@proyecto-viviana/solidaria-components 0.7.0-rc.3 → 0.7.0-rc.4

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.
@@ -1,14 +1 @@
1
- /*
2
- * Copyright 2024 Adobe. All rights reserved.
3
- * This file is licensed to you under the Apache License, Version 2.0 (the "License");
4
- * you may not use this file except in compliance with the License. You may obtain a copy
5
- * of the License at http://www.apache.org/licenses/LICENSE-2.0
6
- *
7
- * Unless required by applicable law or agreed to in writing, software distributed under
8
- * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
9
- * OF ANY KIND, either express or implied. See the License for the specific language
10
- * governing permissions and limitations under the License.
11
- */
12
- // Ported to SolidJS for Proyecto Viviana; based on packages/react-aria-components/src/ColorThumb.tsx
13
- import { ColorSliderThumb } from "./ColorSlider.js";
14
- export { ColorSliderThumb as ColorThumb };
1
+ export { ColorSliderThumb as ColorThumb } from "./ColorSlider.js";
@@ -1,14 +1 @@
1
- /*
2
- * Copyright 2024 Adobe. All rights reserved.
3
- * This file is licensed to you under the Apache License, Version 2.0 (the "License");
4
- * you may not use this file except in compliance with the License. You may obtain a copy
5
- * of the License at http://www.apache.org/licenses/LICENSE-2.0
6
- *
7
- * Unless required by applicable law or agreed to in writing, software distributed under
8
- * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
9
- * OF ANY KIND, either express or implied. See the License for the specific language
10
- * governing permissions and limitations under the License.
11
- */
12
- // Ported to SolidJS for Proyecto Viviana; based on packages/react-aria-components/src/ColorThumb.tsx
13
- import { ColorSliderThumb } from "./ColorSlider.jsx";
14
- export { ColorSliderThumb as ColorThumb };
1
+ export { ColorSliderThumb as ColorThumb } from "./ColorSlider.jsx";
package/dist/DateField.js CHANGED
@@ -1,2 +1 @@
1
- import { a as DateFieldLabel, c as DateSegment, i as DateFieldErrorMessage, l as useDateFieldContext, n as DateFieldContext, o as DateFieldStateContext, r as DateFieldDescription, s as DateInput, t as DateField } from "./DateField2.js";
2
- export { DateField, DateFieldContext, DateFieldDescription, DateFieldErrorMessage, DateFieldLabel, DateFieldStateContext, DateInput, DateSegment, useDateFieldContext };
1
+ export { t as DateField, n as DateFieldContext, r as DateFieldDescription, i as DateFieldErrorMessage, a as DateFieldLabel, o as DateFieldStateContext, s as DateInput, c as DateSegment, l as useDateFieldContext } from "./DateField2.js";
@@ -1,2 +1 @@
1
- import { a as DateFieldLabel, c as DateSegment, i as DateFieldErrorMessage, l as useDateFieldContext, n as DateFieldContext, o as DateFieldStateContext, r as DateFieldDescription, s as DateInput, t as DateField } from "./DateField2.jsx";
2
- export { DateField, DateFieldContext, DateFieldDescription, DateFieldErrorMessage, DateFieldLabel, DateFieldStateContext, DateInput, DateSegment, useDateFieldContext };
1
+ export { t as DateField, n as DateFieldContext, r as DateFieldDescription, i as DateFieldErrorMessage, a as DateFieldLabel, o as DateFieldStateContext, s as DateInput, c as DateSegment, l as useDateFieldContext } from "./DateField2.jsx";
package/dist/Modal.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"Modal.js","names":["<Show when={isHydrated() && (isOpen() || combinedExiting())}>\n <Portal mount={portalContainer()}>\n <OverlayTriggerStateContext value={state}>\n <InternalModalContext value={internalModalContext}>\n <div\n {...domProps()}\n ref={registerOverlayRef}\n class={renderProps.class()}\n style={renderProps.style()}\n data-entering={dataAttr(overlayEntering())}\n data-exiting={dataAttr(combinedExiting())}\n onPointerDown={handleOverlayPointerDown}\n >\n {renderProps.renderChildrenStable()}\n </div>\n </InternalModalContext>\n </OverlayTriggerStateContext>\n </Portal>\n </Show>","isHydrated() && (isOpen() || combinedExiting())","<Portal mount={portalContainer()}>\n <OverlayTriggerStateContext value={state}>\n <InternalModalContext value={internalModalContext}>\n <div\n {...domProps()}\n ref={registerOverlayRef}\n class={renderProps.class()}\n style={renderProps.style()}\n data-entering={dataAttr(overlayEntering())}\n data-exiting={dataAttr(combinedExiting())}\n onPointerDown={handleOverlayPointerDown}\n >\n {renderProps.renderChildrenStable()}\n </div>\n </InternalModalContext>\n </OverlayTriggerStateContext>\n </Portal>","<OverlayTriggerStateContext value={state}>\n <InternalModalContext value={internalModalContext}>\n <div\n {...domProps()}\n ref={registerOverlayRef}\n class={renderProps.class()}\n style={renderProps.style()}\n data-entering={dataAttr(overlayEntering())}\n data-exiting={dataAttr(combinedExiting())}\n onPointerDown={handleOverlayPointerDown}\n >\n {renderProps.renderChildrenStable()}\n </div>\n </InternalModalContext>\n </OverlayTriggerStateContext>","value={state}","<InternalModalContext value={internalModalContext}>\n <div\n {...domProps()}\n ref={registerOverlayRef}\n class={renderProps.class()}\n style={renderProps.style()}\n data-entering={dataAttr(overlayEntering())}\n data-exiting={dataAttr(combinedExiting())}\n onPointerDown={handleOverlayPointerDown}\n >\n {renderProps.renderChildrenStable()}\n </div>\n </InternalModalContext>","value={internalModalContext}","ref={registerOverlayRef}","onPointerDown={handleOverlayPointerDown}","{renderProps.renderChildrenStable()}","<div\n {...domProps()}\n ref={registerOverlayRef}\n class={renderProps.class()}\n style={renderProps.style()}\n data-entering={dataAttr(overlayEntering())}\n data-exiting={dataAttr(combinedExiting())}\n onPointerDown={handleOverlayPointerDown}\n >\n {renderProps.renderChildrenStable()}\n </div>","<ModalContentWithAutoOverlay {...props} />","<ModalContent {...modalProps}>{props.children}</ModalContent>","<ModalOverlay {...overlayProps}>\n <ModalContent {...modalProps}>{props.children}</ModalContent>\n </ModalOverlay>","{props.children}","<FocusScope contain={!isModalExiting()} restoreFocus>\n <div\n {...domProps()}\n ref={registerModalRef}\n class={renderProps.class()}\n style={renderProps.style()}\n data-entering={dataAttr(isModalEntering())}\n data-exiting={dataAttr(isModalExiting())}\n >\n <Show when={isDismissable()}>\n {/* Faithful to react-aria's DismissButton: a bare button carrying\n only `width/height: 1px` inside a VisuallyHidden `div` wrapper —\n NOT the hidden styles inlined onto the button. The wrapper clips\n it out of sight while the button keeps its intrinsic UA border-box,\n which is exactly what upstream renders (and what D8 target-size\n measures against the pair oracle). Inlining the reset onto the\n button instead collapsed it to a 1x1 box, diverging from\n upstream's ~16x6 sentinel. */}\n <VisuallyHidden elementType=\"div\">\n <button\n aria-label={stringFormatter().format(\"dismiss\")}\n tabindex={-1}\n onClick={close}\n style={{ width: \"1px\", height: \"1px\" }}\n />\n </VisuallyHidden>\n </Show>\n {renderProps.renderChildren()}\n </div>\n </FocusScope>","ref={registerModalRef}","<Show when={isDismissable()}>\n {/* Faithful to react-aria's DismissButton: a bare button carrying\n only `width/height: 1px` inside a VisuallyHidden `div` wrapper —\n NOT the hidden styles inlined onto the button. The wrapper clips\n it out of sight while the button keeps its intrinsic UA border-box,\n which is exactly what upstream renders (and what D8 target-size\n measures against the pair oracle). Inlining the reset onto the\n button instead collapsed it to a 1x1 box, diverging from\n upstream's ~16x6 sentinel. */}\n <VisuallyHidden elementType=\"div\">\n <button\n aria-label={stringFormatter().format(\"dismiss\")}\n tabindex={-1}\n onClick={close}\n style={{ width: \"1px\", height: \"1px\" }}\n />\n </VisuallyHidden>\n </Show>","<VisuallyHidden elementType=\"div\">\n <button\n aria-label={stringFormatter().format(\"dismiss\")}\n tabindex={-1}\n onClick={close}\n style={{ width: \"1px\", height: \"1px\" }}\n />\n </VisuallyHidden>","elementType=\"div\"","<button\n aria-label={stringFormatter().format(\"dismiss\")}\n tabindex={-1}\n onClick={close}\n style={{ width: \"1px\", height: \"1px\" }}\n />","<div\n {...domProps()}\n ref={registerModalRef}\n class={renderProps.class()}\n style={renderProps.style()}\n data-entering={dataAttr(isModalEntering())}\n data-exiting={dataAttr(isModalExiting())}\n >\n <Show when={isDismissable()}>\n {/* Faithful to react-aria's DismissButton: a bare button carrying\n only `width/height: 1px` inside a VisuallyHidden `div` wrapper —\n NOT the hidden styles inlined onto the button. The wrapper clips\n it out of sight while the button keeps its intrinsic UA border-box,\n which is exactly what upstream renders (and what D8 target-size\n measures against the pair oracle). Inlining the reset onto the\n button instead collapsed it to a 1x1 box, diverging from\n upstream's ~16x6 sentinel. */}\n <VisuallyHidden elementType=\"div\">\n <button\n aria-label={stringFormatter().format(\"dismiss\")}\n tabindex={-1}\n onClick={close}\n style={{ width: \"1px\", height: \"1px\" }}\n />\n </VisuallyHidden>\n </Show>\n {renderProps.renderChildren()}\n </div>","{renderProps.renderChildren()}","_$createComponent","_$memo","_$getNextElement","_$scope","_$mergeProps","_$getNextMarker","_$delegateEvents"],"sources":["../src/Modal.tsx"],"sourcesContent":["/*\n * Copyright 2022 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\n// Ported to SolidJS for Proyecto Viviana; based on packages/react-aria-components/src/Modal.tsx\n\n/**\n * Modal and ModalOverlay components for solidaria-components\n *\n * Headless modal components with overlay, focus trapping, and dismissal handling.\n * Port of react-aria-components Modal.\n */\n\nimport {\n createContext,\n createMemo,\n createSignal,\n Show,\n useContext,\n createTrackedEffect,\n} from \"solid-js\";\nimport type { JSX } from \"@solidjs/web\";\nimport { Portal, isServer } from \"@solidjs/web\";\nimport {\n createInteractOutside,\n createPreventScroll,\n ariaHideOutside,\n FocusScope,\n useUNSAFE_PortalContext,\n createEnterAnimation,\n createExitAnimation,\n createStringFormatter,\n overlaysIntlStrings,\n} from \"@proyecto-viviana/solidaria\";\nimport {\n type RenderChildren,\n type ClassNameOrFunction,\n type StyleOrFunction,\n useRenderProps,\n filterDOMProps,\n dataAttr,\n useIsHydrated,\n} from \"./utils\";\nimport {\n DialogTriggerContext,\n OverlayTriggerStateContext,\n type OverlayTriggerState,\n} from \"./contexts\";\nimport { VisuallyHidden } from \"./VisuallyHidden\";\nimport { splitProps } from \"@proyecto-viviana/solidaria/utils\";\n\n/**\n * Internal context to signal that Modal is wrapped in ModalOverlay.\n * When present, Modal should not create its own Portal.\n */\ninterface InternalModalContextValue {\n isDismissable?: boolean;\n isKeyboardDismissDisabled?: boolean;\n // Upstream's ModalOverlay owns the modal element's ref so it can watch the\n // modal surface's exit animation alongside the overlay's (both must finish\n // before the overlay unmounts). ModalContent registers its element here.\n setModalRef?: (element: HTMLElement | null) => void;\n // Combined exit flag (overlay OR modal still exiting). Both the overlay and\n // the modal surface carry `data-exiting` off this so they fade out together.\n isExiting?: () => boolean;\n}\n\nconst InternalModalContext = createContext<InternalModalContextValue | null>(null);\n\n// Stack of visible modals, used to ensure only the top-most modal dismisses on Escape/outside interaction.\nconst visibleModals: Array<() => Element | null> = [];\n\nfunction pruneDisconnectedModals() {\n for (let index = visibleModals.length - 1; index >= 0; index -= 1) {\n const element = visibleModals[index]?.();\n if (!element?.isConnected) {\n visibleModals.splice(index, 1);\n }\n }\n}\n\nexport interface ModalRenderProps {\n /** Whether the modal is currently entering (for animations). */\n isEntering: boolean;\n /** Whether the modal is currently exiting (for animations). */\n isExiting: boolean;\n}\n\nexport interface ModalOverlayProps {\n /** The children of the component - can be JSX or render function. */\n children?: RenderChildren<ModalRenderProps>;\n /** The CSS className for the element. */\n class?: ClassNameOrFunction<ModalRenderProps>;\n /** The inline style for the element. */\n style?: StyleOrFunction<ModalRenderProps>;\n /** Whether the modal is open (controlled). */\n isOpen?: boolean;\n /** Whether the modal opens by default (uncontrolled). */\n defaultOpen?: boolean;\n /** Handler called when the modal's open state changes. */\n onOpenChange?: (isOpen: boolean) => void;\n /** Whether clicking outside the modal closes it. */\n isDismissable?: boolean;\n /** Whether pressing Escape closes the modal. */\n isKeyboardDismissDisabled?: boolean;\n /** Whether the modal is entering (for animations). */\n isEntering?: boolean;\n /** Whether the modal is exiting (for animations). */\n isExiting?: boolean;\n}\n\nexport interface ModalProps extends ModalOverlayProps {}\n\nexport { OverlayTriggerStateContext, type OverlayTriggerState } from \"./contexts\";\nexport { useOverlayTriggerState } from \"./contexts\";\nexport const ModalContext = OverlayTriggerStateContext;\n\n/**\n * ModalOverlay is the backdrop/underlay behind a modal.\n * It handles click-outside dismissal and provides styling hooks.\n */\nexport function ModalOverlay(props: ModalOverlayProps): JSX.Element {\n // Do NOT early-return on the server: rendering children bare on the server and a\n // <Show>/<Portal> overlay on the client desyncs hydration. Run the same structure\n // on both and gate the Portal on useIsHydrated() (see Popover for the rationale).\n const isHydrated = useIsHydrated();\n\n // IMPORTANT: Don't destructure or access props.children early!\n // In SolidJS, children are lazily evaluated. Accessing them before\n // the context provider renders causes them to evaluate outside the context.\n // See: https://github.com/solidjs/solid/issues/182\n const [local, rest] = splitProps(props, [\n \"class\",\n \"style\",\n \"isOpen\",\n \"defaultOpen\",\n \"onOpenChange\",\n \"isDismissable\",\n \"isKeyboardDismissDisabled\",\n \"isEntering\",\n \"isExiting\",\n ]);\n\n // Get state from DialogTrigger context if available\n const dialogTriggerContext = useContext(DialogTriggerContext);\n\n // Internal state for uncontrolled mode\n const [internalOpen, setInternalOpen] = createSignal(local.defaultOpen ?? false);\n\n // Determine if open (controlled > DialogTrigger context > uncontrolled)\n const isOpen = (): boolean => {\n if (local.isOpen !== undefined) return local.isOpen;\n if (dialogTriggerContext) return dialogTriggerContext.state.isOpen();\n return internalOpen();\n };\n\n const close = () => {\n if (local.isOpen !== undefined) {\n local.onOpenChange?.(false);\n } else if (dialogTriggerContext) {\n dialogTriggerContext.state.close();\n local.onOpenChange?.(false);\n } else {\n setInternalOpen(false);\n local.onOpenChange?.(false);\n }\n };\n\n const open = () => {\n if (local.isOpen !== undefined) {\n local.onOpenChange?.(true);\n } else if (dialogTriggerContext) {\n dialogTriggerContext.state.open();\n local.onOpenChange?.(true);\n } else {\n setInternalOpen(true);\n local.onOpenChange?.(true);\n }\n };\n\n const toggle = () => {\n if (isOpen()) {\n close();\n } else {\n open();\n }\n };\n\n const state: OverlayTriggerState = {\n get isOpen() {\n return isOpen();\n },\n open,\n close,\n toggle,\n setOpen: (next) => {\n if (next) open();\n else close();\n },\n get point() {\n return null;\n },\n setPoint: () => {},\n };\n\n // Enter/exit animation state (mirrors upstream's ModalOverlayWithForwardRef +\n // ModalOverlayInner). The overlay stays mounted here even while closed, so the\n // enter animation is gated on `isOpen` (isReady) — otherwise it would resolve\n // to \"done entering\" before the element ever mounts. Exit is watched for BOTH\n // the overlay and the modal surface; the modal registers its element via\n // InternalModalContext (setModalRef) so we can await its exit too.\n let overlayRef!: HTMLDivElement;\n // Signal-backed so the enter/exit effects re-run once the element mounts — a\n // plain closure over `overlayRef` would read `null` if the effect fired first\n // and, with no reactive dep on the ref, never recover (stuck `data-entering`).\n const [overlayEl, setOverlayEl] = createSignal<HTMLElement | null>(null, { ownedWrite: true });\n const overlayRefAccessor = () => overlayEl();\n const registerOverlayRef = (element: HTMLDivElement) => {\n overlayRef = element;\n setOverlayEl(element);\n };\n const [modalEl, setModalEl] = createSignal<HTMLElement | null>(null, { ownedWrite: true });\n\n const isOverlayEntering = createEnterAnimation(overlayRefAccessor, isOpen);\n const isOverlayExiting = createExitAnimation(overlayRefAccessor, isOpen);\n const isModalExiting = createExitAnimation(() => modalEl(), isOpen);\n const overlayEntering = () => isOverlayEntering() || (local.isEntering ?? false);\n const combinedExiting = () =>\n isOverlayExiting() || isModalExiting() || (local.isExiting ?? false);\n\n const renderValues = createMemo<ModalRenderProps>(() => ({\n isEntering: overlayEntering(),\n isExiting: combinedExiting(),\n }));\n\n // Keep children lazy until insertion inside the overlay contexts.\n const renderProps = useRenderProps(\n {\n get children() {\n return props.children;\n },\n get class() {\n return local.class;\n },\n get style() {\n return local.style;\n },\n defaultClassName: \"solidaria-ModalOverlay\",\n },\n renderValues,\n );\n\n const domProps = createMemo(() =>\n filterDOMProps(rest as Record<string, unknown>, { global: true }),\n );\n\n // Internal context value to signal Modal that it's wrapped\n const internalModalContext: InternalModalContextValue = {\n isDismissable: local.isDismissable,\n isKeyboardDismissDisabled: local.isKeyboardDismissDisabled,\n setModalRef: setModalEl,\n isExiting: combinedExiting,\n };\n const portalContext = useUNSAFE_PortalContext();\n const portalContainer = () => portalContext.getContainer?.() ?? undefined;\n\n const isTopMostModalInOverlay = () => {\n pruneDisconnectedModals();\n const topMostModal = visibleModals[visibleModals.length - 1]?.();\n return !topMostModal || overlayRef?.contains(topMostModal);\n };\n\n const handleOverlayPointerDown: JSX.EventHandler<HTMLDivElement, PointerEvent> = (event) => {\n if (local.isDismissable && event.target === event.currentTarget && isTopMostModalInOverlay()) {\n close();\n }\n };\n\n return (\n <Show when={isHydrated() && (isOpen() || combinedExiting())}>\n <Portal mount={portalContainer()}>\n <OverlayTriggerStateContext value={state}>\n <InternalModalContext value={internalModalContext}>\n <div\n {...domProps()}\n ref={registerOverlayRef}\n class={renderProps.class()}\n style={renderProps.style()}\n data-entering={dataAttr(overlayEntering())}\n data-exiting={dataAttr(combinedExiting())}\n onPointerDown={handleOverlayPointerDown}\n >\n {renderProps.renderChildrenStable()}\n </div>\n </InternalModalContext>\n </OverlayTriggerStateContext>\n </Portal>\n </Show>\n );\n}\n\n/**\n * Modal is a dialog container that manages focus trapping, scroll prevention,\n * aria-hiding of content outside, and dismissal.\n *\n * Usage patterns:\n * 1. Standalone: `<Modal isOpen>...</Modal>` - Creates its own overlay\n * 2. With custom overlay: `<ModalOverlay><Modal>...</Modal></ModalOverlay>`\n *\n * Note: Due to SolidJS's eager JSX evaluation, we cannot detect at render time\n * whether Modal is wrapped in ModalOverlay. So standalone Modal always creates\n * an overlay, and wrapped Modal renders directly (relying on InternalModalContext).\n */\nexport function Modal(props: ModalProps): JSX.Element {\n // Check for InternalModalContext which signals we're inside a rendered ModalOverlay\n // This works because ModalContent is rendered INSIDE ModalOverlay's Show/Portal\n return <ModalContentWithAutoOverlay {...props} />;\n}\n\n/**\n * Helper component that handles the overlay detection.\n * By being a separate component, we can use Show to defer rendering until\n * the parent context is available.\n */\nfunction ModalContentWithAutoOverlay(props: ModalProps): JSX.Element {\n const [overlayProps, modalProps] = splitProps(props, [\n \"isOpen\",\n \"defaultOpen\",\n \"onOpenChange\",\n \"isDismissable\",\n \"isKeyboardDismissDisabled\",\n \"isEntering\",\n \"isExiting\",\n ]);\n\n // Check for InternalModalContext - if present, we're inside a ModalOverlay\n const internalContext = useContext(InternalModalContext);\n\n // If wrapped in ModalOverlay, just render the content. ModalContent reads the\n // overlay's InternalModalContext itself (via useContext), so nothing needs\n // threading — in both branches ModalContent renders inside a provider.\n if (internalContext) {\n return <ModalContent {...modalProps}>{props.children}</ModalContent>;\n }\n\n // For standalone usage, wrap in ModalOverlay.\n return (\n <ModalOverlay {...overlayProps}>\n <ModalContent {...modalProps}>{props.children}</ModalContent>\n </ModalOverlay>\n );\n}\n\n/**\n * Internal component that renders the actual modal content.\n * Used by both standalone Modal and Modal wrapped in ModalOverlay.\n */\nfunction ModalContent(props: ModalProps): JSX.Element {\n if (isServer) {\n return <>{props.children}</>;\n }\n\n const [local, rest] = splitProps(props, [\n \"children\",\n \"class\",\n \"style\",\n \"isOpen\",\n \"defaultOpen\",\n \"onOpenChange\",\n \"isDismissable\",\n \"isKeyboardDismissDisabled\",\n \"isEntering\",\n \"isExiting\",\n ]);\n\n const stringFormatter = createStringFormatter(overlaysIntlStrings, \"@react-aria/overlays\");\n\n let modalRef!: HTMLDivElement;\n const modalRefAccessor = () => modalRef ?? null;\n // Signal-backed element for the enter animation, so the effect re-runs when\n // the surface mounts (see the overlay's note); the plain `modalRef` var still\n // backs the synchronous consumers (focus stack, interact-outside, aria-hide).\n const [modalEl, setModalEl] = createSignal<HTMLElement | null>(null, { ownedWrite: true });\n\n // Get state from parent OverlayTriggerStateContext (provided by ModalOverlay)\n const parentState = useContext(OverlayTriggerStateContext);\n\n // The overlay (auto or user-provided) always wraps this content, so it owns\n // the InternalModalContext: dismissal settings, the modal-ref registration\n // sink, and the combined exit flag.\n const internalContext = useContext(InternalModalContext);\n\n // Get dismissable settings from internal context (set by ModalOverlay)\n const isDismissable = () => internalContext?.isDismissable ?? local.isDismissable;\n const isKeyboardDismissDisabled = () =>\n internalContext?.isKeyboardDismissDisabled ?? local.isKeyboardDismissDisabled;\n\n // Determine if open from parent state\n const isOpen = (): boolean => {\n if (local.isOpen !== undefined) return local.isOpen;\n return parentState?.isOpen ?? false;\n };\n\n // Register this element with the overlay so it can await the modal surface's\n // exit animation (upstream threads modalRef down the same way). The overlay's\n // combined exit flag drives this surface's `data-exiting`. The enter animation\n // is local — the modal fades/slides in on its own timeline (delay 160 vs the\n // overlay's 0).\n const registerModalRef = (element: HTMLDivElement) => {\n modalRef = element;\n setModalEl(element);\n internalContext?.setModalRef?.(element);\n };\n const isModalEntering = createEnterAnimation(() => modalEl(), isOpen);\n const isModalExiting = () => internalContext?.isExiting?.() ?? local.isExiting ?? false;\n\n // Keep this modal in a global stack so nested modals dismiss in top-down order.\n createTrackedEffect(() => {\n const _s2Cleanups: Array<() => void> = [];\n\n if (!isOpen()) return;\n\n pruneDisconnectedModals();\n if (!visibleModals.includes(modalRefAccessor)) {\n visibleModals.push(modalRefAccessor);\n }\n\n _s2Cleanups.push(() => {\n const index = visibleModals.indexOf(modalRefAccessor);\n if (index >= 0) {\n visibleModals.splice(index, 1);\n }\n });\n\n return () => {\n for (const c of _s2Cleanups) c();\n };\n });\n\n const isTopMostModal = () => {\n pruneDisconnectedModals();\n return visibleModals[visibleModals.length - 1] === modalRefAccessor;\n };\n\n const close = () => {\n if (local.isOpen !== undefined) {\n local.onOpenChange?.(false);\n } else {\n parentState?.close();\n }\n };\n\n // Prevent scroll when modal is open. Upstream `useModalOverlay.ts:65-67`\n // calls `usePreventScroll`, which is refcounted across every holder and\n // handles the scrollbar gutter and mobile Safari; a one-off\n // `overflow: hidden` here joined none of that.\n createPreventScroll({\n get isDisabled() {\n return !isOpen();\n },\n });\n\n // Click outside to close (if dismissable)\n createInteractOutside({\n ref: modalRefAccessor,\n onInteractOutside: () => {\n if (isTopMostModal()) {\n close();\n }\n },\n get isDisabled() {\n return !isOpen() || !isDismissable();\n },\n });\n\n // Escape key to close\n createTrackedEffect(() => {\n const _s2Cleanups: Array<() => void> = [];\n\n if (!isOpen() || isKeyboardDismissDisabled()) return;\n\n const handleKeyDown = (e: KeyboardEvent) => {\n if (e.key === \"Escape\" && !e.isComposing && isTopMostModal()) {\n e.preventDefault();\n e.stopPropagation();\n close();\n }\n };\n\n // ModalContent owns Escape, matching RAC's useModalOverlay modalProps.\n // Bubble phase preserves inner-widget Escape precedence (useOverlay parity).\n document.addEventListener(\"keydown\", handleKeyDown, false);\n _s2Cleanups.push(() => {\n document.removeEventListener(\"keydown\", handleKeyDown, false);\n });\n\n return () => {\n for (const c of _s2Cleanups) c();\n };\n });\n\n // Aria-hide outside content\n createTrackedEffect(() => {\n const _s2Cleanups: Array<() => void> = [];\n\n if (!isOpen() || !modalRef) return;\n\n let cleanup: (() => void) | undefined;\n let cancelled = false;\n const ownerWindow = modalRef.ownerDocument.defaultView ?? window;\n\n const hideOutside = () => {\n if (cancelled || !modalRef?.isConnected) return;\n cleanup = ariaHideOutside([modalRef], { shouldUseInert: true });\n };\n\n if (modalRef.isConnected) {\n hideOutside();\n } else {\n ownerWindow.queueMicrotask(hideOutside);\n }\n\n _s2Cleanups.push(() => {\n cancelled = true;\n cleanup?.();\n });\n\n return () => {\n for (const c of _s2Cleanups) c();\n };\n });\n\n const renderValues = createMemo<ModalRenderProps>(() => ({\n isEntering: isModalEntering(),\n isExiting: isModalExiting(),\n }));\n\n const renderProps = useRenderProps(\n {\n // Lazy: the modal content is gated behind `<Show when={isHydrated() && …}>`\n // (Portal) below, so it must not be instantiated during the component body.\n // An eager `children: props.children` would build the content template (and\n // walk getNextElement) before the gate — content the server never emitted →\n // hydration mismatch. See Popover for the full rationale.\n get children() {\n return props.children;\n },\n get class() {\n return local.class;\n },\n get style() {\n return local.style;\n },\n defaultClassName: \"solidaria-Modal\",\n },\n renderValues,\n );\n\n const domProps = createMemo(() =>\n filterDOMProps(rest as Record<string, unknown>, { global: true }),\n );\n\n return (\n // No autoFocus: react-aria's Overlay renders FocusScope with restoreFocus +\n // contain only — initial focus is useDialog's job (it focuses the dialog\n // element itself when nothing inside holds focus).\n //\n // `contain` is gated on `!isExiting`, mirroring react-aria's Overlay\n // (react-aria/src/overlays/Overlay.tsx: `contain={... && !isExiting}`). The\n // overlay stays mounted through its exit transition (isOpen || isExiting), so\n // without this gate containment would remain active during the exit and yank\n // focus back into the dialog as restoreFocus moves it to the trigger —\n // producing a focus bounce (focusout→focusin→focusout) that React never\n // shows. Releasing containment the instant the exit begins lets focus settle\n // on the trigger in a single move, matching upstream's event sequence.\n <FocusScope contain={!isModalExiting()} restoreFocus>\n <div\n {...domProps()}\n ref={registerModalRef}\n class={renderProps.class()}\n style={renderProps.style()}\n data-entering={dataAttr(isModalEntering())}\n data-exiting={dataAttr(isModalExiting())}\n >\n <Show when={isDismissable()}>\n {/* Faithful to react-aria's DismissButton: a bare button carrying\n only `width/height: 1px` inside a VisuallyHidden `div` wrapper —\n NOT the hidden styles inlined onto the button. The wrapper clips\n it out of sight while the button keeps its intrinsic UA border-box,\n which is exactly what upstream renders (and what D8 target-size\n measures against the pair oracle). Inlining the reset onto the\n button instead collapsed it to a 1x1 box, diverging from\n upstream's ~16x6 sentinel. */}\n <VisuallyHidden elementType=\"div\">\n <button\n aria-label={stringFormatter().format(\"dismiss\")}\n tabindex={-1}\n onClick={close}\n style={{ width: \"1px\", height: \"1px\" }}\n />\n </VisuallyHidden>\n </Show>\n {renderProps.renderChildren()}\n </div>\n </FocusScope>\n );\n}\n\nexport default Modal;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA2EA,MAAM,uBAAuB,cAAgD,IAAI;AAGjF,MAAM,gBAA6C,CAAC;AAEpD,SAAS,0BAA0B;CACjC,KAAK,IAAI,QAAQ,cAAc,SAAS,GAAG,SAAS,GAAG,SAAS,GAE9D,IAAI,EADY,cAAc,MAAM,GAAG,EAAA,EACzB,aACZ,cAAc,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AAAA,KA2BK;GA3BL,OAAA,OA0BEC,YAAAA;IAAC,OAAA,YAAY,eAAe;GAAC,CAAA,GA1B/BD,OAAAA,KA2BK;GA3BL,mBA2BK;GA5BP,OACEA;EA4BU;;AAEhB"}
1
+ {"version":3,"file":"Modal.js","names":["<Show when={isHydrated() && (isOpen() || combinedExiting())}>\n <Portal mount={portalContainer()}>\n <OverlayTriggerStateContext value={state}>\n <InternalModalContext value={internalModalContext}>\n <div\n {...domProps()}\n ref={registerOverlayRef}\n class={renderProps.class()}\n style={renderProps.style()}\n data-entering={dataAttr(overlayEntering())}\n data-exiting={dataAttr(combinedExiting())}\n onPointerDown={handleOverlayPointerDown}\n >\n {renderProps.renderChildrenStable()}\n </div>\n </InternalModalContext>\n </OverlayTriggerStateContext>\n </Portal>\n </Show>","isHydrated() && (isOpen() || combinedExiting())","<Portal mount={portalContainer()}>\n <OverlayTriggerStateContext value={state}>\n <InternalModalContext value={internalModalContext}>\n <div\n {...domProps()}\n ref={registerOverlayRef}\n class={renderProps.class()}\n style={renderProps.style()}\n data-entering={dataAttr(overlayEntering())}\n data-exiting={dataAttr(combinedExiting())}\n onPointerDown={handleOverlayPointerDown}\n >\n {renderProps.renderChildrenStable()}\n </div>\n </InternalModalContext>\n </OverlayTriggerStateContext>\n </Portal>","<OverlayTriggerStateContext value={state}>\n <InternalModalContext value={internalModalContext}>\n <div\n {...domProps()}\n ref={registerOverlayRef}\n class={renderProps.class()}\n style={renderProps.style()}\n data-entering={dataAttr(overlayEntering())}\n data-exiting={dataAttr(combinedExiting())}\n onPointerDown={handleOverlayPointerDown}\n >\n {renderProps.renderChildrenStable()}\n </div>\n </InternalModalContext>\n </OverlayTriggerStateContext>","value={state}","<InternalModalContext value={internalModalContext}>\n <div\n {...domProps()}\n ref={registerOverlayRef}\n class={renderProps.class()}\n style={renderProps.style()}\n data-entering={dataAttr(overlayEntering())}\n data-exiting={dataAttr(combinedExiting())}\n onPointerDown={handleOverlayPointerDown}\n >\n {renderProps.renderChildrenStable()}\n </div>\n </InternalModalContext>","value={internalModalContext}","ref={registerOverlayRef}","onPointerDown={handleOverlayPointerDown}","{renderProps.renderChildrenStable()}","<div\n {...domProps()}\n ref={registerOverlayRef}\n class={renderProps.class()}\n style={renderProps.style()}\n data-entering={dataAttr(overlayEntering())}\n data-exiting={dataAttr(combinedExiting())}\n onPointerDown={handleOverlayPointerDown}\n >\n {renderProps.renderChildrenStable()}\n </div>","<ModalContentWithAutoOverlay {...props} />","<ModalContent {...modalProps}>{props.children}</ModalContent>","<ModalOverlay {...overlayProps}>\n <ModalContent {...modalProps}>{props.children}</ModalContent>\n </ModalOverlay>","{props.children}","<FocusScope contain={!isModalExiting()} restoreFocus>\n <div\n {...domProps()}\n ref={registerModalRef}\n class={renderProps.class()}\n style={renderProps.style()}\n data-entering={dataAttr(isModalEntering())}\n data-exiting={dataAttr(isModalExiting())}\n >\n <Show when={isDismissable()}>\n {/* Faithful to react-aria's DismissButton: a bare button carrying\n only `width/height: 1px` inside a VisuallyHidden `div` wrapper —\n NOT the hidden styles inlined onto the button. The wrapper clips\n it out of sight while the button keeps its intrinsic UA border-box,\n which is exactly what upstream renders (and what D8 target-size\n measures against the pair oracle). Inlining the reset onto the\n button instead collapsed it to a 1x1 box, diverging from\n upstream's ~16x6 sentinel. */}\n <VisuallyHidden elementType=\"div\">\n <button\n aria-label={stringFormatter().format(\"dismiss\")}\n tabindex={-1}\n onClick={close}\n style={{ width: \"1px\", height: \"1px\" }}\n />\n </VisuallyHidden>\n </Show>\n {renderProps.renderChildren()}\n </div>\n </FocusScope>","ref={registerModalRef}","<Show when={isDismissable()}>\n {/* Faithful to react-aria's DismissButton: a bare button carrying\n only `width/height: 1px` inside a VisuallyHidden `div` wrapper —\n NOT the hidden styles inlined onto the button. The wrapper clips\n it out of sight while the button keeps its intrinsic UA border-box,\n which is exactly what upstream renders (and what D8 target-size\n measures against the pair oracle). Inlining the reset onto the\n button instead collapsed it to a 1x1 box, diverging from\n upstream's ~16x6 sentinel. */}\n <VisuallyHidden elementType=\"div\">\n <button\n aria-label={stringFormatter().format(\"dismiss\")}\n tabindex={-1}\n onClick={close}\n style={{ width: \"1px\", height: \"1px\" }}\n />\n </VisuallyHidden>\n </Show>","<VisuallyHidden elementType=\"div\">\n <button\n aria-label={stringFormatter().format(\"dismiss\")}\n tabindex={-1}\n onClick={close}\n style={{ width: \"1px\", height: \"1px\" }}\n />\n </VisuallyHidden>","elementType=\"div\"","<button\n aria-label={stringFormatter().format(\"dismiss\")}\n tabindex={-1}\n onClick={close}\n style={{ width: \"1px\", height: \"1px\" }}\n />","<div\n {...domProps()}\n ref={registerModalRef}\n class={renderProps.class()}\n style={renderProps.style()}\n data-entering={dataAttr(isModalEntering())}\n data-exiting={dataAttr(isModalExiting())}\n >\n <Show when={isDismissable()}>\n {/* Faithful to react-aria's DismissButton: a bare button carrying\n only `width/height: 1px` inside a VisuallyHidden `div` wrapper —\n NOT the hidden styles inlined onto the button. The wrapper clips\n it out of sight while the button keeps its intrinsic UA border-box,\n which is exactly what upstream renders (and what D8 target-size\n measures against the pair oracle). Inlining the reset onto the\n button instead collapsed it to a 1x1 box, diverging from\n upstream's ~16x6 sentinel. */}\n <VisuallyHidden elementType=\"div\">\n <button\n aria-label={stringFormatter().format(\"dismiss\")}\n tabindex={-1}\n onClick={close}\n style={{ width: \"1px\", height: \"1px\" }}\n />\n </VisuallyHidden>\n </Show>\n {renderProps.renderChildren()}\n </div>","{renderProps.renderChildren()}","_$createComponent","_$memo","_$getNextElement","_$scope","_$mergeProps","_$getNextMarker","_$delegateEvents"],"sources":["../src/Modal.tsx"],"sourcesContent":["/*\n * Copyright 2022 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\n// Ported to SolidJS for Proyecto Viviana; based on packages/react-aria-components/src/Modal.tsx\n\n/**\n * Modal and ModalOverlay components for solidaria-components\n *\n * Headless modal components with overlay, focus trapping, and dismissal handling.\n * Port of react-aria-components Modal.\n */\n\nimport {\n createContext,\n createMemo,\n createSignal,\n Show,\n useContext,\n createTrackedEffect,\n} from \"solid-js\";\nimport type { JSX } from \"@solidjs/web\";\nimport { Portal, isServer } from \"@solidjs/web\";\nimport {\n createInteractOutside,\n createPreventScroll,\n ariaHideOutside,\n FocusScope,\n useUNSAFE_PortalContext,\n createEnterAnimation,\n createExitAnimation,\n createStringFormatter,\n overlaysIntlStrings,\n} from \"@proyecto-viviana/solidaria\";\nimport {\n type RenderChildren,\n type ClassNameOrFunction,\n type StyleOrFunction,\n useRenderProps,\n filterDOMProps,\n dataAttr,\n useIsHydrated,\n} from \"./utils\";\nimport {\n DialogTriggerContext,\n OverlayTriggerStateContext,\n type OverlayTriggerState,\n} from \"./contexts\";\nimport { VisuallyHidden } from \"./VisuallyHidden\";\nimport { splitProps } from \"@proyecto-viviana/solidaria/utils\";\n\n/**\n * Internal context to signal that Modal is wrapped in ModalOverlay.\n * When present, Modal should not create its own Portal.\n */\ninterface InternalModalContextValue {\n isDismissable?: boolean;\n isKeyboardDismissDisabled?: boolean;\n // Upstream's ModalOverlay owns the modal element's ref so it can watch the\n // modal surface's exit animation alongside the overlay's (both must finish\n // before the overlay unmounts). ModalContent registers its element here.\n setModalRef?: (element: HTMLElement | null) => void;\n // Combined exit flag (overlay OR modal still exiting). Both the overlay and\n // the modal surface carry `data-exiting` off this so they fade out together.\n isExiting?: () => boolean;\n}\n\nconst InternalModalContext = createContext<InternalModalContextValue | null>(null);\n\n// Stack of visible modals, used to ensure only the top-most modal dismisses on Escape/outside interaction.\nconst visibleModals: Array<() => Element | null> = [];\n\nfunction pruneDisconnectedModals() {\n for (let index = visibleModals.length - 1; index >= 0; index -= 1) {\n const element = visibleModals[index]?.();\n if (!element?.isConnected) {\n visibleModals.splice(index, 1);\n }\n }\n}\n\nexport interface ModalRenderProps {\n /** Whether the modal is currently entering (for animations). */\n isEntering: boolean;\n /** Whether the modal is currently exiting (for animations). */\n isExiting: boolean;\n}\n\nexport interface ModalOverlayProps {\n /** The children of the component - can be JSX or render function. */\n children?: RenderChildren<ModalRenderProps>;\n /** The CSS className for the element. */\n class?: ClassNameOrFunction<ModalRenderProps>;\n /** The inline style for the element. */\n style?: StyleOrFunction<ModalRenderProps>;\n /** Whether the modal is open (controlled). */\n isOpen?: boolean;\n /** Whether the modal opens by default (uncontrolled). */\n defaultOpen?: boolean;\n /** Handler called when the modal's open state changes. */\n onOpenChange?: (isOpen: boolean) => void;\n /** Whether clicking outside the modal closes it. */\n isDismissable?: boolean;\n /** Whether pressing Escape closes the modal. */\n isKeyboardDismissDisabled?: boolean;\n /** Whether the modal is entering (for animations). */\n isEntering?: boolean;\n /** Whether the modal is exiting (for animations). */\n isExiting?: boolean;\n}\n\nexport interface ModalProps extends ModalOverlayProps {}\n\nexport { OverlayTriggerStateContext, type OverlayTriggerState } from \"./contexts\";\nexport { useOverlayTriggerState } from \"./contexts\";\nexport const ModalContext = OverlayTriggerStateContext;\n\n/**\n * ModalOverlay is the backdrop/underlay behind a modal.\n * It handles click-outside dismissal and provides styling hooks.\n */\nexport function ModalOverlay(props: ModalOverlayProps): JSX.Element {\n // Do NOT early-return on the server: rendering children bare on the server and a\n // <Show>/<Portal> overlay on the client desyncs hydration. Run the same structure\n // on both and gate the Portal on useIsHydrated() (see Popover for the rationale).\n const isHydrated = useIsHydrated();\n\n // IMPORTANT: Don't destructure or access props.children early!\n // In SolidJS, children are lazily evaluated. Accessing them before\n // the context provider renders causes them to evaluate outside the context.\n // See: https://github.com/solidjs/solid/issues/182\n const [local, rest] = splitProps(props, [\n \"class\",\n \"style\",\n \"isOpen\",\n \"defaultOpen\",\n \"onOpenChange\",\n \"isDismissable\",\n \"isKeyboardDismissDisabled\",\n \"isEntering\",\n \"isExiting\",\n ]);\n\n // Get state from DialogTrigger context if available\n const dialogTriggerContext = useContext(DialogTriggerContext);\n\n // Internal state for uncontrolled mode\n const [internalOpen, setInternalOpen] = createSignal(local.defaultOpen ?? false);\n\n // Determine if open (controlled > DialogTrigger context > uncontrolled)\n const isOpen = (): boolean => {\n if (local.isOpen !== undefined) return local.isOpen;\n if (dialogTriggerContext) return dialogTriggerContext.state.isOpen();\n return internalOpen();\n };\n\n const close = () => {\n if (local.isOpen !== undefined) {\n local.onOpenChange?.(false);\n } else if (dialogTriggerContext) {\n dialogTriggerContext.state.close();\n local.onOpenChange?.(false);\n } else {\n setInternalOpen(false);\n local.onOpenChange?.(false);\n }\n };\n\n const open = () => {\n if (local.isOpen !== undefined) {\n local.onOpenChange?.(true);\n } else if (dialogTriggerContext) {\n dialogTriggerContext.state.open();\n local.onOpenChange?.(true);\n } else {\n setInternalOpen(true);\n local.onOpenChange?.(true);\n }\n };\n\n const toggle = () => {\n if (isOpen()) {\n close();\n } else {\n open();\n }\n };\n\n const state: OverlayTriggerState = {\n get isOpen() {\n return isOpen();\n },\n open,\n close,\n toggle,\n setOpen: (next) => {\n if (next) open();\n else close();\n },\n get point() {\n return null;\n },\n setPoint: () => {},\n };\n\n // Enter/exit animation state (mirrors upstream's ModalOverlayWithForwardRef +\n // ModalOverlayInner). The overlay stays mounted here even while closed, so the\n // enter animation is gated on `isOpen` (isReady) — otherwise it would resolve\n // to \"done entering\" before the element ever mounts. Exit is watched for BOTH\n // the overlay and the modal surface; the modal registers its element via\n // InternalModalContext (setModalRef) so we can await its exit too.\n let overlayRef!: HTMLDivElement;\n // Signal-backed so the enter/exit effects re-run once the element mounts — a\n // plain closure over `overlayRef` would read `null` if the effect fired first\n // and, with no reactive dep on the ref, never recover (stuck `data-entering`).\n const [overlayEl, setOverlayEl] = createSignal<HTMLElement | null>(null, { ownedWrite: true });\n const overlayRefAccessor = () => overlayEl();\n const registerOverlayRef = (element: HTMLDivElement) => {\n overlayRef = element;\n setOverlayEl(element);\n };\n const [modalEl, setModalEl] = createSignal<HTMLElement | null>(null, { ownedWrite: true });\n\n const isOverlayEntering = createEnterAnimation(overlayRefAccessor, isOpen);\n const isOverlayExiting = createExitAnimation(overlayRefAccessor, isOpen);\n const isModalExiting = createExitAnimation(() => modalEl(), isOpen);\n const overlayEntering = () => isOverlayEntering() || (local.isEntering ?? false);\n const combinedExiting = () =>\n isOverlayExiting() || isModalExiting() || (local.isExiting ?? false);\n\n const renderValues = createMemo<ModalRenderProps>(() => ({\n isEntering: overlayEntering(),\n isExiting: combinedExiting(),\n }));\n\n // Keep children lazy until insertion inside the overlay contexts.\n const renderProps = useRenderProps(\n {\n get children() {\n return props.children;\n },\n get class() {\n return local.class;\n },\n get style() {\n return local.style;\n },\n defaultClassName: \"solidaria-ModalOverlay\",\n },\n renderValues,\n );\n\n const domProps = createMemo(() =>\n filterDOMProps(rest as Record<string, unknown>, { global: true }),\n );\n\n // Internal context value to signal Modal that it's wrapped\n const internalModalContext: InternalModalContextValue = {\n isDismissable: local.isDismissable,\n isKeyboardDismissDisabled: local.isKeyboardDismissDisabled,\n setModalRef: setModalEl,\n isExiting: combinedExiting,\n };\n const portalContext = useUNSAFE_PortalContext();\n const portalContainer = () => portalContext.getContainer?.() ?? undefined;\n\n const isTopMostModalInOverlay = () => {\n pruneDisconnectedModals();\n const topMostModal = visibleModals[visibleModals.length - 1]?.();\n return !topMostModal || overlayRef?.contains(topMostModal);\n };\n\n const handleOverlayPointerDown: JSX.EventHandler<HTMLDivElement, PointerEvent> = (event) => {\n if (local.isDismissable && event.target === event.currentTarget && isTopMostModalInOverlay()) {\n close();\n }\n };\n\n return (\n <Show when={isHydrated() && (isOpen() || combinedExiting())}>\n <Portal mount={portalContainer()}>\n <OverlayTriggerStateContext value={state}>\n <InternalModalContext value={internalModalContext}>\n <div\n {...domProps()}\n ref={registerOverlayRef}\n class={renderProps.class()}\n style={renderProps.style()}\n data-entering={dataAttr(overlayEntering())}\n data-exiting={dataAttr(combinedExiting())}\n onPointerDown={handleOverlayPointerDown}\n >\n {renderProps.renderChildrenStable()}\n </div>\n </InternalModalContext>\n </OverlayTriggerStateContext>\n </Portal>\n </Show>\n );\n}\n\n/**\n * Modal is a dialog container that manages focus trapping, scroll prevention,\n * aria-hiding of content outside, and dismissal.\n *\n * Usage patterns:\n * 1. Standalone: `<Modal isOpen>...</Modal>` - Creates its own overlay\n * 2. With custom overlay: `<ModalOverlay><Modal>...</Modal></ModalOverlay>`\n *\n * Note: Due to SolidJS's eager JSX evaluation, we cannot detect at render time\n * whether Modal is wrapped in ModalOverlay. So standalone Modal always creates\n * an overlay, and wrapped Modal renders directly (relying on InternalModalContext).\n */\nexport function Modal(props: ModalProps): JSX.Element {\n // Check for InternalModalContext which signals we're inside a rendered ModalOverlay\n // This works because ModalContent is rendered INSIDE ModalOverlay's Show/Portal\n return <ModalContentWithAutoOverlay {...props} />;\n}\n\n/**\n * Helper component that handles the overlay detection.\n * By being a separate component, we can use Show to defer rendering until\n * the parent context is available.\n */\nfunction ModalContentWithAutoOverlay(props: ModalProps): JSX.Element {\n const [overlayProps, modalProps] = splitProps(props, [\n \"isOpen\",\n \"defaultOpen\",\n \"onOpenChange\",\n \"isDismissable\",\n \"isKeyboardDismissDisabled\",\n \"isEntering\",\n \"isExiting\",\n ]);\n\n // Check for InternalModalContext - if present, we're inside a ModalOverlay\n const internalContext = useContext(InternalModalContext);\n\n // If wrapped in ModalOverlay, just render the content. ModalContent reads the\n // overlay's InternalModalContext itself (via useContext), so nothing needs\n // threading — in both branches ModalContent renders inside a provider.\n if (internalContext) {\n return <ModalContent {...modalProps}>{props.children}</ModalContent>;\n }\n\n // For standalone usage, wrap in ModalOverlay.\n return (\n <ModalOverlay {...overlayProps}>\n <ModalContent {...modalProps}>{props.children}</ModalContent>\n </ModalOverlay>\n );\n}\n\n/**\n * Internal component that renders the actual modal content.\n * Used by both standalone Modal and Modal wrapped in ModalOverlay.\n */\nfunction ModalContent(props: ModalProps): JSX.Element {\n if (isServer) {\n return <>{props.children}</>;\n }\n\n const [local, rest] = splitProps(props, [\n \"children\",\n \"class\",\n \"style\",\n \"isOpen\",\n \"defaultOpen\",\n \"onOpenChange\",\n \"isDismissable\",\n \"isKeyboardDismissDisabled\",\n \"isEntering\",\n \"isExiting\",\n ]);\n\n const stringFormatter = createStringFormatter(overlaysIntlStrings, \"@react-aria/overlays\");\n\n let modalRef!: HTMLDivElement;\n const modalRefAccessor = () => modalRef ?? null;\n // Signal-backed element for the enter animation, so the effect re-runs when\n // the surface mounts (see the overlay's note); the plain `modalRef` var still\n // backs the synchronous consumers (focus stack, interact-outside, aria-hide).\n const [modalEl, setModalEl] = createSignal<HTMLElement | null>(null, { ownedWrite: true });\n\n // Get state from parent OverlayTriggerStateContext (provided by ModalOverlay)\n const parentState = useContext(OverlayTriggerStateContext);\n\n // The overlay (auto or user-provided) always wraps this content, so it owns\n // the InternalModalContext: dismissal settings, the modal-ref registration\n // sink, and the combined exit flag.\n const internalContext = useContext(InternalModalContext);\n\n // Get dismissable settings from internal context (set by ModalOverlay)\n const isDismissable = () => internalContext?.isDismissable ?? local.isDismissable;\n const isKeyboardDismissDisabled = () =>\n internalContext?.isKeyboardDismissDisabled ?? local.isKeyboardDismissDisabled;\n\n // Determine if open from parent state\n const isOpen = (): boolean => {\n if (local.isOpen !== undefined) return local.isOpen;\n return parentState?.isOpen ?? false;\n };\n\n // Register this element with the overlay so it can await the modal surface's\n // exit animation (upstream threads modalRef down the same way). The overlay's\n // combined exit flag drives this surface's `data-exiting`. The enter animation\n // is local — the modal fades/slides in on its own timeline (delay 160 vs the\n // overlay's 0).\n const registerModalRef = (element: HTMLDivElement) => {\n modalRef = element;\n setModalEl(element);\n internalContext?.setModalRef?.(element);\n };\n const isModalEntering = createEnterAnimation(() => modalEl(), isOpen);\n const isModalExiting = () => internalContext?.isExiting?.() ?? local.isExiting ?? false;\n\n // Keep this modal in a global stack so nested modals dismiss in top-down order.\n createTrackedEffect(() => {\n const _s2Cleanups: Array<() => void> = [];\n\n if (!isOpen()) return;\n\n pruneDisconnectedModals();\n if (!visibleModals.includes(modalRefAccessor)) {\n visibleModals.push(modalRefAccessor);\n }\n\n _s2Cleanups.push(() => {\n const index = visibleModals.indexOf(modalRefAccessor);\n if (index >= 0) {\n visibleModals.splice(index, 1);\n }\n });\n\n return () => {\n for (const c of _s2Cleanups) c();\n };\n });\n\n const isTopMostModal = () => {\n pruneDisconnectedModals();\n return visibleModals[visibleModals.length - 1] === modalRefAccessor;\n };\n\n const close = () => {\n if (local.isOpen !== undefined) {\n local.onOpenChange?.(false);\n } else {\n parentState?.close();\n }\n };\n\n // Prevent scroll when modal is open. Upstream `useModalOverlay.ts:65-67`\n // calls `usePreventScroll`, which is refcounted across every holder and\n // handles the scrollbar gutter and mobile Safari; a one-off\n // `overflow: hidden` here joined none of that.\n createPreventScroll({\n get isDisabled() {\n return !isOpen();\n },\n });\n\n // Click outside to close (if dismissable)\n createInteractOutside({\n ref: modalRefAccessor,\n onInteractOutside: () => {\n if (isTopMostModal()) {\n close();\n }\n },\n get isDisabled() {\n return !isOpen() || !isDismissable();\n },\n });\n\n // Escape key to close\n createTrackedEffect(() => {\n const _s2Cleanups: Array<() => void> = [];\n\n if (!isOpen() || isKeyboardDismissDisabled()) return;\n\n const handleKeyDown = (e: KeyboardEvent) => {\n if (e.key === \"Escape\" && !e.isComposing && isTopMostModal()) {\n e.preventDefault();\n e.stopPropagation();\n close();\n }\n };\n\n // ModalContent owns Escape, matching RAC's useModalOverlay modalProps.\n // Bubble phase preserves inner-widget Escape precedence (useOverlay parity).\n document.addEventListener(\"keydown\", handleKeyDown, false);\n _s2Cleanups.push(() => {\n document.removeEventListener(\"keydown\", handleKeyDown, false);\n });\n\n return () => {\n for (const c of _s2Cleanups) c();\n };\n });\n\n // Aria-hide outside content\n createTrackedEffect(() => {\n const _s2Cleanups: Array<() => void> = [];\n\n if (!isOpen() || !modalRef) return;\n\n let cleanup: (() => void) | undefined;\n let cancelled = false;\n const ownerWindow = modalRef.ownerDocument.defaultView ?? window;\n\n const hideOutside = () => {\n if (cancelled || !modalRef?.isConnected) return;\n cleanup = ariaHideOutside([modalRef], { shouldUseInert: true });\n };\n\n if (modalRef.isConnected) {\n hideOutside();\n } else {\n ownerWindow.queueMicrotask(hideOutside);\n }\n\n _s2Cleanups.push(() => {\n cancelled = true;\n cleanup?.();\n });\n\n return () => {\n for (const c of _s2Cleanups) c();\n };\n });\n\n const renderValues = createMemo<ModalRenderProps>(() => ({\n isEntering: isModalEntering(),\n isExiting: isModalExiting(),\n }));\n\n const renderProps = useRenderProps(\n {\n // Lazy: the modal content is gated behind `<Show when={isHydrated() && …}>`\n // (Portal) below, so it must not be instantiated during the component body.\n // An eager `children: props.children` would build the content template (and\n // walk getNextElement) before the gate — content the server never emitted →\n // hydration mismatch. See Popover for the full rationale.\n get children() {\n return props.children;\n },\n get class() {\n return local.class;\n },\n get style() {\n return local.style;\n },\n defaultClassName: \"solidaria-Modal\",\n },\n renderValues,\n );\n\n const domProps = createMemo(() =>\n filterDOMProps(rest as Record<string, unknown>, { global: true }),\n );\n\n return (\n // No autoFocus: react-aria's Overlay renders FocusScope with restoreFocus +\n // contain only — initial focus is useDialog's job (it focuses the dialog\n // element itself when nothing inside holds focus).\n //\n // `contain` is gated on `!isExiting`, mirroring react-aria's Overlay\n // (react-aria/src/overlays/Overlay.tsx: `contain={... && !isExiting}`). The\n // overlay stays mounted through its exit transition (isOpen || isExiting), so\n // without this gate containment would remain active during the exit and yank\n // focus back into the dialog as restoreFocus moves it to the trigger —\n // producing a focus bounce (focusout→focusin→focusout) that React never\n // shows. Releasing containment the instant the exit begins lets focus settle\n // on the trigger in a single move, matching upstream's event sequence.\n <FocusScope contain={!isModalExiting()} restoreFocus>\n <div\n {...domProps()}\n ref={registerModalRef}\n class={renderProps.class()}\n style={renderProps.style()}\n data-entering={dataAttr(isModalEntering())}\n data-exiting={dataAttr(isModalExiting())}\n >\n <Show when={isDismissable()}>\n {/* Faithful to react-aria's DismissButton: a bare button carrying\n only `width/height: 1px` inside a VisuallyHidden `div` wrapper —\n NOT the hidden styles inlined onto the button. The wrapper clips\n it out of sight while the button keeps its intrinsic UA border-box,\n which is exactly what upstream renders (and what D8 target-size\n measures against the pair oracle). Inlining the reset onto the\n button instead collapsed it to a 1x1 box, diverging from\n upstream's ~16x6 sentinel. */}\n <VisuallyHidden elementType=\"div\">\n <button\n aria-label={stringFormatter().format(\"dismiss\")}\n tabindex={-1}\n onClick={close}\n style={{ width: \"1px\", height: \"1px\" }}\n />\n </VisuallyHidden>\n </Show>\n {renderProps.renderChildren()}\n </div>\n </FocusScope>\n );\n}\n\nexport default Modal;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA2EA,MAAM,uBAAuB,cAAgD,IAAI;AAGjF,MAAM,gBAA6C,CAAC;AAEpD,SAAS,0BAA0B;CACjC,KAAK,IAAI,QAAQ,cAAc,SAAS,GAAG,SAAS,GAAG,SAAS,GAE9D,IAAI,EADY,cAAc,MAAM,GAAG,EAAA,EACzB,aACZ,cAAc,OAAO,OAAO,CAAC;AAGnC;AAoCA,MAAa,eAAe;;;;;AAM5B,SAAgB,aAAa,OAAuC;CAIlE,MAAM,aAAa,cAAc;CAMjC,MAAM,CAAC,OAAO,QAAQ,WAAW,OAAO;EACtC;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACF,CAAC;CAGD,MAAM,uBAAuB,WAAW,oBAAoB;CAG5D,MAAM,CAAC,cAAc,mBAAmB,aAAa,MAAM,eAAe,KAAK;CAG/E,MAAM,eAAwB;EAC5B,IAAI,MAAM,WAAW,KAAA,GAAW,OAAO,MAAM;EAC7C,IAAI,sBAAsB,OAAO,qBAAqB,MAAM,OAAO;EACnE,OAAO,aAAa;CACtB;CAEA,MAAM,cAAc;EAClB,IAAI,MAAM,WAAW,KAAA,GACnB,MAAM,eAAe,KAAK;OACrB,IAAI,sB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AAA,CAAA,OAAA,SAAAA,cAAA,MAAA,WAAA;GAzBH,UAAA;IAAK,OAAA;GAAgB,GAArBZ,KAAqB;GADjB,OAAA,OAAA,CAAA,UAAA;IAEJ,IAAA,UAAA;KAAO,OAAA,YAAY,MAAM;IAAC;IAC1B,IAAA,QAAA;KAAO,OAAA,YAAY,MAAM;IAAC;IAC1B,IAAA,kBAAA;KAAe,OAAA,SAAS,gBAAgB,CAAC;IAAC;IAC1C,IAAA,iBAAA;KAAc,OAAA,SAAS,eAAe,CAAC;IAAC;;GAN1C,OAAA,OAQEC,gBAAAA,MAAAA;IAAM,IAAA,OAAA;KAAM,OAAA,cAAc;IAAC;IAA3B,IAAA,WAAA;KASEC,OAAAA,gBAAAA,gBAAAA;MAAgBC,aAAY;MAA5B,IAAA,WAAA;OACE,IAAA,QAAAM,eAAA,OAKC;OAFC,MAAA,WAAS;OAFT,aAAY,gBAAgB,CAAC,CAAC,OAAO,SAAS,IAA9C,QAAA;QAA+C,aAAA,OAAA,cAAA,GAAA;;OADjD,mBAKC;OANH,OACEL;MAMc;;IACZ;GAzBRC,CAAAA,GAAAA,OAAAA,KA2BK;GA3BL,OAAA,OA0BEC,YAAAA;IAAC,OAAA,YAAY,eAAe;GAAC,CAAA,GA1B/BD,OAAAA,KA2BK;GA3BL,mBA2BK;GA5BP,OACEA;EA4BU;;AAEhB"}
@@ -1,14 +1 @@
1
- /*
2
- * Copyright 2023 Adobe. All rights reserved.
3
- * This file is licensed to you under the Apache License, Version 2.0 (the "License");
4
- * you may not use this file except in compliance with the License. You may obtain a copy
5
- * of the License at http://www.apache.org/licenses/LICENSE-2.0
6
- *
7
- * Unless required by applicable law or agreed to in writing, software distributed under
8
- * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
9
- * OF ANY KIND, either express or implied. See the License for the specific language
10
- * governing permissions and limitations under the License.
11
- */
12
- // Ported to SolidJS for Proyecto Viviana; based on packages/react-aria/src/utils/openLink.tsx
13
- import { RouterContext, RouterProvider, getSyntheticLink, getSyntheticLinkProps, handleLinkClick, openLink, openSyntheticLink, shouldClientNavigate, useLinkProps, useRouter, useSyntheticLinkProps } from "@proyecto-viviana/solidaria/utils";
14
- export { RouterContext, RouterProvider, getSyntheticLink, getSyntheticLinkProps, handleLinkClick, openLink, openSyntheticLink, shouldClientNavigate, useLinkProps, useRouter, useSyntheticLinkProps };
1
+ export { RouterContext, RouterProvider, getSyntheticLink, getSyntheticLinkProps, handleLinkClick, openLink, openSyntheticLink, shouldClientNavigate, useLinkProps, useRouter, useSyntheticLinkProps } from "@proyecto-viviana/solidaria/utils";
@@ -1,14 +1 @@
1
- /*
2
- * Copyright 2023 Adobe. All rights reserved.
3
- * This file is licensed to you under the Apache License, Version 2.0 (the "License");
4
- * you may not use this file except in compliance with the License. You may obtain a copy
5
- * of the License at http://www.apache.org/licenses/LICENSE-2.0
6
- *
7
- * Unless required by applicable law or agreed to in writing, software distributed under
8
- * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
9
- * OF ANY KIND, either express or implied. See the License for the specific language
10
- * governing permissions and limitations under the License.
11
- */
12
- // Ported to SolidJS for Proyecto Viviana; based on packages/react-aria/src/utils/openLink.tsx
13
- import { RouterContext, RouterProvider, getSyntheticLink, getSyntheticLinkProps, handleLinkClick, openLink, openSyntheticLink, shouldClientNavigate, useLinkProps, useRouter, useSyntheticLinkProps } from "@proyecto-viviana/solidaria/utils";
14
- export { RouterContext, RouterProvider, getSyntheticLink, getSyntheticLinkProps, handleLinkClick, openLink, openSyntheticLink, shouldClientNavigate, useLinkProps, useRouter, useSyntheticLinkProps };
1
+ export { RouterContext, RouterProvider, getSyntheticLink, getSyntheticLinkProps, handleLinkClick, openLink, openSyntheticLink, shouldClientNavigate, useLinkProps, useRouter, useSyntheticLinkProps } from "@proyecto-viviana/solidaria/utils";