@mhmo91/schmancy 0.9.16 → 0.9.18
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/custom-elements.json +111 -51
- package/dist/agent/schmancy.agent.js +288 -38
- package/dist/agent/schmancy.agent.js.map +1 -1
- package/dist/agent/schmancy.manifest.json +332 -25
- package/dist/breadcrumb.cjs.map +1 -1
- package/dist/breadcrumb.js.map +1 -1
- package/dist/card-BslSqOsf.cjs.map +1 -1
- package/dist/card-CEdgK9nb.js.map +1 -1
- package/dist/details-B8p62xmR.cjs.map +1 -1
- package/dist/details-CCW52lzz.js.map +1 -1
- package/dist/dialog.cjs.map +1 -1
- package/dist/dialog.js.map +1 -1
- package/dist/divider-CbEWg3G_.js.map +1 -1
- package/dist/divider-JyyFw_3J.cjs.map +1 -1
- package/dist/dropdown.cjs.map +1 -1
- package/dist/dropdown.js.map +1 -1
- package/dist/expand-BmwIPNjq.cjs.map +1 -1
- package/dist/expand-bFa_qVDT.js.map +1 -1
- package/dist/handover/agent-runtime-followups.md +1 -1
- package/dist/handover/agent-runtime-v1.md +3 -3
- package/dist/list-BpjKUOzM.js.map +1 -1
- package/dist/list-CMWHu6cV.cjs.map +1 -1
- package/dist/menu-BIBUgS1T.js.map +1 -1
- package/dist/menu-DS8Iz4fJ.cjs.map +1 -1
- package/dist/navigation-rail.cjs.map +1 -1
- package/dist/navigation-rail.js.map +1 -1
- package/dist/page.cjs.map +1 -1
- package/dist/page.js.map +1 -1
- package/dist/scroll-CdmXRXh2.js.map +1 -1
- package/dist/scroll-V1rAZ9fK.cjs.map +1 -1
- package/dist/sheet-DdlZhnDG.cjs.map +1 -1
- package/dist/sheet-LFVo5iN4.js.map +1 -1
- package/dist/src-C7niWYur.js.map +1 -1
- package/dist/src-I4M33WK2.cjs.map +1 -1
- package/dist/surface-0XM4DBaT.js.map +1 -1
- package/dist/surface-B6DA01kL.cjs.map +1 -1
- package/dist/theme-Cq_c9IO3.js.map +1 -1
- package/dist/theme-DU5yXaV-.cjs.map +1 -1
- package/dist/tree.cjs.map +1 -1
- package/dist/tree.js.map +1 -1
- package/package.json +1 -1
- package/src/breadcrumb/breadcrumb.ts +14 -4
- package/src/card/actions.ts +9 -0
- package/src/card/card.ts +18 -0
- package/src/card/content.ts +9 -0
- package/src/card/media.ts +6 -0
- package/src/details/details.ts +12 -0
- package/src/dialog/dialog.component.ts +9 -9
- package/src/divider/divider.ts +11 -0
- package/src/dropdown/dropdown-component.ts +13 -1
- package/src/dropdown/dropdown-content.ts +11 -3
- package/src/expand/expand-root.component.ts +12 -0
- package/src/expand/expand.component.ts +14 -0
- package/src/layout/scroll/scroll.ts +5 -1
- package/src/list/list-item.ts +10 -0
- package/src/list/list.ts +7 -8
- package/src/menu/menu-item.ts +13 -0
- package/src/menu/menu.ts +10 -22
- package/src/nav-drawer/appbar.ts +11 -0
- package/src/nav-drawer/content.ts +11 -0
- package/src/nav-drawer/drawer.ts +15 -0
- package/src/nav-drawer/navbar.ts +14 -0
- package/src/navigation-bar/navigation-bar-item.ts +3 -4
- package/src/navigation-bar/navigation-bar.ts +3 -9
- package/src/navigation-rail/navigation-rail-item.ts +3 -7
- package/src/navigation-rail/navigation-rail.ts +12 -8
- package/src/page/page.ts +8 -11
- package/src/sheet/sheet.ts +17 -0
- package/src/surface/surface.ts +4 -10
- package/src/theme/theme.component.ts +10 -15
- package/src/tree/tree.ts +12 -0
- package/types/src/breadcrumb/breadcrumb.d.ts +14 -4
- package/types/src/card/actions.d.ts +9 -0
- package/types/src/card/card.d.ts +18 -0
- package/types/src/card/content.d.ts +9 -0
- package/types/src/card/media.d.ts +6 -0
- package/types/src/details/details.d.ts +12 -0
- package/types/src/dialog/dialog.component.d.ts +9 -9
- package/types/src/divider/divider.d.ts +11 -0
- package/types/src/dropdown/dropdown-component.d.ts +13 -1
- package/types/src/dropdown/dropdown-content.d.ts +11 -3
- package/types/src/expand/expand-root.component.d.ts +12 -0
- package/types/src/expand/expand.component.d.ts +14 -0
- package/types/src/layout/scroll/scroll.d.ts +5 -1
- package/types/src/list/list-item.d.ts +10 -0
- package/types/src/list/list.d.ts +7 -8
- package/types/src/menu/menu-item.d.ts +13 -0
- package/types/src/menu/menu.d.ts +10 -22
- package/types/src/nav-drawer/appbar.d.ts +11 -0
- package/types/src/nav-drawer/content.d.ts +11 -0
- package/types/src/nav-drawer/drawer.d.ts +15 -0
- package/types/src/nav-drawer/navbar.d.ts +14 -0
- package/types/src/navigation-bar/navigation-bar-item.d.ts +3 -4
- package/types/src/navigation-bar/navigation-bar.d.ts +3 -9
- package/types/src/navigation-rail/navigation-rail-item.d.ts +3 -7
- package/types/src/navigation-rail/navigation-rail.d.ts +12 -8
- package/types/src/page/page.d.ts +8 -11
- package/types/src/sheet/sheet.d.ts +17 -0
- package/types/src/surface/surface.d.ts +4 -10
- package/types/src/theme/theme.component.d.ts +10 -15
- package/types/src/tree/tree.d.ts +12 -0
package/dist/dialog.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dialog.cjs","names":[],"sources":["../src/dialog/dialog-base.mixin.ts","../src/dialog/dialog.component.ts"],"sourcesContent":["import { autoPlacement, autoUpdate, computePosition, offset, shift, size } from '@floating-ui/dom'\nimport { LitElement } from 'lit'\nimport { distinctUntilChanged, filter, fromEvent, map, merge, Subject, takeUntil, tap } from 'rxjs'\nimport type { Constructor } from '../../mixins/constructor'\nimport type { IBaseMixin } from '../../mixins/baseElement'\nimport {\n\tBLACKBIRD_EASING,\n\tDURATION_ENTER,\n\tDURATION_EXIT,\n\tDURATION_BACKDROP,\n\tEASE_OUT,\n\tEASE_IN,\n} from '../utils/animation'\nimport { reducedMotion$ } from '../directives/reduced-motion'\n\n// Mobile breakpoint - matches Tailwind's sm breakpoint\nconst MOBILE_BREAKPOINT = 640\n\n// Tablet breakpoint\nconst TABLET_BREAKPOINT = 1024\n\n/**\n * Fraction of viewport a dialog can occupy before converting to bottom sheet.\n * Tablet (640–1024px): 60% — tighter screens benefit from bottom sheet sooner.\n * Desktop (>1024px): 80% — plenty of room, keep floating longer.\n */\nfunction largeContentThreshold(): number {\n\treturn window.innerWidth < TABLET_BREAKPOINT ? 0.6 : 0.8\n}\n\nexport interface DialogPosition {\n\tx: number\n\ty: number\n}\n\nexport interface VirtualReference {\n\tgetBoundingClientRect: () => DOMRect\n}\n\n/**\n * Interface for the DialogBase mixin methods\n */\nexport interface IDialogBaseMixin {\n\tposition: DialogPosition\n\tisMobile: boolean\n\tdragOffset: number\n\tshow(positionOrEvent?: DialogPosition | MouseEvent | TouchEvent): Promise<boolean>\n\thide(result?: boolean): Promise<void>\n\tisCentered(): boolean\n\tisAnimating(): boolean\n}\n\n/**\n * Dialog mixin with smart positioning using Floating UI.\n *\n * On mobile (< 640px), automatically switches to bottom sheet mode\n * with swipe-to-dismiss gesture. On tablet/desktop, if content exceeds\n * a viewport-dependent threshold, also opens as bottom sheet.\n */\nexport const DialogBase = <T extends Constructor<LitElement & IBaseMixin>>(superClass: T) => {\n\tclass DialogBaseClass extends superClass {\n\t\tposition: DialogPosition = { x: 0, y: 0 }\n\t\tisMobile = false\n\t\tdragOffset = 0\n\n\t\tprotected resolvePromise?: (value: boolean) => void\n\t\tprotected cleanupAutoUpdate?: () => void\n\t\tprotected virtualReference?: VirtualReference\n\n\t\t// Subject to signal when to stop swipe gesture stream\n\t\tprivate readonly stopSwipe$ = new Subject<void>()\n\n\t\t// Focus trap state\n\t\tprivate lastFocusedElement: Element | null = null\n\t\tprivate inertSiblings: HTMLElement[] = []\n\n\t\t// Animation guard\n\t\tprivate animating = false\n\n\t\t/** ElementInternals — used for broadcasting `:state(open)` to consumers. */\n\t\tprotected dialogInternals: ElementInternals | undefined = (() => {\n\t\t\ttry {\n\t\t\t\treturn this.attachInternals()\n\t\t\t} catch {\n\t\t\t\treturn undefined\n\t\t\t}\n\t\t})()\n\n\t\t/**\n\t\t * Check if the dialog is currently animating\n\t\t */\n\t\tisAnimating(): boolean {\n\t\t\treturn this.animating\n\t\t}\n\n\t\t/**\n\t\t * Override in subclass to return the dialog element\n\t\t */\n\t\tprotected getDialogElement(): HTMLElement | null {\n\t\t\treturn null\n\t\t}\n\n\t\t/**\n\t\t * Override in subclass to return the backdrop element for animations\n\t\t */\n\t\tprotected getBackdropElement(): HTMLElement | null {\n\t\t\treturn null\n\t\t}\n\n\t\t/**\n\t\t * Override in subclass to return the drag handle element for swipe gestures\n\t\t */\n\t\tprotected getDragHandleElement(): HTMLElement | null {\n\t\t\treturn null\n\t\t}\n\n\t\tconnectedCallback(): void {\n\t\t\tsuper.connectedCallback()\n\t\t\tthis.setupResizeListener()\n\t\t}\n\n\t\t/**\n\t\t * Listen for resize to switch between mobile/desktop modes\n\t\t */\n\t\tprivate setupResizeListener(): void {\n\t\t\tfromEvent(window, 'resize')\n\t\t\t\t.pipe(\n\t\t\t\t\tmap(() => window.innerWidth < MOBILE_BREAKPOINT),\n\t\t\t\t\tdistinctUntilChanged(),\n\t\t\t\t\tfilter(() => this.hasAttribute('active')),\n\t\t\t\t\ttap(isMobile => {\n\t\t\t\t\t\tif (this.isMobile !== isMobile) {\n\t\t\t\t\t\t\tthis.isMobile = isMobile\n\t\t\t\t\t\t\tthis.requestUpdate()\n\t\t\t\t\t\t\tconst dialog = this.getDialogElement()\n\t\t\t\t\t\t\tif (dialog) {\n\t\t\t\t\t\t\t\tif (isMobile) {\n\t\t\t\t\t\t\t\t\tthis.applyBottomSheetStyles(dialog)\n\t\t\t\t\t\t\t\t\tthis.setupSwipeGesture(dialog)\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\tthis.stopSwipe$.next()\n\t\t\t\t\t\t\t\t\tthis.setupPositioning()\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}),\n\t\t\t\t\ttakeUntil(this.disconnecting),\n\t\t\t\t)\n\t\t\t\t.subscribe()\n\t\t}\n\n\t\t/**\n\t\t * Setup RxJS-based swipe gesture for dialog\n\t\t */\n\t\tprivate setupSwipeGesture(dialog: HTMLElement): void {\n\t\t\t// Stop any existing swipe gesture\n\t\t\tthis.stopSwipe$.next()\n\n\t\t\tlet dragStartY = 0\n\t\t\tlet isDragging = false\n\t\t\tlet currentY = 0\n\n\t\t\tconst dragHandle = this.getDragHandleElement()\n\t\t\tconst dragTarget = dragHandle || dialog\n\n\t\t\tconst touchStart$ = fromEvent<TouchEvent>(dragTarget, 'touchstart', { passive: true }).pipe(\n\t\t\t\ttap(e => {\n\t\t\t\t\tconst touch = e.touches[0]\n\t\t\t\t\tconst rect = dialog.getBoundingClientRect()\n\t\t\t\t\tconst touchY = touch.clientY - rect.top\n\n\t\t\t\t\t// Only allow drag from top 80px or drag handle\n\t\t\t\t\tif (touchY > 80 && !dragHandle) return\n\n\t\t\t\t\tisDragging = true\n\t\t\t\t\tdragStartY = touch.clientY\n\t\t\t\t\tcurrentY = 0\n\t\t\t\t\tthis.dragOffset = 0\n\n\t\t\t\t\t// Disable transitions for immediate feedback\n\t\t\t\t\tdialog.style.transition = 'none'\n\t\t\t\t\tdialog.style.willChange = 'transform'\n\t\t\t\t}),\n\t\t\t)\n\n\t\t\tconst touchMove$ = fromEvent<TouchEvent>(dialog, 'touchmove', { passive: false }).pipe(\n\t\t\t\tfilter(() => isDragging),\n\t\t\t\ttap(e => {\n\t\t\t\t\tconst touch = e.touches[0]\n\t\t\t\t\tconst deltaY = touch.clientY - dragStartY\n\n\t\t\t\t\t// Rubber-band effect for upward drag\n\t\t\t\t\tif (deltaY < 0) {\n\t\t\t\t\t\tcurrentY = deltaY * 0.2\n\t\t\t\t\t} else {\n\t\t\t\t\t\tcurrentY = deltaY\n\t\t\t\t\t}\n\n\t\t\t\t\tthis.dragOffset = Math.max(0, deltaY)\n\n\t\t\t\t\t// Direct DOM update - 1:1 tracking\n\t\t\t\t\tdialog.style.transform = `translateY(${currentY}px)`\n\n\t\t\t\t\te.preventDefault()\n\t\t\t\t}),\n\t\t\t)\n\n\t\t\tconst touchEnd$ = merge(\n\t\t\t\tfromEvent<TouchEvent>(dialog, 'touchend', { passive: true }),\n\t\t\t\tfromEvent<TouchEvent>(dialog, 'touchcancel', { passive: true }),\n\t\t\t).pipe(\n\t\t\t\tfilter(() => isDragging),\n\t\t\t\ttap(() => {\n\t\t\t\t\tisDragging = false\n\n\t\t\t\t\t// Re-enable transitions for snap animation\n\t\t\t\t\tdialog.style.transition = 'transform 0.3s cubic-bezier(0.16, 1, 0.3, 1)'\n\t\t\t\t\tdialog.style.willChange = ''\n\n\t\t\t\t\tconst dialogHeight = dialog.getBoundingClientRect().height\n\t\t\t\t\tconst threshold = Math.min(100, dialogHeight * 0.25)\n\n\t\t\t\t\tif (this.dragOffset > threshold) {\n\t\t\t\t\t\t// Dismiss - animate out\n\t\t\t\t\t\tdialog.style.transform = 'translateY(100%)'\n\t\t\t\t\t\tthis.hide(false)\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// Snap back\n\t\t\t\t\t\tdialog.style.transform = 'translateY(0)'\n\t\t\t\t\t\tthis.dragOffset = 0\n\t\t\t\t\t}\n\t\t\t\t}),\n\t\t\t)\n\n\t\t\t// Merge all touch streams and subscribe\n\t\t\tmerge(touchStart$, touchMove$, touchEnd$)\n\t\t\t\t.pipe(takeUntil(merge(this.stopSwipe$, this.disconnecting)))\n\t\t\t\t.subscribe()\n\t\t}\n\n\t\t/**\n\t\t * Apply bottom sheet styles for mobile\n\t\t */\n\t\tprivate applyBottomSheetStyles(dialog: HTMLElement): void {\n\t\t\tif (this.cleanupAutoUpdate) {\n\t\t\t\tthis.cleanupAutoUpdate()\n\t\t\t\tthis.cleanupAutoUpdate = undefined\n\t\t\t}\n\n\t\t\tObject.assign(dialog.style, {\n\t\t\t\tposition: '',\n\t\t\t\tleft: '',\n\t\t\t\ttop: '',\n\t\t\t\ttransform: '',\n\t\t\t\tmaxWidth: '',\n\t\t\t})\n\t\t}\n\n\t\t/**\n\t\t * Show the dialog at a specific position\n\t\t */\n\t\tasync show(positionOrEvent?: DialogPosition | MouseEvent | TouchEvent): Promise<boolean> {\n\t\t\tif (this.cleanupAutoUpdate) {\n\t\t\t\tthis.cleanupAutoUpdate()\n\t\t\t\tthis.cleanupAutoUpdate = undefined\n\t\t\t}\n\n\t\t\tthis.isMobile = window.innerWidth < MOBILE_BREAKPOINT\n\n\t\t\tlet x: number, y: number\n\n\t\t\tif (!positionOrEvent) {\n\t\t\t\tx = window.innerWidth / 2\n\t\t\t\ty = window.innerHeight / 2\n\t\t\t} else if ('clientX' in positionOrEvent) {\n\t\t\t\tx = positionOrEvent.clientX\n\t\t\t\ty = positionOrEvent.clientY\n\t\t\t} else if ('touches' in positionOrEvent && positionOrEvent.touches.length) {\n\t\t\t\tx = positionOrEvent.touches[0].clientX\n\t\t\t\ty = positionOrEvent.touches[0].clientY\n\t\t\t} else {\n\t\t\t\tconst pos = positionOrEvent as DialogPosition\n\t\t\t\tx = pos.x\n\t\t\t\ty = pos.y\n\t\t\t}\n\n\t\t\tthis.position = { x, y }\n\n\t\t\tthis.virtualReference = {\n\t\t\t\tgetBoundingClientRect: () => new DOMRect(x, y, 0, 0),\n\t\t\t}\n\n\t\t\tthis.requestUpdate()\n\t\t\tawait this.updateComplete\n\n\t\t\tthis.setAttribute('active', '')\n\t\t\tthis.dialogInternals?.states.add('open')\n\t\t\tawait this.updateComplete\n\n\t\t\t// Save focus and set siblings to inert for focus trap\n\t\t\tthis.lastFocusedElement = document.activeElement\n\t\t\tconst parent = this.parentElement\n\t\t\tif (parent) {\n\t\t\t\tthis.inertSiblings = []\n\t\t\t\tfor (let i = 0; i < parent.children.length; i++) {\n\t\t\t\t\tconst sibling = parent.children[i] as HTMLElement\n\t\t\t\t\tif (sibling !== this && 'inert' in sibling) {\n\t\t\t\t\t\tsibling.inert = true\n\t\t\t\t\t\tthis.inertSiblings.push(sibling)\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Escape key listener\n\t\t\tfromEvent<KeyboardEvent>(document, 'keydown')\n\t\t\t\t.pipe(\n\t\t\t\t\tfilter(e => e.key === 'Escape'),\n\t\t\t\t\ttap(e => {\n\t\t\t\t\t\te.preventDefault()\n\t\t\t\t\t\tthis.hide(false)\n\t\t\t\t\t}),\n\t\t\t\t\ttakeUntil(merge(this.stopSwipe$, this.disconnecting)),\n\t\t\t\t)\n\t\t\t\t.subscribe()\n\n\t\t\tconst dialog = this.getDialogElement()\n\n\t\t\t// If content exceeds viewport threshold on desktop, treat as bottom sheet\n\t\t\tconst threshold = largeContentThreshold()\n\t\t\tif (\n\t\t\t\t!this.isMobile &&\n\t\t\t\tdialog &&\n\t\t\t\t(dialog.scrollHeight > window.innerHeight * threshold ||\n\t\t\t\t\tdialog.scrollWidth > window.innerWidth * threshold)\n\t\t\t) {\n\t\t\t\tthis.isMobile = true\n\t\t\t\tthis.requestUpdate()\n\t\t\t\tawait this.updateComplete\n\t\t\t}\n\n\t\t\tif (this.isMobile) {\n\t\t\t\tif (dialog) {\n\t\t\t\t\tthis.applyBottomSheetStyles(dialog)\n\t\t\t\t\tthis.setupSwipeGesture(dialog)\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tthis.setupPositioning()\n\t\t\t}\n\n\t\t\tthis.animating = true\n\t\t\tawait this.animateIn()\n\t\t\tthis.animating = false\n\n\t\t\treturn new Promise<boolean>(resolve => {\n\t\t\t\tthis.resolvePromise = resolve\n\t\t\t})\n\t\t}\n\n\t\t/**\n\t\t * Animate dialog entrance\n\t\t */\n\t\tprivate async animateIn(): Promise<void> {\n\t\t\tconst dialog = this.getDialogElement()\n\t\t\tconst backdrop = this.getBackdropElement()\n\n\t\t\tif (reducedMotion$.value) {\n\t\t\t\tif (backdrop) backdrop.style.opacity = '1'\n\t\t\t\tif (dialog) dialog.style.opacity = '1'\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tbackdrop?.animate([{ opacity: 0 }, { opacity: 1 }], {\n\t\t\t\tduration: DURATION_BACKDROP,\n\t\t\t\teasing: EASE_OUT,\n\t\t\t\tfill: 'forwards',\n\t\t\t})\n\n\t\t\tif (dialog) {\n\t\t\t\tconst animation = this.isMobile\n\t\t\t\t\t? [\n\t\t\t\t\t\t\t{ opacity: 0, transform: 'translateY(100%)' },\n\t\t\t\t\t\t\t{ opacity: 1, transform: 'translateY(0)' },\n\t\t\t\t\t\t]\n\t\t\t\t\t: [\n\t\t\t\t\t\t\t{ opacity: 0, transform: 'scale(0.92) translateY(16px)' },\n\t\t\t\t\t\t\t{ opacity: 1, transform: 'scale(1) translateY(0)' },\n\t\t\t\t\t\t]\n\n\t\t\t\tawait dialog.animate(animation, {\n\t\t\t\t\tduration: DURATION_ENTER,\n\t\t\t\t\teasing: BLACKBIRD_EASING,\n\t\t\t\t\tfill: 'forwards',\n\t\t\t\t}).finished\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * Animate dialog exit\n\t\t */\n\t\tprivate async animateOut(): Promise<void> {\n\t\t\tconst dialog = this.getDialogElement()\n\t\t\tconst backdrop = this.getBackdropElement()\n\n\t\t\tif (reducedMotion$.value) {\n\t\t\t\tif (backdrop) backdrop.style.opacity = '0'\n\t\t\t\tif (dialog) dialog.style.opacity = '0'\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tconst animations: Promise<Animation>[] = []\n\n\t\t\tif (backdrop) {\n\t\t\t\tanimations.push(\n\t\t\t\t\tbackdrop.animate([{ opacity: 1 }, { opacity: 0 }], {\n\t\t\t\t\t\tduration: DURATION_EXIT,\n\t\t\t\t\t\teasing: EASE_OUT,\n\t\t\t\t\t\tfill: 'forwards',\n\t\t\t\t\t}).finished,\n\t\t\t\t)\n\t\t\t}\n\n\t\t\tif (dialog) {\n\t\t\t\tconst animation = this.isMobile\n\t\t\t\t\t? [\n\t\t\t\t\t\t\t{ opacity: 1, transform: 'translateY(0)' },\n\t\t\t\t\t\t\t{ opacity: 0, transform: 'translateY(100%)' },\n\t\t\t\t\t\t]\n\t\t\t\t\t: [\n\t\t\t\t\t\t\t{ opacity: 1, transform: 'scale(1) translateY(0)' },\n\t\t\t\t\t\t\t{ opacity: 0, transform: 'scale(0.95) translateY(8px)' },\n\t\t\t\t\t\t]\n\n\t\t\t\tanimations.push(\n\t\t\t\t\tdialog.animate(animation, {\n\t\t\t\t\t\tduration: DURATION_EXIT,\n\t\t\t\t\t\teasing: EASE_IN,\n\t\t\t\t\t\tfill: 'forwards',\n\t\t\t\t\t}).finished,\n\t\t\t\t)\n\t\t\t}\n\n\t\t\tawait Promise.all(animations)\n\t\t}\n\n\t\t/**\n\t\t * Hide the dialog\n\t\t */\n\t\tasync hide(result = false): Promise<void> {\n\t\t\tthis.stopSwipe$.next()\n\n\t\t\tthis.animating = true\n\t\t\tawait this.animateOut()\n\t\t\tthis.animating = false\n\n\t\t\tthis.removeAttribute('active')\n\t\t\tthis.dialogInternals?.states.delete('open')\n\n\t\t\t// Restore inert siblings\n\t\t\tfor (const el of this.inertSiblings) {\n\t\t\t\tel.inert = false\n\t\t\t}\n\t\t\tthis.inertSiblings = []\n\n\t\t\t// Restore focus\n\t\t\tif (this.lastFocusedElement) {\n\t\t\t\tconst el = this.lastFocusedElement as HTMLElement\n\t\t\t\tif (typeof el.focus === 'function') {\n\t\t\t\t\tel.focus()\n\t\t\t\t}\n\t\t\t\tthis.lastFocusedElement = null\n\t\t\t}\n\n\t\t\tif (this.cleanupAutoUpdate) {\n\t\t\t\tthis.cleanupAutoUpdate()\n\t\t\t\tthis.cleanupAutoUpdate = undefined\n\t\t\t}\n\n\t\t\tif (this.resolvePromise) {\n\t\t\t\tthis.resolvePromise(result)\n\t\t\t\tthis.resolvePromise = undefined\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * Check if position is near center (only skip Floating UI for truly centered dialogs)\n\t\t */\n\t\tisCentered(): boolean {\n\t\t\t// Use tight tolerance (5%) - only skip Floating UI when position is very close to center\n\t\t\tconst toleranceX = window.innerWidth * 0.05\n\t\t\tconst toleranceY = window.innerHeight * 0.05\n\n\t\t\treturn (\n\t\t\t\tMath.abs(this.position.x - window.innerWidth / 2) < toleranceX &&\n\t\t\t\tMath.abs(this.position.y - window.innerHeight / 2) < toleranceY\n\t\t\t)\n\t\t}\n\n\t\t/**\n\t\t * Setup Floating UI positioning for desktop\n\t\t */\n\t\tprivate setupPositioning(): void {\n\t\t\tconst dialog = this.getDialogElement()\n\t\t\tif (!dialog) return\n\n\t\t\tif (this.isCentered()) return\n\n\t\t\tif (this.virtualReference) {\n\t\t\t\tthis.cleanupAutoUpdate = autoUpdate(\n\t\t\t\t\tthis.virtualReference,\n\t\t\t\t\tdialog,\n\t\t\t\t\t() => this.updatePosition(dialog),\n\t\t\t\t\t{\n\t\t\t\t\t\tancestorScroll: true,\n\t\t\t\t\t\tancestorResize: true,\n\t\t\t\t\t\telementResize: true,\n\t\t\t\t\t},\n\t\t\t\t)\n\t\t\t\tthis.updatePosition(dialog)\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * Update position using Floating UI\n\t\t */\n\t\tprivate async updatePosition(dialog: HTMLElement): Promise<void> {\n\t\t\tif (!this.virtualReference) return\n\n\t\t\tconst padding = 16\n\n\t\t\tconst { x, y } = await computePosition(this.virtualReference, dialog, {\n\t\t\t\tstrategy: 'fixed',\n\t\t\t\tmiddleware: [\n\t\t\t\t\toffset(8),\n\t\t\t\t\tautoPlacement({\n\t\t\t\t\t\tpadding,\n\t\t\t\t\t\tallowedPlacements: [\n\t\t\t\t\t\t\t'top-start',\n\t\t\t\t\t\t\t'top-end',\n\t\t\t\t\t\t\t'bottom-start',\n\t\t\t\t\t\t\t'bottom-end',\n\t\t\t\t\t\t\t'left-start',\n\t\t\t\t\t\t\t'left-end',\n\t\t\t\t\t\t\t'right-start',\n\t\t\t\t\t\t\t'right-end',\n\t\t\t\t\t\t],\n\t\t\t\t\t}),\n\t\t\t\t\tshift({ padding }),\n\t\t\t\t\tsize({\n\t\t\t\t\t\tpadding,\n\t\t\t\t\t\tapply({ availableWidth, elements }) {\n\t\t\t\t\t\t\telements.floating.style.maxWidth = `${availableWidth}px`\n\t\t\t\t\t\t},\n\t\t\t\t\t}),\n\t\t\t\t],\n\t\t\t})\n\n\t\t\tObject.assign(dialog.style, {\n\t\t\t\tposition: 'fixed',\n\t\t\t\tleft: `${Math.round(x)}px`,\n\t\t\t\ttop: `${Math.round(y)}px`,\n\t\t\t\ttransform: 'none',\n\t\t\t})\n\t\t}\n\n\t\tdisconnectedCallback(): void {\n\t\t\tthis.stopSwipe$.next()\n\t\t\tif (this.cleanupAutoUpdate) {\n\t\t\t\tthis.cleanupAutoUpdate()\n\t\t\t\tthis.cleanupAutoUpdate = undefined\n\t\t\t}\n\t\t\tsuper.disconnectedCallback()\n\t\t}\n\t}\n\n\treturn DialogBaseClass as Constructor<IDialogBaseMixin> & T\n}\n","import { $LitElement } from '@mixins/index'\nimport { css, html, nothing } from 'lit'\nimport { customElement, property, queryAssignedElements } from 'lit/decorators.js'\nimport { cursorGlow } from '../directives/cursor-glow'\nimport { createRef, ref, type Ref } from 'lit/directives/ref.js'\nimport { when } from 'lit/directives/when.js'\nimport { fromEvent, tap } from 'rxjs'\nimport { takeUntil } from 'rxjs/operators'\nimport { DialogBase } from './dialog-base.mixin'\nimport { DialogHereMorty, DialogWhereAreYouRicky, DialogWhereAreYouRickyEvent } from './dialog-events'\n\n/**\n * Unified dialog component that handles both content-only and confirm modes.\n *\n * @element schmancy-dialog\n * @slot default - Content slot for dialog body (used in content mode)\n * @slot content - Named slot for custom content in confirm mode\n *\n * @example Content mode (no buttons):\n * ```html\n * <schmancy-dialog>\n * <my-custom-content></my-custom-content>\n * </schmancy-dialog>\n * ```\n *\n * @example Confirm mode (with buttons):\n * ```html\n * <schmancy-dialog\n * title=\"Confirm Action\"\n * message=\"Are you sure?\"\n * confirm-text=\"Yes\"\n * cancel-text=\"No\"\n * ></schmancy-dialog>\n * ```\n */\n@customElement('schmancy-dialog')\nexport class SchmancyDialog extends DialogBase(\n\t$LitElement(css`\n\t\t:host {\n\t\t\tposition: fixed;\n\t\t\tz-index: var(--schmancy-overlay-z, 10000);\n\t\t\tinset: 0;\n\t\t\tdisplay: none;\n\t\t\t--dialog-width: fit-content;\n\t\t}\n\n\t\t:host([active]) {\n\t\t\tdisplay: block;\n\t\t}\n\n\n\t\t/* Luminous glow around the dialog container */\n\t\t.dialog {\n\t\t\tbox-shadow: 0 8px 40px -8px color-mix(in srgb, var(--schmancy-sys-color-primary-default) 15%, transparent);\n\t\t\tborder-radius: var(--schmancy-sys-shape-corner-large);\n\t\t}\n\n\t\t@media (prefers-reduced-motion: reduce) {\n\t\t\t.dialog { box-shadow: var(--schmancy-sys-elevation-2); }\n\t\t}\n\t`),\n) {\n\t/**\n\t * Unique identifier for the dialog instance\n\t */\n\t@property({ type: String, reflect: true }) uid!: string\n\n\t/**\n\t * Dialog title (enables confirm mode when set)\n\t */\n\t@property({ type: String }) title: string | undefined = undefined\n\n\t/**\n\t * Dialog subtitle\n\t */\n\t@property({ type: String }) subtitle: string | undefined = undefined\n\n\t/**\n\t * Dialog message\n\t */\n\t@property({ type: String }) message: string | undefined = undefined\n\n\t/**\n\t * Text for confirm button (enables confirm mode when set with cancelText)\n\t */\n\t@property({ type: String, attribute: 'confirm-text' }) confirmText: string | undefined = undefined\n\n\t/**\n\t * Text for cancel button\n\t */\n\t@property({ type: String, attribute: 'cancel-text' }) cancelText: string | undefined = undefined\n\n\t/**\n\t * Dialog variant (affects button colors in confirm mode)\n\t */\n\t@property({ type: String }) variant: 'default' | 'danger' = 'default'\n\n\t/**\n\t * Whether to hide action buttons (force content mode)\n\t */\n\t@property({ type: Boolean, attribute: 'hide-actions' }) hideActions = false\n\n\t/**\n\t * Slotted children in the named \"content\" slot (confirm mode custom content)\n\t */\n\t@queryAssignedElements({ slot: 'content', flatten: true })\n\tprivate _contentSlotElements!: HTMLElement[]\n\n\t/**\n\t * Ref to the confirm mode wrapper div\n\t */\n\tprivate _confirmDialogRef: Ref<HTMLElement> = createRef()\n\n\t/**\n\t * Ref to the content mode section element\n\t */\n\tprivate _contentDialogRef: Ref<HTMLElement> = createRef()\n\n\t/**\n\t * Ref to the backdrop element for animations\n\t */\n\tprivate _backdropRef: Ref<HTMLElement> = createRef()\n\n\t/**\n\t * Ref to the drag handle element for swipe gestures\n\t */\n\tprivate _dragHandleRef: Ref<HTMLElement> = createRef()\n\n\t/**\n\t * Stable per-instance id used for ARIA labelledby/describedby wiring\n\t */\n\tprivate readonly _a11yId = `schmancy-dialog-${Math.random().toString(36).slice(2, 10)}`\n\tprivate get _titleId() { return `${this._a11yId}-title` }\n\tprivate get _descId() { return `${this._a11yId}-desc` }\n\n\t/**\n\t * Return the dialog element for positioning/size measurement.\n\t * In content mode, returns the first slotted child (the actual component).\n\t * In confirm mode, returns the wrapper div.\n\t */\n\tprotected getDialogElement(): HTMLElement | null {\n\t\t// Content mode: use the section wrapper (slotted content may be display:contents)\n\t\tif (this._contentDialogRef.value) return this._contentDialogRef.value\n\t\t// Confirm mode: use the wrapper div\n\t\treturn this._confirmDialogRef.value ?? null\n\t}\n\n\t/**\n\t * Return the backdrop element for animations\n\t */\n\tprotected getBackdropElement(): HTMLElement | null {\n\t\treturn this._backdropRef.value ?? null\n\t}\n\n\t/**\n\t * Return the drag handle element for swipe gestures\n\t */\n\tprotected getDragHandleElement(): HTMLElement | null {\n\t\treturn this._dragHandleRef.value ?? null\n\t}\n\n\t/**\n\t * Check if dialog is in confirm mode (has buttons)\n\t */\n\tprivate get isConfirmMode(): boolean {\n\t\tif (this.hideActions) return false\n\t\treturn !!(this.confirmText?.trim() && this.cancelText?.trim())\n\t}\n\n\t/**\n\t * Handle component connection to DOM\n\t */\n\tconnectedCallback(): void {\n\t\tsuper.connectedCallback()\n\n\t\t// Listen for \"where are you ricky\" events\n\t\tfromEvent<DialogWhereAreYouRickyEvent>(window, DialogWhereAreYouRicky)\n\t\t\t.pipe(\n\t\t\t\ttap(e => {\n\t\t\t\t\tif (e.detail.uid === this.uid) this.announcePresence()\n\t\t\t\t}),\n\t\t\t\ttakeUntil(this.disconnecting),\n\t\t\t)\n\t\t\t.subscribe()\n\t}\n\n\t/**\n\t * Announce this dialog's presence to the service\n\t */\n\tprivate announcePresence(): void {\n\t\tthis.dispatchEvent(\n\t\t\tnew CustomEvent(DialogHereMorty, {\n\t\t\t\tdetail: { dialog: this },\n\t\t\t\tbubbles: true,\n\t\t\t\tcomposed: true,\n\t\t\t}),\n\t\t)\n\t}\n\n\t/**\n\t * Handle confirm action\n\t */\n\tprivate handleConfirm(): void {\n\t\tthis.hide(true)\n\t\tthis.dispatchEvent(\n\t\t\tnew CustomEvent('confirm', {\n\t\t\t\tbubbles: true,\n\t\t\t\tcomposed: true,\n\t\t\t}),\n\t\t)\n\t}\n\n\t/**\n\t * Handle cancel/close action\n\t */\n\tprivate handleClose(): void {\n\t\tif (this.isAnimating()) return\n\t\tthis.hide(false)\n\t\tthis.dispatchEvent(\n\t\t\tnew CustomEvent(this.isConfirmMode ? 'cancel' : 'close', {\n\t\t\t\tbubbles: true,\n\t\t\t\tcomposed: true,\n\t\t\t}),\n\t\t)\n\t}\n\n\t/**\n\t * Render drag handle for mobile bottom sheet\n\t */\n\tprivate renderDragHandle() {\n\t\treturn html`\n\t\t\t<div ${ref(this._dragHandleRef)} class=\"dialog-drag-handle flex justify-center pt-2 pb-1 cursor-grab active:cursor-grabbing touch-none\">\n\t\t\t\t<div class=\"w-10 h-1 rounded-full bg-outline-variant\"></div>\n\t\t\t</div>\n\t\t`\n\t}\n\n\trender() {\n\t\tconst isCentered = this.isCentered()\n\t\tconst hasCustomContent = this._contentSlotElements?.length > 0\n\n\t\t// Mobile bottom sheet classes\n\t\tconst mobileDialogClasses = {\n\t\t\tdialog: true,\n\t\t\tfixed: true,\n\t\t\t'inset-x-0': true,\n\t\t\t'bottom-0': true,\n\t\t\t'w-full': true,\n\t\t\t'max-h-[90dvh]': true,\n\t\t\t'overflow-hidden': true,\n\t\t\t// Safe area padding for notched devices\n\t\t\t'pb-[env(safe-area-inset-bottom)]': true,\n\t\t}\n\n\t\t// Desktop dialog classes\n\t\tconst desktopDialogClasses = {\n\t\t\tdialog: true,\n\t\t\tfixed: true,\n\t\t\t'w-[var(--dialog-width)]': true,\n\t\t\t'max-w-[calc(100vw-2rem)]': true,\n\t\t\t'max-h-[90dvh]': true,\n\t\t\t'overflow-hidden': true,\n\t\t\t'top-1/2': isCentered,\n\t\t\t'left-1/2': isCentered,\n\t\t\t'-translate-x-1/2': isCentered,\n\t\t\t'-translate-y-1/2': isCentered,\n\t\t}\n\n\t\tconst dialogClasses = this.isMobile ? mobileDialogClasses : desktopDialogClasses\n\n\t\t// Button classes - stack vertically on mobile\n\t\tconst buttonContainerClasses = this.isMobile\n\t\t\t? 'flex flex-col-reverse gap-2 w-full'\n\t\t\t: 'flex justify-end gap-3'\n\n\t\t// Confirm mode: with title/buttons\n\t\tif (this.isConfirmMode) {\n\t\t\tconst hasTitle = !!this.title?.trim()\n\t\t\tconst hasSubtitle = !!this.subtitle?.trim()\n\t\t\tconst hasMessage = !!this.message?.trim()\n\t\t\tconst describedBy = [hasSubtitle && this._descId + '-sub', hasMessage && this._descId + '-msg']\n\t\t\t\t.filter(Boolean)\n\t\t\t\t.join(' ') || ''\n\t\t\treturn html`\n\t\t\t\t<div ${ref(this._backdropRef)} class=\"fixed inset-0 bg-surface-container/10 backdrop-blur-lg backdrop-saturate-150 backdrop-brightness-105\" @click=${this.handleClose}></div>\n\n\t\t\t\t<div\n\t\t\t\t\t${ref(this._confirmDialogRef)}\n\t\t\t\t\tclass=${this.classMap(dialogClasses)}\n\t\t\t\t\trole=\"alertdialog\"\n\t\t\t\t\taria-modal=\"true\"\n\t\t\t\t\taria-labelledby=${hasTitle ? this._titleId : nothing}\n\t\t\t\t\taria-describedby=${describedBy || nothing}\n\t\t\t\t>\n\t\t\t\t\t<schmancy-surface\n\t\t\t\t\t\t${cursorGlow({ radius: 250, intensity: 0.1 })}\n\t\t\t\t\t\trounded=${this.isMobile ? 'top' : 'all'}\n\t\t\t\t\t\ttype=\"glass\"\n\t\t\t\t\t\tfill=\"all\"\n\t\t\t\t\t\tclass=\"overflow-hidden\"\n\t\t\t\t\t>\n\t\t\t\t\t\t${this.isMobile ? this.renderDragHandle() : null}\n\t\t\t\t\t\t<schmancy-scroll direction=\"vertical\" hide class=\"p-4 pt-2\">\n\t\t\t\t\t\t\t<schmancy-form @submit=${this.handleConfirm}>\n\t\t\t\t\t\t\t\t${when(\n\t\t\t\t\t\t\t\t\thasTitle,\n\t\t\t\t\t\t\t\t\t() => html`\n\t\t\t\t\t\t\t\t\t\t<schmancy-typography id=${this._titleId} type=\"title\" token=\"md\" class=\"mb-1\">${this.title}</schmancy-typography>\n\t\t\t\t\t\t\t\t\t\t${when(\n\t\t\t\t\t\t\t\t\t\t\thasSubtitle,\n\t\t\t\t\t\t\t\t\t\t\t() => html`\n\t\t\t\t\t\t\t\t\t\t\t\t<schmancy-typography id=\"${this._descId}-sub\" type=\"subtitle\" token=\"xs\" class=\"mb-2\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t${this.subtitle}\n\t\t\t\t\t\t\t\t\t\t\t\t</schmancy-typography>\n\t\t\t\t\t\t\t\t\t\t\t`,\n\t\t\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t\t\t`,\n\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t\t${hasCustomContent\n\t\t\t\t\t\t\t\t\t? html`<div class=\"mb-4\"><slot name=\"content\"></slot></div>`\n\t\t\t\t\t\t\t\t\t: when(\n\t\t\t\t\t\t\t\t\t\t\thasMessage,\n\t\t\t\t\t\t\t\t\t\t\t() => html`<schmancy-typography id=\"${this._descId}-msg\" type=\"body\" class=\"mb-4\">${this.message}</schmancy-typography>`,\n\t\t\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t\t<div class=${buttonContainerClasses}>\n\t\t\t\t\t\t\t\t\t<schmancy-button\n\t\t\t\t\t\t\t\t\t\tvariant=\"outlined\"\n\t\t\t\t\t\t\t\t\t\t@click=${this.handleClose}\n\t\t\t\t\t\t\t\t\t\tclass=${this.isMobile ? 'w-full' : ''}\n\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t${this.cancelText}\n\t\t\t\t\t\t\t\t\t</schmancy-button>\n\t\t\t\t\t\t\t\t\t<schmancy-button\n\t\t\t\t\t\t\t\t\t\ttype=\"submit\"\n\t\t\t\t\t\t\t\t\t\tvariant=\"filled\"\n\t\t\t\t\t\t\t\t\t\tclass=${this.isMobile ? 'w-full' : ''}\n\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t${this.confirmText}\n\t\t\t\t\t\t\t\t\t</schmancy-button>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t</schmancy-form>\n\t\t\t\t\t\t</schmancy-scroll>\n\t\t\t\t\t</schmancy-surface>\n\t\t\t\t</div>\n\t\t\t`\n\t\t}\n\n\t\t// Content mode: minimal, just slot\n\t\treturn html`\n\t\t\t<div ${ref(this._backdropRef)} class=\"fixed inset-0 bg-surface-container/10 backdrop-blur-lg backdrop-saturate-150 backdrop-brightness-105\" @click=${this.handleClose}></div>\n\n\t\t\t<section ${ref(this._contentDialogRef)} class=${this.classMap(dialogClasses)} role=\"dialog\" aria-modal=\"true\">\n\t\t\t\t<schmancy-surface ${cursorGlow({ radius: 250, intensity: 0.1 })} rounded=${this.isMobile ? 'top' : 'all'} type=\"glass\" fill=\"all\">\n\t\t\t\t\t${this.isMobile ? this.renderDragHandle() : null}\n\t\t\t\t\t<schmancy-scroll direction=\"vertical\" hide class=\"max-h-[85dvh]\">\n\t\t\t\t\t\t<slot></slot>\n\t\t\t\t\t</schmancy-scroll>\n\t\t\t\t</schmancy-surface>\n\t\t\t</section>\n\t\t`\n\t}\n\n\t/**\n\t * Static helper for confirm dialogs\n\t */\n\tstatic async confirm(options: {\n\t\ttitle?: string\n\t\tsubtitle?: string\n\t\tmessage?: string\n\t\tconfirmText?: string\n\t\tcancelText?: string\n\t\tvariant?: 'default' | 'danger'\n\t\tposition?: { x: number; y: number } | MouseEvent | TouchEvent\n\t\twidth?: string\n\t}): Promise<boolean> {\n\t\tlet dialog = document.querySelector('schmancy-dialog[data-static-confirm]') as SchmancyDialog\n\n\t\tif (!dialog) {\n\t\t\tdialog = document.createElement('schmancy-dialog') as SchmancyDialog\n\t\t\tdialog.setAttribute('data-static-confirm', '')\n\t\t\tdocument.body.appendChild(dialog)\n\t\t}\n\n\t\t// Set options\n\t\tdialog.title = options.title\n\t\tdialog.subtitle = options.subtitle\n\t\tdialog.message = options.message\n\t\tdialog.confirmText = options.confirmText ?? 'Confirm'\n\t\tdialog.cancelText = options.cancelText ?? 'Cancel'\n\t\tdialog.variant = options.variant ?? 'default'\n\t\tif (options.width) dialog.style.setProperty('--dialog-width', options.width)\n\n\t\treturn dialog.show(options.position)\n\t}\n\n\t/**\n\t * Simple shorthand - just pass message and optionally an event\n\t */\n\tstatic async ask(message: string, event?: MouseEvent | TouchEvent): Promise<boolean> {\n\t\treturn this.confirm({\n\t\t\tmessage,\n\t\t\tposition: event,\n\t\t})\n\t}\n}\n\n// Alias for backward compatibility\nexport { SchmancyDialog as ConfirmDialog }\n\ndeclare global {\n\tinterface HTMLElementTagNameMap {\n\t\t'schmancy-dialog': SchmancyDialog\n\t}\n}\n"],"mappings":"okBA2DA,IAAa,EAA8D,GAC1E,cAA8B,CAAA,CAAA,YAAA,GAAA,EAAA,CAAA,MAAA,GAAA,EAAA,CAAA,KAAA,SACF,CAAE,EAAG,EAAG,EAAG,EAAA,CAAA,KAAA,SAAA,CAC3B,EAAA,KAAA,WACE,EAAA,KAAA,WAOiB,IAAI,EAAA,QAAA,KAAA,mBAGW,KAAA,KAAA,cACN,EAAA,CAAA,KAAA,UAAA,CAGnB,EAAA,KAAA,qBAAA,CAInB,GAAA,CACC,OAAO,KAAK,iBAAA,MAAA,CAEZ,WAAA,CAOF,aAAA,CACC,OAAO,KAAK,UAMb,kBAAA,CACC,OAAO,KAMR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,EAAA,EAAA,UAKjB,CAAE,KAAM,OAAA,CAAA,CAAA,CAAS,EAAA,UAAA,UAAA,IAAA,GAAA,CAAA,EAAA,EAAA,EAAA,EAAA,EAAA,UAKjB,CAAE,KAAM,OAAQ,UAAW,eAAA,CAAA,CAAA,CAAiB,EAAA,UAAA,cAAA,IAAA,GAAA,CAAA,EAAA,EAAA,EAAA,EAAA,EAAA,UAK5C,CAAE,KAAM,OAAQ,UAAW,cAAA,CAAA,CAAA,CAAgB,EAAA,UAAA,aAAA,IAAA,GAAA,CAAA,EAAA,EAAA,EAAA,EAAA,EAAA,UAK3C,CAAE,KAAM,OAAA,CAAA,CAAA,CAAS,EAAA,UAAA,UAAA,IAAA,GAAA,CAAA,EAAA,EAAA,EAAA,EAAA,EAAA,UAKjB,CAAE,KAAM,QAAS,UAAW,eAAA,CAAA,CAAA,CAAiB,EAAA,UAAA,cAAA,IAAA,GAAA,CAAA,EAAA,EAAA,EAAA,EAAA,EAAA,uBAKhC,CAAE,KAAM,UAAW,QAAA,CAAS,EAAA,CAAA,CAAA,CAAO,EAAA,UAAA,uBAAA,IAAA,GAAA,CAAA,EAAA,EAAA,EAAA,EAAA,EAAA,EAAA,eAtE5C,kBAAA,CAAA,CAAkB,EAAA,CAAA,QAAA,QAAA,EAAA,EAAA,OAAA,eAAA,QAAA,gBAAA,CAAA,WAAA,CAAA,EAAA,IAAA,UAAA,CAAA,OAAA,GAAA,CAAA,CAAA,OAAA,eAAA,QAAA,iBAAA,CAAA,WAAA,CAAA,EAAA,IAAA,UAAA,CAAA,OAAA,GAAA,CAAA,CAAA,QAAA,WAAA,EAAA,QAAA,cAAA,EAAA"}
|
|
1
|
+
{"version":3,"file":"dialog.cjs","names":[],"sources":["../src/dialog/dialog-base.mixin.ts","../src/dialog/dialog.component.ts"],"sourcesContent":["import { autoPlacement, autoUpdate, computePosition, offset, shift, size } from '@floating-ui/dom'\nimport { LitElement } from 'lit'\nimport { distinctUntilChanged, filter, fromEvent, map, merge, Subject, takeUntil, tap } from 'rxjs'\nimport type { Constructor } from '../../mixins/constructor'\nimport type { IBaseMixin } from '../../mixins/baseElement'\nimport {\n\tBLACKBIRD_EASING,\n\tDURATION_ENTER,\n\tDURATION_EXIT,\n\tDURATION_BACKDROP,\n\tEASE_OUT,\n\tEASE_IN,\n} from '../utils/animation'\nimport { reducedMotion$ } from '../directives/reduced-motion'\n\n// Mobile breakpoint - matches Tailwind's sm breakpoint\nconst MOBILE_BREAKPOINT = 640\n\n// Tablet breakpoint\nconst TABLET_BREAKPOINT = 1024\n\n/**\n * Fraction of viewport a dialog can occupy before converting to bottom sheet.\n * Tablet (640–1024px): 60% — tighter screens benefit from bottom sheet sooner.\n * Desktop (>1024px): 80% — plenty of room, keep floating longer.\n */\nfunction largeContentThreshold(): number {\n\treturn window.innerWidth < TABLET_BREAKPOINT ? 0.6 : 0.8\n}\n\nexport interface DialogPosition {\n\tx: number\n\ty: number\n}\n\nexport interface VirtualReference {\n\tgetBoundingClientRect: () => DOMRect\n}\n\n/**\n * Interface for the DialogBase mixin methods\n */\nexport interface IDialogBaseMixin {\n\tposition: DialogPosition\n\tisMobile: boolean\n\tdragOffset: number\n\tshow(positionOrEvent?: DialogPosition | MouseEvent | TouchEvent): Promise<boolean>\n\thide(result?: boolean): Promise<void>\n\tisCentered(): boolean\n\tisAnimating(): boolean\n}\n\n/**\n * Dialog mixin with smart positioning using Floating UI.\n *\n * On mobile (< 640px), automatically switches to bottom sheet mode\n * with swipe-to-dismiss gesture. On tablet/desktop, if content exceeds\n * a viewport-dependent threshold, also opens as bottom sheet.\n */\nexport const DialogBase = <T extends Constructor<LitElement & IBaseMixin>>(superClass: T) => {\n\tclass DialogBaseClass extends superClass {\n\t\tposition: DialogPosition = { x: 0, y: 0 }\n\t\tisMobile = false\n\t\tdragOffset = 0\n\n\t\tprotected resolvePromise?: (value: boolean) => void\n\t\tprotected cleanupAutoUpdate?: () => void\n\t\tprotected virtualReference?: VirtualReference\n\n\t\t// Subject to signal when to stop swipe gesture stream\n\t\tprivate readonly stopSwipe$ = new Subject<void>()\n\n\t\t// Focus trap state\n\t\tprivate lastFocusedElement: Element | null = null\n\t\tprivate inertSiblings: HTMLElement[] = []\n\n\t\t// Animation guard\n\t\tprivate animating = false\n\n\t\t/** ElementInternals — used for broadcasting `:state(open)` to consumers. */\n\t\tprotected dialogInternals: ElementInternals | undefined = (() => {\n\t\t\ttry {\n\t\t\t\treturn this.attachInternals()\n\t\t\t} catch {\n\t\t\t\treturn undefined\n\t\t\t}\n\t\t})()\n\n\t\t/**\n\t\t * Check if the dialog is currently animating\n\t\t */\n\t\tisAnimating(): boolean {\n\t\t\treturn this.animating\n\t\t}\n\n\t\t/**\n\t\t * Override in subclass to return the dialog element\n\t\t */\n\t\tprotected getDialogElement(): HTMLElement | null {\n\t\t\treturn null\n\t\t}\n\n\t\t/**\n\t\t * Override in subclass to return the backdrop element for animations\n\t\t */\n\t\tprotected getBackdropElement(): HTMLElement | null {\n\t\t\treturn null\n\t\t}\n\n\t\t/**\n\t\t * Override in subclass to return the drag handle element for swipe gestures\n\t\t */\n\t\tprotected getDragHandleElement(): HTMLElement | null {\n\t\t\treturn null\n\t\t}\n\n\t\tconnectedCallback(): void {\n\t\t\tsuper.connectedCallback()\n\t\t\tthis.setupResizeListener()\n\t\t}\n\n\t\t/**\n\t\t * Listen for resize to switch between mobile/desktop modes\n\t\t */\n\t\tprivate setupResizeListener(): void {\n\t\t\tfromEvent(window, 'resize')\n\t\t\t\t.pipe(\n\t\t\t\t\tmap(() => window.innerWidth < MOBILE_BREAKPOINT),\n\t\t\t\t\tdistinctUntilChanged(),\n\t\t\t\t\tfilter(() => this.hasAttribute('active')),\n\t\t\t\t\ttap(isMobile => {\n\t\t\t\t\t\tif (this.isMobile !== isMobile) {\n\t\t\t\t\t\t\tthis.isMobile = isMobile\n\t\t\t\t\t\t\tthis.requestUpdate()\n\t\t\t\t\t\t\tconst dialog = this.getDialogElement()\n\t\t\t\t\t\t\tif (dialog) {\n\t\t\t\t\t\t\t\tif (isMobile) {\n\t\t\t\t\t\t\t\t\tthis.applyBottomSheetStyles(dialog)\n\t\t\t\t\t\t\t\t\tthis.setupSwipeGesture(dialog)\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\tthis.stopSwipe$.next()\n\t\t\t\t\t\t\t\t\tthis.setupPositioning()\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}),\n\t\t\t\t\ttakeUntil(this.disconnecting),\n\t\t\t\t)\n\t\t\t\t.subscribe()\n\t\t}\n\n\t\t/**\n\t\t * Setup RxJS-based swipe gesture for dialog\n\t\t */\n\t\tprivate setupSwipeGesture(dialog: HTMLElement): void {\n\t\t\t// Stop any existing swipe gesture\n\t\t\tthis.stopSwipe$.next()\n\n\t\t\tlet dragStartY = 0\n\t\t\tlet isDragging = false\n\t\t\tlet currentY = 0\n\n\t\t\tconst dragHandle = this.getDragHandleElement()\n\t\t\tconst dragTarget = dragHandle || dialog\n\n\t\t\tconst touchStart$ = fromEvent<TouchEvent>(dragTarget, 'touchstart', { passive: true }).pipe(\n\t\t\t\ttap(e => {\n\t\t\t\t\tconst touch = e.touches[0]\n\t\t\t\t\tconst rect = dialog.getBoundingClientRect()\n\t\t\t\t\tconst touchY = touch.clientY - rect.top\n\n\t\t\t\t\t// Only allow drag from top 80px or drag handle\n\t\t\t\t\tif (touchY > 80 && !dragHandle) return\n\n\t\t\t\t\tisDragging = true\n\t\t\t\t\tdragStartY = touch.clientY\n\t\t\t\t\tcurrentY = 0\n\t\t\t\t\tthis.dragOffset = 0\n\n\t\t\t\t\t// Disable transitions for immediate feedback\n\t\t\t\t\tdialog.style.transition = 'none'\n\t\t\t\t\tdialog.style.willChange = 'transform'\n\t\t\t\t}),\n\t\t\t)\n\n\t\t\tconst touchMove$ = fromEvent<TouchEvent>(dialog, 'touchmove', { passive: false }).pipe(\n\t\t\t\tfilter(() => isDragging),\n\t\t\t\ttap(e => {\n\t\t\t\t\tconst touch = e.touches[0]\n\t\t\t\t\tconst deltaY = touch.clientY - dragStartY\n\n\t\t\t\t\t// Rubber-band effect for upward drag\n\t\t\t\t\tif (deltaY < 0) {\n\t\t\t\t\t\tcurrentY = deltaY * 0.2\n\t\t\t\t\t} else {\n\t\t\t\t\t\tcurrentY = deltaY\n\t\t\t\t\t}\n\n\t\t\t\t\tthis.dragOffset = Math.max(0, deltaY)\n\n\t\t\t\t\t// Direct DOM update - 1:1 tracking\n\t\t\t\t\tdialog.style.transform = `translateY(${currentY}px)`\n\n\t\t\t\t\te.preventDefault()\n\t\t\t\t}),\n\t\t\t)\n\n\t\t\tconst touchEnd$ = merge(\n\t\t\t\tfromEvent<TouchEvent>(dialog, 'touchend', { passive: true }),\n\t\t\t\tfromEvent<TouchEvent>(dialog, 'touchcancel', { passive: true }),\n\t\t\t).pipe(\n\t\t\t\tfilter(() => isDragging),\n\t\t\t\ttap(() => {\n\t\t\t\t\tisDragging = false\n\n\t\t\t\t\t// Re-enable transitions for snap animation\n\t\t\t\t\tdialog.style.transition = 'transform 0.3s cubic-bezier(0.16, 1, 0.3, 1)'\n\t\t\t\t\tdialog.style.willChange = ''\n\n\t\t\t\t\tconst dialogHeight = dialog.getBoundingClientRect().height\n\t\t\t\t\tconst threshold = Math.min(100, dialogHeight * 0.25)\n\n\t\t\t\t\tif (this.dragOffset > threshold) {\n\t\t\t\t\t\t// Dismiss - animate out\n\t\t\t\t\t\tdialog.style.transform = 'translateY(100%)'\n\t\t\t\t\t\tthis.hide(false)\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// Snap back\n\t\t\t\t\t\tdialog.style.transform = 'translateY(0)'\n\t\t\t\t\t\tthis.dragOffset = 0\n\t\t\t\t\t}\n\t\t\t\t}),\n\t\t\t)\n\n\t\t\t// Merge all touch streams and subscribe\n\t\t\tmerge(touchStart$, touchMove$, touchEnd$)\n\t\t\t\t.pipe(takeUntil(merge(this.stopSwipe$, this.disconnecting)))\n\t\t\t\t.subscribe()\n\t\t}\n\n\t\t/**\n\t\t * Apply bottom sheet styles for mobile\n\t\t */\n\t\tprivate applyBottomSheetStyles(dialog: HTMLElement): void {\n\t\t\tif (this.cleanupAutoUpdate) {\n\t\t\t\tthis.cleanupAutoUpdate()\n\t\t\t\tthis.cleanupAutoUpdate = undefined\n\t\t\t}\n\n\t\t\tObject.assign(dialog.style, {\n\t\t\t\tposition: '',\n\t\t\t\tleft: '',\n\t\t\t\ttop: '',\n\t\t\t\ttransform: '',\n\t\t\t\tmaxWidth: '',\n\t\t\t})\n\t\t}\n\n\t\t/**\n\t\t * Show the dialog at a specific position\n\t\t */\n\t\tasync show(positionOrEvent?: DialogPosition | MouseEvent | TouchEvent): Promise<boolean> {\n\t\t\tif (this.cleanupAutoUpdate) {\n\t\t\t\tthis.cleanupAutoUpdate()\n\t\t\t\tthis.cleanupAutoUpdate = undefined\n\t\t\t}\n\n\t\t\tthis.isMobile = window.innerWidth < MOBILE_BREAKPOINT\n\n\t\t\tlet x: number, y: number\n\n\t\t\tif (!positionOrEvent) {\n\t\t\t\tx = window.innerWidth / 2\n\t\t\t\ty = window.innerHeight / 2\n\t\t\t} else if ('clientX' in positionOrEvent) {\n\t\t\t\tx = positionOrEvent.clientX\n\t\t\t\ty = positionOrEvent.clientY\n\t\t\t} else if ('touches' in positionOrEvent && positionOrEvent.touches.length) {\n\t\t\t\tx = positionOrEvent.touches[0].clientX\n\t\t\t\ty = positionOrEvent.touches[0].clientY\n\t\t\t} else {\n\t\t\t\tconst pos = positionOrEvent as DialogPosition\n\t\t\t\tx = pos.x\n\t\t\t\ty = pos.y\n\t\t\t}\n\n\t\t\tthis.position = { x, y }\n\n\t\t\tthis.virtualReference = {\n\t\t\t\tgetBoundingClientRect: () => new DOMRect(x, y, 0, 0),\n\t\t\t}\n\n\t\t\tthis.requestUpdate()\n\t\t\tawait this.updateComplete\n\n\t\t\tthis.setAttribute('active', '')\n\t\t\tthis.dialogInternals?.states.add('open')\n\t\t\tawait this.updateComplete\n\n\t\t\t// Save focus and set siblings to inert for focus trap\n\t\t\tthis.lastFocusedElement = document.activeElement\n\t\t\tconst parent = this.parentElement\n\t\t\tif (parent) {\n\t\t\t\tthis.inertSiblings = []\n\t\t\t\tfor (let i = 0; i < parent.children.length; i++) {\n\t\t\t\t\tconst sibling = parent.children[i] as HTMLElement\n\t\t\t\t\tif (sibling !== this && 'inert' in sibling) {\n\t\t\t\t\t\tsibling.inert = true\n\t\t\t\t\t\tthis.inertSiblings.push(sibling)\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Escape key listener\n\t\t\tfromEvent<KeyboardEvent>(document, 'keydown')\n\t\t\t\t.pipe(\n\t\t\t\t\tfilter(e => e.key === 'Escape'),\n\t\t\t\t\ttap(e => {\n\t\t\t\t\t\te.preventDefault()\n\t\t\t\t\t\tthis.hide(false)\n\t\t\t\t\t}),\n\t\t\t\t\ttakeUntil(merge(this.stopSwipe$, this.disconnecting)),\n\t\t\t\t)\n\t\t\t\t.subscribe()\n\n\t\t\tconst dialog = this.getDialogElement()\n\n\t\t\t// If content exceeds viewport threshold on desktop, treat as bottom sheet\n\t\t\tconst threshold = largeContentThreshold()\n\t\t\tif (\n\t\t\t\t!this.isMobile &&\n\t\t\t\tdialog &&\n\t\t\t\t(dialog.scrollHeight > window.innerHeight * threshold ||\n\t\t\t\t\tdialog.scrollWidth > window.innerWidth * threshold)\n\t\t\t) {\n\t\t\t\tthis.isMobile = true\n\t\t\t\tthis.requestUpdate()\n\t\t\t\tawait this.updateComplete\n\t\t\t}\n\n\t\t\tif (this.isMobile) {\n\t\t\t\tif (dialog) {\n\t\t\t\t\tthis.applyBottomSheetStyles(dialog)\n\t\t\t\t\tthis.setupSwipeGesture(dialog)\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tthis.setupPositioning()\n\t\t\t}\n\n\t\t\tthis.animating = true\n\t\t\tawait this.animateIn()\n\t\t\tthis.animating = false\n\n\t\t\treturn new Promise<boolean>(resolve => {\n\t\t\t\tthis.resolvePromise = resolve\n\t\t\t})\n\t\t}\n\n\t\t/**\n\t\t * Animate dialog entrance\n\t\t */\n\t\tprivate async animateIn(): Promise<void> {\n\t\t\tconst dialog = this.getDialogElement()\n\t\t\tconst backdrop = this.getBackdropElement()\n\n\t\t\tif (reducedMotion$.value) {\n\t\t\t\tif (backdrop) backdrop.style.opacity = '1'\n\t\t\t\tif (dialog) dialog.style.opacity = '1'\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tbackdrop?.animate([{ opacity: 0 }, { opacity: 1 }], {\n\t\t\t\tduration: DURATION_BACKDROP,\n\t\t\t\teasing: EASE_OUT,\n\t\t\t\tfill: 'forwards',\n\t\t\t})\n\n\t\t\tif (dialog) {\n\t\t\t\tconst animation = this.isMobile\n\t\t\t\t\t? [\n\t\t\t\t\t\t\t{ opacity: 0, transform: 'translateY(100%)' },\n\t\t\t\t\t\t\t{ opacity: 1, transform: 'translateY(0)' },\n\t\t\t\t\t\t]\n\t\t\t\t\t: [\n\t\t\t\t\t\t\t{ opacity: 0, transform: 'scale(0.92) translateY(16px)' },\n\t\t\t\t\t\t\t{ opacity: 1, transform: 'scale(1) translateY(0)' },\n\t\t\t\t\t\t]\n\n\t\t\t\tawait dialog.animate(animation, {\n\t\t\t\t\tduration: DURATION_ENTER,\n\t\t\t\t\teasing: BLACKBIRD_EASING,\n\t\t\t\t\tfill: 'forwards',\n\t\t\t\t}).finished\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * Animate dialog exit\n\t\t */\n\t\tprivate async animateOut(): Promise<void> {\n\t\t\tconst dialog = this.getDialogElement()\n\t\t\tconst backdrop = this.getBackdropElement()\n\n\t\t\tif (reducedMotion$.value) {\n\t\t\t\tif (backdrop) backdrop.style.opacity = '0'\n\t\t\t\tif (dialog) dialog.style.opacity = '0'\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tconst animations: Promise<Animation>[] = []\n\n\t\t\tif (backdrop) {\n\t\t\t\tanimations.push(\n\t\t\t\t\tbackdrop.animate([{ opacity: 1 }, { opacity: 0 }], {\n\t\t\t\t\t\tduration: DURATION_EXIT,\n\t\t\t\t\t\teasing: EASE_OUT,\n\t\t\t\t\t\tfill: 'forwards',\n\t\t\t\t\t}).finished,\n\t\t\t\t)\n\t\t\t}\n\n\t\t\tif (dialog) {\n\t\t\t\tconst animation = this.isMobile\n\t\t\t\t\t? [\n\t\t\t\t\t\t\t{ opacity: 1, transform: 'translateY(0)' },\n\t\t\t\t\t\t\t{ opacity: 0, transform: 'translateY(100%)' },\n\t\t\t\t\t\t]\n\t\t\t\t\t: [\n\t\t\t\t\t\t\t{ opacity: 1, transform: 'scale(1) translateY(0)' },\n\t\t\t\t\t\t\t{ opacity: 0, transform: 'scale(0.95) translateY(8px)' },\n\t\t\t\t\t\t]\n\n\t\t\t\tanimations.push(\n\t\t\t\t\tdialog.animate(animation, {\n\t\t\t\t\t\tduration: DURATION_EXIT,\n\t\t\t\t\t\teasing: EASE_IN,\n\t\t\t\t\t\tfill: 'forwards',\n\t\t\t\t\t}).finished,\n\t\t\t\t)\n\t\t\t}\n\n\t\t\tawait Promise.all(animations)\n\t\t}\n\n\t\t/**\n\t\t * Hide the dialog\n\t\t */\n\t\tasync hide(result = false): Promise<void> {\n\t\t\tthis.stopSwipe$.next()\n\n\t\t\tthis.animating = true\n\t\t\tawait this.animateOut()\n\t\t\tthis.animating = false\n\n\t\t\tthis.removeAttribute('active')\n\t\t\tthis.dialogInternals?.states.delete('open')\n\n\t\t\t// Restore inert siblings\n\t\t\tfor (const el of this.inertSiblings) {\n\t\t\t\tel.inert = false\n\t\t\t}\n\t\t\tthis.inertSiblings = []\n\n\t\t\t// Restore focus\n\t\t\tif (this.lastFocusedElement) {\n\t\t\t\tconst el = this.lastFocusedElement as HTMLElement\n\t\t\t\tif (typeof el.focus === 'function') {\n\t\t\t\t\tel.focus()\n\t\t\t\t}\n\t\t\t\tthis.lastFocusedElement = null\n\t\t\t}\n\n\t\t\tif (this.cleanupAutoUpdate) {\n\t\t\t\tthis.cleanupAutoUpdate()\n\t\t\t\tthis.cleanupAutoUpdate = undefined\n\t\t\t}\n\n\t\t\tif (this.resolvePromise) {\n\t\t\t\tthis.resolvePromise(result)\n\t\t\t\tthis.resolvePromise = undefined\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * Check if position is near center (only skip Floating UI for truly centered dialogs)\n\t\t */\n\t\tisCentered(): boolean {\n\t\t\t// Use tight tolerance (5%) - only skip Floating UI when position is very close to center\n\t\t\tconst toleranceX = window.innerWidth * 0.05\n\t\t\tconst toleranceY = window.innerHeight * 0.05\n\n\t\t\treturn (\n\t\t\t\tMath.abs(this.position.x - window.innerWidth / 2) < toleranceX &&\n\t\t\t\tMath.abs(this.position.y - window.innerHeight / 2) < toleranceY\n\t\t\t)\n\t\t}\n\n\t\t/**\n\t\t * Setup Floating UI positioning for desktop\n\t\t */\n\t\tprivate setupPositioning(): void {\n\t\t\tconst dialog = this.getDialogElement()\n\t\t\tif (!dialog) return\n\n\t\t\tif (this.isCentered()) return\n\n\t\t\tif (this.virtualReference) {\n\t\t\t\tthis.cleanupAutoUpdate = autoUpdate(\n\t\t\t\t\tthis.virtualReference,\n\t\t\t\t\tdialog,\n\t\t\t\t\t() => this.updatePosition(dialog),\n\t\t\t\t\t{\n\t\t\t\t\t\tancestorScroll: true,\n\t\t\t\t\t\tancestorResize: true,\n\t\t\t\t\t\telementResize: true,\n\t\t\t\t\t},\n\t\t\t\t)\n\t\t\t\tthis.updatePosition(dialog)\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * Update position using Floating UI\n\t\t */\n\t\tprivate async updatePosition(dialog: HTMLElement): Promise<void> {\n\t\t\tif (!this.virtualReference) return\n\n\t\t\tconst padding = 16\n\n\t\t\tconst { x, y } = await computePosition(this.virtualReference, dialog, {\n\t\t\t\tstrategy: 'fixed',\n\t\t\t\tmiddleware: [\n\t\t\t\t\toffset(8),\n\t\t\t\t\tautoPlacement({\n\t\t\t\t\t\tpadding,\n\t\t\t\t\t\tallowedPlacements: [\n\t\t\t\t\t\t\t'top-start',\n\t\t\t\t\t\t\t'top-end',\n\t\t\t\t\t\t\t'bottom-start',\n\t\t\t\t\t\t\t'bottom-end',\n\t\t\t\t\t\t\t'left-start',\n\t\t\t\t\t\t\t'left-end',\n\t\t\t\t\t\t\t'right-start',\n\t\t\t\t\t\t\t'right-end',\n\t\t\t\t\t\t],\n\t\t\t\t\t}),\n\t\t\t\t\tshift({ padding }),\n\t\t\t\t\tsize({\n\t\t\t\t\t\tpadding,\n\t\t\t\t\t\tapply({ availableWidth, elements }) {\n\t\t\t\t\t\t\telements.floating.style.maxWidth = `${availableWidth}px`\n\t\t\t\t\t\t},\n\t\t\t\t\t}),\n\t\t\t\t],\n\t\t\t})\n\n\t\t\tObject.assign(dialog.style, {\n\t\t\t\tposition: 'fixed',\n\t\t\t\tleft: `${Math.round(x)}px`,\n\t\t\t\ttop: `${Math.round(y)}px`,\n\t\t\t\ttransform: 'none',\n\t\t\t})\n\t\t}\n\n\t\tdisconnectedCallback(): void {\n\t\t\tthis.stopSwipe$.next()\n\t\t\tif (this.cleanupAutoUpdate) {\n\t\t\t\tthis.cleanupAutoUpdate()\n\t\t\t\tthis.cleanupAutoUpdate = undefined\n\t\t\t}\n\t\t\tsuper.disconnectedCallback()\n\t\t}\n\t}\n\n\treturn DialogBaseClass as Constructor<IDialogBaseMixin> & T\n}\n","import { $LitElement } from '@mixins/index'\nimport { css, html, nothing } from 'lit'\nimport { customElement, property, queryAssignedElements } from 'lit/decorators.js'\nimport { cursorGlow } from '../directives/cursor-glow'\nimport { createRef, ref, type Ref } from 'lit/directives/ref.js'\nimport { when } from 'lit/directives/when.js'\nimport { fromEvent, tap } from 'rxjs'\nimport { takeUntil } from 'rxjs/operators'\nimport { DialogBase } from './dialog-base.mixin'\nimport { DialogHereMorty, DialogWhereAreYouRicky, DialogWhereAreYouRickyEvent } from './dialog-events'\n\n/**\n * Modal dialog — content-only (just a styled panel) or confirm mode (title + message + confirm/cancel buttons). Prefer the imperative `$dialog` service for most use cases; use the element directly only when you want a declaratively-positioned dialog.\n *\n * @element schmancy-dialog\n * @summary Blocks interaction with the rest of the page until dismissed. For quick confirmations, prefer `$dialog.confirm({ ... })` over this element. For arbitrary dialog content driven imperatively, prefer `$dialog.component(MyComponent)`.\n * @platform dialog close - Positioned overlay in light DOM. Degrades to a styled `<dialog>` if the tag never registers — loses custom animations but keeps focus trap + ESC close.\n * @slot default - Content slot for dialog body (used in content mode)\n * @slot content - Named slot for custom content in confirm mode\n * @fires confirm - In confirm mode, when the confirm button is clicked.\n * @fires cancel - In confirm mode, when the cancel button or ESC is activated.\n *\n * @example Content mode (no buttons):\n * <schmancy-dialog>\n * <my-custom-content></my-custom-content>\n * </schmancy-dialog>\n *\n * @example Confirm mode (with buttons):\n * <schmancy-dialog\n * title=\"Delete item?\"\n * message=\"This action cannot be undone.\"\n * confirm-text=\"Delete\"\n * cancel-text=\"Keep\"\n * ></schmancy-dialog>\n */\n@customElement('schmancy-dialog')\nexport class SchmancyDialog extends DialogBase(\n\t$LitElement(css`\n\t\t:host {\n\t\t\tposition: fixed;\n\t\t\tz-index: var(--schmancy-overlay-z, 10000);\n\t\t\tinset: 0;\n\t\t\tdisplay: none;\n\t\t\t--dialog-width: fit-content;\n\t\t}\n\n\t\t:host([active]) {\n\t\t\tdisplay: block;\n\t\t}\n\n\n\t\t/* Luminous glow around the dialog container */\n\t\t.dialog {\n\t\t\tbox-shadow: 0 8px 40px -8px color-mix(in srgb, var(--schmancy-sys-color-primary-default) 15%, transparent);\n\t\t\tborder-radius: var(--schmancy-sys-shape-corner-large);\n\t\t}\n\n\t\t@media (prefers-reduced-motion: reduce) {\n\t\t\t.dialog { box-shadow: var(--schmancy-sys-elevation-2); }\n\t\t}\n\t`),\n) {\n\t/**\n\t * Unique identifier for the dialog instance\n\t */\n\t@property({ type: String, reflect: true }) uid!: string\n\n\t/**\n\t * Dialog title (enables confirm mode when set)\n\t */\n\t@property({ type: String }) title: string | undefined = undefined\n\n\t/**\n\t * Dialog subtitle\n\t */\n\t@property({ type: String }) subtitle: string | undefined = undefined\n\n\t/**\n\t * Dialog message\n\t */\n\t@property({ type: String }) message: string | undefined = undefined\n\n\t/**\n\t * Text for confirm button (enables confirm mode when set with cancelText)\n\t */\n\t@property({ type: String, attribute: 'confirm-text' }) confirmText: string | undefined = undefined\n\n\t/**\n\t * Text for cancel button\n\t */\n\t@property({ type: String, attribute: 'cancel-text' }) cancelText: string | undefined = undefined\n\n\t/**\n\t * Dialog variant (affects button colors in confirm mode)\n\t */\n\t@property({ type: String }) variant: 'default' | 'danger' = 'default'\n\n\t/**\n\t * Whether to hide action buttons (force content mode)\n\t */\n\t@property({ type: Boolean, attribute: 'hide-actions' }) hideActions = false\n\n\t/**\n\t * Slotted children in the named \"content\" slot (confirm mode custom content)\n\t */\n\t@queryAssignedElements({ slot: 'content', flatten: true })\n\tprivate _contentSlotElements!: HTMLElement[]\n\n\t/**\n\t * Ref to the confirm mode wrapper div\n\t */\n\tprivate _confirmDialogRef: Ref<HTMLElement> = createRef()\n\n\t/**\n\t * Ref to the content mode section element\n\t */\n\tprivate _contentDialogRef: Ref<HTMLElement> = createRef()\n\n\t/**\n\t * Ref to the backdrop element for animations\n\t */\n\tprivate _backdropRef: Ref<HTMLElement> = createRef()\n\n\t/**\n\t * Ref to the drag handle element for swipe gestures\n\t */\n\tprivate _dragHandleRef: Ref<HTMLElement> = createRef()\n\n\t/**\n\t * Stable per-instance id used for ARIA labelledby/describedby wiring\n\t */\n\tprivate readonly _a11yId = `schmancy-dialog-${Math.random().toString(36).slice(2, 10)}`\n\tprivate get _titleId() { return `${this._a11yId}-title` }\n\tprivate get _descId() { return `${this._a11yId}-desc` }\n\n\t/**\n\t * Return the dialog element for positioning/size measurement.\n\t * In content mode, returns the first slotted child (the actual component).\n\t * In confirm mode, returns the wrapper div.\n\t */\n\tprotected getDialogElement(): HTMLElement | null {\n\t\t// Content mode: use the section wrapper (slotted content may be display:contents)\n\t\tif (this._contentDialogRef.value) return this._contentDialogRef.value\n\t\t// Confirm mode: use the wrapper div\n\t\treturn this._confirmDialogRef.value ?? null\n\t}\n\n\t/**\n\t * Return the backdrop element for animations\n\t */\n\tprotected getBackdropElement(): HTMLElement | null {\n\t\treturn this._backdropRef.value ?? null\n\t}\n\n\t/**\n\t * Return the drag handle element for swipe gestures\n\t */\n\tprotected getDragHandleElement(): HTMLElement | null {\n\t\treturn this._dragHandleRef.value ?? null\n\t}\n\n\t/**\n\t * Check if dialog is in confirm mode (has buttons)\n\t */\n\tprivate get isConfirmMode(): boolean {\n\t\tif (this.hideActions) return false\n\t\treturn !!(this.confirmText?.trim() && this.cancelText?.trim())\n\t}\n\n\t/**\n\t * Handle component connection to DOM\n\t */\n\tconnectedCallback(): void {\n\t\tsuper.connectedCallback()\n\n\t\t// Listen for \"where are you ricky\" events\n\t\tfromEvent<DialogWhereAreYouRickyEvent>(window, DialogWhereAreYouRicky)\n\t\t\t.pipe(\n\t\t\t\ttap(e => {\n\t\t\t\t\tif (e.detail.uid === this.uid) this.announcePresence()\n\t\t\t\t}),\n\t\t\t\ttakeUntil(this.disconnecting),\n\t\t\t)\n\t\t\t.subscribe()\n\t}\n\n\t/**\n\t * Announce this dialog's presence to the service\n\t */\n\tprivate announcePresence(): void {\n\t\tthis.dispatchEvent(\n\t\t\tnew CustomEvent(DialogHereMorty, {\n\t\t\t\tdetail: { dialog: this },\n\t\t\t\tbubbles: true,\n\t\t\t\tcomposed: true,\n\t\t\t}),\n\t\t)\n\t}\n\n\t/**\n\t * Handle confirm action\n\t */\n\tprivate handleConfirm(): void {\n\t\tthis.hide(true)\n\t\tthis.dispatchEvent(\n\t\t\tnew CustomEvent('confirm', {\n\t\t\t\tbubbles: true,\n\t\t\t\tcomposed: true,\n\t\t\t}),\n\t\t)\n\t}\n\n\t/**\n\t * Handle cancel/close action\n\t */\n\tprivate handleClose(): void {\n\t\tif (this.isAnimating()) return\n\t\tthis.hide(false)\n\t\tthis.dispatchEvent(\n\t\t\tnew CustomEvent(this.isConfirmMode ? 'cancel' : 'close', {\n\t\t\t\tbubbles: true,\n\t\t\t\tcomposed: true,\n\t\t\t}),\n\t\t)\n\t}\n\n\t/**\n\t * Render drag handle for mobile bottom sheet\n\t */\n\tprivate renderDragHandle() {\n\t\treturn html`\n\t\t\t<div ${ref(this._dragHandleRef)} class=\"dialog-drag-handle flex justify-center pt-2 pb-1 cursor-grab active:cursor-grabbing touch-none\">\n\t\t\t\t<div class=\"w-10 h-1 rounded-full bg-outline-variant\"></div>\n\t\t\t</div>\n\t\t`\n\t}\n\n\trender() {\n\t\tconst isCentered = this.isCentered()\n\t\tconst hasCustomContent = this._contentSlotElements?.length > 0\n\n\t\t// Mobile bottom sheet classes\n\t\tconst mobileDialogClasses = {\n\t\t\tdialog: true,\n\t\t\tfixed: true,\n\t\t\t'inset-x-0': true,\n\t\t\t'bottom-0': true,\n\t\t\t'w-full': true,\n\t\t\t'max-h-[90dvh]': true,\n\t\t\t'overflow-hidden': true,\n\t\t\t// Safe area padding for notched devices\n\t\t\t'pb-[env(safe-area-inset-bottom)]': true,\n\t\t}\n\n\t\t// Desktop dialog classes\n\t\tconst desktopDialogClasses = {\n\t\t\tdialog: true,\n\t\t\tfixed: true,\n\t\t\t'w-[var(--dialog-width)]': true,\n\t\t\t'max-w-[calc(100vw-2rem)]': true,\n\t\t\t'max-h-[90dvh]': true,\n\t\t\t'overflow-hidden': true,\n\t\t\t'top-1/2': isCentered,\n\t\t\t'left-1/2': isCentered,\n\t\t\t'-translate-x-1/2': isCentered,\n\t\t\t'-translate-y-1/2': isCentered,\n\t\t}\n\n\t\tconst dialogClasses = this.isMobile ? mobileDialogClasses : desktopDialogClasses\n\n\t\t// Button classes - stack vertically on mobile\n\t\tconst buttonContainerClasses = this.isMobile\n\t\t\t? 'flex flex-col-reverse gap-2 w-full'\n\t\t\t: 'flex justify-end gap-3'\n\n\t\t// Confirm mode: with title/buttons\n\t\tif (this.isConfirmMode) {\n\t\t\tconst hasTitle = !!this.title?.trim()\n\t\t\tconst hasSubtitle = !!this.subtitle?.trim()\n\t\t\tconst hasMessage = !!this.message?.trim()\n\t\t\tconst describedBy = [hasSubtitle && this._descId + '-sub', hasMessage && this._descId + '-msg']\n\t\t\t\t.filter(Boolean)\n\t\t\t\t.join(' ') || ''\n\t\t\treturn html`\n\t\t\t\t<div ${ref(this._backdropRef)} class=\"fixed inset-0 bg-surface-container/10 backdrop-blur-lg backdrop-saturate-150 backdrop-brightness-105\" @click=${this.handleClose}></div>\n\n\t\t\t\t<div\n\t\t\t\t\t${ref(this._confirmDialogRef)}\n\t\t\t\t\tclass=${this.classMap(dialogClasses)}\n\t\t\t\t\trole=\"alertdialog\"\n\t\t\t\t\taria-modal=\"true\"\n\t\t\t\t\taria-labelledby=${hasTitle ? this._titleId : nothing}\n\t\t\t\t\taria-describedby=${describedBy || nothing}\n\t\t\t\t>\n\t\t\t\t\t<schmancy-surface\n\t\t\t\t\t\t${cursorGlow({ radius: 250, intensity: 0.1 })}\n\t\t\t\t\t\trounded=${this.isMobile ? 'top' : 'all'}\n\t\t\t\t\t\ttype=\"glass\"\n\t\t\t\t\t\tfill=\"all\"\n\t\t\t\t\t\tclass=\"overflow-hidden\"\n\t\t\t\t\t>\n\t\t\t\t\t\t${this.isMobile ? this.renderDragHandle() : null}\n\t\t\t\t\t\t<schmancy-scroll direction=\"vertical\" hide class=\"p-4 pt-2\">\n\t\t\t\t\t\t\t<schmancy-form @submit=${this.handleConfirm}>\n\t\t\t\t\t\t\t\t${when(\n\t\t\t\t\t\t\t\t\thasTitle,\n\t\t\t\t\t\t\t\t\t() => html`\n\t\t\t\t\t\t\t\t\t\t<schmancy-typography id=${this._titleId} type=\"title\" token=\"md\" class=\"mb-1\">${this.title}</schmancy-typography>\n\t\t\t\t\t\t\t\t\t\t${when(\n\t\t\t\t\t\t\t\t\t\t\thasSubtitle,\n\t\t\t\t\t\t\t\t\t\t\t() => html`\n\t\t\t\t\t\t\t\t\t\t\t\t<schmancy-typography id=\"${this._descId}-sub\" type=\"subtitle\" token=\"xs\" class=\"mb-2\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t${this.subtitle}\n\t\t\t\t\t\t\t\t\t\t\t\t</schmancy-typography>\n\t\t\t\t\t\t\t\t\t\t\t`,\n\t\t\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t\t\t`,\n\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t\t${hasCustomContent\n\t\t\t\t\t\t\t\t\t? html`<div class=\"mb-4\"><slot name=\"content\"></slot></div>`\n\t\t\t\t\t\t\t\t\t: when(\n\t\t\t\t\t\t\t\t\t\t\thasMessage,\n\t\t\t\t\t\t\t\t\t\t\t() => html`<schmancy-typography id=\"${this._descId}-msg\" type=\"body\" class=\"mb-4\">${this.message}</schmancy-typography>`,\n\t\t\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t\t<div class=${buttonContainerClasses}>\n\t\t\t\t\t\t\t\t\t<schmancy-button\n\t\t\t\t\t\t\t\t\t\tvariant=\"outlined\"\n\t\t\t\t\t\t\t\t\t\t@click=${this.handleClose}\n\t\t\t\t\t\t\t\t\t\tclass=${this.isMobile ? 'w-full' : ''}\n\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t${this.cancelText}\n\t\t\t\t\t\t\t\t\t</schmancy-button>\n\t\t\t\t\t\t\t\t\t<schmancy-button\n\t\t\t\t\t\t\t\t\t\ttype=\"submit\"\n\t\t\t\t\t\t\t\t\t\tvariant=\"filled\"\n\t\t\t\t\t\t\t\t\t\tclass=${this.isMobile ? 'w-full' : ''}\n\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t${this.confirmText}\n\t\t\t\t\t\t\t\t\t</schmancy-button>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t</schmancy-form>\n\t\t\t\t\t\t</schmancy-scroll>\n\t\t\t\t\t</schmancy-surface>\n\t\t\t\t</div>\n\t\t\t`\n\t\t}\n\n\t\t// Content mode: minimal, just slot\n\t\treturn html`\n\t\t\t<div ${ref(this._backdropRef)} class=\"fixed inset-0 bg-surface-container/10 backdrop-blur-lg backdrop-saturate-150 backdrop-brightness-105\" @click=${this.handleClose}></div>\n\n\t\t\t<section ${ref(this._contentDialogRef)} class=${this.classMap(dialogClasses)} role=\"dialog\" aria-modal=\"true\">\n\t\t\t\t<schmancy-surface ${cursorGlow({ radius: 250, intensity: 0.1 })} rounded=${this.isMobile ? 'top' : 'all'} type=\"glass\" fill=\"all\">\n\t\t\t\t\t${this.isMobile ? this.renderDragHandle() : null}\n\t\t\t\t\t<schmancy-scroll direction=\"vertical\" hide class=\"max-h-[85dvh]\">\n\t\t\t\t\t\t<slot></slot>\n\t\t\t\t\t</schmancy-scroll>\n\t\t\t\t</schmancy-surface>\n\t\t\t</section>\n\t\t`\n\t}\n\n\t/**\n\t * Static helper for confirm dialogs\n\t */\n\tstatic async confirm(options: {\n\t\ttitle?: string\n\t\tsubtitle?: string\n\t\tmessage?: string\n\t\tconfirmText?: string\n\t\tcancelText?: string\n\t\tvariant?: 'default' | 'danger'\n\t\tposition?: { x: number; y: number } | MouseEvent | TouchEvent\n\t\twidth?: string\n\t}): Promise<boolean> {\n\t\tlet dialog = document.querySelector('schmancy-dialog[data-static-confirm]') as SchmancyDialog\n\n\t\tif (!dialog) {\n\t\t\tdialog = document.createElement('schmancy-dialog') as SchmancyDialog\n\t\t\tdialog.setAttribute('data-static-confirm', '')\n\t\t\tdocument.body.appendChild(dialog)\n\t\t}\n\n\t\t// Set options\n\t\tdialog.title = options.title\n\t\tdialog.subtitle = options.subtitle\n\t\tdialog.message = options.message\n\t\tdialog.confirmText = options.confirmText ?? 'Confirm'\n\t\tdialog.cancelText = options.cancelText ?? 'Cancel'\n\t\tdialog.variant = options.variant ?? 'default'\n\t\tif (options.width) dialog.style.setProperty('--dialog-width', options.width)\n\n\t\treturn dialog.show(options.position)\n\t}\n\n\t/**\n\t * Simple shorthand - just pass message and optionally an event\n\t */\n\tstatic async ask(message: string, event?: MouseEvent | TouchEvent): Promise<boolean> {\n\t\treturn this.confirm({\n\t\t\tmessage,\n\t\t\tposition: event,\n\t\t})\n\t}\n}\n\n// Alias for backward compatibility\nexport { SchmancyDialog as ConfirmDialog }\n\ndeclare global {\n\tinterface HTMLElementTagNameMap {\n\t\t'schmancy-dialog': SchmancyDialog\n\t}\n}\n"],"mappings":"okBA2DA,IAAa,EAA8D,GAC1E,cAA8B,CAAA,CAAA,YAAA,GAAA,EAAA,CAAA,MAAA,GAAA,EAAA,CAAA,KAAA,SACF,CAAE,EAAG,EAAG,EAAG,EAAA,CAAA,KAAA,SAAA,CAC3B,EAAA,KAAA,WACE,EAAA,KAAA,WAOiB,IAAI,EAAA,QAAA,KAAA,mBAGW,KAAA,KAAA,cACN,EAAA,CAAA,KAAA,UAAA,CAGnB,EAAA,KAAA,qBAAA,CAInB,GAAA,CACC,OAAO,KAAK,iBAAA,MAAA,CAEZ,WAAA,CAOF,aAAA,CACC,OAAO,KAAK,UAMb,kBAAA,CACC,OAAO,KAMR,oBAAA,CACC,OAAO,KAMR,sBAAA,CACC,OAAO,KAGR,mBAAA,CACC,MAAM,mBAAA,CACN,KAAK,qBAAA,CAMN,qBAAA,EACC,EAAA,EAAA,WAAU,OAAQ,SAAA,CAChB,MAAA,EAAA,EAAA,SACU,OAAO,WA/GI,IAAA,EA+G2B,EAAA,EAAA,uBAAA,EAC1B,EAAA,EAAA,YACT,KAAK,aAAa,SAAA,CAAA,EAAU,EAAA,EAAA,KACrC,GAAA,CACH,GAAI,KAAK,WAAa,EAAU,CAC/B,KAAK,SAAW,EAChB,KAAK,eAAA,CACL,IAAM,EAAS,KAAK,kBAAA,CAChB,IACC,GACH,KAAK,uBAAuB,EAAA,CAC5B,KAAK,kBAAkB,EAAA,GAEvB,KAAK,WAAW,MAAA,CAChB,KAAK,kBAAA,KAAA,EAIP,EAAA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CAAA,CAAA,CAAiB,EAAA,UAAA,cAAA,IAAA,GAAA,CAAA,EAAA,EAAA,EAAA,EAAA,EAAA,uBAKhC,CAAE,KAAM,UAAW,QAAA,CAAS,EAAA,CAAA,CAAA,CAAO,EAAA,UAAA,uBAAA,IAAA,GAAA,CAAA,EAAA,EAAA,EAAA,EAAA,EAAA,EAAA,eAtE5C,kBAAA,CAAA,CAAkB,EAAA,CAAA,QAAA,QAAA,EAAA,EAAA,OAAA,eAAA,QAAA,gBAAA,CAAA,WAAA,CAAA,EAAA,IAAA,UAAA,CAAA,OAAA,GAAA,CAAA,CAAA,OAAA,eAAA,QAAA,iBAAA,CAAA,WAAA,CAAA,EAAA,IAAA,UAAA,CAAA,OAAA,GAAA,CAAA,CAAA,QAAA,WAAA,EAAA,QAAA,cAAA,EAAA"}
|
package/dist/dialog.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dialog.js","names":[],"sources":["../src/dialog/dialog-base.mixin.ts","../src/dialog/dialog.component.ts"],"sourcesContent":["import { autoPlacement, autoUpdate, computePosition, offset, shift, size } from '@floating-ui/dom'\nimport { LitElement } from 'lit'\nimport { distinctUntilChanged, filter, fromEvent, map, merge, Subject, takeUntil, tap } from 'rxjs'\nimport type { Constructor } from '../../mixins/constructor'\nimport type { IBaseMixin } from '../../mixins/baseElement'\nimport {\n\tBLACKBIRD_EASING,\n\tDURATION_ENTER,\n\tDURATION_EXIT,\n\tDURATION_BACKDROP,\n\tEASE_OUT,\n\tEASE_IN,\n} from '../utils/animation'\nimport { reducedMotion$ } from '../directives/reduced-motion'\n\n// Mobile breakpoint - matches Tailwind's sm breakpoint\nconst MOBILE_BREAKPOINT = 640\n\n// Tablet breakpoint\nconst TABLET_BREAKPOINT = 1024\n\n/**\n * Fraction of viewport a dialog can occupy before converting to bottom sheet.\n * Tablet (640–1024px): 60% — tighter screens benefit from bottom sheet sooner.\n * Desktop (>1024px): 80% — plenty of room, keep floating longer.\n */\nfunction largeContentThreshold(): number {\n\treturn window.innerWidth < TABLET_BREAKPOINT ? 0.6 : 0.8\n}\n\nexport interface DialogPosition {\n\tx: number\n\ty: number\n}\n\nexport interface VirtualReference {\n\tgetBoundingClientRect: () => DOMRect\n}\n\n/**\n * Interface for the DialogBase mixin methods\n */\nexport interface IDialogBaseMixin {\n\tposition: DialogPosition\n\tisMobile: boolean\n\tdragOffset: number\n\tshow(positionOrEvent?: DialogPosition | MouseEvent | TouchEvent): Promise<boolean>\n\thide(result?: boolean): Promise<void>\n\tisCentered(): boolean\n\tisAnimating(): boolean\n}\n\n/**\n * Dialog mixin with smart positioning using Floating UI.\n *\n * On mobile (< 640px), automatically switches to bottom sheet mode\n * with swipe-to-dismiss gesture. On tablet/desktop, if content exceeds\n * a viewport-dependent threshold, also opens as bottom sheet.\n */\nexport const DialogBase = <T extends Constructor<LitElement & IBaseMixin>>(superClass: T) => {\n\tclass DialogBaseClass extends superClass {\n\t\tposition: DialogPosition = { x: 0, y: 0 }\n\t\tisMobile = false\n\t\tdragOffset = 0\n\n\t\tprotected resolvePromise?: (value: boolean) => void\n\t\tprotected cleanupAutoUpdate?: () => void\n\t\tprotected virtualReference?: VirtualReference\n\n\t\t// Subject to signal when to stop swipe gesture stream\n\t\tprivate readonly stopSwipe$ = new Subject<void>()\n\n\t\t// Focus trap state\n\t\tprivate lastFocusedElement: Element | null = null\n\t\tprivate inertSiblings: HTMLElement[] = []\n\n\t\t// Animation guard\n\t\tprivate animating = false\n\n\t\t/** ElementInternals — used for broadcasting `:state(open)` to consumers. */\n\t\tprotected dialogInternals: ElementInternals | undefined = (() => {\n\t\t\ttry {\n\t\t\t\treturn this.attachInternals()\n\t\t\t} catch {\n\t\t\t\treturn undefined\n\t\t\t}\n\t\t})()\n\n\t\t/**\n\t\t * Check if the dialog is currently animating\n\t\t */\n\t\tisAnimating(): boolean {\n\t\t\treturn this.animating\n\t\t}\n\n\t\t/**\n\t\t * Override in subclass to return the dialog element\n\t\t */\n\t\tprotected getDialogElement(): HTMLElement | null {\n\t\t\treturn null\n\t\t}\n\n\t\t/**\n\t\t * Override in subclass to return the backdrop element for animations\n\t\t */\n\t\tprotected getBackdropElement(): HTMLElement | null {\n\t\t\treturn null\n\t\t}\n\n\t\t/**\n\t\t * Override in subclass to return the drag handle element for swipe gestures\n\t\t */\n\t\tprotected getDragHandleElement(): HTMLElement | null {\n\t\t\treturn null\n\t\t}\n\n\t\tconnectedCallback(): void {\n\t\t\tsuper.connectedCallback()\n\t\t\tthis.setupResizeListener()\n\t\t}\n\n\t\t/**\n\t\t * Listen for resize to switch between mobile/desktop modes\n\t\t */\n\t\tprivate setupResizeListener(): void {\n\t\t\tfromEvent(window, 'resize')\n\t\t\t\t.pipe(\n\t\t\t\t\tmap(() => window.innerWidth < MOBILE_BREAKPOINT),\n\t\t\t\t\tdistinctUntilChanged(),\n\t\t\t\t\tfilter(() => this.hasAttribute('active')),\n\t\t\t\t\ttap(isMobile => {\n\t\t\t\t\t\tif (this.isMobile !== isMobile) {\n\t\t\t\t\t\t\tthis.isMobile = isMobile\n\t\t\t\t\t\t\tthis.requestUpdate()\n\t\t\t\t\t\t\tconst dialog = this.getDialogElement()\n\t\t\t\t\t\t\tif (dialog) {\n\t\t\t\t\t\t\t\tif (isMobile) {\n\t\t\t\t\t\t\t\t\tthis.applyBottomSheetStyles(dialog)\n\t\t\t\t\t\t\t\t\tthis.setupSwipeGesture(dialog)\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\tthis.stopSwipe$.next()\n\t\t\t\t\t\t\t\t\tthis.setupPositioning()\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}),\n\t\t\t\t\ttakeUntil(this.disconnecting),\n\t\t\t\t)\n\t\t\t\t.subscribe()\n\t\t}\n\n\t\t/**\n\t\t * Setup RxJS-based swipe gesture for dialog\n\t\t */\n\t\tprivate setupSwipeGesture(dialog: HTMLElement): void {\n\t\t\t// Stop any existing swipe gesture\n\t\t\tthis.stopSwipe$.next()\n\n\t\t\tlet dragStartY = 0\n\t\t\tlet isDragging = false\n\t\t\tlet currentY = 0\n\n\t\t\tconst dragHandle = this.getDragHandleElement()\n\t\t\tconst dragTarget = dragHandle || dialog\n\n\t\t\tconst touchStart$ = fromEvent<TouchEvent>(dragTarget, 'touchstart', { passive: true }).pipe(\n\t\t\t\ttap(e => {\n\t\t\t\t\tconst touch = e.touches[0]\n\t\t\t\t\tconst rect = dialog.getBoundingClientRect()\n\t\t\t\t\tconst touchY = touch.clientY - rect.top\n\n\t\t\t\t\t// Only allow drag from top 80px or drag handle\n\t\t\t\t\tif (touchY > 80 && !dragHandle) return\n\n\t\t\t\t\tisDragging = true\n\t\t\t\t\tdragStartY = touch.clientY\n\t\t\t\t\tcurrentY = 0\n\t\t\t\t\tthis.dragOffset = 0\n\n\t\t\t\t\t// Disable transitions for immediate feedback\n\t\t\t\t\tdialog.style.transition = 'none'\n\t\t\t\t\tdialog.style.willChange = 'transform'\n\t\t\t\t}),\n\t\t\t)\n\n\t\t\tconst touchMove$ = fromEvent<TouchEvent>(dialog, 'touchmove', { passive: false }).pipe(\n\t\t\t\tfilter(() => isDragging),\n\t\t\t\ttap(e => {\n\t\t\t\t\tconst touch = e.touches[0]\n\t\t\t\t\tconst deltaY = touch.clientY - dragStartY\n\n\t\t\t\t\t// Rubber-band effect for upward drag\n\t\t\t\t\tif (deltaY < 0) {\n\t\t\t\t\t\tcurrentY = deltaY * 0.2\n\t\t\t\t\t} else {\n\t\t\t\t\t\tcurrentY = deltaY\n\t\t\t\t\t}\n\n\t\t\t\t\tthis.dragOffset = Math.max(0, deltaY)\n\n\t\t\t\t\t// Direct DOM update - 1:1 tracking\n\t\t\t\t\tdialog.style.transform = `translateY(${currentY}px)`\n\n\t\t\t\t\te.preventDefault()\n\t\t\t\t}),\n\t\t\t)\n\n\t\t\tconst touchEnd$ = merge(\n\t\t\t\tfromEvent<TouchEvent>(dialog, 'touchend', { passive: true }),\n\t\t\t\tfromEvent<TouchEvent>(dialog, 'touchcancel', { passive: true }),\n\t\t\t).pipe(\n\t\t\t\tfilter(() => isDragging),\n\t\t\t\ttap(() => {\n\t\t\t\t\tisDragging = false\n\n\t\t\t\t\t// Re-enable transitions for snap animation\n\t\t\t\t\tdialog.style.transition = 'transform 0.3s cubic-bezier(0.16, 1, 0.3, 1)'\n\t\t\t\t\tdialog.style.willChange = ''\n\n\t\t\t\t\tconst dialogHeight = dialog.getBoundingClientRect().height\n\t\t\t\t\tconst threshold = Math.min(100, dialogHeight * 0.25)\n\n\t\t\t\t\tif (this.dragOffset > threshold) {\n\t\t\t\t\t\t// Dismiss - animate out\n\t\t\t\t\t\tdialog.style.transform = 'translateY(100%)'\n\t\t\t\t\t\tthis.hide(false)\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// Snap back\n\t\t\t\t\t\tdialog.style.transform = 'translateY(0)'\n\t\t\t\t\t\tthis.dragOffset = 0\n\t\t\t\t\t}\n\t\t\t\t}),\n\t\t\t)\n\n\t\t\t// Merge all touch streams and subscribe\n\t\t\tmerge(touchStart$, touchMove$, touchEnd$)\n\t\t\t\t.pipe(takeUntil(merge(this.stopSwipe$, this.disconnecting)))\n\t\t\t\t.subscribe()\n\t\t}\n\n\t\t/**\n\t\t * Apply bottom sheet styles for mobile\n\t\t */\n\t\tprivate applyBottomSheetStyles(dialog: HTMLElement): void {\n\t\t\tif (this.cleanupAutoUpdate) {\n\t\t\t\tthis.cleanupAutoUpdate()\n\t\t\t\tthis.cleanupAutoUpdate = undefined\n\t\t\t}\n\n\t\t\tObject.assign(dialog.style, {\n\t\t\t\tposition: '',\n\t\t\t\tleft: '',\n\t\t\t\ttop: '',\n\t\t\t\ttransform: '',\n\t\t\t\tmaxWidth: '',\n\t\t\t})\n\t\t}\n\n\t\t/**\n\t\t * Show the dialog at a specific position\n\t\t */\n\t\tasync show(positionOrEvent?: DialogPosition | MouseEvent | TouchEvent): Promise<boolean> {\n\t\t\tif (this.cleanupAutoUpdate) {\n\t\t\t\tthis.cleanupAutoUpdate()\n\t\t\t\tthis.cleanupAutoUpdate = undefined\n\t\t\t}\n\n\t\t\tthis.isMobile = window.innerWidth < MOBILE_BREAKPOINT\n\n\t\t\tlet x: number, y: number\n\n\t\t\tif (!positionOrEvent) {\n\t\t\t\tx = window.innerWidth / 2\n\t\t\t\ty = window.innerHeight / 2\n\t\t\t} else if ('clientX' in positionOrEvent) {\n\t\t\t\tx = positionOrEvent.clientX\n\t\t\t\ty = positionOrEvent.clientY\n\t\t\t} else if ('touches' in positionOrEvent && positionOrEvent.touches.length) {\n\t\t\t\tx = positionOrEvent.touches[0].clientX\n\t\t\t\ty = positionOrEvent.touches[0].clientY\n\t\t\t} else {\n\t\t\t\tconst pos = positionOrEvent as DialogPosition\n\t\t\t\tx = pos.x\n\t\t\t\ty = pos.y\n\t\t\t}\n\n\t\t\tthis.position = { x, y }\n\n\t\t\tthis.virtualReference = {\n\t\t\t\tgetBoundingClientRect: () => new DOMRect(x, y, 0, 0),\n\t\t\t}\n\n\t\t\tthis.requestUpdate()\n\t\t\tawait this.updateComplete\n\n\t\t\tthis.setAttribute('active', '')\n\t\t\tthis.dialogInternals?.states.add('open')\n\t\t\tawait this.updateComplete\n\n\t\t\t// Save focus and set siblings to inert for focus trap\n\t\t\tthis.lastFocusedElement = document.activeElement\n\t\t\tconst parent = this.parentElement\n\t\t\tif (parent) {\n\t\t\t\tthis.inertSiblings = []\n\t\t\t\tfor (let i = 0; i < parent.children.length; i++) {\n\t\t\t\t\tconst sibling = parent.children[i] as HTMLElement\n\t\t\t\t\tif (sibling !== this && 'inert' in sibling) {\n\t\t\t\t\t\tsibling.inert = true\n\t\t\t\t\t\tthis.inertSiblings.push(sibling)\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Escape key listener\n\t\t\tfromEvent<KeyboardEvent>(document, 'keydown')\n\t\t\t\t.pipe(\n\t\t\t\t\tfilter(e => e.key === 'Escape'),\n\t\t\t\t\ttap(e => {\n\t\t\t\t\t\te.preventDefault()\n\t\t\t\t\t\tthis.hide(false)\n\t\t\t\t\t}),\n\t\t\t\t\ttakeUntil(merge(this.stopSwipe$, this.disconnecting)),\n\t\t\t\t)\n\t\t\t\t.subscribe()\n\n\t\t\tconst dialog = this.getDialogElement()\n\n\t\t\t// If content exceeds viewport threshold on desktop, treat as bottom sheet\n\t\t\tconst threshold = largeContentThreshold()\n\t\t\tif (\n\t\t\t\t!this.isMobile &&\n\t\t\t\tdialog &&\n\t\t\t\t(dialog.scrollHeight > window.innerHeight * threshold ||\n\t\t\t\t\tdialog.scrollWidth > window.innerWidth * threshold)\n\t\t\t) {\n\t\t\t\tthis.isMobile = true\n\t\t\t\tthis.requestUpdate()\n\t\t\t\tawait this.updateComplete\n\t\t\t}\n\n\t\t\tif (this.isMobile) {\n\t\t\t\tif (dialog) {\n\t\t\t\t\tthis.applyBottomSheetStyles(dialog)\n\t\t\t\t\tthis.setupSwipeGesture(dialog)\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tthis.setupPositioning()\n\t\t\t}\n\n\t\t\tthis.animating = true\n\t\t\tawait this.animateIn()\n\t\t\tthis.animating = false\n\n\t\t\treturn new Promise<boolean>(resolve => {\n\t\t\t\tthis.resolvePromise = resolve\n\t\t\t})\n\t\t}\n\n\t\t/**\n\t\t * Animate dialog entrance\n\t\t */\n\t\tprivate async animateIn(): Promise<void> {\n\t\t\tconst dialog = this.getDialogElement()\n\t\t\tconst backdrop = this.getBackdropElement()\n\n\t\t\tif (reducedMotion$.value) {\n\t\t\t\tif (backdrop) backdrop.style.opacity = '1'\n\t\t\t\tif (dialog) dialog.style.opacity = '1'\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tbackdrop?.animate([{ opacity: 0 }, { opacity: 1 }], {\n\t\t\t\tduration: DURATION_BACKDROP,\n\t\t\t\teasing: EASE_OUT,\n\t\t\t\tfill: 'forwards',\n\t\t\t})\n\n\t\t\tif (dialog) {\n\t\t\t\tconst animation = this.isMobile\n\t\t\t\t\t? [\n\t\t\t\t\t\t\t{ opacity: 0, transform: 'translateY(100%)' },\n\t\t\t\t\t\t\t{ opacity: 1, transform: 'translateY(0)' },\n\t\t\t\t\t\t]\n\t\t\t\t\t: [\n\t\t\t\t\t\t\t{ opacity: 0, transform: 'scale(0.92) translateY(16px)' },\n\t\t\t\t\t\t\t{ opacity: 1, transform: 'scale(1) translateY(0)' },\n\t\t\t\t\t\t]\n\n\t\t\t\tawait dialog.animate(animation, {\n\t\t\t\t\tduration: DURATION_ENTER,\n\t\t\t\t\teasing: BLACKBIRD_EASING,\n\t\t\t\t\tfill: 'forwards',\n\t\t\t\t}).finished\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * Animate dialog exit\n\t\t */\n\t\tprivate async animateOut(): Promise<void> {\n\t\t\tconst dialog = this.getDialogElement()\n\t\t\tconst backdrop = this.getBackdropElement()\n\n\t\t\tif (reducedMotion$.value) {\n\t\t\t\tif (backdrop) backdrop.style.opacity = '0'\n\t\t\t\tif (dialog) dialog.style.opacity = '0'\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tconst animations: Promise<Animation>[] = []\n\n\t\t\tif (backdrop) {\n\t\t\t\tanimations.push(\n\t\t\t\t\tbackdrop.animate([{ opacity: 1 }, { opacity: 0 }], {\n\t\t\t\t\t\tduration: DURATION_EXIT,\n\t\t\t\t\t\teasing: EASE_OUT,\n\t\t\t\t\t\tfill: 'forwards',\n\t\t\t\t\t}).finished,\n\t\t\t\t)\n\t\t\t}\n\n\t\t\tif (dialog) {\n\t\t\t\tconst animation = this.isMobile\n\t\t\t\t\t? [\n\t\t\t\t\t\t\t{ opacity: 1, transform: 'translateY(0)' },\n\t\t\t\t\t\t\t{ opacity: 0, transform: 'translateY(100%)' },\n\t\t\t\t\t\t]\n\t\t\t\t\t: [\n\t\t\t\t\t\t\t{ opacity: 1, transform: 'scale(1) translateY(0)' },\n\t\t\t\t\t\t\t{ opacity: 0, transform: 'scale(0.95) translateY(8px)' },\n\t\t\t\t\t\t]\n\n\t\t\t\tanimations.push(\n\t\t\t\t\tdialog.animate(animation, {\n\t\t\t\t\t\tduration: DURATION_EXIT,\n\t\t\t\t\t\teasing: EASE_IN,\n\t\t\t\t\t\tfill: 'forwards',\n\t\t\t\t\t}).finished,\n\t\t\t\t)\n\t\t\t}\n\n\t\t\tawait Promise.all(animations)\n\t\t}\n\n\t\t/**\n\t\t * Hide the dialog\n\t\t */\n\t\tasync hide(result = false): Promise<void> {\n\t\t\tthis.stopSwipe$.next()\n\n\t\t\tthis.animating = true\n\t\t\tawait this.animateOut()\n\t\t\tthis.animating = false\n\n\t\t\tthis.removeAttribute('active')\n\t\t\tthis.dialogInternals?.states.delete('open')\n\n\t\t\t// Restore inert siblings\n\t\t\tfor (const el of this.inertSiblings) {\n\t\t\t\tel.inert = false\n\t\t\t}\n\t\t\tthis.inertSiblings = []\n\n\t\t\t// Restore focus\n\t\t\tif (this.lastFocusedElement) {\n\t\t\t\tconst el = this.lastFocusedElement as HTMLElement\n\t\t\t\tif (typeof el.focus === 'function') {\n\t\t\t\t\tel.focus()\n\t\t\t\t}\n\t\t\t\tthis.lastFocusedElement = null\n\t\t\t}\n\n\t\t\tif (this.cleanupAutoUpdate) {\n\t\t\t\tthis.cleanupAutoUpdate()\n\t\t\t\tthis.cleanupAutoUpdate = undefined\n\t\t\t}\n\n\t\t\tif (this.resolvePromise) {\n\t\t\t\tthis.resolvePromise(result)\n\t\t\t\tthis.resolvePromise = undefined\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * Check if position is near center (only skip Floating UI for truly centered dialogs)\n\t\t */\n\t\tisCentered(): boolean {\n\t\t\t// Use tight tolerance (5%) - only skip Floating UI when position is very close to center\n\t\t\tconst toleranceX = window.innerWidth * 0.05\n\t\t\tconst toleranceY = window.innerHeight * 0.05\n\n\t\t\treturn (\n\t\t\t\tMath.abs(this.position.x - window.innerWidth / 2) < toleranceX &&\n\t\t\t\tMath.abs(this.position.y - window.innerHeight / 2) < toleranceY\n\t\t\t)\n\t\t}\n\n\t\t/**\n\t\t * Setup Floating UI positioning for desktop\n\t\t */\n\t\tprivate setupPositioning(): void {\n\t\t\tconst dialog = this.getDialogElement()\n\t\t\tif (!dialog) return\n\n\t\t\tif (this.isCentered()) return\n\n\t\t\tif (this.virtualReference) {\n\t\t\t\tthis.cleanupAutoUpdate = autoUpdate(\n\t\t\t\t\tthis.virtualReference,\n\t\t\t\t\tdialog,\n\t\t\t\t\t() => this.updatePosition(dialog),\n\t\t\t\t\t{\n\t\t\t\t\t\tancestorScroll: true,\n\t\t\t\t\t\tancestorResize: true,\n\t\t\t\t\t\telementResize: true,\n\t\t\t\t\t},\n\t\t\t\t)\n\t\t\t\tthis.updatePosition(dialog)\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * Update position using Floating UI\n\t\t */\n\t\tprivate async updatePosition(dialog: HTMLElement): Promise<void> {\n\t\t\tif (!this.virtualReference) return\n\n\t\t\tconst padding = 16\n\n\t\t\tconst { x, y } = await computePosition(this.virtualReference, dialog, {\n\t\t\t\tstrategy: 'fixed',\n\t\t\t\tmiddleware: [\n\t\t\t\t\toffset(8),\n\t\t\t\t\tautoPlacement({\n\t\t\t\t\t\tpadding,\n\t\t\t\t\t\tallowedPlacements: [\n\t\t\t\t\t\t\t'top-start',\n\t\t\t\t\t\t\t'top-end',\n\t\t\t\t\t\t\t'bottom-start',\n\t\t\t\t\t\t\t'bottom-end',\n\t\t\t\t\t\t\t'left-start',\n\t\t\t\t\t\t\t'left-end',\n\t\t\t\t\t\t\t'right-start',\n\t\t\t\t\t\t\t'right-end',\n\t\t\t\t\t\t],\n\t\t\t\t\t}),\n\t\t\t\t\tshift({ padding }),\n\t\t\t\t\tsize({\n\t\t\t\t\t\tpadding,\n\t\t\t\t\t\tapply({ availableWidth, elements }) {\n\t\t\t\t\t\t\telements.floating.style.maxWidth = `${availableWidth}px`\n\t\t\t\t\t\t},\n\t\t\t\t\t}),\n\t\t\t\t],\n\t\t\t})\n\n\t\t\tObject.assign(dialog.style, {\n\t\t\t\tposition: 'fixed',\n\t\t\t\tleft: `${Math.round(x)}px`,\n\t\t\t\ttop: `${Math.round(y)}px`,\n\t\t\t\ttransform: 'none',\n\t\t\t})\n\t\t}\n\n\t\tdisconnectedCallback(): void {\n\t\t\tthis.stopSwipe$.next()\n\t\t\tif (this.cleanupAutoUpdate) {\n\t\t\t\tthis.cleanupAutoUpdate()\n\t\t\t\tthis.cleanupAutoUpdate = undefined\n\t\t\t}\n\t\t\tsuper.disconnectedCallback()\n\t\t}\n\t}\n\n\treturn DialogBaseClass as Constructor<IDialogBaseMixin> & T\n}\n","import { $LitElement } from '@mixins/index'\nimport { css, html, nothing } from 'lit'\nimport { customElement, property, queryAssignedElements } from 'lit/decorators.js'\nimport { cursorGlow } from '../directives/cursor-glow'\nimport { createRef, ref, type Ref } from 'lit/directives/ref.js'\nimport { when } from 'lit/directives/when.js'\nimport { fromEvent, tap } from 'rxjs'\nimport { takeUntil } from 'rxjs/operators'\nimport { DialogBase } from './dialog-base.mixin'\nimport { DialogHereMorty, DialogWhereAreYouRicky, DialogWhereAreYouRickyEvent } from './dialog-events'\n\n/**\n * Unified dialog component that handles both content-only and confirm modes.\n *\n * @element schmancy-dialog\n * @slot default - Content slot for dialog body (used in content mode)\n * @slot content - Named slot for custom content in confirm mode\n *\n * @example Content mode (no buttons):\n * ```html\n * <schmancy-dialog>\n * <my-custom-content></my-custom-content>\n * </schmancy-dialog>\n * ```\n *\n * @example Confirm mode (with buttons):\n * ```html\n * <schmancy-dialog\n * title=\"Confirm Action\"\n * message=\"Are you sure?\"\n * confirm-text=\"Yes\"\n * cancel-text=\"No\"\n * ></schmancy-dialog>\n * ```\n */\n@customElement('schmancy-dialog')\nexport class SchmancyDialog extends DialogBase(\n\t$LitElement(css`\n\t\t:host {\n\t\t\tposition: fixed;\n\t\t\tz-index: var(--schmancy-overlay-z, 10000);\n\t\t\tinset: 0;\n\t\t\tdisplay: none;\n\t\t\t--dialog-width: fit-content;\n\t\t}\n\n\t\t:host([active]) {\n\t\t\tdisplay: block;\n\t\t}\n\n\n\t\t/* Luminous glow around the dialog container */\n\t\t.dialog {\n\t\t\tbox-shadow: 0 8px 40px -8px color-mix(in srgb, var(--schmancy-sys-color-primary-default) 15%, transparent);\n\t\t\tborder-radius: var(--schmancy-sys-shape-corner-large);\n\t\t}\n\n\t\t@media (prefers-reduced-motion: reduce) {\n\t\t\t.dialog { box-shadow: var(--schmancy-sys-elevation-2); }\n\t\t}\n\t`),\n) {\n\t/**\n\t * Unique identifier for the dialog instance\n\t */\n\t@property({ type: String, reflect: true }) uid!: string\n\n\t/**\n\t * Dialog title (enables confirm mode when set)\n\t */\n\t@property({ type: String }) title: string | undefined = undefined\n\n\t/**\n\t * Dialog subtitle\n\t */\n\t@property({ type: String }) subtitle: string | undefined = undefined\n\n\t/**\n\t * Dialog message\n\t */\n\t@property({ type: String }) message: string | undefined = undefined\n\n\t/**\n\t * Text for confirm button (enables confirm mode when set with cancelText)\n\t */\n\t@property({ type: String, attribute: 'confirm-text' }) confirmText: string | undefined = undefined\n\n\t/**\n\t * Text for cancel button\n\t */\n\t@property({ type: String, attribute: 'cancel-text' }) cancelText: string | undefined = undefined\n\n\t/**\n\t * Dialog variant (affects button colors in confirm mode)\n\t */\n\t@property({ type: String }) variant: 'default' | 'danger' = 'default'\n\n\t/**\n\t * Whether to hide action buttons (force content mode)\n\t */\n\t@property({ type: Boolean, attribute: 'hide-actions' }) hideActions = false\n\n\t/**\n\t * Slotted children in the named \"content\" slot (confirm mode custom content)\n\t */\n\t@queryAssignedElements({ slot: 'content', flatten: true })\n\tprivate _contentSlotElements!: HTMLElement[]\n\n\t/**\n\t * Ref to the confirm mode wrapper div\n\t */\n\tprivate _confirmDialogRef: Ref<HTMLElement> = createRef()\n\n\t/**\n\t * Ref to the content mode section element\n\t */\n\tprivate _contentDialogRef: Ref<HTMLElement> = createRef()\n\n\t/**\n\t * Ref to the backdrop element for animations\n\t */\n\tprivate _backdropRef: Ref<HTMLElement> = createRef()\n\n\t/**\n\t * Ref to the drag handle element for swipe gestures\n\t */\n\tprivate _dragHandleRef: Ref<HTMLElement> = createRef()\n\n\t/**\n\t * Stable per-instance id used for ARIA labelledby/describedby wiring\n\t */\n\tprivate readonly _a11yId = `schmancy-dialog-${Math.random().toString(36).slice(2, 10)}`\n\tprivate get _titleId() { return `${this._a11yId}-title` }\n\tprivate get _descId() { return `${this._a11yId}-desc` }\n\n\t/**\n\t * Return the dialog element for positioning/size measurement.\n\t * In content mode, returns the first slotted child (the actual component).\n\t * In confirm mode, returns the wrapper div.\n\t */\n\tprotected getDialogElement(): HTMLElement | null {\n\t\t// Content mode: use the section wrapper (slotted content may be display:contents)\n\t\tif (this._contentDialogRef.value) return this._contentDialogRef.value\n\t\t// Confirm mode: use the wrapper div\n\t\treturn this._confirmDialogRef.value ?? null\n\t}\n\n\t/**\n\t * Return the backdrop element for animations\n\t */\n\tprotected getBackdropElement(): HTMLElement | null {\n\t\treturn this._backdropRef.value ?? null\n\t}\n\n\t/**\n\t * Return the drag handle element for swipe gestures\n\t */\n\tprotected getDragHandleElement(): HTMLElement | null {\n\t\treturn this._dragHandleRef.value ?? null\n\t}\n\n\t/**\n\t * Check if dialog is in confirm mode (has buttons)\n\t */\n\tprivate get isConfirmMode(): boolean {\n\t\tif (this.hideActions) return false\n\t\treturn !!(this.confirmText?.trim() && this.cancelText?.trim())\n\t}\n\n\t/**\n\t * Handle component connection to DOM\n\t */\n\tconnectedCallback(): void {\n\t\tsuper.connectedCallback()\n\n\t\t// Listen for \"where are you ricky\" events\n\t\tfromEvent<DialogWhereAreYouRickyEvent>(window, DialogWhereAreYouRicky)\n\t\t\t.pipe(\n\t\t\t\ttap(e => {\n\t\t\t\t\tif (e.detail.uid === this.uid) this.announcePresence()\n\t\t\t\t}),\n\t\t\t\ttakeUntil(this.disconnecting),\n\t\t\t)\n\t\t\t.subscribe()\n\t}\n\n\t/**\n\t * Announce this dialog's presence to the service\n\t */\n\tprivate announcePresence(): void {\n\t\tthis.dispatchEvent(\n\t\t\tnew CustomEvent(DialogHereMorty, {\n\t\t\t\tdetail: { dialog: this },\n\t\t\t\tbubbles: true,\n\t\t\t\tcomposed: true,\n\t\t\t}),\n\t\t)\n\t}\n\n\t/**\n\t * Handle confirm action\n\t */\n\tprivate handleConfirm(): void {\n\t\tthis.hide(true)\n\t\tthis.dispatchEvent(\n\t\t\tnew CustomEvent('confirm', {\n\t\t\t\tbubbles: true,\n\t\t\t\tcomposed: true,\n\t\t\t}),\n\t\t)\n\t}\n\n\t/**\n\t * Handle cancel/close action\n\t */\n\tprivate handleClose(): void {\n\t\tif (this.isAnimating()) return\n\t\tthis.hide(false)\n\t\tthis.dispatchEvent(\n\t\t\tnew CustomEvent(this.isConfirmMode ? 'cancel' : 'close', {\n\t\t\t\tbubbles: true,\n\t\t\t\tcomposed: true,\n\t\t\t}),\n\t\t)\n\t}\n\n\t/**\n\t * Render drag handle for mobile bottom sheet\n\t */\n\tprivate renderDragHandle() {\n\t\treturn html`\n\t\t\t<div ${ref(this._dragHandleRef)} class=\"dialog-drag-handle flex justify-center pt-2 pb-1 cursor-grab active:cursor-grabbing touch-none\">\n\t\t\t\t<div class=\"w-10 h-1 rounded-full bg-outline-variant\"></div>\n\t\t\t</div>\n\t\t`\n\t}\n\n\trender() {\n\t\tconst isCentered = this.isCentered()\n\t\tconst hasCustomContent = this._contentSlotElements?.length > 0\n\n\t\t// Mobile bottom sheet classes\n\t\tconst mobileDialogClasses = {\n\t\t\tdialog: true,\n\t\t\tfixed: true,\n\t\t\t'inset-x-0': true,\n\t\t\t'bottom-0': true,\n\t\t\t'w-full': true,\n\t\t\t'max-h-[90dvh]': true,\n\t\t\t'overflow-hidden': true,\n\t\t\t// Safe area padding for notched devices\n\t\t\t'pb-[env(safe-area-inset-bottom)]': true,\n\t\t}\n\n\t\t// Desktop dialog classes\n\t\tconst desktopDialogClasses = {\n\t\t\tdialog: true,\n\t\t\tfixed: true,\n\t\t\t'w-[var(--dialog-width)]': true,\n\t\t\t'max-w-[calc(100vw-2rem)]': true,\n\t\t\t'max-h-[90dvh]': true,\n\t\t\t'overflow-hidden': true,\n\t\t\t'top-1/2': isCentered,\n\t\t\t'left-1/2': isCentered,\n\t\t\t'-translate-x-1/2': isCentered,\n\t\t\t'-translate-y-1/2': isCentered,\n\t\t}\n\n\t\tconst dialogClasses = this.isMobile ? mobileDialogClasses : desktopDialogClasses\n\n\t\t// Button classes - stack vertically on mobile\n\t\tconst buttonContainerClasses = this.isMobile\n\t\t\t? 'flex flex-col-reverse gap-2 w-full'\n\t\t\t: 'flex justify-end gap-3'\n\n\t\t// Confirm mode: with title/buttons\n\t\tif (this.isConfirmMode) {\n\t\t\tconst hasTitle = !!this.title?.trim()\n\t\t\tconst hasSubtitle = !!this.subtitle?.trim()\n\t\t\tconst hasMessage = !!this.message?.trim()\n\t\t\tconst describedBy = [hasSubtitle && this._descId + '-sub', hasMessage && this._descId + '-msg']\n\t\t\t\t.filter(Boolean)\n\t\t\t\t.join(' ') || ''\n\t\t\treturn html`\n\t\t\t\t<div ${ref(this._backdropRef)} class=\"fixed inset-0 bg-surface-container/10 backdrop-blur-lg backdrop-saturate-150 backdrop-brightness-105\" @click=${this.handleClose}></div>\n\n\t\t\t\t<div\n\t\t\t\t\t${ref(this._confirmDialogRef)}\n\t\t\t\t\tclass=${this.classMap(dialogClasses)}\n\t\t\t\t\trole=\"alertdialog\"\n\t\t\t\t\taria-modal=\"true\"\n\t\t\t\t\taria-labelledby=${hasTitle ? this._titleId : nothing}\n\t\t\t\t\taria-describedby=${describedBy || nothing}\n\t\t\t\t>\n\t\t\t\t\t<schmancy-surface\n\t\t\t\t\t\t${cursorGlow({ radius: 250, intensity: 0.1 })}\n\t\t\t\t\t\trounded=${this.isMobile ? 'top' : 'all'}\n\t\t\t\t\t\ttype=\"glass\"\n\t\t\t\t\t\tfill=\"all\"\n\t\t\t\t\t\tclass=\"overflow-hidden\"\n\t\t\t\t\t>\n\t\t\t\t\t\t${this.isMobile ? this.renderDragHandle() : null}\n\t\t\t\t\t\t<schmancy-scroll direction=\"vertical\" hide class=\"p-4 pt-2\">\n\t\t\t\t\t\t\t<schmancy-form @submit=${this.handleConfirm}>\n\t\t\t\t\t\t\t\t${when(\n\t\t\t\t\t\t\t\t\thasTitle,\n\t\t\t\t\t\t\t\t\t() => html`\n\t\t\t\t\t\t\t\t\t\t<schmancy-typography id=${this._titleId} type=\"title\" token=\"md\" class=\"mb-1\">${this.title}</schmancy-typography>\n\t\t\t\t\t\t\t\t\t\t${when(\n\t\t\t\t\t\t\t\t\t\t\thasSubtitle,\n\t\t\t\t\t\t\t\t\t\t\t() => html`\n\t\t\t\t\t\t\t\t\t\t\t\t<schmancy-typography id=\"${this._descId}-sub\" type=\"subtitle\" token=\"xs\" class=\"mb-2\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t${this.subtitle}\n\t\t\t\t\t\t\t\t\t\t\t\t</schmancy-typography>\n\t\t\t\t\t\t\t\t\t\t\t`,\n\t\t\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t\t\t`,\n\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t\t${hasCustomContent\n\t\t\t\t\t\t\t\t\t? html`<div class=\"mb-4\"><slot name=\"content\"></slot></div>`\n\t\t\t\t\t\t\t\t\t: when(\n\t\t\t\t\t\t\t\t\t\t\thasMessage,\n\t\t\t\t\t\t\t\t\t\t\t() => html`<schmancy-typography id=\"${this._descId}-msg\" type=\"body\" class=\"mb-4\">${this.message}</schmancy-typography>`,\n\t\t\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t\t<div class=${buttonContainerClasses}>\n\t\t\t\t\t\t\t\t\t<schmancy-button\n\t\t\t\t\t\t\t\t\t\tvariant=\"outlined\"\n\t\t\t\t\t\t\t\t\t\t@click=${this.handleClose}\n\t\t\t\t\t\t\t\t\t\tclass=${this.isMobile ? 'w-full' : ''}\n\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t${this.cancelText}\n\t\t\t\t\t\t\t\t\t</schmancy-button>\n\t\t\t\t\t\t\t\t\t<schmancy-button\n\t\t\t\t\t\t\t\t\t\ttype=\"submit\"\n\t\t\t\t\t\t\t\t\t\tvariant=\"filled\"\n\t\t\t\t\t\t\t\t\t\tclass=${this.isMobile ? 'w-full' : ''}\n\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t${this.confirmText}\n\t\t\t\t\t\t\t\t\t</schmancy-button>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t</schmancy-form>\n\t\t\t\t\t\t</schmancy-scroll>\n\t\t\t\t\t</schmancy-surface>\n\t\t\t\t</div>\n\t\t\t`\n\t\t}\n\n\t\t// Content mode: minimal, just slot\n\t\treturn html`\n\t\t\t<div ${ref(this._backdropRef)} class=\"fixed inset-0 bg-surface-container/10 backdrop-blur-lg backdrop-saturate-150 backdrop-brightness-105\" @click=${this.handleClose}></div>\n\n\t\t\t<section ${ref(this._contentDialogRef)} class=${this.classMap(dialogClasses)} role=\"dialog\" aria-modal=\"true\">\n\t\t\t\t<schmancy-surface ${cursorGlow({ radius: 250, intensity: 0.1 })} rounded=${this.isMobile ? 'top' : 'all'} type=\"glass\" fill=\"all\">\n\t\t\t\t\t${this.isMobile ? this.renderDragHandle() : null}\n\t\t\t\t\t<schmancy-scroll direction=\"vertical\" hide class=\"max-h-[85dvh]\">\n\t\t\t\t\t\t<slot></slot>\n\t\t\t\t\t</schmancy-scroll>\n\t\t\t\t</schmancy-surface>\n\t\t\t</section>\n\t\t`\n\t}\n\n\t/**\n\t * Static helper for confirm dialogs\n\t */\n\tstatic async confirm(options: {\n\t\ttitle?: string\n\t\tsubtitle?: string\n\t\tmessage?: string\n\t\tconfirmText?: string\n\t\tcancelText?: string\n\t\tvariant?: 'default' | 'danger'\n\t\tposition?: { x: number; y: number } | MouseEvent | TouchEvent\n\t\twidth?: string\n\t}): Promise<boolean> {\n\t\tlet dialog = document.querySelector('schmancy-dialog[data-static-confirm]') as SchmancyDialog\n\n\t\tif (!dialog) {\n\t\t\tdialog = document.createElement('schmancy-dialog') as SchmancyDialog\n\t\t\tdialog.setAttribute('data-static-confirm', '')\n\t\t\tdocument.body.appendChild(dialog)\n\t\t}\n\n\t\t// Set options\n\t\tdialog.title = options.title\n\t\tdialog.subtitle = options.subtitle\n\t\tdialog.message = options.message\n\t\tdialog.confirmText = options.confirmText ?? 'Confirm'\n\t\tdialog.cancelText = options.cancelText ?? 'Cancel'\n\t\tdialog.variant = options.variant ?? 'default'\n\t\tif (options.width) dialog.style.setProperty('--dialog-width', options.width)\n\n\t\treturn dialog.show(options.position)\n\t}\n\n\t/**\n\t * Simple shorthand - just pass message and optionally an event\n\t */\n\tstatic async ask(message: string, event?: MouseEvent | TouchEvent): Promise<boolean> {\n\t\treturn this.confirm({\n\t\t\tmessage,\n\t\t\tposition: event,\n\t\t})\n\t}\n}\n\n// Alias for backward compatibility\nexport { SchmancyDialog as ConfirmDialog }\n\ndeclare global {\n\tinterface HTMLElementTagNameMap {\n\t\t'schmancy-dialog': SchmancyDialog\n\t}\n}\n"],"mappings":";;;;;;;;;;;;;;AA2DA,IAAa,KAA8D,MAC1E,cAA8B,EAAA;CAAA,YAAA,GAAA,GAAA;AAAA,QAAA,GAAA,EAAA,EAAA,KAAA,WACF;GAAE,GAAG;GAAG,GAAG;GAAA,EAAA,KAAA,WAAA,CAC3B,GAAA,KAAA,aACE,GAAA,KAAA,aAOiB,IAAI,GAAA,EAAA,KAAA,qBAGW,MAAA,KAAA,gBACN,EAAA,EAAA,KAAA,YAAA,CAGnB,GAAA,KAAA,yBAAA;AAInB,OAAA;AACC,WAAO,KAAK,iBAAA;WAAA;AAEZ;;MAAA;;CAOF,cAAA;AACC,SAAO,KAAK;;CAMb,mBAAA;AACC,SAAO;;CAMR,qBAAA;AACC,SAAO;;CAMR,uBAAA;AACC,SAAO;;CAGR,oBA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A,CAAA,EAAkB,EAAA;AAAA,SAAA,KAAA,SAAA,KAAA,eAAA,KAAA,gBAAA,KAAA,YAAA,KAAA"}
|
|
1
|
+
{"version":3,"file":"dialog.js","names":[],"sources":["../src/dialog/dialog-base.mixin.ts","../src/dialog/dialog.component.ts"],"sourcesContent":["import { autoPlacement, autoUpdate, computePosition, offset, shift, size } from '@floating-ui/dom'\nimport { LitElement } from 'lit'\nimport { distinctUntilChanged, filter, fromEvent, map, merge, Subject, takeUntil, tap } from 'rxjs'\nimport type { Constructor } from '../../mixins/constructor'\nimport type { IBaseMixin } from '../../mixins/baseElement'\nimport {\n\tBLACKBIRD_EASING,\n\tDURATION_ENTER,\n\tDURATION_EXIT,\n\tDURATION_BACKDROP,\n\tEASE_OUT,\n\tEASE_IN,\n} from '../utils/animation'\nimport { reducedMotion$ } from '../directives/reduced-motion'\n\n// Mobile breakpoint - matches Tailwind's sm breakpoint\nconst MOBILE_BREAKPOINT = 640\n\n// Tablet breakpoint\nconst TABLET_BREAKPOINT = 1024\n\n/**\n * Fraction of viewport a dialog can occupy before converting to bottom sheet.\n * Tablet (640–1024px): 60% — tighter screens benefit from bottom sheet sooner.\n * Desktop (>1024px): 80% — plenty of room, keep floating longer.\n */\nfunction largeContentThreshold(): number {\n\treturn window.innerWidth < TABLET_BREAKPOINT ? 0.6 : 0.8\n}\n\nexport interface DialogPosition {\n\tx: number\n\ty: number\n}\n\nexport interface VirtualReference {\n\tgetBoundingClientRect: () => DOMRect\n}\n\n/**\n * Interface for the DialogBase mixin methods\n */\nexport interface IDialogBaseMixin {\n\tposition: DialogPosition\n\tisMobile: boolean\n\tdragOffset: number\n\tshow(positionOrEvent?: DialogPosition | MouseEvent | TouchEvent): Promise<boolean>\n\thide(result?: boolean): Promise<void>\n\tisCentered(): boolean\n\tisAnimating(): boolean\n}\n\n/**\n * Dialog mixin with smart positioning using Floating UI.\n *\n * On mobile (< 640px), automatically switches to bottom sheet mode\n * with swipe-to-dismiss gesture. On tablet/desktop, if content exceeds\n * a viewport-dependent threshold, also opens as bottom sheet.\n */\nexport const DialogBase = <T extends Constructor<LitElement & IBaseMixin>>(superClass: T) => {\n\tclass DialogBaseClass extends superClass {\n\t\tposition: DialogPosition = { x: 0, y: 0 }\n\t\tisMobile = false\n\t\tdragOffset = 0\n\n\t\tprotected resolvePromise?: (value: boolean) => void\n\t\tprotected cleanupAutoUpdate?: () => void\n\t\tprotected virtualReference?: VirtualReference\n\n\t\t// Subject to signal when to stop swipe gesture stream\n\t\tprivate readonly stopSwipe$ = new Subject<void>()\n\n\t\t// Focus trap state\n\t\tprivate lastFocusedElement: Element | null = null\n\t\tprivate inertSiblings: HTMLElement[] = []\n\n\t\t// Animation guard\n\t\tprivate animating = false\n\n\t\t/** ElementInternals — used for broadcasting `:state(open)` to consumers. */\n\t\tprotected dialogInternals: ElementInternals | undefined = (() => {\n\t\t\ttry {\n\t\t\t\treturn this.attachInternals()\n\t\t\t} catch {\n\t\t\t\treturn undefined\n\t\t\t}\n\t\t})()\n\n\t\t/**\n\t\t * Check if the dialog is currently animating\n\t\t */\n\t\tisAnimating(): boolean {\n\t\t\treturn this.animating\n\t\t}\n\n\t\t/**\n\t\t * Override in subclass to return the dialog element\n\t\t */\n\t\tprotected getDialogElement(): HTMLElement | null {\n\t\t\treturn null\n\t\t}\n\n\t\t/**\n\t\t * Override in subclass to return the backdrop element for animations\n\t\t */\n\t\tprotected getBackdropElement(): HTMLElement | null {\n\t\t\treturn null\n\t\t}\n\n\t\t/**\n\t\t * Override in subclass to return the drag handle element for swipe gestures\n\t\t */\n\t\tprotected getDragHandleElement(): HTMLElement | null {\n\t\t\treturn null\n\t\t}\n\n\t\tconnectedCallback(): void {\n\t\t\tsuper.connectedCallback()\n\t\t\tthis.setupResizeListener()\n\t\t}\n\n\t\t/**\n\t\t * Listen for resize to switch between mobile/desktop modes\n\t\t */\n\t\tprivate setupResizeListener(): void {\n\t\t\tfromEvent(window, 'resize')\n\t\t\t\t.pipe(\n\t\t\t\t\tmap(() => window.innerWidth < MOBILE_BREAKPOINT),\n\t\t\t\t\tdistinctUntilChanged(),\n\t\t\t\t\tfilter(() => this.hasAttribute('active')),\n\t\t\t\t\ttap(isMobile => {\n\t\t\t\t\t\tif (this.isMobile !== isMobile) {\n\t\t\t\t\t\t\tthis.isMobile = isMobile\n\t\t\t\t\t\t\tthis.requestUpdate()\n\t\t\t\t\t\t\tconst dialog = this.getDialogElement()\n\t\t\t\t\t\t\tif (dialog) {\n\t\t\t\t\t\t\t\tif (isMobile) {\n\t\t\t\t\t\t\t\t\tthis.applyBottomSheetStyles(dialog)\n\t\t\t\t\t\t\t\t\tthis.setupSwipeGesture(dialog)\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\tthis.stopSwipe$.next()\n\t\t\t\t\t\t\t\t\tthis.setupPositioning()\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}),\n\t\t\t\t\ttakeUntil(this.disconnecting),\n\t\t\t\t)\n\t\t\t\t.subscribe()\n\t\t}\n\n\t\t/**\n\t\t * Setup RxJS-based swipe gesture for dialog\n\t\t */\n\t\tprivate setupSwipeGesture(dialog: HTMLElement): void {\n\t\t\t// Stop any existing swipe gesture\n\t\t\tthis.stopSwipe$.next()\n\n\t\t\tlet dragStartY = 0\n\t\t\tlet isDragging = false\n\t\t\tlet currentY = 0\n\n\t\t\tconst dragHandle = this.getDragHandleElement()\n\t\t\tconst dragTarget = dragHandle || dialog\n\n\t\t\tconst touchStart$ = fromEvent<TouchEvent>(dragTarget, 'touchstart', { passive: true }).pipe(\n\t\t\t\ttap(e => {\n\t\t\t\t\tconst touch = e.touches[0]\n\t\t\t\t\tconst rect = dialog.getBoundingClientRect()\n\t\t\t\t\tconst touchY = touch.clientY - rect.top\n\n\t\t\t\t\t// Only allow drag from top 80px or drag handle\n\t\t\t\t\tif (touchY > 80 && !dragHandle) return\n\n\t\t\t\t\tisDragging = true\n\t\t\t\t\tdragStartY = touch.clientY\n\t\t\t\t\tcurrentY = 0\n\t\t\t\t\tthis.dragOffset = 0\n\n\t\t\t\t\t// Disable transitions for immediate feedback\n\t\t\t\t\tdialog.style.transition = 'none'\n\t\t\t\t\tdialog.style.willChange = 'transform'\n\t\t\t\t}),\n\t\t\t)\n\n\t\t\tconst touchMove$ = fromEvent<TouchEvent>(dialog, 'touchmove', { passive: false }).pipe(\n\t\t\t\tfilter(() => isDragging),\n\t\t\t\ttap(e => {\n\t\t\t\t\tconst touch = e.touches[0]\n\t\t\t\t\tconst deltaY = touch.clientY - dragStartY\n\n\t\t\t\t\t// Rubber-band effect for upward drag\n\t\t\t\t\tif (deltaY < 0) {\n\t\t\t\t\t\tcurrentY = deltaY * 0.2\n\t\t\t\t\t} else {\n\t\t\t\t\t\tcurrentY = deltaY\n\t\t\t\t\t}\n\n\t\t\t\t\tthis.dragOffset = Math.max(0, deltaY)\n\n\t\t\t\t\t// Direct DOM update - 1:1 tracking\n\t\t\t\t\tdialog.style.transform = `translateY(${currentY}px)`\n\n\t\t\t\t\te.preventDefault()\n\t\t\t\t}),\n\t\t\t)\n\n\t\t\tconst touchEnd$ = merge(\n\t\t\t\tfromEvent<TouchEvent>(dialog, 'touchend', { passive: true }),\n\t\t\t\tfromEvent<TouchEvent>(dialog, 'touchcancel', { passive: true }),\n\t\t\t).pipe(\n\t\t\t\tfilter(() => isDragging),\n\t\t\t\ttap(() => {\n\t\t\t\t\tisDragging = false\n\n\t\t\t\t\t// Re-enable transitions for snap animation\n\t\t\t\t\tdialog.style.transition = 'transform 0.3s cubic-bezier(0.16, 1, 0.3, 1)'\n\t\t\t\t\tdialog.style.willChange = ''\n\n\t\t\t\t\tconst dialogHeight = dialog.getBoundingClientRect().height\n\t\t\t\t\tconst threshold = Math.min(100, dialogHeight * 0.25)\n\n\t\t\t\t\tif (this.dragOffset > threshold) {\n\t\t\t\t\t\t// Dismiss - animate out\n\t\t\t\t\t\tdialog.style.transform = 'translateY(100%)'\n\t\t\t\t\t\tthis.hide(false)\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// Snap back\n\t\t\t\t\t\tdialog.style.transform = 'translateY(0)'\n\t\t\t\t\t\tthis.dragOffset = 0\n\t\t\t\t\t}\n\t\t\t\t}),\n\t\t\t)\n\n\t\t\t// Merge all touch streams and subscribe\n\t\t\tmerge(touchStart$, touchMove$, touchEnd$)\n\t\t\t\t.pipe(takeUntil(merge(this.stopSwipe$, this.disconnecting)))\n\t\t\t\t.subscribe()\n\t\t}\n\n\t\t/**\n\t\t * Apply bottom sheet styles for mobile\n\t\t */\n\t\tprivate applyBottomSheetStyles(dialog: HTMLElement): void {\n\t\t\tif (this.cleanupAutoUpdate) {\n\t\t\t\tthis.cleanupAutoUpdate()\n\t\t\t\tthis.cleanupAutoUpdate = undefined\n\t\t\t}\n\n\t\t\tObject.assign(dialog.style, {\n\t\t\t\tposition: '',\n\t\t\t\tleft: '',\n\t\t\t\ttop: '',\n\t\t\t\ttransform: '',\n\t\t\t\tmaxWidth: '',\n\t\t\t})\n\t\t}\n\n\t\t/**\n\t\t * Show the dialog at a specific position\n\t\t */\n\t\tasync show(positionOrEvent?: DialogPosition | MouseEvent | TouchEvent): Promise<boolean> {\n\t\t\tif (this.cleanupAutoUpdate) {\n\t\t\t\tthis.cleanupAutoUpdate()\n\t\t\t\tthis.cleanupAutoUpdate = undefined\n\t\t\t}\n\n\t\t\tthis.isMobile = window.innerWidth < MOBILE_BREAKPOINT\n\n\t\t\tlet x: number, y: number\n\n\t\t\tif (!positionOrEvent) {\n\t\t\t\tx = window.innerWidth / 2\n\t\t\t\ty = window.innerHeight / 2\n\t\t\t} else if ('clientX' in positionOrEvent) {\n\t\t\t\tx = positionOrEvent.clientX\n\t\t\t\ty = positionOrEvent.clientY\n\t\t\t} else if ('touches' in positionOrEvent && positionOrEvent.touches.length) {\n\t\t\t\tx = positionOrEvent.touches[0].clientX\n\t\t\t\ty = positionOrEvent.touches[0].clientY\n\t\t\t} else {\n\t\t\t\tconst pos = positionOrEvent as DialogPosition\n\t\t\t\tx = pos.x\n\t\t\t\ty = pos.y\n\t\t\t}\n\n\t\t\tthis.position = { x, y }\n\n\t\t\tthis.virtualReference = {\n\t\t\t\tgetBoundingClientRect: () => new DOMRect(x, y, 0, 0),\n\t\t\t}\n\n\t\t\tthis.requestUpdate()\n\t\t\tawait this.updateComplete\n\n\t\t\tthis.setAttribute('active', '')\n\t\t\tthis.dialogInternals?.states.add('open')\n\t\t\tawait this.updateComplete\n\n\t\t\t// Save focus and set siblings to inert for focus trap\n\t\t\tthis.lastFocusedElement = document.activeElement\n\t\t\tconst parent = this.parentElement\n\t\t\tif (parent) {\n\t\t\t\tthis.inertSiblings = []\n\t\t\t\tfor (let i = 0; i < parent.children.length; i++) {\n\t\t\t\t\tconst sibling = parent.children[i] as HTMLElement\n\t\t\t\t\tif (sibling !== this && 'inert' in sibling) {\n\t\t\t\t\t\tsibling.inert = true\n\t\t\t\t\t\tthis.inertSiblings.push(sibling)\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Escape key listener\n\t\t\tfromEvent<KeyboardEvent>(document, 'keydown')\n\t\t\t\t.pipe(\n\t\t\t\t\tfilter(e => e.key === 'Escape'),\n\t\t\t\t\ttap(e => {\n\t\t\t\t\t\te.preventDefault()\n\t\t\t\t\t\tthis.hide(false)\n\t\t\t\t\t}),\n\t\t\t\t\ttakeUntil(merge(this.stopSwipe$, this.disconnecting)),\n\t\t\t\t)\n\t\t\t\t.subscribe()\n\n\t\t\tconst dialog = this.getDialogElement()\n\n\t\t\t// If content exceeds viewport threshold on desktop, treat as bottom sheet\n\t\t\tconst threshold = largeContentThreshold()\n\t\t\tif (\n\t\t\t\t!this.isMobile &&\n\t\t\t\tdialog &&\n\t\t\t\t(dialog.scrollHeight > window.innerHeight * threshold ||\n\t\t\t\t\tdialog.scrollWidth > window.innerWidth * threshold)\n\t\t\t) {\n\t\t\t\tthis.isMobile = true\n\t\t\t\tthis.requestUpdate()\n\t\t\t\tawait this.updateComplete\n\t\t\t}\n\n\t\t\tif (this.isMobile) {\n\t\t\t\tif (dialog) {\n\t\t\t\t\tthis.applyBottomSheetStyles(dialog)\n\t\t\t\t\tthis.setupSwipeGesture(dialog)\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tthis.setupPositioning()\n\t\t\t}\n\n\t\t\tthis.animating = true\n\t\t\tawait this.animateIn()\n\t\t\tthis.animating = false\n\n\t\t\treturn new Promise<boolean>(resolve => {\n\t\t\t\tthis.resolvePromise = resolve\n\t\t\t})\n\t\t}\n\n\t\t/**\n\t\t * Animate dialog entrance\n\t\t */\n\t\tprivate async animateIn(): Promise<void> {\n\t\t\tconst dialog = this.getDialogElement()\n\t\t\tconst backdrop = this.getBackdropElement()\n\n\t\t\tif (reducedMotion$.value) {\n\t\t\t\tif (backdrop) backdrop.style.opacity = '1'\n\t\t\t\tif (dialog) dialog.style.opacity = '1'\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tbackdrop?.animate([{ opacity: 0 }, { opacity: 1 }], {\n\t\t\t\tduration: DURATION_BACKDROP,\n\t\t\t\teasing: EASE_OUT,\n\t\t\t\tfill: 'forwards',\n\t\t\t})\n\n\t\t\tif (dialog) {\n\t\t\t\tconst animation = this.isMobile\n\t\t\t\t\t? [\n\t\t\t\t\t\t\t{ opacity: 0, transform: 'translateY(100%)' },\n\t\t\t\t\t\t\t{ opacity: 1, transform: 'translateY(0)' },\n\t\t\t\t\t\t]\n\t\t\t\t\t: [\n\t\t\t\t\t\t\t{ opacity: 0, transform: 'scale(0.92) translateY(16px)' },\n\t\t\t\t\t\t\t{ opacity: 1, transform: 'scale(1) translateY(0)' },\n\t\t\t\t\t\t]\n\n\t\t\t\tawait dialog.animate(animation, {\n\t\t\t\t\tduration: DURATION_ENTER,\n\t\t\t\t\teasing: BLACKBIRD_EASING,\n\t\t\t\t\tfill: 'forwards',\n\t\t\t\t}).finished\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * Animate dialog exit\n\t\t */\n\t\tprivate async animateOut(): Promise<void> {\n\t\t\tconst dialog = this.getDialogElement()\n\t\t\tconst backdrop = this.getBackdropElement()\n\n\t\t\tif (reducedMotion$.value) {\n\t\t\t\tif (backdrop) backdrop.style.opacity = '0'\n\t\t\t\tif (dialog) dialog.style.opacity = '0'\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tconst animations: Promise<Animation>[] = []\n\n\t\t\tif (backdrop) {\n\t\t\t\tanimations.push(\n\t\t\t\t\tbackdrop.animate([{ opacity: 1 }, { opacity: 0 }], {\n\t\t\t\t\t\tduration: DURATION_EXIT,\n\t\t\t\t\t\teasing: EASE_OUT,\n\t\t\t\t\t\tfill: 'forwards',\n\t\t\t\t\t}).finished,\n\t\t\t\t)\n\t\t\t}\n\n\t\t\tif (dialog) {\n\t\t\t\tconst animation = this.isMobile\n\t\t\t\t\t? [\n\t\t\t\t\t\t\t{ opacity: 1, transform: 'translateY(0)' },\n\t\t\t\t\t\t\t{ opacity: 0, transform: 'translateY(100%)' },\n\t\t\t\t\t\t]\n\t\t\t\t\t: [\n\t\t\t\t\t\t\t{ opacity: 1, transform: 'scale(1) translateY(0)' },\n\t\t\t\t\t\t\t{ opacity: 0, transform: 'scale(0.95) translateY(8px)' },\n\t\t\t\t\t\t]\n\n\t\t\t\tanimations.push(\n\t\t\t\t\tdialog.animate(animation, {\n\t\t\t\t\t\tduration: DURATION_EXIT,\n\t\t\t\t\t\teasing: EASE_IN,\n\t\t\t\t\t\tfill: 'forwards',\n\t\t\t\t\t}).finished,\n\t\t\t\t)\n\t\t\t}\n\n\t\t\tawait Promise.all(animations)\n\t\t}\n\n\t\t/**\n\t\t * Hide the dialog\n\t\t */\n\t\tasync hide(result = false): Promise<void> {\n\t\t\tthis.stopSwipe$.next()\n\n\t\t\tthis.animating = true\n\t\t\tawait this.animateOut()\n\t\t\tthis.animating = false\n\n\t\t\tthis.removeAttribute('active')\n\t\t\tthis.dialogInternals?.states.delete('open')\n\n\t\t\t// Restore inert siblings\n\t\t\tfor (const el of this.inertSiblings) {\n\t\t\t\tel.inert = false\n\t\t\t}\n\t\t\tthis.inertSiblings = []\n\n\t\t\t// Restore focus\n\t\t\tif (this.lastFocusedElement) {\n\t\t\t\tconst el = this.lastFocusedElement as HTMLElement\n\t\t\t\tif (typeof el.focus === 'function') {\n\t\t\t\t\tel.focus()\n\t\t\t\t}\n\t\t\t\tthis.lastFocusedElement = null\n\t\t\t}\n\n\t\t\tif (this.cleanupAutoUpdate) {\n\t\t\t\tthis.cleanupAutoUpdate()\n\t\t\t\tthis.cleanupAutoUpdate = undefined\n\t\t\t}\n\n\t\t\tif (this.resolvePromise) {\n\t\t\t\tthis.resolvePromise(result)\n\t\t\t\tthis.resolvePromise = undefined\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * Check if position is near center (only skip Floating UI for truly centered dialogs)\n\t\t */\n\t\tisCentered(): boolean {\n\t\t\t// Use tight tolerance (5%) - only skip Floating UI when position is very close to center\n\t\t\tconst toleranceX = window.innerWidth * 0.05\n\t\t\tconst toleranceY = window.innerHeight * 0.05\n\n\t\t\treturn (\n\t\t\t\tMath.abs(this.position.x - window.innerWidth / 2) < toleranceX &&\n\t\t\t\tMath.abs(this.position.y - window.innerHeight / 2) < toleranceY\n\t\t\t)\n\t\t}\n\n\t\t/**\n\t\t * Setup Floating UI positioning for desktop\n\t\t */\n\t\tprivate setupPositioning(): void {\n\t\t\tconst dialog = this.getDialogElement()\n\t\t\tif (!dialog) return\n\n\t\t\tif (this.isCentered()) return\n\n\t\t\tif (this.virtualReference) {\n\t\t\t\tthis.cleanupAutoUpdate = autoUpdate(\n\t\t\t\t\tthis.virtualReference,\n\t\t\t\t\tdialog,\n\t\t\t\t\t() => this.updatePosition(dialog),\n\t\t\t\t\t{\n\t\t\t\t\t\tancestorScroll: true,\n\t\t\t\t\t\tancestorResize: true,\n\t\t\t\t\t\telementResize: true,\n\t\t\t\t\t},\n\t\t\t\t)\n\t\t\t\tthis.updatePosition(dialog)\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * Update position using Floating UI\n\t\t */\n\t\tprivate async updatePosition(dialog: HTMLElement): Promise<void> {\n\t\t\tif (!this.virtualReference) return\n\n\t\t\tconst padding = 16\n\n\t\t\tconst { x, y } = await computePosition(this.virtualReference, dialog, {\n\t\t\t\tstrategy: 'fixed',\n\t\t\t\tmiddleware: [\n\t\t\t\t\toffset(8),\n\t\t\t\t\tautoPlacement({\n\t\t\t\t\t\tpadding,\n\t\t\t\t\t\tallowedPlacements: [\n\t\t\t\t\t\t\t'top-start',\n\t\t\t\t\t\t\t'top-end',\n\t\t\t\t\t\t\t'bottom-start',\n\t\t\t\t\t\t\t'bottom-end',\n\t\t\t\t\t\t\t'left-start',\n\t\t\t\t\t\t\t'left-end',\n\t\t\t\t\t\t\t'right-start',\n\t\t\t\t\t\t\t'right-end',\n\t\t\t\t\t\t],\n\t\t\t\t\t}),\n\t\t\t\t\tshift({ padding }),\n\t\t\t\t\tsize({\n\t\t\t\t\t\tpadding,\n\t\t\t\t\t\tapply({ availableWidth, elements }) {\n\t\t\t\t\t\t\telements.floating.style.maxWidth = `${availableWidth}px`\n\t\t\t\t\t\t},\n\t\t\t\t\t}),\n\t\t\t\t],\n\t\t\t})\n\n\t\t\tObject.assign(dialog.style, {\n\t\t\t\tposition: 'fixed',\n\t\t\t\tleft: `${Math.round(x)}px`,\n\t\t\t\ttop: `${Math.round(y)}px`,\n\t\t\t\ttransform: 'none',\n\t\t\t})\n\t\t}\n\n\t\tdisconnectedCallback(): void {\n\t\t\tthis.stopSwipe$.next()\n\t\t\tif (this.cleanupAutoUpdate) {\n\t\t\t\tthis.cleanupAutoUpdate()\n\t\t\t\tthis.cleanupAutoUpdate = undefined\n\t\t\t}\n\t\t\tsuper.disconnectedCallback()\n\t\t}\n\t}\n\n\treturn DialogBaseClass as Constructor<IDialogBaseMixin> & T\n}\n","import { $LitElement } from '@mixins/index'\nimport { css, html, nothing } from 'lit'\nimport { customElement, property, queryAssignedElements } from 'lit/decorators.js'\nimport { cursorGlow } from '../directives/cursor-glow'\nimport { createRef, ref, type Ref } from 'lit/directives/ref.js'\nimport { when } from 'lit/directives/when.js'\nimport { fromEvent, tap } from 'rxjs'\nimport { takeUntil } from 'rxjs/operators'\nimport { DialogBase } from './dialog-base.mixin'\nimport { DialogHereMorty, DialogWhereAreYouRicky, DialogWhereAreYouRickyEvent } from './dialog-events'\n\n/**\n * Modal dialog — content-only (just a styled panel) or confirm mode (title + message + confirm/cancel buttons). Prefer the imperative `$dialog` service for most use cases; use the element directly only when you want a declaratively-positioned dialog.\n *\n * @element schmancy-dialog\n * @summary Blocks interaction with the rest of the page until dismissed. For quick confirmations, prefer `$dialog.confirm({ ... })` over this element. For arbitrary dialog content driven imperatively, prefer `$dialog.component(MyComponent)`.\n * @platform dialog close - Positioned overlay in light DOM. Degrades to a styled `<dialog>` if the tag never registers — loses custom animations but keeps focus trap + ESC close.\n * @slot default - Content slot for dialog body (used in content mode)\n * @slot content - Named slot for custom content in confirm mode\n * @fires confirm - In confirm mode, when the confirm button is clicked.\n * @fires cancel - In confirm mode, when the cancel button or ESC is activated.\n *\n * @example Content mode (no buttons):\n * <schmancy-dialog>\n * <my-custom-content></my-custom-content>\n * </schmancy-dialog>\n *\n * @example Confirm mode (with buttons):\n * <schmancy-dialog\n * title=\"Delete item?\"\n * message=\"This action cannot be undone.\"\n * confirm-text=\"Delete\"\n * cancel-text=\"Keep\"\n * ></schmancy-dialog>\n */\n@customElement('schmancy-dialog')\nexport class SchmancyDialog extends DialogBase(\n\t$LitElement(css`\n\t\t:host {\n\t\t\tposition: fixed;\n\t\t\tz-index: var(--schmancy-overlay-z, 10000);\n\t\t\tinset: 0;\n\t\t\tdisplay: none;\n\t\t\t--dialog-width: fit-content;\n\t\t}\n\n\t\t:host([active]) {\n\t\t\tdisplay: block;\n\t\t}\n\n\n\t\t/* Luminous glow around the dialog container */\n\t\t.dialog {\n\t\t\tbox-shadow: 0 8px 40px -8px color-mix(in srgb, var(--schmancy-sys-color-primary-default) 15%, transparent);\n\t\t\tborder-radius: var(--schmancy-sys-shape-corner-large);\n\t\t}\n\n\t\t@media (prefers-reduced-motion: reduce) {\n\t\t\t.dialog { box-shadow: var(--schmancy-sys-elevation-2); }\n\t\t}\n\t`),\n) {\n\t/**\n\t * Unique identifier for the dialog instance\n\t */\n\t@property({ type: String, reflect: true }) uid!: string\n\n\t/**\n\t * Dialog title (enables confirm mode when set)\n\t */\n\t@property({ type: String }) title: string | undefined = undefined\n\n\t/**\n\t * Dialog subtitle\n\t */\n\t@property({ type: String }) subtitle: string | undefined = undefined\n\n\t/**\n\t * Dialog message\n\t */\n\t@property({ type: String }) message: string | undefined = undefined\n\n\t/**\n\t * Text for confirm button (enables confirm mode when set with cancelText)\n\t */\n\t@property({ type: String, attribute: 'confirm-text' }) confirmText: string | undefined = undefined\n\n\t/**\n\t * Text for cancel button\n\t */\n\t@property({ type: String, attribute: 'cancel-text' }) cancelText: string | undefined = undefined\n\n\t/**\n\t * Dialog variant (affects button colors in confirm mode)\n\t */\n\t@property({ type: String }) variant: 'default' | 'danger' = 'default'\n\n\t/**\n\t * Whether to hide action buttons (force content mode)\n\t */\n\t@property({ type: Boolean, attribute: 'hide-actions' }) hideActions = false\n\n\t/**\n\t * Slotted children in the named \"content\" slot (confirm mode custom content)\n\t */\n\t@queryAssignedElements({ slot: 'content', flatten: true })\n\tprivate _contentSlotElements!: HTMLElement[]\n\n\t/**\n\t * Ref to the confirm mode wrapper div\n\t */\n\tprivate _confirmDialogRef: Ref<HTMLElement> = createRef()\n\n\t/**\n\t * Ref to the content mode section element\n\t */\n\tprivate _contentDialogRef: Ref<HTMLElement> = createRef()\n\n\t/**\n\t * Ref to the backdrop element for animations\n\t */\n\tprivate _backdropRef: Ref<HTMLElement> = createRef()\n\n\t/**\n\t * Ref to the drag handle element for swipe gestures\n\t */\n\tprivate _dragHandleRef: Ref<HTMLElement> = createRef()\n\n\t/**\n\t * Stable per-instance id used for ARIA labelledby/describedby wiring\n\t */\n\tprivate readonly _a11yId = `schmancy-dialog-${Math.random().toString(36).slice(2, 10)}`\n\tprivate get _titleId() { return `${this._a11yId}-title` }\n\tprivate get _descId() { return `${this._a11yId}-desc` }\n\n\t/**\n\t * Return the dialog element for positioning/size measurement.\n\t * In content mode, returns the first slotted child (the actual component).\n\t * In confirm mode, returns the wrapper div.\n\t */\n\tprotected getDialogElement(): HTMLElement | null {\n\t\t// Content mode: use the section wrapper (slotted content may be display:contents)\n\t\tif (this._contentDialogRef.value) return this._contentDialogRef.value\n\t\t// Confirm mode: use the wrapper div\n\t\treturn this._confirmDialogRef.value ?? null\n\t}\n\n\t/**\n\t * Return the backdrop element for animations\n\t */\n\tprotected getBackdropElement(): HTMLElement | null {\n\t\treturn this._backdropRef.value ?? null\n\t}\n\n\t/**\n\t * Return the drag handle element for swipe gestures\n\t */\n\tprotected getDragHandleElement(): HTMLElement | null {\n\t\treturn this._dragHandleRef.value ?? null\n\t}\n\n\t/**\n\t * Check if dialog is in confirm mode (has buttons)\n\t */\n\tprivate get isConfirmMode(): boolean {\n\t\tif (this.hideActions) return false\n\t\treturn !!(this.confirmText?.trim() && this.cancelText?.trim())\n\t}\n\n\t/**\n\t * Handle component connection to DOM\n\t */\n\tconnectedCallback(): void {\n\t\tsuper.connectedCallback()\n\n\t\t// Listen for \"where are you ricky\" events\n\t\tfromEvent<DialogWhereAreYouRickyEvent>(window, DialogWhereAreYouRicky)\n\t\t\t.pipe(\n\t\t\t\ttap(e => {\n\t\t\t\t\tif (e.detail.uid === this.uid) this.announcePresence()\n\t\t\t\t}),\n\t\t\t\ttakeUntil(this.disconnecting),\n\t\t\t)\n\t\t\t.subscribe()\n\t}\n\n\t/**\n\t * Announce this dialog's presence to the service\n\t */\n\tprivate announcePresence(): void {\n\t\tthis.dispatchEvent(\n\t\t\tnew CustomEvent(DialogHereMorty, {\n\t\t\t\tdetail: { dialog: this },\n\t\t\t\tbubbles: true,\n\t\t\t\tcomposed: true,\n\t\t\t}),\n\t\t)\n\t}\n\n\t/**\n\t * Handle confirm action\n\t */\n\tprivate handleConfirm(): void {\n\t\tthis.hide(true)\n\t\tthis.dispatchEvent(\n\t\t\tnew CustomEvent('confirm', {\n\t\t\t\tbubbles: true,\n\t\t\t\tcomposed: true,\n\t\t\t}),\n\t\t)\n\t}\n\n\t/**\n\t * Handle cancel/close action\n\t */\n\tprivate handleClose(): void {\n\t\tif (this.isAnimating()) return\n\t\tthis.hide(false)\n\t\tthis.dispatchEvent(\n\t\t\tnew CustomEvent(this.isConfirmMode ? 'cancel' : 'close', {\n\t\t\t\tbubbles: true,\n\t\t\t\tcomposed: true,\n\t\t\t}),\n\t\t)\n\t}\n\n\t/**\n\t * Render drag handle for mobile bottom sheet\n\t */\n\tprivate renderDragHandle() {\n\t\treturn html`\n\t\t\t<div ${ref(this._dragHandleRef)} class=\"dialog-drag-handle flex justify-center pt-2 pb-1 cursor-grab active:cursor-grabbing touch-none\">\n\t\t\t\t<div class=\"w-10 h-1 rounded-full bg-outline-variant\"></div>\n\t\t\t</div>\n\t\t`\n\t}\n\n\trender() {\n\t\tconst isCentered = this.isCentered()\n\t\tconst hasCustomContent = this._contentSlotElements?.length > 0\n\n\t\t// Mobile bottom sheet classes\n\t\tconst mobileDialogClasses = {\n\t\t\tdialog: true,\n\t\t\tfixed: true,\n\t\t\t'inset-x-0': true,\n\t\t\t'bottom-0': true,\n\t\t\t'w-full': true,\n\t\t\t'max-h-[90dvh]': true,\n\t\t\t'overflow-hidden': true,\n\t\t\t// Safe area padding for notched devices\n\t\t\t'pb-[env(safe-area-inset-bottom)]': true,\n\t\t}\n\n\t\t// Desktop dialog classes\n\t\tconst desktopDialogClasses = {\n\t\t\tdialog: true,\n\t\t\tfixed: true,\n\t\t\t'w-[var(--dialog-width)]': true,\n\t\t\t'max-w-[calc(100vw-2rem)]': true,\n\t\t\t'max-h-[90dvh]': true,\n\t\t\t'overflow-hidden': true,\n\t\t\t'top-1/2': isCentered,\n\t\t\t'left-1/2': isCentered,\n\t\t\t'-translate-x-1/2': isCentered,\n\t\t\t'-translate-y-1/2': isCentered,\n\t\t}\n\n\t\tconst dialogClasses = this.isMobile ? mobileDialogClasses : desktopDialogClasses\n\n\t\t// Button classes - stack vertically on mobile\n\t\tconst buttonContainerClasses = this.isMobile\n\t\t\t? 'flex flex-col-reverse gap-2 w-full'\n\t\t\t: 'flex justify-end gap-3'\n\n\t\t// Confirm mode: with title/buttons\n\t\tif (this.isConfirmMode) {\n\t\t\tconst hasTitle = !!this.title?.trim()\n\t\t\tconst hasSubtitle = !!this.subtitle?.trim()\n\t\t\tconst hasMessage = !!this.message?.trim()\n\t\t\tconst describedBy = [hasSubtitle && this._descId + '-sub', hasMessage && this._descId + '-msg']\n\t\t\t\t.filter(Boolean)\n\t\t\t\t.join(' ') || ''\n\t\t\treturn html`\n\t\t\t\t<div ${ref(this._backdropRef)} class=\"fixed inset-0 bg-surface-container/10 backdrop-blur-lg backdrop-saturate-150 backdrop-brightness-105\" @click=${this.handleClose}></div>\n\n\t\t\t\t<div\n\t\t\t\t\t${ref(this._confirmDialogRef)}\n\t\t\t\t\tclass=${this.classMap(dialogClasses)}\n\t\t\t\t\trole=\"alertdialog\"\n\t\t\t\t\taria-modal=\"true\"\n\t\t\t\t\taria-labelledby=${hasTitle ? this._titleId : nothing}\n\t\t\t\t\taria-describedby=${describedBy || nothing}\n\t\t\t\t>\n\t\t\t\t\t<schmancy-surface\n\t\t\t\t\t\t${cursorGlow({ radius: 250, intensity: 0.1 })}\n\t\t\t\t\t\trounded=${this.isMobile ? 'top' : 'all'}\n\t\t\t\t\t\ttype=\"glass\"\n\t\t\t\t\t\tfill=\"all\"\n\t\t\t\t\t\tclass=\"overflow-hidden\"\n\t\t\t\t\t>\n\t\t\t\t\t\t${this.isMobile ? this.renderDragHandle() : null}\n\t\t\t\t\t\t<schmancy-scroll direction=\"vertical\" hide class=\"p-4 pt-2\">\n\t\t\t\t\t\t\t<schmancy-form @submit=${this.handleConfirm}>\n\t\t\t\t\t\t\t\t${when(\n\t\t\t\t\t\t\t\t\thasTitle,\n\t\t\t\t\t\t\t\t\t() => html`\n\t\t\t\t\t\t\t\t\t\t<schmancy-typography id=${this._titleId} type=\"title\" token=\"md\" class=\"mb-1\">${this.title}</schmancy-typography>\n\t\t\t\t\t\t\t\t\t\t${when(\n\t\t\t\t\t\t\t\t\t\t\thasSubtitle,\n\t\t\t\t\t\t\t\t\t\t\t() => html`\n\t\t\t\t\t\t\t\t\t\t\t\t<schmancy-typography id=\"${this._descId}-sub\" type=\"subtitle\" token=\"xs\" class=\"mb-2\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t${this.subtitle}\n\t\t\t\t\t\t\t\t\t\t\t\t</schmancy-typography>\n\t\t\t\t\t\t\t\t\t\t\t`,\n\t\t\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t\t\t`,\n\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t\t${hasCustomContent\n\t\t\t\t\t\t\t\t\t? html`<div class=\"mb-4\"><slot name=\"content\"></slot></div>`\n\t\t\t\t\t\t\t\t\t: when(\n\t\t\t\t\t\t\t\t\t\t\thasMessage,\n\t\t\t\t\t\t\t\t\t\t\t() => html`<schmancy-typography id=\"${this._descId}-msg\" type=\"body\" class=\"mb-4\">${this.message}</schmancy-typography>`,\n\t\t\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t\t<div class=${buttonContainerClasses}>\n\t\t\t\t\t\t\t\t\t<schmancy-button\n\t\t\t\t\t\t\t\t\t\tvariant=\"outlined\"\n\t\t\t\t\t\t\t\t\t\t@click=${this.handleClose}\n\t\t\t\t\t\t\t\t\t\tclass=${this.isMobile ? 'w-full' : ''}\n\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t${this.cancelText}\n\t\t\t\t\t\t\t\t\t</schmancy-button>\n\t\t\t\t\t\t\t\t\t<schmancy-button\n\t\t\t\t\t\t\t\t\t\ttype=\"submit\"\n\t\t\t\t\t\t\t\t\t\tvariant=\"filled\"\n\t\t\t\t\t\t\t\t\t\tclass=${this.isMobile ? 'w-full' : ''}\n\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t${this.confirmText}\n\t\t\t\t\t\t\t\t\t</schmancy-button>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t</schmancy-form>\n\t\t\t\t\t\t</schmancy-scroll>\n\t\t\t\t\t</schmancy-surface>\n\t\t\t\t</div>\n\t\t\t`\n\t\t}\n\n\t\t// Content mode: minimal, just slot\n\t\treturn html`\n\t\t\t<div ${ref(this._backdropRef)} class=\"fixed inset-0 bg-surface-container/10 backdrop-blur-lg backdrop-saturate-150 backdrop-brightness-105\" @click=${this.handleClose}></div>\n\n\t\t\t<section ${ref(this._contentDialogRef)} class=${this.classMap(dialogClasses)} role=\"dialog\" aria-modal=\"true\">\n\t\t\t\t<schmancy-surface ${cursorGlow({ radius: 250, intensity: 0.1 })} rounded=${this.isMobile ? 'top' : 'all'} type=\"glass\" fill=\"all\">\n\t\t\t\t\t${this.isMobile ? this.renderDragHandle() : null}\n\t\t\t\t\t<schmancy-scroll direction=\"vertical\" hide class=\"max-h-[85dvh]\">\n\t\t\t\t\t\t<slot></slot>\n\t\t\t\t\t</schmancy-scroll>\n\t\t\t\t</schmancy-surface>\n\t\t\t</section>\n\t\t`\n\t}\n\n\t/**\n\t * Static helper for confirm dialogs\n\t */\n\tstatic async confirm(options: {\n\t\ttitle?: string\n\t\tsubtitle?: string\n\t\tmessage?: string\n\t\tconfirmText?: string\n\t\tcancelText?: string\n\t\tvariant?: 'default' | 'danger'\n\t\tposition?: { x: number; y: number } | MouseEvent | TouchEvent\n\t\twidth?: string\n\t}): Promise<boolean> {\n\t\tlet dialog = document.querySelector('schmancy-dialog[data-static-confirm]') as SchmancyDialog\n\n\t\tif (!dialog) {\n\t\t\tdialog = document.createElement('schmancy-dialog') as SchmancyDialog\n\t\t\tdialog.setAttribute('data-static-confirm', '')\n\t\t\tdocument.body.appendChild(dialog)\n\t\t}\n\n\t\t// Set options\n\t\tdialog.title = options.title\n\t\tdialog.subtitle = options.subtitle\n\t\tdialog.message = options.message\n\t\tdialog.confirmText = options.confirmText ?? 'Confirm'\n\t\tdialog.cancelText = options.cancelText ?? 'Cancel'\n\t\tdialog.variant = options.variant ?? 'default'\n\t\tif (options.width) dialog.style.setProperty('--dialog-width', options.width)\n\n\t\treturn dialog.show(options.position)\n\t}\n\n\t/**\n\t * Simple shorthand - just pass message and optionally an event\n\t */\n\tstatic async ask(message: string, event?: MouseEvent | TouchEvent): Promise<boolean> {\n\t\treturn this.confirm({\n\t\t\tmessage,\n\t\t\tposition: event,\n\t\t})\n\t}\n}\n\n// Alias for backward compatibility\nexport { SchmancyDialog as ConfirmDialog }\n\ndeclare global {\n\tinterface HTMLElementTagNameMap {\n\t\t'schmancy-dialog': SchmancyDialog\n\t}\n}\n"],"mappings":";;;;;;;;;;;;;;AA2DA,IAAa,KAA8D,MAC1E,cAA8B,EAAA;CAAA,YAAA,GAAA,GAAA;AAAA,QAAA,GAAA,EAAA,EAAA,KAAA,WACF;GAAE,GAAG;GAAG,GAAG;GAAA,EAAA,KAAA,WAAA,CAC3B,GAAA,KAAA,aACE,GAAA,KAAA,aAOiB,IAAI,GAAA,EAAA,KAAA,qBAGW,MAAA,KAAA,gBACN,EAAA,EAAA,KAAA,YAAA,CAGnB,GAAA,KAAA,yBAAA;AAInB,OAAA;AACC,WAAO,KAAK,iBAAA;WAAA;AAEZ;;MAAA;;CAOF,cAAA;AACC,SAAO,KAAK;;CAMb,mBAAA;AACC,SAAO;;CAMR,qBAAA;AACC,SAAO;;CAMR,uBAAA;AACC,SAAO;;CAGR,oBAAA;AACC,QAAM,mBAAA,EACN,KAAK,qBAAA;;CAMN,sBAAA;AACC,IAAU,QAAQ,SAAA,CAChB,KACA,QAAU,OAAO,aA/GI,IAAA,EAgHrB,GAAA,EACA,QAAa,KAAK,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g3G_.js","names":[],"sources":["../src/divider/divider.ts"],"sourcesContent":["// divider.ts\nimport { $LitElement } from '@mixins/index'\nimport { css, html } from 'lit'\nimport { customElement, property } from 'lit/decorators.js'\n\n@customElement('schmancy-divider')\nexport default class SchmancyDivider extends $LitElement(css`\n\t:host {\n\t\tdisplay: block;\n\t}\n\n\t@keyframes grow-horizontal {\n\t\tfrom {\n\t\t\ttransform: scaleX(0);\n\t\t}\n\t\tto {\n\t\t\ttransform: scaleX(1);\n\t\t}\n\t}\n\n\t@keyframes grow-vertical {\n\t\tfrom {\n\t\t\ttransform: scaleY(0);\n\t\t}\n\t\tto {\n\t\t\ttransform: scaleY(1);\n\t\t}\n\t}\n\n\t/* Horizontal divider grow animations */\n\t.grow-start:not(.h-full) {\n\t\tanimation: grow-horizontal 400ms ease-out;\n\t\ttransform-origin: left;\n\t}\n\n\t.grow-end:not(.h-full) {\n\t\tanimation: grow-horizontal 400ms ease-out;\n\t\ttransform-origin: right;\n\t}\n\n\t.grow-both:not(.h-full) {\n\t\tanimation: grow-horizontal 400ms ease-out;\n\t\ttransform-origin: center;\n\t}\n\n\t/* Vertical divider grow animations */\n\t.grow-start.h-full {\n\t\tanimation: grow-vertical 400ms ease-out;\n\t\ttransform-origin: top;\n\t}\n\n\t.grow-end.h-full {\n\t\tanimation: grow-vertical 400ms ease-out;\n\t\ttransform-origin: bottom;\n\t}\n\n\t.grow-both.h-full {\n\t\tanimation: grow-vertical 400ms ease-out;\n\t\ttransform-origin: center;\n\t}\n`) {\n\t@property({ type: String }) outline: 'default' | 'variant' = 'variant'\n\t@property({ type: Boolean }) vertical = false\n\t@property({ type: String }) grow: 'start' | 'end' | 'both' = 'start'\n\n\t/**\n\t * @deprecated Use `vertical` property instead. Will be removed in next major version.\n\t */\n\t@property({ reflect: true, type: String })\n\tset orientation(value: 'horizontal' | 'vertical') {\n\t\tthis.vertical = value === 'vertical'\n\t}\n\tget orientation(): 'horizontal' | 'vertical' {\n\t\treturn this.vertical ? 'vertical' : 'horizontal'\n\t}\n\n\tprotected render() {\n\t\treturn html`<div\n\t\t\tclass=${this.classMap({\n\t\t\t\t// Dimensions\n\t\t\t\t'w-full h-px': !this.vertical,\n\t\t\t\t'h-full w-px': this.vertical,\n\t\t\t\t// Border color\n\t\t\t\t'border-outlineVariant': this.outline === 'variant',\n\t\t\t\t'border-outline': this.outline === 'default',\n\t\t\t\t// Border style\n\t\t\t\t'border-t': !this.vertical,\n\t\t\t\t'border-l': this.vertical,\n\t\t\t\t// Grow behavior\n\t\t\t\t[`grow-${this.grow}`]: true,\n\t\t\t})}\n\t\t></div>`\n\t}\n}\n\ndeclare global {\n\tinterface HTMLElementTagNameMap {\n\t\t'schmancy-divider': SchmancyDivider\n\t}\n}\n"],"mappings":";;;;;
|
|
1
|
+
{"version":3,"file":"divider-CbEWg3G_.js","names":[],"sources":["../src/divider/divider.ts"],"sourcesContent":["// divider.ts\nimport { $LitElement } from '@mixins/index'\nimport { css, html } from 'lit'\nimport { customElement, property } from 'lit/decorators.js'\n\n/**\n * Thin horizontal (or vertical) separator rule between sections of content.\n *\n * @element schmancy-divider\n * @summary Semantic separator between groups — list items, menu sections, content blocks. Uses outline theme token.\n * @example\n * <schmancy-list-item>First</schmancy-list-item>\n * <schmancy-divider></schmancy-divider>\n * <schmancy-list-item>Second</schmancy-list-item>\n * @platform hr - Styled horizontal rule. Degrades to a native `<hr>` if the tag never registers.\n */\n@customElement('schmancy-divider')\nexport default class SchmancyDivider extends $LitElement(css`\n\t:host {\n\t\tdisplay: block;\n\t}\n\n\t@keyframes grow-horizontal {\n\t\tfrom {\n\t\t\ttransform: scaleX(0);\n\t\t}\n\t\tto {\n\t\t\ttransform: scaleX(1);\n\t\t}\n\t}\n\n\t@keyframes grow-vertical {\n\t\tfrom {\n\t\t\ttransform: scaleY(0);\n\t\t}\n\t\tto {\n\t\t\ttransform: scaleY(1);\n\t\t}\n\t}\n\n\t/* Horizontal divider grow animations */\n\t.grow-start:not(.h-full) {\n\t\tanimation: grow-horizontal 400ms ease-out;\n\t\ttransform-origin: left;\n\t}\n\n\t.grow-end:not(.h-full) {\n\t\tanimation: grow-horizontal 400ms ease-out;\n\t\ttransform-origin: right;\n\t}\n\n\t.grow-both:not(.h-full) {\n\t\tanimation: grow-horizontal 400ms ease-out;\n\t\ttransform-origin: center;\n\t}\n\n\t/* Vertical divider grow animations */\n\t.grow-start.h-full {\n\t\tanimation: grow-vertical 400ms ease-out;\n\t\ttransform-origin: top;\n\t}\n\n\t.grow-end.h-full {\n\t\tanimation: grow-vertical 400ms ease-out;\n\t\ttransform-origin: bottom;\n\t}\n\n\t.grow-both.h-full {\n\t\tanimation: grow-vertical 400ms ease-out;\n\t\ttransform-origin: center;\n\t}\n`) {\n\t@property({ type: String }) outline: 'default' | 'variant' = 'variant'\n\t@property({ type: Boolean }) vertical = false\n\t@property({ type: String }) grow: 'start' | 'end' | 'both' = 'start'\n\n\t/**\n\t * @deprecated Use `vertical` property instead. Will be removed in next major version.\n\t */\n\t@property({ reflect: true, type: String })\n\tset orientation(value: 'horizontal' | 'vertical') {\n\t\tthis.vertical = value === 'vertical'\n\t}\n\tget orientation(): 'horizontal' | 'vertical' {\n\t\treturn this.vertical ? 'vertical' : 'horizontal'\n\t}\n\n\tprotected render() {\n\t\treturn html`<div\n\t\t\tclass=${this.classMap({\n\t\t\t\t// Dimensions\n\t\t\t\t'w-full h-px': !this.vertical,\n\t\t\t\t'h-full w-px': this.vertical,\n\t\t\t\t// Border color\n\t\t\t\t'border-outlineVariant': this.outline === 'variant',\n\t\t\t\t'border-outline': this.outline === 'default',\n\t\t\t\t// Border style\n\t\t\t\t'border-t': !this.vertical,\n\t\t\t\t'border-l': this.vertical,\n\t\t\t\t// Grow behavior\n\t\t\t\t[`grow-${this.grow}`]: true,\n\t\t\t})}\n\t\t></div>`\n\t}\n}\n\ndeclare global {\n\tinterface HTMLElementTagNameMap {\n\t\t'schmancy-divider': SchmancyDivider\n\t}\n}\n"],"mappings":";;;;;AAiBe,IAAA,IAAA,cAA8B,EAAY,CAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8BAuDE,WAAA,KAAA,WAAA,CACrB,GAAA,KAAA,OACqB;;CAK7D,IAAA,YACgB,GAAA;AACf,OAAK,WAAW,MAAU;;CAE3B,IAAA,cAAI;AACH,SAAO,KAAK,WAAW,aAAa;;CAGrC,SAAA;AACC,SAAO,CAAI;WACF,KAAK,SAAS;GAErB,eAAA,CAAgB,KAAK;GACrB,eAAe,KAAK;GAEpB,yBAAyB,KAAK,YAAY;GAC1C,kBAAkB,KAAK,YAAY;GAEnC,YAAA,CAAa,KAAK;GAClB,YAAY,KAAK;IAEhB,QAAQ,KAAK,SAAA,CAAS;GAAA,CAAA,CAAA;;;;GA5BzB,EAAS,EAAE,MAAM,QAAA,CAAA,CAAA,EAAS,EAAA,WAAA,WAAA,KAAA,EAAA,EAAA,EAAA,CAC1B,EAAS,EAAE,MAAM,SAAA,CAAA,CAAA,EAAU,EAAA,WAAA,YAAA,KAAA,EAAA,EAAA,EAAA,CAC3B,EAAS,EAAE,MAAM,QAAA,CAAA,CAAA,EAAS,EAAA,WAAA,QAAA,KAAA,EAAA,EAAA,EAAA,CAK1B,EAAS;CAAE,SAAA,CAAS;CAAM,MAAM;CAAA,CAAA,CAAA,EAAS,EAAA,WAAA,eAAA,KAAA,EAAA,IAAA,EAAA,CA/D1C,EAAc,mBAAA,CAAA,EAAmB,EAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"divider-JyyFw_3J.cjs","names":[],"sources":["../src/divider/divider.ts"],"sourcesContent":["// divider.ts\nimport { $LitElement } from '@mixins/index'\nimport { css, html } from 'lit'\nimport { customElement, property } from 'lit/decorators.js'\n\n@customElement('schmancy-divider')\nexport default class SchmancyDivider extends $LitElement(css`\n\t:host {\n\t\tdisplay: block;\n\t}\n\n\t@keyframes grow-horizontal {\n\t\tfrom {\n\t\t\ttransform: scaleX(0);\n\t\t}\n\t\tto {\n\t\t\ttransform: scaleX(1);\n\t\t}\n\t}\n\n\t@keyframes grow-vertical {\n\t\tfrom {\n\t\t\ttransform: scaleY(0);\n\t\t}\n\t\tto {\n\t\t\ttransform: scaleY(1);\n\t\t}\n\t}\n\n\t/* Horizontal divider grow animations */\n\t.grow-start:not(.h-full) {\n\t\tanimation: grow-horizontal 400ms ease-out;\n\t\ttransform-origin: left;\n\t}\n\n\t.grow-end:not(.h-full) {\n\t\tanimation: grow-horizontal 400ms ease-out;\n\t\ttransform-origin: right;\n\t}\n\n\t.grow-both:not(.h-full) {\n\t\tanimation: grow-horizontal 400ms ease-out;\n\t\ttransform-origin: center;\n\t}\n\n\t/* Vertical divider grow animations */\n\t.grow-start.h-full {\n\t\tanimation: grow-vertical 400ms ease-out;\n\t\ttransform-origin: top;\n\t}\n\n\t.grow-end.h-full {\n\t\tanimation: grow-vertical 400ms ease-out;\n\t\ttransform-origin: bottom;\n\t}\n\n\t.grow-both.h-full {\n\t\tanimation: grow-vertical 400ms ease-out;\n\t\ttransform-origin: center;\n\t}\n`) {\n\t@property({ type: String }) outline: 'default' | 'variant' = 'variant'\n\t@property({ type: Boolean }) vertical = false\n\t@property({ type: String }) grow: 'start' | 'end' | 'both' = 'start'\n\n\t/**\n\t * @deprecated Use `vertical` property instead. Will be removed in next major version.\n\t */\n\t@property({ reflect: true, type: String })\n\tset orientation(value: 'horizontal' | 'vertical') {\n\t\tthis.vertical = value === 'vertical'\n\t}\n\tget orientation(): 'horizontal' | 'vertical' {\n\t\treturn this.vertical ? 'vertical' : 'horizontal'\n\t}\n\n\tprotected render() {\n\t\treturn html`<div\n\t\t\tclass=${this.classMap({\n\t\t\t\t// Dimensions\n\t\t\t\t'w-full h-px': !this.vertical,\n\t\t\t\t'h-full w-px': this.vertical,\n\t\t\t\t// Border color\n\t\t\t\t'border-outlineVariant': this.outline === 'variant',\n\t\t\t\t'border-outline': this.outline === 'default',\n\t\t\t\t// Border style\n\t\t\t\t'border-t': !this.vertical,\n\t\t\t\t'border-l': this.vertical,\n\t\t\t\t// Grow behavior\n\t\t\t\t[`grow-${this.grow}`]: true,\n\t\t\t})}\n\t\t></div>`\n\t}\n}\n\ndeclare global {\n\tinterface HTMLElementTagNameMap {\n\t\t'schmancy-divider': SchmancyDivider\n\t}\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"divider-JyyFw_3J.cjs","names":[],"sources":["../src/divider/divider.ts"],"sourcesContent":["// divider.ts\nimport { $LitElement } from '@mixins/index'\nimport { css, html } from 'lit'\nimport { customElement, property } from 'lit/decorators.js'\n\n/**\n * Thin horizontal (or vertical) separator rule between sections of content.\n *\n * @element schmancy-divider\n * @summary Semantic separator between groups — list items, menu sections, content blocks. Uses outline theme token.\n * @example\n * <schmancy-list-item>First</schmancy-list-item>\n * <schmancy-divider></schmancy-divider>\n * <schmancy-list-item>Second</schmancy-list-item>\n * @platform hr - Styled horizontal rule. Degrades to a native `<hr>` if the tag never registers.\n */\n@customElement('schmancy-divider')\nexport default class SchmancyDivider extends $LitElement(css`\n\t:host {\n\t\tdisplay: block;\n\t}\n\n\t@keyframes grow-horizontal {\n\t\tfrom {\n\t\t\ttransform: scaleX(0);\n\t\t}\n\t\tto {\n\t\t\ttransform: scaleX(1);\n\t\t}\n\t}\n\n\t@keyframes grow-vertical {\n\t\tfrom {\n\t\t\ttransform: scaleY(0);\n\t\t}\n\t\tto {\n\t\t\ttransform: scaleY(1);\n\t\t}\n\t}\n\n\t/* Horizontal divider grow animations */\n\t.grow-start:not(.h-full) {\n\t\tanimation: grow-horizontal 400ms ease-out;\n\t\ttransform-origin: left;\n\t}\n\n\t.grow-end:not(.h-full) {\n\t\tanimation: grow-horizontal 400ms ease-out;\n\t\ttransform-origin: right;\n\t}\n\n\t.grow-both:not(.h-full) {\n\t\tanimation: grow-horizontal 400ms ease-out;\n\t\ttransform-origin: center;\n\t}\n\n\t/* Vertical divider grow animations */\n\t.grow-start.h-full {\n\t\tanimation: grow-vertical 400ms ease-out;\n\t\ttransform-origin: top;\n\t}\n\n\t.grow-end.h-full {\n\t\tanimation: grow-vertical 400ms ease-out;\n\t\ttransform-origin: bottom;\n\t}\n\n\t.grow-both.h-full {\n\t\tanimation: grow-vertical 400ms ease-out;\n\t\ttransform-origin: center;\n\t}\n`) {\n\t@property({ type: String }) outline: 'default' | 'variant' = 'variant'\n\t@property({ type: Boolean }) vertical = false\n\t@property({ type: String }) grow: 'start' | 'end' | 'both' = 'start'\n\n\t/**\n\t * @deprecated Use `vertical` property instead. Will be removed in next major version.\n\t */\n\t@property({ reflect: true, type: String })\n\tset orientation(value: 'horizontal' | 'vertical') {\n\t\tthis.vertical = value === 'vertical'\n\t}\n\tget orientation(): 'horizontal' | 'vertical' {\n\t\treturn this.vertical ? 'vertical' : 'horizontal'\n\t}\n\n\tprotected render() {\n\t\treturn html`<div\n\t\t\tclass=${this.classMap({\n\t\t\t\t// Dimensions\n\t\t\t\t'w-full h-px': !this.vertical,\n\t\t\t\t'h-full w-px': this.vertical,\n\t\t\t\t// Border color\n\t\t\t\t'border-outlineVariant': this.outline === 'variant',\n\t\t\t\t'border-outline': this.outline === 'default',\n\t\t\t\t// Border style\n\t\t\t\t'border-t': !this.vertical,\n\t\t\t\t'border-l': this.vertical,\n\t\t\t\t// Grow behavior\n\t\t\t\t[`grow-${this.grow}`]: true,\n\t\t\t})}\n\t\t></div>`\n\t}\n}\n\ndeclare global {\n\tinterface HTMLElementTagNameMap {\n\t\t'schmancy-divider': SchmancyDivider\n\t}\n}\n"],"mappings":"oMAiBe,IAAA,EAAA,cAA8B,EAAA,EAAY,EAAA,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8CAuDE,UAAA,KAAA,SAAA,CACrB,EAAA,KAAA,KACqB,QAK7D,IAAA,YACgB,EAAA,CACf,KAAK,SAAW,IAAU,WAE3B,IAAA,aAAI,CACH,OAAO,KAAK,SAAW,WAAa,aAGrC,QAAA,CACC,MAAO,GAAA,IAAI;WACF,KAAK,SAAS,CAErB,cAAA,CAAgB,KAAK,SACrB,cAAe,KAAK,SAEpB,wBAAyB,KAAK,UAAY,UAC1C,iBAAkB,KAAK,UAAY,UAEnC,WAAA,CAAa,KAAK,SAClB,WAAY,KAAK,UAEhB,QAAQ,KAAK,QAAA,CAAS,EAAA,CAAA,CAAA;iCA5BhB,CAAE,KAAM,OAAA,CAAA,CAAA,CAAS,EAAA,UAAA,UAAA,IAAA,GAAA,CAAA,EAAA,EAAA,EAAA,EAAA,EAAA,UACjB,CAAE,KAAM,QAAA,CAAA,CAAA,CAAU,EAAA,UAAA,WAAA,IAAA,GAAA,CAAA,EAAA,EAAA,EAAA,EAAA,EAAA,UAClB,CAAE,KAAM,OAAA,CAAA,CAAA,CAAS,EAAA,UAAA,OAAA,IAAA,GAAA,CAAA,EAAA,EAAA,EAAA,EAAA,EAAA,UAKjB,CAAE,QAAA,CAAS,EAAM,KAAM,OAAA,CAAA,CAAA,CAAS,EAAA,UAAA,cAAA,KAAA,CAAA,EAAA,EAAA,EAAA,EAAA,EAAA,EAAA,eA/D5B,mBAAA,CAAA,CAAmB,EAAA"}
|
package/dist/dropdown.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dropdown.cjs","names":[],"sources":["../src/dropdown/dropdown-component.ts","../src/dropdown/dropdown-content.ts"],"sourcesContent":["import { autoUpdate, computePosition, flip, offset, shift } from '@floating-ui/dom'\nimport { $LitElement } from '@mixins/index'\nimport { html } from 'lit'\nimport { customElement, property, query, queryAssignedElements, state } from 'lit/decorators.js'\nimport { filter, fromEvent, takeUntil, Subscription } from 'rxjs'\n\n/**\n * A dropdown component that displays content when triggered.\n *\n * @element schmancy-dropdown\n * @slot trigger - The element that triggers the dropdown\n * @slot - Default slot for the dropdown content\n */\n@customElement('schmancy-dropdown')\nexport class SchmancyDropdown extends $LitElement() {\n\t/**\n\t * Whether the dropdown is currently open\n\t */\n\t@property({ type: Boolean, reflect: true })\n\topen = false\n\n\t/**\n\t * Placement of the dropdown relative to the trigger\n\t */\n\t@property({ type: String })\n\tplacement:\n\t\t| 'top'\n\t\t| 'top-start'\n\t\t| 'top-end'\n\t\t| 'right'\n\t\t| 'right-start'\n\t\t| 'right-end'\n\t\t| 'bottom'\n\t\t| 'bottom-start'\n\t\t| 'bottom-end'\n\t\t| 'left'\n\t\t| 'left-start'\n\t\t| 'left-end' = 'bottom-start'\n\n\t/**\n\t * Offset distance in pixels\n\t */\n\t@property({ type: Number })\n\tdistance = 8\n\n\t@query('.trigger-container') triggerContainer!: HTMLElement\n\t@query('.dropdown-content-container') contentContainer!: HTMLElement\n\t@queryAssignedElements({ flatten: true }) contentElements!: HTMLElement[]\n\t@state() private portal: HTMLElement | null = null\n\n\t@queryAssignedElements({ slot: 'trigger', flatten: true })\n\ttriggerElements!: Array<HTMLElement>\n\n\tprivate cleanupPositioner?: () => void\n\tprivate portalSubscriptions: Subscription[] = []\n\n\tconnectedCallback() {\n\t\tsuper.connectedCallback()\n\n\t\t// Create portal container for teleporting content to document body\n\t\tthis.setupPortal()\n\n\t\t// Listen for document clicks to close dropdown when clicking outside\n\t\tfromEvent<MouseEvent>(document, 'click')\n\t\t\t.pipe(\n\t\t\t\tfilter(event => this.open && !this.isEventFromSelf(event)),\n\t\t\t\ttakeUntil(this.disconnecting),\n\t\t\t)\n\t\t\t.subscribe(() => {\n\t\t\t\tthis.open = false\n\t\t\t})\n\n\t\t// Listen for escape key to close dropdown\n\t\tfromEvent<KeyboardEvent>(document, 'keydown')\n\t\t\t.pipe(\n\t\t\t\tfilter(event => this.open && event.key === 'Escape'),\n\t\t\t\ttakeUntil(this.disconnecting),\n\t\t\t)\n\t\t\t.subscribe(() => {\n\t\t\t\tthis.open = false\n\t\t\t})\n\t}\n\n\t/**\n\t * Set up the portal element for teleporting content\n\t */\n\tprivate setupPortal() {\n\t\t// Check if portal container exists\n\t\tlet portalContainer = document.getElementById('schmancy-portal-container')\n\n\t\t// Create portal container if it doesn't exist\n\t\tif (!portalContainer) {\n\t\t\tportalContainer = document.createElement('div')\n\t\t\tportalContainer.id = 'schmancy-portal-container'\n\t\t\tportalContainer.style.position = 'fixed'\n\t\t\tportalContainer.style.zIndex = '10000'\n\t\t\tportalContainer.style.top = '0'\n\t\t\tportalContainer.style.left = '0'\n\t\t\tportalContainer.style.pointerEvents = 'none'\n\t\t\tdocument.body.appendChild(portalContainer)\n\t\t}\n\n\t\t// Create portal for this specific dropdown\n\t\tconst portal = document.createElement('div')\n\t\tportal.className = 'schmancy-dropdown-portal'\n\t\tportal.style.position = 'absolute'\n\t\tportal.style.pointerEvents = 'auto'\n\t\tportal.style.display = 'none'\n\t\tportalContainer.appendChild(portal)\n\n\t\tthis.portal = portal\n\t}\n\n\t/**\n\t * Check if an event originated from within this component\n\t */\n\tprivate isEventFromSelf(event: Event): boolean {\n\t\treturn event.composedPath().some(el => el === this)\n\t}\n\n\tdisconnectedCallback() {\n\t\tthis.cleanupPositioner?.()\n\n\t\t// Clean up portal subscriptions\n\t\tthis.portalSubscriptions.forEach(subscription => subscription.unsubscribe())\n\t\tthis.portalSubscriptions = []\n\n\t\t// Remove portal when component is disconnected\n\t\tif (this.portal) {\n\t\t\tthis.portal.remove()\n\t\t\tthis.portal = null\n\t\t}\n\n\t\tsuper.disconnectedCallback()\n\t}\n\n\t/**\n\t * Toggle the dropdown open state\n\t */\n\ttoggle() {\n\t\tthis.open = !this.open\n\t}\n\n\tupdated(changedProps: Map<string, any>) {\n\t\tsuper.updated(changedProps)\n\n\t\tif (changedProps.has('open')) {\n\t\t\tif (this.open) {\n\t\t\t\tthis.setupPositioner()\n\t\t\t} else {\n\t\t\t\tthis.cleanupPositioner?.()\n\n\t\t\t\t// Hide portal when dropdown is closed\n\t\t\t\tif (this.portal) {\n\t\t\t\t\tthis.portal.style.display = 'none'\n\t\t\t\t\tthis.portal.innerHTML = ''\n\t\t\t\t\t// Clean up subscriptions when content is cleared\n\t\t\t\t\tthis.portalSubscriptions.forEach(subscription => subscription.unsubscribe())\n\t\t\t\t\tthis.portalSubscriptions = []\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Setup floating UI positioning with teleportation\n\t */\n\tprivate setupPositioner() {\n\t\tif (!this.triggerContainer || !this.portal) return\n\n\t\t// Show the portal\n\t\tthis.portal.style.display = 'block'\n\n\t\t// Move content to portal\n\t\tthis.teleportContentToPortal()\n\n\t\t// Setup positioning\n\t\tthis.cleanupPositioner = autoUpdate(this.triggerContainer, this.portal, () => {\n\t\t\tcomputePosition(this.triggerContainer, this.portal, {\n\t\t\t\tplacement: this.placement,\n\t\t\t\tmiddleware: [\n\t\t\t\t\toffset(this.distance),\n\t\t\t\t\tflip({\n\t\t\t\t\t\tfallbackPlacements: ['top-start', 'bottom-start'],\n\t\t\t\t\t}),\n\t\t\t\t\tshift({ padding: 0 }),\n\t\t\t\t],\n\t\t\t}).then(({ x, y }) => {\n\t\t\t\t// Update portal position\n\t\t\t\tObject.assign(this.portal.style, {\n\t\t\t\t\tleft: `${x}px`,\n\t\t\t\t\ttop: `${y - 8}px`,\n\t\t\t\t})\n\t\t\t})\n\t\t})\n\t}\n\n\t/**\n\t * Move slotted content to the portal\n\t */\n\tprivate teleportContentToPortal() {\n\t\tif (!this.portal) return\n\n\t\t// Clean up existing subscriptions\n\t\tthis.portalSubscriptions.forEach(subscription => subscription.unsubscribe())\n\t\tthis.portalSubscriptions = []\n\n\t\t// Clear existing content\n\t\tthis.portal.innerHTML = ''\n\n\t\t// Clone and move slotted content to portal\n\t\tthis.contentElements.forEach(element => {\n\t\t\t// Get computed styles to ensure portal content matches original styling\n\t\t\tconst clonedElement = element.cloneNode(true) as HTMLElement\n\n\t\t\t// Ensure dropdown-content elements maintain their styles when teleported\n\t\t\tif (element.tagName.toLowerCase() === 'schmancy-dropdown-content') {\n\t\t\t\tconst subscription = fromEvent(clonedElement, 'slotchange').subscribe(() => {\n\t\t\t\t\t// Propagate any slot changes to class changes on children\n\t\t\t\t\tconst contentDiv = clonedElement.shadowRoot?.querySelector('[part=\"content\"]')\n\t\t\t\t\tif (contentDiv) {\n\t\t\t\t\t\tcontentDiv.classList.add('schmancy-dropdown-content')\n\t\t\t\t\t}\n\t\t\t\t})\n\t\t\t\tthis.portalSubscriptions.push(subscription)\n\t\t\t}\n\n\t\t\tthis.portal?.appendChild(clonedElement)\n\t\t})\n\t}\n\n\t/**\n\t * Handle trigger click to toggle dropdown\n\t */\n\tprivate handleTriggerClick(e: Event) {\n\t\te.stopPropagation()\n\t\tthis.toggle()\n\t}\n\n\trender() {\n\t\treturn html`\n\t\t\t<div class=\"trigger-container\" @click=${this.handleTriggerClick}>\n\t\t\t\t<slot name=\"trigger\"></slot>\n\t\t\t</div>\n\n\t\t\t<div class=\"dropdown-content-container\" ?hidden=${!this.open}>\n\t\t\t\t<slot\n\t\t\t\t\t@slotchange=${() => {\n\t\t\t\t\t\tif (this.open) {\n\t\t\t\t\t\t\tthis.teleportContentToPortal()\n\t\t\t\t\t\t\tthis.setupPositioner()\n\t\t\t\t\t\t}\n\t\t\t\t\t}}\n\t\t\t\t></slot>\n\t\t\t</div>\n\t\t`\n\t}\n}\n\ndeclare global {\n\tinterface HTMLElementTagNameMap {\n\t\t'schmancy-dropdown': SchmancyDropdown\n\t}\n}\n","import { TailwindElement } from '@mixins/index'\nimport { css, html } from 'lit'\nimport { customElement, property } from 'lit/decorators.js'\n\n/**\n * Content container for the schmancy-dropdown component.\n *\n * @element schmancy-dropdown-content\n * @slot - Default slot for dropdown content.\n * @csspart content - The inner wrapper element; style to override panel\n * backgrounds, shadows, padding, or borders without shadow-root piercing.\n */\n@customElement('schmancy-dropdown-content')\nexport class SchmancyDropdownContent extends TailwindElement(css`\n\t:host {\n\t\tdisplay: block;\n\t\tposition: absolute;\n\t\tz-index: 1000;\n\t\tmin-width: 10rem;\n\t\tmargin: 0;\n\t\ttext-align: left;\n\t\tlist-style: none;\n\t\tbackground-color: var(--schmancy-sys-color-surface-container);\n\t\tbackground-clip: padding-box;\n\t\tborder-radius: 0.375rem;\n\t\tbox-shadow: var(--schmancy-sys-elevation-3);\n\t\twill-change: transform;\n\t\ttransform-origin: top left;\n\t\tanimation: dropdownAnimation 0.1s ease-out forwards;\n\t}\n\n\t:host([hidden]) {\n\t\tdisplay: none;\n\t}\n\n\t@keyframes dropdownAnimation {\n\t\tfrom {\n\t\t\topacity: 0;\n\t\t\ttransform: scale(0.95);\n\t\t}\n\t\tto {\n\t\t\topacity: 1;\n\t\t\ttransform: scale(1);\n\t\t}\n\t}\n\n\t/* Apply styles to content both in the component and when teleported to the portal */\n\t.schmancy-dropdown-content {\n\t\tbackground-color: var(--schmancy-sys-color-surface-container);\n\t\tborder-radius: 0.375rem;\n\t\tbox-shadow: var(--schmancy-sys-elevation-3);\n\t\twill-change: transform;\n\t\ttransform-origin: top left;\n\t\tanimation: dropdownAnimation 0.1s ease-out forwards;\n\t}\n`) {\n\t/**\n\t * Width of the dropdown content\n\t */\n\t@property({ type: String })\n\twidth: string = 'auto'\n\n\t/**\n\t * Maximum height of the dropdown content\n\t */\n\t@property({ type: String })\n\tmaxHeight: string = '80vh'\n\n\t/**\n\t * Whether to render with a shadow\n\t */\n\t@property({ type: Boolean })\n\tshadow: boolean = true\n\n\t/**\n\t * Border radius style\n\t */\n\t@property({ type: String })\n\tradius: 'none' | 'sm' | 'md' | 'lg' | 'full' = 'md'\n\n\trender() {\n\t\tconst classes = {\n\t\t\t'schmancy-dropdown-content': true,\n\t\t\t'overflow-auto': true,\n\t\t\t'shadow-none': !this.shadow,\n\t\t\t'rounded-none': this.radius === 'none',\n\t\t\t'rounded-sm': this.radius === 'sm',\n\t\t\t'rounded-md': this.radius === 'md',\n\t\t\t'rounded-lg': this.radius === 'lg',\n\t\t\t'rounded-full': this.radius === 'full',\n\t\t}\n\n\t\tconst styles = {\n\t\t\twidth: this.width,\n\t\t\tmaxHeight: this.maxHeight,\n\t\t}\n\n\t\treturn html`\n\t\t\t<div class=${this.classMap(classes)} style=${this.styleMap(styles)} part=\"content\">\n\t\t\t\t<slot></slot>\n\t\t\t</div>\n\t\t`\n\t}\n}\n\ndeclare global {\n\tinterface HTMLElementTagNameMap {\n\t\t'schmancy-dropdown-content': SchmancyDropdownContent\n\t}\n}\n"],"mappings":"kWAcO,IAAA,EAAA,cAA+B,EAAA,GAAA,AAAA,CAAA,YAAA,GAAA,EAAA,CAAA,MAAA,GAAA,EAAA,CAAA,KAAA,KAAA,CAK9B,EAAA,KAAA,UAkBS,eAAA,KAAA,SAML,EAAA,KAAA,OAKmC,KAAA,KAAA,oBAMA,EAAA,CAE9C,mBAAA,CACC,MAAM,mBAAA,CAGN,KAAK,aAAA,EAGL,EAAA,EAAA,WAAsB,SAAU,QAAA,CAC9B,MAAA,EAAA,EAAA,QACO,GAAS,KAAK,MAAA,CAAS,KAAK,gBAAgB,EAAA,CAAA,EAAO,EAAA,EAAA,WAChD,KAAK,cAAA,CAAA,CAEf,cAAA,CACA,KAAK,KAAA,CAAO,GAAA,EAId,EAAA,EAAA,WAAyB,SAAU,UAAA,CACjC,MAAA,EAAA,EAAA,QACO,GAAS,KAAK,MAAQ,EAAM,MAAQ,SAAR,EAAiB,EAAA,EAAA,WAC1C,KAAK,cAAA,CAAA,CAEf,cAAA,CACA,KAAK,KAAA,CAAO,GAAA,CAOf,aAAA,CAEC,IAAI,EAAkB,SAAS,eAAe,4BAAA,CAGzC,IACJ,EAAkB,SAAS,cAAc,MAAA,CACzC,EAAgB,GAAK,4BACrB,EAAgB,MAAM,SAAW,QACjC,EAAgB,MAAM,OAAS,QAC/B,EAAgB,MAAM,IAAM,IAC5B,EAAgB,MAAM,KAAO,IAC7B,EAAgB,MAAM,cAAgB,OACtC,SAAS,KAAK,YAAY,EAAA,EAI3B,IAAM,EAAS,SAAS,cAAc,MAAA,CACtC,EAAO,UAAY,2BACnB,EAAO,MAAM,SAAW,WACxB,EAAO,MAAM,cAAgB,OAC7B,EAAO,MAAM,QAAU,OACv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A,CAAA,EAAA,EAAA,EAAA,EAAA,EAAA,EAAA,eAjEb,4BAAA,CAAA,CAA4B,EAAA,CAAA,OAAA,eAAA,QAAA,mBAAA,CAAA,WAAA,CAAA,EAAA,IAAA,UAAA,CAAA,OAAA,GAAA,CAAA,CAAA,OAAA,eAAA,QAAA,0BAAA,CAAA,WAAA,CAAA,EAAA,IAAA,UAAA,CAAA,OAAA,GAAA,CAAA"}
|
|
1
|
+
{"version":3,"file":"dropdown.cjs","names":[],"sources":["../src/dropdown/dropdown-component.ts","../src/dropdown/dropdown-content.ts"],"sourcesContent":["import { autoUpdate, computePosition, flip, offset, shift } from '@floating-ui/dom'\nimport { $LitElement } from '@mixins/index'\nimport { html } from 'lit'\nimport { customElement, property, query, queryAssignedElements, state } from 'lit/decorators.js'\nimport { filter, fromEvent, takeUntil, Subscription } from 'rxjs'\n\n/**\n * Anchored floating dropdown — a generic \"show this content relative to that trigger\" primitive. Unlike schmancy-menu (which uses the dialog service and is list-shaped), dropdown is a low-level popover anchored with Floating UI. Use when you want a custom-shaped overlay tied to a specific trigger element without the menu semantics.\n *\n * @element schmancy-dropdown\n * @summary Prefer schmancy-menu for action lists, schmancy-autocomplete for type-ahead, schmancy-tooltip for hover hints. Reach for schmancy-dropdown when none of those fit — custom filters, color pickers, inline forms anchored to a trigger.\n * @example\n * <schmancy-dropdown>\n * <schmancy-button slot=\"trigger\">Filters</schmancy-button>\n * <schmancy-dropdown-content>\n * <schmancy-form>…</schmancy-form>\n * </schmancy-dropdown-content>\n * </schmancy-dropdown>\n * @platform div - Anchored via Floating UI (autoUpdate, flip, shift). Degrades to inline content if the tag never registers — loses positioning but content stays accessible.\n * @attr open - Boolean; whether the dropdown is visible.\n * @fires open - When the dropdown opens.\n * @fires close - When the dropdown closes.\n * @slot trigger - The element that triggers the dropdown\n * @slot - Default slot for the dropdown content\n */\n@customElement('schmancy-dropdown')\nexport class SchmancyDropdown extends $LitElement() {\n\t/**\n\t * Whether the dropdown is currently open\n\t */\n\t@property({ type: Boolean, reflect: true })\n\topen = false\n\n\t/**\n\t * Placement of the dropdown relative to the trigger\n\t */\n\t@property({ type: String })\n\tplacement:\n\t\t| 'top'\n\t\t| 'top-start'\n\t\t| 'top-end'\n\t\t| 'right'\n\t\t| 'right-start'\n\t\t| 'right-end'\n\t\t| 'bottom'\n\t\t| 'bottom-start'\n\t\t| 'bottom-end'\n\t\t| 'left'\n\t\t| 'left-start'\n\t\t| 'left-end' = 'bottom-start'\n\n\t/**\n\t * Offset distance in pixels\n\t */\n\t@property({ type: Number })\n\tdistance = 8\n\n\t@query('.trigger-container') triggerContainer!: HTMLElement\n\t@query('.dropdown-content-container') contentContainer!: HTMLElement\n\t@queryAssignedElements({ flatten: true }) contentElements!: HTMLElement[]\n\t@state() private portal: HTMLElement | null = null\n\n\t@queryAssignedElements({ slot: 'trigger', flatten: true })\n\ttriggerElements!: Array<HTMLElement>\n\n\tprivate cleanupPositioner?: () => void\n\tprivate portalSubscriptions: Subscription[] = []\n\n\tconnectedCallback() {\n\t\tsuper.connectedCallback()\n\n\t\t// Create portal container for teleporting content to document body\n\t\tthis.setupPortal()\n\n\t\t// Listen for document clicks to close dropdown when clicking outside\n\t\tfromEvent<MouseEvent>(document, 'click')\n\t\t\t.pipe(\n\t\t\t\tfilter(event => this.open && !this.isEventFromSelf(event)),\n\t\t\t\ttakeUntil(this.disconnecting),\n\t\t\t)\n\t\t\t.subscribe(() => {\n\t\t\t\tthis.open = false\n\t\t\t})\n\n\t\t// Listen for escape key to close dropdown\n\t\tfromEvent<KeyboardEvent>(document, 'keydown')\n\t\t\t.pipe(\n\t\t\t\tfilter(event => this.open && event.key === 'Escape'),\n\t\t\t\ttakeUntil(this.disconnecting),\n\t\t\t)\n\t\t\t.subscribe(() => {\n\t\t\t\tthis.open = false\n\t\t\t})\n\t}\n\n\t/**\n\t * Set up the portal element for teleporting content\n\t */\n\tprivate setupPortal() {\n\t\t// Check if portal container exists\n\t\tlet portalContainer = document.getElementById('schmancy-portal-container')\n\n\t\t// Create portal container if it doesn't exist\n\t\tif (!portalContainer) {\n\t\t\tportalContainer = document.createElement('div')\n\t\t\tportalContainer.id = 'schmancy-portal-container'\n\t\t\tportalContainer.style.position = 'fixed'\n\t\t\tportalContainer.style.zIndex = '10000'\n\t\t\tportalContainer.style.top = '0'\n\t\t\tportalContainer.style.left = '0'\n\t\t\tportalContainer.style.pointerEvents = 'none'\n\t\t\tdocument.body.appendChild(portalContainer)\n\t\t}\n\n\t\t// Create portal for this specific dropdown\n\t\tconst portal = document.createElement('div')\n\t\tportal.className = 'schmancy-dropdown-portal'\n\t\tportal.style.position = 'absolute'\n\t\tportal.style.pointerEvents = 'auto'\n\t\tportal.style.display = 'none'\n\t\tportalContainer.appendChild(portal)\n\n\t\tthis.portal = portal\n\t}\n\n\t/**\n\t * Check if an event originated from within this component\n\t */\n\tprivate isEventFromSelf(event: Event): boolean {\n\t\treturn event.composedPath().some(el => el === this)\n\t}\n\n\tdisconnectedCallback() {\n\t\tthis.cleanupPositioner?.()\n\n\t\t// Clean up portal subscriptions\n\t\tthis.portalSubscriptions.forEach(subscription => subscription.unsubscribe())\n\t\tthis.portalSubscriptions = []\n\n\t\t// Remove portal when component is disconnected\n\t\tif (this.portal) {\n\t\t\tthis.portal.remove()\n\t\t\tthis.portal = null\n\t\t}\n\n\t\tsuper.disconnectedCallback()\n\t}\n\n\t/**\n\t * Toggle the dropdown open state\n\t */\n\ttoggle() {\n\t\tthis.open = !this.open\n\t}\n\n\tupdated(changedProps: Map<string, any>) {\n\t\tsuper.updated(changedProps)\n\n\t\tif (changedProps.has('open')) {\n\t\t\tif (this.open) {\n\t\t\t\tthis.setupPositioner()\n\t\t\t} else {\n\t\t\t\tthis.cleanupPositioner?.()\n\n\t\t\t\t// Hide portal when dropdown is closed\n\t\t\t\tif (this.portal) {\n\t\t\t\t\tthis.portal.style.display = 'none'\n\t\t\t\t\tthis.portal.innerHTML = ''\n\t\t\t\t\t// Clean up subscriptions when content is cleared\n\t\t\t\t\tthis.portalSubscriptions.forEach(subscription => subscription.unsubscribe())\n\t\t\t\t\tthis.portalSubscriptions = []\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Setup floating UI positioning with teleportation\n\t */\n\tprivate setupPositioner() {\n\t\tif (!this.triggerContainer || !this.portal) return\n\n\t\t// Show the portal\n\t\tthis.portal.style.display = 'block'\n\n\t\t// Move content to portal\n\t\tthis.teleportContentToPortal()\n\n\t\t// Setup positioning\n\t\tthis.cleanupPositioner = autoUpdate(this.triggerContainer, this.portal, () => {\n\t\t\tcomputePosition(this.triggerContainer, this.portal, {\n\t\t\t\tplacement: this.placement,\n\t\t\t\tmiddleware: [\n\t\t\t\t\toffset(this.distance),\n\t\t\t\t\tflip({\n\t\t\t\t\t\tfallbackPlacements: ['top-start', 'bottom-start'],\n\t\t\t\t\t}),\n\t\t\t\t\tshift({ padding: 0 }),\n\t\t\t\t],\n\t\t\t}).then(({ x, y }) => {\n\t\t\t\t// Update portal position\n\t\t\t\tObject.assign(this.portal.style, {\n\t\t\t\t\tleft: `${x}px`,\n\t\t\t\t\ttop: `${y - 8}px`,\n\t\t\t\t})\n\t\t\t})\n\t\t})\n\t}\n\n\t/**\n\t * Move slotted content to the portal\n\t */\n\tprivate teleportContentToPortal() {\n\t\tif (!this.portal) return\n\n\t\t// Clean up existing subscriptions\n\t\tthis.portalSubscriptions.forEach(subscription => subscription.unsubscribe())\n\t\tthis.portalSubscriptions = []\n\n\t\t// Clear existing content\n\t\tthis.portal.innerHTML = ''\n\n\t\t// Clone and move slotted content to portal\n\t\tthis.contentElements.forEach(element => {\n\t\t\t// Get computed styles to ensure portal content matches original styling\n\t\t\tconst clonedElement = element.cloneNode(true) as HTMLElement\n\n\t\t\t// Ensure dropdown-content elements maintain their styles when teleported\n\t\t\tif (element.tagName.toLowerCase() === 'schmancy-dropdown-content') {\n\t\t\t\tconst subscription = fromEvent(clonedElement, 'slotchange').subscribe(() => {\n\t\t\t\t\t// Propagate any slot changes to class changes on children\n\t\t\t\t\tconst contentDiv = clonedElement.shadowRoot?.querySelector('[part=\"content\"]')\n\t\t\t\t\tif (contentDiv) {\n\t\t\t\t\t\tcontentDiv.classList.add('schmancy-dropdown-content')\n\t\t\t\t\t}\n\t\t\t\t})\n\t\t\t\tthis.portalSubscriptions.push(subscription)\n\t\t\t}\n\n\t\t\tthis.portal?.appendChild(clonedElement)\n\t\t})\n\t}\n\n\t/**\n\t * Handle trigger click to toggle dropdown\n\t */\n\tprivate handleTriggerClick(e: Event) {\n\t\te.stopPropagation()\n\t\tthis.toggle()\n\t}\n\n\trender() {\n\t\treturn html`\n\t\t\t<div class=\"trigger-container\" @click=${this.handleTriggerClick}>\n\t\t\t\t<slot name=\"trigger\"></slot>\n\t\t\t</div>\n\n\t\t\t<div class=\"dropdown-content-container\" ?hidden=${!this.open}>\n\t\t\t\t<slot\n\t\t\t\t\t@slotchange=${() => {\n\t\t\t\t\t\tif (this.open) {\n\t\t\t\t\t\t\tthis.teleportContentToPortal()\n\t\t\t\t\t\t\tthis.setupPositioner()\n\t\t\t\t\t\t}\n\t\t\t\t\t}}\n\t\t\t\t></slot>\n\t\t\t</div>\n\t\t`\n\t}\n}\n\ndeclare global {\n\tinterface HTMLElementTagNameMap {\n\t\t'schmancy-dropdown': SchmancyDropdown\n\t}\n}\n","import { TailwindElement } from '@mixins/index'\nimport { css, html } from 'lit'\nimport { customElement, property } from 'lit/decorators.js'\n\n/**\n * Content panel for a schmancy-dropdown — a styled positioned surface. Always nested inside schmancy-dropdown and placed alongside the trigger slot.\n *\n * @element schmancy-dropdown-content\n * @summary Nest this inside schmancy-dropdown (not in the trigger slot). Use the `content` CSS part to customize backgrounds / shadows / padding without shadow-root piercing.\n * @example\n * <schmancy-dropdown>\n * <schmancy-button slot=\"trigger\">Open</schmancy-button>\n * <schmancy-dropdown-content>\n * Panel contents…\n * </schmancy-dropdown-content>\n * </schmancy-dropdown>\n * @platform div - Positioned panel with theme-aware styling. Degrades to an inline div if the tag never registers.\n * @slot - Default slot for dropdown content.\n * @csspart content - The inner wrapper element; style to override panel backgrounds, shadows, padding, or borders without shadow-root piercing.\n */\n@customElement('schmancy-dropdown-content')\nexport class SchmancyDropdownContent extends TailwindElement(css`\n\t:host {\n\t\tdisplay: block;\n\t\tposition: absolute;\n\t\tz-index: 1000;\n\t\tmin-width: 10rem;\n\t\tmargin: 0;\n\t\ttext-align: left;\n\t\tlist-style: none;\n\t\tbackground-color: var(--schmancy-sys-color-surface-container);\n\t\tbackground-clip: padding-box;\n\t\tborder-radius: 0.375rem;\n\t\tbox-shadow: var(--schmancy-sys-elevation-3);\n\t\twill-change: transform;\n\t\ttransform-origin: top left;\n\t\tanimation: dropdownAnimation 0.1s ease-out forwards;\n\t}\n\n\t:host([hidden]) {\n\t\tdisplay: none;\n\t}\n\n\t@keyframes dropdownAnimation {\n\t\tfrom {\n\t\t\topacity: 0;\n\t\t\ttransform: scale(0.95);\n\t\t}\n\t\tto {\n\t\t\topacity: 1;\n\t\t\ttransform: scale(1);\n\t\t}\n\t}\n\n\t/* Apply styles to content both in the component and when teleported to the portal */\n\t.schmancy-dropdown-content {\n\t\tbackground-color: var(--schmancy-sys-color-surface-container);\n\t\tborder-radius: 0.375rem;\n\t\tbox-shadow: var(--schmancy-sys-elevation-3);\n\t\twill-change: transform;\n\t\ttransform-origin: top left;\n\t\tanimation: dropdownAnimation 0.1s ease-out forwards;\n\t}\n`) {\n\t/**\n\t * Width of the dropdown content\n\t */\n\t@property({ type: String })\n\twidth: string = 'auto'\n\n\t/**\n\t * Maximum height of the dropdown content\n\t */\n\t@property({ type: String })\n\tmaxHeight: string = '80vh'\n\n\t/**\n\t * Whether to render with a shadow\n\t */\n\t@property({ type: Boolean })\n\tshadow: boolean = true\n\n\t/**\n\t * Border radius style\n\t */\n\t@property({ type: String })\n\tradius: 'none' | 'sm' | 'md' | 'lg' | 'full' = 'md'\n\n\trender() {\n\t\tconst classes = {\n\t\t\t'schmancy-dropdown-content': true,\n\t\t\t'overflow-auto': true,\n\t\t\t'shadow-none': !this.shadow,\n\t\t\t'rounded-none': this.radius === 'none',\n\t\t\t'rounded-sm': this.radius === 'sm',\n\t\t\t'rounded-md': this.radius === 'md',\n\t\t\t'rounded-lg': this.radius === 'lg',\n\t\t\t'rounded-full': this.radius === 'full',\n\t\t}\n\n\t\tconst styles = {\n\t\t\twidth: this.width,\n\t\t\tmaxHeight: this.maxHeight,\n\t\t}\n\n\t\treturn html`\n\t\t\t<div class=${this.classMap(classes)} style=${this.styleMap(styles)} part=\"content\">\n\t\t\t\t<slot></slot>\n\t\t\t</div>\n\t\t`\n\t}\n}\n\ndeclare global {\n\tinterface HTMLElementTagNameMap {\n\t\t'schmancy-dropdown-content': SchmancyDropdownContent\n\t}\n}\n"],"mappings":"kWA0BO,IAAA,EAAA,cAA+B,EAAA,GAAA,AAAA,CAAA,YAAA,GAAA,EAAA,CAAA,MAAA,GAAA,EAAA,CAAA,KAAA,KAAA,CAK9B,EAAA,KAAA,UAkBS,eAAA,KAAA,SAML,EAAA,KAAA,OAKmC,KAAA,KAAA,oBAMA,EAAA,CAE9C,mBAAA,CACC,MAAM,mBAAA,CAGN,KAAK,aAAA,EAGL,EAAA,EAAA,WAAsB,SAAU,QAAA,CAC9B,MAAA,EAAA,EAAA,QACO,GAAS,KAAK,MAAA,CAAS,KAAK,gBAAgB,EAAA,CAAA,EAAO,EAAA,EAAA,WAChD,KAAK,cAAA,CAAA,CAEf,cAAA,CACA,KAAK,KAAA,CAAO,GAAA,EAId,EAAA,EAAA,WAAyB,SAAU,UAAA,CACjC,MAAA,EAAA,EAAA,QACO,GAAS,KAAK,MAAQ,EAAM,MAAQ,SAAR,EAAiB,EAAA,EAAA,WAC1C,KAAK,cAAA,CAAA,CAEf,cAAA,CACA,KAAK,KAAA,CAAO,GAAA,CAOf,aAAA,CAEC,IAAI,EAAkB,SAAS,eAAe,4BAAA,CAGzC,IACJ,EAAkB,SAAS,cAAc,MAAA,CACzC,EAAgB,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