@solid2-aria/vaul 0.0.1 → 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -2,14 +2,16 @@
2
2
 
3
3
  Build unstyled, draggable drawers with Solid 2. This package ports [Vaul](https://github.com/emilkowalski/vaul) 1.1.2 and uses Solid2 Aria for focus management and scroll prevention.
4
4
 
5
- ## Add a drawer
5
+ ## Installation
6
6
 
7
7
  Install the package alongside Solid 2 and its web renderer:
8
8
 
9
9
  ```sh
10
- bun add @solid2-aria/vaul solid-js@^2.0.0-rc.17 @solidjs/web@^2.0.0-rc.17
10
+ bun add @solid2-aria/vaul solid-js@next @solidjs/web@next
11
11
  ```
12
12
 
13
+ ## Add a drawer
14
+
13
15
  Set `jsxImportSource` to `@solidjs/web` in your TypeScript configuration. Import the drawer stylesheet once in your application:
14
16
 
15
17
  ```tsx
@@ -669,29 +669,24 @@ function Portal(props) {
669
669
  onSettled(() => {
670
670
  setMounted(true);
671
671
  });
672
- return createComponent(Show, {
673
- get when() {
674
- return memo(() => {
675
- return !!mounted();
676
- })() ? context.present || props.forceMount === true : mounted();
677
- },
678
- get children() {
679
- return createComponent(Portal$1, {
680
- get mount() {
681
- return props.container ?? context.props.container ?? document.body;
682
- },
683
- get children() {
684
- return createComponent(PortalContext, {
685
- get value() {
686
- return props.forceMount ?? false;
687
- },
688
- get children() {
689
- return props.children;
690
- }
691
- });
692
- }
693
- });
694
- }
672
+ return memo(() => {
673
+ return memo(() => {
674
+ return !!(mounted() && (context.present || props.forceMount === true));
675
+ })() ? createComponent(Portal$1, {
676
+ get mount() {
677
+ return props.container ?? context.props.container ?? document.body;
678
+ },
679
+ get children() {
680
+ return createComponent(PortalContext, {
681
+ get value() {
682
+ return props.forceMount ?? false;
683
+ },
684
+ get children() {
685
+ return props.children;
686
+ }
687
+ });
688
+ }
689
+ }) : void 0;
695
690
  });
696
691
  }
697
692
  function Trigger(props) {
@@ -760,15 +755,10 @@ function Close(props) {
760
755
  function Overlay(props) {
761
756
  const context = useContext(DrawerContext);
762
757
  const forceMount = useContext(PortalContext);
763
- return createComponent(Show, {
764
- get when() {
765
- return memo(() => {
766
- return !!context.modal;
767
- })() ? context.present || props.forceMount === true || forceMount : context.modal;
768
- },
769
- get children() {
770
- return createComponent(OverlayElement, props);
771
- }
758
+ return memo(() => {
759
+ return memo(() => {
760
+ return !!(context.modal && (context.present || props.forceMount === true || forceMount));
761
+ })() ? createComponent(OverlayElement, props) : void 0;
772
762
  });
773
763
  }
774
764
  function OverlayElement(props) {
@@ -804,13 +794,10 @@ function OverlayElement(props) {
804
794
  function Content(props) {
805
795
  const context = useContext(DrawerContext);
806
796
  const forceMount = useContext(PortalContext);
807
- return createComponent(Show, {
808
- get when() {
809
- return context.present || props.forceMount === true || forceMount;
810
- },
811
- get children() {
812
- return createComponent(ContentElement, props);
813
- }
797
+ return memo(() => {
798
+ return memo(() => {
799
+ return !!(context.present || props.forceMount === true || forceMount);
800
+ })() ? createComponent(ContentElement, props) : void 0;
814
801
  });
815
802
  }
816
803
  function ContentElement(props) {
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["<DrawerContext value={context}>{props.children}</DrawerContext>","value={context}","<Show when={mounted() && (context.present || props.forceMount === true)}>\n <SolidPortal\n mount={props.container ?? context.props.container ?? document.body}\n >\n <PortalContext value={props.forceMount ?? false}>\n {props.children}\n </PortalContext>\n </SolidPortal>\n </Show>","mounted() && (context.present || props.forceMount === true)","<SolidPortal\n mount={props.container ?? context.props.container ?? document.body}\n >\n <PortalContext value={props.forceMount ?? false}>\n {props.children}\n </PortalContext>\n </SolidPortal>","<PortalContext value={props.forceMount ?? false}>\n {props.children}\n </PortalContext>","<Show when={props.render} keyed fallback={<button {...attributes} />}>\n {(render) => render(attributes)}\n </Show>","<button {...attributes} />","<Show\n when={\n context.modal &&\n (context.present || props.forceMount === true || forceMount)\n }\n >\n <OverlayElement {...props} />\n </Show>","context.modal &&\n (context.present || props.forceMount === true || forceMount)","<OverlayElement {...props} />","ref={[\n props.ref,\n (element) => {\n context.setOverlay(element);\n },\n ]}","<div\n {...rest}\n ref={[\n props.ref,\n (element) => {\n context.setOverlay(element);\n },\n ]}\n data-vaul-overlay=\"\"\n data-state={context.isOpen ? \"open\" : \"closed\"}\n data-vaul-snap-points={\n (context.props.snapPoints?.length ?? 0) > 0 ? \"true\" : \"false\"\n }\n data-vaul-snap-points-overlay={context.shouldFade ? \"true\" : \"false\"}\n data-vaul-animate={context.shouldAnimate ? \"true\" : \"false\"}\n />","<Show when={context.present || props.forceMount === true || forceMount}>\n <ContentElement {...props} />\n </Show>","<ContentElement {...props} />","<FocusScope contain={context.isOpen && context.modal && !context.childOpen}>\n <div\n id={context.contentId}\n role=\"dialog\"\n aria-modal={context.modal ? \"true\" : undefined}\n aria-labelledby={context.titleId}\n aria-describedby={context.descriptionId}\n tabindex={-1}\n {...rest}\n ref={[\n props.ref,\n (element) => {\n context.setContent(element);\n },\n ]}\n data-state={context.isOpen ? \"open\" : \"closed\"}\n data-vaul-drawer=\"\"\n data-vaul-drawer-direction={context.direction}\n data-vaul-custom-container={context.props.container ? \"true\" : \"false\"}\n data-vaul-snap-points={\n (context.props.snapPoints?.length ?? 0) > 0 ? \"true\" : \"false\"\n }\n data-vaul-delayed-snap-points={\n context.snapPointsOffset.length > 0 ? \"true\" : \"false\"\n }\n data-vaul-handle-only={\n context.props.handleOnly === true ? \"true\" : \"false\"\n }\n data-vaul-animate={context.shouldAnimate ? \"true\" : \"false\"}\n onPointerDown={(event) => {\n callHandler(props.onPointerDown, event);\n context.press(event);\n }}\n onPointerMove={(event) => {\n callHandler(props.onPointerMove, event);\n\n if (!event.defaultPrevented) {\n context.drag(event);\n }\n }}\n onPointerUp={(event) => {\n callHandler(props.onPointerUp, event);\n context.release(event);\n }}\n onPointerCancel={(event) => {\n callHandler(props.onPointerCancel, event);\n context.cancelDrag();\n }}\n onLostPointerCapture={(event) => {\n callHandler(props.onLostPointerCapture, event);\n context.cancelDrag();\n }}\n />\n </FocusScope>","context.isOpen && context.modal && !context.childOpen","role=\"dialog\"","tabindex={-1}","onPointerDown={(event) => {\n callHandler(props.onPointerDown, event);\n context.press(event);\n }}","onPointerMove={(event) => {\n callHandler(props.onPointerMove, event);\n\n if (!event.defaultPrevented) {\n context.drag(event);\n }\n }}","onPointerUp={(event) => {\n callHandler(props.onPointerUp, event);\n context.release(event);\n }}","onPointerCancel={(event) => {\n callHandler(props.onPointerCancel, event);\n context.cancelDrag();\n }}","onLostPointerCapture={(event) => {\n callHandler(props.onLostPointerCapture, event);\n context.cancelDrag();\n }}","ref={[\n props.ref,\n (element) => {\n context.setContent(element);\n },\n ]}","<div\n id={context.contentId}\n role=\"dialog\"\n aria-modal={context.modal ? \"true\" : undefined}\n aria-labelledby={context.titleId}\n aria-describedby={context.descriptionId}\n tabindex={-1}\n {...rest}\n ref={[\n props.ref,\n (element) => {\n context.setContent(element);\n },\n ]}\n data-state={context.isOpen ? \"open\" : \"closed\"}\n data-vaul-drawer=\"\"\n data-vaul-drawer-direction={context.direction}\n data-vaul-custom-container={context.props.container ? \"true\" : \"false\"}\n data-vaul-snap-points={\n (context.props.snapPoints?.length ?? 0) > 0 ? \"true\" : \"false\"\n }\n data-vaul-delayed-snap-points={\n context.snapPointsOffset.length > 0 ? \"true\" : \"false\"\n }\n data-vaul-handle-only={\n context.props.handleOnly === true ? \"true\" : \"false\"\n }\n data-vaul-animate={context.shouldAnimate ? \"true\" : \"false\"}\n onPointerDown={(event) => {\n callHandler(props.onPointerDown, event);\n context.press(event);\n }}\n onPointerMove={(event) => {\n callHandler(props.onPointerMove, event);\n\n if (!event.defaultPrevented) {\n context.drag(event);\n }\n }}\n onPointerUp={(event) => {\n callHandler(props.onPointerUp, event);\n context.release(event);\n }}\n onPointerCancel={(event) => {\n callHandler(props.onPointerCancel, event);\n context.cancelDrag();\n }}\n onLostPointerCapture={(event) => {\n callHandler(props.onLostPointerCapture, event);\n context.cancelDrag();\n }}\n />","<h2 id={context.titleId} {...props} />","<p id={context.descriptionId} {...props} />","onClick={(event) => {\n callHandler(props.onClick, event);\n\n if (!event.defaultPrevented) {\n cycle();\n }\n }}","onPointerDown={(event) => {\n callHandler(props.onPointerDown, event);\n\n if (event.defaultPrevented) {\n return;\n }\n\n pressTime = Date.now();\n pressPosition = { x: event.clientX, y: event.clientY };\n moved = false;\n context.press(event, true);\n event.stopPropagation();\n }}","onPointerMove={(event) => {\n callHandler(props.onPointerMove, event);\n\n if (\n Math.abs(event.clientX - pressPosition.x) > 2 ||\n Math.abs(event.clientY - pressPosition.y) > 2\n ) {\n moved = true;\n }\n }}","onPointerCancel={(event) => {\n callHandler(props.onPointerCancel, event);\n moved = true;\n context.cancelDrag();\n }}","{props.children}","<div\n {...rest}\n data-vaul-handle=\"\"\n aria-hidden=\"true\"\n data-vaul-drawer-visible={context.isOpen ? \"true\" : \"false\"}\n onClick={(event) => {\n callHandler(props.onClick, event);\n\n if (!event.defaultPrevented) {\n cycle();\n }\n }}\n onPointerDown={(event) => {\n callHandler(props.onPointerDown, event);\n\n if (event.defaultPrevented) {\n return;\n }\n\n pressTime = Date.now();\n pressPosition = { x: event.clientX, y: event.clientY };\n moved = false;\n context.press(event, true);\n event.stopPropagation();\n }}\n onPointerMove={(event) => {\n callHandler(props.onPointerMove, event);\n\n if (\n Math.abs(event.clientX - pressPosition.x) > 2 ||\n Math.abs(event.clientY - pressPosition.y) > 2\n ) {\n moved = true;\n }\n }}\n onPointerCancel={(event) => {\n callHandler(props.onPointerCancel, event);\n moved = true;\n context.cancelDrag();\n }}\n >\n <span data-vaul-handle-hitarea=\"\" aria-hidden=\"true\">\n {props.children}\n </span>\n </div>","_$createComponent","_$memo","SolidPortal","_$getNextElement","_$scope"],"sources":["../../src/context.ts","../../src/constants.ts","../../src/helpers.ts","../../src/create-background.ts","../../src/create-snap-points.ts","../../src/create-drawer.ts","../../src/create-layer.ts","../../src/create-position.ts","../../src/drawer.tsx","../../src/index.ts"],"sourcesContent":["/*\n * Derived from Vaul (https://github.com/emilkowalski/vaul): src/context.ts.\n * Copyright (c) 2023 Emil Kowalski\n * Modified for Solid Aria: native Solid 2 contexts, reactive getters, and callback refs.\n * MIT licensed. See LICENSE, VAUL-LICENSE, and NOTICE.txt in the package root.\n */\n\nimport { createContext } from \"solid-js\";\n\nimport type { DialogProps, DrawerDirection, SnapPoint } from \"./types\";\n\nexport interface DrawerContextValue {\n readonly props: DialogProps;\n readonly isOpen: boolean;\n readonly present: boolean;\n readonly shouldAnimate: boolean;\n readonly direction: DrawerDirection;\n readonly modal: boolean;\n readonly dismissible: boolean;\n readonly contentId: string;\n readonly titleId: string;\n readonly descriptionId: string;\n readonly content: HTMLDivElement | null;\n readonly overlay: HTMLDivElement | null;\n readonly trigger: HTMLButtonElement | null;\n readonly activeSnapPoint: SnapPoint | null;\n readonly activeSnapPointIndex: number;\n readonly snapPointsOffset: readonly number[];\n readonly shouldFade: boolean;\n readonly isDragging: boolean;\n readonly dragProgress: number;\n readonly childOpen: boolean;\n setContent: (element: HTMLDivElement | null) => void;\n setOverlay: (element: HTMLDivElement | null) => void;\n setTrigger: (element: HTMLButtonElement | null) => void;\n setActiveSnapPoint: (point: SnapPoint | null) => void;\n setOpen: (open: boolean) => void;\n close: () => void;\n press: (event: PointerEvent, fromHandle?: boolean) => void;\n drag: (event: PointerEvent) => void;\n release: (event: PointerEvent) => void;\n cancelDrag: () => void;\n setChildOpen: (open: boolean) => void;\n setChildProgress: (progress: number) => void;\n}\n\nexport const DrawerContext = createContext<DrawerContextValue>();\nexport const PortalContext = createContext(false);\n","/*\n * Derived from Vaul (https://github.com/emilkowalski/vaul): src/constants.ts.\n * Copyright (c) 2023 Emil Kowalski\n * Modified for Solid Aria: preserved drawer animation and gesture constants.\n * MIT licensed. See LICENSE, VAUL-LICENSE, and NOTICE.txt in the package root.\n */\n\nexport const TRANSITIONS = {\n DURATION: 0.5,\n EASE: [0.32, 0.72, 0, 1],\n};\n\nexport const VELOCITY_THRESHOLD = 0.4;\n\nexport const CLOSE_THRESHOLD = 0.25;\n\nexport const SCROLL_LOCK_TIMEOUT = 100;\n\nexport const BORDER_RADIUS = 8;\n\nexport const NESTED_DISPLACEMENT = 16;\n\nexport const WINDOW_TOP_OFFSET = 26;\n\nexport const DRAG_CLASS = \"vaul-dragging\";\n","/*\n * Derived from Vaul (https://github.com/emilkowalski/vaul): src/helpers.ts and src/browser.ts.\n * Copyright (c) 2023 Emil Kowalski\n * Modified for Solid Aria: typed geometry and property-scoped style restoration without shared style caches.\n * MIT licensed. See LICENSE, VAUL-LICENSE, and NOTICE.txt in the package root.\n */\n\nimport type { DrawerDirection } from \"./types\";\n\nexport function isVertical(direction: DrawerDirection): boolean {\n return direction === \"top\" || direction === \"bottom\";\n}\n\nexport function directionSign(direction: DrawerDirection): 1 | -1 {\n return direction === \"bottom\" || direction === \"right\" ? 1 : -1;\n}\n\nexport function translate(\n distance: number,\n direction: DrawerDirection\n): string {\n return isVertical(direction)\n ? `translate3d(0, ${distance}px, 0)`\n : `translate3d(${distance}px, 0, 0)`;\n}\n\nexport function dampenValue(value: number): number {\n return Math.max(0, 8 * (Math.log(value + 1) - 2));\n}\n\nexport function clamp(value: number, min = 0, max = 1): number {\n return Math.min(max, Math.max(min, value));\n}\n\n/** Restore only the properties this operation owns, including priorities. */\nexport function assignStyle(\n element: HTMLElement,\n styles: Record<string, string>\n): () => void {\n const previous = Object.keys(styles).map((property) => ({\n priority: element.style.getPropertyPriority(property),\n property,\n value: element.style.getPropertyValue(property),\n }));\n\n for (const [property, value] of Object.entries(styles)) {\n element.style.setProperty(property, value);\n }\n\n return () => {\n for (const { property, value, priority } of previous) {\n if (value) {\n element.style.setProperty(property, value, priority);\n } else {\n element.style.removeProperty(property);\n }\n }\n };\n}\n\nexport function isSafari(view: Window): boolean {\n return /^(?:(?!chrome|android).)*safari/iu.test(view.navigator.userAgent);\n}\n\nexport function canScroll(\n target: HTMLElement,\n content: HTMLElement,\n direction: DrawerDirection,\n distance: number\n): boolean {\n const vertical = isVertical(direction);\n const forward = distance * directionSign(direction) < 0;\n\n for (\n let node: HTMLElement | null = target;\n node && content.contains(node);\n node = node.parentElement\n ) {\n const scrollSize = vertical ? node.scrollHeight : node.scrollWidth;\n const size = vertical ? node.clientHeight : node.clientWidth;\n\n if (scrollSize <= size) {\n continue;\n }\n\n const position = vertical ? node.scrollTop : node.scrollLeft;\n\n if (\n (forward && position < scrollSize - size) ||\n (!forward && position > 0)\n ) {\n return true;\n }\n }\n\n return false;\n}\n","/*\n * Derived from Vaul (https://github.com/emilkowalski/vaul): src/use-scale-background.ts and src/index.tsx.\n * Copyright (c) 2023 Emil Kowalski\n * Modified for Solid Aria: Solid 2 effects, document-local scaling, drag interpolation, and complete style cleanup.\n * MIT licensed. See LICENSE, VAUL-LICENSE, and NOTICE.txt in the package root.\n */\n\nimport { createEffect } from \"solid-js\";\n\nimport { BORDER_RADIUS, TRANSITIONS, WINDOW_TOP_OFFSET } from \"./constants\";\nimport type { DrawerContextValue } from \"./context\";\nimport { assignStyle, isVertical } from \"./helpers\";\n\nexport function createBackground(context: DrawerContextValue): void {\n let background: HTMLElement | null = null;\n let initialScale = 1;\n let vertical = true;\n createEffect(\n () => ({\n color:\n context.props.setBackgroundColorOnScale !== false &&\n context.props.noBodyStyles !== true,\n direction: context.direction,\n element: context.content,\n enabled: context.props.shouldScaleBackground === true,\n nested: context.props.nested === true,\n open: context.isOpen,\n }),\n ({\n element,\n open,\n enabled,\n color,\n direction,\n nested,\n }): undefined | (() => void) => {\n if (!element || !open || !enabled || nested) {\n return undefined;\n }\n\n const doc = element.ownerDocument;\n\n const wrapper = doc.querySelector<HTMLElement>(\n \"[data-vaul-drawer-wrapper], [vaul-drawer-wrapper]\"\n );\n\n const view = doc.defaultView;\n\n if (!wrapper || !view) {\n return undefined;\n }\n\n background = wrapper;\n initialScale = (view.innerWidth - WINDOW_TOP_OFFSET) / view.innerWidth;\n vertical = isVertical(direction);\n\n const restoreBody = color\n ? assignStyle(doc.body, { background: \"black\" })\n : undefined;\n\n const restoreWrapper = assignStyle(wrapper, {\n \"border-radius\": `${BORDER_RADIUS}px`,\n overflow: \"hidden\",\n transform: `scale(${initialScale}) ${vertical ? \"translate3d(0, 14px, 0)\" : \"translate3d(14px, 0, 0)\"}`,\n \"transform-origin\": vertical ? \"top\" : \"left\",\n \"transition-duration\": `${TRANSITIONS.DURATION}s`,\n \"transition-property\": \"transform, border-radius\",\n \"transition-timing-function\": `cubic-bezier(${TRANSITIONS.EASE.join(\",\")})`,\n });\n\n return () => {\n background = null;\n restoreWrapper();\n restoreBody?.();\n };\n },\n { ssrSource: \"client\" }\n );\n createEffect(\n () => ({\n dragging: context.isDragging,\n element: context.content,\n open: context.isOpen,\n progress: context.dragProgress,\n }),\n ({ progress, dragging, open }) => {\n if (!background || !open) {\n return;\n }\n\n const scale = initialScale + progress * (1 - initialScale);\n const displacement = 14 * (1 - progress);\n background.style.transitionDuration = dragging\n ? \"0s\"\n : `${TRANSITIONS.DURATION}s`;\n background.style.borderRadius = `${BORDER_RADIUS * (1 - progress)}px`;\n background.style.transform = `scale(${scale}) ${vertical ? `translate3d(0, ${displacement}px, 0)` : `translate3d(${displacement}px, 0, 0)`}`;\n },\n { ssrSource: \"client\" }\n );\n}\n","/*\n * Derived from Vaul (https://github.com/emilkowalski/vaul): src/use-snap-points.ts.\n * Copyright (c) 2023 Emil Kowalski\n * Modified for Solid Aria: pure snap geometry and selection, bounded sequential swipes, and container dimensions.\n * MIT licensed. See LICENSE, VAUL-LICENSE, and NOTICE.txt in the package root.\n */\n\nimport { VELOCITY_THRESHOLD } from \"./constants\";\nimport { clamp, directionSign } from \"./helpers\";\nimport type { DrawerDirection, SnapPoint } from \"./types\";\n\nexport function getSnapPointOffsets(\n points: readonly SnapPoint[],\n dimension: number,\n direction: DrawerDirection\n): number[] {\n return points.map((point) => {\n const visible =\n typeof point === \"number\"\n ? point * dimension\n : Number(point.replace(/px$/u, \"\"));\n\n return (dimension - visible) * directionSign(direction);\n });\n}\n\nexport function getOverlayOpacity(\n offsets: readonly number[],\n offset: number,\n fadeFromIndex: number,\n dimension: number\n): number {\n const faded = Math.abs(offsets[fadeFromIndex] ?? 0);\n\n const clear =\n fadeFromIndex === 0\n ? dimension\n : Math.abs(offsets[fadeFromIndex - 1] ?? faded);\n\n if (clear === faded) {\n return offset <= faded ? 1 : 0;\n }\n\n return clamp((clear - offset) / (clear - faded));\n}\n\nexport function selectSnapPoint(options: {\n offsets: readonly number[];\n activeIndex: number;\n /** Positive distance moves toward the closed edge. */\n distance: number;\n velocity: number;\n dimension: number;\n dismissible: boolean;\n sequential: boolean;\n}): number | \"close\" {\n const {\n offsets,\n activeIndex,\n distance,\n velocity,\n dimension,\n dismissible,\n sequential,\n } = options;\n\n const [first] = offsets;\n\n if (first === undefined) {\n return activeIndex;\n }\n\n const active = Math.abs(offsets[activeIndex] ?? first);\n const position = active + distance;\n\n if (!sequential && velocity > 2) {\n if (distance <= 0) {\n return offsets.length - 1;\n }\n\n return dismissible ? \"close\" : 0;\n }\n\n if (velocity > VELOCITY_THRESHOLD && Math.abs(distance) < dimension * 0.4) {\n if (distance > 0 && activeIndex === 0 && dismissible) {\n return \"close\";\n }\n\n return clamp(activeIndex + (distance > 0 ? -1 : 1), 0, offsets.length - 1);\n }\n\n const remaining = dimension - Math.abs(first);\n\n if (\n dismissible &&\n distance > 0 &&\n position > Math.abs(first) + remaining / 2\n ) {\n return \"close\";\n }\n\n let closest = 0;\n let difference = Infinity;\n\n for (const [index, offset] of offsets.entries()) {\n if (sequential && Math.abs(index - activeIndex) > 1) {\n continue;\n }\n\n const nextDifference = Math.abs(Math.abs(offset) - position);\n\n if (nextDifference < difference) {\n difference = nextDifference;\n closest = index;\n }\n }\n\n return closest;\n}\n","/*\n * Derived from Vaul (https://github.com/emilkowalski/vaul): src/index.tsx.\n * Copyright (c) 2023 Emil Kowalski\n * Modified for Solid Aria: native Solid 2 controlled state, presence, pointer gestures, measured snap-point entry, nested transforms, and lifecycle.\n * MIT licensed. See LICENSE, VAUL-LICENSE, and NOTICE.txt in the package root.\n */\n\nimport {\n createEffect,\n createMemo,\n createSignal,\n createUniqueId,\n onSettled,\n untrack,\n} from \"solid-js\";\n\nimport {\n CLOSE_THRESHOLD,\n DRAG_CLASS,\n NESTED_DISPLACEMENT,\n SCROLL_LOCK_TIMEOUT,\n TRANSITIONS,\n VELOCITY_THRESHOLD,\n} from \"./constants\";\nimport type { DrawerContextValue } from \"./context\";\nimport {\n getOverlayOpacity,\n getSnapPointOffsets,\n selectSnapPoint,\n} from \"./create-snap-points\";\nimport {\n canScroll,\n clamp,\n dampenValue,\n directionSign,\n isVertical,\n translate,\n} from \"./helpers\";\nimport type { DialogProps, SnapPoint } from \"./types\";\n\nconst transition = `${TRANSITIONS.DURATION}s cubic-bezier(${TRANSITIONS.EASE.join(\",\")})`;\n\ninterface Gesture {\n x: number;\n y: number;\n startedAt: number;\n dimension: number;\n startOffset: number;\n distance: number;\n allowed: boolean;\n fromHandle: boolean;\n pointerId: number;\n target: HTMLElement;\n}\n\nexport function createDrawer(\n props: DialogProps,\n parent?: DrawerContextValue\n): DrawerContextValue {\n const [internalOpen, setInternalOpen] = createSignal(\n untrack(() => props.defaultOpen ?? false)\n );\n\n const isOpen = createMemo(() => props.open ?? internalOpen());\n const [present, setPresent] = createSignal(untrack(isOpen));\n\n const [animate, setAnimate] = createSignal(\n untrack(() => props.defaultOpen !== true)\n );\n\n const [internalSnap, setInternalSnap] = createSignal<SnapPoint | null>(\n untrack(() => props.snapPoints?.[0] ?? null)\n );\n\n const activeSnap = createMemo(() =>\n props.activeSnapPoint === undefined ? internalSnap() : props.activeSnapPoint\n );\n\n const [content, setContent] = createSignal<HTMLDivElement | null>(null, {\n ownedWrite: true,\n });\n\n const [overlay, setOverlay] = createSignal<HTMLDivElement | null>(null, {\n ownedWrite: true,\n });\n\n const [trigger, setTrigger] = createSignal<HTMLButtonElement | null>(null, {\n ownedWrite: true,\n });\n\n const [dimension, setDimension] = createSignal(0);\n const [dragging, setDragging] = createSignal(false);\n const [dragProgress, setDragProgress] = createSignal(0);\n const [childOpen, setChildOpen] = createSignal(false);\n const [childProgress, setChildProgress] = createSignal(0);\n const direction = () => props.direction ?? \"bottom\";\n const points = () => props.snapPoints ?? [];\n\n const offsets = createMemo(() =>\n getSnapPointOffsets(points(), dimension(), direction())\n );\n\n const activeIndex = createMemo(() =>\n Math.max(0, points().indexOf(activeSnap() ?? points()[0] ?? 0))\n );\n\n const offset = () => offsets()[activeIndex()] ?? 0;\n\n const fadeFromIndex = () =>\n props.fadeFromIndex ?? Math.max(0, points().length - 1);\n\n const id = createUniqueId();\n let gesture: Gesture | null = null;\n let lastScrollTime = -Infinity;\n let openedAt = -Infinity;\n\n const onScroll = () => {\n lastScrollTime = Date.now();\n };\n\n function setOpen(open: boolean): void {\n if (open === isOpen()) {\n return;\n }\n\n if (props.open === undefined) {\n setInternalOpen(open);\n }\n\n props.onOpenChange?.(open);\n }\n\n function setActiveSnapPoint(point: SnapPoint | null): void {\n if (point === activeSnap()) {\n return;\n }\n\n if (props.activeSnapPoint === undefined) {\n setInternalSnap(point);\n }\n\n props.setActiveSnapPoint?.(point);\n }\n\n function resetPosition(): void {\n const element = content();\n\n if (!element) {\n return;\n }\n\n element.classList.remove(DRAG_CLASS);\n element.style.transition = `transform ${transition}`;\n element.style.transform = translate(offset(), direction());\n const backdrop = overlay();\n\n if (backdrop) {\n backdrop.style.transition = `opacity ${transition}`;\n backdrop.style.opacity = points().length\n ? `${getOverlayOpacity(offsets(), Math.abs(offset()), fadeFromIndex(), dimension())}`\n : \"1\";\n }\n }\n\n function cancelDrag(): void {\n if (!gesture) {\n return;\n }\n\n if (gesture.target.hasPointerCapture?.(gesture.pointerId)) {\n gesture.target.releasePointerCapture(gesture.pointerId);\n }\n\n gesture = null;\n setDragging(false);\n setDragProgress(0);\n untrack(resetPosition);\n parent?.setChildProgress(0);\n }\n\n function close(): void {\n cancelDrag();\n\n if (props.dismissible !== false) {\n setOpen(false);\n }\n }\n\n createEffect(\n isOpen,\n (open, previous): undefined | (() => void) => {\n if (open) {\n openedAt = Date.now();\n setPresent(true);\n } else {\n cancelDrag();\n\n if (previous === true) {\n props.onClose?.();\n }\n }\n\n parent?.setChildOpen(open);\n\n if (previous === undefined && !open) {\n return undefined;\n }\n\n const view = untrack(content)?.ownerDocument.defaultView;\n\n const duration =\n view?.matchMedia(\"(prefers-reduced-motion: reduce)\").matches === true\n ? 0\n : TRANSITIONS.DURATION * 1000;\n\n const timer = setTimeout(() => {\n if (!open) {\n setPresent(false);\n setActiveSnapPoint(points()[0] ?? null);\n }\n\n if (previous !== undefined) {\n props.onAnimationEnd?.(open);\n }\n }, duration);\n\n return () => {\n clearTimeout(timer);\n };\n },\n { ssrSource: \"client\" }\n );\n\n createEffect(\n () => ({\n container: props.container,\n direction: direction(),\n element: content(),\n }),\n ({\n element,\n container,\n direction: currentDirection,\n }): undefined | (() => void) => {\n if (!element) {\n return undefined;\n }\n\n const view = element.ownerDocument.defaultView;\n\n if (!view) {\n return undefined;\n }\n\n const measure = (): void => {\n const rect = container?.getBoundingClientRect();\n setDimension(\n isVertical(currentDirection)\n ? (rect?.height ?? view.innerHeight)\n : (rect?.width ?? view.innerWidth)\n );\n };\n\n measure();\n view.addEventListener(\"resize\", measure);\n\n const observer =\n typeof ResizeObserver === \"undefined\"\n ? undefined\n : new ResizeObserver(measure);\n\n if (container) {\n observer?.observe(container);\n }\n\n element.addEventListener(\"scroll\", onScroll, true);\n\n return () => {\n view.removeEventListener(\"resize\", measure);\n observer?.disconnect();\n element.removeEventListener(\"scroll\", onScroll, true);\n cancelDrag();\n };\n },\n { ssrSource: \"client\" }\n );\n\n createEffect(\n () => ({\n animate: animate(),\n backdrop: overlay(),\n child: childOpen(),\n dimension: dimension(),\n direction: direction(),\n element: content(),\n hasSnapPoints: points().length > 0,\n offset: offset(),\n opacity: points().length\n ? getOverlayOpacity(\n offsets(),\n Math.abs(offset()),\n fadeFromIndex(),\n dimension()\n )\n : 1,\n open: isOpen(),\n progress: childProgress(),\n }),\n ({\n animate: shouldAnimate,\n element,\n backdrop,\n dimension: currentDimension,\n hasSnapPoints,\n open,\n offset: currentOffset,\n child,\n progress,\n direction: currentDirection,\n opacity,\n }) => {\n if (!element || (hasSnapPoints && currentDimension === 0)) {\n return;\n }\n\n const sign = directionSign(currentDirection);\n const view = element.ownerDocument.defaultView;\n\n const size = isVertical(currentDirection)\n ? view?.innerHeight\n : view?.innerWidth;\n\n const scale = child\n ? 1 - (NESTED_DISPLACEMENT / Math.max(1, size ?? 1)) * (1 - progress)\n : 1;\n\n const displacement = child\n ? -NESTED_DISPLACEMENT * (1 - progress) * sign\n : 0;\n\n if (hasSnapPoints && shouldAnimate && element.style.transform === \"\") {\n // Commit the closed position before transitioning to the measured snap point.\n element.getBoundingClientRect();\n }\n\n element.style.transition = shouldAnimate\n ? `transform ${transition}`\n : \"none\";\n element.style.transform = `${translate(open ? currentOffset + displacement : sign * (size ?? currentDimension), currentDirection)} scale(${scale})`;\n\n if (backdrop) {\n backdrop.style.transition = shouldAnimate\n ? `opacity ${transition}`\n : \"none\";\n backdrop.style.opacity = open ? `${opacity}` : \"0\";\n }\n },\n { ssrSource: \"client\" }\n );\n\n onSettled(() => {\n const frame = requestAnimationFrame(() => {\n setAnimate(true);\n });\n\n return () => {\n cancelAnimationFrame(frame);\n parent?.setChildOpen(false);\n };\n });\n\n function press(event: PointerEvent, fromHandle = false): void {\n const element = content();\n const { target } = event;\n\n if (\n !element ||\n !isOpen() ||\n childOpen() ||\n event.defaultPrevented ||\n event.button > 0\n ) {\n return;\n }\n\n if (\n !(target instanceof HTMLElement) ||\n target.closest(\"[data-vaul-drawer]\") !== element\n ) {\n return;\n }\n\n if (\n target.closest(\"[data-vaul-no-drag],select,option\") ||\n (props.handleOnly === true && !fromHandle)\n ) {\n return;\n }\n\n if (props.dismissible === false && !points().length) {\n return;\n }\n\n const rect = element.getBoundingClientRect();\n gesture = {\n allowed: false,\n dimension: isVertical(direction()) ? rect.height : rect.width,\n distance: 0,\n fromHandle,\n pointerId: event.pointerId,\n startOffset: Math.abs(offset()),\n startedAt: Date.now(),\n target,\n x: event.clientX,\n y: event.clientY,\n };\n }\n\n function canDrag(target: HTMLElement, distance: number): boolean {\n if (!gesture || target.closest(\"[data-vaul-no-drag],select,option\")) {\n return false;\n }\n\n if (gesture.fromHandle) {\n return true;\n }\n\n if ((target.ownerDocument.getSelection()?.toString().length ?? 0) > 0) {\n return false;\n }\n\n if (Date.now() - openedAt < TRANSITIONS.DURATION * 1000) {\n return false;\n }\n\n if (\n Date.now() - lastScrollTime <\n (props.scrollLockTimeout ?? SCROLL_LOCK_TIMEOUT)\n ) {\n return false;\n }\n\n const lastOffset = Math.abs(offsets().at(-1) ?? 0);\n\n if (distance < 0 && gesture.startOffset > lastOffset) {\n return true;\n }\n\n const element = content();\n\n return (\n element !== null && !canScroll(target, element, direction(), distance)\n );\n }\n\n function claimGesture(\n event: PointerEvent,\n current: Gesture,\n axis: number,\n cross: number,\n distance: number\n ): boolean {\n if (current.allowed) {\n return true;\n }\n\n const threshold = event.pointerType === \"touch\" ? 10 : 2;\n\n if (Math.abs(axis) < threshold && Math.abs(cross) < threshold) {\n return false;\n }\n\n if (Math.abs(cross) > Math.abs(axis)) {\n gesture = null;\n\n return false;\n }\n\n if (!canDrag(current.target, distance)) {\n return false;\n }\n\n current.allowed = true;\n current.target.setPointerCapture?.(event.pointerId);\n setDragging(true);\n\n return true;\n }\n\n function drag(event: PointerEvent): void {\n const current = gesture;\n const element = content();\n\n if (!current || !element || current.pointerId !== event.pointerId) {\n return;\n }\n\n const dx = event.clientX - current.x;\n const dy = event.clientY - current.y;\n const vertical = isVertical(direction());\n const axis = vertical ? dy : dx;\n const cross = vertical ? dx : dy;\n const distance = axis * directionSign(direction());\n\n if (!claimGesture(event, current, axis, cross, distance)) {\n return;\n }\n\n event.preventDefault();\n const minimum = Math.abs(offsets().at(-1) ?? 0);\n let position = current.startOffset + distance;\n\n if (position < minimum) {\n position = minimum - dampenValue(minimum - position);\n }\n\n if (props.dismissible === false) {\n position = Math.min(position, Math.abs(offsets()[0] ?? 0));\n }\n\n current.distance = position - current.startOffset;\n element.classList.add(DRAG_CLASS);\n element.style.transition = \"none\";\n element.style.transform = translate(\n position * directionSign(direction()),\n direction()\n );\n\n const percentage = clamp(\n Math.max(0, distance) /\n Math.max(1, current.dimension - current.startOffset)\n );\n\n const backdrop = overlay();\n\n if (backdrop) {\n backdrop.style.transition = \"none\";\n backdrop.style.opacity = points().length\n ? `${getOverlayOpacity(offsets(), position, fadeFromIndex(), dimension())}`\n : `${1 - percentage}`;\n }\n\n setDragProgress(percentage);\n props.onDrag?.(event, percentage);\n parent?.setChildProgress(percentage);\n }\n\n function release(event: PointerEvent): void {\n const current = gesture;\n\n if (!current || event.pointerId !== current.pointerId) {\n return;\n }\n\n const velocity =\n Math.abs(current.distance) / Math.max(1, Date.now() - current.startedAt);\n\n let next: number | \"close\" = activeIndex();\n\n if (current.allowed && points().length) {\n next = selectSnapPoint({\n activeIndex: activeIndex(),\n dimension: dimension(),\n dismissible: props.dismissible !== false,\n distance: current.distance,\n offsets: offsets(),\n sequential: props.snapToSequentialPoint ?? false,\n velocity,\n });\n } else if (\n current.allowed &&\n current.distance > 0 &&\n props.dismissible !== false &&\n (velocity > VELOCITY_THRESHOLD ||\n current.distance >=\n current.dimension * (props.closeThreshold ?? CLOSE_THRESHOLD))\n ) {\n next = \"close\";\n }\n\n cancelDrag();\n\n if (!current.allowed) {\n return;\n }\n\n if (next === \"close\") {\n close();\n } else if (points().length) {\n setActiveSnapPoint(points()[next] ?? null);\n }\n\n props.onRelease?.(event, next !== \"close\");\n }\n\n return {\n get activeSnapPoint() {\n return activeSnap();\n },\n get activeSnapPointIndex() {\n return activeIndex();\n },\n cancelDrag,\n get childOpen() {\n return childOpen();\n },\n close,\n get content() {\n return content();\n },\n contentId: `vaul-${id}`,\n descriptionId: `vaul-${id}-description`,\n get direction() {\n return direction();\n },\n get dismissible() {\n return props.dismissible ?? true;\n },\n drag,\n get dragProgress() {\n return dragProgress();\n },\n get isDragging() {\n return dragging();\n },\n get isOpen() {\n return isOpen();\n },\n get modal() {\n return props.modal ?? true;\n },\n get overlay() {\n return overlay();\n },\n get present() {\n return present();\n },\n press,\n props,\n release,\n setActiveSnapPoint,\n setChildOpen(open) {\n setChildOpen(open);\n setChildProgress(0);\n },\n setChildProgress(progress) {\n setChildProgress(progress);\n },\n setContent(element) {\n setContent(element);\n },\n setOpen,\n setOverlay(element) {\n setOverlay(element);\n },\n setTrigger(element) {\n setTrigger(element);\n },\n get shouldAnimate() {\n return animate();\n },\n get shouldFade() {\n return !points().length || activeIndex() >= fadeFromIndex();\n },\n get snapPointsOffset() {\n return offsets();\n },\n titleId: `vaul-${id}-title`,\n get trigger() {\n return trigger();\n },\n };\n}\n","import { ariaHideOutside } from \"@solid2-aria/core/overlays/aria-hide-outside\";\nimport { createPreventScroll } from \"@solid2-aria/core/overlays/create-prevent-scroll\";\nimport { createEffect, untrack } from \"solid-js\";\n\nimport type { DrawerContextValue } from \"./context\";\nimport type {\n ContentProps,\n FocusOutsideEvent,\n PointerDownOutsideEvent,\n} from \"./types\";\n\nconst layers = new WeakMap<Document, HTMLDivElement[]>();\n\nexport function createLayer(\n context: DrawerContextValue,\n props: ContentProps\n): void {\n createPreventScroll({\n get isDisabled() {\n return (\n !context.isOpen ||\n !context.content ||\n !context.modal ||\n context.props.noBodyStyles === true ||\n (!context.overlay && context.props.disablePreventScroll !== true)\n );\n },\n });\n\n createEffect(\n () => ({\n element: context.content,\n modal: context.modal,\n open: context.isOpen,\n overlay: context.overlay,\n }),\n ({ element, overlay, open, modal }): undefined | (() => void) => {\n if (!element || !open || !modal) {\n return undefined;\n }\n\n return ariaHideOutside(overlay ? [element, overlay] : [element], {\n shouldUseInert: true,\n });\n },\n { ssrSource: \"client\" }\n );\n\n createEffect(\n () => ({ element: context.content, open: context.isOpen }),\n ({ element, open }): undefined | (() => void) => {\n if (!element || !open) {\n return undefined;\n }\n\n const doc = element.ownerDocument;\n const stack = layers.get(doc) ?? [];\n layers.set(doc, stack);\n stack.push(element);\n const previous = doc.activeElement;\n let interactedOutside = false;\n const autoFocus = new Event(\"openAutoFocus\", { cancelable: true });\n props.onOpenAutoFocus?.(autoFocus);\n\n if (!autoFocus.defaultPrevented && context.props.autoFocus === true) {\n const first = element.querySelector<HTMLElement>(\n \"[autofocus],button:not([disabled]),[href],input:not([disabled]),select:not([disabled]),textarea:not([disabled]),[tabindex='0']\"\n );\n\n (first ?? element).focus({ preventScroll: true });\n }\n\n const isTop = () => stack.at(-1) === element;\n\n const isOutside = (event: Event) =>\n !event.composedPath().includes(element);\n\n function pointerDown(event: PointerEvent): void {\n if (!isTop() || !isOutside(event)) {\n return;\n }\n\n const outside: PointerDownOutsideEvent = new CustomEvent(\n \"pointerDownOutside\",\n {\n cancelable: true,\n detail: { originalEvent: event },\n }\n );\n\n props.onPointerDownOutside?.(outside);\n props.onInteractOutside?.(outside);\n\n if (\n outside.defaultPrevented ||\n !context.modal ||\n event.button > 0 ||\n event.ctrlKey\n ) {\n return;\n }\n\n interactedOutside = !context.modal;\n context.close();\n }\n\n function focusIn(event: FocusEvent): void {\n if (!isTop() || !isOutside(event)) {\n return;\n }\n\n const outside: FocusOutsideEvent = new CustomEvent(\"focusOutside\", {\n cancelable: true,\n detail: { originalEvent: event },\n });\n\n props.onFocusOutside?.(outside);\n props.onInteractOutside?.(outside);\n\n if (!context.modal) {\n interactedOutside = true;\n }\n }\n\n function keyDown(event: KeyboardEvent): void {\n if (event.key !== \"Escape\" || !isTop() || event.defaultPrevented) {\n return;\n }\n\n props.onEscapeKeyDown?.(event);\n\n if (event.defaultPrevented) {\n return;\n }\n\n event.preventDefault();\n context.close();\n }\n\n doc.addEventListener(\"pointerdown\", pointerDown);\n doc.addEventListener(\"focusin\", focusIn);\n doc.addEventListener(\"keydown\", keyDown);\n\n const touchMove = (event: TouchEvent) => {\n if (element.classList.contains(\"vaul-dragging\") && event.cancelable) {\n event.preventDefault();\n }\n };\n\n element.addEventListener(\"touchmove\", touchMove, { passive: false });\n\n return () => {\n const index = stack.indexOf(element);\n const wasTop = isTop();\n\n if (index !== -1) {\n stack.splice(index, 1);\n }\n\n if (!stack.length) {\n layers.delete(doc);\n }\n\n doc.removeEventListener(\"pointerdown\", pointerDown);\n doc.removeEventListener(\"focusin\", focusIn);\n doc.removeEventListener(\"keydown\", keyDown);\n element.removeEventListener(\"touchmove\", touchMove);\n\n const closeAutoFocus = new Event(\"closeAutoFocus\", {\n cancelable: true,\n });\n\n props.onCloseAutoFocus?.(closeAutoFocus);\n\n if (closeAutoFocus.defaultPrevented || interactedOutside || !wasTop) {\n return;\n }\n\n const target = untrack(() => context.trigger) ?? previous;\n queueMicrotask(() => {\n if (target instanceof HTMLElement && target.isConnected) {\n target.focus({ preventScroll: true });\n }\n });\n };\n },\n { ssrSource: \"client\" }\n );\n}\n","/*\n * Derived from Vaul (https://github.com/emilkowalski/vaul): src/use-position-fixed.ts and src/index.tsx.\n * Copyright (c) 2023 Emil Kowalski\n * Modified for Solid Aria: Solid 2 lifecycle, per-drawer style ownership, viewport resizing, and route-aware restoration.\n * MIT licensed. See LICENSE, VAUL-LICENSE, and NOTICE.txt in the package root.\n */\n\nimport { createEffect } from \"solid-js\";\n\nimport { WINDOW_TOP_OFFSET } from \"./constants\";\nimport type { DrawerContextValue } from \"./context\";\nimport { assignStyle, isSafari } from \"./helpers\";\n\nexport function createPosition(context: DrawerContextValue): void {\n createEffect(\n () => ({\n element: context.content,\n modal: context.modal,\n nested: context.props.nested === true,\n noBodyStyles: context.props.noBodyStyles === true,\n open: context.isOpen,\n preventScrollRestoration: context.props.preventScrollRestoration === true,\n }),\n ({\n element,\n open,\n modal,\n noBodyStyles,\n nested,\n preventScrollRestoration,\n }): undefined | (() => void) => {\n if (!element || !open || !modal || noBodyStyles || nested) {\n return undefined;\n }\n\n const doc = element.ownerDocument;\n const view = doc.defaultView;\n\n if (\n !view ||\n !isSafari(view) ||\n view.matchMedia(\"(display-mode: standalone)\").matches\n ) {\n return undefined;\n }\n\n const { scrollX, scrollY } = view;\n const url = view.location.href;\n\n const restore = assignStyle(doc.body, {\n height: \"auto\",\n left: `${-scrollX}px`,\n position: \"fixed\",\n right: \"0\",\n top: `${-scrollY}px`,\n });\n\n return () => {\n restore();\n\n if (!preventScrollRestoration || url === view.location.href) {\n view.scrollTo(scrollX, scrollY);\n }\n };\n },\n { ssrSource: \"client\" }\n );\n\n createEffect(\n () => ({\n direction: context.direction,\n element: context.content,\n fixed: context.props.fixed === true,\n open: context.isOpen,\n reposition: context.props.repositionInputs !== false,\n }),\n ({\n element,\n open,\n reposition,\n fixed,\n direction,\n }): undefined | (() => void) => {\n if (!element || !open || !reposition || direction !== \"bottom\") {\n return undefined;\n }\n\n const doc = element.ownerDocument;\n const view = doc.defaultView;\n const viewport = view?.visualViewport;\n\n if (!view || !viewport) {\n return undefined;\n }\n\n const { height } = element.style;\n const { bottom } = element.style;\n let keyboardOpen = false;\n const initialHeight = element.getBoundingClientRect().height;\n\n const resize = (): void => {\n const focused = doc.activeElement;\n\n if (\n !keyboardOpen &&\n (!(focused instanceof HTMLElement) ||\n !element.contains(focused) ||\n !focused.matches(\"input,textarea,[contenteditable]\"))\n ) {\n return;\n }\n\n const diff = Math.max(\n 0,\n view.innerHeight - viewport.height - viewport.offsetTop\n );\n\n keyboardOpen = diff > 60;\n\n if (!keyboardOpen) {\n element.style.height = height;\n element.style.bottom = bottom;\n\n return;\n }\n\n const rect = element.getBoundingClientRect();\n\n const available = Math.max(\n 0,\n viewport.height - Math.max(WINDOW_TOP_OFFSET, rect.top)\n );\n\n element.style.height = `${fixed ? Math.max(0, initialHeight - diff) : available}px`;\n element.style.bottom = `${diff}px`;\n\n if (focused instanceof HTMLElement) {\n focused.scrollIntoView({ block: \"nearest\" });\n }\n };\n\n viewport.addEventListener(\"resize\", resize);\n viewport.addEventListener(\"scroll\", resize);\n\n return () => {\n viewport.removeEventListener(\"resize\", resize);\n viewport.removeEventListener(\"scroll\", resize);\n element.style.height = height;\n element.style.bottom = bottom;\n };\n },\n { ssrSource: \"client\" }\n );\n}\n","/*\n * Derived from Vaul (https://github.com/emilkowalski/vaul): src/index.tsx.\n * Copyright (c) 2023 Emil Kowalski\n * Modified for Solid Aria: Solid 2 components, contexts, callback refs, portals, presence, and native DOM event composition.\n * MIT licensed. See LICENSE, VAUL-LICENSE, and NOTICE.txt in the package root.\n */\n\nimport { FocusScope } from \"@solid2-aria/core/focus/focus-scope\";\nimport { Portal as SolidPortal } from \"@solidjs/web\";\nimport type { JSX } from \"@solidjs/web\";\nimport {\n createSignal,\n merge,\n omit,\n onSettled,\n Show,\n useContext,\n} from \"solid-js\";\n\nimport { DrawerContext, PortalContext } from \"./context\";\nimport { createBackground } from \"./create-background\";\nimport { createDrawer } from \"./create-drawer\";\nimport { createLayer } from \"./create-layer\";\nimport { createPosition } from \"./create-position\";\nimport type {\n CloseProps,\n ContentProps,\n DescriptionProps,\n DialogProps,\n HandleProps,\n OverlayProps,\n PortalProps,\n TitleProps,\n TriggerProps,\n} from \"./types\";\n\nexport function Root(props: DialogProps): JSX.Element {\n const context = createDrawer(props);\n createBackground(context);\n createPosition(context);\n\n return <DrawerContext value={context}>{props.children}</DrawerContext>;\n}\n\nexport function NestedRoot(props: DialogProps): JSX.Element {\n const parent = useContext(DrawerContext);\n const context = createDrawer(merge(props, { nested: true }), parent);\n createPosition(context);\n\n return <DrawerContext value={context}>{props.children}</DrawerContext>;\n}\n\nexport function Portal(props: PortalProps): JSX.Element {\n const context = useContext(DrawerContext);\n const [mounted, setMounted] = createSignal(false);\n onSettled(() => {\n setMounted(true);\n });\n\n return (\n <Show when={mounted() && (context.present || props.forceMount === true)}>\n <SolidPortal\n mount={props.container ?? context.props.container ?? document.body}\n >\n <PortalContext value={props.forceMount ?? false}>\n {props.children}\n </PortalContext>\n </SolidPortal>\n </Show>\n );\n}\n\nexport function Trigger(props: TriggerProps): JSX.Element {\n const context = useContext(DrawerContext);\n\n const attributes = merge(omit(props, \"render\", \"ref\", \"onClick\"), {\n \"aria-controls\": context.contentId,\n get \"aria-expanded\"(): \"true\" | \"false\" {\n return context.isOpen ? \"true\" : \"false\";\n },\n \"aria-haspopup\": \"dialog\" as const,\n get \"data-state\"() {\n return context.isOpen ? \"open\" : \"closed\";\n },\n onClick(\n event: Parameters<JSX.EventHandler<HTMLButtonElement, MouseEvent>>[0]\n ) {\n callHandler(props.onClick, event);\n\n if (!event.defaultPrevented) {\n context.setOpen(!context.isOpen);\n }\n },\n get ref() {\n return [\n props.ref,\n (element: HTMLButtonElement) => {\n context.setTrigger(element);\n },\n ];\n },\n get type() {\n return props.type ?? \"button\";\n },\n });\n\n return (\n <Show when={props.render} keyed fallback={<button {...attributes} />}>\n {(render) => render(attributes)}\n </Show>\n );\n}\n\nexport function Close(props: CloseProps): JSX.Element {\n const context = useContext(DrawerContext);\n\n const attributes = merge(omit(props, \"render\", \"onClick\"), {\n onClick(\n event: Parameters<JSX.EventHandler<HTMLButtonElement, MouseEvent>>[0]\n ) {\n callHandler(props.onClick, event);\n\n if (!event.defaultPrevented) {\n context.close();\n }\n },\n get type() {\n return props.type ?? \"button\";\n },\n });\n\n return (\n <Show when={props.render} keyed fallback={<button {...attributes} />}>\n {(render) => render(attributes)}\n </Show>\n );\n}\n\nexport function Overlay(props: OverlayProps): JSX.Element {\n const context = useContext(DrawerContext);\n const forceMount = useContext(PortalContext);\n\n return (\n <Show\n when={\n context.modal &&\n (context.present || props.forceMount === true || forceMount)\n }\n >\n <OverlayElement {...props} />\n </Show>\n );\n}\n\nfunction OverlayElement(props: OverlayProps): JSX.Element {\n const context = useContext(DrawerContext);\n const rest = omit(props, \"forceMount\", \"ref\");\n onSettled(() => () => {\n context.setOverlay(null);\n });\n\n return (\n <div\n {...rest}\n ref={[\n props.ref,\n (element) => {\n context.setOverlay(element);\n },\n ]}\n data-vaul-overlay=\"\"\n data-state={context.isOpen ? \"open\" : \"closed\"}\n data-vaul-snap-points={\n (context.props.snapPoints?.length ?? 0) > 0 ? \"true\" : \"false\"\n }\n data-vaul-snap-points-overlay={context.shouldFade ? \"true\" : \"false\"}\n data-vaul-animate={context.shouldAnimate ? \"true\" : \"false\"}\n />\n );\n}\n\nexport function Content(props: ContentProps): JSX.Element {\n const context = useContext(DrawerContext);\n const forceMount = useContext(PortalContext);\n\n return (\n <Show when={context.present || props.forceMount === true || forceMount}>\n <ContentElement {...props} />\n </Show>\n );\n}\n\nfunction ContentElement(props: ContentProps): JSX.Element {\n const context = useContext(DrawerContext);\n\n const rest = omit(\n props,\n \"forceMount\",\n \"ref\",\n \"onOpenAutoFocus\",\n \"onCloseAutoFocus\",\n \"onEscapeKeyDown\",\n \"onPointerDownOutside\",\n \"onFocusOutside\",\n \"onInteractOutside\",\n \"onPointerDown\",\n \"onPointerMove\",\n \"onPointerUp\",\n \"onPointerCancel\",\n \"onLostPointerCapture\"\n );\n\n createLayer(context, props);\n onSettled(() => () => {\n context.setContent(null);\n });\n\n return (\n <FocusScope contain={context.isOpen && context.modal && !context.childOpen}>\n <div\n id={context.contentId}\n role=\"dialog\"\n aria-modal={context.modal ? \"true\" : undefined}\n aria-labelledby={context.titleId}\n aria-describedby={context.descriptionId}\n tabindex={-1}\n {...rest}\n ref={[\n props.ref,\n (element) => {\n context.setContent(element);\n },\n ]}\n data-state={context.isOpen ? \"open\" : \"closed\"}\n data-vaul-drawer=\"\"\n data-vaul-drawer-direction={context.direction}\n data-vaul-custom-container={context.props.container ? \"true\" : \"false\"}\n data-vaul-snap-points={\n (context.props.snapPoints?.length ?? 0) > 0 ? \"true\" : \"false\"\n }\n data-vaul-delayed-snap-points={\n context.snapPointsOffset.length > 0 ? \"true\" : \"false\"\n }\n data-vaul-handle-only={\n context.props.handleOnly === true ? \"true\" : \"false\"\n }\n data-vaul-animate={context.shouldAnimate ? \"true\" : \"false\"}\n onPointerDown={(event) => {\n callHandler(props.onPointerDown, event);\n context.press(event);\n }}\n onPointerMove={(event) => {\n callHandler(props.onPointerMove, event);\n\n if (!event.defaultPrevented) {\n context.drag(event);\n }\n }}\n onPointerUp={(event) => {\n callHandler(props.onPointerUp, event);\n context.release(event);\n }}\n onPointerCancel={(event) => {\n callHandler(props.onPointerCancel, event);\n context.cancelDrag();\n }}\n onLostPointerCapture={(event) => {\n callHandler(props.onLostPointerCapture, event);\n context.cancelDrag();\n }}\n />\n </FocusScope>\n );\n}\n\nexport function Title(props: TitleProps): JSX.Element {\n const context = useContext(DrawerContext);\n\n return <h2 id={context.titleId} {...props} />;\n}\n\nexport function Description(props: DescriptionProps): JSX.Element {\n const context = useContext(DrawerContext);\n\n return <p id={context.descriptionId} {...props} />;\n}\n\nexport function Handle(props: HandleProps): JSX.Element {\n const context = useContext(DrawerContext);\n\n const rest = omit(\n props,\n \"preventCycle\",\n \"children\",\n \"onClick\",\n \"onPointerDown\",\n \"onPointerMove\",\n \"onPointerCancel\"\n );\n\n let pressTime = 0;\n let pressPosition = { x: 0, y: 0 };\n let moved = false;\n let lastClick = -Infinity;\n\n function cycle(): void {\n if (\n props.preventCycle === true ||\n moved ||\n Date.now() - pressTime > 250 ||\n Date.now() - lastClick < 120\n ) {\n return;\n }\n\n lastClick = Date.now();\n const points = context.props.snapPoints;\n\n if (!points || points.length === 0) {\n context.close();\n\n return;\n }\n\n const next = points[context.activeSnapPointIndex + 1];\n\n if (next !== undefined) {\n context.setActiveSnapPoint(next);\n } else if (context.dismissible) {\n context.close();\n } else {\n context.setActiveSnapPoint(points[0] ?? null);\n }\n }\n\n return (\n <div\n {...rest}\n data-vaul-handle=\"\"\n aria-hidden=\"true\"\n data-vaul-drawer-visible={context.isOpen ? \"true\" : \"false\"}\n onClick={(event) => {\n callHandler(props.onClick, event);\n\n if (!event.defaultPrevented) {\n cycle();\n }\n }}\n onPointerDown={(event) => {\n callHandler(props.onPointerDown, event);\n\n if (event.defaultPrevented) {\n return;\n }\n\n pressTime = Date.now();\n pressPosition = { x: event.clientX, y: event.clientY };\n moved = false;\n context.press(event, true);\n event.stopPropagation();\n }}\n onPointerMove={(event) => {\n callHandler(props.onPointerMove, event);\n\n if (\n Math.abs(event.clientX - pressPosition.x) > 2 ||\n Math.abs(event.clientY - pressPosition.y) > 2\n ) {\n moved = true;\n }\n }}\n onPointerCancel={(event) => {\n callHandler(props.onPointerCancel, event);\n moved = true;\n context.cancelDrag();\n }}\n >\n <span data-vaul-handle-hitarea=\"\" aria-hidden=\"true\">\n {props.children}\n </span>\n </div>\n );\n}\n\nfunction callHandler<T, E extends Event>(\n handler: JSX.EventHandlerUnion<T, E> | undefined,\n event: Parameters<JSX.EventHandler<T, E>>[0]\n): void {\n if (typeof handler === \"function\") {\n handler(event);\n } else if (handler) {\n handler[0](handler[1], event);\n }\n}\n","import {\n Close,\n Content,\n Description,\n Handle,\n NestedRoot,\n Overlay,\n Portal,\n Root,\n Title,\n Trigger,\n} from \"./drawer\";\n\nexport {\n Close,\n Content,\n Description,\n Handle,\n NestedRoot,\n Overlay,\n Portal,\n Root,\n Title,\n Trigger,\n} from \"./drawer\";\n\nexport type {\n CloseProps,\n ContentProps,\n DescriptionProps,\n DialogProps,\n DrawerDirection,\n DrawerProps,\n FocusOutsideEvent,\n HandleProps,\n InteractOutsideEvent,\n OverlayProps,\n PointerDownOutsideEvent,\n PortalProps,\n SnapPoint,\n TitleProps,\n TriggerProps,\n WithFadeFromProps,\n WithoutFadeFromProps,\n} from \"./types\";\n\nexport const Drawer = {\n Close,\n Content,\n Description,\n Handle,\n NestedRoot,\n Overlay,\n Portal,\n Root,\n Title,\n Trigger,\n};\n"],"mappings":";;;;;;;;;;;;AA8CA,MAAa,gBAAgB,cAAkC;AAC/D,MAAa,gBAAgB,cAAc,KAAK;;ACxChD,MAAa,cAAc;CACzB,UAAU;CACV,MAAM;EAAC;EAAM;EAAM;EAAG;CAAC;AACzB;AAcA,MAAa,aAAa;;ACf1B,SAAgB,WAAW,WAAqC;CAC9D,OAA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,IACE,KAAK,IAAI,MAAM,UAAU,cAAc,CAAC,IAAI,KAC5C,KAAK,IAAI,MAAM,UAAU,cAAc,CAAC,IAAI,GAE5C,QAAQ;EAEZ;EACAC,kBAAkB,UAAU;GAC1B,YAAY,MAAM,iBAAiB,KAAK;GACxC,QAAQ;GACR,QAAQ,WAAW;EACrB;;CAEA,OAAA,OACEC,YAAAA;EAAC,OAAA,MAAM;CAAQ,CAAA,CACX;CA3CR,mBA4CK;CA7CP,OACEC;AA8CJ;AAEA,SAAS,YACP,SACA,OACM;CACN,IAAI,OAAO,YAAY,YACrB,QAAQ,KAAK;MACR,IAAI,SACT,QAAQ,EAAE,CAAC,QAAQ,IAAI,KAAK;AAEhC;;AC3VA,MAAa,SAAS;CACpB;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACF"}
1
+ {"version":3,"file":"index.js","names":["<DrawerContext value={context}>{props.children}</DrawerContext>","value={context}","<Show when={mounted() && (context.present || props.forceMount === true)}>\n <SolidPortal\n mount={props.container ?? context.props.container ?? document.body}\n >\n <PortalContext value={props.forceMount ?? false}>\n {props.children}\n </PortalContext>\n </SolidPortal>\n </Show>","<SolidPortal\n mount={props.container ?? context.props.container ?? document.body}\n >\n <PortalContext value={props.forceMount ?? false}>\n {props.children}\n </PortalContext>\n </SolidPortal>","<PortalContext value={props.forceMount ?? false}>\n {props.children}\n </PortalContext>","<Show when={props.render} keyed fallback={<button {...attributes} />}>\n {(render) => render(attributes)}\n </Show>","<button {...attributes} />","<Show\n when={\n context.modal &&\n (context.present || props.forceMount === true || forceMount)\n }\n >\n <OverlayElement {...props} />\n </Show>","<OverlayElement {...props} />","ref={[\n props.ref,\n (element) => {\n context.setOverlay(element);\n },\n ]}","<div\n {...rest}\n ref={[\n props.ref,\n (element) => {\n context.setOverlay(element);\n },\n ]}\n data-vaul-overlay=\"\"\n data-state={context.isOpen ? \"open\" : \"closed\"}\n data-vaul-snap-points={\n (context.props.snapPoints?.length ?? 0) > 0 ? \"true\" : \"false\"\n }\n data-vaul-snap-points-overlay={context.shouldFade ? \"true\" : \"false\"}\n data-vaul-animate={context.shouldAnimate ? \"true\" : \"false\"}\n />","<Show when={context.present || props.forceMount === true || forceMount}>\n <ContentElement {...props} />\n </Show>","<ContentElement {...props} />","<FocusScope contain={context.isOpen && context.modal && !context.childOpen}>\n <div\n id={context.contentId}\n role=\"dialog\"\n aria-modal={context.modal ? \"true\" : undefined}\n aria-labelledby={context.titleId}\n aria-describedby={context.descriptionId}\n tabindex={-1}\n {...rest}\n ref={[\n props.ref,\n (element) => {\n context.setContent(element);\n },\n ]}\n data-state={context.isOpen ? \"open\" : \"closed\"}\n data-vaul-drawer=\"\"\n data-vaul-drawer-direction={context.direction}\n data-vaul-custom-container={context.props.container ? \"true\" : \"false\"}\n data-vaul-snap-points={\n (context.props.snapPoints?.length ?? 0) > 0 ? \"true\" : \"false\"\n }\n data-vaul-delayed-snap-points={\n context.snapPointsOffset.length > 0 ? \"true\" : \"false\"\n }\n data-vaul-handle-only={\n context.props.handleOnly === true ? \"true\" : \"false\"\n }\n data-vaul-animate={context.shouldAnimate ? \"true\" : \"false\"}\n onPointerDown={(event) => {\n callHandler(props.onPointerDown, event);\n context.press(event);\n }}\n onPointerMove={(event) => {\n callHandler(props.onPointerMove, event);\n\n if (!event.defaultPrevented) {\n context.drag(event);\n }\n }}\n onPointerUp={(event) => {\n callHandler(props.onPointerUp, event);\n context.release(event);\n }}\n onPointerCancel={(event) => {\n callHandler(props.onPointerCancel, event);\n context.cancelDrag();\n }}\n onLostPointerCapture={(event) => {\n callHandler(props.onLostPointerCapture, event);\n context.cancelDrag();\n }}\n />\n </FocusScope>","context.isOpen && context.modal && !context.childOpen","role=\"dialog\"","tabindex={-1}","onPointerDown={(event) => {\n callHandler(props.onPointerDown, event);\n context.press(event);\n }}","onPointerMove={(event) => {\n callHandler(props.onPointerMove, event);\n\n if (!event.defaultPrevented) {\n context.drag(event);\n }\n }}","onPointerUp={(event) => {\n callHandler(props.onPointerUp, event);\n context.release(event);\n }}","onPointerCancel={(event) => {\n callHandler(props.onPointerCancel, event);\n context.cancelDrag();\n }}","onLostPointerCapture={(event) => {\n callHandler(props.onLostPointerCapture, event);\n context.cancelDrag();\n }}","ref={[\n props.ref,\n (element) => {\n context.setContent(element);\n },\n ]}","<div\n id={context.contentId}\n role=\"dialog\"\n aria-modal={context.modal ? \"true\" : undefined}\n aria-labelledby={context.titleId}\n aria-describedby={context.descriptionId}\n tabindex={-1}\n {...rest}\n ref={[\n props.ref,\n (element) => {\n context.setContent(element);\n },\n ]}\n data-state={context.isOpen ? \"open\" : \"closed\"}\n data-vaul-drawer=\"\"\n data-vaul-drawer-direction={context.direction}\n data-vaul-custom-container={context.props.container ? \"true\" : \"false\"}\n data-vaul-snap-points={\n (context.props.snapPoints?.length ?? 0) > 0 ? \"true\" : \"false\"\n }\n data-vaul-delayed-snap-points={\n context.snapPointsOffset.length > 0 ? \"true\" : \"false\"\n }\n data-vaul-handle-only={\n context.props.handleOnly === true ? \"true\" : \"false\"\n }\n data-vaul-animate={context.shouldAnimate ? \"true\" : \"false\"}\n onPointerDown={(event) => {\n callHandler(props.onPointerDown, event);\n context.press(event);\n }}\n onPointerMove={(event) => {\n callHandler(props.onPointerMove, event);\n\n if (!event.defaultPrevented) {\n context.drag(event);\n }\n }}\n onPointerUp={(event) => {\n callHandler(props.onPointerUp, event);\n context.release(event);\n }}\n onPointerCancel={(event) => {\n callHandler(props.onPointerCancel, event);\n context.cancelDrag();\n }}\n onLostPointerCapture={(event) => {\n callHandler(props.onLostPointerCapture, event);\n context.cancelDrag();\n }}\n />","<h2 id={context.titleId} {...props} />","<p id={context.descriptionId} {...props} />","onClick={(event) => {\n callHandler(props.onClick, event);\n\n if (!event.defaultPrevented) {\n cycle();\n }\n }}","onPointerDown={(event) => {\n callHandler(props.onPointerDown, event);\n\n if (event.defaultPrevented) {\n return;\n }\n\n pressTime = Date.now();\n pressPosition = { x: event.clientX, y: event.clientY };\n moved = false;\n context.press(event, true);\n event.stopPropagation();\n }}","onPointerMove={(event) => {\n callHandler(props.onPointerMove, event);\n\n if (\n Math.abs(event.clientX - pressPosition.x) > 2 ||\n Math.abs(event.clientY - pressPosition.y) > 2\n ) {\n moved = true;\n }\n }}","onPointerCancel={(event) => {\n callHandler(props.onPointerCancel, event);\n moved = true;\n context.cancelDrag();\n }}","{props.children}","<div\n {...rest}\n data-vaul-handle=\"\"\n aria-hidden=\"true\"\n data-vaul-drawer-visible={context.isOpen ? \"true\" : \"false\"}\n onClick={(event) => {\n callHandler(props.onClick, event);\n\n if (!event.defaultPrevented) {\n cycle();\n }\n }}\n onPointerDown={(event) => {\n callHandler(props.onPointerDown, event);\n\n if (event.defaultPrevented) {\n return;\n }\n\n pressTime = Date.now();\n pressPosition = { x: event.clientX, y: event.clientY };\n moved = false;\n context.press(event, true);\n event.stopPropagation();\n }}\n onPointerMove={(event) => {\n callHandler(props.onPointerMove, event);\n\n if (\n Math.abs(event.clientX - pressPosition.x) > 2 ||\n Math.abs(event.clientY - pressPosition.y) > 2\n ) {\n moved = true;\n }\n }}\n onPointerCancel={(event) => {\n callHandler(props.onPointerCancel, event);\n moved = true;\n context.cancelDrag();\n }}\n >\n <span data-vaul-handle-hitarea=\"\" aria-hidden=\"true\">\n {props.children}\n </span>\n </div>","_$createComponent","_$memo","SolidPortal","_$getNextElement","_$scope"],"sources":["../../src/context.ts","../../src/constants.ts","../../src/helpers.ts","../../src/create-background.ts","../../src/create-snap-points.ts","../../src/create-drawer.ts","../../src/create-layer.ts","../../src/create-position.ts","../../src/drawer.tsx","../../src/index.ts"],"sourcesContent":["/*\n * Derived from Vaul (https://github.com/emilkowalski/vaul): src/context.ts.\n * Copyright (c) 2023 Emil Kowalski\n * Modified for Solid Aria: native Solid 2 contexts, reactive getters, and callback refs.\n * MIT licensed. See LICENSE, VAUL-LICENSE, and NOTICE.txt in the package root.\n */\n\nimport { createContext } from \"solid-js\";\n\nimport type { DialogProps, DrawerDirection, SnapPoint } from \"./types\";\n\nexport interface DrawerContextValue {\n readonly props: DialogProps;\n readonly isOpen: boolean;\n readonly present: boolean;\n readonly shouldAnimate: boolean;\n readonly direction: DrawerDirection;\n readonly modal: boolean;\n readonly dismissible: boolean;\n readonly contentId: string;\n readonly titleId: string;\n readonly descriptionId: string;\n readonly content: HTMLDivElement | null;\n readonly overlay: HTMLDivElement | null;\n readonly trigger: HTMLButtonElement | null;\n readonly activeSnapPoint: SnapPoint | null;\n readonly activeSnapPointIndex: number;\n readonly snapPointsOffset: readonly number[];\n readonly shouldFade: boolean;\n readonly isDragging: boolean;\n readonly dragProgress: number;\n readonly childOpen: boolean;\n setContent: (element: HTMLDivElement | null) => void;\n setOverlay: (element: HTMLDivElement | null) => void;\n setTrigger: (element: HTMLButtonElement | null) => void;\n setActiveSnapPoint: (point: SnapPoint | null) => void;\n setOpen: (open: boolean) => void;\n close: () => void;\n press: (event: PointerEvent, fromHandle?: boolean) => void;\n drag: (event: PointerEvent) => void;\n release: (event: PointerEvent) => void;\n cancelDrag: () => void;\n setChildOpen: (open: boolean) => void;\n setChildProgress: (progress: number) => void;\n}\n\nexport const DrawerContext = createContext<DrawerContextValue>();\nexport const PortalContext = createContext(false);\n","/*\n * Derived from Vaul (https://github.com/emilkowalski/vaul): src/constants.ts.\n * Copyright (c) 2023 Emil Kowalski\n * Modified for Solid Aria: preserved drawer animation and gesture constants.\n * MIT licensed. See LICENSE, VAUL-LICENSE, and NOTICE.txt in the package root.\n */\n\nexport const TRANSITIONS = {\n DURATION: 0.5,\n EASE: [0.32, 0.72, 0, 1],\n};\n\nexport const VELOCITY_THRESHOLD = 0.4;\n\nexport const CLOSE_THRESHOLD = 0.25;\n\nexport const SCROLL_LOCK_TIMEOUT = 100;\n\nexport const BORDER_RADIUS = 8;\n\nexport const NESTED_DISPLACEMENT = 16;\n\nexport const WINDOW_TOP_OFFSET = 26;\n\nexport const DRAG_CLASS = \"vaul-dragging\";\n","/*\n * Derived from Vaul (https://github.com/emilkowalski/vaul): src/helpers.ts and src/browser.ts.\n * Copyright (c) 2023 Emil Kowalski\n * Modified for Solid Aria: typed geometry and property-scoped style restoration without shared style caches.\n * MIT licensed. See LICENSE, VAUL-LICENSE, and NOTICE.txt in the package root.\n */\n\nimport type { DrawerDirection } from \"./types\";\n\nexport function isVertical(direction: DrawerDirection): boolean {\n return direction === \"top\" || direction === \"bottom\";\n}\n\nexport function directionSign(direction: DrawerDirection): 1 | -1 {\n return direction === \"bottom\" || direction === \"right\" ? 1 : -1;\n}\n\nexport function translate(\n distance: number,\n direction: DrawerDirection\n): string {\n return isVertical(direction)\n ? `translate3d(0, ${distance}px, 0)`\n : `translate3d(${distance}px, 0, 0)`;\n}\n\nexport function dampenValue(value: number): number {\n return Math.max(0, 8 * (Math.log(value + 1) - 2));\n}\n\nexport function clamp(value: number, min = 0, max = 1): number {\n return Math.min(max, Math.max(min, value));\n}\n\n/** Restore only the properties this operation owns, including priorities. */\nexport function assignStyle(\n element: HTMLElement,\n styles: Record<string, string>\n): () => void {\n const previous = Object.keys(styles).map((property) => ({\n priority: element.style.getPropertyPriority(property),\n property,\n value: element.style.getPropertyValue(property),\n }));\n\n for (const [property, value] of Object.entries(styles)) {\n element.style.setProperty(property, value);\n }\n\n return () => {\n for (const { property, value, priority } of previous) {\n if (value) {\n element.style.setProperty(property, value, priority);\n } else {\n element.style.removeProperty(property);\n }\n }\n };\n}\n\nexport function isSafari(view: Window): boolean {\n return /^(?:(?!chrome|android).)*safari/iu.test(view.navigator.userAgent);\n}\n\nexport function canScroll(\n target: HTMLElement,\n content: HTMLElement,\n direction: DrawerDirection,\n distance: number\n): boolean {\n const vertical = isVertical(direction);\n const forward = distance * directionSign(direction) < 0;\n\n for (\n let node: HTMLElement | null = target;\n node && content.contains(node);\n node = node.parentElement\n ) {\n const scrollSize = vertical ? node.scrollHeight : node.scrollWidth;\n const size = vertical ? node.clientHeight : node.clientWidth;\n\n if (scrollSize <= size) {\n continue;\n }\n\n const position = vertical ? node.scrollTop : node.scrollLeft;\n\n if (\n (forward && position < scrollSize - size) ||\n (!forward && position > 0)\n ) {\n return true;\n }\n }\n\n return false;\n}\n","/*\n * Derived from Vaul (https://github.com/emilkowalski/vaul): src/use-scale-background.ts and src/index.tsx.\n * Copyright (c) 2023 Emil Kowalski\n * Modified for Solid Aria: Solid 2 effects, document-local scaling, drag interpolation, and complete style cleanup.\n * MIT licensed. See LICENSE, VAUL-LICENSE, and NOTICE.txt in the package root.\n */\n\nimport { createEffect } from \"solid-js\";\n\nimport { BORDER_RADIUS, TRANSITIONS, WINDOW_TOP_OFFSET } from \"./constants\";\nimport type { DrawerContextValue } from \"./context\";\nimport { assignStyle, isVertical } from \"./helpers\";\n\nexport function createBackground(context: DrawerContextValue): void {\n let background: HTMLElement | null = null;\n let initialScale = 1;\n let vertical = true;\n createEffect(\n () => ({\n color:\n context.props.setBackgroundColorOnScale !== false &&\n context.props.noBodyStyles !== true,\n direction: context.direction,\n element: context.content,\n enabled: context.props.shouldScaleBackground === true,\n nested: context.props.nested === true,\n open: context.isOpen,\n }),\n ({\n element,\n open,\n enabled,\n color,\n direction,\n nested,\n }): undefined | (() => void) => {\n if (!element || !open || !enabled || nested) {\n return undefined;\n }\n\n const doc = element.ownerDocument;\n\n const wrapper = doc.querySelector<HTMLElement>(\n \"[data-vaul-drawer-wrapper], [vaul-drawer-wrapper]\"\n );\n\n const view = doc.defaultView;\n\n if (!wrapper || !view) {\n return undefined;\n }\n\n background = wrapper;\n initialScale = (view.innerWidth - WINDOW_TOP_OFFSET) / view.innerWidth;\n vertical = isVertical(direction);\n\n const restoreBody = color\n ? assignStyle(doc.body, { background: \"black\" })\n : undefined;\n\n const restoreWrapper = assignStyle(wrapper, {\n \"border-radius\": `${BORDER_RADIUS}px`,\n overflow: \"hidden\",\n transform: `scale(${initialScale}) ${vertical ? \"translate3d(0, 14px, 0)\" : \"translate3d(14px, 0, 0)\"}`,\n \"transform-origin\": vertical ? \"top\" : \"left\",\n \"transition-duration\": `${TRANSITIONS.DURATION}s`,\n \"transition-property\": \"transform, border-radius\",\n \"transition-timing-function\": `cubic-bezier(${TRANSITIONS.EASE.join(\",\")})`,\n });\n\n return () => {\n background = null;\n restoreWrapper();\n restoreBody?.();\n };\n },\n { ssrSource: \"client\" }\n );\n createEffect(\n () => ({\n dragging: context.isDragging,\n element: context.content,\n open: context.isOpen,\n progress: context.dragProgress,\n }),\n ({ progress, dragging, open }) => {\n if (!background || !open) {\n return;\n }\n\n const scale = initialScale + progress * (1 - initialScale);\n const displacement = 14 * (1 - progress);\n background.style.transitionDuration = dragging\n ? \"0s\"\n : `${TRANSITIONS.DURATION}s`;\n background.style.borderRadius = `${BORDER_RADIUS * (1 - progress)}px`;\n background.style.transform = `scale(${scale}) ${vertical ? `translate3d(0, ${displacement}px, 0)` : `translate3d(${displacement}px, 0, 0)`}`;\n },\n { ssrSource: \"client\" }\n );\n}\n","/*\n * Derived from Vaul (https://github.com/emilkowalski/vaul): src/use-snap-points.ts.\n * Copyright (c) 2023 Emil Kowalski\n * Modified for Solid Aria: pure snap geometry and selection, bounded sequential swipes, and container dimensions.\n * MIT licensed. See LICENSE, VAUL-LICENSE, and NOTICE.txt in the package root.\n */\n\nimport { VELOCITY_THRESHOLD } from \"./constants\";\nimport { clamp, directionSign } from \"./helpers\";\nimport type { DrawerDirection, SnapPoint } from \"./types\";\n\nexport function getSnapPointOffsets(\n points: readonly SnapPoint[],\n dimension: number,\n direction: DrawerDirection\n): number[] {\n return points.map((point) => {\n const visible =\n typeof point === \"number\"\n ? point * dimension\n : Number(point.replace(/px$/u, \"\"));\n\n return (dimension - visible) * directionSign(direction);\n });\n}\n\nexport function getOverlayOpacity(\n offsets: readonly number[],\n offset: number,\n fadeFromIndex: number,\n dimension: number\n): number {\n const faded = Math.abs(offsets[fadeFromIndex] ?? 0);\n\n const clear =\n fadeFromIndex === 0\n ? dimension\n : Math.abs(offsets[fadeFromIndex - 1] ?? faded);\n\n if (clear === faded) {\n return offset <= faded ? 1 : 0;\n }\n\n return clamp((clear - offset) / (clear - faded));\n}\n\nexport function selectSnapPoint(options: {\n offsets: readonly number[];\n activeIndex: number;\n /** Positive distance moves toward the closed edge. */\n distance: number;\n velocity: number;\n dimension: number;\n dismissible: boolean;\n sequential: boolean;\n}): number | \"close\" {\n const {\n offsets,\n activeIndex,\n distance,\n velocity,\n dimension,\n dismissible,\n sequential,\n } = options;\n\n const [first] = offsets;\n\n if (first === undefined) {\n return activeIndex;\n }\n\n const active = Math.abs(offsets[activeIndex] ?? first);\n const position = active + distance;\n\n if (!sequential && velocity > 2) {\n if (distance <= 0) {\n return offsets.length - 1;\n }\n\n return dismissible ? \"close\" : 0;\n }\n\n if (velocity > VELOCITY_THRESHOLD && Math.abs(distance) < dimension * 0.4) {\n if (distance > 0 && activeIndex === 0 && dismissible) {\n return \"close\";\n }\n\n return clamp(activeIndex + (distance > 0 ? -1 : 1), 0, offsets.length - 1);\n }\n\n const remaining = dimension - Math.abs(first);\n\n if (\n dismissible &&\n distance > 0 &&\n position > Math.abs(first) + remaining / 2\n ) {\n return \"close\";\n }\n\n let closest = 0;\n let difference = Infinity;\n\n for (const [index, offset] of offsets.entries()) {\n if (sequential && Math.abs(index - activeIndex) > 1) {\n continue;\n }\n\n const nextDifference = Math.abs(Math.abs(offset) - position);\n\n if (nextDifference < difference) {\n difference = nextDifference;\n closest = index;\n }\n }\n\n return closest;\n}\n","/*\n * Derived from Vaul (https://github.com/emilkowalski/vaul): src/index.tsx.\n * Copyright (c) 2023 Emil Kowalski\n * Modified for Solid Aria: native Solid 2 controlled state, presence, pointer gestures, measured snap-point entry, nested transforms, and lifecycle.\n * MIT licensed. See LICENSE, VAUL-LICENSE, and NOTICE.txt in the package root.\n */\n\nimport {\n createEffect,\n createMemo,\n createSignal,\n createUniqueId,\n onSettled,\n untrack,\n} from \"solid-js\";\n\nimport {\n CLOSE_THRESHOLD,\n DRAG_CLASS,\n NESTED_DISPLACEMENT,\n SCROLL_LOCK_TIMEOUT,\n TRANSITIONS,\n VELOCITY_THRESHOLD,\n} from \"./constants\";\nimport type { DrawerContextValue } from \"./context\";\nimport {\n getOverlayOpacity,\n getSnapPointOffsets,\n selectSnapPoint,\n} from \"./create-snap-points\";\nimport {\n canScroll,\n clamp,\n dampenValue,\n directionSign,\n isVertical,\n translate,\n} from \"./helpers\";\nimport type { DialogProps, SnapPoint } from \"./types\";\n\nconst transition = `${TRANSITIONS.DURATION}s cubic-bezier(${TRANSITIONS.EASE.join(\",\")})`;\n\ninterface Gesture {\n x: number;\n y: number;\n startedAt: number;\n dimension: number;\n startOffset: number;\n distance: number;\n allowed: boolean;\n fromHandle: boolean;\n pointerId: number;\n target: HTMLElement;\n}\n\nexport function createDrawer(\n props: DialogProps,\n parent?: DrawerContextValue\n): DrawerContextValue {\n const [internalOpen, setInternalOpen] = createSignal(\n untrack(() => props.defaultOpen ?? false)\n );\n\n const isOpen = createMemo(() => props.open ?? internalOpen());\n const [present, setPresent] = createSignal(untrack(isOpen));\n\n const [animate, setAnimate] = createSignal(\n untrack(() => props.defaultOpen !== true)\n );\n\n const [internalSnap, setInternalSnap] = createSignal<SnapPoint | null>(\n untrack(() => props.snapPoints?.[0] ?? null)\n );\n\n const activeSnap = createMemo(() =>\n props.activeSnapPoint === undefined ? internalSnap() : props.activeSnapPoint\n );\n\n const [content, setContent] = createSignal<HTMLDivElement | null>(null, {\n ownedWrite: true,\n });\n\n const [overlay, setOverlay] = createSignal<HTMLDivElement | null>(null, {\n ownedWrite: true,\n });\n\n const [trigger, setTrigger] = createSignal<HTMLButtonElement | null>(null, {\n ownedWrite: true,\n });\n\n const [dimension, setDimension] = createSignal(0);\n const [dragging, setDragging] = createSignal(false);\n const [dragProgress, setDragProgress] = createSignal(0);\n const [childOpen, setChildOpen] = createSignal(false);\n const [childProgress, setChildProgress] = createSignal(0);\n const direction = () => props.direction ?? \"bottom\";\n const points = () => props.snapPoints ?? [];\n\n const offsets = createMemo(() =>\n getSnapPointOffsets(points(), dimension(), direction())\n );\n\n const activeIndex = createMemo(() =>\n Math.max(0, points().indexOf(activeSnap() ?? points()[0] ?? 0))\n );\n\n const offset = () => offsets()[activeIndex()] ?? 0;\n\n const fadeFromIndex = () =>\n props.fadeFromIndex ?? Math.max(0, points().length - 1);\n\n const id = createUniqueId();\n let gesture: Gesture | null = null;\n let lastScrollTime = -Infinity;\n let openedAt = -Infinity;\n\n const onScroll = () => {\n lastScrollTime = Date.now();\n };\n\n function setOpen(open: boolean): void {\n if (open === isOpen()) {\n return;\n }\n\n if (props.open === undefined) {\n setInternalOpen(open);\n }\n\n props.onOpenChange?.(open);\n }\n\n function setActiveSnapPoint(point: SnapPoint | null): void {\n if (point === activeSnap()) {\n return;\n }\n\n if (props.activeSnapPoint === undefined) {\n setInternalSnap(point);\n }\n\n props.setActiveSnapPoint?.(point);\n }\n\n function resetPosition(): void {\n const element = content();\n\n if (!element) {\n return;\n }\n\n element.classList.remove(DRAG_CLASS);\n element.style.transition = `transform ${transition}`;\n element.style.transform = translate(offset(), direction());\n const backdrop = overlay();\n\n if (backdrop) {\n backdrop.style.transition = `opacity ${transition}`;\n backdrop.style.opacity = points().length\n ? `${getOverlayOpacity(offsets(), Math.abs(offset()), fadeFromIndex(), dimension())}`\n : \"1\";\n }\n }\n\n function cancelDrag(): void {\n if (!gesture) {\n return;\n }\n\n if (gesture.target.hasPointerCapture?.(gesture.pointerId)) {\n gesture.target.releasePointerCapture(gesture.pointerId);\n }\n\n gesture = null;\n setDragging(false);\n setDragProgress(0);\n untrack(resetPosition);\n parent?.setChildProgress(0);\n }\n\n function close(): void {\n cancelDrag();\n\n if (props.dismissible !== false) {\n setOpen(false);\n }\n }\n\n createEffect(\n isOpen,\n (open, previous): undefined | (() => void) => {\n if (open) {\n openedAt = Date.now();\n setPresent(true);\n } else {\n cancelDrag();\n\n if (previous === true) {\n props.onClose?.();\n }\n }\n\n parent?.setChildOpen(open);\n\n if (previous === undefined && !open) {\n return undefined;\n }\n\n const view = untrack(content)?.ownerDocument.defaultView;\n\n const duration =\n view?.matchMedia(\"(prefers-reduced-motion: reduce)\").matches === true\n ? 0\n : TRANSITIONS.DURATION * 1000;\n\n const timer = setTimeout(() => {\n if (!open) {\n setPresent(false);\n setActiveSnapPoint(points()[0] ?? null);\n }\n\n if (previous !== undefined) {\n props.onAnimationEnd?.(open);\n }\n }, duration);\n\n return () => {\n clearTimeout(timer);\n };\n },\n { ssrSource: \"client\" }\n );\n\n createEffect(\n () => ({\n container: props.container,\n direction: direction(),\n element: content(),\n }),\n ({\n element,\n container,\n direction: currentDirection,\n }): undefined | (() => void) => {\n if (!element) {\n return undefined;\n }\n\n const view = element.ownerDocument.defaultView;\n\n if (!view) {\n return undefined;\n }\n\n const measure = (): void => {\n const rect = container?.getBoundingClientRect();\n setDimension(\n isVertical(currentDirection)\n ? (rect?.height ?? view.innerHeight)\n : (rect?.width ?? view.innerWidth)\n );\n };\n\n measure();\n view.addEventListener(\"resize\", measure);\n\n const observer =\n typeof ResizeObserver === \"undefined\"\n ? undefined\n : new ResizeObserver(measure);\n\n if (container) {\n observer?.observe(container);\n }\n\n element.addEventListener(\"scroll\", onScroll, true);\n\n return () => {\n view.removeEventListener(\"resize\", measure);\n observer?.disconnect();\n element.removeEventListener(\"scroll\", onScroll, true);\n cancelDrag();\n };\n },\n { ssrSource: \"client\" }\n );\n\n createEffect(\n () => ({\n animate: animate(),\n backdrop: overlay(),\n child: childOpen(),\n dimension: dimension(),\n direction: direction(),\n element: content(),\n hasSnapPoints: points().length > 0,\n offset: offset(),\n opacity: points().length\n ? getOverlayOpacity(\n offsets(),\n Math.abs(offset()),\n fadeFromIndex(),\n dimension()\n )\n : 1,\n open: isOpen(),\n progress: childProgress(),\n }),\n ({\n animate: shouldAnimate,\n element,\n backdrop,\n dimension: currentDimension,\n hasSnapPoints,\n open,\n offset: currentOffset,\n child,\n progress,\n direction: currentDirection,\n opacity,\n }) => {\n if (!element || (hasSnapPoints && currentDimension === 0)) {\n return;\n }\n\n const sign = directionSign(currentDirection);\n const view = element.ownerDocument.defaultView;\n\n const size = isVertical(currentDirection)\n ? view?.innerHeight\n : view?.innerWidth;\n\n const scale = child\n ? 1 - (NESTED_DISPLACEMENT / Math.max(1, size ?? 1)) * (1 - progress)\n : 1;\n\n const displacement = child\n ? -NESTED_DISPLACEMENT * (1 - progress) * sign\n : 0;\n\n if (hasSnapPoints && shouldAnimate && element.style.transform === \"\") {\n // Commit the closed position before transitioning to the measured snap point.\n element.getBoundingClientRect();\n }\n\n element.style.transition = shouldAnimate\n ? `transform ${transition}`\n : \"none\";\n element.style.transform = `${translate(open ? currentOffset + displacement : sign * (size ?? currentDimension), currentDirection)} scale(${scale})`;\n\n if (backdrop) {\n backdrop.style.transition = shouldAnimate\n ? `opacity ${transition}`\n : \"none\";\n backdrop.style.opacity = open ? `${opacity}` : \"0\";\n }\n },\n { ssrSource: \"client\" }\n );\n\n onSettled(() => {\n const frame = requestAnimationFrame(() => {\n setAnimate(true);\n });\n\n return () => {\n cancelAnimationFrame(frame);\n parent?.setChildOpen(false);\n };\n });\n\n function press(event: PointerEvent, fromHandle = false): void {\n const element = content();\n const { target } = event;\n\n if (\n !element ||\n !isOpen() ||\n childOpen() ||\n event.defaultPrevented ||\n event.button > 0\n ) {\n return;\n }\n\n if (\n !(target instanceof HTMLElement) ||\n target.closest(\"[data-vaul-drawer]\") !== element\n ) {\n return;\n }\n\n if (\n target.closest(\"[data-vaul-no-drag],select,option\") ||\n (props.handleOnly === true && !fromHandle)\n ) {\n return;\n }\n\n if (props.dismissible === false && !points().length) {\n return;\n }\n\n const rect = element.getBoundingClientRect();\n gesture = {\n allowed: false,\n dimension: isVertical(direction()) ? rect.height : rect.width,\n distance: 0,\n fromHandle,\n pointerId: event.pointerId,\n startOffset: Math.abs(offset()),\n startedAt: Date.now(),\n target,\n x: event.clientX,\n y: event.clientY,\n };\n }\n\n function canDrag(target: HTMLElement, distance: number): boolean {\n if (!gesture || target.closest(\"[data-vaul-no-drag],select,option\")) {\n return false;\n }\n\n if (gesture.fromHandle) {\n return true;\n }\n\n if ((target.ownerDocument.getSelection()?.toString().length ?? 0) > 0) {\n return false;\n }\n\n if (Date.now() - openedAt < TRANSITIONS.DURATION * 1000) {\n return false;\n }\n\n if (\n Date.now() - lastScrollTime <\n (props.scrollLockTimeout ?? SCROLL_LOCK_TIMEOUT)\n ) {\n return false;\n }\n\n const lastOffset = Math.abs(offsets().at(-1) ?? 0);\n\n if (distance < 0 && gesture.startOffset > lastOffset) {\n return true;\n }\n\n const element = content();\n\n return (\n element !== null && !canScroll(target, element, direction(), distance)\n );\n }\n\n function claimGesture(\n event: PointerEvent,\n current: Gesture,\n axis: number,\n cross: number,\n distance: number\n ): boolean {\n if (current.allowed) {\n return true;\n }\n\n const threshold = event.pointerType === \"touch\" ? 10 : 2;\n\n if (Math.abs(axis) < threshold && Math.abs(cross) < threshold) {\n return false;\n }\n\n if (Math.abs(cross) > Math.abs(axis)) {\n gesture = null;\n\n return false;\n }\n\n if (!canDrag(current.target, distance)) {\n return false;\n }\n\n current.allowed = true;\n current.target.setPointerCapture?.(event.pointerId);\n setDragging(true);\n\n return true;\n }\n\n function drag(event: PointerEvent): void {\n const current = gesture;\n const element = content();\n\n if (!current || !element || current.pointerId !== event.pointerId) {\n return;\n }\n\n const dx = event.clientX - current.x;\n const dy = event.clientY - current.y;\n const vertical = isVertical(direction());\n const axis = vertical ? dy : dx;\n const cross = vertical ? dx : dy;\n const distance = axis * directionSign(direction());\n\n if (!claimGesture(event, current, axis, cross, distance)) {\n return;\n }\n\n event.preventDefault();\n const minimum = Math.abs(offsets().at(-1) ?? 0);\n let position = current.startOffset + distance;\n\n if (position < minimum) {\n position = minimum - dampenValue(minimum - position);\n }\n\n if (props.dismissible === false) {\n position = Math.min(position, Math.abs(offsets()[0] ?? 0));\n }\n\n current.distance = position - current.startOffset;\n element.classList.add(DRAG_CLASS);\n element.style.transition = \"none\";\n element.style.transform = translate(\n position * directionSign(direction()),\n direction()\n );\n\n const percentage = clamp(\n Math.max(0, distance) /\n Math.max(1, current.dimension - current.startOffset)\n );\n\n const backdrop = overlay();\n\n if (backdrop) {\n backdrop.style.transition = \"none\";\n backdrop.style.opacity = points().length\n ? `${getOverlayOpacity(offsets(), position, fadeFromIndex(), dimension())}`\n : `${1 - percentage}`;\n }\n\n setDragProgress(percentage);\n props.onDrag?.(event, percentage);\n parent?.setChildProgress(percentage);\n }\n\n function release(event: PointerEvent): void {\n const current = gesture;\n\n if (!current || event.pointerId !== current.pointerId) {\n return;\n }\n\n const velocity =\n Math.abs(current.distance) / Math.max(1, Date.now() - current.startedAt);\n\n let next: number | \"close\" = activeIndex();\n\n if (current.allowed && points().length) {\n next = selectSnapPoint({\n activeIndex: activeIndex(),\n dimension: dimension(),\n dismissible: props.dismissible !== false,\n distance: current.distance,\n offsets: offsets(),\n sequential: props.snapToSequentialPoint ?? false,\n velocity,\n });\n } else if (\n current.allowed &&\n current.distance > 0 &&\n props.dismissible !== false &&\n (velocity > VELOCITY_THRESHOLD ||\n current.distance >=\n current.dimension * (props.closeThreshold ?? CLOSE_THRESHOLD))\n ) {\n next = \"close\";\n }\n\n cancelDrag();\n\n if (!current.allowed) {\n return;\n }\n\n if (next === \"close\") {\n close();\n } else if (points().length) {\n setActiveSnapPoint(points()[next] ?? null);\n }\n\n props.onRelease?.(event, next !== \"close\");\n }\n\n return {\n get activeSnapPoint() {\n return activeSnap();\n },\n get activeSnapPointIndex() {\n return activeIndex();\n },\n cancelDrag,\n get childOpen() {\n return childOpen();\n },\n close,\n get content() {\n return content();\n },\n contentId: `vaul-${id}`,\n descriptionId: `vaul-${id}-description`,\n get direction() {\n return direction();\n },\n get dismissible() {\n return props.dismissible ?? true;\n },\n drag,\n get dragProgress() {\n return dragProgress();\n },\n get isDragging() {\n return dragging();\n },\n get isOpen() {\n return isOpen();\n },\n get modal() {\n return props.modal ?? true;\n },\n get overlay() {\n return overlay();\n },\n get present() {\n return present();\n },\n press,\n props,\n release,\n setActiveSnapPoint,\n setChildOpen(open) {\n setChildOpen(open);\n setChildProgress(0);\n },\n setChildProgress(progress) {\n setChildProgress(progress);\n },\n setContent(element) {\n setContent(element);\n },\n setOpen,\n setOverlay(element) {\n setOverlay(element);\n },\n setTrigger(element) {\n setTrigger(element);\n },\n get shouldAnimate() {\n return animate();\n },\n get shouldFade() {\n return !points().length || activeIndex() >= fadeFromIndex();\n },\n get snapPointsOffset() {\n return offsets();\n },\n titleId: `vaul-${id}-title`,\n get trigger() {\n return trigger();\n },\n };\n}\n","import { ariaHideOutside } from \"@solid2-aria/core/overlays/aria-hide-outside\";\nimport { createPreventScroll } from \"@solid2-aria/core/overlays/create-prevent-scroll\";\nimport { createEffect, untrack } from \"solid-js\";\n\nimport type { DrawerContextValue } from \"./context\";\nimport type {\n ContentProps,\n FocusOutsideEvent,\n PointerDownOutsideEvent,\n} from \"./types\";\n\nconst layers = new WeakMap<Document, HTMLDivElement[]>();\n\nexport function createLayer(\n context: DrawerContextValue,\n props: ContentProps\n): void {\n createPreventScroll({\n get isDisabled() {\n return (\n !context.isOpen ||\n !context.content ||\n !context.modal ||\n context.props.noBodyStyles === true ||\n (!context.overlay && context.props.disablePreventScroll !== true)\n );\n },\n });\n\n createEffect(\n () => ({\n element: context.content,\n modal: context.modal,\n open: context.isOpen,\n overlay: context.overlay,\n }),\n ({ element, overlay, open, modal }): undefined | (() => void) => {\n if (!element || !open || !modal) {\n return undefined;\n }\n\n return ariaHideOutside(overlay ? [element, overlay] : [element], {\n shouldUseInert: true,\n });\n },\n { ssrSource: \"client\" }\n );\n\n createEffect(\n () => ({ element: context.content, open: context.isOpen }),\n ({ element, open }): undefined | (() => void) => {\n if (!element || !open) {\n return undefined;\n }\n\n const doc = element.ownerDocument;\n const stack = layers.get(doc) ?? [];\n layers.set(doc, stack);\n stack.push(element);\n const previous = doc.activeElement;\n let interactedOutside = false;\n const autoFocus = new Event(\"openAutoFocus\", { cancelable: true });\n props.onOpenAutoFocus?.(autoFocus);\n\n if (!autoFocus.defaultPrevented && context.props.autoFocus === true) {\n const first = element.querySelector<HTMLElement>(\n \"[autofocus],button:not([disabled]),[href],input:not([disabled]),select:not([disabled]),textarea:not([disabled]),[tabindex='0']\"\n );\n\n (first ?? element).focus({ preventScroll: true });\n }\n\n const isTop = () => stack.at(-1) === element;\n\n const isOutside = (event: Event) =>\n !event.composedPath().includes(element);\n\n function pointerDown(event: PointerEvent): void {\n if (!isTop() || !isOutside(event)) {\n return;\n }\n\n const outside: PointerDownOutsideEvent = new CustomEvent(\n \"pointerDownOutside\",\n {\n cancelable: true,\n detail: { originalEvent: event },\n }\n );\n\n props.onPointerDownOutside?.(outside);\n props.onInteractOutside?.(outside);\n\n if (\n outside.defaultPrevented ||\n !context.modal ||\n event.button > 0 ||\n event.ctrlKey\n ) {\n return;\n }\n\n interactedOutside = !context.modal;\n context.close();\n }\n\n function focusIn(event: FocusEvent): void {\n if (!isTop() || !isOutside(event)) {\n return;\n }\n\n const outside: FocusOutsideEvent = new CustomEvent(\"focusOutside\", {\n cancelable: true,\n detail: { originalEvent: event },\n });\n\n props.onFocusOutside?.(outside);\n props.onInteractOutside?.(outside);\n\n if (!context.modal) {\n interactedOutside = true;\n }\n }\n\n function keyDown(event: KeyboardEvent): void {\n if (event.key !== \"Escape\" || !isTop() || event.defaultPrevented) {\n return;\n }\n\n props.onEscapeKeyDown?.(event);\n\n if (event.defaultPrevented) {\n return;\n }\n\n event.preventDefault();\n context.close();\n }\n\n doc.addEventListener(\"pointerdown\", pointerDown);\n doc.addEventListener(\"focusin\", focusIn);\n doc.addEventListener(\"keydown\", keyDown);\n\n const touchMove = (event: TouchEvent) => {\n if (element.classList.contains(\"vaul-dragging\") && event.cancelable) {\n event.preventDefault();\n }\n };\n\n element.addEventListener(\"touchmove\", touchMove, { passive: false });\n\n return () => {\n const index = stack.indexOf(element);\n const wasTop = isTop();\n\n if (index !== -1) {\n stack.splice(index, 1);\n }\n\n if (!stack.length) {\n layers.delete(doc);\n }\n\n doc.removeEventListener(\"pointerdown\", pointerDown);\n doc.removeEventListener(\"focusin\", focusIn);\n doc.removeEventListener(\"keydown\", keyDown);\n element.removeEventListener(\"touchmove\", touchMove);\n\n const closeAutoFocus = new Event(\"closeAutoFocus\", {\n cancelable: true,\n });\n\n props.onCloseAutoFocus?.(closeAutoFocus);\n\n if (closeAutoFocus.defaultPrevented || interactedOutside || !wasTop) {\n return;\n }\n\n const target = untrack(() => context.trigger) ?? previous;\n queueMicrotask(() => {\n if (target instanceof HTMLElement && target.isConnected) {\n target.focus({ preventScroll: true });\n }\n });\n };\n },\n { ssrSource: \"client\" }\n );\n}\n","/*\n * Derived from Vaul (https://github.com/emilkowalski/vaul): src/use-position-fixed.ts and src/index.tsx.\n * Copyright (c) 2023 Emil Kowalski\n * Modified for Solid Aria: Solid 2 lifecycle, per-drawer style ownership, viewport resizing, and route-aware restoration.\n * MIT licensed. See LICENSE, VAUL-LICENSE, and NOTICE.txt in the package root.\n */\n\nimport { createEffect } from \"solid-js\";\n\nimport { WINDOW_TOP_OFFSET } from \"./constants\";\nimport type { DrawerContextValue } from \"./context\";\nimport { assignStyle, isSafari } from \"./helpers\";\n\nexport function createPosition(context: DrawerContextValue): void {\n createEffect(\n () => ({\n element: context.content,\n modal: context.modal,\n nested: context.props.nested === true,\n noBodyStyles: context.props.noBodyStyles === true,\n open: context.isOpen,\n preventScrollRestoration: context.props.preventScrollRestoration === true,\n }),\n ({\n element,\n open,\n modal,\n noBodyStyles,\n nested,\n preventScrollRestoration,\n }): undefined | (() => void) => {\n if (!element || !open || !modal || noBodyStyles || nested) {\n return undefined;\n }\n\n const doc = element.ownerDocument;\n const view = doc.defaultView;\n\n if (\n !view ||\n !isSafari(view) ||\n view.matchMedia(\"(display-mode: standalone)\").matches\n ) {\n return undefined;\n }\n\n const { scrollX, scrollY } = view;\n const url = view.location.href;\n\n const restore = assignStyle(doc.body, {\n height: \"auto\",\n left: `${-scrollX}px`,\n position: \"fixed\",\n right: \"0\",\n top: `${-scrollY}px`,\n });\n\n return () => {\n restore();\n\n if (!preventScrollRestoration || url === view.location.href) {\n view.scrollTo(scrollX, scrollY);\n }\n };\n },\n { ssrSource: \"client\" }\n );\n\n createEffect(\n () => ({\n direction: context.direction,\n element: context.content,\n fixed: context.props.fixed === true,\n open: context.isOpen,\n reposition: context.props.repositionInputs !== false,\n }),\n ({\n element,\n open,\n reposition,\n fixed,\n direction,\n }): undefined | (() => void) => {\n if (!element || !open || !reposition || direction !== \"bottom\") {\n return undefined;\n }\n\n const doc = element.ownerDocument;\n const view = doc.defaultView;\n const viewport = view?.visualViewport;\n\n if (!view || !viewport) {\n return undefined;\n }\n\n const { height } = element.style;\n const { bottom } = element.style;\n let keyboardOpen = false;\n const initialHeight = element.getBoundingClientRect().height;\n\n const resize = (): void => {\n const focused = doc.activeElement;\n\n if (\n !keyboardOpen &&\n (!(focused instanceof HTMLElement) ||\n !element.contains(focused) ||\n !focused.matches(\"input,textarea,[contenteditable]\"))\n ) {\n return;\n }\n\n const diff = Math.max(\n 0,\n view.innerHeight - viewport.height - viewport.offsetTop\n );\n\n keyboardOpen = diff > 60;\n\n if (!keyboardOpen) {\n element.style.height = height;\n element.style.bottom = bottom;\n\n return;\n }\n\n const rect = element.getBoundingClientRect();\n\n const available = Math.max(\n 0,\n viewport.height - Math.max(WINDOW_TOP_OFFSET, rect.top)\n );\n\n element.style.height = `${fixed ? Math.max(0, initialHeight - diff) : available}px`;\n element.style.bottom = `${diff}px`;\n\n if (focused instanceof HTMLElement) {\n focused.scrollIntoView({ block: \"nearest\" });\n }\n };\n\n viewport.addEventListener(\"resize\", resize);\n viewport.addEventListener(\"scroll\", resize);\n\n return () => {\n viewport.removeEventListener(\"resize\", resize);\n viewport.removeEventListener(\"scroll\", resize);\n element.style.height = height;\n element.style.bottom = bottom;\n };\n },\n { ssrSource: \"client\" }\n );\n}\n","/*\n * Derived from Vaul (https://github.com/emilkowalski/vaul): src/index.tsx.\n * Copyright (c) 2023 Emil Kowalski\n * Modified for Solid Aria: Solid 2 components, contexts, callback refs, portals, presence, and native DOM event composition.\n * MIT licensed. See LICENSE, VAUL-LICENSE, and NOTICE.txt in the package root.\n */\n\nimport { FocusScope } from \"@solid2-aria/core/focus/focus-scope\";\nimport { Portal as SolidPortal } from \"@solidjs/web\";\nimport type { JSX } from \"@solidjs/web\";\nimport {\n createSignal,\n merge,\n omit,\n onSettled,\n Show,\n useContext,\n} from \"solid-js\";\n\nimport { DrawerContext, PortalContext } from \"./context\";\nimport { createBackground } from \"./create-background\";\nimport { createDrawer } from \"./create-drawer\";\nimport { createLayer } from \"./create-layer\";\nimport { createPosition } from \"./create-position\";\nimport type {\n CloseProps,\n ContentProps,\n DescriptionProps,\n DialogProps,\n HandleProps,\n OverlayProps,\n PortalProps,\n TitleProps,\n TriggerProps,\n} from \"./types\";\n\nexport function Root(props: DialogProps): JSX.Element {\n const context = createDrawer(props);\n createBackground(context);\n createPosition(context);\n\n return <DrawerContext value={context}>{props.children}</DrawerContext>;\n}\n\nexport function NestedRoot(props: DialogProps): JSX.Element {\n const parent = useContext(DrawerContext);\n const context = createDrawer(merge(props, { nested: true }), parent);\n createPosition(context);\n\n return <DrawerContext value={context}>{props.children}</DrawerContext>;\n}\n\nexport function Portal(props: PortalProps): JSX.Element {\n const context = useContext(DrawerContext);\n const [mounted, setMounted] = createSignal(false);\n onSettled(() => {\n setMounted(true);\n });\n\n return (\n <Show when={mounted() && (context.present || props.forceMount === true)}>\n <SolidPortal\n mount={props.container ?? context.props.container ?? document.body}\n >\n <PortalContext value={props.forceMount ?? false}>\n {props.children}\n </PortalContext>\n </SolidPortal>\n </Show>\n );\n}\n\nexport function Trigger(props: TriggerProps): JSX.Element {\n const context = useContext(DrawerContext);\n\n const attributes = merge(omit(props, \"render\", \"ref\", \"onClick\"), {\n \"aria-controls\": context.contentId,\n get \"aria-expanded\"(): \"true\" | \"false\" {\n return context.isOpen ? \"true\" : \"false\";\n },\n \"aria-haspopup\": \"dialog\" as const,\n get \"data-state\"() {\n return context.isOpen ? \"open\" : \"closed\";\n },\n onClick(\n event: Parameters<JSX.EventHandler<HTMLButtonElement, MouseEvent>>[0]\n ) {\n callHandler(props.onClick, event);\n\n if (!event.defaultPrevented) {\n context.setOpen(!context.isOpen);\n }\n },\n get ref() {\n return [\n props.ref,\n (element: HTMLButtonElement) => {\n context.setTrigger(element);\n },\n ];\n },\n get type() {\n return props.type ?? \"button\";\n },\n });\n\n return (\n <Show when={props.render} keyed fallback={<button {...attributes} />}>\n {(render) => render(attributes)}\n </Show>\n );\n}\n\nexport function Close(props: CloseProps): JSX.Element {\n const context = useContext(DrawerContext);\n\n const attributes = merge(omit(props, \"render\", \"onClick\"), {\n onClick(\n event: Parameters<JSX.EventHandler<HTMLButtonElement, MouseEvent>>[0]\n ) {\n callHandler(props.onClick, event);\n\n if (!event.defaultPrevented) {\n context.close();\n }\n },\n get type() {\n return props.type ?? \"button\";\n },\n });\n\n return (\n <Show when={props.render} keyed fallback={<button {...attributes} />}>\n {(render) => render(attributes)}\n </Show>\n );\n}\n\nexport function Overlay(props: OverlayProps): JSX.Element {\n const context = useContext(DrawerContext);\n const forceMount = useContext(PortalContext);\n\n return (\n <Show\n when={\n context.modal &&\n (context.present || props.forceMount === true || forceMount)\n }\n >\n <OverlayElement {...props} />\n </Show>\n );\n}\n\nfunction OverlayElement(props: OverlayProps): JSX.Element {\n const context = useContext(DrawerContext);\n const rest = omit(props, \"forceMount\", \"ref\");\n onSettled(() => () => {\n context.setOverlay(null);\n });\n\n return (\n <div\n {...rest}\n ref={[\n props.ref,\n (element) => {\n context.setOverlay(element);\n },\n ]}\n data-vaul-overlay=\"\"\n data-state={context.isOpen ? \"open\" : \"closed\"}\n data-vaul-snap-points={\n (context.props.snapPoints?.length ?? 0) > 0 ? \"true\" : \"false\"\n }\n data-vaul-snap-points-overlay={context.shouldFade ? \"true\" : \"false\"}\n data-vaul-animate={context.shouldAnimate ? \"true\" : \"false\"}\n />\n );\n}\n\nexport function Content(props: ContentProps): JSX.Element {\n const context = useContext(DrawerContext);\n const forceMount = useContext(PortalContext);\n\n return (\n <Show when={context.present || props.forceMount === true || forceMount}>\n <ContentElement {...props} />\n </Show>\n );\n}\n\nfunction ContentElement(props: ContentProps): JSX.Element {\n const context = useContext(DrawerContext);\n\n const rest = omit(\n props,\n \"forceMount\",\n \"ref\",\n \"onOpenAutoFocus\",\n \"onCloseAutoFocus\",\n \"onEscapeKeyDown\",\n \"onPointerDownOutside\",\n \"onFocusOutside\",\n \"onInteractOutside\",\n \"onPointerDown\",\n \"onPointerMove\",\n \"onPointerUp\",\n \"onPointerCancel\",\n \"onLostPointerCapture\"\n );\n\n createLayer(context, props);\n onSettled(() => () => {\n context.setContent(null);\n });\n\n return (\n <FocusScope contain={context.isOpen && context.modal && !context.childOpen}>\n <div\n id={context.contentId}\n role=\"dialog\"\n aria-modal={context.modal ? \"true\" : undefined}\n aria-labelledby={context.titleId}\n aria-describedby={context.descriptionId}\n tabindex={-1}\n {...rest}\n ref={[\n props.ref,\n (element) => {\n context.setContent(element);\n },\n ]}\n data-state={context.isOpen ? \"open\" : \"closed\"}\n data-vaul-drawer=\"\"\n data-vaul-drawer-direction={context.direction}\n data-vaul-custom-container={context.props.container ? \"true\" : \"false\"}\n data-vaul-snap-points={\n (context.props.snapPoints?.length ?? 0) > 0 ? \"true\" : \"false\"\n }\n data-vaul-delayed-snap-points={\n context.snapPointsOffset.length > 0 ? \"true\" : \"false\"\n }\n data-vaul-handle-only={\n context.props.handleOnly === true ? \"true\" : \"false\"\n }\n data-vaul-animate={context.shouldAnimate ? \"true\" : \"false\"}\n onPointerDown={(event) => {\n callHandler(props.onPointerDown, event);\n context.press(event);\n }}\n onPointerMove={(event) => {\n callHandler(props.onPointerMove, event);\n\n if (!event.defaultPrevented) {\n context.drag(event);\n }\n }}\n onPointerUp={(event) => {\n callHandler(props.onPointerUp, event);\n context.release(event);\n }}\n onPointerCancel={(event) => {\n callHandler(props.onPointerCancel, event);\n context.cancelDrag();\n }}\n onLostPointerCapture={(event) => {\n callHandler(props.onLostPointerCapture, event);\n context.cancelDrag();\n }}\n />\n </FocusScope>\n );\n}\n\nexport function Title(props: TitleProps): JSX.Element {\n const context = useContext(DrawerContext);\n\n return <h2 id={context.titleId} {...props} />;\n}\n\nexport function Description(props: DescriptionProps): JSX.Element {\n const context = useContext(DrawerContext);\n\n return <p id={context.descriptionId} {...props} />;\n}\n\nexport function Handle(props: HandleProps): JSX.Element {\n const context = useContext(DrawerContext);\n\n const rest = omit(\n props,\n \"preventCycle\",\n \"children\",\n \"onClick\",\n \"onPointerDown\",\n \"onPointerMove\",\n \"onPointerCancel\"\n );\n\n let pressTime = 0;\n let pressPosition = { x: 0, y: 0 };\n let moved = false;\n let lastClick = -Infinity;\n\n function cycle(): void {\n if (\n props.preventCycle === true ||\n moved ||\n Date.now() - pressTime > 250 ||\n Date.now() - lastClick < 120\n ) {\n return;\n }\n\n lastClick = Date.now();\n const points = context.props.snapPoints;\n\n if (!points || points.length === 0) {\n context.close();\n\n return;\n }\n\n const next = points[context.activeSnapPointIndex + 1];\n\n if (next !== undefined) {\n context.setActiveSnapPoint(next);\n } else if (context.dismissible) {\n context.close();\n } else {\n context.setActiveSnapPoint(points[0] ?? null);\n }\n }\n\n return (\n <div\n {...rest}\n data-vaul-handle=\"\"\n aria-hidden=\"true\"\n data-vaul-drawer-visible={context.isOpen ? \"true\" : \"false\"}\n onClick={(event) => {\n callHandler(props.onClick, event);\n\n if (!event.defaultPrevented) {\n cycle();\n }\n }}\n onPointerDown={(event) => {\n callHandler(props.onPointerDown, event);\n\n if (event.defaultPrevented) {\n return;\n }\n\n pressTime = Date.now();\n pressPosition = { x: event.clientX, y: event.clientY };\n moved = false;\n context.press(event, true);\n event.stopPropagation();\n }}\n onPointerMove={(event) => {\n callHandler(props.onPointerMove, event);\n\n if (\n Math.abs(event.clientX - pressPosition.x) > 2 ||\n Math.abs(event.clientY - pressPosition.y) > 2\n ) {\n moved = true;\n }\n }}\n onPointerCancel={(event) => {\n callHandler(props.onPointerCancel, event);\n moved = true;\n context.cancelDrag();\n }}\n >\n <span data-vaul-handle-hitarea=\"\" aria-hidden=\"true\">\n {props.children}\n </span>\n </div>\n );\n}\n\nfunction callHandler<T, E extends Event>(\n handler: JSX.EventHandlerUnion<T, E> | undefined,\n event: Parameters<JSX.EventHandler<T, E>>[0]\n): void {\n if (typeof handler === \"function\") {\n handler(event);\n } else if (handler) {\n handler[0](handler[1], event);\n }\n}\n","import {\n Close,\n Content,\n Description,\n Handle,\n NestedRoot,\n Overlay,\n Portal,\n Root,\n Title,\n Trigger,\n} from \"./drawer\";\n\nexport {\n Close,\n Content,\n Description,\n Handle,\n NestedRoot,\n Overlay,\n Portal,\n Root,\n Title,\n Trigger,\n} from \"./drawer\";\n\nexport type {\n CloseProps,\n ContentProps,\n DescriptionProps,\n DialogProps,\n DrawerDirection,\n DrawerProps,\n FocusOutsideEvent,\n HandleProps,\n InteractOutsideEvent,\n OverlayProps,\n PointerDownOutsideEvent,\n PortalProps,\n SnapPoint,\n TitleProps,\n TriggerProps,\n WithFadeFromProps,\n WithoutFadeFromProps,\n} from \"./types\";\n\nexport const Drawer = {\n Close,\n Content,\n Description,\n Handle,\n NestedRoot,\n Overlay,\n Portal,\n Root,\n Title,\n Trigger,\n};\n"],"mappings":";;;;;;;;;;;;AA8CA,MAAa,gBAAgB,cAAkC;AAC/D,MAAa,gBAAgB,cAAc,KAAK;;ACxChD,MAAa,cAAc;CACzB,UAAU;CACV,MAAM;EAAC;EAAM;EAAM;EAAG;CAAC;AACzB;AAcA,MAAa,aAAa;;ACf1B,SAAgB,WAAW,WAAqC;CAC9D,OAAO,cAAc,SAAS,cAAc;AAC9C;AAEA,SAAgB,cAAc,WAAoC;CAChE,OAAO,cAAc,YAAY,cAAc,UAAU,IAAI;AAC/D;AAEA,SAAgB,UACd,UACA,WACQ;CACR,OAAO,WAAW,SAAS,IACvB,kBAAkB,SAAS,UAC3B,eAAe,SAAS;AAC9B;AAEA,SAAgB,YAAY,OAAuB;CACjD,OAAO,KAAK,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I,SACT,QAAQ,EAAE,CAAC,QAAQ,IAAI,KAAK;AAEhC;;AC3VA,MAAa,SAAS;CACpB;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACF"}
@@ -642,7 +642,6 @@ var _sk$2 = (k) => k === "data-state" || k === "data-vaul-drawer" || k === "data
642
642
  var _sk$3 = (k) => k === "data-vaul-handle" || k === "aria-hidden" || k === "data-vaul-drawer-visible";
643
643
  var _m$ = Symbol();
644
644
  var _m$2 = Symbol();
645
- var _m$3 = Symbol();
646
645
  var _d$ = {
647
646
  get() {
648
647
  return this[_m$].children;
@@ -715,31 +714,26 @@ function _P$4(_p6, _p7) {
715
714
  _P$4.prototype = Object.prototype;
716
715
  var _d$7 = {
717
716
  get() {
718
- const mounted = this[_m$];
719
- const context = this[_m$2];
720
- const props = this[_m$3];
721
- return memo(() => {
722
- return !!mounted();
723
- })() ? context.present || props.forceMount === true : mounted();
717
+ return this[_m$].render;
724
718
  },
725
719
  enumerable: true,
726
720
  configurable: true
727
721
  };
728
722
  var _d$8 = {
729
723
  get() {
730
- const props = this[_m$3];
731
- const context = this[_m$2];
732
- return Portal$1(new _P$4(props, context));
724
+ const attributes = this[_m$2];
725
+ return ssrElement("button", attributes, void 0, true);
733
726
  },
734
727
  enumerable: true,
735
728
  configurable: true
736
729
  };
737
- function _P$5(_p8, _p9, _p0) {
730
+ function _P$5(_p8, _p9, _p0, _p1) {
738
731
  this[_m$] = _p8;
739
732
  this[_m$2] = _p9;
740
- this[_m$3] = _p0;
741
733
  Object.defineProperty(this, "when", _d$7);
742
- Object.defineProperty(this, "children", _d$8);
734
+ this.keyed = _p0;
735
+ Object.defineProperty(this, "fallback", _d$8);
736
+ this.children = _p1;
743
737
  }
744
738
  _P$5.prototype = Object.prototype;
745
739
  var _d$9 = {
@@ -757,132 +751,54 @@ var _d$10 = {
757
751
  enumerable: true,
758
752
  configurable: true
759
753
  };
760
- function _P$6(_p1, _p10, _p11, _p12) {
761
- this[_m$] = _p1;
762
- this[_m$2] = _p10;
754
+ function _P$6(_p10, _p11, _p12, _p13) {
755
+ this[_m$] = _p10;
756
+ this[_m$2] = _p11;
763
757
  Object.defineProperty(this, "when", _d$9);
764
- this.keyed = _p11;
758
+ this.keyed = _p12;
765
759
  Object.defineProperty(this, "fallback", _d$10);
766
- this.children = _p12;
760
+ this.children = _p13;
767
761
  }
768
762
  _P$6.prototype = Object.prototype;
769
763
  var _d$11 = {
770
- get() {
771
- return this[_m$].render;
772
- },
773
- enumerable: true,
774
- configurable: true
775
- };
776
- var _d$12 = {
777
- get() {
778
- const attributes = this[_m$2];
779
- return ssrElement("button", attributes, void 0, true);
780
- },
781
- enumerable: true,
782
- configurable: true
783
- };
784
- function _P$7(_p13, _p14, _p15, _p16) {
785
- this[_m$] = _p13;
786
- this[_m$2] = _p14;
787
- Object.defineProperty(this, "when", _d$11);
788
- this.keyed = _p15;
789
- Object.defineProperty(this, "fallback", _d$12);
790
- this.children = _p16;
791
- }
792
- _P$7.prototype = Object.prototype;
793
- var _d$13 = {
794
- get() {
795
- const context = this[_m$];
796
- const props = this[_m$2];
797
- const forceMount = this[_m$3];
798
- return memo(() => {
799
- return !!context.modal;
800
- })() ? context.present || props.forceMount === true || forceMount : context.modal;
801
- },
802
- enumerable: true,
803
- configurable: true
804
- };
805
- var _d$14 = {
806
- get() {
807
- const props = this[_m$2];
808
- return OverlayElement(props);
809
- },
810
- enumerable: true,
811
- configurable: true
812
- };
813
- function _P$8(_p17, _p18, _p19) {
814
- this[_m$] = _p17;
815
- this[_m$2] = _p18;
816
- this[_m$3] = _p19;
817
- Object.defineProperty(this, "when", _d$13);
818
- Object.defineProperty(this, "children", _d$14);
819
- }
820
- _P$8.prototype = Object.prototype;
821
- var _d$15 = {
822
- get() {
823
- const context = this[_m$];
824
- const props = this[_m$2];
825
- const forceMount = this[_m$3];
826
- return context.present || props.forceMount === true || forceMount;
827
- },
828
- enumerable: true,
829
- configurable: true
830
- };
831
- var _d$16 = {
832
- get() {
833
- const props = this[_m$2];
834
- return ContentElement(props);
835
- },
836
- enumerable: true,
837
- configurable: true
838
- };
839
- function _P$9(_p20, _p21, _p22) {
840
- this[_m$] = _p20;
841
- this[_m$2] = _p21;
842
- this[_m$3] = _p22;
843
- Object.defineProperty(this, "when", _d$15);
844
- Object.defineProperty(this, "children", _d$16);
845
- }
846
- _P$9.prototype = Object.prototype;
847
- var _d$17 = {
848
764
  get() {
849
765
  return this[_m$].contentId;
850
766
  },
851
767
  enumerable: true,
852
768
  configurable: true
853
769
  };
854
- var _d$18 = {
770
+ var _d$12 = {
855
771
  get() {
856
772
  return this[_m$].modal ? "true" : void 0;
857
773
  },
858
774
  enumerable: true,
859
775
  configurable: true
860
776
  };
861
- var _d$19 = {
777
+ var _d$13 = {
862
778
  get() {
863
779
  return this[_m$].titleId;
864
780
  },
865
781
  enumerable: true,
866
782
  configurable: true
867
783
  };
868
- var _d$20 = {
784
+ var _d$14 = {
869
785
  get() {
870
786
  return this[_m$].descriptionId;
871
787
  },
872
788
  enumerable: true,
873
789
  configurable: true
874
790
  };
875
- function _P$10(_p23, _p24, _p25) {
876
- this[_m$] = _p23;
877
- Object.defineProperty(this, "id", _d$17);
878
- this.role = _p24;
879
- Object.defineProperty(this, "aria-modal", _d$18);
880
- Object.defineProperty(this, "aria-labelledby", _d$19);
881
- Object.defineProperty(this, "aria-describedby", _d$20);
882
- this.tabindex = _p25;
791
+ function _P$7(_p14, _p15, _p16) {
792
+ this[_m$] = _p14;
793
+ Object.defineProperty(this, "id", _d$11);
794
+ this.role = _p15;
795
+ Object.defineProperty(this, "aria-modal", _d$12);
796
+ Object.defineProperty(this, "aria-labelledby", _d$13);
797
+ Object.defineProperty(this, "aria-describedby", _d$14);
798
+ this.tabindex = _p16;
883
799
  }
884
- _P$10.prototype = Object.prototype;
885
- var _d$21 = {
800
+ _P$7.prototype = Object.prototype;
801
+ var _d$15 = {
886
802
  get() {
887
803
  const context = this[_m$];
888
804
  return memo(() => {
@@ -892,46 +808,46 @@ var _d$21 = {
892
808
  enumerable: true,
893
809
  configurable: true
894
810
  };
895
- var _d$22 = {
811
+ var _d$16 = {
896
812
  get() {
897
813
  const context = this[_m$];
898
814
  const rest = this[_m$2];
899
- return ssrElement("div", [new _P$10(context, "dialog", -1), rest], void 0, true, _sk$2, () => ssrElementAttribute("data-state", context.isOpen ? "open" : "closed") + " data-vaul-drawer" + ssrElementAttribute("data-vaul-drawer-direction", context.direction) + ssrElementAttribute("data-vaul-custom-container", context.props.container ? "true" : "false") + ssrElementAttribute("data-vaul-snap-points", (context.props.snapPoints?.length ?? 0) > 0 ? "true" : "false") + ssrElementAttribute("data-vaul-delayed-snap-points", context.snapPointsOffset.length > 0 ? "true" : "false") + ssrElementAttribute("data-vaul-handle-only", context.props.handleOnly === true ? "true" : "false") + ssrElementAttribute("data-vaul-animate", context.shouldAnimate ? "true" : "false"));
815
+ return ssrElement("div", [new _P$7(context, "dialog", -1), rest], void 0, true, _sk$2, () => ssrElementAttribute("data-state", context.isOpen ? "open" : "closed") + " data-vaul-drawer" + ssrElementAttribute("data-vaul-drawer-direction", context.direction) + ssrElementAttribute("data-vaul-custom-container", context.props.container ? "true" : "false") + ssrElementAttribute("data-vaul-snap-points", (context.props.snapPoints?.length ?? 0) > 0 ? "true" : "false") + ssrElementAttribute("data-vaul-delayed-snap-points", context.snapPointsOffset.length > 0 ? "true" : "false") + ssrElementAttribute("data-vaul-handle-only", context.props.handleOnly === true ? "true" : "false") + ssrElementAttribute("data-vaul-animate", context.shouldAnimate ? "true" : "false"));
900
816
  },
901
817
  enumerable: true,
902
818
  configurable: true
903
819
  };
904
- function _P$11(_p26, _p27) {
905
- this[_m$] = _p26;
906
- this[_m$2] = _p27;
907
- Object.defineProperty(this, "contain", _d$21);
908
- Object.defineProperty(this, "children", _d$22);
820
+ function _P$8(_p17, _p18) {
821
+ this[_m$] = _p17;
822
+ this[_m$2] = _p18;
823
+ Object.defineProperty(this, "contain", _d$15);
824
+ Object.defineProperty(this, "children", _d$16);
909
825
  }
910
- _P$11.prototype = Object.prototype;
911
- var _d$23 = {
826
+ _P$8.prototype = Object.prototype;
827
+ var _d$17 = {
912
828
  get() {
913
829
  return this[_m$].titleId;
914
830
  },
915
831
  enumerable: true,
916
832
  configurable: true
917
833
  };
918
- function _P$12(_p28) {
919
- this[_m$] = _p28;
920
- Object.defineProperty(this, "id", _d$23);
834
+ function _P$9(_p19) {
835
+ this[_m$] = _p19;
836
+ Object.defineProperty(this, "id", _d$17);
921
837
  }
922
- _P$12.prototype = Object.prototype;
923
- var _d$24 = {
838
+ _P$9.prototype = Object.prototype;
839
+ var _d$18 = {
924
840
  get() {
925
841
  return this[_m$].descriptionId;
926
842
  },
927
843
  enumerable: true,
928
844
  configurable: true
929
845
  };
930
- function _P$13(_p29) {
931
- this[_m$] = _p29;
932
- Object.defineProperty(this, "id", _d$24);
846
+ function _P$10(_p20) {
847
+ this[_m$] = _p20;
848
+ Object.defineProperty(this, "id", _d$18);
933
849
  }
934
- _P$13.prototype = Object.prototype;
850
+ _P$10.prototype = Object.prototype;
935
851
  function Root(props) {
936
852
  const context = createDrawer(props);
937
853
  createBackground(context);
@@ -950,7 +866,11 @@ function Portal(props) {
950
866
  onSettled(() => {
951
867
  setMounted(true);
952
868
  });
953
- return Show(new _P$5(mounted, context, props));
869
+ return memo(() => {
870
+ return memo(() => {
871
+ return !!(mounted() && (context.present || props.forceMount === true));
872
+ })() ? Portal$1(new _P$4(props, context)) : void 0;
873
+ });
954
874
  }
955
875
  function Trigger(props) {
956
876
  const context = useContext(DrawerContext);
@@ -976,7 +896,7 @@ function Trigger(props) {
976
896
  return props.type ?? "button";
977
897
  }
978
898
  });
979
- return Show(new _P$6(props, attributes, true, (render) => render(attributes)));
899
+ return Show(new _P$5(props, attributes, true, (render) => render(attributes)));
980
900
  }
981
901
  function Close(props) {
982
902
  const context = useContext(DrawerContext);
@@ -989,12 +909,16 @@ function Close(props) {
989
909
  return props.type ?? "button";
990
910
  }
991
911
  });
992
- return Show(new _P$7(props, attributes, true, (render) => render(attributes)));
912
+ return Show(new _P$6(props, attributes, true, (render) => render(attributes)));
993
913
  }
994
914
  function Overlay(props) {
995
915
  const context = useContext(DrawerContext);
996
916
  const forceMount = useContext(PortalContext);
997
- return Show(new _P$8(context, props, forceMount));
917
+ return memo(() => {
918
+ return memo(() => {
919
+ return !!(context.modal && (context.present || props.forceMount === true || forceMount));
920
+ })() ? OverlayElement(props) : void 0;
921
+ });
998
922
  }
999
923
  function OverlayElement(props) {
1000
924
  const context = useContext(DrawerContext);
@@ -1007,7 +931,11 @@ function OverlayElement(props) {
1007
931
  function Content(props) {
1008
932
  const context = useContext(DrawerContext);
1009
933
  const forceMount = useContext(PortalContext);
1010
- return Show(new _P$9(context, props, forceMount));
934
+ return memo(() => {
935
+ return memo(() => {
936
+ return !!(context.present || props.forceMount === true || forceMount);
937
+ })() ? ContentElement(props) : void 0;
938
+ });
1011
939
  }
1012
940
  function ContentElement(props) {
1013
941
  const context = useContext(DrawerContext);
@@ -1016,15 +944,15 @@ function ContentElement(props) {
1016
944
  onSettled(() => () => {
1017
945
  context.setContent(null);
1018
946
  });
1019
- return FocusScope(new _P$11(context, rest));
947
+ return FocusScope(new _P$8(context, rest));
1020
948
  }
1021
949
  function Title(props) {
1022
950
  const context = useContext(DrawerContext);
1023
- return ssrElement("h2", [new _P$12(context), props], void 0, true);
951
+ return ssrElement("h2", [new _P$9(context), props], void 0, true);
1024
952
  }
1025
953
  function Description(props) {
1026
954
  const context = useContext(DrawerContext);
1027
- return ssrElement("p", [new _P$13(context), props], void 0, true);
955
+ return ssrElement("p", [new _P$10(context), props], void 0, true);
1028
956
  }
1029
957
  function Handle(props) {
1030
958
  var _v$;
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["mounted() && (context.present || props.forceMount === true)","<button {...attributes} />","context.modal &&\n (context.present || props.forceMount === true || forceMount)","context.isOpen && context.modal && !context.childOpen","data-state={context.isOpen ? \"open\" : \"closed\"}","data-vaul-drawer-direction={context.direction}","data-vaul-custom-container={context.props.container ? \"true\" : \"false\"}","data-vaul-snap-points={\n (context.props.snapPoints?.length ?? 0) > 0 ? \"true\" : \"false\"\n }","data-vaul-delayed-snap-points={\n context.snapPointsOffset.length > 0 ? \"true\" : \"false\"\n }","data-vaul-handle-only={\n context.props.handleOnly === true ? \"true\" : \"false\"\n }","data-vaul-animate={context.shouldAnimate ? \"true\" : \"false\"}","<div\n {...rest}\n ref={[\n props.ref,\n (element) => {\n context.setOverlay(element);\n },\n ]}\n data-vaul-overlay=\"\"\n data-state={context.isOpen ? \"open\" : \"closed\"}\n data-vaul-snap-points={\n (context.props.snapPoints?.length ?? 0) > 0 ? \"true\" : \"false\"\n }\n data-vaul-snap-points-overlay={context.shouldFade ? \"true\" : \"false\"}\n data-vaul-animate={context.shouldAnimate ? \"true\" : \"false\"}\n />","data-vaul-snap-points={\n (context.props.snapPoints?.length ?? 0) > 0 ? \"true\" : \"false\"\n }","data-vaul-snap-points-overlay={context.shouldFade ? \"true\" : \"false\"}","<h2 id={context.titleId} {...props} />","<p id={context.descriptionId} {...props} />","<div\n {...rest}\n data-vaul-handle=\"\"\n aria-hidden=\"true\"\n data-vaul-drawer-visible={context.isOpen ? \"true\" : \"false\"}\n onClick={(event) => {\n callHandler(props.onClick, event);\n\n if (!event.defaultPrevented) {\n cycle();\n }\n }}\n onPointerDown={(event) => {\n callHandler(props.onPointerDown, event);\n\n if (event.defaultPrevented) {\n return;\n }\n\n pressTime = Date.now();\n pressPosition = { x: event.clientX, y: event.clientY };\n moved = false;\n context.press(event, true);\n event.stopPropagation();\n }}\n onPointerMove={(event) => {\n callHandler(props.onPointerMove, event);\n\n if (\n Math.abs(event.clientX - pressPosition.x) > 2 ||\n Math.abs(event.clientY - pressPosition.y) > 2\n ) {\n moved = true;\n }\n }}\n onPointerCancel={(event) => {\n callHandler(props.onPointerCancel, event);\n moved = true;\n context.cancelDrag();\n }}\n >\n <span data-vaul-handle-hitarea=\"\" aria-hidden=\"true\">\n {props.children}\n </span>\n </div>","{props.children}","props.children","<span data-vaul-handle-hitarea=\"\" aria-hidden=\"true\">\n {props.children}\n </span>","data-vaul-drawer-visible={context.isOpen ? \"true\" : \"false\"}","_$memo","SolidPortal","_$ssrElement","_$ssrElementAttribute","_$scope","_$escape","_$ssr"],"sources":["../../src/context.ts","../../src/constants.ts","../../src/helpers.ts","../../src/create-background.ts","../../src/create-snap-points.ts","../../src/create-drawer.ts","../../src/create-layer.ts","../../src/create-position.ts","../../src/drawer.tsx","../../src/index.ts"],"sourcesContent":["/*\n * Derived from Vaul (https://github.com/emilkowalski/vaul): src/context.ts.\n * Copyright (c) 2023 Emil Kowalski\n * Modified for Solid Aria: native Solid 2 contexts, reactive getters, and callback refs.\n * MIT licensed. See LICENSE, VAUL-LICENSE, and NOTICE.txt in the package root.\n */\n\nimport { createContext } from \"solid-js\";\n\nimport type { DialogProps, DrawerDirection, SnapPoint } from \"./types\";\n\nexport interface DrawerContextValue {\n readonly props: DialogProps;\n readonly isOpen: boolean;\n readonly present: boolean;\n readonly shouldAnimate: boolean;\n readonly direction: DrawerDirection;\n readonly modal: boolean;\n readonly dismissible: boolean;\n readonly contentId: string;\n readonly titleId: string;\n readonly descriptionId: string;\n readonly content: HTMLDivElement | null;\n readonly overlay: HTMLDivElement | null;\n readonly trigger: HTMLButtonElement | null;\n readonly activeSnapPoint: SnapPoint | null;\n readonly activeSnapPointIndex: number;\n readonly snapPointsOffset: readonly number[];\n readonly shouldFade: boolean;\n readonly isDragging: boolean;\n readonly dragProgress: number;\n readonly childOpen: boolean;\n setContent: (element: HTMLDivElement | null) => void;\n setOverlay: (element: HTMLDivElement | null) => void;\n setTrigger: (element: HTMLButtonElement | null) => void;\n setActiveSnapPoint: (point: SnapPoint | null) => void;\n setOpen: (open: boolean) => void;\n close: () => void;\n press: (event: PointerEvent, fromHandle?: boolean) => void;\n drag: (event: PointerEvent) => void;\n release: (event: PointerEvent) => void;\n cancelDrag: () => void;\n setChildOpen: (open: boolean) => void;\n setChildProgress: (progress: number) => void;\n}\n\nexport const DrawerContext = createContext<DrawerContextValue>();\nexport const PortalContext = createContext(false);\n","/*\n * Derived from Vaul (https://github.com/emilkowalski/vaul): src/constants.ts.\n * Copyright (c) 2023 Emil Kowalski\n * Modified for Solid Aria: preserved drawer animation and gesture constants.\n * MIT licensed. See LICENSE, VAUL-LICENSE, and NOTICE.txt in the package root.\n */\n\nexport const TRANSITIONS = {\n DURATION: 0.5,\n EASE: [0.32, 0.72, 0, 1],\n};\n\nexport const VELOCITY_THRESHOLD = 0.4;\n\nexport const CLOSE_THRESHOLD = 0.25;\n\nexport const SCROLL_LOCK_TIMEOUT = 100;\n\nexport const BORDER_RADIUS = 8;\n\nexport const NESTED_DISPLACEMENT = 16;\n\nexport const WINDOW_TOP_OFFSET = 26;\n\nexport const DRAG_CLASS = \"vaul-dragging\";\n","/*\n * Derived from Vaul (https://github.com/emilkowalski/vaul): src/helpers.ts and src/browser.ts.\n * Copyright (c) 2023 Emil Kowalski\n * Modified for Solid Aria: typed geometry and property-scoped style restoration without shared style caches.\n * MIT licensed. See LICENSE, VAUL-LICENSE, and NOTICE.txt in the package root.\n */\n\nimport type { DrawerDirection } from \"./types\";\n\nexport function isVertical(direction: DrawerDirection): boolean {\n return direction === \"top\" || direction === \"bottom\";\n}\n\nexport function directionSign(direction: DrawerDirection): 1 | -1 {\n return direction === \"bottom\" || direction === \"right\" ? 1 : -1;\n}\n\nexport function translate(\n distance: number,\n direction: DrawerDirection\n): string {\n return isVertical(direction)\n ? `translate3d(0, ${distance}px, 0)`\n : `translate3d(${distance}px, 0, 0)`;\n}\n\nexport function dampenValue(value: number): number {\n return Math.max(0, 8 * (Math.log(value + 1) - 2));\n}\n\nexport function clamp(value: number, min = 0, max = 1): number {\n return Math.min(max, Math.max(min, value));\n}\n\n/** Restore only the properties this operation owns, including priorities. */\nexport function assignStyle(\n element: HTMLElement,\n styles: Record<string, string>\n): () => void {\n const previous = Object.keys(styles).map((property) => ({\n priority: element.style.getPropertyPriority(property),\n property,\n value: element.style.getPropertyValue(property),\n }));\n\n for (const [property, value] of Object.entries(styles)) {\n element.style.setProperty(property, value);\n }\n\n return () => {\n for (const { property, value, priority } of previous) {\n if (value) {\n element.style.setProperty(property, value, priority);\n } else {\n element.style.removeProperty(property);\n }\n }\n };\n}\n\nexport function isSafari(view: Window): boolean {\n return /^(?:(?!chrome|android).)*safari/iu.test(view.navigator.userAgent);\n}\n\nexport function canScroll(\n target: HTMLElement,\n content: HTMLElement,\n direction: DrawerDirection,\n distance: number\n): boolean {\n const vertical = isVertical(direction);\n const forward = distance * directionSign(direction) < 0;\n\n for (\n let node: HTMLElement | null = target;\n node && content.contains(node);\n node = node.parentElement\n ) {\n const scrollSize = vertical ? node.scrollHeight : node.scrollWidth;\n const size = vertical ? node.clientHeight : node.clientWidth;\n\n if (scrollSize <= size) {\n continue;\n }\n\n const position = vertical ? node.scrollTop : node.scrollLeft;\n\n if (\n (forward && position < scrollSize - size) ||\n (!forward && position > 0)\n ) {\n return true;\n }\n }\n\n return false;\n}\n","/*\n * Derived from Vaul (https://github.com/emilkowalski/vaul): src/use-scale-background.ts and src/index.tsx.\n * Copyright (c) 2023 Emil Kowalski\n * Modified for Solid Aria: Solid 2 effects, document-local scaling, drag interpolation, and complete style cleanup.\n * MIT licensed. See LICENSE, VAUL-LICENSE, and NOTICE.txt in the package root.\n */\n\nimport { createEffect } from \"solid-js\";\n\nimport { BORDER_RADIUS, TRANSITIONS, WINDOW_TOP_OFFSET } from \"./constants\";\nimport type { DrawerContextValue } from \"./context\";\nimport { assignStyle, isVertical } from \"./helpers\";\n\nexport function createBackground(context: DrawerContextValue): void {\n let background: HTMLElement | null = null;\n let initialScale = 1;\n let vertical = true;\n createEffect(\n () => ({\n color:\n context.props.setBackgroundColorOnScale !== false &&\n context.props.noBodyStyles !== true,\n direction: context.direction,\n element: context.content,\n enabled: context.props.shouldScaleBackground === true,\n nested: context.props.nested === true,\n open: context.isOpen,\n }),\n ({\n element,\n open,\n enabled,\n color,\n direction,\n nested,\n }): undefined | (() => void) => {\n if (!element || !open || !enabled || nested) {\n return undefined;\n }\n\n const doc = element.ownerDocument;\n\n const wrapper = doc.querySelector<HTMLElement>(\n \"[data-vaul-drawer-wrapper], [vaul-drawer-wrapper]\"\n );\n\n const view = doc.defaultView;\n\n if (!wrapper || !view) {\n return undefined;\n }\n\n background = wrapper;\n initialScale = (view.innerWidth - WINDOW_TOP_OFFSET) / view.innerWidth;\n vertical = isVertical(direction);\n\n const restoreBody = color\n ? assignStyle(doc.body, { background: \"black\" })\n : undefined;\n\n const restoreWrapper = assignStyle(wrapper, {\n \"border-radius\": `${BORDER_RADIUS}px`,\n overflow: \"hidden\",\n transform: `scale(${initialScale}) ${vertical ? \"translate3d(0, 14px, 0)\" : \"translate3d(14px, 0, 0)\"}`,\n \"transform-origin\": vertical ? \"top\" : \"left\",\n \"transition-duration\": `${TRANSITIONS.DURATION}s`,\n \"transition-property\": \"transform, border-radius\",\n \"transition-timing-function\": `cubic-bezier(${TRANSITIONS.EASE.join(\",\")})`,\n });\n\n return () => {\n background = null;\n restoreWrapper();\n restoreBody?.();\n };\n },\n { ssrSource: \"client\" }\n );\n createEffect(\n () => ({\n dragging: context.isDragging,\n element: context.content,\n open: context.isOpen,\n progress: context.dragProgress,\n }),\n ({ progress, dragging, open }) => {\n if (!background || !open) {\n return;\n }\n\n const scale = initialScale + progress * (1 - initialScale);\n const displacement = 14 * (1 - progress);\n background.style.transitionDuration = dragging\n ? \"0s\"\n : `${TRANSITIONS.DURATION}s`;\n background.style.borderRadius = `${BORDER_RADIUS * (1 - progress)}px`;\n background.style.transform = `scale(${scale}) ${vertical ? `translate3d(0, ${displacement}px, 0)` : `translate3d(${displacement}px, 0, 0)`}`;\n },\n { ssrSource: \"client\" }\n );\n}\n","/*\n * Derived from Vaul (https://github.com/emilkowalski/vaul): src/use-snap-points.ts.\n * Copyright (c) 2023 Emil Kowalski\n * Modified for Solid Aria: pure snap geometry and selection, bounded sequential swipes, and container dimensions.\n * MIT licensed. See LICENSE, VAUL-LICENSE, and NOTICE.txt in the package root.\n */\n\nimport { VELOCITY_THRESHOLD } from \"./constants\";\nimport { clamp, directionSign } from \"./helpers\";\nimport type { DrawerDirection, SnapPoint } from \"./types\";\n\nexport function getSnapPointOffsets(\n points: readonly SnapPoint[],\n dimension: number,\n direction: DrawerDirection\n): number[] {\n return points.map((point) => {\n const visible =\n typeof point === \"number\"\n ? point * dimension\n : Number(point.replace(/px$/u, \"\"));\n\n return (dimension - visible) * directionSign(direction);\n });\n}\n\nexport function getOverlayOpacity(\n offsets: readonly number[],\n offset: number,\n fadeFromIndex: number,\n dimension: number\n): number {\n const faded = Math.abs(offsets[fadeFromIndex] ?? 0);\n\n const clear =\n fadeFromIndex === 0\n ? dimension\n : Math.abs(offsets[fadeFromIndex - 1] ?? faded);\n\n if (clear === faded) {\n return offset <= faded ? 1 : 0;\n }\n\n return clamp((clear - offset) / (clear - faded));\n}\n\nexport function selectSnapPoint(options: {\n offsets: readonly number[];\n activeIndex: number;\n /** Positive distance moves toward the closed edge. */\n distance: number;\n velocity: number;\n dimension: number;\n dismissible: boolean;\n sequential: boolean;\n}): number | \"close\" {\n const {\n offsets,\n activeIndex,\n distance,\n velocity,\n dimension,\n dismissible,\n sequential,\n } = options;\n\n const [first] = offsets;\n\n if (first === undefined) {\n return activeIndex;\n }\n\n const active = Math.abs(offsets[activeIndex] ?? first);\n const position = active + distance;\n\n if (!sequential && velocity > 2) {\n if (distance <= 0) {\n return offsets.length - 1;\n }\n\n return dismissible ? \"close\" : 0;\n }\n\n if (velocity > VELOCITY_THRESHOLD && Math.abs(distance) < dimension * 0.4) {\n if (distance > 0 && activeIndex === 0 && dismissible) {\n return \"close\";\n }\n\n return clamp(activeIndex + (distance > 0 ? -1 : 1), 0, offsets.length - 1);\n }\n\n const remaining = dimension - Math.abs(first);\n\n if (\n dismissible &&\n distance > 0 &&\n position > Math.abs(first) + remaining / 2\n ) {\n return \"close\";\n }\n\n let closest = 0;\n let difference = Infinity;\n\n for (const [index, offset] of offsets.entries()) {\n if (sequential && Math.abs(index - activeIndex) > 1) {\n continue;\n }\n\n const nextDifference = Math.abs(Math.abs(offset) - position);\n\n if (nextDifference < difference) {\n difference = nextDifference;\n closest = index;\n }\n }\n\n return closest;\n}\n","/*\n * Derived from Vaul (https://github.com/emilkowalski/vaul): src/index.tsx.\n * Copyright (c) 2023 Emil Kowalski\n * Modified for Solid Aria: native Solid 2 controlled state, presence, pointer gestures, measured snap-point entry, nested transforms, and lifecycle.\n * MIT licensed. See LICENSE, VAUL-LICENSE, and NOTICE.txt in the package root.\n */\n\nimport {\n createEffect,\n createMemo,\n createSignal,\n createUniqueId,\n onSettled,\n untrack,\n} from \"solid-js\";\n\nimport {\n CLOSE_THRESHOLD,\n DRAG_CLASS,\n NESTED_DISPLACEMENT,\n SCROLL_LOCK_TIMEOUT,\n TRANSITIONS,\n VELOCITY_THRESHOLD,\n} from \"./constants\";\nimport type { DrawerContextValue } from \"./context\";\nimport {\n getOverlayOpacity,\n getSnapPointOffsets,\n selectSnapPoint,\n} from \"./create-snap-points\";\nimport {\n canScroll,\n clamp,\n dampenValue,\n directionSign,\n isVertical,\n translate,\n} from \"./helpers\";\nimport type { DialogProps, SnapPoint } from \"./types\";\n\nconst transition = `${TRANSITIONS.DURATION}s cubic-bezier(${TRANSITIONS.EASE.join(\",\")})`;\n\ninterface Gesture {\n x: number;\n y: number;\n startedAt: number;\n dimension: number;\n startOffset: number;\n distance: number;\n allowed: boolean;\n fromHandle: boolean;\n pointerId: number;\n target: HTMLElement;\n}\n\nexport function createDrawer(\n props: DialogProps,\n parent?: DrawerContextValue\n): DrawerContextValue {\n const [internalOpen, setInternalOpen] = createSignal(\n untrack(() => props.defaultOpen ?? false)\n );\n\n const isOpen = createMemo(() => props.open ?? internalOpen());\n const [present, setPresent] = createSignal(untrack(isOpen));\n\n const [animate, setAnimate] = createSignal(\n untrack(() => props.defaultOpen !== true)\n );\n\n const [internalSnap, setInternalSnap] = createSignal<SnapPoint | null>(\n untrack(() => props.snapPoints?.[0] ?? null)\n );\n\n const activeSnap = createMemo(() =>\n props.activeSnapPoint === undefined ? internalSnap() : props.activeSnapPoint\n );\n\n const [content, setContent] = createSignal<HTMLDivElement | null>(null, {\n ownedWrite: true,\n });\n\n const [overlay, setOverlay] = createSignal<HTMLDivElement | null>(null, {\n ownedWrite: true,\n });\n\n const [trigger, setTrigger] = createSignal<HTMLButtonElement | null>(null, {\n ownedWrite: true,\n });\n\n const [dimension, setDimension] = createSignal(0);\n const [dragging, setDragging] = createSignal(false);\n const [dragProgress, setDragProgress] = createSignal(0);\n const [childOpen, setChildOpen] = createSignal(false);\n const [childProgress, setChildProgress] = createSignal(0);\n const direction = () => props.direction ?? \"bottom\";\n const points = () => props.snapPoints ?? [];\n\n const offsets = createMemo(() =>\n getSnapPointOffsets(points(), dimension(), direction())\n );\n\n const activeIndex = createMemo(() =>\n Math.max(0, points().indexOf(activeSnap() ?? points()[0] ?? 0))\n );\n\n const offset = () => offsets()[activeIndex()] ?? 0;\n\n const fadeFromIndex = () =>\n props.fadeFromIndex ?? Math.max(0, points().length - 1);\n\n const id = createUniqueId();\n let gesture: Gesture | null = null;\n let lastScrollTime = -Infinity;\n let openedAt = -Infinity;\n\n const onScroll = () => {\n lastScrollTime = Date.now();\n };\n\n function setOpen(open: boolean): void {\n if (open === isOpen()) {\n return;\n }\n\n if (props.open === undefined) {\n setInternalOpen(open);\n }\n\n props.onOpenChange?.(open);\n }\n\n function setActiveSnapPoint(point: SnapPoint | null): void {\n if (point === activeSnap()) {\n return;\n }\n\n if (props.activeSnapPoint === undefined) {\n setInternalSnap(point);\n }\n\n props.setActiveSnapPoint?.(point);\n }\n\n function resetPosition(): void {\n const element = content();\n\n if (!element) {\n return;\n }\n\n element.classList.remove(DRAG_CLASS);\n element.style.transition = `transform ${transition}`;\n element.style.transform = translate(offset(), direction());\n const backdrop = overlay();\n\n if (backdrop) {\n backdrop.style.transition = `opacity ${transition}`;\n backdrop.style.opacity = points().length\n ? `${getOverlayOpacity(offsets(), Math.abs(offset()), fadeFromIndex(), dimension())}`\n : \"1\";\n }\n }\n\n function cancelDrag(): void {\n if (!gesture) {\n return;\n }\n\n if (gesture.target.hasPointerCapture?.(gesture.pointerId)) {\n gesture.target.releasePointerCapture(gesture.pointerId);\n }\n\n gesture = null;\n setDragging(false);\n setDragProgress(0);\n untrack(resetPosition);\n parent?.setChildProgress(0);\n }\n\n function close(): void {\n cancelDrag();\n\n if (props.dismissible !== false) {\n setOpen(false);\n }\n }\n\n createEffect(\n isOpen,\n (open, previous): undefined | (() => void) => {\n if (open) {\n openedAt = Date.now();\n setPresent(true);\n } else {\n cancelDrag();\n\n if (previous === true) {\n props.onClose?.();\n }\n }\n\n parent?.setChildOpen(open);\n\n if (previous === undefined && !open) {\n return undefined;\n }\n\n const view = untrack(content)?.ownerDocument.defaultView;\n\n const duration =\n view?.matchMedia(\"(prefers-reduced-motion: reduce)\").matches === true\n ? 0\n : TRANSITIONS.DURATION * 1000;\n\n const timer = setTimeout(() => {\n if (!open) {\n setPresent(false);\n setActiveSnapPoint(points()[0] ?? null);\n }\n\n if (previous !== undefined) {\n props.onAnimationEnd?.(open);\n }\n }, duration);\n\n return () => {\n clearTimeout(timer);\n };\n },\n { ssrSource: \"client\" }\n );\n\n createEffect(\n () => ({\n container: props.container,\n direction: direction(),\n element: content(),\n }),\n ({\n element,\n container,\n direction: currentDirection,\n }): undefined | (() => void) => {\n if (!element) {\n return undefined;\n }\n\n const view = element.ownerDocument.defaultView;\n\n if (!view) {\n return undefined;\n }\n\n const measure = (): void => {\n const rect = container?.getBoundingClientRect();\n setDimension(\n isVertical(currentDirection)\n ? (rect?.height ?? view.innerHeight)\n : (rect?.width ?? view.innerWidth)\n );\n };\n\n measure();\n view.addEventListener(\"resize\", measure);\n\n const observer =\n typeof ResizeObserver === \"undefined\"\n ? undefined\n : new ResizeObserver(measure);\n\n if (container) {\n observer?.observe(container);\n }\n\n element.addEventListener(\"scroll\", onScroll, true);\n\n return () => {\n view.removeEventListener(\"resize\", measure);\n observer?.disconnect();\n element.removeEventListener(\"scroll\", onScroll, true);\n cancelDrag();\n };\n },\n { ssrSource: \"client\" }\n );\n\n createEffect(\n () => ({\n animate: animate(),\n backdrop: overlay(),\n child: childOpen(),\n dimension: dimension(),\n direction: direction(),\n element: content(),\n hasSnapPoints: points().length > 0,\n offset: offset(),\n opacity: points().length\n ? getOverlayOpacity(\n offsets(),\n Math.abs(offset()),\n fadeFromIndex(),\n dimension()\n )\n : 1,\n open: isOpen(),\n progress: childProgress(),\n }),\n ({\n animate: shouldAnimate,\n element,\n backdrop,\n dimension: currentDimension,\n hasSnapPoints,\n open,\n offset: currentOffset,\n child,\n progress,\n direction: currentDirection,\n opacity,\n }) => {\n if (!element || (hasSnapPoints && currentDimension === 0)) {\n return;\n }\n\n const sign = directionSign(currentDirection);\n const view = element.ownerDocument.defaultView;\n\n const size = isVertical(currentDirection)\n ? view?.innerHeight\n : view?.innerWidth;\n\n const scale = child\n ? 1 - (NESTED_DISPLACEMENT / Math.max(1, size ?? 1)) * (1 - progress)\n : 1;\n\n const displacement = child\n ? -NESTED_DISPLACEMENT * (1 - progress) * sign\n : 0;\n\n if (hasSnapPoints && shouldAnimate && element.style.transform === \"\") {\n // Commit the closed position before transitioning to the measured snap point.\n element.getBoundingClientRect();\n }\n\n element.style.transition = shouldAnimate\n ? `transform ${transition}`\n : \"none\";\n element.style.transform = `${translate(open ? currentOffset + displacement : sign * (size ?? currentDimension), currentDirection)} scale(${scale})`;\n\n if (backdrop) {\n backdrop.style.transition = shouldAnimate\n ? `opacity ${transition}`\n : \"none\";\n backdrop.style.opacity = open ? `${opacity}` : \"0\";\n }\n },\n { ssrSource: \"client\" }\n );\n\n onSettled(() => {\n const frame = requestAnimationFrame(() => {\n setAnimate(true);\n });\n\n return () => {\n cancelAnimationFrame(frame);\n parent?.setChildOpen(false);\n };\n });\n\n function press(event: PointerEvent, fromHandle = false): void {\n const element = content();\n const { target } = event;\n\n if (\n !element ||\n !isOpen() ||\n childOpen() ||\n event.defaultPrevented ||\n event.button > 0\n ) {\n return;\n }\n\n if (\n !(target instanceof HTMLElement) ||\n target.closest(\"[data-vaul-drawer]\") !== element\n ) {\n return;\n }\n\n if (\n target.closest(\"[data-vaul-no-drag],select,option\") ||\n (props.handleOnly === true && !fromHandle)\n ) {\n return;\n }\n\n if (props.dismissible === false && !points().length) {\n return;\n }\n\n const rect = element.getBoundingClientRect();\n gesture = {\n allowed: false,\n dimension: isVertical(direction()) ? rect.height : rect.width,\n distance: 0,\n fromHandle,\n pointerId: event.pointerId,\n startOffset: Math.abs(offset()),\n startedAt: Date.now(),\n target,\n x: event.clientX,\n y: event.clientY,\n };\n }\n\n function canDrag(target: HTMLElement, distance: number): boolean {\n if (!gesture || target.closest(\"[data-vaul-no-drag],select,option\")) {\n return false;\n }\n\n if (gesture.fromHandle) {\n return true;\n }\n\n if ((target.ownerDocument.getSelection()?.toString().length ?? 0) > 0) {\n return false;\n }\n\n if (Date.now() - openedAt < TRANSITIONS.DURATION * 1000) {\n return false;\n }\n\n if (\n Date.now() - lastScrollTime <\n (props.scrollLockTimeout ?? SCROLL_LOCK_TIMEOUT)\n ) {\n return false;\n }\n\n const lastOffset = Math.abs(offsets().at(-1) ?? 0);\n\n if (distance < 0 && gesture.startOffset > lastOffset) {\n return true;\n }\n\n const element = content();\n\n return (\n element !== null && !canScroll(target, element, direction(), distance)\n );\n }\n\n function claimGesture(\n event: PointerEvent,\n current: Gesture,\n axis: number,\n cross: number,\n distance: number\n ): boolean {\n if (current.allowed) {\n return true;\n }\n\n const threshold = event.pointerType === \"touch\" ? 10 : 2;\n\n if (Math.abs(axis) < threshold && Math.abs(cross) < threshold) {\n return false;\n }\n\n if (Math.abs(cross) > Math.abs(axis)) {\n gesture = null;\n\n return false;\n }\n\n if (!canDrag(current.target, distance)) {\n return false;\n }\n\n current.allowed = true;\n current.target.setPointerCapture?.(event.pointerId);\n setDragging(true);\n\n return true;\n }\n\n function drag(event: PointerEvent): void {\n const current = gesture;\n const element = content();\n\n if (!current || !element || current.pointerId !== event.pointerId) {\n return;\n }\n\n const dx = event.clientX - current.x;\n const dy = event.clientY - current.y;\n const vertical = isVertical(direction());\n const axis = vertical ? dy : dx;\n const cross = vertical ? dx : dy;\n const distance = axis * directionSign(direction());\n\n if (!claimGesture(event, current, axis, cross, distance)) {\n return;\n }\n\n event.preventDefault();\n const minimum = Math.abs(offsets().at(-1) ?? 0);\n let position = current.startOffset + distance;\n\n if (position < minimum) {\n position = minimum - dampenValue(minimum - position);\n }\n\n if (props.dismissible === false) {\n position = Math.min(position, Math.abs(offsets()[0] ?? 0));\n }\n\n current.distance = position - current.startOffset;\n element.classList.add(DRAG_CLASS);\n element.style.transition = \"none\";\n element.style.transform = translate(\n position * directionSign(direction()),\n direction()\n );\n\n const percentage = clamp(\n Math.max(0, distance) /\n Math.max(1, current.dimension - current.startOffset)\n );\n\n const backdrop = overlay();\n\n if (backdrop) {\n backdrop.style.transition = \"none\";\n backdrop.style.opacity = points().length\n ? `${getOverlayOpacity(offsets(), position, fadeFromIndex(), dimension())}`\n : `${1 - percentage}`;\n }\n\n setDragProgress(percentage);\n props.onDrag?.(event, percentage);\n parent?.setChildProgress(percentage);\n }\n\n function release(event: PointerEvent): void {\n const current = gesture;\n\n if (!current || event.pointerId !== current.pointerId) {\n return;\n }\n\n const velocity =\n Math.abs(current.distance) / Math.max(1, Date.now() - current.startedAt);\n\n let next: number | \"close\" = activeIndex();\n\n if (current.allowed && points().length) {\n next = selectSnapPoint({\n activeIndex: activeIndex(),\n dimension: dimension(),\n dismissible: props.dismissible !== false,\n distance: current.distance,\n offsets: offsets(),\n sequential: props.snapToSequentialPoint ?? false,\n velocity,\n });\n } else if (\n current.allowed &&\n current.distance > 0 &&\n props.dismissible !== false &&\n (velocity > VELOCITY_THRESHOLD ||\n current.distance >=\n current.dimension * (props.closeThreshold ?? CLOSE_THRESHOLD))\n ) {\n next = \"close\";\n }\n\n cancelDrag();\n\n if (!current.allowed) {\n return;\n }\n\n if (next === \"close\") {\n close();\n } else if (points().length) {\n setActiveSnapPoint(points()[next] ?? null);\n }\n\n props.onRelease?.(event, next !== \"close\");\n }\n\n return {\n get activeSnapPoint() {\n return activeSnap();\n },\n get activeSnapPointIndex() {\n return activeIndex();\n },\n cancelDrag,\n get childOpen() {\n return childOpen();\n },\n close,\n get content() {\n return content();\n },\n contentId: `vaul-${id}`,\n descriptionId: `vaul-${id}-description`,\n get direction() {\n return direction();\n },\n get dismissible() {\n return props.dismissible ?? true;\n },\n drag,\n get dragProgress() {\n return dragProgress();\n },\n get isDragging() {\n return dragging();\n },\n get isOpen() {\n return isOpen();\n },\n get modal() {\n return props.modal ?? true;\n },\n get overlay() {\n return overlay();\n },\n get present() {\n return present();\n },\n press,\n props,\n release,\n setActiveSnapPoint,\n setChildOpen(open) {\n setChildOpen(open);\n setChildProgress(0);\n },\n setChildProgress(progress) {\n setChildProgress(progress);\n },\n setContent(element) {\n setContent(element);\n },\n setOpen,\n setOverlay(element) {\n setOverlay(element);\n },\n setTrigger(element) {\n setTrigger(element);\n },\n get shouldAnimate() {\n return animate();\n },\n get shouldFade() {\n return !points().length || activeIndex() >= fadeFromIndex();\n },\n get snapPointsOffset() {\n return offsets();\n },\n titleId: `vaul-${id}-title`,\n get trigger() {\n return trigger();\n },\n };\n}\n","import { ariaHideOutside } from \"@solid2-aria/core/overlays/aria-hide-outside\";\nimport { createPreventScroll } from \"@solid2-aria/core/overlays/create-prevent-scroll\";\nimport { createEffect, untrack } from \"solid-js\";\n\nimport type { DrawerContextValue } from \"./context\";\nimport type {\n ContentProps,\n FocusOutsideEvent,\n PointerDownOutsideEvent,\n} from \"./types\";\n\nconst layers = new WeakMap<Document, HTMLDivElement[]>();\n\nexport function createLayer(\n context: DrawerContextValue,\n props: ContentProps\n): void {\n createPreventScroll({\n get isDisabled() {\n return (\n !context.isOpen ||\n !context.content ||\n !context.modal ||\n context.props.noBodyStyles === true ||\n (!context.overlay && context.props.disablePreventScroll !== true)\n );\n },\n });\n\n createEffect(\n () => ({\n element: context.content,\n modal: context.modal,\n open: context.isOpen,\n overlay: context.overlay,\n }),\n ({ element, overlay, open, modal }): undefined | (() => void) => {\n if (!element || !open || !modal) {\n return undefined;\n }\n\n return ariaHideOutside(overlay ? [element, overlay] : [element], {\n shouldUseInert: true,\n });\n },\n { ssrSource: \"client\" }\n );\n\n createEffect(\n () => ({ element: context.content, open: context.isOpen }),\n ({ element, open }): undefined | (() => void) => {\n if (!element || !open) {\n return undefined;\n }\n\n const doc = element.ownerDocument;\n const stack = layers.get(doc) ?? [];\n layers.set(doc, stack);\n stack.push(element);\n const previous = doc.activeElement;\n let interactedOutside = false;\n const autoFocus = new Event(\"openAutoFocus\", { cancelable: true });\n props.onOpenAutoFocus?.(autoFocus);\n\n if (!autoFocus.defaultPrevented && context.props.autoFocus === true) {\n const first = element.querySelector<HTMLElement>(\n \"[autofocus],button:not([disabled]),[href],input:not([disabled]),select:not([disabled]),textarea:not([disabled]),[tabindex='0']\"\n );\n\n (first ?? element).focus({ preventScroll: true });\n }\n\n const isTop = () => stack.at(-1) === element;\n\n const isOutside = (event: Event) =>\n !event.composedPath().includes(element);\n\n function pointerDown(event: PointerEvent): void {\n if (!isTop() || !isOutside(event)) {\n return;\n }\n\n const outside: PointerDownOutsideEvent = new CustomEvent(\n \"pointerDownOutside\",\n {\n cancelable: true,\n detail: { originalEvent: event },\n }\n );\n\n props.onPointerDownOutside?.(outside);\n props.onInteractOutside?.(outside);\n\n if (\n outside.defaultPrevented ||\n !context.modal ||\n event.button > 0 ||\n event.ctrlKey\n ) {\n return;\n }\n\n interactedOutside = !context.modal;\n context.close();\n }\n\n function focusIn(event: FocusEvent): void {\n if (!isTop() || !isOutside(event)) {\n return;\n }\n\n const outside: FocusOutsideEvent = new CustomEvent(\"focusOutside\", {\n cancelable: true,\n detail: { originalEvent: event },\n });\n\n props.onFocusOutside?.(outside);\n props.onInteractOutside?.(outside);\n\n if (!context.modal) {\n interactedOutside = true;\n }\n }\n\n function keyDown(event: KeyboardEvent): void {\n if (event.key !== \"Escape\" || !isTop() || event.defaultPrevented) {\n return;\n }\n\n props.onEscapeKeyDown?.(event);\n\n if (event.defaultPrevented) {\n return;\n }\n\n event.preventDefault();\n context.close();\n }\n\n doc.addEventListener(\"pointerdown\", pointerDown);\n doc.addEventListener(\"focusin\", focusIn);\n doc.addEventListener(\"keydown\", keyDown);\n\n const touchMove = (event: TouchEvent) => {\n if (element.classList.contains(\"vaul-dragging\") && event.cancelable) {\n event.preventDefault();\n }\n };\n\n element.addEventListener(\"touchmove\", touchMove, { passive: false });\n\n return () => {\n const index = stack.indexOf(element);\n const wasTop = isTop();\n\n if (index !== -1) {\n stack.splice(index, 1);\n }\n\n if (!stack.length) {\n layers.delete(doc);\n }\n\n doc.removeEventListener(\"pointerdown\", pointerDown);\n doc.removeEventListener(\"focusin\", focusIn);\n doc.removeEventListener(\"keydown\", keyDown);\n element.removeEventListener(\"touchmove\", touchMove);\n\n const closeAutoFocus = new Event(\"closeAutoFocus\", {\n cancelable: true,\n });\n\n props.onCloseAutoFocus?.(closeAutoFocus);\n\n if (closeAutoFocus.defaultPrevented || interactedOutside || !wasTop) {\n return;\n }\n\n const target = untrack(() => context.trigger) ?? previous;\n queueMicrotask(() => {\n if (target instanceof HTMLElement && target.isConnected) {\n target.focus({ preventScroll: true });\n }\n });\n };\n },\n { ssrSource: \"client\" }\n );\n}\n","/*\n * Derived from Vaul (https://github.com/emilkowalski/vaul): src/use-position-fixed.ts and src/index.tsx.\n * Copyright (c) 2023 Emil Kowalski\n * Modified for Solid Aria: Solid 2 lifecycle, per-drawer style ownership, viewport resizing, and route-aware restoration.\n * MIT licensed. See LICENSE, VAUL-LICENSE, and NOTICE.txt in the package root.\n */\n\nimport { createEffect } from \"solid-js\";\n\nimport { WINDOW_TOP_OFFSET } from \"./constants\";\nimport type { DrawerContextValue } from \"./context\";\nimport { assignStyle, isSafari } from \"./helpers\";\n\nexport function createPosition(context: DrawerContextValue): void {\n createEffect(\n () => ({\n element: context.content,\n modal: context.modal,\n nested: context.props.nested === true,\n noBodyStyles: context.props.noBodyStyles === true,\n open: context.isOpen,\n preventScrollRestoration: context.props.preventScrollRestoration === true,\n }),\n ({\n element,\n open,\n modal,\n noBodyStyles,\n nested,\n preventScrollRestoration,\n }): undefined | (() => void) => {\n if (!element || !open || !modal || noBodyStyles || nested) {\n return undefined;\n }\n\n const doc = element.ownerDocument;\n const view = doc.defaultView;\n\n if (\n !view ||\n !isSafari(view) ||\n view.matchMedia(\"(display-mode: standalone)\").matches\n ) {\n return undefined;\n }\n\n const { scrollX, scrollY } = view;\n const url = view.location.href;\n\n const restore = assignStyle(doc.body, {\n height: \"auto\",\n left: `${-scrollX}px`,\n position: \"fixed\",\n right: \"0\",\n top: `${-scrollY}px`,\n });\n\n return () => {\n restore();\n\n if (!preventScrollRestoration || url === view.location.href) {\n view.scrollTo(scrollX, scrollY);\n }\n };\n },\n { ssrSource: \"client\" }\n );\n\n createEffect(\n () => ({\n direction: context.direction,\n element: context.content,\n fixed: context.props.fixed === true,\n open: context.isOpen,\n reposition: context.props.repositionInputs !== false,\n }),\n ({\n element,\n open,\n reposition,\n fixed,\n direction,\n }): undefined | (() => void) => {\n if (!element || !open || !reposition || direction !== \"bottom\") {\n return undefined;\n }\n\n const doc = element.ownerDocument;\n const view = doc.defaultView;\n const viewport = view?.visualViewport;\n\n if (!view || !viewport) {\n return undefined;\n }\n\n const { height } = element.style;\n const { bottom } = element.style;\n let keyboardOpen = false;\n const initialHeight = element.getBoundingClientRect().height;\n\n const resize = (): void => {\n const focused = doc.activeElement;\n\n if (\n !keyboardOpen &&\n (!(focused instanceof HTMLElement) ||\n !element.contains(focused) ||\n !focused.matches(\"input,textarea,[contenteditable]\"))\n ) {\n return;\n }\n\n const diff = Math.max(\n 0,\n view.innerHeight - viewport.height - viewport.offsetTop\n );\n\n keyboardOpen = diff > 60;\n\n if (!keyboardOpen) {\n element.style.height = height;\n element.style.bottom = bottom;\n\n return;\n }\n\n const rect = element.getBoundingClientRect();\n\n const available = Math.max(\n 0,\n viewport.height - Math.max(WINDOW_TOP_OFFSET, rect.top)\n );\n\n element.style.height = `${fixed ? Math.max(0, initialHeight - diff) : available}px`;\n element.style.bottom = `${diff}px`;\n\n if (focused instanceof HTMLElement) {\n focused.scrollIntoView({ block: \"nearest\" });\n }\n };\n\n viewport.addEventListener(\"resize\", resize);\n viewport.addEventListener(\"scroll\", resize);\n\n return () => {\n viewport.removeEventListener(\"resize\", resize);\n viewport.removeEventListener(\"scroll\", resize);\n element.style.height = height;\n element.style.bottom = bottom;\n };\n },\n { ssrSource: \"client\" }\n );\n}\n","/*\n * Derived from Vaul (https://github.com/emilkowalski/vaul): src/index.tsx.\n * Copyright (c) 2023 Emil Kowalski\n * Modified for Solid Aria: Solid 2 components, contexts, callback refs, portals, presence, and native DOM event composition.\n * MIT licensed. See LICENSE, VAUL-LICENSE, and NOTICE.txt in the package root.\n */\n\nimport { FocusScope } from \"@solid2-aria/core/focus/focus-scope\";\nimport { Portal as SolidPortal } from \"@solidjs/web\";\nimport type { JSX } from \"@solidjs/web\";\nimport {\n createSignal,\n merge,\n omit,\n onSettled,\n Show,\n useContext,\n} from \"solid-js\";\n\nimport { DrawerContext, PortalContext } from \"./context\";\nimport { createBackground } from \"./create-background\";\nimport { createDrawer } from \"./create-drawer\";\nimport { createLayer } from \"./create-layer\";\nimport { createPosition } from \"./create-position\";\nimport type {\n CloseProps,\n ContentProps,\n DescriptionProps,\n DialogProps,\n HandleProps,\n OverlayProps,\n PortalProps,\n TitleProps,\n TriggerProps,\n} from \"./types\";\n\nexport function Root(props: DialogProps): JSX.Element {\n const context = createDrawer(props);\n createBackground(context);\n createPosition(context);\n\n return <DrawerContext value={context}>{props.children}</DrawerContext>;\n}\n\nexport function NestedRoot(props: DialogProps): JSX.Element {\n const parent = useContext(DrawerContext);\n const context = createDrawer(merge(props, { nested: true }), parent);\n createPosition(context);\n\n return <DrawerContext value={context}>{props.children}</DrawerContext>;\n}\n\nexport function Portal(props: PortalProps): JSX.Element {\n const context = useContext(DrawerContext);\n const [mounted, setMounted] = createSignal(false);\n onSettled(() => {\n setMounted(true);\n });\n\n return (\n <Show when={mounted() && (context.present || props.forceMount === true)}>\n <SolidPortal\n mount={props.container ?? context.props.container ?? document.body}\n >\n <PortalContext value={props.forceMount ?? false}>\n {props.children}\n </PortalContext>\n </SolidPortal>\n </Show>\n );\n}\n\nexport function Trigger(props: TriggerProps): JSX.Element {\n const context = useContext(DrawerContext);\n\n const attributes = merge(omit(props, \"render\", \"ref\", \"onClick\"), {\n \"aria-controls\": context.contentId,\n get \"aria-expanded\"(): \"true\" | \"false\" {\n return context.isOpen ? \"true\" : \"false\";\n },\n \"aria-haspopup\": \"dialog\" as const,\n get \"data-state\"() {\n return context.isOpen ? \"open\" : \"closed\";\n },\n onClick(\n event: Parameters<JSX.EventHandler<HTMLButtonElement, MouseEvent>>[0]\n ) {\n callHandler(props.onClick, event);\n\n if (!event.defaultPrevented) {\n context.setOpen(!context.isOpen);\n }\n },\n get ref() {\n return [\n props.ref,\n (element: HTMLButtonElement) => {\n context.setTrigger(element);\n },\n ];\n },\n get type() {\n return props.type ?? \"button\";\n },\n });\n\n return (\n <Show when={props.render} keyed fallback={<button {...attributes} />}>\n {(render) => render(attributes)}\n </Show>\n );\n}\n\nexport function Close(props: CloseProps): JSX.Element {\n const context = useContext(DrawerContext);\n\n const attributes = merge(omit(props, \"render\", \"onClick\"), {\n onClick(\n event: Parameters<JSX.EventHandler<HTMLButtonElement, MouseEvent>>[0]\n ) {\n callHandler(props.onClick, event);\n\n if (!event.defaultPrevented) {\n context.close();\n }\n },\n get type() {\n return props.type ?? \"button\";\n },\n });\n\n return (\n <Show when={props.render} keyed fallback={<button {...attributes} />}>\n {(render) => render(attributes)}\n </Show>\n );\n}\n\nexport function Overlay(props: OverlayProps): JSX.Element {\n const context = useContext(DrawerContext);\n const forceMount = useContext(PortalContext);\n\n return (\n <Show\n when={\n context.modal &&\n (context.present || props.forceMount === true || forceMount)\n }\n >\n <OverlayElement {...props} />\n </Show>\n );\n}\n\nfunction OverlayElement(props: OverlayProps): JSX.Element {\n const context = useContext(DrawerContext);\n const rest = omit(props, \"forceMount\", \"ref\");\n onSettled(() => () => {\n context.setOverlay(null);\n });\n\n return (\n <div\n {...rest}\n ref={[\n props.ref,\n (element) => {\n context.setOverlay(element);\n },\n ]}\n data-vaul-overlay=\"\"\n data-state={context.isOpen ? \"open\" : \"closed\"}\n data-vaul-snap-points={\n (context.props.snapPoints?.length ?? 0) > 0 ? \"true\" : \"false\"\n }\n data-vaul-snap-points-overlay={context.shouldFade ? \"true\" : \"false\"}\n data-vaul-animate={context.shouldAnimate ? \"true\" : \"false\"}\n />\n );\n}\n\nexport function Content(props: ContentProps): JSX.Element {\n const context = useContext(DrawerContext);\n const forceMount = useContext(PortalContext);\n\n return (\n <Show when={context.present || props.forceMount === true || forceMount}>\n <ContentElement {...props} />\n </Show>\n );\n}\n\nfunction ContentElement(props: ContentProps): JSX.Element {\n const context = useContext(DrawerContext);\n\n const rest = omit(\n props,\n \"forceMount\",\n \"ref\",\n \"onOpenAutoFocus\",\n \"onCloseAutoFocus\",\n \"onEscapeKeyDown\",\n \"onPointerDownOutside\",\n \"onFocusOutside\",\n \"onInteractOutside\",\n \"onPointerDown\",\n \"onPointerMove\",\n \"onPointerUp\",\n \"onPointerCancel\",\n \"onLostPointerCapture\"\n );\n\n createLayer(context, props);\n onSettled(() => () => {\n context.setContent(null);\n });\n\n return (\n <FocusScope contain={context.isOpen && context.modal && !context.childOpen}>\n <div\n id={context.contentId}\n role=\"dialog\"\n aria-modal={context.modal ? \"true\" : undefined}\n aria-labelledby={context.titleId}\n aria-describedby={context.descriptionId}\n tabindex={-1}\n {...rest}\n ref={[\n props.ref,\n (element) => {\n context.setContent(element);\n },\n ]}\n data-state={context.isOpen ? \"open\" : \"closed\"}\n data-vaul-drawer=\"\"\n data-vaul-drawer-direction={context.direction}\n data-vaul-custom-container={context.props.container ? \"true\" : \"false\"}\n data-vaul-snap-points={\n (context.props.snapPoints?.length ?? 0) > 0 ? \"true\" : \"false\"\n }\n data-vaul-delayed-snap-points={\n context.snapPointsOffset.length > 0 ? \"true\" : \"false\"\n }\n data-vaul-handle-only={\n context.props.handleOnly === true ? \"true\" : \"false\"\n }\n data-vaul-animate={context.shouldAnimate ? \"true\" : \"false\"}\n onPointerDown={(event) => {\n callHandler(props.onPointerDown, event);\n context.press(event);\n }}\n onPointerMove={(event) => {\n callHandler(props.onPointerMove, event);\n\n if (!event.defaultPrevented) {\n context.drag(event);\n }\n }}\n onPointerUp={(event) => {\n callHandler(props.onPointerUp, event);\n context.release(event);\n }}\n onPointerCancel={(event) => {\n callHandler(props.onPointerCancel, event);\n context.cancelDrag();\n }}\n onLostPointerCapture={(event) => {\n callHandler(props.onLostPointerCapture, event);\n context.cancelDrag();\n }}\n />\n </FocusScope>\n );\n}\n\nexport function Title(props: TitleProps): JSX.Element {\n const context = useContext(DrawerContext);\n\n return <h2 id={context.titleId} {...props} />;\n}\n\nexport function Description(props: DescriptionProps): JSX.Element {\n const context = useContext(DrawerContext);\n\n return <p id={context.descriptionId} {...props} />;\n}\n\nexport function Handle(props: HandleProps): JSX.Element {\n const context = useContext(DrawerContext);\n\n const rest = omit(\n props,\n \"preventCycle\",\n \"children\",\n \"onClick\",\n \"onPointerDown\",\n \"onPointerMove\",\n \"onPointerCancel\"\n );\n\n let pressTime = 0;\n let pressPosition = { x: 0, y: 0 };\n let moved = false;\n let lastClick = -Infinity;\n\n function cycle(): void {\n if (\n props.preventCycle === true ||\n moved ||\n Date.now() - pressTime > 250 ||\n Date.now() - lastClick < 120\n ) {\n return;\n }\n\n lastClick = Date.now();\n const points = context.props.snapPoints;\n\n if (!points || points.length === 0) {\n context.close();\n\n return;\n }\n\n const next = points[context.activeSnapPointIndex + 1];\n\n if (next !== undefined) {\n context.setActiveSnapPoint(next);\n } else if (context.dismissible) {\n context.close();\n } else {\n context.setActiveSnapPoint(points[0] ?? null);\n }\n }\n\n return (\n <div\n {...rest}\n data-vaul-handle=\"\"\n aria-hidden=\"true\"\n data-vaul-drawer-visible={context.isOpen ? \"true\" : \"false\"}\n onClick={(event) => {\n callHandler(props.onClick, event);\n\n if (!event.defaultPrevented) {\n cycle();\n }\n }}\n onPointerDown={(event) => {\n callHandler(props.onPointerDown, event);\n\n if (event.defaultPrevented) {\n return;\n }\n\n pressTime = Date.now();\n pressPosition = { x: event.clientX, y: event.clientY };\n moved = false;\n context.press(event, true);\n event.stopPropagation();\n }}\n onPointerMove={(event) => {\n callHandler(props.onPointerMove, event);\n\n if (\n Math.abs(event.clientX - pressPosition.x) > 2 ||\n Math.abs(event.clientY - pressPosition.y) > 2\n ) {\n moved = true;\n }\n }}\n onPointerCancel={(event) => {\n callHandler(props.onPointerCancel, event);\n moved = true;\n context.cancelDrag();\n }}\n >\n <span data-vaul-handle-hitarea=\"\" aria-hidden=\"true\">\n {props.children}\n </span>\n </div>\n );\n}\n\nfunction callHandler<T, E extends Event>(\n handler: JSX.EventHandlerUnion<T, E> | undefined,\n event: Parameters<JSX.EventHandler<T, E>>[0]\n): void {\n if (typeof handler === \"function\") {\n handler(event);\n } else if (handler) {\n handler[0](handler[1], event);\n }\n}\n","import {\n Close,\n Content,\n Description,\n Handle,\n NestedRoot,\n Overlay,\n Portal,\n Root,\n Title,\n Trigger,\n} from \"./drawer\";\n\nexport {\n Close,\n Content,\n Description,\n Handle,\n NestedRoot,\n Overlay,\n Portal,\n Root,\n Title,\n Trigger,\n} from \"./drawer\";\n\nexport type {\n CloseProps,\n ContentProps,\n DescriptionProps,\n DialogProps,\n DrawerDirection,\n DrawerProps,\n FocusOutsideEvent,\n HandleProps,\n InteractOutsideEvent,\n OverlayProps,\n PointerDownOutsideEvent,\n PortalProps,\n SnapPoint,\n TitleProps,\n TriggerProps,\n WithFadeFromProps,\n WithoutFadeFromProps,\n} from \"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,WAAW,aAAa;CAExC,MAAM,OAAO,KACX,OACA,cACA,OACA,mBACA,oBACA,mBACA,wBACA,kBACA,qBACA,iBACA,iBACA,eACA,mBACA,sBACF;CAEA,YAAY,SAAS,KAAK;CAC1B,sBAAsB;EACpB,QAAQ,WAAW,IAAI;CACzB,CAAC;CAED,OAAA,WACE,IAAA,MAAqB,SAQb,IA6CI,CAAA;AAEhB;AAEA,SAAgB,MAAM,OAAgC;CACpD,MAAM,UAAU,WAAW,aAAa;CAExC,OAAOI,WAAAA,MAAAA,CAAyB,IAAA,MAAjB,OAA0B,GAAL,KAAA,GAAA,KAAA,GAA7B,IAAqC;AAC9C;AAEA,SAAgB,YAAY,OAAsC;CAChE,MAAM,UAAU,WAAW,aAAa;CAExC,OAAOC,WAAAA,KAAAA,CAA8B,IAAA,MAAvB,OAAgC,GAAL,KAAA,GAAA,KAAA,GAAlC,IAA0C;AACnD;AAEA,SAAgB,OAAO,OAAiC;;CACtD,MAAM,UAAU,WAAW,aAAa;CAExC,MAAM,OAAO,KACX,OACA,gBACA,YACA,WACA,iBACA,iBACA,iBACF;CAqCA,OACEC,WAAAA,OACM,YADN;EAyCE,OAAA,MACEC,YAAAA;GAACC,OAAAA,OAAAA,MAAM,QAAO;EAAC,CAAA,GADjBC,IAAAA,QACEF,GACI;CACH,GA5CL,MAAA,aAAA,2CAIEG,oBAAAA,4BAA0B,QAAQ,SAAS,SAAS,OAAO,CAwCxD;AAET;AAEA,SAAS,YACP,SACA,OACM;CACN,IAAI,OAAO,YAAY,YACrB,QAAQ,KAAK;MACR,IAAI,SACT,QAAQ,EAAE,CAAC,QAAQ,IAAI,KAAK;AAEhC;;AC3VA,MAAa,SAAS;CACpB;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACF"}
1
+ {"version":3,"file":"index.js","names":["<button {...attributes} />","context.isOpen && context.modal && !context.childOpen","data-state={context.isOpen ? \"open\" : \"closed\"}","data-vaul-drawer-direction={context.direction}","data-vaul-custom-container={context.props.container ? \"true\" : \"false\"}","data-vaul-snap-points={\n (context.props.snapPoints?.length ?? 0) > 0 ? \"true\" : \"false\"\n }","data-vaul-delayed-snap-points={\n context.snapPointsOffset.length > 0 ? \"true\" : \"false\"\n }","data-vaul-handle-only={\n context.props.handleOnly === true ? \"true\" : \"false\"\n }","data-vaul-animate={context.shouldAnimate ? \"true\" : \"false\"}","<Show when={mounted() && (context.present || props.forceMount === true)}>\n <SolidPortal\n mount={props.container ?? context.props.container ?? document.body}\n >\n <PortalContext value={props.forceMount ?? false}>\n {props.children}\n </PortalContext>\n </SolidPortal>\n </Show>","<Show\n when={\n context.modal &&\n (context.present || props.forceMount === true || forceMount)\n }\n >\n <OverlayElement {...props} />\n </Show>","<div\n {...rest}\n ref={[\n props.ref,\n (element) => {\n context.setOverlay(element);\n },\n ]}\n data-vaul-overlay=\"\"\n data-state={context.isOpen ? \"open\" : \"closed\"}\n data-vaul-snap-points={\n (context.props.snapPoints?.length ?? 0) > 0 ? \"true\" : \"false\"\n }\n data-vaul-snap-points-overlay={context.shouldFade ? \"true\" : \"false\"}\n data-vaul-animate={context.shouldAnimate ? \"true\" : \"false\"}\n />","data-vaul-snap-points={\n (context.props.snapPoints?.length ?? 0) > 0 ? \"true\" : \"false\"\n }","data-vaul-snap-points-overlay={context.shouldFade ? \"true\" : \"false\"}","<Show when={context.present || props.forceMount === true || forceMount}>\n <ContentElement {...props} />\n </Show>","<h2 id={context.titleId} {...props} />","<p id={context.descriptionId} {...props} />","<div\n {...rest}\n data-vaul-handle=\"\"\n aria-hidden=\"true\"\n data-vaul-drawer-visible={context.isOpen ? \"true\" : \"false\"}\n onClick={(event) => {\n callHandler(props.onClick, event);\n\n if (!event.defaultPrevented) {\n cycle();\n }\n }}\n onPointerDown={(event) => {\n callHandler(props.onPointerDown, event);\n\n if (event.defaultPrevented) {\n return;\n }\n\n pressTime = Date.now();\n pressPosition = { x: event.clientX, y: event.clientY };\n moved = false;\n context.press(event, true);\n event.stopPropagation();\n }}\n onPointerMove={(event) => {\n callHandler(props.onPointerMove, event);\n\n if (\n Math.abs(event.clientX - pressPosition.x) > 2 ||\n Math.abs(event.clientY - pressPosition.y) > 2\n ) {\n moved = true;\n }\n }}\n onPointerCancel={(event) => {\n callHandler(props.onPointerCancel, event);\n moved = true;\n context.cancelDrag();\n }}\n >\n <span data-vaul-handle-hitarea=\"\" aria-hidden=\"true\">\n {props.children}\n </span>\n </div>","{props.children}","props.children","<span data-vaul-handle-hitarea=\"\" aria-hidden=\"true\">\n {props.children}\n </span>","data-vaul-drawer-visible={context.isOpen ? \"true\" : \"false\"}","_$ssrElement","_$memo","_$ssrElementAttribute","SolidPortal","_$scope","_$escape","_$ssr"],"sources":["../../src/context.ts","../../src/constants.ts","../../src/helpers.ts","../../src/create-background.ts","../../src/create-snap-points.ts","../../src/create-drawer.ts","../../src/create-layer.ts","../../src/create-position.ts","../../src/drawer.tsx","../../src/index.ts"],"sourcesContent":["/*\n * Derived from Vaul (https://github.com/emilkowalski/vaul): src/context.ts.\n * Copyright (c) 2023 Emil Kowalski\n * Modified for Solid Aria: native Solid 2 contexts, reactive getters, and callback refs.\n * MIT licensed. See LICENSE, VAUL-LICENSE, and NOTICE.txt in the package root.\n */\n\nimport { createContext } from \"solid-js\";\n\nimport type { DialogProps, DrawerDirection, SnapPoint } from \"./types\";\n\nexport interface DrawerContextValue {\n readonly props: DialogProps;\n readonly isOpen: boolean;\n readonly present: boolean;\n readonly shouldAnimate: boolean;\n readonly direction: DrawerDirection;\n readonly modal: boolean;\n readonly dismissible: boolean;\n readonly contentId: string;\n readonly titleId: string;\n readonly descriptionId: string;\n readonly content: HTMLDivElement | null;\n readonly overlay: HTMLDivElement | null;\n readonly trigger: HTMLButtonElement | null;\n readonly activeSnapPoint: SnapPoint | null;\n readonly activeSnapPointIndex: number;\n readonly snapPointsOffset: readonly number[];\n readonly shouldFade: boolean;\n readonly isDragging: boolean;\n readonly dragProgress: number;\n readonly childOpen: boolean;\n setContent: (element: HTMLDivElement | null) => void;\n setOverlay: (element: HTMLDivElement | null) => void;\n setTrigger: (element: HTMLButtonElement | null) => void;\n setActiveSnapPoint: (point: SnapPoint | null) => void;\n setOpen: (open: boolean) => void;\n close: () => void;\n press: (event: PointerEvent, fromHandle?: boolean) => void;\n drag: (event: PointerEvent) => void;\n release: (event: PointerEvent) => void;\n cancelDrag: () => void;\n setChildOpen: (open: boolean) => void;\n setChildProgress: (progress: number) => void;\n}\n\nexport const DrawerContext = createContext<DrawerContextValue>();\nexport const PortalContext = createContext(false);\n","/*\n * Derived from Vaul (https://github.com/emilkowalski/vaul): src/constants.ts.\n * Copyright (c) 2023 Emil Kowalski\n * Modified for Solid Aria: preserved drawer animation and gesture constants.\n * MIT licensed. See LICENSE, VAUL-LICENSE, and NOTICE.txt in the package root.\n */\n\nexport const TRANSITIONS = {\n DURATION: 0.5,\n EASE: [0.32, 0.72, 0, 1],\n};\n\nexport const VELOCITY_THRESHOLD = 0.4;\n\nexport const CLOSE_THRESHOLD = 0.25;\n\nexport const SCROLL_LOCK_TIMEOUT = 100;\n\nexport const BORDER_RADIUS = 8;\n\nexport const NESTED_DISPLACEMENT = 16;\n\nexport const WINDOW_TOP_OFFSET = 26;\n\nexport const DRAG_CLASS = \"vaul-dragging\";\n","/*\n * Derived from Vaul (https://github.com/emilkowalski/vaul): src/helpers.ts and src/browser.ts.\n * Copyright (c) 2023 Emil Kowalski\n * Modified for Solid Aria: typed geometry and property-scoped style restoration without shared style caches.\n * MIT licensed. See LICENSE, VAUL-LICENSE, and NOTICE.txt in the package root.\n */\n\nimport type { DrawerDirection } from \"./types\";\n\nexport function isVertical(direction: DrawerDirection): boolean {\n return direction === \"top\" || direction === \"bottom\";\n}\n\nexport function directionSign(direction: DrawerDirection): 1 | -1 {\n return direction === \"bottom\" || direction === \"right\" ? 1 : -1;\n}\n\nexport function translate(\n distance: number,\n direction: DrawerDirection\n): string {\n return isVertical(direction)\n ? `translate3d(0, ${distance}px, 0)`\n : `translate3d(${distance}px, 0, 0)`;\n}\n\nexport function dampenValue(value: number): number {\n return Math.max(0, 8 * (Math.log(value + 1) - 2));\n}\n\nexport function clamp(value: number, min = 0, max = 1): number {\n return Math.min(max, Math.max(min, value));\n}\n\n/** Restore only the properties this operation owns, including priorities. */\nexport function assignStyle(\n element: HTMLElement,\n styles: Record<string, string>\n): () => void {\n const previous = Object.keys(styles).map((property) => ({\n priority: element.style.getPropertyPriority(property),\n property,\n value: element.style.getPropertyValue(property),\n }));\n\n for (const [property, value] of Object.entries(styles)) {\n element.style.setProperty(property, value);\n }\n\n return () => {\n for (const { property, value, priority } of previous) {\n if (value) {\n element.style.setProperty(property, value, priority);\n } else {\n element.style.removeProperty(property);\n }\n }\n };\n}\n\nexport function isSafari(view: Window): boolean {\n return /^(?:(?!chrome|android).)*safari/iu.test(view.navigator.userAgent);\n}\n\nexport function canScroll(\n target: HTMLElement,\n content: HTMLElement,\n direction: DrawerDirection,\n distance: number\n): boolean {\n const vertical = isVertical(direction);\n const forward = distance * directionSign(direction) < 0;\n\n for (\n let node: HTMLElement | null = target;\n node && content.contains(node);\n node = node.parentElement\n ) {\n const scrollSize = vertical ? node.scrollHeight : node.scrollWidth;\n const size = vertical ? node.clientHeight : node.clientWidth;\n\n if (scrollSize <= size) {\n continue;\n }\n\n const position = vertical ? node.scrollTop : node.scrollLeft;\n\n if (\n (forward && position < scrollSize - size) ||\n (!forward && position > 0)\n ) {\n return true;\n }\n }\n\n return false;\n}\n","/*\n * Derived from Vaul (https://github.com/emilkowalski/vaul): src/use-scale-background.ts and src/index.tsx.\n * Copyright (c) 2023 Emil Kowalski\n * Modified for Solid Aria: Solid 2 effects, document-local scaling, drag interpolation, and complete style cleanup.\n * MIT licensed. See LICENSE, VAUL-LICENSE, and NOTICE.txt in the package root.\n */\n\nimport { createEffect } from \"solid-js\";\n\nimport { BORDER_RADIUS, TRANSITIONS, WINDOW_TOP_OFFSET } from \"./constants\";\nimport type { DrawerContextValue } from \"./context\";\nimport { assignStyle, isVertical } from \"./helpers\";\n\nexport function createBackground(context: DrawerContextValue): void {\n let background: HTMLElement | null = null;\n let initialScale = 1;\n let vertical = true;\n createEffect(\n () => ({\n color:\n context.props.setBackgroundColorOnScale !== false &&\n context.props.noBodyStyles !== true,\n direction: context.direction,\n element: context.content,\n enabled: context.props.shouldScaleBackground === true,\n nested: context.props.nested === true,\n open: context.isOpen,\n }),\n ({\n element,\n open,\n enabled,\n color,\n direction,\n nested,\n }): undefined | (() => void) => {\n if (!element || !open || !enabled || nested) {\n return undefined;\n }\n\n const doc = element.ownerDocument;\n\n const wrapper = doc.querySelector<HTMLElement>(\n \"[data-vaul-drawer-wrapper], [vaul-drawer-wrapper]\"\n );\n\n const view = doc.defaultView;\n\n if (!wrapper || !view) {\n return undefined;\n }\n\n background = wrapper;\n initialScale = (view.innerWidth - WINDOW_TOP_OFFSET) / view.innerWidth;\n vertical = isVertical(direction);\n\n const restoreBody = color\n ? assignStyle(doc.body, { background: \"black\" })\n : undefined;\n\n const restoreWrapper = assignStyle(wrapper, {\n \"border-radius\": `${BORDER_RADIUS}px`,\n overflow: \"hidden\",\n transform: `scale(${initialScale}) ${vertical ? \"translate3d(0, 14px, 0)\" : \"translate3d(14px, 0, 0)\"}`,\n \"transform-origin\": vertical ? \"top\" : \"left\",\n \"transition-duration\": `${TRANSITIONS.DURATION}s`,\n \"transition-property\": \"transform, border-radius\",\n \"transition-timing-function\": `cubic-bezier(${TRANSITIONS.EASE.join(\",\")})`,\n });\n\n return () => {\n background = null;\n restoreWrapper();\n restoreBody?.();\n };\n },\n { ssrSource: \"client\" }\n );\n createEffect(\n () => ({\n dragging: context.isDragging,\n element: context.content,\n open: context.isOpen,\n progress: context.dragProgress,\n }),\n ({ progress, dragging, open }) => {\n if (!background || !open) {\n return;\n }\n\n const scale = initialScale + progress * (1 - initialScale);\n const displacement = 14 * (1 - progress);\n background.style.transitionDuration = dragging\n ? \"0s\"\n : `${TRANSITIONS.DURATION}s`;\n background.style.borderRadius = `${BORDER_RADIUS * (1 - progress)}px`;\n background.style.transform = `scale(${scale}) ${vertical ? `translate3d(0, ${displacement}px, 0)` : `translate3d(${displacement}px, 0, 0)`}`;\n },\n { ssrSource: \"client\" }\n );\n}\n","/*\n * Derived from Vaul (https://github.com/emilkowalski/vaul): src/use-snap-points.ts.\n * Copyright (c) 2023 Emil Kowalski\n * Modified for Solid Aria: pure snap geometry and selection, bounded sequential swipes, and container dimensions.\n * MIT licensed. See LICENSE, VAUL-LICENSE, and NOTICE.txt in the package root.\n */\n\nimport { VELOCITY_THRESHOLD } from \"./constants\";\nimport { clamp, directionSign } from \"./helpers\";\nimport type { DrawerDirection, SnapPoint } from \"./types\";\n\nexport function getSnapPointOffsets(\n points: readonly SnapPoint[],\n dimension: number,\n direction: DrawerDirection\n): number[] {\n return points.map((point) => {\n const visible =\n typeof point === \"number\"\n ? point * dimension\n : Number(point.replace(/px$/u, \"\"));\n\n return (dimension - visible) * directionSign(direction);\n });\n}\n\nexport function getOverlayOpacity(\n offsets: readonly number[],\n offset: number,\n fadeFromIndex: number,\n dimension: number\n): number {\n const faded = Math.abs(offsets[fadeFromIndex] ?? 0);\n\n const clear =\n fadeFromIndex === 0\n ? dimension\n : Math.abs(offsets[fadeFromIndex - 1] ?? faded);\n\n if (clear === faded) {\n return offset <= faded ? 1 : 0;\n }\n\n return clamp((clear - offset) / (clear - faded));\n}\n\nexport function selectSnapPoint(options: {\n offsets: readonly number[];\n activeIndex: number;\n /** Positive distance moves toward the closed edge. */\n distance: number;\n velocity: number;\n dimension: number;\n dismissible: boolean;\n sequential: boolean;\n}): number | \"close\" {\n const {\n offsets,\n activeIndex,\n distance,\n velocity,\n dimension,\n dismissible,\n sequential,\n } = options;\n\n const [first] = offsets;\n\n if (first === undefined) {\n return activeIndex;\n }\n\n const active = Math.abs(offsets[activeIndex] ?? first);\n const position = active + distance;\n\n if (!sequential && velocity > 2) {\n if (distance <= 0) {\n return offsets.length - 1;\n }\n\n return dismissible ? \"close\" : 0;\n }\n\n if (velocity > VELOCITY_THRESHOLD && Math.abs(distance) < dimension * 0.4) {\n if (distance > 0 && activeIndex === 0 && dismissible) {\n return \"close\";\n }\n\n return clamp(activeIndex + (distance > 0 ? -1 : 1), 0, offsets.length - 1);\n }\n\n const remaining = dimension - Math.abs(first);\n\n if (\n dismissible &&\n distance > 0 &&\n position > Math.abs(first) + remaining / 2\n ) {\n return \"close\";\n }\n\n let closest = 0;\n let difference = Infinity;\n\n for (const [index, offset] of offsets.entries()) {\n if (sequential && Math.abs(index - activeIndex) > 1) {\n continue;\n }\n\n const nextDifference = Math.abs(Math.abs(offset) - position);\n\n if (nextDifference < difference) {\n difference = nextDifference;\n closest = index;\n }\n }\n\n return closest;\n}\n","/*\n * Derived from Vaul (https://github.com/emilkowalski/vaul): src/index.tsx.\n * Copyright (c) 2023 Emil Kowalski\n * Modified for Solid Aria: native Solid 2 controlled state, presence, pointer gestures, measured snap-point entry, nested transforms, and lifecycle.\n * MIT licensed. See LICENSE, VAUL-LICENSE, and NOTICE.txt in the package root.\n */\n\nimport {\n createEffect,\n createMemo,\n createSignal,\n createUniqueId,\n onSettled,\n untrack,\n} from \"solid-js\";\n\nimport {\n CLOSE_THRESHOLD,\n DRAG_CLASS,\n NESTED_DISPLACEMENT,\n SCROLL_LOCK_TIMEOUT,\n TRANSITIONS,\n VELOCITY_THRESHOLD,\n} from \"./constants\";\nimport type { DrawerContextValue } from \"./context\";\nimport {\n getOverlayOpacity,\n getSnapPointOffsets,\n selectSnapPoint,\n} from \"./create-snap-points\";\nimport {\n canScroll,\n clamp,\n dampenValue,\n directionSign,\n isVertical,\n translate,\n} from \"./helpers\";\nimport type { DialogProps, SnapPoint } from \"./types\";\n\nconst transition = `${TRANSITIONS.DURATION}s cubic-bezier(${TRANSITIONS.EASE.join(\",\")})`;\n\ninterface Gesture {\n x: number;\n y: number;\n startedAt: number;\n dimension: number;\n startOffset: number;\n distance: number;\n allowed: boolean;\n fromHandle: boolean;\n pointerId: number;\n target: HTMLElement;\n}\n\nexport function createDrawer(\n props: DialogProps,\n parent?: DrawerContextValue\n): DrawerContextValue {\n const [internalOpen, setInternalOpen] = createSignal(\n untrack(() => props.defaultOpen ?? false)\n );\n\n const isOpen = createMemo(() => props.open ?? internalOpen());\n const [present, setPresent] = createSignal(untrack(isOpen));\n\n const [animate, setAnimate] = createSignal(\n untrack(() => props.defaultOpen !== true)\n );\n\n const [internalSnap, setInternalSnap] = createSignal<SnapPoint | null>(\n untrack(() => props.snapPoints?.[0] ?? null)\n );\n\n const activeSnap = createMemo(() =>\n props.activeSnapPoint === undefined ? internalSnap() : props.activeSnapPoint\n );\n\n const [content, setContent] = createSignal<HTMLDivElement | null>(null, {\n ownedWrite: true,\n });\n\n const [overlay, setOverlay] = createSignal<HTMLDivElement | null>(null, {\n ownedWrite: true,\n });\n\n const [trigger, setTrigger] = createSignal<HTMLButtonElement | null>(null, {\n ownedWrite: true,\n });\n\n const [dimension, setDimension] = createSignal(0);\n const [dragging, setDragging] = createSignal(false);\n const [dragProgress, setDragProgress] = createSignal(0);\n const [childOpen, setChildOpen] = createSignal(false);\n const [childProgress, setChildProgress] = createSignal(0);\n const direction = () => props.direction ?? \"bottom\";\n const points = () => props.snapPoints ?? [];\n\n const offsets = createMemo(() =>\n getSnapPointOffsets(points(), dimension(), direction())\n );\n\n const activeIndex = createMemo(() =>\n Math.max(0, points().indexOf(activeSnap() ?? points()[0] ?? 0))\n );\n\n const offset = () => offsets()[activeIndex()] ?? 0;\n\n const fadeFromIndex = () =>\n props.fadeFromIndex ?? Math.max(0, points().length - 1);\n\n const id = createUniqueId();\n let gesture: Gesture | null = null;\n let lastScrollTime = -Infinity;\n let openedAt = -Infinity;\n\n const onScroll = () => {\n lastScrollTime = Date.now();\n };\n\n function setOpen(open: boolean): void {\n if (open === isOpen()) {\n return;\n }\n\n if (props.open === undefined) {\n setInternalOpen(open);\n }\n\n props.onOpenChange?.(open);\n }\n\n function setActiveSnapPoint(point: SnapPoint | null): void {\n if (point === activeSnap()) {\n return;\n }\n\n if (props.activeSnapPoint === undefined) {\n setInternalSnap(point);\n }\n\n props.setActiveSnapPoint?.(point);\n }\n\n function resetPosition(): void {\n const element = content();\n\n if (!element) {\n return;\n }\n\n element.classList.remove(DRAG_CLASS);\n element.style.transition = `transform ${transition}`;\n element.style.transform = translate(offset(), direction());\n const backdrop = overlay();\n\n if (backdrop) {\n backdrop.style.transition = `opacity ${transition}`;\n backdrop.style.opacity = points().length\n ? `${getOverlayOpacity(offsets(), Math.abs(offset()), fadeFromIndex(), dimension())}`\n : \"1\";\n }\n }\n\n function cancelDrag(): void {\n if (!gesture) {\n return;\n }\n\n if (gesture.target.hasPointerCapture?.(gesture.pointerId)) {\n gesture.target.releasePointerCapture(gesture.pointerId);\n }\n\n gesture = null;\n setDragging(false);\n setDragProgress(0);\n untrack(resetPosition);\n parent?.setChildProgress(0);\n }\n\n function close(): void {\n cancelDrag();\n\n if (props.dismissible !== false) {\n setOpen(false);\n }\n }\n\n createEffect(\n isOpen,\n (open, previous): undefined | (() => void) => {\n if (open) {\n openedAt = Date.now();\n setPresent(true);\n } else {\n cancelDrag();\n\n if (previous === true) {\n props.onClose?.();\n }\n }\n\n parent?.setChildOpen(open);\n\n if (previous === undefined && !open) {\n return undefined;\n }\n\n const view = untrack(content)?.ownerDocument.defaultView;\n\n const duration =\n view?.matchMedia(\"(prefers-reduced-motion: reduce)\").matches === true\n ? 0\n : TRANSITIONS.DURATION * 1000;\n\n const timer = setTimeout(() => {\n if (!open) {\n setPresent(false);\n setActiveSnapPoint(points()[0] ?? null);\n }\n\n if (previous !== undefined) {\n props.onAnimationEnd?.(open);\n }\n }, duration);\n\n return () => {\n clearTimeout(timer);\n };\n },\n { ssrSource: \"client\" }\n );\n\n createEffect(\n () => ({\n container: props.container,\n direction: direction(),\n element: content(),\n }),\n ({\n element,\n container,\n direction: currentDirection,\n }): undefined | (() => void) => {\n if (!element) {\n return undefined;\n }\n\n const view = element.ownerDocument.defaultView;\n\n if (!view) {\n return undefined;\n }\n\n const measure = (): void => {\n const rect = container?.getBoundingClientRect();\n setDimension(\n isVertical(currentDirection)\n ? (rect?.height ?? view.innerHeight)\n : (rect?.width ?? view.innerWidth)\n );\n };\n\n measure();\n view.addEventListener(\"resize\", measure);\n\n const observer =\n typeof ResizeObserver === \"undefined\"\n ? undefined\n : new ResizeObserver(measure);\n\n if (container) {\n observer?.observe(container);\n }\n\n element.addEventListener(\"scroll\", onScroll, true);\n\n return () => {\n view.removeEventListener(\"resize\", measure);\n observer?.disconnect();\n element.removeEventListener(\"scroll\", onScroll, true);\n cancelDrag();\n };\n },\n { ssrSource: \"client\" }\n );\n\n createEffect(\n () => ({\n animate: animate(),\n backdrop: overlay(),\n child: childOpen(),\n dimension: dimension(),\n direction: direction(),\n element: content(),\n hasSnapPoints: points().length > 0,\n offset: offset(),\n opacity: points().length\n ? getOverlayOpacity(\n offsets(),\n Math.abs(offset()),\n fadeFromIndex(),\n dimension()\n )\n : 1,\n open: isOpen(),\n progress: childProgress(),\n }),\n ({\n animate: shouldAnimate,\n element,\n backdrop,\n dimension: currentDimension,\n hasSnapPoints,\n open,\n offset: currentOffset,\n child,\n progress,\n direction: currentDirection,\n opacity,\n }) => {\n if (!element || (hasSnapPoints && currentDimension === 0)) {\n return;\n }\n\n const sign = directionSign(currentDirection);\n const view = element.ownerDocument.defaultView;\n\n const size = isVertical(currentDirection)\n ? view?.innerHeight\n : view?.innerWidth;\n\n const scale = child\n ? 1 - (NESTED_DISPLACEMENT / Math.max(1, size ?? 1)) * (1 - progress)\n : 1;\n\n const displacement = child\n ? -NESTED_DISPLACEMENT * (1 - progress) * sign\n : 0;\n\n if (hasSnapPoints && shouldAnimate && element.style.transform === \"\") {\n // Commit the closed position before transitioning to the measured snap point.\n element.getBoundingClientRect();\n }\n\n element.style.transition = shouldAnimate\n ? `transform ${transition}`\n : \"none\";\n element.style.transform = `${translate(open ? currentOffset + displacement : sign * (size ?? currentDimension), currentDirection)} scale(${scale})`;\n\n if (backdrop) {\n backdrop.style.transition = shouldAnimate\n ? `opacity ${transition}`\n : \"none\";\n backdrop.style.opacity = open ? `${opacity}` : \"0\";\n }\n },\n { ssrSource: \"client\" }\n );\n\n onSettled(() => {\n const frame = requestAnimationFrame(() => {\n setAnimate(true);\n });\n\n return () => {\n cancelAnimationFrame(frame);\n parent?.setChildOpen(false);\n };\n });\n\n function press(event: PointerEvent, fromHandle = false): void {\n const element = content();\n const { target } = event;\n\n if (\n !element ||\n !isOpen() ||\n childOpen() ||\n event.defaultPrevented ||\n event.button > 0\n ) {\n return;\n }\n\n if (\n !(target instanceof HTMLElement) ||\n target.closest(\"[data-vaul-drawer]\") !== element\n ) {\n return;\n }\n\n if (\n target.closest(\"[data-vaul-no-drag],select,option\") ||\n (props.handleOnly === true && !fromHandle)\n ) {\n return;\n }\n\n if (props.dismissible === false && !points().length) {\n return;\n }\n\n const rect = element.getBoundingClientRect();\n gesture = {\n allowed: false,\n dimension: isVertical(direction()) ? rect.height : rect.width,\n distance: 0,\n fromHandle,\n pointerId: event.pointerId,\n startOffset: Math.abs(offset()),\n startedAt: Date.now(),\n target,\n x: event.clientX,\n y: event.clientY,\n };\n }\n\n function canDrag(target: HTMLElement, distance: number): boolean {\n if (!gesture || target.closest(\"[data-vaul-no-drag],select,option\")) {\n return false;\n }\n\n if (gesture.fromHandle) {\n return true;\n }\n\n if ((target.ownerDocument.getSelection()?.toString().length ?? 0) > 0) {\n return false;\n }\n\n if (Date.now() - openedAt < TRANSITIONS.DURATION * 1000) {\n return false;\n }\n\n if (\n Date.now() - lastScrollTime <\n (props.scrollLockTimeout ?? SCROLL_LOCK_TIMEOUT)\n ) {\n return false;\n }\n\n const lastOffset = Math.abs(offsets().at(-1) ?? 0);\n\n if (distance < 0 && gesture.startOffset > lastOffset) {\n return true;\n }\n\n const element = content();\n\n return (\n element !== null && !canScroll(target, element, direction(), distance)\n );\n }\n\n function claimGesture(\n event: PointerEvent,\n current: Gesture,\n axis: number,\n cross: number,\n distance: number\n ): boolean {\n if (current.allowed) {\n return true;\n }\n\n const threshold = event.pointerType === \"touch\" ? 10 : 2;\n\n if (Math.abs(axis) < threshold && Math.abs(cross) < threshold) {\n return false;\n }\n\n if (Math.abs(cross) > Math.abs(axis)) {\n gesture = null;\n\n return false;\n }\n\n if (!canDrag(current.target, distance)) {\n return false;\n }\n\n current.allowed = true;\n current.target.setPointerCapture?.(event.pointerId);\n setDragging(true);\n\n return true;\n }\n\n function drag(event: PointerEvent): void {\n const current = gesture;\n const element = content();\n\n if (!current || !element || current.pointerId !== event.pointerId) {\n return;\n }\n\n const dx = event.clientX - current.x;\n const dy = event.clientY - current.y;\n const vertical = isVertical(direction());\n const axis = vertical ? dy : dx;\n const cross = vertical ? dx : dy;\n const distance = axis * directionSign(direction());\n\n if (!claimGesture(event, current, axis, cross, distance)) {\n return;\n }\n\n event.preventDefault();\n const minimum = Math.abs(offsets().at(-1) ?? 0);\n let position = current.startOffset + distance;\n\n if (position < minimum) {\n position = minimum - dampenValue(minimum - position);\n }\n\n if (props.dismissible === false) {\n position = Math.min(position, Math.abs(offsets()[0] ?? 0));\n }\n\n current.distance = position - current.startOffset;\n element.classList.add(DRAG_CLASS);\n element.style.transition = \"none\";\n element.style.transform = translate(\n position * directionSign(direction()),\n direction()\n );\n\n const percentage = clamp(\n Math.max(0, distance) /\n Math.max(1, current.dimension - current.startOffset)\n );\n\n const backdrop = overlay();\n\n if (backdrop) {\n backdrop.style.transition = \"none\";\n backdrop.style.opacity = points().length\n ? `${getOverlayOpacity(offsets(), position, fadeFromIndex(), dimension())}`\n : `${1 - percentage}`;\n }\n\n setDragProgress(percentage);\n props.onDrag?.(event, percentage);\n parent?.setChildProgress(percentage);\n }\n\n function release(event: PointerEvent): void {\n const current = gesture;\n\n if (!current || event.pointerId !== current.pointerId) {\n return;\n }\n\n const velocity =\n Math.abs(current.distance) / Math.max(1, Date.now() - current.startedAt);\n\n let next: number | \"close\" = activeIndex();\n\n if (current.allowed && points().length) {\n next = selectSnapPoint({\n activeIndex: activeIndex(),\n dimension: dimension(),\n dismissible: props.dismissible !== false,\n distance: current.distance,\n offsets: offsets(),\n sequential: props.snapToSequentialPoint ?? false,\n velocity,\n });\n } else if (\n current.allowed &&\n current.distance > 0 &&\n props.dismissible !== false &&\n (velocity > VELOCITY_THRESHOLD ||\n current.distance >=\n current.dimension * (props.closeThreshold ?? CLOSE_THRESHOLD))\n ) {\n next = \"close\";\n }\n\n cancelDrag();\n\n if (!current.allowed) {\n return;\n }\n\n if (next === \"close\") {\n close();\n } else if (points().length) {\n setActiveSnapPoint(points()[next] ?? null);\n }\n\n props.onRelease?.(event, next !== \"close\");\n }\n\n return {\n get activeSnapPoint() {\n return activeSnap();\n },\n get activeSnapPointIndex() {\n return activeIndex();\n },\n cancelDrag,\n get childOpen() {\n return childOpen();\n },\n close,\n get content() {\n return content();\n },\n contentId: `vaul-${id}`,\n descriptionId: `vaul-${id}-description`,\n get direction() {\n return direction();\n },\n get dismissible() {\n return props.dismissible ?? true;\n },\n drag,\n get dragProgress() {\n return dragProgress();\n },\n get isDragging() {\n return dragging();\n },\n get isOpen() {\n return isOpen();\n },\n get modal() {\n return props.modal ?? true;\n },\n get overlay() {\n return overlay();\n },\n get present() {\n return present();\n },\n press,\n props,\n release,\n setActiveSnapPoint,\n setChildOpen(open) {\n setChildOpen(open);\n setChildProgress(0);\n },\n setChildProgress(progress) {\n setChildProgress(progress);\n },\n setContent(element) {\n setContent(element);\n },\n setOpen,\n setOverlay(element) {\n setOverlay(element);\n },\n setTrigger(element) {\n setTrigger(element);\n },\n get shouldAnimate() {\n return animate();\n },\n get shouldFade() {\n return !points().length || activeIndex() >= fadeFromIndex();\n },\n get snapPointsOffset() {\n return offsets();\n },\n titleId: `vaul-${id}-title`,\n get trigger() {\n return trigger();\n },\n };\n}\n","import { ariaHideOutside } from \"@solid2-aria/core/overlays/aria-hide-outside\";\nimport { createPreventScroll } from \"@solid2-aria/core/overlays/create-prevent-scroll\";\nimport { createEffect, untrack } from \"solid-js\";\n\nimport type { DrawerContextValue } from \"./context\";\nimport type {\n ContentProps,\n FocusOutsideEvent,\n PointerDownOutsideEvent,\n} from \"./types\";\n\nconst layers = new WeakMap<Document, HTMLDivElement[]>();\n\nexport function createLayer(\n context: DrawerContextValue,\n props: ContentProps\n): void {\n createPreventScroll({\n get isDisabled() {\n return (\n !context.isOpen ||\n !context.content ||\n !context.modal ||\n context.props.noBodyStyles === true ||\n (!context.overlay && context.props.disablePreventScroll !== true)\n );\n },\n });\n\n createEffect(\n () => ({\n element: context.content,\n modal: context.modal,\n open: context.isOpen,\n overlay: context.overlay,\n }),\n ({ element, overlay, open, modal }): undefined | (() => void) => {\n if (!element || !open || !modal) {\n return undefined;\n }\n\n return ariaHideOutside(overlay ? [element, overlay] : [element], {\n shouldUseInert: true,\n });\n },\n { ssrSource: \"client\" }\n );\n\n createEffect(\n () => ({ element: context.content, open: context.isOpen }),\n ({ element, open }): undefined | (() => void) => {\n if (!element || !open) {\n return undefined;\n }\n\n const doc = element.ownerDocument;\n const stack = layers.get(doc) ?? [];\n layers.set(doc, stack);\n stack.push(element);\n const previous = doc.activeElement;\n let interactedOutside = false;\n const autoFocus = new Event(\"openAutoFocus\", { cancelable: true });\n props.onOpenAutoFocus?.(autoFocus);\n\n if (!autoFocus.defaultPrevented && context.props.autoFocus === true) {\n const first = element.querySelector<HTMLElement>(\n \"[autofocus],button:not([disabled]),[href],input:not([disabled]),select:not([disabled]),textarea:not([disabled]),[tabindex='0']\"\n );\n\n (first ?? element).focus({ preventScroll: true });\n }\n\n const isTop = () => stack.at(-1) === element;\n\n const isOutside = (event: Event) =>\n !event.composedPath().includes(element);\n\n function pointerDown(event: PointerEvent): void {\n if (!isTop() || !isOutside(event)) {\n return;\n }\n\n const outside: PointerDownOutsideEvent = new CustomEvent(\n \"pointerDownOutside\",\n {\n cancelable: true,\n detail: { originalEvent: event },\n }\n );\n\n props.onPointerDownOutside?.(outside);\n props.onInteractOutside?.(outside);\n\n if (\n outside.defaultPrevented ||\n !context.modal ||\n event.button > 0 ||\n event.ctrlKey\n ) {\n return;\n }\n\n interactedOutside = !context.modal;\n context.close();\n }\n\n function focusIn(event: FocusEvent): void {\n if (!isTop() || !isOutside(event)) {\n return;\n }\n\n const outside: FocusOutsideEvent = new CustomEvent(\"focusOutside\", {\n cancelable: true,\n detail: { originalEvent: event },\n });\n\n props.onFocusOutside?.(outside);\n props.onInteractOutside?.(outside);\n\n if (!context.modal) {\n interactedOutside = true;\n }\n }\n\n function keyDown(event: KeyboardEvent): void {\n if (event.key !== \"Escape\" || !isTop() || event.defaultPrevented) {\n return;\n }\n\n props.onEscapeKeyDown?.(event);\n\n if (event.defaultPrevented) {\n return;\n }\n\n event.preventDefault();\n context.close();\n }\n\n doc.addEventListener(\"pointerdown\", pointerDown);\n doc.addEventListener(\"focusin\", focusIn);\n doc.addEventListener(\"keydown\", keyDown);\n\n const touchMove = (event: TouchEvent) => {\n if (element.classList.contains(\"vaul-dragging\") && event.cancelable) {\n event.preventDefault();\n }\n };\n\n element.addEventListener(\"touchmove\", touchMove, { passive: false });\n\n return () => {\n const index = stack.indexOf(element);\n const wasTop = isTop();\n\n if (index !== -1) {\n stack.splice(index, 1);\n }\n\n if (!stack.length) {\n layers.delete(doc);\n }\n\n doc.removeEventListener(\"pointerdown\", pointerDown);\n doc.removeEventListener(\"focusin\", focusIn);\n doc.removeEventListener(\"keydown\", keyDown);\n element.removeEventListener(\"touchmove\", touchMove);\n\n const closeAutoFocus = new Event(\"closeAutoFocus\", {\n cancelable: true,\n });\n\n props.onCloseAutoFocus?.(closeAutoFocus);\n\n if (closeAutoFocus.defaultPrevented || interactedOutside || !wasTop) {\n return;\n }\n\n const target = untrack(() => context.trigger) ?? previous;\n queueMicrotask(() => {\n if (target instanceof HTMLElement && target.isConnected) {\n target.focus({ preventScroll: true });\n }\n });\n };\n },\n { ssrSource: \"client\" }\n );\n}\n","/*\n * Derived from Vaul (https://github.com/emilkowalski/vaul): src/use-position-fixed.ts and src/index.tsx.\n * Copyright (c) 2023 Emil Kowalski\n * Modified for Solid Aria: Solid 2 lifecycle, per-drawer style ownership, viewport resizing, and route-aware restoration.\n * MIT licensed. See LICENSE, VAUL-LICENSE, and NOTICE.txt in the package root.\n */\n\nimport { createEffect } from \"solid-js\";\n\nimport { WINDOW_TOP_OFFSET } from \"./constants\";\nimport type { DrawerContextValue } from \"./context\";\nimport { assignStyle, isSafari } from \"./helpers\";\n\nexport function createPosition(context: DrawerContextValue): void {\n createEffect(\n () => ({\n element: context.content,\n modal: context.modal,\n nested: context.props.nested === true,\n noBodyStyles: context.props.noBodyStyles === true,\n open: context.isOpen,\n preventScrollRestoration: context.props.preventScrollRestoration === true,\n }),\n ({\n element,\n open,\n modal,\n noBodyStyles,\n nested,\n preventScrollRestoration,\n }): undefined | (() => void) => {\n if (!element || !open || !modal || noBodyStyles || nested) {\n return undefined;\n }\n\n const doc = element.ownerDocument;\n const view = doc.defaultView;\n\n if (\n !view ||\n !isSafari(view) ||\n view.matchMedia(\"(display-mode: standalone)\").matches\n ) {\n return undefined;\n }\n\n const { scrollX, scrollY } = view;\n const url = view.location.href;\n\n const restore = assignStyle(doc.body, {\n height: \"auto\",\n left: `${-scrollX}px`,\n position: \"fixed\",\n right: \"0\",\n top: `${-scrollY}px`,\n });\n\n return () => {\n restore();\n\n if (!preventScrollRestoration || url === view.location.href) {\n view.scrollTo(scrollX, scrollY);\n }\n };\n },\n { ssrSource: \"client\" }\n );\n\n createEffect(\n () => ({\n direction: context.direction,\n element: context.content,\n fixed: context.props.fixed === true,\n open: context.isOpen,\n reposition: context.props.repositionInputs !== false,\n }),\n ({\n element,\n open,\n reposition,\n fixed,\n direction,\n }): undefined | (() => void) => {\n if (!element || !open || !reposition || direction !== \"bottom\") {\n return undefined;\n }\n\n const doc = element.ownerDocument;\n const view = doc.defaultView;\n const viewport = view?.visualViewport;\n\n if (!view || !viewport) {\n return undefined;\n }\n\n const { height } = element.style;\n const { bottom } = element.style;\n let keyboardOpen = false;\n const initialHeight = element.getBoundingClientRect().height;\n\n const resize = (): void => {\n const focused = doc.activeElement;\n\n if (\n !keyboardOpen &&\n (!(focused instanceof HTMLElement) ||\n !element.contains(focused) ||\n !focused.matches(\"input,textarea,[contenteditable]\"))\n ) {\n return;\n }\n\n const diff = Math.max(\n 0,\n view.innerHeight - viewport.height - viewport.offsetTop\n );\n\n keyboardOpen = diff > 60;\n\n if (!keyboardOpen) {\n element.style.height = height;\n element.style.bottom = bottom;\n\n return;\n }\n\n const rect = element.getBoundingClientRect();\n\n const available = Math.max(\n 0,\n viewport.height - Math.max(WINDOW_TOP_OFFSET, rect.top)\n );\n\n element.style.height = `${fixed ? Math.max(0, initialHeight - diff) : available}px`;\n element.style.bottom = `${diff}px`;\n\n if (focused instanceof HTMLElement) {\n focused.scrollIntoView({ block: \"nearest\" });\n }\n };\n\n viewport.addEventListener(\"resize\", resize);\n viewport.addEventListener(\"scroll\", resize);\n\n return () => {\n viewport.removeEventListener(\"resize\", resize);\n viewport.removeEventListener(\"scroll\", resize);\n element.style.height = height;\n element.style.bottom = bottom;\n };\n },\n { ssrSource: \"client\" }\n );\n}\n","/*\n * Derived from Vaul (https://github.com/emilkowalski/vaul): src/index.tsx.\n * Copyright (c) 2023 Emil Kowalski\n * Modified for Solid Aria: Solid 2 components, contexts, callback refs, portals, presence, and native DOM event composition.\n * MIT licensed. See LICENSE, VAUL-LICENSE, and NOTICE.txt in the package root.\n */\n\nimport { FocusScope } from \"@solid2-aria/core/focus/focus-scope\";\nimport { Portal as SolidPortal } from \"@solidjs/web\";\nimport type { JSX } from \"@solidjs/web\";\nimport {\n createSignal,\n merge,\n omit,\n onSettled,\n Show,\n useContext,\n} from \"solid-js\";\n\nimport { DrawerContext, PortalContext } from \"./context\";\nimport { createBackground } from \"./create-background\";\nimport { createDrawer } from \"./create-drawer\";\nimport { createLayer } from \"./create-layer\";\nimport { createPosition } from \"./create-position\";\nimport type {\n CloseProps,\n ContentProps,\n DescriptionProps,\n DialogProps,\n HandleProps,\n OverlayProps,\n PortalProps,\n TitleProps,\n TriggerProps,\n} from \"./types\";\n\nexport function Root(props: DialogProps): JSX.Element {\n const context = createDrawer(props);\n createBackground(context);\n createPosition(context);\n\n return <DrawerContext value={context}>{props.children}</DrawerContext>;\n}\n\nexport function NestedRoot(props: DialogProps): JSX.Element {\n const parent = useContext(DrawerContext);\n const context = createDrawer(merge(props, { nested: true }), parent);\n createPosition(context);\n\n return <DrawerContext value={context}>{props.children}</DrawerContext>;\n}\n\nexport function Portal(props: PortalProps): JSX.Element {\n const context = useContext(DrawerContext);\n const [mounted, setMounted] = createSignal(false);\n onSettled(() => {\n setMounted(true);\n });\n\n return (\n <Show when={mounted() && (context.present || props.forceMount === true)}>\n <SolidPortal\n mount={props.container ?? context.props.container ?? document.body}\n >\n <PortalContext value={props.forceMount ?? false}>\n {props.children}\n </PortalContext>\n </SolidPortal>\n </Show>\n );\n}\n\nexport function Trigger(props: TriggerProps): JSX.Element {\n const context = useContext(DrawerContext);\n\n const attributes = merge(omit(props, \"render\", \"ref\", \"onClick\"), {\n \"aria-controls\": context.contentId,\n get \"aria-expanded\"(): \"true\" | \"false\" {\n return context.isOpen ? \"true\" : \"false\";\n },\n \"aria-haspopup\": \"dialog\" as const,\n get \"data-state\"() {\n return context.isOpen ? \"open\" : \"closed\";\n },\n onClick(\n event: Parameters<JSX.EventHandler<HTMLButtonElement, MouseEvent>>[0]\n ) {\n callHandler(props.onClick, event);\n\n if (!event.defaultPrevented) {\n context.setOpen(!context.isOpen);\n }\n },\n get ref() {\n return [\n props.ref,\n (element: HTMLButtonElement) => {\n context.setTrigger(element);\n },\n ];\n },\n get type() {\n return props.type ?? \"button\";\n },\n });\n\n return (\n <Show when={props.render} keyed fallback={<button {...attributes} />}>\n {(render) => render(attributes)}\n </Show>\n );\n}\n\nexport function Close(props: CloseProps): JSX.Element {\n const context = useContext(DrawerContext);\n\n const attributes = merge(omit(props, \"render\", \"onClick\"), {\n onClick(\n event: Parameters<JSX.EventHandler<HTMLButtonElement, MouseEvent>>[0]\n ) {\n callHandler(props.onClick, event);\n\n if (!event.defaultPrevented) {\n context.close();\n }\n },\n get type() {\n return props.type ?? \"button\";\n },\n });\n\n return (\n <Show when={props.render} keyed fallback={<button {...attributes} />}>\n {(render) => render(attributes)}\n </Show>\n );\n}\n\nexport function Overlay(props: OverlayProps): JSX.Element {\n const context = useContext(DrawerContext);\n const forceMount = useContext(PortalContext);\n\n return (\n <Show\n when={\n context.modal &&\n (context.present || props.forceMount === true || forceMount)\n }\n >\n <OverlayElement {...props} />\n </Show>\n );\n}\n\nfunction OverlayElement(props: OverlayProps): JSX.Element {\n const context = useContext(DrawerContext);\n const rest = omit(props, \"forceMount\", \"ref\");\n onSettled(() => () => {\n context.setOverlay(null);\n });\n\n return (\n <div\n {...rest}\n ref={[\n props.ref,\n (element) => {\n context.setOverlay(element);\n },\n ]}\n data-vaul-overlay=\"\"\n data-state={context.isOpen ? \"open\" : \"closed\"}\n data-vaul-snap-points={\n (context.props.snapPoints?.length ?? 0) > 0 ? \"true\" : \"false\"\n }\n data-vaul-snap-points-overlay={context.shouldFade ? \"true\" : \"false\"}\n data-vaul-animate={context.shouldAnimate ? \"true\" : \"false\"}\n />\n );\n}\n\nexport function Content(props: ContentProps): JSX.Element {\n const context = useContext(DrawerContext);\n const forceMount = useContext(PortalContext);\n\n return (\n <Show when={context.present || props.forceMount === true || forceMount}>\n <ContentElement {...props} />\n </Show>\n );\n}\n\nfunction ContentElement(props: ContentProps): JSX.Element {\n const context = useContext(DrawerContext);\n\n const rest = omit(\n props,\n \"forceMount\",\n \"ref\",\n \"onOpenAutoFocus\",\n \"onCloseAutoFocus\",\n \"onEscapeKeyDown\",\n \"onPointerDownOutside\",\n \"onFocusOutside\",\n \"onInteractOutside\",\n \"onPointerDown\",\n \"onPointerMove\",\n \"onPointerUp\",\n \"onPointerCancel\",\n \"onLostPointerCapture\"\n );\n\n createLayer(context, props);\n onSettled(() => () => {\n context.setContent(null);\n });\n\n return (\n <FocusScope contain={context.isOpen && context.modal && !context.childOpen}>\n <div\n id={context.contentId}\n role=\"dialog\"\n aria-modal={context.modal ? \"true\" : undefined}\n aria-labelledby={context.titleId}\n aria-describedby={context.descriptionId}\n tabindex={-1}\n {...rest}\n ref={[\n props.ref,\n (element) => {\n context.setContent(element);\n },\n ]}\n data-state={context.isOpen ? \"open\" : \"closed\"}\n data-vaul-drawer=\"\"\n data-vaul-drawer-direction={context.direction}\n data-vaul-custom-container={context.props.container ? \"true\" : \"false\"}\n data-vaul-snap-points={\n (context.props.snapPoints?.length ?? 0) > 0 ? \"true\" : \"false\"\n }\n data-vaul-delayed-snap-points={\n context.snapPointsOffset.length > 0 ? \"true\" : \"false\"\n }\n data-vaul-handle-only={\n context.props.handleOnly === true ? \"true\" : \"false\"\n }\n data-vaul-animate={context.shouldAnimate ? \"true\" : \"false\"}\n onPointerDown={(event) => {\n callHandler(props.onPointerDown, event);\n context.press(event);\n }}\n onPointerMove={(event) => {\n callHandler(props.onPointerMove, event);\n\n if (!event.defaultPrevented) {\n context.drag(event);\n }\n }}\n onPointerUp={(event) => {\n callHandler(props.onPointerUp, event);\n context.release(event);\n }}\n onPointerCancel={(event) => {\n callHandler(props.onPointerCancel, event);\n context.cancelDrag();\n }}\n onLostPointerCapture={(event) => {\n callHandler(props.onLostPointerCapture, event);\n context.cancelDrag();\n }}\n />\n </FocusScope>\n );\n}\n\nexport function Title(props: TitleProps): JSX.Element {\n const context = useContext(DrawerContext);\n\n return <h2 id={context.titleId} {...props} />;\n}\n\nexport function Description(props: DescriptionProps): JSX.Element {\n const context = useContext(DrawerContext);\n\n return <p id={context.descriptionId} {...props} />;\n}\n\nexport function Handle(props: HandleProps): JSX.Element {\n const context = useContext(DrawerContext);\n\n const rest = omit(\n props,\n \"preventCycle\",\n \"children\",\n \"onClick\",\n \"onPointerDown\",\n \"onPointerMove\",\n \"onPointerCancel\"\n );\n\n let pressTime = 0;\n let pressPosition = { x: 0, y: 0 };\n let moved = false;\n let lastClick = -Infinity;\n\n function cycle(): void {\n if (\n props.preventCycle === true ||\n moved ||\n Date.now() - pressTime > 250 ||\n Date.now() - lastClick < 120\n ) {\n return;\n }\n\n lastClick = Date.now();\n const points = context.props.snapPoints;\n\n if (!points || points.length === 0) {\n context.close();\n\n return;\n }\n\n const next = points[context.activeSnapPointIndex + 1];\n\n if (next !== undefined) {\n context.setActiveSnapPoint(next);\n } else if (context.dismissible) {\n context.close();\n } else {\n context.setActiveSnapPoint(points[0] ?? null);\n }\n }\n\n return (\n <div\n {...rest}\n data-vaul-handle=\"\"\n aria-hidden=\"true\"\n data-vaul-drawer-visible={context.isOpen ? \"true\" : \"false\"}\n onClick={(event) => {\n callHandler(props.onClick, event);\n\n if (!event.defaultPrevented) {\n cycle();\n }\n }}\n onPointerDown={(event) => {\n callHandler(props.onPointerDown, event);\n\n if (event.defaultPrevented) {\n return;\n }\n\n pressTime = Date.now();\n pressPosition = { x: event.clientX, y: event.clientY };\n moved = false;\n context.press(event, true);\n event.stopPropagation();\n }}\n onPointerMove={(event) => {\n callHandler(props.onPointerMove, event);\n\n if (\n Math.abs(event.clientX - pressPosition.x) > 2 ||\n Math.abs(event.clientY - pressPosition.y) > 2\n ) {\n moved = true;\n }\n }}\n onPointerCancel={(event) => {\n callHandler(props.onPointerCancel, event);\n moved = true;\n context.cancelDrag();\n }}\n >\n <span data-vaul-handle-hitarea=\"\" aria-hidden=\"true\">\n {props.children}\n </span>\n </div>\n );\n}\n\nfunction callHandler<T, E extends Event>(\n handler: JSX.EventHandlerUnion<T, E> | undefined,\n event: Parameters<JSX.EventHandler<T, E>>[0]\n): void {\n if (typeof handler === \"function\") {\n handler(event);\n } else if (handler) {\n handler[0](handler[1], event);\n }\n}\n","import {\n Close,\n Content,\n Description,\n Handle,\n NestedRoot,\n Overlay,\n Portal,\n Root,\n Title,\n Trigger,\n} from \"./drawer\";\n\nexport {\n Close,\n Content,\n Description,\n Handle,\n NestedRoot,\n Overlay,\n Portal,\n Root,\n Title,\n Trigger,\n} from \"./drawer\";\n\nexport type {\n CloseProps,\n ContentProps,\n DescriptionProps,\n DialogProps,\n DrawerDirection,\n DrawerProps,\n FocusOutsideEvent,\n HandleProps,\n InteractOutsideEvent,\n OverlayProps,\n PointerDownOutsideEvent,\n PortalProps,\n SnapPoint,\n TitleProps,\n TriggerProps,\n WithFadeFromProps,\n WithoutFadeFromProps,\n} from \"./types\";\n\nexport const Drawer = {\n Close,\n Content,\n Description,\n Handle,\n NestedRoot,\n Overlay,\n Portal,\n Root,\n Title,\n Trigger,\n};\n"],"mappings":";;;;;;;;;;;;AA8CA,MAAa,gBAAgB,cAAkC;AAC/D,MAAa,gBAAgB,cAAc,KAAK;;ACxChD,MAAa,cAAc;CACzB,UAAU;CACV,MAAM;EAAC;EAAM;EAAM;EAAG;CAAC;AACzB;AAcA,MAAa,aAAa;;ACf1B,SAAgB,WAAW,WAAqC;CAC9D,OAAO,cAAc,SAAS,cAAc;AAC9C;AAEA,SAAgB,cAAc,WAAoC;CAChE,OAAO,cAAc,YAAY,cAAc,UAAU,IAAI;AAC/D;AAEA,SAAgB,UACd,UACA,WACQ;CACR,OAAO,WAAW,SAAS,IACvB,kBAAkB,SAAS,UAC3B,eAAe,SAAS;AAC9B;AAEA,SAAgB,YAAY,OAAuB;CACjD,OAAO,KAAK,IAAI,GAAG,KAAK,KAAK,IAAI,QAAQ,CAAC,IAAI,EAAE;AAClD;AAEA,SAAgB,MAAM,OAAe,MAAM,GAAG,MAAM,GAAW;CAC7D,OAAO,KAAK,IAAI,KAAK,KAAK,IAAI,KAAK,KAAK,CAAC;AAC3C;;AAGA,SAAgB,YACd,SACA,QACY;CACZ,MAAM,WAAW,OAAO,KAAK,MAAM,CAAC,CAAC,KAAK,cAAc;EACtD,UAAU,QAAQ,MAAM,oBAAoB,QAAQ;EACpD;EACA,OAAO,QAAQ,MAAM,iBAAiB,QAAQ;CAChD,EAAE;CAEF,KAAK,MAAM,CAAC,UAAU,UAAU,OAAO,QAAQ,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/vaul",
3
- "version": "0.0.1",
3
+ "version": "0.1.0",
4
4
  "private": false,
5
5
  "description": "Unstyled, draggable drawers for Solid 2, based on Vaul",
6
6
  "keywords": [
@@ -57,21 +57,22 @@
57
57
  "check-browser": "bun scripts/check-browser.ts"
58
58
  },
59
59
  "dependencies": {
60
- "@solid2-aria/core": "^0.0.1"
60
+ "@solid2-aria/core": "^0.1.0"
61
61
  },
62
62
  "devDependencies": {
63
63
  "@playwright/test": "^1.64.1",
64
- "@solidjs/compiler": "^2.0.0-rc.17",
65
- "@solidjs/web": "^2.0.0-rc.17",
64
+ "@solidjs/compiler": "^2.0.0",
65
+ "@solidjs/web": "^2.0.0",
66
66
  "@types/bun": "^1.4.4",
67
67
  "happy-dom": "^21.0.4",
68
- "solid-js": "^2.0.0-rc.17",
68
+ "rolldown-plugin-solid-compiler": "^1.0.0",
69
+ "solid-js": "^2.0.0",
69
70
  "tsdown": "^0.23.2",
70
- "tsrs": "^0.20.0-ts7.1.0-beta",
71
+ "tsrs": "^7.1.0-beta.tsrs3",
71
72
  "typescript": "^7.1.0-beta"
72
73
  },
73
74
  "peerDependencies": {
74
- "@solidjs/web": "^2.0.0-rc.17",
75
- "solid-js": "^2.0.0-rc.17"
75
+ "@solidjs/web": "^2.0.0",
76
+ "solid-js": "^2.0.0"
76
77
  }
77
78
  }