@knpkv/rly 0.4.0 → 0.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (36) hide show
  1. package/README.md +31 -2
  2. package/dist/Dialog-DSwimdwG.js +955 -0
  3. package/dist/Dialog-DSwimdwG.js.map +1 -0
  4. package/dist/{PortalProvider-BpgZwSpw.js → PortalProvider-CN_81Fy3.js} +2 -2
  5. package/dist/{PortalProvider-BpgZwSpw.js.map → PortalProvider-CN_81Fy3.js.map} +1 -1
  6. package/dist/assets/worker-D8fZ3h-U.js.map +1 -1
  7. package/dist/components.css +1 -1
  8. package/dist/diff/bounded/index.js +6 -6
  9. package/dist/diff/bounded/index.js.map +1 -1
  10. package/dist/diff/index.js +479 -467
  11. package/dist/diff/index.js.map +1 -1
  12. package/dist/dts/foundations/PortalProvider.d.ts +1 -0
  13. package/dist/dts/foundations/PortalProvider.d.ts.map +1 -1
  14. package/dist/dts/internal/modal.d.ts +4 -0
  15. package/dist/dts/internal/modal.d.ts.map +1 -1
  16. package/dist/dts/patterns/RelayDock.d.ts +75 -0
  17. package/dist/dts/patterns/RelayDock.d.ts.map +1 -0
  18. package/dist/dts/patterns/index.d.ts +2 -0
  19. package/dist/dts/patterns/index.d.ts.map +1 -1
  20. package/dist/foundations/index.js +2 -2
  21. package/dist/index.js +6 -6
  22. package/dist/patterns/index.js +2 -2
  23. package/dist/patterns-DB9mAzxZ.js +3138 -0
  24. package/dist/patterns-DB9mAzxZ.js.map +1 -0
  25. package/dist/primitives/index.js +3 -3
  26. package/dist/primitives-DYGtIZqB.js +342 -0
  27. package/dist/primitives-DYGtIZqB.js.map +1 -0
  28. package/package.json +1 -1
  29. package/registry/components.json +111 -0
  30. package/registry/search.json +36 -0
  31. package/dist/Dialog-1WvU8GjA.js +0 -715
  32. package/dist/Dialog-1WvU8GjA.js.map +0 -1
  33. package/dist/patterns-CxMz8DKX.js +0 -2792
  34. package/dist/patterns-CxMz8DKX.js.map +0 -1
  35. package/dist/primitives-CW89TsFB.js +0 -543
  36. package/dist/primitives-CW89TsFB.js.map +0 -1
@@ -1 +0,0 @@
1
- {"version":3,"file":"Dialog-1WvU8GjA.js","names":[],"sources":["../src/internal/modal.ts","../src/primitives/Sheet.module.css","../src/primitives/Sheet.tsx","../src/primitives/Button.module.css","../src/primitives/Button.tsx","../src/primitives/StateLabel.module.css","../src/primitives/StateLabel.tsx","../src/primitives/Avatar.module.css","../src/primitives/Avatar.tsx","../src/primitives/Skeleton.module.css","../src/primitives/Skeleton.tsx","../src/primitives/StatePanel.module.css","../src/primitives/StatePanel.tsx","../src/primitives/Dialog.module.css","../src/primitives/Dialog.tsx"],"sourcesContent":["import {\n createContext,\n createElement,\n type ReactElement,\n type ReactNode,\n type RefObject,\n useContext,\n useLayoutEffect,\n useRef,\n useState\n} from \"react\"\nimport * as Predicate from \"./predicates.js\"\n\ninterface InertRecord {\n count: number\n readonly previous: boolean\n}\n\ninterface ModalNestingState {\n readonly isContentMounted: boolean\n readonly setContentMounted: (isMounted: boolean) => void\n}\n\ninterface ModalNestingBoundaryProps {\n readonly children: ReactNode\n}\n\nconst inertRecords = new WeakMap<HTMLElement, InertRecord>()\nconst ModalNestingContext = createContext<ModalNestingState | null>(null)\nlet focusTransitionGeneration = 0\n\n/** Entry-motion ownership sampled once for each closed-to-open modal cycle. */\nexport type ModalEntryMotion = \"external\" | \"intrinsic\"\n\n/** Keep entry ownership stable while a modal is open, then resample it for the next open cycle. */\nexport const useModalEntryMotion = (open: boolean, requested: ModalEntryMotion): ModalEntryMotion => {\n const committedCycleRef = useRef({ open, value: requested })\n const resolved = open && !committedCycleRef.current.open ? requested : committedCycleRef.current.value\n useLayoutEffect(() => {\n if (!open) committedCycleRef.current = { open: false, value: requested }\n else if (!committedCycleRef.current.open) committedCycleRef.current = { open: true, value: requested }\n }, [open, requested])\n return resolved\n}\n\n/** Narrows DOM elements through the HTML-only inert contract without relying on a realm-specific constructor. */\nexport const isHTMLElement = (element: Element | null): element is HTMLElement =>\n element !== null && \"inert\" in element && Predicate.isBoolean(element.inert)\n\n/** Stages nested default-open or controlled overlays until their parent content is mounted. */\nexport const ModalNestingBoundary = ({ children }: ModalNestingBoundaryProps): ReactElement => {\n const [isContentMounted, setContentMounted] = useState(false)\n return createElement(ModalNestingContext.Provider, { value: { isContentMounted, setContentMounted } }, children)\n}\n\n/** Reports whether a logical parent modal is ready to host a nested overlay. */\nexport const useParentModalReady = (): boolean => useContext(ModalNestingContext)?.isContentMounted ?? true\n\n/** Registers the current portal content so deeper overlays mount in logical stack order. */\nexport const useModalContentRegistration = (): void => {\n const setContentMounted = useContext(ModalNestingContext)?.setContentMounted\n useLayoutEffect(() => {\n setContentMounted?.(true)\n return () => setContentMounted?.(false)\n }, [setContentMounted])\n}\n\nconst retainInert = (element: HTMLElement): void => {\n const record = inertRecords.get(element)\n if (record === undefined) {\n inertRecords.set(element, { count: 1, previous: element.inert })\n element.inert = true\n return\n }\n record.count += 1\n}\n\nconst releaseInert = (element: HTMLElement): void => {\n const record = inertRecords.get(element)\n if (record === undefined) return\n if (record.count > 1) {\n record.count -= 1\n return\n }\n element.inert = record.previous\n inertRecords.delete(element)\n}\n\n/** Shares reference-counted background isolation across every rly modal primitive. */\nexport const useModalIsolation = (layerRef: RefObject<HTMLDivElement | null>, isOpen: boolean): void => {\n useLayoutEffect(() => {\n if (!isOpen) return\n const layer = layerRef.current\n if (layer === null) return\n let current: HTMLElement = layer\n const retained: Array<HTMLElement> = []\n\n while (true) {\n if (current === current.ownerDocument.body) break\n const parent = current.parentElement\n if (parent === null) break\n let hasReachedCurrent = false\n for (const sibling of parent.children) {\n if (sibling === current) {\n hasReachedCurrent = true\n continue\n }\n const isLaterModalLayer = hasReachedCurrent && sibling.hasAttribute(\"data-rly-modal-layer\")\n if (!isLaterModalLayer && isHTMLElement(sibling)) {\n retainInert(sibling)\n retained.push(sibling)\n }\n }\n current = parent\n }\n\n return () => {\n for (const element of retained) releaseInert(element)\n }\n }, [isOpen, layerRef])\n}\n\n/** Invalidates an older deferred restoration whenever a newer modal transition starts. */\nexport const invalidateModalFocusRestore = (): void => {\n focusTransitionGeneration += 1\n}\n\n/** Restores focus only after modal cleanup and only while this remains the newest transition. */\nexport const restoreModalFocusAfterCleanup = (target: HTMLElement | null): void => {\n const generation = ++focusTransitionGeneration\n setTimeout(() => {\n if (focusTransitionGeneration === generation && target?.isConnected) target.focus()\n }, 0)\n}\n","@layer rly.components {\n .layer {\n inset: var(--rly-space-0);\n isolation: isolate;\n pointer-events: none;\n position: fixed;\n z-index: 100;\n }\n\n .trigger,\n .close,\n .iconClose {\n align-items: center;\n appearance: none;\n background: var(--rly-color-surface-1);\n border: 1px solid var(--rly-color-border-2);\n color: var(--rly-color-text-1);\n cursor: pointer;\n display: inline-flex;\n font: var(--rly-type-label-weight) var(--rly-type-label-size) / var(--rly-type-label-line-height)\n var(--rly-type-label-font);\n justify-content: center;\n }\n\n .trigger,\n .close {\n border-radius: var(--rly-radius-field);\n min-block-size: var(--rly-space-40);\n padding: var(--rly-space-8) var(--rly-space-16);\n }\n\n .trigger:hover,\n .close:hover,\n .iconClose:hover {\n background: var(--rly-color-surface-2);\n }\n\n .trigger:active,\n .close:active,\n .iconClose:active {\n background: var(--rly-color-surface-3);\n }\n\n .trigger:disabled,\n .close:disabled,\n .iconClose:disabled {\n cursor: not-allowed;\n opacity: 0.58;\n }\n\n .overlay {\n animation: rly-sheet-overlay-out var(--rly-motion-standard-duration) var(--rly-motion-standard-easing);\n background: var(--rly-color-text-1);\n inset: var(--rly-space-0);\n opacity: 0.3;\n position: fixed;\n pointer-events: auto;\n z-index: 0;\n }\n\n .overlay[data-state=\"open\"] {\n animation-name: rly-sheet-overlay-in;\n }\n\n .content {\n background: var(--rly-color-surface-1);\n block-size: 100vh;\n block-size: 100dvh;\n color: var(--rly-color-text-1);\n display: flex;\n flex-direction: column;\n inset-block: var(--rly-space-0);\n max-inline-size: min(92vw, 30rem);\n overflow: hidden;\n pointer-events: auto;\n position: fixed;\n z-index: 1;\n }\n\n .end {\n animation: rly-sheet-end-out var(--rly-motion-standard-duration) var(--rly-motion-standard-easing);\n border-inline-start: 1px solid var(--rly-color-border-1);\n border-start-start-radius: var(--rly-radius-overlay);\n border-end-start-radius: var(--rly-radius-overlay);\n inset-inline-end: var(--rly-space-0);\n }\n\n .end[data-state=\"open\"] {\n animation-name: rly-sheet-end-in;\n }\n\n .start {\n animation: rly-sheet-start-out var(--rly-motion-standard-duration) var(--rly-motion-standard-easing);\n border-inline-end: 1px solid var(--rly-color-border-1);\n border-start-end-radius: var(--rly-radius-overlay);\n border-end-end-radius: var(--rly-radius-overlay);\n inset-inline-start: var(--rly-space-0);\n }\n\n .start[data-state=\"open\"] {\n animation-name: rly-sheet-start-in;\n }\n\n .layer[data-rly-sheet-entry-motion=\"external\"] .overlay[data-state=\"open\"],\n .layer[data-rly-sheet-entry-motion=\"external\"] .content[data-state=\"open\"] {\n animation: none;\n }\n\n .header {\n align-items: flex-start;\n border-block-end: 1px solid var(--rly-color-border-1);\n display: flex;\n flex: none;\n gap: var(--rly-space-16);\n justify-content: space-between;\n padding: var(--rly-space-20) var(--rly-space-24);\n }\n\n .heading {\n display: grid;\n gap: var(--rly-space-6);\n min-inline-size: var(--rly-space-0);\n }\n\n .title {\n font: var(--rly-type-card-title-weight) var(--rly-type-card-title-size) / var(--rly-type-card-title-line-height)\n var(--rly-type-card-title-font);\n letter-spacing: var(--rly-type-card-title-tracking);\n margin: var(--rly-space-0);\n overflow-wrap: anywhere;\n }\n\n .description {\n color: var(--rly-color-text-2);\n font: var(--rly-type-body-weight) var(--rly-type-body-size) / var(--rly-type-body-line-height)\n var(--rly-type-body-font);\n margin: var(--rly-space-0);\n overflow-wrap: anywhere;\n }\n\n .iconClose {\n border-radius: var(--rly-radius-field);\n flex: none;\n min-block-size: var(--rly-space-40);\n min-inline-size: var(--rly-space-40);\n padding: var(--rly-space-8);\n }\n\n .body {\n flex: 1 1 auto;\n min-block-size: var(--rly-space-0);\n min-inline-size: var(--rly-space-0);\n overflow: auto;\n overscroll-behavior: contain;\n padding: var(--rly-space-24);\n }\n\n .footer {\n align-items: center;\n border-block-start: 1px solid var(--rly-color-border-1);\n display: flex;\n flex: none;\n flex-wrap: wrap;\n gap: var(--rly-space-12);\n justify-content: flex-end;\n padding: var(--rly-space-16) var(--rly-space-24);\n }\n\n @media (max-width: 40rem) {\n .content {\n border: 0;\n border-radius: var(--rly-space-0);\n inline-size: 100vw;\n max-inline-size: none;\n }\n\n .header,\n .body {\n padding-inline: var(--rly-space-16);\n }\n\n .footer {\n padding: var(--rly-space-12) var(--rly-space-16);\n }\n }\n}\n\n@keyframes rly-sheet-overlay-in {\n from {\n opacity: 0;\n }\n\n to {\n opacity: 0.3;\n }\n}\n\n@keyframes rly-sheet-overlay-out {\n from {\n opacity: 0.3;\n }\n\n to {\n opacity: 0;\n }\n}\n\n@keyframes rly-sheet-end-in {\n from {\n transform: translateX(100%);\n }\n\n to {\n transform: translateX(0);\n }\n}\n\n@keyframes rly-sheet-end-out {\n from {\n transform: translateX(0);\n }\n\n to {\n transform: translateX(100%);\n }\n}\n\n@keyframes rly-sheet-start-in {\n from {\n transform: translateX(-100%);\n }\n\n to {\n transform: translateX(0);\n }\n}\n\n@keyframes rly-sheet-start-out {\n from {\n transform: translateX(0);\n }\n\n to {\n transform: translateX(-100%);\n }\n}\n","import { Dialog as RadixDialog } from \"radix-ui\"\nimport {\n type ComponentPropsWithRef,\n createContext,\n type ReactElement,\n type ReactNode,\n type RefObject,\n useCallback,\n useContext,\n useLayoutEffect,\n useRef,\n useState\n} from \"react\"\nimport { Icon } from \"../foundations/Icon.js\"\nimport { PortalBoundary } from \"../foundations/PortalProvider.js\"\nimport { classNames, cssClass, defineVariants, requireText } from \"../internal/component.js\"\nimport {\n invalidateModalFocusRestore,\n isHTMLElement,\n ModalNestingBoundary,\n restoreModalFocusAfterCleanup,\n useModalContentRegistration,\n useModalEntryMotion,\n useModalIsolation,\n useParentModalReady\n} from \"../internal/modal.js\"\nimport styles from \"./Sheet.module.css\"\nimport * as Predicate from \"../internal/predicates.js\"\n\nconst style = (name: string): string => cssClass(styles, name)\n\n/** Semantic logical-side metadata for the sheet surface. */\nexport const RLY_SHEET_VARIANTS = defineVariants({\n side: {\n end: {\n className: style(\"end\"),\n purpose: \"Supporting detail that follows the current reading flow\",\n tokens: [\"color-surface-1\", \"radius-overlay\", \"motion-standard\"]\n },\n start: {\n className: style(\"start\"),\n purpose: \"Navigation or context that precedes the current reading flow\",\n tokens: [\"color-surface-1\", \"radius-overlay\", \"motion-standard\"]\n }\n }\n})\n\n/** Default logical edge used when no sheet side is selected. */\nexport const RLY_SHEET_DEFAULT_VARIANTS = defineVariants({ side: \"end\" })\n/** Logical inline edges supported by a sheet. */\nexport type RlySheetSide = keyof typeof RLY_SHEET_VARIANTS.side\n\ninterface SheetRootBaseProps {\n readonly children: ReactNode\n}\n\ntype ControlledSheetRootProps = SheetRootBaseProps & {\n readonly defaultOpen?: never\n readonly onOpenChange: (open: boolean) => void\n readonly open: boolean\n}\n\ntype DefaultSheetRootProps = SheetRootBaseProps & {\n readonly defaultOpen?: boolean\n readonly onOpenChange?: (open: boolean) => void\n readonly open?: never\n}\n\n/** Controlled-first or locally owned state for a sheet tree. */\nexport type SheetRootProps = ControlledSheetRootProps | DefaultSheetRootProps\n\n/** Props for the visible native button that opens a sheet. */\nexport type SheetTriggerProps = Omit<ComponentPropsWithRef<\"button\">, \"children\"> & {\n /** Visible text that identifies the panel being opened. */\n readonly children: number | string\n}\n\n/** Props for a visible native button that closes a sheet. */\nexport type SheetCloseProps = Omit<ComponentPropsWithRef<\"button\">, \"children\"> & {\n /** Visible text that identifies the close action. */\n readonly children: number | string\n}\n\n/** Accessible content, naming, focus, and logical placement for a sheet surface. */\nexport type SheetContentProps = Omit<\n ComponentPropsWithRef<\"div\">,\n \"aria-label\" | \"aria-labelledby\" | \"children\" | \"title\"\n> & {\n readonly children: ReactNode\n /** Accessible text for the built-in icon close action. */\n readonly closeLabel?: string\n /** Optional visible supporting description announced with the title. */\n readonly description?: string\n /**\n * Defaults to intrinsic and is sampled when the sheet opens. While open, changes apply to the next cycle.\n * External suppresses surface and overlay entry only; exit stays intrinsic and shared reduced-motion rules apply.\n */\n readonly entryMotion?: \"external\" | \"intrinsic\"\n /** Optional target for deterministic initial focus. Content receives focus by default. */\n readonly initialFocusRef?: RefObject<HTMLElement | null>\n readonly side?: RlySheetSide\n /** Required visible heading and accessible name for the sheet. */\n readonly title: string\n}\n\n/** Props for the independently scrolling sheet body. */\nexport type SheetBodyProps = ComponentPropsWithRef<\"div\">\n/** Props for the persistent sheet action footer. */\nexport type SheetFooterProps = ComponentPropsWithRef<\"footer\">\n\ninterface SheetState {\n readonly open: boolean\n readonly requestOpenChange: (open: boolean) => void\n readonly restoreFocusRef: RefObject<HTMLElement | null>\n}\n\nconst SheetStateContext = createContext<SheetState | null>(null)\n\nconst useSheetState = (): SheetState => {\n const state = useContext(SheetStateContext)\n if (state === null) throw new Error(\"Sheet compound components must be nested inside Sheet.Root\")\n return state\n}\n\nconst SheetLayer = ({\n children,\n entryMotion\n}: {\n readonly children: ReactNode\n readonly entryMotion: \"external\" | \"intrinsic\"\n}): ReactElement => {\n const state = useSheetState()\n const layerRef = useRef<HTMLDivElement>(null)\n useModalContentRegistration()\n useModalIsolation(layerRef, state.open)\n return (\n <div\n className={style(\"layer\")}\n data-rly-modal-layer=\"\"\n data-rly-sheet-entry-motion={entryMotion}\n data-rly-sheet-layer=\"\"\n ref={layerRef}\n >\n {children}\n </div>\n )\n}\n\nconst requireVisibleAction = (value: number | string, component: string): number | string => {\n if (Predicate.isString(value)) requireText(value, `${component} children`)\n return value\n}\n\nconst SheetRoot = (componentProps: SheetRootProps): ReactElement => {\n const { children, defaultOpen = false, onOpenChange, open } = componentProps\n const [defaultState, setDefaultState] = useState(defaultOpen)\n const isParentModalReady = useParentModalReady()\n const restoreFocusRef = useRef<HTMLElement | null>(null)\n const resolvedOpen = (open ?? defaultState) && isParentModalReady\n const previousOpenRef = useRef(resolvedOpen)\n const requestOpenChange = (nextOpen: boolean): void => {\n if (open === undefined) setDefaultState(nextOpen)\n onOpenChange?.(nextOpen)\n }\n\n useLayoutEffect(() => {\n if (previousOpenRef.current === resolvedOpen) return\n previousOpenRef.current = resolvedOpen\n if (resolvedOpen) invalidateModalFocusRestore()\n else restoreModalFocusAfterCleanup(restoreFocusRef.current)\n }, [resolvedOpen])\n\n return (\n <ModalNestingBoundary>\n <SheetStateContext.Provider value={{ open: resolvedOpen, requestOpenChange, restoreFocusRef }}>\n <RadixDialog.Root modal onOpenChange={requestOpenChange} open={resolvedOpen}>\n {children}\n </RadixDialog.Root>\n </SheetStateContext.Provider>\n </ModalNestingBoundary>\n )\n}\n\nconst SheetTrigger = ({ children, className, onClick, type, ...props }: SheetTriggerProps): ReactElement => {\n const state = useSheetState()\n return (\n <RadixDialog.Trigger\n {...props}\n className={classNames(style(\"trigger\"), className)}\n onClick={(event) => {\n state.restoreFocusRef.current = event.currentTarget\n onClick?.(event)\n }}\n type={type ?? \"button\"}\n >\n {requireVisibleAction(children, \"Sheet.Trigger\")}\n </RadixDialog.Trigger>\n )\n}\n\nconst SheetClose = ({ children, className, type, ...props }: SheetCloseProps): ReactElement => (\n <RadixDialog.Close {...props} className={classNames(style(\"close\"), className)} type={type ?? \"button\"}>\n {requireVisibleAction(children, \"Sheet.Close\")}\n </RadixDialog.Close>\n)\n\nconst SheetBody = ({ className, ...props }: SheetBodyProps): ReactElement => (\n <div {...props} className={classNames(style(\"body\"), className)} />\n)\n\nconst SheetFooter = ({ className, ...props }: SheetFooterProps): ReactElement => (\n <footer {...props} className={classNames(style(\"footer\"), className)} />\n)\n\nconst SheetContent = ({\n children,\n className,\n closeLabel,\n description,\n entryMotion = \"intrinsic\",\n initialFocusRef,\n ref,\n side = RLY_SHEET_DEFAULT_VARIANTS.side,\n tabIndex,\n title,\n ...props\n}: SheetContentProps): ReactElement => {\n const state = useSheetState()\n const resolvedEntryMotion = useModalEntryMotion(state.open, entryMotion)\n const visibleTitle = requireText(title, \"Sheet title\")\n const visibleDescription = description === undefined ? undefined : requireText(description, \"Sheet description\")\n const accessibleCloseLabel = requireText(closeLabel ?? `Close ${visibleTitle}`, \"Sheet closeLabel\")\n const contentRef = useRef<HTMLDivElement | null>(null)\n const setContentRef = useCallback(\n (node: HTMLDivElement | null): void => {\n contentRef.current = node\n if (Predicate.isFunction(ref)) ref(node)\n else if (ref !== null && ref !== undefined) ref.current = node\n },\n [ref]\n )\n\n return (\n <PortalBoundary>\n {(container) => (\n <RadixDialog.Portal container={container}>\n <SheetLayer entryMotion={resolvedEntryMotion}>\n <RadixDialog.Overlay\n className={style(\"overlay\")}\n data-rly-sheet-overlay=\"\"\n onPointerDown={() => state.requestOpenChange(false)}\n />\n <RadixDialog.Content\n {...props}\n {...(visibleDescription === undefined ? { \"aria-describedby\": undefined } : {})}\n className={classNames(style(\"content\"), RLY_SHEET_VARIANTS.side[side].className, className)}\n data-rly-sheet-side={side}\n onCloseAutoFocus={(event) => event.preventDefault()}\n onOpenAutoFocus={(event) => {\n event.preventDefault()\n const activeElement = contentRef.current?.ownerDocument.activeElement ?? null\n if (state.restoreFocusRef.current === null && isHTMLElement(activeElement)) {\n state.restoreFocusRef.current = activeElement\n }\n const target = initialFocusRef?.current ?? contentRef.current\n target?.focus()\n if (target !== contentRef.current && target?.ownerDocument.activeElement !== target)\n contentRef.current?.focus()\n }}\n ref={setContentRef}\n tabIndex={tabIndex ?? -1}\n >\n <div className={style(\"header\")}>\n <div className={style(\"heading\")}>\n <RadixDialog.Title className={style(\"title\")}>{visibleTitle}</RadixDialog.Title>\n {visibleDescription === undefined ? null : (\n <RadixDialog.Description className={style(\"description\")}>\n {visibleDescription}\n </RadixDialog.Description>\n )}\n </div>\n <RadixDialog.Close aria-label={accessibleCloseLabel} className={style(\"iconClose\")} type=\"button\">\n <Icon decorative name=\"close\" size=\"default\" />\n </RadixDialog.Close>\n </div>\n {children}\n </RadixDialog.Content>\n </SheetLayer>\n </RadixDialog.Portal>\n )}\n </PortalBoundary>\n )\n}\n\n/** Owned compound side panel with modal focus, dismissal, and portal behavior. */\nexport const Sheet = Object.freeze({\n Body: SheetBody,\n Close: SheetClose,\n Content: SheetContent,\n Footer: SheetFooter,\n Root: SheetRoot,\n Trigger: SheetTrigger\n})\n","@layer rly.components {\n .root {\n align-items: center;\n appearance: none;\n border: 1px solid var(--rly-color-border-2);\n border-radius: var(--rly-radius-control);\n box-sizing: border-box;\n cursor: pointer;\n display: inline-grid;\n font: var(--rly-type-label-weight) var(--rly-type-label-size) / var(--rly-type-label-line-height)\n var(--rly-type-label-font);\n justify-items: center;\n letter-spacing: var(--rly-type-label-tracking);\n max-inline-size: 100%;\n padding-inline: var(--rly-space-16);\n position: relative;\n text-align: center;\n }\n\n .root:disabled {\n cursor: not-allowed;\n opacity: 0.58;\n }\n .primary {\n background: var(--rly-color-action-background);\n border-color: var(--rly-color-action-background);\n color: var(--rly-color-action-foreground);\n }\n .secondary {\n background: var(--rly-color-surface-1);\n color: var(--rly-color-text-1);\n }\n .quiet {\n background: var(--rly-color-surface-2);\n border-color: var(--rly-color-surface-2);\n color: var(--rly-color-text-1);\n }\n .compact {\n min-block-size: var(--rly-space-40);\n }\n .defaultSize {\n min-block-size: var(--rly-space-48);\n }\n .principal {\n min-block-size: calc(var(--rly-space-48) + var(--rly-space-8));\n padding-inline: var(--rly-space-24);\n }\n .stretch {\n inline-size: 100%;\n }\n\n .content {\n align-items: center;\n display: inline-flex;\n gap: var(--rly-space-8);\n justify-content: center;\n min-inline-size: var(--rly-space-0);\n padding-block: var(--rly-space-8);\n }\n\n .label {\n min-inline-size: var(--rly-space-0);\n overflow-wrap: anywhere;\n }\n .loadingContent {\n opacity: 0;\n }\n .loader {\n display: grid;\n inset: var(--rly-space-0);\n place-items: center;\n position: absolute;\n }\n\n @media (hover: hover) {\n .root:not(:disabled):hover {\n border-color: var(--rly-color-text-2);\n }\n .primary:not(:disabled):hover {\n background: var(--rly-color-text-2);\n }\n }\n}\n","import type { ComponentPropsWithRef, ReactElement } from \"react\"\nimport { Icon, type RlyIconName } from \"../foundations/Icon.js\"\nimport { classNames, cssClass, defineVariants } from \"../internal/component.js\"\nimport styles from \"./Button.module.css\"\nimport * as Predicate from \"../internal/predicates.js\"\n\nconst style = (name: string): string => cssClass(styles, name)\nexport const RLY_BUTTON_VARIANTS = defineVariants({\n variant: {\n primary: {\n className: style(\"primary\"),\n purpose: \"Single principal action\",\n tokens: [\"color-action-background\", \"color-action-foreground\"]\n },\n secondary: {\n className: style(\"secondary\"),\n purpose: \"Default supporting action\",\n tokens: [\"color-surface-1\", \"color-border-2\"]\n },\n quiet: {\n className: style(\"quiet\"),\n purpose: \"Low-emphasis contextual action\",\n tokens: [\"color-text-1\", \"color-surface-2\"]\n }\n },\n size: {\n compact: { className: style(\"compact\"), purpose: \"Dense text action\", tokens: [\"space-40\"] },\n default: { className: style(\"defaultSize\"), purpose: \"Standard action\", tokens: [\"space-48\"] },\n principal: {\n className: style(\"principal\"),\n purpose: \"Prominent consequential action\",\n tokens: [\"space-48\", \"space-8\"]\n }\n }\n})\nexport const RLY_BUTTON_DEFAULT_VARIANTS = defineVariants({ variant: \"secondary\", size: \"default\" })\nexport type RlyButtonVariant = keyof typeof RLY_BUTTON_VARIANTS.variant\nexport type RlyButtonSize = keyof typeof RLY_BUTTON_VARIANTS.size\nexport type ButtonProps = Omit<ComponentPropsWithRef<\"button\">, \"children\"> & {\n /** Plain visible text. Use IconButton for an icon-only action. */\n readonly children: number | string\n readonly leadingIcon?: RlyIconName\n readonly loading?: boolean\n readonly size?: RlyButtonSize\n readonly stretch?: boolean\n readonly trailingIcon?: RlyIconName\n readonly variant?: RlyButtonVariant\n}\n\n/** Render a visible-text action with stable disabled and loading geometry. */\nexport const Button = ({\n \"aria-label\": ariaLabel,\n \"aria-labelledby\": ariaLabelledBy,\n children,\n className,\n disabled,\n leadingIcon,\n loading = false,\n size = \"default\",\n stretch = false,\n trailingIcon,\n type,\n variant = \"secondary\",\n ...props\n}: ButtonProps): ReactElement => {\n if (\n (!Predicate.isNumber(children) && !Predicate.isString(children)) ||\n (Predicate.isString(children) && children.trim().length === 0)\n ) {\n throw new Error(\"Button children must contain visible content\")\n }\n return (\n <button\n {...props}\n aria-busy={loading ? \"true\" : undefined}\n aria-label={loading && !ariaLabelledBy?.trim() ? (ariaLabel?.trim() ? ariaLabel : String(children)) : ariaLabel}\n aria-labelledby={ariaLabelledBy}\n className={classNames(\n style(\"root\"),\n RLY_BUTTON_VARIANTS.variant[variant].className,\n RLY_BUTTON_VARIANTS.size[size].className,\n stretch && style(\"stretch\"),\n className\n )}\n data-loading={loading ? \"true\" : undefined}\n disabled={disabled || loading}\n type={type ?? \"button\"}\n >\n <span className={classNames(style(\"content\"), loading && style(\"loadingContent\"))}>\n {leadingIcon === undefined ? null : (\n <Icon decorative name={leadingIcon} size={size === \"compact\" ? \"small\" : \"default\"} />\n )}\n <span className={style(\"label\")}>{children}</span>\n {trailingIcon === undefined ? null : (\n <Icon decorative name={trailingIcon} size={size === \"compact\" ? \"small\" : \"default\"} />\n )}\n </span>\n {loading ? (\n <span aria-hidden=\"true\" className={style(\"loader\")}>\n <Icon decorative name=\"loader\" size={size === \"compact\" ? \"small\" : \"default\"} />\n </span>\n ) : null}\n </button>\n )\n}\n","@layer rly.components {\n .root {\n align-items: center;\n border: 1px solid currentcolor;\n border-radius: var(--rly-radius-tag);\n display: inline-flex;\n gap: var(--rly-space-6);\n max-inline-size: 100%;\n padding: var(--rly-space-4) var(--rly-space-8);\n overflow-wrap: anywhere;\n }\n\n .neutral {\n background: var(--rly-color-surface-2);\n color: var(--rly-color-text-2);\n }\n .positive {\n background: var(--rly-color-success-tint);\n color: var(--rly-color-success-ink);\n }\n .critical {\n background: var(--rly-color-blocked-tint);\n color: var(--rly-color-blocked-ink);\n }\n .caution {\n background: var(--rly-color-held-tint);\n color: var(--rly-color-held-ink);\n }\n .progress {\n background: var(--rly-color-deploying-tint);\n color: var(--rly-color-deploying-ink);\n }\n .compact {\n font: var(--rly-type-meta-weight) var(--rly-type-meta-size) / var(--rly-type-meta-line-height)\n var(--rly-type-meta-font);\n }\n .defaultSize {\n font: var(--rly-type-label-weight) var(--rly-type-label-size) / var(--rly-type-label-line-height)\n var(--rly-type-label-font);\n }\n}\n","import type { ComponentPropsWithRef, ReactElement } from \"react\"\nimport { Icon, type RlyIconName } from \"../foundations/Icon.js\"\nimport { classNames, cssClass, defineVariants, requireText } from \"../internal/component.js\"\nimport styles from \"./StateLabel.module.css\"\n\nconst style = (name: string): string => cssClass(styles, name)\nexport type RlyStateTone = \"neutral\" | \"positive\" | \"critical\" | \"caution\" | \"progress\"\nexport const RLY_STATE_LABEL_VARIANTS = defineVariants({\n tone: {\n neutral: {\n className: style(\"neutral\"),\n purpose: \"Neutral or unavailable state\",\n tokens: [\"color-text-2\", \"color-surface-2\"]\n },\n positive: {\n className: style(\"positive\"),\n purpose: \"Positive state\",\n tokens: [\"color-success-ink\", \"color-success-tint\"]\n },\n critical: {\n className: style(\"critical\"),\n purpose: \"Critical state\",\n tokens: [\"color-blocked-ink\", \"color-blocked-tint\"]\n },\n caution: { className: style(\"caution\"), purpose: \"Caution state\", tokens: [\"color-held-ink\", \"color-held-tint\"] },\n progress: {\n className: style(\"progress\"),\n purpose: \"Work in progress\",\n tokens: [\"color-deploying-ink\", \"color-deploying-tint\"]\n }\n },\n size: {\n compact: { className: style(\"compact\"), purpose: \"Dense metadata state\", tokens: [\"type-meta\"] },\n default: { className: style(\"defaultSize\"), purpose: \"Standard explicit state\", tokens: [\"type-label\"] }\n }\n})\nexport const RLY_STATE_LABEL_DEFAULT_VARIANTS = defineVariants({ tone: \"neutral\", size: \"default\" })\nexport type RlyStateLabelSize = keyof typeof RLY_STATE_LABEL_VARIANTS.size\nconst toneIcons = {\n neutral: \"minus\",\n positive: \"check\",\n critical: \"alert\",\n caution: \"clock\",\n progress: \"loader\"\n} satisfies Readonly<Record<RlyStateTone, RlyIconName>>\nexport type StateLabelProps = Omit<ComponentPropsWithRef<\"span\">, \"children\"> & {\n readonly icon?: RlyIconName\n readonly label: string\n readonly size?: RlyStateLabelSize\n readonly tone?: RlyStateTone\n}\n\n/** Render state through a visible word, icon, ink, and restrained tint. */\nexport const StateLabel = ({\n className,\n icon,\n label,\n size = \"default\",\n tone = \"neutral\",\n ...props\n}: StateLabelProps): ReactElement => (\n <span\n {...props}\n className={classNames(\n style(\"root\"),\n RLY_STATE_LABEL_VARIANTS.tone[tone].className,\n RLY_STATE_LABEL_VARIANTS.size[size].className,\n className\n )}\n >\n <Icon decorative name={icon ?? toneIcons[tone]} size=\"small\" />\n <span>{requireText(label, \"StateLabel label\")}</span>\n </span>\n)\n","@layer rly.components {\n .root {\n align-items: center;\n background: var(--rly-color-surface-2);\n box-sizing: border-box;\n color: var(--rly-color-text-2);\n display: inline-flex;\n flex: none;\n justify-content: center;\n overflow: hidden;\n }\n\n .small {\n block-size: var(--rly-space-24);\n inline-size: var(--rly-space-24);\n }\n .defaultSize {\n block-size: var(--rly-space-32);\n inline-size: var(--rly-space-32);\n }\n .large {\n block-size: var(--rly-space-40);\n inline-size: var(--rly-space-40);\n }\n .hero {\n block-size: calc(var(--rly-space-48) + var(--rly-space-8));\n inline-size: calc(var(--rly-space-48) + var(--rly-space-8));\n }\n .circle {\n border-radius: var(--rly-radius-round);\n }\n .roundedSquare {\n border-radius: var(--rly-radius-field);\n }\n .image {\n block-size: 100%;\n inline-size: 100%;\n object-fit: cover;\n }\n\n .fallback {\n align-items: center;\n block-size: 100%;\n display: flex;\n font: var(--rly-type-meta-weight) var(--rly-type-meta-size) / var(--rly-type-meta-line-height)\n var(--rly-type-meta-font);\n inline-size: 100%;\n justify-content: center;\n overflow: hidden;\n text-transform: uppercase;\n }\n}\n","import type { ComponentPropsWithRef, ReactElement } from \"react\"\nimport { Avatar as RadixAvatar } from \"radix-ui\"\nimport { classNames, cssClass, defineVariants, requireText } from \"../internal/component.js\"\nimport styles from \"./Avatar.module.css\"\n\nconst style = (name: string): string => cssClass(styles, name)\nexport const RLY_AVATAR_VARIANTS = defineVariants({\n size: {\n small: { className: style(\"small\"), purpose: \"Compact supporting identity\", tokens: [\"space-24\"] },\n default: { className: style(\"defaultSize\"), purpose: \"Standard identity\", tokens: [\"space-32\"] },\n large: { className: style(\"large\"), purpose: \"Prominent identity\", tokens: [\"space-40\"] },\n hero: { className: style(\"hero\"), purpose: \"Page-level identity\", tokens: [\"space-48\", \"space-8\"] }\n },\n form: {\n circle: { className: style(\"circle\"), purpose: \"Human or general identity\", tokens: [\"radius-round\"] },\n \"rounded-square\": {\n className: style(\"roundedSquare\"),\n purpose: \"Non-human or system identity\",\n tokens: [\"radius-field\"]\n }\n }\n})\nexport const RLY_AVATAR_DEFAULT_VARIANTS = defineVariants({ size: \"default\", form: \"circle\" })\nexport type RlyAvatarSize = keyof typeof RLY_AVATAR_VARIANTS.size\nexport type RlyAvatarForm = keyof typeof RLY_AVATAR_VARIANTS.form\ntype AvatarBaseProps = Omit<ComponentPropsWithRef<\"span\">, \"aria-label\" | \"children\"> & {\n readonly fallback: string\n readonly form?: RlyAvatarForm\n readonly size?: RlyAvatarSize\n readonly src?: string\n}\nexport type AvatarProps = AvatarBaseProps &\n ({ readonly decorative: true; readonly label?: never } | { readonly decorative?: false; readonly label: string })\n\n/** Render a fixed-geometry image with deterministic fallback and owned accessible name. */\nexport const Avatar = ({\n className,\n decorative,\n fallback,\n form = \"circle\",\n label,\n size = \"default\",\n src,\n ...props\n}: AvatarProps): ReactElement => {\n const accessibleLabel = decorative ? undefined : requireText(label, \"Avatar label\")\n const visibleFallback = requireText(fallback, \"Avatar fallback\")\n return (\n <RadixAvatar.Root\n {...props}\n aria-hidden={decorative ? \"true\" : undefined}\n aria-label={accessibleLabel}\n className={classNames(\n style(\"root\"),\n RLY_AVATAR_VARIANTS.size[size].className,\n RLY_AVATAR_VARIANTS.form[form].className,\n className\n )}\n role={decorative ? undefined : \"img\"}\n >\n {src === undefined ? null : (\n <RadixAvatar.Image alt=\"\" className={style(\"image\")} decoding=\"async\" loading=\"lazy\" src={src} />\n )}\n <RadixAvatar.Fallback aria-hidden=\"true\" className={style(\"fallback\")}>\n {visibleFallback}\n </RadixAvatar.Fallback>\n </RadixAvatar.Root>\n )\n}\n","@layer rly.components {\n .root {\n background: var(--rly-color-surface-3);\n border: 1px solid var(--rly-color-border-1);\n box-sizing: border-box;\n max-inline-size: 100%;\n }\n\n .text {\n block-size: var(--rly-type-body-line-height);\n border-radius: var(--rly-radius-tag);\n inline-size: 100%;\n }\n .block {\n border-radius: var(--rly-radius-control);\n inline-size: 100%;\n min-block-size: var(--rly-space-64);\n }\n .circle {\n aspect-ratio: 1;\n border-radius: var(--rly-radius-round);\n inline-size: var(--rly-space-48);\n }\n}\n","import type { ComponentPropsWithRef, CSSProperties, ReactElement } from \"react\"\nimport { classNames, cssClass, defineVariants, requireText } from \"../internal/component.js\"\nimport styles from \"./Skeleton.module.css\"\n\nconst style = (name: string): string => cssClass(styles, name)\n\nexport const RLY_SKELETON_VARIANTS = defineVariants({\n variant: {\n text: { className: style(\"text\"), purpose: \"A line of unavailable copy\", tokens: [\"type-body\", \"radius-tag\"] },\n block: {\n className: style(\"block\"),\n purpose: \"A rectangular unavailable region\",\n tokens: [\"space-64\", \"radius-control\"]\n },\n circle: { className: style(\"circle\"), purpose: \"A circular unavailable image\", tokens: [\"radius-round\"] }\n }\n})\n\nexport const RLY_SKELETON_DEFAULT_VARIANTS = defineVariants({ variant: \"text\" })\nexport type RlySkeletonVariant = keyof typeof RLY_SKELETON_VARIANTS.variant\n\ntype SkeletonBaseProps = Omit<ComponentPropsWithRef<\"div\">, \"aria-label\" | \"children\" | \"style\"> & {\n readonly height?: CSSProperties[\"blockSize\"]\n readonly style?: CSSProperties\n readonly variant?: RlySkeletonVariant\n readonly width?: CSSProperties[\"inlineSize\"]\n}\nexport type SkeletonProps = SkeletonBaseProps &\n ({ readonly decorative?: true; readonly label?: never } | { readonly decorative: false; readonly label: string })\n\n/** Reserve content geometry without suggesting progress or motion. */\nexport const Skeleton = ({\n className,\n decorative = true,\n height,\n label,\n style: inlineStyle,\n variant = \"text\",\n width,\n ...props\n}: SkeletonProps): ReactElement => {\n if (!decorative && label === undefined) throw new Error(\"Skeleton label must contain visible text\")\n const accessibleLabel = decorative || label === undefined ? undefined : requireText(label, \"Skeleton label\")\n const dimensions: CSSProperties = {\n ...(!(height === undefined) && { blockSize: height }),\n ...(!(width === undefined) && { inlineSize: width })\n }\n\n return (\n <div\n {...props}\n aria-busy={decorative ? undefined : \"true\"}\n aria-hidden={decorative ? \"true\" : undefined}\n aria-label={accessibleLabel}\n className={classNames(style(\"root\"), RLY_SKELETON_VARIANTS.variant[variant].className, className)}\n role={decorative ? \"presentation\" : \"status\"}\n style={{ ...inlineStyle, ...dimensions }}\n />\n )\n}\n","@layer rly.components {\n .root {\n background: var(--rly-color-surface-2);\n border: 1px solid currentcolor;\n border-radius: var(--rly-radius-control);\n box-sizing: border-box;\n color: var(--rly-color-text-2);\n display: grid;\n gap: var(--rly-space-16);\n grid-template-columns: var(--rly-space-4) auto minmax(var(--rly-space-0), 1fr);\n max-inline-size: 100%;\n padding: var(--rly-space-24);\n }\n\n .neutral {\n background: var(--rly-color-surface-2);\n color: var(--rly-color-text-2);\n }\n .positive {\n background: var(--rly-color-success-tint);\n color: var(--rly-color-success-ink);\n }\n .critical {\n background: var(--rly-color-blocked-tint);\n color: var(--rly-color-blocked-ink);\n }\n .caution {\n background: var(--rly-color-held-tint);\n color: var(--rly-color-held-ink);\n }\n .progress {\n background: var(--rly-color-deploying-tint);\n color: var(--rly-color-deploying-ink);\n }\n .rail {\n align-self: stretch;\n background: currentcolor;\n border-radius: var(--rly-radius-round);\n }\n .icon {\n display: inline-flex;\n padding-block-start: var(--rly-space-2);\n }\n .content {\n color: var(--rly-color-text-1);\n display: grid;\n gap: var(--rly-space-8);\n min-inline-size: var(--rly-space-0);\n }\n\n .title {\n color: var(--rly-color-text-2);\n font: var(--rly-type-card-title-weight) var(--rly-type-card-title-size) / var(--rly-type-card-title-line-height)\n var(--rly-type-card-title-font);\n letter-spacing: var(--rly-type-card-title-tracking);\n margin: var(--rly-space-0);\n overflow-wrap: anywhere;\n }\n\n .positive .title {\n color: var(--rly-color-success-ink);\n }\n .critical .title {\n color: var(--rly-color-blocked-ink);\n }\n .caution .title {\n color: var(--rly-color-held-ink);\n }\n .progress .title {\n color: var(--rly-color-deploying-ink);\n }\n\n .description {\n color: var(--rly-color-text-2);\n font: var(--rly-type-body-weight) var(--rly-type-body-size) / var(--rly-type-body-line-height)\n var(--rly-type-body-font);\n overflow-wrap: anywhere;\n }\n .description > :first-child {\n margin-block-start: var(--rly-space-0);\n }\n .description > :last-child {\n margin-block-end: var(--rly-space-0);\n }\n .action {\n align-items: center;\n display: flex;\n flex-wrap: wrap;\n gap: var(--rly-space-8);\n padding-block-start: var(--rly-space-8);\n }\n}\n","import type { ComponentPropsWithRef, ReactElement, ReactNode } from \"react\"\nimport { Icon, type RlyIconName } from \"../foundations/Icon.js\"\nimport { classNames, cssClass, defineVariants, requireText } from \"../internal/component.js\"\nimport styles from \"./StatePanel.module.css\"\n\nconst style = (name: string): string => cssClass(styles, name)\n\nexport const RLY_STATE_PANEL_VARIANTS = defineVariants({\n tone: {\n neutral: {\n className: style(\"neutral\"),\n purpose: \"Neutral explanatory state\",\n tokens: [\"color-text-2\", \"color-surface-2\"]\n },\n positive: {\n className: style(\"positive\"),\n purpose: \"Positive outcome\",\n tokens: [\"color-success-ink\", \"color-success-tint\"]\n },\n critical: {\n className: style(\"critical\"),\n purpose: \"Critical outcome requiring attention\",\n tokens: [\"color-blocked-ink\", \"color-blocked-tint\"]\n },\n caution: {\n className: style(\"caution\"),\n purpose: \"Held outcome requiring review\",\n tokens: [\"color-held-ink\", \"color-held-tint\"]\n },\n progress: {\n className: style(\"progress\"),\n purpose: \"Work currently in progress\",\n tokens: [\"color-deploying-ink\", \"color-deploying-tint\"]\n }\n }\n})\n\nexport const RLY_STATE_PANEL_DEFAULT_VARIANTS = defineVariants({ tone: \"neutral\" })\nexport type RlyStatePanelTone = keyof typeof RLY_STATE_PANEL_VARIANTS.tone\nexport type RlyStatePanelAnnouncement = \"off\" | \"polite\" | \"assertive\"\n\nconst toneIcons = {\n neutral: \"minus\",\n positive: \"check\",\n critical: \"alert\",\n caution: \"clock\",\n progress: \"loader\"\n} satisfies Readonly<Record<RlyStatePanelTone, RlyIconName>>\n\nexport type StatePanelProps = Omit<ComponentPropsWithRef<\"section\">, \"aria-live\" | \"children\" | \"title\"> & {\n readonly action?: ReactNode\n readonly announce?: RlyStatePanelAnnouncement\n readonly description?: ReactNode\n readonly icon?: RlyIconName\n readonly title: string\n readonly tone?: RlyStatePanelTone\n}\n\n/** Explain an outcome with redundant word, icon, rail, ink, and tint cues. */\nexport const StatePanel = ({\n action,\n announce = \"off\",\n className,\n description,\n icon,\n title,\n tone = \"neutral\",\n ...props\n}: StatePanelProps): ReactElement => {\n const role = announce === \"assertive\" ? \"alert\" : announce === \"polite\" ? \"status\" : undefined\n\n return (\n <section\n {...props}\n aria-live={announce === \"off\" ? undefined : announce}\n className={classNames(style(\"root\"), RLY_STATE_PANEL_VARIANTS.tone[tone].className, className)}\n role={role}\n >\n <span aria-hidden=\"true\" className={style(\"rail\")} />\n <span aria-hidden=\"true\" className={style(\"icon\")}>\n <Icon decorative name={icon ?? toneIcons[tone]} />\n </span>\n <div className={style(\"content\")}>\n <strong className={style(\"title\")}>{requireText(title, \"StatePanel title\")}</strong>\n {description === undefined ? null : <div className={style(\"description\")}>{description}</div>}\n {action === undefined ? null : <div className={style(\"action\")}>{action}</div>}\n </div>\n </section>\n )\n}\n","@layer rly.components {\n .layer {\n inset: var(--rly-space-0);\n isolation: isolate;\n pointer-events: none;\n position: fixed;\n z-index: 100;\n }\n\n .overlay {\n background: var(--rly-color-canvas);\n inset: var(--rly-space-0);\n opacity: 0.78;\n pointer-events: auto;\n position: fixed;\n z-index: 0;\n }\n\n .content {\n background: var(--rly-color-surface-1);\n border: 1px solid var(--rly-color-border-1);\n border-radius: var(--rly-radius-overlay);\n box-sizing: border-box;\n color: var(--rly-color-text-1);\n display: grid;\n gap: var(--rly-space-24);\n inset-block-start: 50%;\n inset-inline-start: 50%;\n max-block-size: calc(100dvh - var(--rly-space-32));\n max-inline-size: calc(100vw - var(--rly-space-32));\n overflow: auto;\n overscroll-behavior: contain;\n padding: var(--rly-space-32);\n pointer-events: auto;\n position: fixed;\n transform: translate(-50%, -50%);\n z-index: 1;\n }\n\n .defaultSize {\n inline-size: 32rem;\n }\n .wide {\n inline-size: 48rem;\n }\n\n .header {\n display: grid;\n gap: var(--rly-space-8);\n min-inline-size: var(--rly-space-0);\n }\n\n .title {\n font: var(--rly-type-section-title-weight) var(--rly-type-section-title-size) /\n var(--rly-type-section-title-line-height) var(--rly-type-section-title-font);\n letter-spacing: var(--rly-type-section-title-tracking);\n margin: var(--rly-space-0);\n overflow-wrap: anywhere;\n text-wrap: balance;\n }\n\n .description {\n color: var(--rly-color-text-2);\n font: var(--rly-type-body-large-weight) var(--rly-type-body-large-size) / var(--rly-type-body-large-line-height)\n var(--rly-type-body-large-font);\n margin: var(--rly-space-0);\n overflow-wrap: anywhere;\n text-wrap: pretty;\n }\n\n .body {\n min-inline-size: var(--rly-space-0);\n overflow-wrap: anywhere;\n }\n\n .overlay[data-state=\"open\"] {\n animation: dialog-fade-in var(--rly-motion-standard-duration) var(--rly-motion-standard-easing);\n }\n .overlay[data-state=\"closed\"] {\n animation: dialog-fade-out var(--rly-motion-fast-duration) var(--rly-motion-fast-easing);\n }\n .content[data-state=\"open\"] {\n animation: dialog-enter var(--rly-motion-standard-duration) var(--rly-motion-standard-easing);\n }\n .content[data-state=\"closed\"] {\n animation: dialog-exit var(--rly-motion-fast-duration) var(--rly-motion-fast-easing);\n }\n\n .layer[data-rly-dialog-entry-motion=\"external\"] .overlay[data-state=\"open\"],\n .layer[data-rly-dialog-entry-motion=\"external\"] .content[data-state=\"open\"] {\n animation: none;\n }\n\n @keyframes dialog-fade-in {\n from {\n opacity: 0;\n }\n }\n @keyframes dialog-fade-out {\n to {\n opacity: 0;\n }\n }\n @keyframes dialog-enter {\n from {\n opacity: 0;\n transform: translate(-50%, calc(-50% + var(--rly-space-8)));\n }\n }\n @keyframes dialog-exit {\n to {\n opacity: 0;\n transform: translate(-50%, calc(-50% + var(--rly-space-8)));\n }\n }\n\n @media (max-width: 25rem) {\n .content {\n block-size: 100dvh;\n border: var(--rly-space-0);\n border-radius: var(--rly-space-0);\n inset: var(--rly-space-0);\n inline-size: 100%;\n max-block-size: none;\n max-inline-size: none;\n padding: var(--rly-space-20);\n transform: none;\n }\n\n .content[data-state=\"open\"] {\n animation-name: dialog-compact-in;\n }\n .content[data-state=\"closed\"] {\n animation-name: dialog-compact-out;\n }\n }\n\n @keyframes dialog-compact-in {\n from {\n opacity: 0;\n }\n }\n @keyframes dialog-compact-out {\n to {\n opacity: 0;\n }\n }\n}\n","import {\n type ComponentPropsWithRef,\n createContext,\n type ReactElement,\n type ReactNode,\n type Ref,\n type RefObject,\n useContext,\n useLayoutEffect,\n useRef,\n useState\n} from \"react\"\nimport { Dialog as RadixDialog } from \"radix-ui\"\nimport { PortalBoundary } from \"../foundations/PortalProvider.js\"\nimport { classNames, cssClass, defineVariants, requireText } from \"../internal/component.js\"\nimport {\n invalidateModalFocusRestore,\n isHTMLElement,\n ModalNestingBoundary,\n restoreModalFocusAfterCleanup,\n useModalContentRegistration,\n useModalEntryMotion,\n useModalIsolation,\n useParentModalReady\n} from \"../internal/modal.js\"\nimport { Button, type ButtonProps } from \"./Button.js\"\nimport styles from \"./Dialog.module.css\"\nimport * as Predicate from \"../internal/predicates.js\"\n\nconst style = (name: string): string => cssClass(styles, name)\n\ninterface DialogState {\n readonly open: boolean\n readonly requestOpenChange: (open: boolean) => void\n readonly restoreTargetRef: RefObject<HTMLElement | null>\n readonly triggerRef: RefObject<HTMLButtonElement | null>\n}\n\nconst DialogStateContext = createContext<DialogState | null>(null)\n\nconst useDialogState = (): DialogState => {\n const state = useContext(DialogStateContext)\n if (state === null) throw new Error(\"Dialog compound components must be nested inside Dialog\")\n return state\n}\n\nconst assignRef = <Element,>(ref: Ref<Element> | undefined, value: Element | null): void => {\n if (Predicate.isFunction(ref)) ref(value)\n else if (ref !== null && ref !== undefined) ref.current = value\n}\n\nconst getActiveElement = (): HTMLElement | null => {\n try {\n return isHTMLElement(document.activeElement) ? document.activeElement : null\n } catch {\n return null\n }\n}\n\n/** Semantic size metadata for the dialog surface. */\nexport const RLY_DIALOG_VARIANTS = defineVariants({\n size: {\n default: {\n className: style(\"defaultSize\"),\n purpose: \"Focused decision or short form\",\n tokens: [\"radius-overlay\", \"space-32\"]\n },\n wide: {\n className: style(\"wide\"),\n purpose: \"Detailed comparison or multi-section form\",\n tokens: [\"radius-overlay\", \"space-64\"]\n }\n }\n})\n\n/** Default dialog size used when no size is selected. */\nexport const RLY_DIALOG_DEFAULT_VARIANTS = defineVariants({ size: \"default\" })\n/** Available dialog surface sizes. */\nexport type RlyDialogSize = keyof typeof RLY_DIALOG_VARIANTS.size\n\ntype DialogBaseProps = { readonly children: ReactNode }\ntype ControlledDialogProps = DialogBaseProps & {\n readonly defaultOpen?: never\n readonly onOpenChange: (open: boolean) => void\n readonly open: boolean\n}\ntype DefaultDialogProps = DialogBaseProps & {\n readonly defaultOpen?: boolean\n readonly onOpenChange?: (open: boolean) => void\n readonly open?: never\n}\n/** Controlled-first or locally owned state for a dialog tree. */\nexport type DialogRootProps = ControlledDialogProps | DefaultDialogProps\n\n/** Props for the visible rly button that opens a dialog. */\nexport type DialogTriggerProps = ButtonProps\n/** Props for a visible rly button that closes a dialog. */\nexport type DialogCloseProps = ButtonProps\n\n/** Accessible content, naming, focus, and sizing for a modal dialog surface. */\nexport type DialogContentProps = Omit<\n ComponentPropsWithRef<\"div\">,\n \"aria-describedby\" | \"aria-label\" | \"aria-labelledby\" | \"children\" | \"title\"\n> & {\n readonly children: ReactNode\n readonly description?: string\n /**\n * Defaults to intrinsic and is sampled when the dialog opens. While open, changes apply to the next cycle.\n * External suppresses surface and overlay entry only; exit stays intrinsic and shared reduced-motion rules apply.\n */\n readonly entryMotion?: \"external\" | \"intrinsic\"\n readonly initialFocusRef?: RefObject<HTMLElement | null>\n readonly size?: RlyDialogSize\n readonly title: string\n}\n\nconst DialogLayer = ({\n children,\n entryMotion\n}: {\n readonly children: ReactNode\n readonly entryMotion: \"external\" | \"intrinsic\"\n}): ReactElement => {\n const state = useDialogState()\n const ref = useRef<HTMLDivElement>(null)\n useModalContentRegistration()\n useModalIsolation(ref, state.open)\n return (\n <div\n className={style(\"layer\")}\n data-rly-dialog-entry-motion={entryMotion}\n data-rly-dialog-layer=\"\"\n data-rly-modal-layer=\"\"\n ref={ref}\n >\n {children}\n </div>\n )\n}\n\n/** Own controlled or reusable default dialog state without exposing Radix contracts. */\nconst DialogRoot = ({ children, defaultOpen = false, onOpenChange, open }: DialogRootProps): ReactElement => {\n const [defaultState, setDefaultState] = useState(defaultOpen)\n const isParentModalReady = useParentModalReady()\n const resolvedOpen = (open ?? defaultState) && isParentModalReady\n const previousOpenRef = useRef(resolvedOpen)\n const triggerRef = useRef<HTMLButtonElement>(null)\n const restoreTargetRef = useRef<HTMLElement | null>(resolvedOpen ? getActiveElement() : null)\n if (resolvedOpen && !previousOpenRef.current) {\n restoreTargetRef.current = triggerRef.current ?? getActiveElement()\n }\n const requestOpenChange = (nextOpen: boolean): void => {\n if (nextOpen) restoreTargetRef.current = triggerRef.current ?? getActiveElement()\n if (open === undefined) setDefaultState(nextOpen)\n onOpenChange?.(nextOpen)\n }\n\n useLayoutEffect(() => {\n if (previousOpenRef.current === resolvedOpen) return\n previousOpenRef.current = resolvedOpen\n if (resolvedOpen) invalidateModalFocusRestore()\n else restoreModalFocusAfterCleanup(restoreTargetRef.current)\n }, [resolvedOpen])\n\n return (\n <ModalNestingBoundary>\n <DialogStateContext.Provider value={{ open: resolvedOpen, requestOpenChange, restoreTargetRef, triggerRef }}>\n <RadixDialog.Root modal onOpenChange={requestOpenChange} open={resolvedOpen}>\n {children}\n </RadixDialog.Root>\n </DialogStateContext.Provider>\n </ModalNestingBoundary>\n )\n}\n\n/** Render the explicit action that opens a dialog using rly Button semantics. */\nconst DialogTrigger = ({ ref, ...props }: DialogTriggerProps): ReactElement => {\n const state = useDialogState()\n return (\n <RadixDialog.Trigger asChild>\n <Button\n {...props}\n ref={(element) => {\n state.triggerRef.current = element\n assignRef(ref, element)\n }}\n />\n </RadixDialog.Trigger>\n )\n}\n\n/** Render the explicit action that closes the current dialog. */\nconst DialogClose = (props: DialogCloseProps): ReactElement => (\n <RadixDialog.Close asChild>\n <Button {...props} />\n </RadixDialog.Close>\n)\n\n/** Render a named modal surface in the application-controlled portal boundary. */\nconst DialogContent = ({\n children,\n className,\n description,\n entryMotion = \"intrinsic\",\n initialFocusRef,\n size = \"default\",\n title,\n ...props\n}: DialogContentProps): ReactElement => {\n const state = useDialogState()\n const resolvedEntryMotion = useModalEntryMotion(state.open, entryMotion)\n const visibleTitle = requireText(title, \"Dialog title\")\n const visibleDescription = description === undefined ? undefined : requireText(description, \"Dialog description\")\n\n return (\n <PortalBoundary>\n {(container) => (\n <RadixDialog.Portal container={container}>\n <DialogLayer entryMotion={resolvedEntryMotion}>\n <RadixDialog.Overlay\n className={style(\"overlay\")}\n data-rly-dialog-overlay=\"\"\n onPointerDown={() => {\n state.requestOpenChange(false)\n }}\n />\n <RadixDialog.Content\n {...props}\n {...(visibleDescription === undefined ? { \"aria-describedby\": undefined } : {})}\n className={classNames(style(\"content\"), RLY_DIALOG_VARIANTS.size[size].className, className)}\n onCloseAutoFocus={(event) => {\n event.preventDefault()\n }}\n onOpenAutoFocus={(event) => {\n const activeElement = getActiveElement()\n if (state.triggerRef.current === null && activeElement !== null) {\n state.restoreTargetRef.current = activeElement\n }\n const target = initialFocusRef?.current\n if (target !== null && target !== undefined) {\n event.preventDefault()\n target.focus()\n }\n }}\n >\n <header className={style(\"header\")}>\n <RadixDialog.Title className={style(\"title\")}>{visibleTitle}</RadixDialog.Title>\n {visibleDescription === undefined ? null : (\n <RadixDialog.Description className={style(\"description\")}>\n {visibleDescription}\n </RadixDialog.Description>\n )}\n </header>\n <div className={style(\"body\")}>{children}</div>\n </RadixDialog.Content>\n </DialogLayer>\n </RadixDialog.Portal>\n )}\n </PortalBoundary>\n )\n}\n\n/** Owned compound dialog API with no Radix types or slots in its public contract. */\nexport const Dialog = Object.freeze({\n Close: DialogClose,\n Content: DialogContent,\n Root: DialogRoot,\n Trigger: DialogTrigger\n})\n"],"mappings":";;;;;;AA2BA,IAAM,oBAAe,IAAI,QAAkC,GACrD,IAAsB,EAAwC,IAAI,GACpE,IAA4B,GAMnB,KAAuB,GAAe,MAAkD;CACnG,IAAM,IAAoB,EAAO;EAAE;EAAM,OAAO;CAAU,CAAC,GACrD,IAAW,KAAQ,CAAC,EAAkB,QAAQ,OAAO,IAAY,EAAkB,QAAQ;CAKjG,OAJA,QAAsB;EACpB,AAAK,IACK,EAAkB,QAAQ,SAAM,EAAkB,UAAU;GAAE,MAAM;GAAM,OAAO;EAAU,KAD1F,EAAkB,UAAU;GAAE,MAAM;GAAO,OAAO;EAAU;CAEzE,GAAG,CAAC,GAAM,CAAS,CAAC,GACb;AACT,GAGa,KAAiB,MAC5B,MAAY,QAAQ,WAAW,KAAW,EAAoB,EAAQ,KAAK,GAGhE,KAAwB,EAAE,kBAAwD;CAC7F,IAAM,CAAC,GAAkB,KAAqB,EAAS,EAAK;CAC5D,OAAO,EAAc,EAAoB,UAAU,EAAE,OAAO;EAAE;EAAkB;CAAkB,EAAE,GAAG,CAAQ;AACjH,GAGa,UAAqC,EAAW,CAAmB,CAAC,EAAE,oBAAoB,IAG1F,UAA0C;CACrD,IAAM,IAAoB,EAAW,CAAmB,CAAC,EAAE;CAC3D,SACE,IAAoB,EAAI,SACX,IAAoB,EAAK,IACrC,CAAC,CAAiB,CAA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