@wow-two-beta/fe 0.0.26 → 0.0.28
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +15 -3
- package/dist/chunks/{AppSwitcherMenu.vue_vue_type_script_setup_true_lang-DVqdOOst.js → AccountMenu.vue_vue_type_script_setup_true_lang-CWsiHHiy.js} +700 -283
- package/dist/chunks/AccountMenu.vue_vue_type_script_setup_true_lang-CWsiHHiy.js.map +1 -0
- package/dist/chunks/Avatar.vue_vue_type_script_setup_true_lang-BIoaOjCh.js +267 -0
- package/dist/chunks/Avatar.vue_vue_type_script_setup_true_lang-BIoaOjCh.js.map +1 -0
- package/dist/chunks/{BackToTopButton.vue_vue_type_script_setup_true_lang-CNMcUYtR.js → BackToTopButton.vue_vue_type_script_setup_true_lang-6tfkqsrZ.js} +2 -2
- package/dist/chunks/{BackToTopButton.vue_vue_type_script_setup_true_lang-CNMcUYtR.js.map → BackToTopButton.vue_vue_type_script_setup_true_lang-6tfkqsrZ.js.map} +1 -1
- package/dist/chunks/{Button.vue_vue_type_script_setup_true_lang-BrgCAsgC.js → Button.vue_vue_type_script_setup_true_lang-Cw0QS_Mm.js} +2 -3
- package/dist/chunks/{Button.vue_vue_type_script_setup_true_lang-BrgCAsgC.js.map → Button.vue_vue_type_script_setup_true_lang-Cw0QS_Mm.js.map} +1 -1
- package/dist/chunks/{DrawerContent.vue_vue_type_script_setup_true_lang-CZQnfNGk.js → DrawerContent.vue_vue_type_script_setup_true_lang-BA-au7LC.js} +2 -2
- package/dist/chunks/{DrawerContent.vue_vue_type_script_setup_true_lang-CZQnfNGk.js.map → DrawerContent.vue_vue_type_script_setup_true_lang-BA-au7LC.js.map} +1 -1
- package/dist/chunks/{ErrorBoundary.vue_vue_type_script_setup_true_lang-LRQbVAiW.js → ErrorBoundary.vue_vue_type_script_setup_true_lang-DzqE0ZF8.js} +4 -4
- package/dist/chunks/{ErrorBoundary.vue_vue_type_script_setup_true_lang-LRQbVAiW.js.map → ErrorBoundary.vue_vue_type_script_setup_true_lang-DzqE0ZF8.js.map} +1 -1
- package/dist/chunks/{FieldHelperText.vue_vue_type_script_setup_true_lang-eqG5AyoV.js → FieldHelperText.vue_vue_type_script_setup_true_lang-DuMcXUch.js} +2 -2
- package/dist/chunks/{FieldHelperText.vue_vue_type_script_setup_true_lang-eqG5AyoV.js.map → FieldHelperText.vue_vue_type_script_setup_true_lang-DuMcXUch.js.map} +1 -1
- package/dist/chunks/{KanbanCard.vue_vue_type_script_setup_true_lang-BCnquIre.js → KanbanCard.vue_vue_type_script_setup_true_lang-CyXb4ZZw.js} +169 -427
- package/dist/chunks/KanbanCard.vue_vue_type_script_setup_true_lang-CyXb4ZZw.js.map +1 -0
- package/dist/chunks/{LightboxModal.vue_vue_type_script_setup_true_lang-Dm79L1eK.js → LightboxModal.vue_vue_type_script_setup_true_lang-BxdSYLYf.js} +6 -6
- package/dist/chunks/{LightboxModal.vue_vue_type_script_setup_true_lang-Dm79L1eK.js.map → LightboxModal.vue_vue_type_script_setup_true_lang-BxdSYLYf.js.map} +1 -1
- package/dist/chunks/{MasonryLayout.vue_vue_type_script_setup_true_lang-TuNWahLw.js → MasonryLayout.vue_vue_type_script_setup_true_lang-DD_jRzkM.js} +22 -7
- package/dist/chunks/MasonryLayout.vue_vue_type_script_setup_true_lang-DD_jRzkM.js.map +1 -0
- package/dist/chunks/{MentionInput.vue_vue_type_script_setup_true_lang-DdT24dkW.js → MentionInput.vue_vue_type_script_setup_true_lang-hYD3uP3P.js} +6 -6
- package/dist/chunks/{MentionInput.vue_vue_type_script_setup_true_lang-DdT24dkW.js.map → MentionInput.vue_vue_type_script_setup_true_lang-hYD3uP3P.js.map} +1 -1
- package/dist/chunks/{OverlayCloseButton.vue_vue_type_script_setup_true_lang-D01KYAAn.js → OverlayCloseButton.vue_vue_type_script_setup_true_lang-Df9raD_m.js} +2 -2
- package/dist/chunks/{OverlayCloseButton.vue_vue_type_script_setup_true_lang-D01KYAAn.js.map → OverlayCloseButton.vue_vue_type_script_setup_true_lang-Df9raD_m.js.map} +1 -1
- package/dist/chunks/{PopoverContent.vue_vue_type_script_setup_true_lang-BIHYpwzT.js → PopoverContent.vue_vue_type_script_setup_true_lang-C6YKEo3H.js} +2 -2
- package/dist/chunks/{PopoverContent.vue_vue_type_script_setup_true_lang-BIHYpwzT.js.map → PopoverContent.vue_vue_type_script_setup_true_lang-C6YKEo3H.js.map} +1 -1
- package/dist/chunks/{ReportAction.vue_vue_type_script_setup_true_lang-l4DjtcpM.js → ReportAction.vue_vue_type_script_setup_true_lang-DCnPCczd.js} +2 -2
- package/dist/chunks/{ReportAction.vue_vue_type_script_setup_true_lang-l4DjtcpM.js.map → ReportAction.vue_vue_type_script_setup_true_lang-DCnPCczd.js.map} +1 -1
- package/dist/chunks/{SurfaceStyles-B8KNkFsm.js → SurfaceStyles-BYvRlsWe.js} +2 -2
- package/dist/chunks/{SurfaceStyles-B8KNkFsm.js.map → SurfaceStyles-BYvRlsWe.js.map} +1 -1
- package/dist/chunks/{ToastHost.vue_vue_type_script_setup_true_lang-p0bfXJ9l.js → ToastHost.vue_vue_type_script_setup_true_lang-J1ZPZXn3.js} +3 -3
- package/dist/chunks/{ToastHost.vue_vue_type_script_setup_true_lang-p0bfXJ9l.js.map → ToastHost.vue_vue_type_script_setup_true_lang-J1ZPZXn3.js.map} +1 -1
- package/dist/chunks/{Tones-CQu-OvAk.js → Tones-Bcz8dIo3.js} +159 -1
- package/dist/chunks/Tones-Bcz8dIo3.js.map +1 -0
- package/dist/chunks/UseScrollActivity-D8MC5xgH.js +37 -0
- package/dist/chunks/UseScrollActivity-D8MC5xgH.js.map +1 -0
- package/dist/chunks/{index-C-r59Hob.js → index-CGIXFfl9.js} +3 -4
- package/dist/chunks/{index-C-r59Hob.js.map → index-CGIXFfl9.js.map} +1 -1
- package/dist/chunks/{index-rh4HVTr5.js → index-COgbQxBT.js} +5 -1
- package/dist/chunks/{index-rh4HVTr5.js.map → index-COgbQxBT.js.map} +1 -1
- package/dist/chunks/{index-CuiXILXc.js → index-Dp6L9sX7.js} +6 -2
- package/dist/chunks/index-Dp6L9sX7.js.map +1 -0
- package/dist/foundation/config/ConfigSource.d.ts +12 -5
- package/dist/foundation/config/DefineConfig.d.ts +9 -4
- package/dist/foundation/config/index.d.ts +1 -1
- package/dist/foundation/config/index.js +12 -9
- package/dist/foundation/config/index.js.map +1 -1
- package/dist/foundation/dom/hooks/UseScrollActivity.d.ts +15 -0
- package/dist/foundation/dom/index.d.ts +1 -0
- package/dist/foundation/dom/index.js +7 -3
- package/dist/foundation/dom/index.js.map +1 -1
- package/dist/foundation/primitives/index.js +1 -1
- package/dist/foundation/primitives/scrollViewport/ScrollViewport.vue.d.ts +9 -0
- package/dist/foundation/styles/index.js +9 -10
- package/dist/foundation/styles/index.js.map +1 -1
- package/dist/index.css +83 -36
- package/dist/index.js +467 -465
- package/dist/index.js.map +1 -1
- package/dist/presentation/actions/index.js +2 -2
- package/dist/presentation/display/index.js +178 -177
- package/dist/presentation/display/index.js.map +1 -1
- package/dist/presentation/feedback/index.js +3 -3
- package/dist/presentation/feedback/toastHost/index.js +1 -1
- package/dist/presentation/forms/index.js +2 -2
- package/dist/presentation/layout/appShell/AppShellMain.vue.d.ts +14 -5
- package/dist/presentation/layout/index.js +1 -1
- package/dist/presentation/layout/scrollArea/ScrollArea.vue.d.ts +7 -0
- package/dist/presentation/layout/virtualScrollArea/VirtualScrollArea.vue.d.ts +6 -0
- package/dist/presentation/nav/accountMenu/AccountMenu.vue.d.ts +131 -0
- package/dist/presentation/nav/accountMenu/index.d.ts +1 -0
- package/dist/presentation/nav/index.d.ts +1 -0
- package/dist/presentation/nav/index.js +72 -71
- package/dist/presentation/overlays/index.js +4 -4
- package/package.json +1 -1
- package/dist/chunks/AppSwitcherMenu.vue_vue_type_script_setup_true_lang-DVqdOOst.js.map +0 -1
- package/dist/chunks/CssExtensions-ctGVlfYU.js +0 -161
- package/dist/chunks/CssExtensions-ctGVlfYU.js.map +0 -1
- package/dist/chunks/KanbanCard.vue_vue_type_script_setup_true_lang-BCnquIre.js.map +0 -1
- package/dist/chunks/MasonryLayout.vue_vue_type_script_setup_true_lang-TuNWahLw.js.map +0 -1
- package/dist/chunks/Tones-CQu-OvAk.js.map +0 -1
- package/dist/chunks/index-CuiXILXc.js.map +0 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { defineComponent, shallowRef, provide, computed, renderSlot, inject, useAttrs, useTemplateRef, watch, openBlock, createBlock, unref, withCtx, createVNode, createCommentVNode, createElementVNode, withModifiers, normalizeClass, mergeProps, createElementBlock, useSlots } from "vue";
|
|
2
2
|
import { c as cn } from "./Cn-C7De6POU.js";
|
|
3
|
-
import { s as surfaceVariants } from "./SurfaceStyles-
|
|
3
|
+
import { s as surfaceVariants } from "./SurfaceStyles-BYvRlsWe.js";
|
|
4
4
|
import { _ as _sfc_main$6 } from "./BackdropOverlay.vue_vue_type_script_setup_true_lang-BsjQoWDM.js";
|
|
5
5
|
import { o as overlayChromeContextKey, u as useOverlayChromeContext } from "./OverlayChrome-BqRpuYX5.js";
|
|
6
6
|
import { u as useControlled } from "./UseControlled-BQneb7BW.js";
|
|
@@ -426,4 +426,4 @@ export {
|
|
|
426
426
|
ModalSize as e,
|
|
427
427
|
useModalContext as u
|
|
428
428
|
};
|
|
429
|
-
//# sourceMappingURL=OverlayCloseButton.vue_vue_type_script_setup_true_lang-
|
|
429
|
+
//# sourceMappingURL=OverlayCloseButton.vue_vue_type_script_setup_true_lang-Df9raD_m.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OverlayCloseButton.vue_vue_type_script_setup_true_lang-D01KYAAn.js","sources":["../../src/presentation/overlays/modal/Modal.vue","../../src/presentation/overlays/modal/ModalContent.vue","../../src/presentation/overlays/OverlayTitle.vue","../../src/presentation/overlays/OverlayCloseButton.vue"],"sourcesContent":["<script lang=\"ts\">\nimport { inject, type ComputedRef, type InjectionKey, type Ref, type ShallowRef } from 'vue';\n\n/** Defines the ARIA dialog role a `Modal` exposes. */\nexport const ModalRole = {\n /** Refers to a standard dialog. */\n Dialog: 'dialog',\n /** Refers to an alert dialog that interrupts to convey an urgent message. */\n AlertDialog: 'alertdialog',\n} as const;\n\nexport type ModalRole = (typeof ModalRole)[keyof typeof ModalRole];\n\n/**\n * The value shared with `ModalTrigger` / `ModalContent`.\n *\n * The reactive fields stay refs so a child reads the live value without the root\n * re-rendering it.\n */\nexport interface ModalContextValue {\n /** The resolved open state. Writable — an assignment routes through `setOpen`. */\n open: Ref<boolean>;\n setOpen: (open: boolean) => void;\n /** The trigger element — the focus-return target when the modal closes. */\n triggerEl: ShallowRef<HTMLElement | null>;\n titleId: string;\n descriptionId: string;\n role: ComputedRef<ModalRole>;\n dismissOnOutsideClick: ComputedRef<boolean>;\n dismissOnEscape: ComputedRef<boolean>;\n}\n\nexport const modalContextKey: InjectionKey<ModalContextValue> = Symbol('wow-two.modal');\n\nexport function useModalContext(): ModalContextValue {\n const context = inject(modalContextKey, null);\n if (!context) throw new Error('Modal.* must be used inside <Modal>');\n return context;\n}\n\n/** Controlled axes use their canonical Vue model names; each update event requests caller state. */\nexport interface ModalProps {\n /** The open state, controlled. The `v-model:open` binding target. */\n readonly open?: boolean;\n\n /** The initial open state when uncontrolled. Default `false`. */\n readonly defaultOpen?: boolean;\n\n /** The outside-click dismissal toggle. Default `true`. */\n readonly canDismissOnOutsideClick?: boolean;\n /** @deprecated Use `canDismissOnOutsideClick`; this alias is removed next release. */\n readonly dismissOnOutsideClick?: boolean;\n\n /** The Escape dismissal toggle. Default `true`. */\n readonly canDismissOnEscape?: boolean;\n /** @deprecated Use `canDismissOnEscape`; this alias is removed next release. */\n readonly dismissOnEscape?: boolean;\n\n /** The ARIA dialog role. Internal — `AlertModal` overrides this. */\n readonly role?: ModalRole;\n}\n</script>\n\n<script setup lang=\"ts\">\nimport { computed, provide, shallowRef } from 'vue';\nimport { useControlled } from '../../../foundation/state';\nimport { useId } from '../../../foundation/identifiers';\n\n/**\n * Renders only its slot, owning the open state and a11y ids of the Modal tree below it.\n * It has no element of its own.\n */\ndefineOptions({ name: 'Modal', inheritAttrs: false });\n\n/** The Modal tree — `ModalTrigger` and `ModalContent`. */\ndefineSlots<{ default(): unknown }>();\n\n/**\n * `open: undefined` / `open: undefined` are load-bearing: Vue coerces an\n * absent `Boolean` prop to `false` unless the declaration *owns* a `default`\n * key, which would make the modal read as explicitly-closed-and-controlled and\n * strand the uncontrolled path. Declaring the default as `undefined` keeps the\n * three states — absent / `true` / `false`.\n */\nconst props = withDefaults(defineProps<ModalProps>(), {\n open: undefined,\n defaultOpen: false,\n canDismissOnOutsideClick: undefined,\n dismissOnOutsideClick: undefined,\n canDismissOnEscape: undefined,\n dismissOnEscape: undefined,\n role: 'dialog',\n});\n\nconst emit = defineEmits<{\n /** Fires when the dialog opens or closes — the `v-model:open` half. */\n 'update:open': [open: boolean];\n}>();\n\nconst controlled = useControlled<boolean>({\n controlled: () => props.open,\n default: () => props.defaultOpen,\n onChange: (value) => {\n emit('update:open', value);\n },\n});\n\nconst triggerEl = shallowRef<HTMLElement | null>(null);\nconst titleId = useId('modal-title');\nconst descriptionId = useId('modal-description');\n\nprovide(modalContextKey, {\n open: controlled.value,\n setOpen: controlled.setValue,\n triggerEl,\n titleId,\n descriptionId,\n role: computed(() => props.role),\n dismissOnOutsideClick: computed(() => props.canDismissOnOutsideClick ?? props.dismissOnOutsideClick ?? true),\n dismissOnEscape: computed(() => props.canDismissOnEscape ?? props.dismissOnEscape ?? true),\n});\n</script>\n\n<template>\n <slot />\n</template>\n","<script lang=\"ts\">\nimport {\n cn,\n type SurfaceElevation,\n type SurfacePadding,\n type SurfaceRadius,\n type SurfaceTone,\n type SurfaceVariant,\n} from '../../../foundation/styles';\n\n/** Defines the max-width step of a `ModalContent` panel. */\nexport const ModalSize = {\n /** Refers to a narrow panel (24rem) — confirmations and short prompts. */\n Sm: 'sm',\n /** Refers to the default panel (32rem). */\n Md: 'md',\n /** Refers to a wide panel (42rem) — forms with paired fields. */\n Lg: 'lg',\n /** Refers to an extra-wide panel (56rem) — tables and multi-column forms. */\n Xl: 'xl',\n /** Refers to a panel that spans the window, inside its gutter. */\n Full: 'full',\n} as const;\n\nexport type ModalSize = (typeof ModalSize)[keyof typeof ModalSize];\n\n/** Defines how a `ModalContent` panel lays out below the `sm` breakpoint; from `sm` up it is the centred card. */\nexport const ModalPhoneLayout = {\n /** Refers to a panel that fills the screen — header on top, a scrolling body, the footer pinned to the bottom. */\n Fullscreen: 'fullscreen',\n /** Refers to a sheet docked to the bottom edge, rounded on top, that slides up. */\n Sheet: 'sheet',\n /** Refers to the centred card, as on wider screens. */\n Card: 'card',\n} as const;\n\nexport type ModalPhoneLayout = (typeof ModalPhoneLayout)[keyof typeof ModalPhoneLayout];\n\nconst ModalSizeClass: Record<ModalSize, string> = {\n sm: 'max-w-sm',\n md: 'max-w-lg',\n lg: 'max-w-2xl',\n xl: 'max-w-4xl',\n full: 'max-w-none',\n};\n\n/* The layer, frame and panel classes per phone layout. Each is prefixed `max-sm:`, so wider screens keep the card. */\nconst LayerPhoneClass: Record<ModalPhoneLayout, string> = {\n fullscreen: 'max-sm:place-items-stretch max-sm:p-0',\n sheet: 'max-sm:items-end max-sm:justify-items-stretch max-sm:p-0',\n card: '',\n};\n\nconst FramePhoneClass: Record<ModalPhoneLayout, string> = {\n fullscreen: 'max-sm:justify-items-stretch',\n sheet: 'max-sm:justify-items-stretch',\n card: '',\n};\n\n/* A wrapping `<form>` joins the fullscreen column, so its `ModalBody` takes the free height and the footer pins. */\nconst PanelPhoneClass: Record<ModalPhoneLayout, string> = {\n fullscreen: cn(\n 'max-sm:h-dvh max-sm:max-h-dvh max-sm:w-full max-sm:max-w-none max-sm:rounded-none',\n 'max-sm:[--ui-overlay-inset-top:env(safe-area-inset-top)]',\n 'max-sm:[&>form]:flex max-sm:[&>form]:min-h-0 max-sm:[&>form]:flex-1 max-sm:[&>form]:flex-col',\n ),\n sheet: 'max-sm:w-full max-sm:max-w-none max-sm:rounded-t-2xl max-sm:rounded-b-none',\n card: '',\n};\n\n/* Phones rise from the bottom edge; the card keeps its pop wherever it shows. */\nconst PanelMotionClass: Record<ModalPhoneLayout, string> = {\n fullscreen: cn(\n 'sm:motion-safe:group-data-[state=open]:animate-(--animate-pop-in)',\n 'sm:motion-safe:group-data-[state=closed]:animate-(--animate-pop-out)',\n 'max-sm:motion-safe:group-data-[state=open]:animate-(--animate-sheet-in)',\n 'max-sm:motion-safe:group-data-[state=closed]:animate-(--animate-sheet-out)',\n ),\n sheet: cn(\n 'sm:motion-safe:group-data-[state=open]:animate-(--animate-pop-in)',\n 'sm:motion-safe:group-data-[state=closed]:animate-(--animate-pop-out)',\n 'max-sm:motion-safe:group-data-[state=open]:animate-(--animate-sheet-in)',\n 'max-sm:motion-safe:group-data-[state=closed]:animate-(--animate-sheet-out)',\n ),\n card: cn(\n 'motion-safe:group-data-[state=open]:animate-(--animate-pop-in)',\n 'motion-safe:group-data-[state=closed]:animate-(--animate-pop-out)',\n ),\n};\n\n/** The drag past which a released sheet handle dismisses: this many pixels, or a third of the sheet if shorter. */\nconst HandleDismissDistance = 96;\n\n/**\n * Represents the prop surface of `ModalContent`.\n *\n * React declared the surface axes by `extends SurfaceLayoutVariants`; they are\n * spelled out here because the SFC compiler's type resolver cannot follow a\n * `VariantProps<typeof …>` base and fails the build on it. The aliases below\n * are the canonical ones from `foundation/styles`, already locked against the\n * `surfaceVariants` config there, so the two cannot drift.\n */\nexport interface ModalContentProps {\n /** Shows the default backdrop behind the panel. Default `true`. */\n readonly showBackdrop?: boolean;\n /** @deprecated Use `showBackdrop` (inverted); this alias is removed next release. */\n readonly hideBackdrop?: boolean;\n\n /** The backdrop-blur toggle. */\n readonly isBlurred?: boolean;\n\n /** The panel's max-width step; a `max-w-*` class still overrides it. Default `md`. */\n readonly size?: ModalSize;\n\n /** The visual recipe. Default `elevated`. */\n readonly variant?: SurfaceVariant;\n\n /** The color tone the recipe is tinted with. */\n readonly tone?: SurfaceTone;\n\n /** The corner rounding. Default `lg`. */\n readonly radius?: SurfaceRadius;\n\n /** The inner spacing step. Default `xl`. */\n readonly padding?: SurfacePadding;\n\n /** The shadow depth. */\n readonly elevation?: SurfaceElevation;\n\n /** The layout below the `sm` breakpoint; wider screens always get the centred card. Default `fullscreen`. */\n readonly phoneLayout?: ModalPhoneLayout;\n\n /**\n * Shows a grab handle on a phone `sheet`. Dragging it down dismisses the dialog where outside clicks may, and\n * springs back where they may not. Default `false`.\n */\n readonly showHandle?: boolean;\n}\n</script>\n\n<script setup lang=\"ts\">\nimport { computed, provide, shallowRef, useAttrs, useTemplateRef, watch } from 'vue';\nimport { surfaceVariants } from '../../../foundation/styles';\nimport { DismissableLayer, FocusScope, Portal, Presence, ScrollLockProvider } from '../../../foundation/primitives';\nimport BackdropOverlay from '../backdropOverlay/BackdropOverlay.vue';\nimport { overlayChromeContextKey } from '../OverlayChrome';\nimport { useModalContext } from './Modal.vue';\n\n/** Renders the portalled dialog surface — scrim, focus trap, scroll lock, and the a11y panel. */\ndefineOptions({ name: 'ModalContent', inheritAttrs: false });\n\n/** The panel content — chrome subcomponents and the dialog body. React's `children`. */\ndefineSlots<{ default(): unknown }>();\n\nconst props = withDefaults(defineProps<ModalContentProps>(), {\n size: 'md',\n showBackdrop: undefined,\n hideBackdrop: undefined,\n phoneLayout: ModalPhoneLayout.Fullscreen,\n showHandle: false,\n});\n\n/** `showBackdrop` first, then the inverted deprecated `hideBackdrop`. */\nconst hasBackdrop = computed(() => props.showBackdrop ?? !(props.hideBackdrop ?? false));\n\nconst attrs = useAttrs();\nconst context = useModalContext();\nconst el = useTemplateRef<HTMLDivElement>('el');\n\n/* Refs lifted to setup consts so the template auto-unwraps them (a plain injected object does not). */\nconst isOpen = context.open;\nconst role = context.role;\nconst dismissOnEscape = context.dismissOnEscape;\n\nfunction close(): void {\n context.setOpen(false);\n}\n\nprovide(overlayChromeContextKey, {\n titleId: context.titleId,\n descriptionId: context.descriptionId,\n close,\n});\n\n/* Safe-area spacers keep content clear of the notch and the home indicator; they collapse from `sm` up. */\nconst hasBottomInset = computed(() => props.phoneLayout !== ModalPhoneLayout.Card);\nconst hasTopInset = computed(() => props.phoneLayout === ModalPhoneLayout.Fullscreen);\nconst hasHandle = computed(() => props.showHandle && props.phoneLayout === ModalPhoneLayout.Sheet);\n\nconst layerClasses = computed(() =>\n cn(\n 'ui-modal-layer group fixed inset-0 z-modal grid place-items-center overflow-y-auto p-4',\n 'motion-safe:data-[state=open]:animate-(--animate-fade-in)',\n 'motion-safe:data-[state=closed]:animate-(--animate-fade-out)',\n LayerPhoneClass[props.phoneLayout],\n ),\n);\n\nconst frameClasses = computed(() =>\n cn('ui-modal-frame grid w-full justify-items-center', FramePhoneClass[props.phoneLayout]),\n);\n\nconst classes = computed(() =>\n cn(\n 'ui-modal-content relative w-full',\n ModalSizeClass[props.size],\n /* The panel never outgrows the window: it caps at the viewport and its body scrolls under a fixed header and\n footer. A panel without a body part scrolls whole. */\n 'flex max-h-[calc(100dvh-2rem)] flex-col overflow-y-auto overscroll-contain',\n PanelMotionClass[props.phoneLayout],\n surfaceVariants({\n variant: props.variant ?? 'elevated',\n tone: props.tone,\n radius: props.radius ?? 'lg',\n padding: props.padding ?? 'xl',\n elevation: props.elevation,\n }),\n attrs.class as string | undefined,\n /* Last, so a caller's width, height or radius serves the card and the phone layout still fills the screen. */\n PanelPhoneClass[props.phoneLayout],\n ),\n);\n\n/** Everything but `class`, which is re-applied through `cn` above. */\nconst rest = computed(() => {\n const { class: _class, ...others } = attrs;\n return others;\n});\n\n/* The sheet handle drag. The offset rides on the panel's transform; a release past the distance closes the dialog,\n and the exit keyframe leaves from that offset. Anything shorter springs back. */\nconst dragOffset = shallowRef(0);\nconst isDragging = shallowRef(false);\nlet dragPointer: { readonly id: number; readonly startY: number } | null = null;\n\nwatch(isOpen, (open) => {\n if (open) dragOffset.value = 0;\n});\n\nconst dragStyle = computed(() =>\n hasHandle.value\n ? {\n transform: dragOffset.value > 0 ? `translateY(${dragOffset.value}px)` : undefined,\n transition: isDragging.value ? 'none' : 'transform var(--duration-base) var(--ease-out)',\n }\n : undefined,\n);\n\nfunction handlePointerDown(event: PointerEvent): void {\n if (event.button !== 0) return;\n dragPointer = { id: event.pointerId, startY: event.clientY };\n isDragging.value = true;\n try {\n (event.currentTarget as HTMLElement).setPointerCapture(event.pointerId);\n } catch {\n /* A synthetic or already-released pointer has nothing to capture; the drag still tracks moves on the handle. */\n }\n}\n\nfunction handlePointerMove(event: PointerEvent): void {\n if (dragPointer?.id !== event.pointerId) return;\n dragOffset.value = Math.max(0, event.clientY - dragPointer.startY);\n}\n\nfunction handlePointerEnd(event: PointerEvent): void {\n if (dragPointer?.id !== event.pointerId) return;\n dragPointer = null;\n isDragging.value = false;\n const height = el.value?.offsetHeight ?? 0;\n const distance = Math.min(HandleDismissDistance, height / 3);\n if (event.type === 'pointerup' && dragOffset.value > distance && context.dismissOnOutsideClick.value) {\n context.setOpen(false);\n return;\n }\n dragOffset.value = 0;\n}\n\n/** Outside-click dismissal — `.self` is React's `e.target !== e.currentTarget` guard. */\nfunction handleOutsideClick(): void {\n if (context.dismissOnOutsideClick.value) context.setOpen(false);\n}\n\nfunction handleEscape(): void {\n context.setOpen(false);\n}\n\ndefineExpose({ el });\n</script>\n\n<template>\n <Portal>\n <!-- Lock follows open state, not mount — Content can mount closed. -->\n <ScrollLockProvider :is-enabled=\"isOpen\">\n <!-- The scrim runs on `BackdropOverlay`'s own `Presence` (its `isOpen` prop) so the\n fade-out plays before it unmounts. React wrapped it in a second, outer\n `Presence`, whose injected `data-state` the inner one then overwrote —\n passing the state straight in is the same intent without the masking. -->\n <BackdropOverlay v-if=\"hasBackdrop\" is-inline :is-open=\"isOpen\" :is-blurred=\"props.isBlurred\" />\n <!-- Outside-click dismissal lives on the centering wrapper (it covers the\n backdrop): a click on the padding (`.self`) = outside. The wrapper is the\n Presence-animated node — `Presence` injects `data-state` + `ref` onto it and\n watches *its own* animations (no subtree walk), so the wrapper carries a\n (transparent) fade and the visible pop lands on the panel via\n `group-data-[state=*]`. Both share the same token timing, so the wrapper fade\n gates unmount correctly. -->\n <Presence :is-present=\"isOpen\">\n <div :class=\"layerClasses\" :data-phone-layout=\"props.phoneLayout\" @click.self=\"handleOutsideClick\">\n <!-- The layer is the grid item, so it spans the window's width: a shrink-wrapped layer would hold the\n panel's `w-full` to its content width. It centers the panel in turn. -->\n <FocusScope as-child is-trapped can-loop is-modal>\n <DismissableLayer\n :class=\"frameClasses\"\n :is-escape-disabled=\"!dismissOnEscape\"\n is-outside-click-disabled\n :on-escape=\"handleEscape\"\n >\n <div\n ref=\"el\"\n :role=\"role\"\n aria-modal=\"true\"\n :aria-labelledby=\"context.titleId\"\n :aria-describedby=\"context.descriptionId\"\n :data-phone-layout=\"props.phoneLayout\"\n v-bind=\"rest\"\n :class=\"classes\"\n :style=\"dragStyle\"\n >\n <div\n v-if=\"hasHandle\"\n data-modal-handle\n aria-hidden=\"true\"\n class=\"absolute inset-x-0 top-0 z-raised flex h-6 cursor-grab touch-none justify-center pt-2 sm:hidden\"\n @pointerdown=\"handlePointerDown\"\n @pointermove=\"handlePointerMove\"\n @pointerup=\"handlePointerEnd\"\n @pointercancel=\"handlePointerEnd\"\n >\n <span class=\"h-1 w-10 rounded-full bg-border-strong forced-colors:bg-[CanvasText]\" />\n </div>\n <span\n v-if=\"hasTopInset\"\n aria-hidden=\"true\"\n class=\"block h-[env(safe-area-inset-top)] shrink-0 sm:hidden\"\n />\n <slot />\n <span\n v-if=\"hasBottomInset\"\n aria-hidden=\"true\"\n class=\"block h-[env(safe-area-inset-bottom)] shrink-0 sm:hidden\"\n />\n </div>\n </DismissableLayer>\n </FocusScope>\n </div>\n </Presence>\n </ScrollLockProvider>\n </Portal>\n</template>\n","<script lang=\"ts\">\n/**\n * The prop surface of `OverlayTitle`.\n *\n * React declared `extends HTMLAttributes<HTMLHeadingElement>` plus `children`;\n * attributes reach the root through `useAttrs` here and `children` is the\n * default slot, which leaves no declared prop.\n */\nexport type OverlayTitleProps = Record<string, never>;\n</script>\n\n<script setup lang=\"ts\">\nimport { computed, useAttrs, useTemplateRef } from 'vue';\nimport { cn } from '../../foundation/styles';\nimport { useOverlayChromeContext } from './OverlayChrome';\n\n/** Renders the enclosing dialog's accessible name, carrying the `id` its `aria-labelledby` names. */\ndefineOptions({ name: 'OverlayTitle', inheritAttrs: false });\n\n/** The title text — React's `children`. */\ndefineSlots<{ default(): unknown }>();\n\nconst attrs = useAttrs();\nconst context = useOverlayChromeContext();\nconst el = useTemplateRef<HTMLHeadingElement>('el');\n\nconst classes = computed(() =>\n cn('text-lg font-semibold leading-none text-foreground', attrs.class as string | undefined),\n);\n\n/** Everything but `class`, which is re-applied through `cn` above. */\nconst rest = computed(() => {\n const { class: _class, ...others } = attrs;\n return others;\n});\n\ndefineExpose({ el });\n</script>\n\n<template>\n <!-- `id` sits before `v-bind`, so a caller-supplied `id` still wins — React's prop order. -->\n <h2 ref=\"el\" :id=\"context.titleId\" v-bind=\"rest\" :class=\"classes\"><slot /></h2>\n</template>\n","<script lang=\"ts\">\n/**\n * The prop surface of `OverlayCloseButton`.\n *\n * React declared `extends Omit<ButtonHTMLAttributes<HTMLButtonElement>, 'children'>`;\n * attributes reach the root through `useAttrs` here, so only `asChild` remains.\n */\nexport interface OverlayCloseButtonProps {\n /** Merge onto the single slot child instead of rendering a `<button>`. */\n readonly asChild?: boolean;\n}\n</script>\n\n<script setup lang=\"ts\">\nimport { resolveElement } from '../../foundation/dom';\nimport { useLocale } from '../../foundation/i18n';\nimport { computed, useAttrs, useSlots, useTemplateRef, type ComponentPublicInstance } from 'vue';\nimport { X } from 'lucide-vue-next';\nimport { cn } from '../../foundation/styles';\nimport { Primitive } from '../../foundation/primitives';\nimport { useOverlayChromeContext } from './OverlayChrome';\n\nconst locale = useLocale();\n\n/** Renders the dismiss control of a Modal / Drawer panel; it closes the overlay and restores focus. */\ndefineOptions({ name: 'OverlayCloseButton', inheritAttrs: false });\n\n/** The button content — React's `children`. Falls back to an `X` glyph. */\ndefineSlots<{ default?(): unknown }>();\n\nconst props = withDefaults(defineProps<OverlayCloseButtonProps>(), { asChild: false });\n\nconst attrs = useAttrs();\nconst slots = useSlots();\nconst context = useOverlayChromeContext();\nconst inner = useTemplateRef<ComponentPublicInstance>('inner');\n\n/** `asChild` hands styling to the caller's element — React applied `className` bare in that branch. */\nconst classes = computed(() =>\n props.asChild\n ? (attrs.class as string | undefined)\n : cn(\n 'absolute right-4 top-[calc(1rem+var(--ui-overlay-inset-top,0px))] grid h-7 w-7 place-items-center rounded-sm text-muted-foreground transition-colors hover:bg-muted hover:text-foreground focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring',\n attrs.class as string | undefined,\n ),\n);\n\n/** Everything but `class`, which is re-applied through `cn` above. */\nconst rest = computed(() => {\n const { class: _class, ...others } = attrs;\n return others;\n});\n\n/**\n * `@click` is declared after `v-bind=\"rest\"`, so Vue chains the caller's own\n * handler first and this one second — the order React's `onClick?.(e)` had, and\n * what makes the `defaultPrevented` opt-out below work.\n */\nfunction handleClick(event: MouseEvent): void {\n if (event.defaultPrevented) return;\n context.close();\n}\n\n/** `Primitive` renders the real element, so its `$el` is this component's root. */\nconst el = computed(() => resolveElement(inner.value));\n\ndefineExpose({ el });\n</script>\n\n<template>\n <Primitive\n ref=\"inner\"\n as=\"button\"\n :as-child=\"props.asChild\"\n type=\"button\"\n :aria-label=\"slots.default ? undefined : locale.t('OverlayCloseButton.close', undefined, 'Close')\"\n v-bind=\"rest\"\n :class=\"classes\"\n @click=\"handleClick\"\n >\n <slot><X class=\"h-4 w-4\" /></slot>\n </Primitive>\n</template>\n"],"names":["_renderSlot","_createBlock","_unref","Portal","_createVNode","ScrollLockProvider","BackdropOverlay","_createElementVNode","FocusScope","DismissableLayer","_mergeProps","_createElementBlock","_openBlock"],"mappings":";;;;;;;;;;;;;;;;AAIO,MAAM,YAAY;AAAA;AAAA,EAEvB,Q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CAAA,GAAA,EAAlB,OAAM,WAAS;AAAA,UAAA;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"OverlayCloseButton.vue_vue_type_script_setup_true_lang-Df9raD_m.js","sources":["../../src/presentation/overlays/modal/Modal.vue","../../src/presentation/overlays/modal/ModalContent.vue","../../src/presentation/overlays/OverlayTitle.vue","../../src/presentation/overlays/OverlayCloseButton.vue"],"sourcesContent":["<script lang=\"ts\">\nimport { inject, type ComputedRef, type InjectionKey, type Ref, type ShallowRef } from 'vue';\n\n/** Defines the ARIA dialog role a `Modal` exposes. */\nexport const ModalRole = {\n /** Refers to a standard dialog. */\n Dialog: 'dialog',\n /** Refers to an alert dialog that interrupts to convey an urgent message. */\n AlertDialog: 'alertdialog',\n} as const;\n\nexport type ModalRole = (typeof ModalRole)[keyof typeof ModalRole];\n\n/**\n * The value shared with `ModalTrigger` / `ModalContent`.\n *\n * The reactive fields stay refs so a child reads the live value without the root\n * re-rendering it.\n */\nexport interface ModalContextValue {\n /** The resolved open state. Writable — an assignment routes through `setOpen`. */\n open: Ref<boolean>;\n setOpen: (open: boolean) => void;\n /** The trigger element — the focus-return target when the modal closes. */\n triggerEl: ShallowRef<HTMLElement | null>;\n titleId: string;\n descriptionId: string;\n role: ComputedRef<ModalRole>;\n dismissOnOutsideClick: ComputedRef<boolean>;\n dismissOnEscape: ComputedRef<boolean>;\n}\n\nexport const modalContextKey: InjectionKey<ModalContextValue> = Symbol('wow-two.modal');\n\nexport function useModalContext(): ModalContextValue {\n const context = inject(modalContextKey, null);\n if (!context) throw new Error('Modal.* must be used inside <Modal>');\n return context;\n}\n\n/** Controlled axes use their canonical Vue model names; each update event requests caller state. */\nexport interface ModalProps {\n /** The open state, controlled. The `v-model:open` binding target. */\n readonly open?: boolean;\n\n /** The initial open state when uncontrolled. Default `false`. */\n readonly defaultOpen?: boolean;\n\n /** The outside-click dismissal toggle. Default `true`. */\n readonly canDismissOnOutsideClick?: boolean;\n /** @deprecated Use `canDismissOnOutsideClick`; this alias is removed next release. */\n readonly dismissOnOutsideClick?: boolean;\n\n /** The Escape dismissal toggle. Default `true`. */\n readonly canDismissOnEscape?: boolean;\n /** @deprecated Use `canDismissOnEscape`; this alias is removed next release. */\n readonly dismissOnEscape?: boolean;\n\n /** The ARIA dialog role. Internal — `AlertModal` overrides this. */\n readonly role?: ModalRole;\n}\n</script>\n\n<script setup lang=\"ts\">\nimport { computed, provide, shallowRef } from 'vue';\nimport { useControlled } from '../../../foundation/state';\nimport { useId } from '../../../foundation/identifiers';\n\n/**\n * Renders only its slot, owning the open state and a11y ids of the Modal tree below it.\n * It has no element of its own.\n */\ndefineOptions({ name: 'Modal', inheritAttrs: false });\n\n/** The Modal tree — `ModalTrigger` and `ModalContent`. */\ndefineSlots<{ default(): unknown }>();\n\n/**\n * `open: undefined` / `open: undefined` are load-bearing: Vue coerces an\n * absent `Boolean` prop to `false` unless the declaration *owns* a `default`\n * key, which would make the modal read as explicitly-closed-and-controlled and\n * strand the uncontrolled path. Declaring the default as `undefined` keeps the\n * three states — absent / `true` / `false`.\n */\nconst props = withDefaults(defineProps<ModalProps>(), {\n open: undefined,\n defaultOpen: false,\n canDismissOnOutsideClick: undefined,\n dismissOnOutsideClick: undefined,\n canDismissOnEscape: undefined,\n dismissOnEscape: undefined,\n role: 'dialog',\n});\n\nconst emit = defineEmits<{\n /** Fires when the dialog opens or closes — the `v-model:open` half. */\n 'update:open': [open: boolean];\n}>();\n\nconst controlled = useControlled<boolean>({\n controlled: () => props.open,\n default: () => props.defaultOpen,\n onChange: (value) => {\n emit('update:open', value);\n },\n});\n\nconst triggerEl = shallowRef<HTMLElement | null>(null);\nconst titleId = useId('modal-title');\nconst descriptionId = useId('modal-description');\n\nprovide(modalContextKey, {\n open: controlled.value,\n setOpen: controlled.setValue,\n triggerEl,\n titleId,\n descriptionId,\n role: computed(() => props.role),\n dismissOnOutsideClick: computed(() => props.canDismissOnOutsideClick ?? props.dismissOnOutsideClick ?? true),\n dismissOnEscape: computed(() => props.canDismissOnEscape ?? props.dismissOnEscape ?? true),\n});\n</script>\n\n<template>\n <slot />\n</template>\n","<script lang=\"ts\">\nimport {\n cn,\n type SurfaceElevation,\n type SurfacePadding,\n type SurfaceRadius,\n type SurfaceTone,\n type SurfaceVariant,\n} from '../../../foundation/styles';\n\n/** Defines the max-width step of a `ModalContent` panel. */\nexport const ModalSize = {\n /** Refers to a narrow panel (24rem) — confirmations and short prompts. */\n Sm: 'sm',\n /** Refers to the default panel (32rem). */\n Md: 'md',\n /** Refers to a wide panel (42rem) — forms with paired fields. */\n Lg: 'lg',\n /** Refers to an extra-wide panel (56rem) — tables and multi-column forms. */\n Xl: 'xl',\n /** Refers to a panel that spans the window, inside its gutter. */\n Full: 'full',\n} as const;\n\nexport type ModalSize = (typeof ModalSize)[keyof typeof ModalSize];\n\n/** Defines how a `ModalContent` panel lays out below the `sm` breakpoint; from `sm` up it is the centred card. */\nexport const ModalPhoneLayout = {\n /** Refers to a panel that fills the screen — header on top, a scrolling body, the footer pinned to the bottom. */\n Fullscreen: 'fullscreen',\n /** Refers to a sheet docked to the bottom edge, rounded on top, that slides up. */\n Sheet: 'sheet',\n /** Refers to the centred card, as on wider screens. */\n Card: 'card',\n} as const;\n\nexport type ModalPhoneLayout = (typeof ModalPhoneLayout)[keyof typeof ModalPhoneLayout];\n\nconst ModalSizeClass: Record<ModalSize, string> = {\n sm: 'max-w-sm',\n md: 'max-w-lg',\n lg: 'max-w-2xl',\n xl: 'max-w-4xl',\n full: 'max-w-none',\n};\n\n/* The layer, frame and panel classes per phone layout. Each is prefixed `max-sm:`, so wider screens keep the card. */\nconst LayerPhoneClass: Record<ModalPhoneLayout, string> = {\n fullscreen: 'max-sm:place-items-stretch max-sm:p-0',\n sheet: 'max-sm:items-end max-sm:justify-items-stretch max-sm:p-0',\n card: '',\n};\n\nconst FramePhoneClass: Record<ModalPhoneLayout, string> = {\n fullscreen: 'max-sm:justify-items-stretch',\n sheet: 'max-sm:justify-items-stretch',\n card: '',\n};\n\n/* A wrapping `<form>` joins the fullscreen column, so its `ModalBody` takes the free height and the footer pins. */\nconst PanelPhoneClass: Record<ModalPhoneLayout, string> = {\n fullscreen: cn(\n 'max-sm:h-dvh max-sm:max-h-dvh max-sm:w-full max-sm:max-w-none max-sm:rounded-none',\n 'max-sm:[--ui-overlay-inset-top:env(safe-area-inset-top)]',\n 'max-sm:[&>form]:flex max-sm:[&>form]:min-h-0 max-sm:[&>form]:flex-1 max-sm:[&>form]:flex-col',\n ),\n sheet: 'max-sm:w-full max-sm:max-w-none max-sm:rounded-t-2xl max-sm:rounded-b-none',\n card: '',\n};\n\n/* Phones rise from the bottom edge; the card keeps its pop wherever it shows. */\nconst PanelMotionClass: Record<ModalPhoneLayout, string> = {\n fullscreen: cn(\n 'sm:motion-safe:group-data-[state=open]:animate-(--animate-pop-in)',\n 'sm:motion-safe:group-data-[state=closed]:animate-(--animate-pop-out)',\n 'max-sm:motion-safe:group-data-[state=open]:animate-(--animate-sheet-in)',\n 'max-sm:motion-safe:group-data-[state=closed]:animate-(--animate-sheet-out)',\n ),\n sheet: cn(\n 'sm:motion-safe:group-data-[state=open]:animate-(--animate-pop-in)',\n 'sm:motion-safe:group-data-[state=closed]:animate-(--animate-pop-out)',\n 'max-sm:motion-safe:group-data-[state=open]:animate-(--animate-sheet-in)',\n 'max-sm:motion-safe:group-data-[state=closed]:animate-(--animate-sheet-out)',\n ),\n card: cn(\n 'motion-safe:group-data-[state=open]:animate-(--animate-pop-in)',\n 'motion-safe:group-data-[state=closed]:animate-(--animate-pop-out)',\n ),\n};\n\n/** The drag past which a released sheet handle dismisses: this many pixels, or a third of the sheet if shorter. */\nconst HandleDismissDistance = 96;\n\n/**\n * Represents the prop surface of `ModalContent`.\n *\n * React declared the surface axes by `extends SurfaceLayoutVariants`; they are\n * spelled out here because the SFC compiler's type resolver cannot follow a\n * `VariantProps<typeof …>` base and fails the build on it. The aliases below\n * are the canonical ones from `foundation/styles`, already locked against the\n * `surfaceVariants` config there, so the two cannot drift.\n */\nexport interface ModalContentProps {\n /** Shows the default backdrop behind the panel. Default `true`. */\n readonly showBackdrop?: boolean;\n /** @deprecated Use `showBackdrop` (inverted); this alias is removed next release. */\n readonly hideBackdrop?: boolean;\n\n /** The backdrop-blur toggle. */\n readonly isBlurred?: boolean;\n\n /** The panel's max-width step; a `max-w-*` class still overrides it. Default `md`. */\n readonly size?: ModalSize;\n\n /** The visual recipe. Default `elevated`. */\n readonly variant?: SurfaceVariant;\n\n /** The color tone the recipe is tinted with. */\n readonly tone?: SurfaceTone;\n\n /** The corner rounding. Default `lg`. */\n readonly radius?: SurfaceRadius;\n\n /** The inner spacing step. Default `xl`. */\n readonly padding?: SurfacePadding;\n\n /** The shadow depth. */\n readonly elevation?: SurfaceElevation;\n\n /** The layout below the `sm` breakpoint; wider screens always get the centred card. Default `fullscreen`. */\n readonly phoneLayout?: ModalPhoneLayout;\n\n /**\n * Shows a grab handle on a phone `sheet`. Dragging it down dismisses the dialog where outside clicks may, and\n * springs back where they may not. Default `false`.\n */\n readonly showHandle?: boolean;\n}\n</script>\n\n<script setup lang=\"ts\">\nimport { computed, provide, shallowRef, useAttrs, useTemplateRef, watch } from 'vue';\nimport { surfaceVariants } from '../../../foundation/styles';\nimport { DismissableLayer, FocusScope, Portal, Presence, ScrollLockProvider } from '../../../foundation/primitives';\nimport BackdropOverlay from '../backdropOverlay/BackdropOverlay.vue';\nimport { overlayChromeContextKey } from '../OverlayChrome';\nimport { useModalContext } from './Modal.vue';\n\n/** Renders the portalled dialog surface — scrim, focus trap, scroll lock, and the a11y panel. */\ndefineOptions({ name: 'ModalContent', inheritAttrs: false });\n\n/** The panel content — chrome subcomponents and the dialog body. React's `children`. */\ndefineSlots<{ default(): unknown }>();\n\nconst props = withDefaults(defineProps<ModalContentProps>(), {\n size: 'md',\n showBackdrop: undefined,\n hideBackdrop: undefined,\n phoneLayout: ModalPhoneLayout.Fullscreen,\n showHandle: false,\n});\n\n/** `showBackdrop` first, then the inverted deprecated `hideBackdrop`. */\nconst hasBackdrop = computed(() => props.showBackdrop ?? !(props.hideBackdrop ?? false));\n\nconst attrs = useAttrs();\nconst context = useModalContext();\nconst el = useTemplateRef<HTMLDivElement>('el');\n\n/* Refs lifted to setup consts so the template auto-unwraps them (a plain injected object does not). */\nconst isOpen = context.open;\nconst role = context.role;\nconst dismissOnEscape = context.dismissOnEscape;\n\nfunction close(): void {\n context.setOpen(false);\n}\n\nprovide(overlayChromeContextKey, {\n titleId: context.titleId,\n descriptionId: context.descriptionId,\n close,\n});\n\n/* Safe-area spacers keep content clear of the notch and the home indicator; they collapse from `sm` up. */\nconst hasBottomInset = computed(() => props.phoneLayout !== ModalPhoneLayout.Card);\nconst hasTopInset = computed(() => props.phoneLayout === ModalPhoneLayout.Fullscreen);\nconst hasHandle = computed(() => props.showHandle && props.phoneLayout === ModalPhoneLayout.Sheet);\n\nconst layerClasses = computed(() =>\n cn(\n 'ui-modal-layer group fixed inset-0 z-modal grid place-items-center overflow-y-auto p-4',\n 'motion-safe:data-[state=open]:animate-(--animate-fade-in)',\n 'motion-safe:data-[state=closed]:animate-(--animate-fade-out)',\n LayerPhoneClass[props.phoneLayout],\n ),\n);\n\nconst frameClasses = computed(() =>\n cn('ui-modal-frame grid w-full justify-items-center', FramePhoneClass[props.phoneLayout]),\n);\n\nconst classes = computed(() =>\n cn(\n 'ui-modal-content relative w-full',\n ModalSizeClass[props.size],\n /* The panel never outgrows the window: it caps at the viewport and its body scrolls under a fixed header and\n footer. A panel without a body part scrolls whole. */\n 'flex max-h-[calc(100dvh-2rem)] flex-col overflow-y-auto overscroll-contain',\n PanelMotionClass[props.phoneLayout],\n surfaceVariants({\n variant: props.variant ?? 'elevated',\n tone: props.tone,\n radius: props.radius ?? 'lg',\n padding: props.padding ?? 'xl',\n elevation: props.elevation,\n }),\n attrs.class as string | undefined,\n /* Last, so a caller's width, height or radius serves the card and the phone layout still fills the screen. */\n PanelPhoneClass[props.phoneLayout],\n ),\n);\n\n/** Everything but `class`, which is re-applied through `cn` above. */\nconst rest = computed(() => {\n const { class: _class, ...others } = attrs;\n return others;\n});\n\n/* The sheet handle drag. The offset rides on the panel's transform; a release past the distance closes the dialog,\n and the exit keyframe leaves from that offset. Anything shorter springs back. */\nconst dragOffset = shallowRef(0);\nconst isDragging = shallowRef(false);\nlet dragPointer: { readonly id: number; readonly startY: number } | null = null;\n\nwatch(isOpen, (open) => {\n if (open) dragOffset.value = 0;\n});\n\nconst dragStyle = computed(() =>\n hasHandle.value\n ? {\n transform: dragOffset.value > 0 ? `translateY(${dragOffset.value}px)` : undefined,\n transition: isDragging.value ? 'none' : 'transform var(--duration-base) var(--ease-out)',\n }\n : undefined,\n);\n\nfunction handlePointerDown(event: PointerEvent): void {\n if (event.button !== 0) return;\n dragPointer = { id: event.pointerId, startY: event.clientY };\n isDragging.value = true;\n try {\n (event.currentTarget as HTMLElement).setPointerCapture(event.pointerId);\n } catch {\n /* A synthetic or already-released pointer has nothing to capture; the drag still tracks moves on the handle. */\n }\n}\n\nfunction handlePointerMove(event: PointerEvent): void {\n if (dragPointer?.id !== event.pointerId) return;\n dragOffset.value = Math.max(0, event.clientY - dragPointer.startY);\n}\n\nfunction handlePointerEnd(event: PointerEvent): void {\n if (dragPointer?.id !== event.pointerId) return;\n dragPointer = null;\n isDragging.value = false;\n const height = el.value?.offsetHeight ?? 0;\n const distance = Math.min(HandleDismissDistance, height / 3);\n if (event.type === 'pointerup' && dragOffset.value > distance && context.dismissOnOutsideClick.value) {\n context.setOpen(false);\n return;\n }\n dragOffset.value = 0;\n}\n\n/** Outside-click dismissal — `.self` is React's `e.target !== e.currentTarget` guard. */\nfunction handleOutsideClick(): void {\n if (context.dismissOnOutsideClick.value) context.setOpen(false);\n}\n\nfunction handleEscape(): void {\n context.setOpen(false);\n}\n\ndefineExpose({ el });\n</script>\n\n<template>\n <Portal>\n <!-- Lock follows open state, not mount — Content can mount closed. -->\n <ScrollLockProvider :is-enabled=\"isOpen\">\n <!-- The scrim runs on `BackdropOverlay`'s own `Presence` (its `isOpen` prop) so the\n fade-out plays before it unmounts. React wrapped it in a second, outer\n `Presence`, whose injected `data-state` the inner one then overwrote —\n passing the state straight in is the same intent without the masking. -->\n <BackdropOverlay v-if=\"hasBackdrop\" is-inline :is-open=\"isOpen\" :is-blurred=\"props.isBlurred\" />\n <!-- Outside-click dismissal lives on the centering wrapper (it covers the\n backdrop): a click on the padding (`.self`) = outside. The wrapper is the\n Presence-animated node — `Presence` injects `data-state` + `ref` onto it and\n watches *its own* animations (no subtree walk), so the wrapper carries a\n (transparent) fade and the visible pop lands on the panel via\n `group-data-[state=*]`. Both share the same token timing, so the wrapper fade\n gates unmount correctly. -->\n <Presence :is-present=\"isOpen\">\n <div :class=\"layerClasses\" :data-phone-layout=\"props.phoneLayout\" @click.self=\"handleOutsideClick\">\n <!-- The layer is the grid item, so it spans the window's width: a shrink-wrapped layer would hold the\n panel's `w-full` to its content width. It centers the panel in turn. -->\n <FocusScope as-child is-trapped can-loop is-modal>\n <DismissableLayer\n :class=\"frameClasses\"\n :is-escape-disabled=\"!dismissOnEscape\"\n is-outside-click-disabled\n :on-escape=\"handleEscape\"\n >\n <div\n ref=\"el\"\n :role=\"role\"\n aria-modal=\"true\"\n :aria-labelledby=\"context.titleId\"\n :aria-describedby=\"context.descriptionId\"\n :data-phone-layout=\"props.phoneLayout\"\n v-bind=\"rest\"\n :class=\"classes\"\n :style=\"dragStyle\"\n >\n <div\n v-if=\"hasHandle\"\n data-modal-handle\n aria-hidden=\"true\"\n class=\"absolute inset-x-0 top-0 z-raised flex h-6 cursor-grab touch-none justify-center pt-2 sm:hidden\"\n @pointerdown=\"handlePointerDown\"\n @pointermove=\"handlePointerMove\"\n @pointerup=\"handlePointerEnd\"\n @pointercancel=\"handlePointerEnd\"\n >\n <span class=\"h-1 w-10 rounded-full bg-border-strong forced-colors:bg-[CanvasText]\" />\n </div>\n <span\n v-if=\"hasTopInset\"\n aria-hidden=\"true\"\n class=\"block h-[env(safe-area-inset-top)] shrink-0 sm:hidden\"\n />\n <slot />\n <span\n v-if=\"hasBottomInset\"\n aria-hidden=\"true\"\n class=\"block h-[env(safe-area-inset-bottom)] shrink-0 sm:hidden\"\n />\n </div>\n </DismissableLayer>\n </FocusScope>\n </div>\n </Presence>\n </ScrollLockProvider>\n </Portal>\n</template>\n","<script lang=\"ts\">\n/**\n * The prop surface of `OverlayTitle`.\n *\n * React declared `extends HTMLAttributes<HTMLHeadingElement>` plus `children`;\n * attributes reach the root through `useAttrs` here and `children` is the\n * default slot, which leaves no declared prop.\n */\nexport type OverlayTitleProps = Record<string, never>;\n</script>\n\n<script setup lang=\"ts\">\nimport { computed, useAttrs, useTemplateRef } from 'vue';\nimport { cn } from '../../foundation/styles';\nimport { useOverlayChromeContext } from './OverlayChrome';\n\n/** Renders the enclosing dialog's accessible name, carrying the `id` its `aria-labelledby` names. */\ndefineOptions({ name: 'OverlayTitle', inheritAttrs: false });\n\n/** The title text — React's `children`. */\ndefineSlots<{ default(): unknown }>();\n\nconst attrs = useAttrs();\nconst context = useOverlayChromeContext();\nconst el = useTemplateRef<HTMLHeadingElement>('el');\n\nconst classes = computed(() =>\n cn('text-lg font-semibold leading-none text-foreground', attrs.class as string | undefined),\n);\n\n/** Everything but `class`, which is re-applied through `cn` above. */\nconst rest = computed(() => {\n const { class: _class, ...others } = attrs;\n return others;\n});\n\ndefineExpose({ el });\n</script>\n\n<template>\n <!-- `id` sits before `v-bind`, so a caller-supplied `id` still wins — React's prop order. -->\n <h2 ref=\"el\" :id=\"context.titleId\" v-bind=\"rest\" :class=\"classes\"><slot /></h2>\n</template>\n","<script lang=\"ts\">\n/**\n * The prop surface of `OverlayCloseButton`.\n *\n * React declared `extends Omit<ButtonHTMLAttributes<HTMLButtonElement>, 'children'>`;\n * attributes reach the root through `useAttrs` here, so only `asChild` remains.\n */\nexport interface OverlayCloseButtonProps {\n /** Merge onto the single slot child instead of rendering a `<button>`. */\n readonly asChild?: boolean;\n}\n</script>\n\n<script setup lang=\"ts\">\nimport { resolveElement } from '../../foundation/dom';\nimport { useLocale } from '../../foundation/i18n';\nimport { computed, useAttrs, useSlots, useTemplateRef, type ComponentPublicInstance } from 'vue';\nimport { X } from 'lucide-vue-next';\nimport { cn } from '../../foundation/styles';\nimport { Primitive } from '../../foundation/primitives';\nimport { useOverlayChromeContext } from './OverlayChrome';\n\nconst locale = useLocale();\n\n/** Renders the dismiss control of a Modal / Drawer panel; it closes the overlay and restores focus. */\ndefineOptions({ name: 'OverlayCloseButton', inheritAttrs: false });\n\n/** The button content — React's `children`. Falls back to an `X` glyph. */\ndefineSlots<{ default?(): unknown }>();\n\nconst props = withDefaults(defineProps<OverlayCloseButtonProps>(), { asChild: false });\n\nconst attrs = useAttrs();\nconst slots = useSlots();\nconst context = useOverlayChromeContext();\nconst inner = useTemplateRef<ComponentPublicInstance>('inner');\n\n/** `asChild` hands styling to the caller's element — React applied `className` bare in that branch. */\nconst classes = computed(() =>\n props.asChild\n ? (attrs.class as string | undefined)\n : cn(\n 'absolute right-4 top-[calc(1rem+var(--ui-overlay-inset-top,0px))] grid h-7 w-7 place-items-center rounded-sm text-muted-foreground transition-colors hover:bg-muted hover:text-foreground focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring',\n attrs.class as string | undefined,\n ),\n);\n\n/** Everything but `class`, which is re-applied through `cn` above. */\nconst rest = computed(() => {\n const { class: _class, ...others } = attrs;\n return others;\n});\n\n/**\n * `@click` is declared after `v-bind=\"rest\"`, so Vue chains the caller's own\n * handler first and this one second — the order React's `onClick?.(e)` had, and\n * what makes the `defaultPrevented` opt-out below work.\n */\nfunction handleClick(event: MouseEvent): void {\n if (event.defaultPrevented) return;\n context.close();\n}\n\n/** `Primitive` renders the real element, so its `$el` is this component's root. */\nconst el = computed(() => resolveElement(inner.value));\n\ndefineExpose({ el });\n</script>\n\n<template>\n <Primitive\n ref=\"inner\"\n as=\"button\"\n :as-child=\"props.asChild\"\n type=\"button\"\n :aria-label=\"slots.default ? undefined : locale.t('OverlayCloseButton.close', undefined, 'Close')\"\n v-bind=\"rest\"\n :class=\"classes\"\n @click=\"handleClick\"\n >\n <slot><X class=\"h-4 w-4\" /></slot>\n </Primitive>\n</template>\n"],"names":["_renderSlot","_createBlock","_unref","Portal","_createVNode","ScrollLockProvider","BackdropOverlay","_createElementVNode","FocusScope","DismissableLayer","_mergeProps","_createElementBlock","_openBlock"],"mappings":";;;;;;;;;;;;;;;;AAIO,MAAM,YAAY;AAAA;AAAA,EAEvB,QAAQ;AAAA;AAAA,EAER,aAAa;AACf;AAuBO,MAAM,kBAAmD,OAAO,eAAe;AAE/E,SAAS,kBAAqC;AACnD,QAAM,UAAU,OAAO,iBAAiB,IAAI;AAC5C,MAAI,CAAC,QAAS,OAAM,IAAI,MAAM,qCAAqC;AACnE,SAAO;AACT;;;;;;;;;;;;;;;AA8CA,UAAM,QAAQ;AAUd,UAAM,OAAO;AAKb,UAAM,aAAa,cAAuB;AAAA,MACxC,YAAY,MAAM,MAAM;AAAA,MACxB,SAAS,MAAM,MAAM;AAAA,MACrB,UAAU,CAAC,UAAU;AACnB,aAAK,eAAe,KAAK;AAAA,MAC3B;AAAA,IAAA,CACD;AAED,UAAM,YAAY,WAA+B,IAAI;AACrD,UAAM,UAAU,MAAM,aAAa;AACnC,UAAM,gBAAgB,MAAM,mBAAmB;AAE/C,YAAQ,iBAAiB;AAAA,MACvB,MAAM,WAAW;AAAA,MACjB,SAAS,WAAW;AAAA,MACpB;AAAA,MACA;AAAA,MACA;AAAA,MACA,MAAM,SAAS,MAAM,MAAM,IAAI;AAAA,MAC/B,uBAAuB,SAAS,MAAM,MAAM,4BAA4B,MAAM,yBAAyB,IAAI;AAAA,MAC3G,iBAAiB,SAAS,MAAM,MAAM,sBAAsB,MAAM,mBAAmB,IAAI;AAAA,IAAA,CAC1F;;aAICA,WAAQ,KAAA,QAAA,SAAA;AAAA;;;;;;;;;;;;;;;ACjHH,MAAM,YAAY;AAAA;AAAA,EAEvB,IAAI;AAAA;AA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,IAAG;AAAA,QACF,YAAU,MAAM;AAAA,QACjB,MAAK;AAAA,QACJ,cAAYR,MAAA,KAAA,EAAM,UAAU,SAAYA,MAAA,MAAA,EAAO,EAAC,4BAA6B,QAAS,OAAA;AAAA,MAAA,GAC/E,KAAA,OAAI;AAAA,QACX,OAAO,QAAA;AAAA,QACP,SAAO;AAAA,MAAA;yBAER,MAAkC;AAAA,UAAlCF,WAAkC,4BAAlC,MAAkC;AAAA,YAA5BI,YAAqBF,MAAA,CAAA,GAAA,EAAlB,OAAM,WAAS;AAAA,UAAA;;;;;;;"}
|
|
@@ -2,7 +2,7 @@ import { defineComponent, shallowRef, provide, computed, renderSlot, inject, use
|
|
|
2
2
|
import { r as resolveElement } from "./ResolveElement-CyRfM82x.js";
|
|
3
3
|
import { P as Primitive } from "./Primitive-D-9ShOm7.js";
|
|
4
4
|
import { c as cn } from "./Cn-C7De6POU.js";
|
|
5
|
-
import { s as surfaceVariants } from "./SurfaceStyles-
|
|
5
|
+
import { s as surfaceVariants } from "./SurfaceStyles-BYvRlsWe.js";
|
|
6
6
|
import { u as useControlled } from "./UseControlled-BQneb7BW.js";
|
|
7
7
|
import { _ as _sfc_main$3 } from "./Portal.vue_vue_type_script_setup_true_lang-C2_xSIMy.js";
|
|
8
8
|
import { P as Presence } from "./Presence-DDk0ZtAr.js";
|
|
@@ -227,4 +227,4 @@ export {
|
|
|
227
227
|
_sfc_main as a,
|
|
228
228
|
_sfc_main$1 as b
|
|
229
229
|
};
|
|
230
|
-
//# sourceMappingURL=PopoverContent.vue_vue_type_script_setup_true_lang-
|
|
230
|
+
//# sourceMappingURL=PopoverContent.vue_vue_type_script_setup_true_lang-C6YKEo3H.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PopoverContent.vue_vue_type_script_setup_true_lang-BIHYpwzT.js","sources":["../../src/presentation/overlays/OverlayExtensions.ts","../../src/presentation/overlays/popover/Popover.vue","../../src/presentation/overlays/popover/PopoverTrigger.vue","../../src/presentation/overlays/popover/PopoverContent.vue"],"sourcesContent":["// Domain-internal helpers for `overlays/`. Not exported from the group barrel —\n// the \"internal\" signal is absence from `index.ts`, not the file name.\n\nimport { resolveElement } from '../../foundation/dom';\n\n/** Extends `overlays/` with the DOM-node reads its triggers and panels share. */\nexport const OverlayExtensions = {\n /**\n * The DOM node behind a template ref, or `null`.\n *\n * The `typeof` guard is load-bearing rather than defensive. Every overlay seeds\n * its trigger element from a `watch(..., { immediate: true, flush: 'post' })`,\n * and Vue runs an *immediate* watcher once during SSR — where `HTMLElement` is\n * not a global, so a bare `value instanceof HTMLElement` throws `ReferenceError`\n * and takes the whole server render down. Returning `null` on the server is\n * correct as well as safe: there is no element to anchor to until hydration.\n */\n toHtmlElement(value: unknown): HTMLElement | null {\n if (typeof HTMLElement === 'undefined') return null;\n /* `resolveElement` also steps past a fragment's start anchor: an `as-child` trigger wrapping a component whose\n template opens with a comment has that anchor as its `$el` in a development build. */\n return resolveElement(value);\n },\n} as const;\n","<script lang=\"ts\">\nimport { inject, type ComputedRef, type InjectionKey, type Ref, type ShallowRef } from 'vue';\nimport type { Placement } from '@floating-ui/vue';\n\n/**\n * The value shared with `PopoverTrigger` / `PopoverContent`.\n *\n * React carried the trigger twice — a ref for imperative focus and a state copy\n * so an initially-open popover re-rendered anchored. A `shallowRef` is already\n * reactive, so one field covers both here.\n */\nexport interface PopoverContextValue {\n /** The resolved open state. Writable — an assignment routes through `setOpen`. */\n open: Ref<boolean>;\n setOpen: (open: boolean) => void;\n /** The trigger element — the positioning anchor and the focus-return target. */\n triggerEl: ShallowRef<HTMLElement | null>;\n placement: ComputedRef<Placement>;\n offset: ComputedRef<number>;\n isModal: ComputedRef<boolean>;\n dismissOnOutsideClick: ComputedRef<boolean>;\n dismissOnEscape: ComputedRef<boolean>;\n}\n\nexport const popoverContextKey: InjectionKey<PopoverContextValue> = Symbol('wow-two.popover');\n\nexport function usePopoverContext(): PopoverContextValue {\n const context = inject(popoverContextKey, null);\n if (!context) throw new Error('Popover.* must be used inside <Popover>');\n return context;\n}\n\n/** Controlled axes use their canonical Vue model names; each update event requests caller state. */\nexport interface PopoverProps {\n /** The open state, controlled. The `v-model:open` binding target. */\n readonly open?: boolean;\n\n /** The initial open state when uncontrolled. Default `false`. */\n readonly defaultOpen?: boolean;\n\n /** The Floating UI placement. Default `bottom`. */\n readonly placement?: Placement;\n\n /** The distance between anchor and panel in px. Default 8. */\n readonly offset?: number;\n\n /** Whether the panel is modal and traps focus. Default false. */\n readonly isModal?: boolean;\n\n /** The outside-click dismissal toggle. Default `true`. */\n readonly canDismissOnOutsideClick?: boolean;\n /** @deprecated Use `canDismissOnOutsideClick`; this alias is removed next release. */\n readonly dismissOnOutsideClick?: boolean;\n\n /** The Escape dismissal toggle. Default `true`. */\n readonly canDismissOnEscape?: boolean;\n /** @deprecated Use `canDismissOnEscape`; this alias is removed next release. */\n readonly dismissOnEscape?: boolean;\n}\n</script>\n\n<script setup lang=\"ts\">\nimport { computed, provide, shallowRef } from 'vue';\nimport { useControlled } from '../../../foundation/state';\n\n/**\n * Renders only its slot, owning the open state and placement of the Popover tree below it.\n * React returned a bare context Provider, which has no element of its own.\n */\ndefineOptions({ name: 'Popover', inheritAttrs: false });\n\n/** The Popover tree — `PopoverTrigger` and `PopoverContent`. React's `children`. */\ndefineSlots<{ default(): unknown }>();\n\n/** `open` default to `undefined` so an absent prop cannot read as an explicit `false`. */\nconst props = withDefaults(defineProps<PopoverProps>(), {\n open: undefined,\n defaultOpen: false,\n placement: 'bottom',\n offset: 8,\n isModal: false,\n canDismissOnOutsideClick: undefined,\n dismissOnOutsideClick: undefined,\n canDismissOnEscape: undefined,\n dismissOnEscape: undefined,\n});\n\nconst emit = defineEmits<{\n /** Fires when the popover opens or closes — the `v-model:open` half. */\n 'update:open': [open: boolean];\n}>();\n\nconst controlled = useControlled<boolean>({\n controlled: () => props.open,\n default: () => props.defaultOpen,\n onChange: (value) => {\n emit('update:open', value);\n },\n});\n\nconst triggerEl = shallowRef<HTMLElement | null>(null);\n\nprovide(popoverContextKey, {\n open: controlled.value,\n setOpen: controlled.setValue,\n triggerEl,\n placement: computed(() => props.placement),\n offset: computed(() => props.offset),\n isModal: computed(() => props.isModal),\n dismissOnOutsideClick: computed(() => props.canDismissOnOutsideClick ?? props.dismissOnOutsideClick ?? true),\n dismissOnEscape: computed(() => props.canDismissOnEscape ?? props.dismissOnEscape ?? true),\n});\n</script>\n\n<template>\n <slot />\n</template>\n","<script lang=\"ts\">\n/**\n * The prop surface of `PopoverTrigger`.\n *\n * React declared `extends Omit<ButtonHTMLAttributes<HTMLButtonElement>, 'children'>`;\n * attributes reach the root through `useAttrs` here, so only `asChild` remains.\n */\nexport interface PopoverTriggerProps {\n /** Merge onto the single slot child instead of rendering a `<button>`. */\n readonly asChild?: boolean;\n}\n</script>\n\n<script setup lang=\"ts\">\nimport { resolveElement } from '../../../foundation/dom';\nimport { computed, useAttrs, useTemplateRef, watch, type ComponentPublicInstance } from 'vue';\nimport { OverlayExtensions } from '../OverlayExtensions';\nimport { Primitive } from '../../../foundation/primitives';\nimport { usePopoverContext } from './Popover.vue';\n\n/** Renders the control that toggles the enclosing `Popover` and anchors its panel. */\ndefineOptions({ name: 'PopoverTrigger', inheritAttrs: false });\n\n/** The trigger content — React's `children`. */\ndefineSlots<{ default(): unknown }>();\n\nconst props = withDefaults(defineProps<PopoverTriggerProps>(), { asChild: false });\n\nconst attrs = useAttrs();\nconst context = usePopoverContext();\nconst inner = useTemplateRef<ComponentPublicInstance>('inner');\n\n/* Lifted to a setup const so the template auto-unwraps it (a plain injected object does not). */\nconst isOpen = context.open;\n\nwatch(\n inner,\n (instance) => {\n context.triggerEl.value = OverlayExtensions.toHtmlElement(instance?.$el);\n },\n { immediate: true, flush: 'post' },\n);\n\n/**\n * `@click` is declared after `v-bind=\"attrs\"`, so Vue chains the caller's own\n * handler first and this one second — React's `onClick?.(e)` order, which is\n * what makes the `defaultPrevented` opt-out work.\n */\nfunction handleClick(event: MouseEvent): void {\n if (event.defaultPrevented) return;\n context.setOpen(!context.open.value);\n}\n\n/** `Primitive` renders the real element, so its `$el` is this component's root. */\nconst el = computed(() => resolveElement(inner.value));\n\ndefineExpose({ el });\n</script>\n\n<template>\n <Primitive\n ref=\"inner\"\n as=\"button\"\n :as-child=\"props.asChild\"\n type=\"button\"\n aria-haspopup=\"dialog\"\n :aria-expanded=\"isOpen\"\n :data-state=\"isOpen ? 'open' : 'closed'\"\n v-bind=\"attrs\"\n @click=\"handleClick\"\n >\n <slot />\n </Primitive>\n</template>\n","<script lang=\"ts\">\nimport type {\n SurfaceElevation,\n SurfacePadding,\n SurfaceRadius,\n SurfaceTone,\n SurfaceVariant,\n} from '../../../foundation/styles';\n\n/**\n * Represents the prop surface of `PopoverContent`.\n *\n * React declared the surface axes by `extends SurfaceLayoutVariants`; they are\n * spelled out here because the SFC compiler's type resolver cannot follow a\n * `VariantProps<typeof …>` base and fails the build on it. The aliases below\n * are the canonical ones from `foundation/styles`, already locked against the\n * `surfaceVariants` config there, so the two cannot drift.\n */\nexport interface PopoverContentProps {\n /** The bare toggle — skips the surface chrome (bg/border/shadow); keeps only z-index + animation. */\n readonly isBare?: boolean;\n\n /** The visual recipe. Default `raised`. */\n readonly variant?: SurfaceVariant;\n\n /** The color tone the recipe is tinted with. */\n readonly tone?: SurfaceTone;\n\n /** The corner rounding. */\n readonly radius?: SurfaceRadius;\n\n /** The inner spacing step. Defaults to `lg` with chrome on, `none` when bare. */\n readonly padding?: SurfacePadding;\n\n /** The shadow depth. */\n readonly elevation?: SurfaceElevation;\n}\n\n/** Contains the default chrome width that preserves the historical look. */\nconst DefaultWidth = 'w-72';\n</script>\n\n<script setup lang=\"ts\">\nimport { computed, useAttrs } from 'vue';\nimport { cn, surfaceVariants } from '../../../foundation/styles';\nimport { AnchoredPositioner, DismissableLayer, FocusScope, Portal, Presence } from '../../../foundation/primitives';\nimport { usePopoverContext } from './Popover.vue';\n\n/** Renders the anchored, dismissable popover panel. */\ndefineOptions({ name: 'PopoverContent', inheritAttrs: false });\n\n/** The panel content — React's `children`. */\ndefineSlots<{ default(): unknown }>();\n\nconst props = defineProps<PopoverContentProps>();\n\nconst attrs = useAttrs();\nconst context = usePopoverContext();\n\n/* Refs lifted to setup consts so the template auto-unwraps them (a plain injected object does not). */\nconst isOpen = context.open;\nconst placement = context.placement;\nconst offset = context.offset;\nconst isModal = context.isModal;\nconst dismissOnEscape = context.dismissOnEscape;\nconst dismissOnOutsideClick = context.dismissOnOutsideClick;\n\nconst anchor = computed(() => context.triggerEl.value);\n\n/** Default to `lg` padding when chrome is on (matches the old `p-4`); the caller can override. */\nconst resolvedPadding = computed(() => props.padding ?? (props.isBare ? 'none' : 'lg'));\n\nconst classes = computed(() =>\n cn(\n /* pop (fade+scale) gated on the portal-root data-state + motion-safe\n so reduced-motion users get no movement. */\n 'outline-hidden',\n 'motion-safe:group-data-[state=open]:animate-(--animate-pop-in)',\n 'motion-safe:group-data-[state=closed]:animate-(--animate-pop-out) motion-reduce:animate-none',\n !props.isBare &&\n cn(\n DefaultWidth,\n surfaceVariants({\n variant: props.variant ?? 'raised',\n tone: props.tone,\n radius: props.radius,\n padding: resolvedPadding.value,\n elevation: props.elevation,\n }),\n ),\n attrs.class as string | undefined,\n ),\n);\n\n/** Everything but `class`, which is re-applied through `cn` above. */\nconst rest = computed(() => {\n const { class: _class, ...others } = attrs;\n return others;\n});\n\nfunction handleEscape(): void {\n context.setOpen(false);\n}\n\nfunction handleOutsidePointerDown(event: PointerEvent): void {\n if (context.triggerEl.value?.contains(event.target as Node)) return;\n context.setOpen(false);\n}\n</script>\n\n<template>\n <!--\n React portalled from *inside* the Presence-cloned root; Vue resolves a cloned\n `ref` through `$el` and a Teleport has no element, so `Portal` is hoisted and\n the `contents` root stays the Presence node — which is what carries\n `data-state` for the panel's `group-data-[state=*]` pop.\n -->\n <Portal>\n <Presence :is-present=\"isOpen\">\n <!--\n `Presence`-clonable root: accepts `data-state` + `ref`, marked `group` so\n the panel animates off it, and holds no layout of its own\n (`display: contents`) so anchored positioning is unaffected.\n -->\n <div class=\"group contents\">\n <!-- z-popover (80) on the SC root (transform makes the stacking context) so a\n popover from a Modal (z-modal, 70) paints above it — both portal to body. -->\n <AnchoredPositioner :anchor=\"anchor\" :placement=\"placement\" :offset=\"offset\" class=\"z-popover\">\n <!--\n `FocusScope as-child` merges into `DismissableLayer`, whose own root div\n *is* the panel — React kept a layer div around a separate panel div. The\n two share a box, and collapsing them puts `role`, the surface classes and\n the outside-click boundary on one node.\n -->\n <FocusScope as-child :is-trapped=\"isModal\" :can-loop=\"isModal\" :is-modal=\"isModal\">\n <DismissableLayer\n :is-escape-disabled=\"!dismissOnEscape\"\n :is-outside-click-disabled=\"!dismissOnOutsideClick\"\n :on-escape=\"handleEscape\"\n :on-outside-pointer-down=\"handleOutsidePointerDown\"\n role=\"dialog\"\n :aria-modal=\"isModal || undefined\"\n v-bind=\"rest\"\n :class=\"classes\"\n >\n <slot />\n </DismissableLayer>\n </FocusScope>\n </AnchoredPositioner>\n </div>\n </Presence>\n </Portal>\n</template>\n"],"names":["_renderSlot","_openBlock","_createBlock","_unref","_mergeProps","Portal","_createVNode","_createElementVNode","AnchoredPositioner","FocusScope"],"mappings":";;;;;;;;;;;AAMO,MAAM,oBAAoB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAW/B,cAAc,OAAoC;AAChD,QAAI,OAAO,gBAAgB,YAAa,QAAO;AAG/C,WAAO,eAAe,KAAK;AAAA,EAC7B;AACF;ACCO,MAAM,oBAAuD,OAAO,iBAAiB;AAErF,SAAS,oBAAyC;AACvD,QAAM,UAAU,OAAO,mBAAmB,IAAI;AAC9C,MAAI,CAAC,QAAS,OAAM,IAAI,MAAM,yCAAyC;AACvE,SAAO;AACT;;;;;;;;;;;;;;;;;AA6CA,UAAM,QAAQ;AAYd,UAAM,OAAO;AAKb,UAAM,aAAa,cAAuB;AAAA,MACxC,YAAY,MAAM,MA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AAA,yBAjCP,MAgCW;AAAA,UAhCXC,YAgCWH,MAAA,QAAA,GAAA,EAhCA,cAAYA,MAAA,MAAA,KAAM;AAAA,6BAM3B,MAyBM;AAAA,cAzBNI,mBAyBM,OAzBN,YAyBM;AAAA,gBAtBJD,YAqBqBH,MAAAK,WAAA,GAAA;AAAA,kBArBA,QAAQ,OAAA;AAAA,kBAAS,WAAWL,MAAA,SAAA;AAAA,kBAAY,QAAQA,MAAA,MAAA;AAAA,kBAAQ,OAAM;AAAA,gBAAA;mCAOjF,MAaa;AAAA,oBAbbG,YAaaH,MAAAM,WAAA,GAAA;AAAA,sBAbD,YAAA;AAAA,sBAAU,cAAYN,MAAA,OAAA;AAAA,sBAAU,YAAUA,MAAA,OAAA;AAAA,sBAAU,YAAUA,MAAA,OAAA;AAAA,oBAAA;uCACxE,MAWmB;AAAA,wBAXnBG,YAWmBH,oBAXnBC,WAWmB;AAAA,0BAVhB,uBAAqBD,MAAA,eAAA;AAAA,0BACrB,8BAA4BA,MAAA,qBAAA;AAAA,0BAC5B,aAAW;AAAA,0BACX,2BAAyB;AAAA,0BAC1B,MAAK;AAAA,0BACJ,cAAYA,MAAA,OAAA,KAAW;AAAA,wBAAA,GAChB,KAAA,OAAI,EACX,OAAO,QAAA,MAAA,CAAO,GAAA;AAAA,2CAEf,MAAQ;AAAA,4BAARH,WAAQ,KAAA,QAAA,SAAA;AAAA,0BAAA;;;;;;;;;;;;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"PopoverContent.vue_vue_type_script_setup_true_lang-C6YKEo3H.js","sources":["../../src/presentation/overlays/OverlayExtensions.ts","../../src/presentation/overlays/popover/Popover.vue","../../src/presentation/overlays/popover/PopoverTrigger.vue","../../src/presentation/overlays/popover/PopoverContent.vue"],"sourcesContent":["// Domain-internal helpers for `overlays/`. Not exported from the group barrel —\n// the \"internal\" signal is absence from `index.ts`, not the file name.\n\nimport { resolveElement } from '../../foundation/dom';\n\n/** Extends `overlays/` with the DOM-node reads its triggers and panels share. */\nexport const OverlayExtensions = {\n /**\n * The DOM node behind a template ref, or `null`.\n *\n * The `typeof` guard is load-bearing rather than defensive. Every overlay seeds\n * its trigger element from a `watch(..., { immediate: true, flush: 'post' })`,\n * and Vue runs an *immediate* watcher once during SSR — where `HTMLElement` is\n * not a global, so a bare `value instanceof HTMLElement` throws `ReferenceError`\n * and takes the whole server render down. Returning `null` on the server is\n * correct as well as safe: there is no element to anchor to until hydration.\n */\n toHtmlElement(value: unknown): HTMLElement | null {\n if (typeof HTMLElement === 'undefined') return null;\n /* `resolveElement` also steps past a fragment's start anchor: an `as-child` trigger wrapping a component whose\n template opens with a comment has that anchor as its `$el` in a development build. */\n return resolveElement(value);\n },\n} as const;\n","<script lang=\"ts\">\nimport { inject, type ComputedRef, type InjectionKey, type Ref, type ShallowRef } from 'vue';\nimport type { Placement } from '@floating-ui/vue';\n\n/**\n * The value shared with `PopoverTrigger` / `PopoverContent`.\n *\n * React carried the trigger twice — a ref for imperative focus and a state copy\n * so an initially-open popover re-rendered anchored. A `shallowRef` is already\n * reactive, so one field covers both here.\n */\nexport interface PopoverContextValue {\n /** The resolved open state. Writable — an assignment routes through `setOpen`. */\n open: Ref<boolean>;\n setOpen: (open: boolean) => void;\n /** The trigger element — the positioning anchor and the focus-return target. */\n triggerEl: ShallowRef<HTMLElement | null>;\n placement: ComputedRef<Placement>;\n offset: ComputedRef<number>;\n isModal: ComputedRef<boolean>;\n dismissOnOutsideClick: ComputedRef<boolean>;\n dismissOnEscape: ComputedRef<boolean>;\n}\n\nexport const popoverContextKey: InjectionKey<PopoverContextValue> = Symbol('wow-two.popover');\n\nexport function usePopoverContext(): PopoverContextValue {\n const context = inject(popoverContextKey, null);\n if (!context) throw new Error('Popover.* must be used inside <Popover>');\n return context;\n}\n\n/** Controlled axes use their canonical Vue model names; each update event requests caller state. */\nexport interface PopoverProps {\n /** The open state, controlled. The `v-model:open` binding target. */\n readonly open?: boolean;\n\n /** The initial open state when uncontrolled. Default `false`. */\n readonly defaultOpen?: boolean;\n\n /** The Floating UI placement. Default `bottom`. */\n readonly placement?: Placement;\n\n /** The distance between anchor and panel in px. Default 8. */\n readonly offset?: number;\n\n /** Whether the panel is modal and traps focus. Default false. */\n readonly isModal?: boolean;\n\n /** The outside-click dismissal toggle. Default `true`. */\n readonly canDismissOnOutsideClick?: boolean;\n /** @deprecated Use `canDismissOnOutsideClick`; this alias is removed next release. */\n readonly dismissOnOutsideClick?: boolean;\n\n /** The Escape dismissal toggle. Default `true`. */\n readonly canDismissOnEscape?: boolean;\n /** @deprecated Use `canDismissOnEscape`; this alias is removed next release. */\n readonly dismissOnEscape?: boolean;\n}\n</script>\n\n<script setup lang=\"ts\">\nimport { computed, provide, shallowRef } from 'vue';\nimport { useControlled } from '../../../foundation/state';\n\n/**\n * Renders only its slot, owning the open state and placement of the Popover tree below it.\n * React returned a bare context Provider, which has no element of its own.\n */\ndefineOptions({ name: 'Popover', inheritAttrs: false });\n\n/** The Popover tree — `PopoverTrigger` and `PopoverContent`. React's `children`. */\ndefineSlots<{ default(): unknown }>();\n\n/** `open` default to `undefined` so an absent prop cannot read as an explicit `false`. */\nconst props = withDefaults(defineProps<PopoverProps>(), {\n open: undefined,\n defaultOpen: false,\n placement: 'bottom',\n offset: 8,\n isModal: false,\n canDismissOnOutsideClick: undefined,\n dismissOnOutsideClick: undefined,\n canDismissOnEscape: undefined,\n dismissOnEscape: undefined,\n});\n\nconst emit = defineEmits<{\n /** Fires when the popover opens or closes — the `v-model:open` half. */\n 'update:open': [open: boolean];\n}>();\n\nconst controlled = useControlled<boolean>({\n controlled: () => props.open,\n default: () => props.defaultOpen,\n onChange: (value) => {\n emit('update:open', value);\n },\n});\n\nconst triggerEl = shallowRef<HTMLElement | null>(null);\n\nprovide(popoverContextKey, {\n open: controlled.value,\n setOpen: controlled.setValue,\n triggerEl,\n placement: computed(() => props.placement),\n offset: computed(() => props.offset),\n isModal: computed(() => props.isModal),\n dismissOnOutsideClick: computed(() => props.canDismissOnOutsideClick ?? props.dismissOnOutsideClick ?? true),\n dismissOnEscape: computed(() => props.canDismissOnEscape ?? props.dismissOnEscape ?? true),\n});\n</script>\n\n<template>\n <slot />\n</template>\n","<script lang=\"ts\">\n/**\n * The prop surface of `PopoverTrigger`.\n *\n * React declared `extends Omit<ButtonHTMLAttributes<HTMLButtonElement>, 'children'>`;\n * attributes reach the root through `useAttrs` here, so only `asChild` remains.\n */\nexport interface PopoverTriggerProps {\n /** Merge onto the single slot child instead of rendering a `<button>`. */\n readonly asChild?: boolean;\n}\n</script>\n\n<script setup lang=\"ts\">\nimport { resolveElement } from '../../../foundation/dom';\nimport { computed, useAttrs, useTemplateRef, watch, type ComponentPublicInstance } from 'vue';\nimport { OverlayExtensions } from '../OverlayExtensions';\nimport { Primitive } from '../../../foundation/primitives';\nimport { usePopoverContext } from './Popover.vue';\n\n/** Renders the control that toggles the enclosing `Popover` and anchors its panel. */\ndefineOptions({ name: 'PopoverTrigger', inheritAttrs: false });\n\n/** The trigger content — React's `children`. */\ndefineSlots<{ default(): unknown }>();\n\nconst props = withDefaults(defineProps<PopoverTriggerProps>(), { asChild: false });\n\nconst attrs = useAttrs();\nconst context = usePopoverContext();\nconst inner = useTemplateRef<ComponentPublicInstance>('inner');\n\n/* Lifted to a setup const so the template auto-unwraps it (a plain injected object does not). */\nconst isOpen = context.open;\n\nwatch(\n inner,\n (instance) => {\n context.triggerEl.value = OverlayExtensions.toHtmlElement(instance?.$el);\n },\n { immediate: true, flush: 'post' },\n);\n\n/**\n * `@click` is declared after `v-bind=\"attrs\"`, so Vue chains the caller's own\n * handler first and this one second — React's `onClick?.(e)` order, which is\n * what makes the `defaultPrevented` opt-out work.\n */\nfunction handleClick(event: MouseEvent): void {\n if (event.defaultPrevented) return;\n context.setOpen(!context.open.value);\n}\n\n/** `Primitive` renders the real element, so its `$el` is this component's root. */\nconst el = computed(() => resolveElement(inner.value));\n\ndefineExpose({ el });\n</script>\n\n<template>\n <Primitive\n ref=\"inner\"\n as=\"button\"\n :as-child=\"props.asChild\"\n type=\"button\"\n aria-haspopup=\"dialog\"\n :aria-expanded=\"isOpen\"\n :data-state=\"isOpen ? 'open' : 'closed'\"\n v-bind=\"attrs\"\n @click=\"handleClick\"\n >\n <slot />\n </Primitive>\n</template>\n","<script lang=\"ts\">\nimport type {\n SurfaceElevation,\n SurfacePadding,\n SurfaceRadius,\n SurfaceTone,\n SurfaceVariant,\n} from '../../../foundation/styles';\n\n/**\n * Represents the prop surface of `PopoverContent`.\n *\n * React declared the surface axes by `extends SurfaceLayoutVariants`; they are\n * spelled out here because the SFC compiler's type resolver cannot follow a\n * `VariantProps<typeof …>` base and fails the build on it. The aliases below\n * are the canonical ones from `foundation/styles`, already locked against the\n * `surfaceVariants` config there, so the two cannot drift.\n */\nexport interface PopoverContentProps {\n /** The bare toggle — skips the surface chrome (bg/border/shadow); keeps only z-index + animation. */\n readonly isBare?: boolean;\n\n /** The visual recipe. Default `raised`. */\n readonly variant?: SurfaceVariant;\n\n /** The color tone the recipe is tinted with. */\n readonly tone?: SurfaceTone;\n\n /** The corner rounding. */\n readonly radius?: SurfaceRadius;\n\n /** The inner spacing step. Defaults to `lg` with chrome on, `none` when bare. */\n readonly padding?: SurfacePadding;\n\n /** The shadow depth. */\n readonly elevation?: SurfaceElevation;\n}\n\n/** Contains the default chrome width that preserves the historical look. */\nconst DefaultWidth = 'w-72';\n</script>\n\n<script setup lang=\"ts\">\nimport { computed, useAttrs } from 'vue';\nimport { cn, surfaceVariants } from '../../../foundation/styles';\nimport { AnchoredPositioner, DismissableLayer, FocusScope, Portal, Presence } from '../../../foundation/primitives';\nimport { usePopoverContext } from './Popover.vue';\n\n/** Renders the anchored, dismissable popover panel. */\ndefineOptions({ name: 'PopoverContent', inheritAttrs: false });\n\n/** The panel content — React's `children`. */\ndefineSlots<{ default(): unknown }>();\n\nconst props = defineProps<PopoverContentProps>();\n\nconst attrs = useAttrs();\nconst context = usePopoverContext();\n\n/* Refs lifted to setup consts so the template auto-unwraps them (a plain injected object does not). */\nconst isOpen = context.open;\nconst placement = context.placement;\nconst offset = context.offset;\nconst isModal = context.isModal;\nconst dismissOnEscape = context.dismissOnEscape;\nconst dismissOnOutsideClick = context.dismissOnOutsideClick;\n\nconst anchor = computed(() => context.triggerEl.value);\n\n/** Default to `lg` padding when chrome is on (matches the old `p-4`); the caller can override. */\nconst resolvedPadding = computed(() => props.padding ?? (props.isBare ? 'none' : 'lg'));\n\nconst classes = computed(() =>\n cn(\n /* pop (fade+scale) gated on the portal-root data-state + motion-safe\n so reduced-motion users get no movement. */\n 'outline-hidden',\n 'motion-safe:group-data-[state=open]:animate-(--animate-pop-in)',\n 'motion-safe:group-data-[state=closed]:animate-(--animate-pop-out) motion-reduce:animate-none',\n !props.isBare &&\n cn(\n DefaultWidth,\n surfaceVariants({\n variant: props.variant ?? 'raised',\n tone: props.tone,\n radius: props.radius,\n padding: resolvedPadding.value,\n elevation: props.elevation,\n }),\n ),\n attrs.class as string | undefined,\n ),\n);\n\n/** Everything but `class`, which is re-applied through `cn` above. */\nconst rest = computed(() => {\n const { class: _class, ...others } = attrs;\n return others;\n});\n\nfunction handleEscape(): void {\n context.setOpen(false);\n}\n\nfunction handleOutsidePointerDown(event: PointerEvent): void {\n if (context.triggerEl.value?.contains(event.target as Node)) return;\n context.setOpen(false);\n}\n</script>\n\n<template>\n <!--\n React portalled from *inside* the Presence-cloned root; Vue resolves a cloned\n `ref` through `$el` and a Teleport has no element, so `Portal` is hoisted and\n the `contents` root stays the Presence node — which is what carries\n `data-state` for the panel's `group-data-[state=*]` pop.\n -->\n <Portal>\n <Presence :is-present=\"isOpen\">\n <!--\n `Presence`-clonable root: accepts `data-state` + `ref`, marked `group` so\n the panel animates off it, and holds no layout of its own\n (`display: contents`) so anchored positioning is unaffected.\n -->\n <div class=\"group contents\">\n <!-- z-popover (80) on the SC root (transform makes the stacking context) so a\n popover from a Modal (z-modal, 70) paints above it — both portal to body. -->\n <AnchoredPositioner :anchor=\"anchor\" :placement=\"placement\" :offset=\"offset\" class=\"z-popover\">\n <!--\n `FocusScope as-child` merges into `DismissableLayer`, whose own root div\n *is* the panel — React kept a layer div around a separate panel div. The\n two share a box, and collapsing them puts `role`, the surface classes and\n the outside-click boundary on one node.\n -->\n <FocusScope as-child :is-trapped=\"isModal\" :can-loop=\"isModal\" :is-modal=\"isModal\">\n <DismissableLayer\n :is-escape-disabled=\"!dismissOnEscape\"\n :is-outside-click-disabled=\"!dismissOnOutsideClick\"\n :on-escape=\"handleEscape\"\n :on-outside-pointer-down=\"handleOutsidePointerDown\"\n role=\"dialog\"\n :aria-modal=\"isModal || undefined\"\n v-bind=\"rest\"\n :class=\"classes\"\n >\n <slot />\n </DismissableLayer>\n </FocusScope>\n </AnchoredPositioner>\n </div>\n </Presence>\n </Portal>\n</template>\n"],"names":["_renderSlot","_openBlock","_createBlock","_unref","_mergeProps","Portal","_createVNode","_createElementVNode","AnchoredPositioner","FocusScope"],"mappings":";;;;;;;;;;;AAMO,MAAM,oBAAoB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAW/B,cAAc,OAAoC;AAChD,QAAI,OAAO,gBAAgB,YAAa,QAAO;AAG/C,WAAO,eAAe,KAAK;AAAA,EAC7B;AACF;ACCO,MAAM,oBAAuD,OAAO,iBAAiB;AAErF,SAAS,oBAAyC;AACvD,QAAM,UAAU,OAAO,mBAAmB,IAAI;AAC9C,MAAI,CAAC,QAAS,OAAM,IAAI,MAAM,yCAAyC;AACvE,SAAO;AACT;;;;;;;;;;;;;;;;;AA6CA,UAAM,QAAQ;AAYd,UAAM,OAAO;AAKb,UAAM,aAAa,cAAuB;AAAA,MACxC,YAAY,MAAM,MAAM;AAAA,MACxB,SAAS,MAAM,MAAM;AAAA,MACrB,UAAU,CAAC,UAAU;AACnB,aAAK,eAAe,KAAK;AAAA,MAC3B;AAAA,IAAA,CACD;AAED,UAAM,YAAY,WAA+B,IAAI;AAErD,YAAQ,mBAAmB;A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qBqBH,MAAAK,WAAA,GAAA;AAAA,kBArBA,QAAQ,OAAA;AAAA,kBAAS,WAAWL,MAAA,SAAA;AAAA,kBAAY,QAAQA,MAAA,MAAA;AAAA,kBAAQ,OAAM;AAAA,gBAAA;mCAOjF,MAaa;AAAA,oBAbbG,YAaaH,MAAAM,WAAA,GAAA;AAAA,sBAbD,YAAA;AAAA,sBAAU,cAAYN,MAAA,OAAA;AAAA,sBAAU,YAAUA,MAAA,OAAA;AAAA,sBAAU,YAAUA,MAAA,OAAA;AAAA,oBAAA;uCACxE,MAWmB;AAAA,wBAXnBG,YAWmBH,oBAXnBC,WAWmB;AAAA,0BAVhB,uBAAqBD,MAAA,eAAA;AAAA,0BACrB,8BAA4BA,MAAA,qBAAA;AAAA,0BAC5B,aAAW;AAAA,0BACX,2BAAyB;AAAA,0BAC1B,MAAK;AAAA,0BACJ,cAAYA,MAAA,OAAA,KAAW;AAAA,wBAAA,GAChB,KAAA,OAAI,EACX,OAAO,QAAA,MAAA,CAAO,GAAA;AAAA,2CAEf,MAAQ;AAAA,4BAARH,WAAQ,KAAA,QAAA,SAAA;AAAA,0BAAA;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { defineComponent, shallowRef, watch, computed, openBlock, createElementBlock, createVNode, unref, withCtx, createTextVNode, toDisplayString, createElementVNode, Fragment, createCommentVNode } from "vue";
|
|
2
2
|
import { CircleCheck, RotateCcw, Flag } from "lucide-vue-next";
|
|
3
3
|
import { u as useLocaleDefaults } from "./UseLocaleDefaults-DnL2Ctbe.js";
|
|
4
|
-
import { _ as _sfc_main$1 } from "./Button.vue_vue_type_script_setup_true_lang-
|
|
4
|
+
import { _ as _sfc_main$1 } from "./Button.vue_vue_type_script_setup_true_lang-Cw0QS_Mm.js";
|
|
5
5
|
import { _ as _sfc_main$2 } from "./Icon.vue_vue_type_script_setup_true_lang-Ca4wsJw9.js";
|
|
6
6
|
const _hoisted_1 = ["data-state"];
|
|
7
7
|
const _hoisted_2 = {
|
|
@@ -132,4 +132,4 @@ export {
|
|
|
132
132
|
_sfc_main as _,
|
|
133
133
|
toReference as t
|
|
134
134
|
};
|
|
135
|
-
//# sourceMappingURL=ReportAction.vue_vue_type_script_setup_true_lang-
|
|
135
|
+
//# sourceMappingURL=ReportAction.vue_vue_type_script_setup_true_lang-DCnPCczd.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ReportAction.vue_vue_type_script_setup_true_lang-
|
|
1
|
+
{"version":3,"file":"ReportAction.vue_vue_type_script_setup_true_lang-DCnPCczd.js","sources":["../../src/presentation/feedback/reportAction/ReportAction.vue"],"sourcesContent":["<script lang=\"ts\">\nimport type { ReportReceipt, ReportSend } from '../../../reporting';\n\n/** Defines where a one-click report stands. */\nexport const ReportState = {\n /** Refers to a report not yet sent. */\n Idle: 'idle',\n /** Refers to a report on its way. */\n Sending: 'sending',\n /** Refers to a delivered report — its reference shows. */\n Sent: 'sent',\n /** Refers to a failed delivery — the action offers a retry. */\n Failed: 'failed',\n} as const;\n\nexport type ReportState = (typeof ReportState)[keyof typeof ReportState];\n\nexport interface ReportActionProps {\n /** Sends the report — a captured incident's `send`. A different function resets the action to idle. */\n readonly send: ReportSend;\n /** The label before sending. Default `\"Report\"`. */\n readonly label?: string;\n /** The label while sending. Default `\"Sending…\"`. */\n readonly sendingLabel?: string;\n /** The label once delivered. Default `\"Reported\"`. */\n readonly sentLabel?: string;\n /** The label after a failed delivery. Default `\"Retry\"`. */\n readonly retryLabel?: string;\n /** The status after a failed delivery. Default `\"Couldn't send\"`. */\n readonly failedText?: string;\n /** The word before the delivered report's reference. Default `\"Ref\"`. */\n readonly referenceLabel?: string;\n /** The announcement preceding the reference for assistive technology. Default `\"Report sent.\"`. */\n readonly sentAnnouncement?: string;\n}\n\n/** A GUID receipt id — shortened to its random tail, since a UUID v7's head is its timestamp. */\nconst GuidId = /^[\\da-f]{8}-[\\da-f]{4}-[\\da-f]{4}-[\\da-f]{4}-[\\da-f]{12}$/iu;\n\n/** Shortens a receipt id for display — a GUID's last eight hex digits, upper-cased; any other id as given. */\nexport function toReference(id: string): string {\n return GuidId.test(id) ? id.slice(-8).toUpperCase() : id;\n}\n</script>\n\n<script setup lang=\"ts\">\nimport { computed, shallowRef, watch } from 'vue';\nimport { CircleCheck, Flag, RotateCcw } from 'lucide-vue-next';\nimport { useLocaleDefaults } from '../../../foundation/i18n';\nimport { Icon } from '../../../foundation/icons';\nimport { Button } from '../../actions/button';\n\n/**\n * Renders the one-click Report action a failure notice carries — Report → Sending… → Reported with the\n * receipt's reference, or a Retry when delivery fails. A second click never sends twice.\n *\n * Clicking focuses the button explicitly (Safari does not on its own), so a hosting toast pauses its expiry\n * while the report is in flight; the button stays focusable once sent, keeping that pause until the user\n * moves on. The status region announces the outcome, and the whole action is `data-report-ignore`, so the\n * click that files a report never lands on a trail.\n */\ndefineOptions({ name: 'ReportAction' });\n\nconst componentProps = defineProps<ReportActionProps>();\nconst props = useLocaleDefaults(componentProps, 'ReportAction', {\n label: 'Report',\n sendingLabel: 'Sending…',\n sentLabel: 'Reported',\n retryLabel: 'Retry',\n failedText: \"Couldn't send\",\n referenceLabel: 'Ref',\n sentAnnouncement: 'Report sent.',\n});\n\nconst emit = defineEmits<{\n /** Fires when the report is delivered. */\n sent: [receipt: ReportReceipt];\n /** Fires when delivery fails. */\n failed: [error: unknown];\n}>();\n\nconst state = shallowRef<ReportState>(ReportState.Idle);\nconst receipt = shallowRef<ReportReceipt | null>(null);\n\n/* Bumped per send and per reset, so a late settle from a replaced `send` never lands on the new one. */\nlet run = 0;\n\nwatch(\n () => componentProps.send,\n () => {\n run += 1;\n state.value = ReportState.Idle;\n receipt.value = null;\n },\n);\n\nconst buttonLabel = computed(() => {\n if (state.value === ReportState.Sent) return props.sentLabel;\n if (state.value === ReportState.Failed) return props.retryLabel;\n return props.label;\n});\n\nconst buttonIcon = computed(() => {\n if (state.value === ReportState.Sent) return CircleCheck;\n if (state.value === ReportState.Failed) return RotateCcw;\n return Flag;\n});\n\nasync function onClick(event: MouseEvent): Promise<void> {\n (event.currentTarget as HTMLElement | null)?.focus();\n if (state.value === ReportState.Sending || state.value === ReportState.Sent) return;\n run += 1;\n const current = run;\n state.value = ReportState.Sending;\n try {\n const delivered = await componentProps.send();\n if (current !== run) return;\n receipt.value = delivered;\n state.value = ReportState.Sent;\n emit('sent', delivered);\n } catch (error) {\n if (current !== run) return;\n state.value = ReportState.Failed;\n emit('failed', error);\n }\n}\n</script>\n\n<template>\n <span class=\"inline-flex items-center gap-2\" data-report-ignore :data-state=\"state\">\n <Button\n variant=\"outline\"\n size=\"xs\"\n :is-loading=\"state === ReportState.Sending\"\n :loading-text=\"props.sendingLabel\"\n :aria-disabled=\"state === ReportState.Sent ? 'true' : undefined\"\n @click=\"onClick\"\n >\n <template #leading><Icon :icon=\"buttonIcon\" :size=\"12\" /></template>\n {{ buttonLabel }}\n </Button>\n <span role=\"status\" class=\"text-xs text-muted-foreground\">\n <template v-if=\"state === ReportState.Sent && receipt\">\n <span class=\"sr-only\">{{ props.sentAnnouncement }}</span>\n {{ props.referenceLabel }} <span class=\"font-mono\">{{ toReference(receipt.id) }}</span>\n </template>\n <template v-else-if=\"state === ReportState.Failed\">{{ props.failedText }}</template>\n </span>\n </span>\n</template>\n"],"names":["_createElementBlock","_createVNode","_unref","Button","Icon","_createTextVNode","_createElementVNode","_Fragment","_toDisplayString"],"mappings":";;;;;;;;;;;;AAIO,MAAM,cAAc;AAAA;AAAA,EAEzB,MAAM;AAAA;AAAA,EAEN,SAAS;AAAA;AAAA,EAET,MAAM;AAAA;AAAA,EAEN,QAAQ;AACV;AAwBA,MAAM,SAAS;AAGR,SAAS,YAAY,IAAoB;AAC9C,SAAO,OAAO,KAAK,EAAE,IAAI,GAAG,MAAM,EAAE,EAAE,YAAA,IAAgB;AACxD;;;;;;;;;;;;;;;;AAqBA,UAAM,iBAAiB;AACvB,UAAM,QAAQ,kBAAkB,gBAAgB,gBAAg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AAAC,WAAA,GAAA;AAAA,UATP,SAAQ;AAAA,UACR,MAAK;AAAA,UACJ,cAAY,MAAA,UAAU,YAAY;AAAA,UAClC,gBAAcD,MAAA,KAAA,EAAM;AAAA,UACpB,iBAAe,MAAA,UAAU,YAAY,gBAAgB;AAAA,UACrD;AAAA,QAAA;UAEU,iBAAQ,MAAsC;AAAA,YAAtCD,YAAsCC,MAAAE,WAAA,GAAA;AAAA,cAA/B,MAAM,WAAA;AAAA,cAAa,MAAM;AAAA,YAAA;;2BAAiB,MACpE;AAAA,YADoEC,gBAAA,sBACjE,YAAA,KAAW,GAAA,CAAA;AAAA,UAAA;;;QAEhBC,mBAMO,QANP,YAMO;AAAA,UALW,MAAA,UAAU,YAAY,QAAQ,QAAA,sBAA9CN,mBAGWO,UAAA,EAAA,KAAA,KAAA;AAAA,YAFTD,mBAAyD,QAAzD,YAAyDE,gBAAhCN,MAAA,KAAA,EAAM,gBAAgB,GAAA,CAAA;AAAA,YAAUG,gBAAA,MACzDG,gBAAGN,MAAA,KAAA,EAAM,cAAc,IAAG,KAAC,CAAA;AAAA,YAAAI,mBAA4D,QAA5D,YAA4DE,gBAAjC,YAAY,QAAA,MAAQ,EAAE,CAAA,GAAA,CAAA;AAAA,UAAA,UAEzD,MAAA,UAAU,YAAY,uBAA3CR,mBAAoFO,UAAA,EAAA,KAAA,KAAA;AAAA,YAA9BF,gBAAAG,gBAAAN,MAAA,KAAA,EAAM,UAAU,GAAA,CAAA;AAAA,UAAA;;;;;;"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { T as Tones } from "./Tones-
|
|
1
|
+
import { T as Tones } from "./Tones-Bcz8dIo3.js";
|
|
2
2
|
import { tv } from "tailwind-variants";
|
|
3
3
|
const SurfaceVariant = {
|
|
4
4
|
/** Refers to an opaque fill, no border, light shadow. */
|
|
@@ -153,4 +153,4 @@ export {
|
|
|
153
153
|
SurfaceVariant as S,
|
|
154
154
|
surfaceVariants as s
|
|
155
155
|
};
|
|
156
|
-
//# sourceMappingURL=SurfaceStyles-
|
|
156
|
+
//# sourceMappingURL=SurfaceStyles-BYvRlsWe.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SurfaceStyles-B8KNkFsm.js","sources":["../../src/foundation/styles/SurfaceStyles.ts"],"sourcesContent":["/* Provides the cross-domain surface style engine — variant × tone × radius × padding × elevation. */\n\nimport { tv, type VariantProps } from './Tv';\nimport { Tones } from './constants/Tones';\nimport { Tone } from './enums/StyleTokens';\n\n/** Defines the visual-recipe axis of a surface (solid · soft · surface · outline · glass · etc.). */\nexport const SurfaceVariant = {\n /** Refers to an opaque fill, no border, light shadow. */\n Solid: 'solid',\n /** Refers to a muted/tinted fill, no border, light shadow. */\n Soft: 'soft',\n /** Refers to an opaque fill + visible border + medium shadow. */\n Surface: 'surface',\n /** Refers to an opaque popover fill + stronger border + heavy shadow — open menus, listboxes and popovers. */\n Raised: 'raised',\n /** Refers to a transparent fill + visible border. */\n Outline: 'outline',\n /** Refers to a translucent + blur fill, no border, medium shadow. */\n Glass: 'glass',\n /** Refers to a translucent + blur fill + subtle border. */\n GlassOutline: 'glass-outline',\n /** Refers to an opaque fill, no border, heavy shadow. */\n Elevated: 'elevated',\n /** Refers to an opaque fill, no border, no shadow. */\n Flat: 'flat',\n /** Refers to a low-alpha tinted fill + neutral border, no shadow. */\n Subtle: 'subtle',\n} as const;\n\nexport type SurfaceVariant = (typeof SurfaceVariant)[keyof typeof SurfaceVariant];\n\n/** Provides the tailwind-variants config for every \"block with a visual treatment\" surface. */\nexport const surfaceVariants = tv({\n base: 'outline-hidden transition-colors',\n variants: {\n variant: {\n /* Opaque fill, no border, light shadow — tooltips, chips, inline pills. */\n solid: 'shadow-sm',\n /* Muted/tinted fill, no border, light shadow — chat bubbles, inline groups. */\n soft: 'shadow-sm',\n /* Opaque fill + visible border + medium shadow — cards, panels, toasts. */\n surface: 'border shadow-md',\n /* Opaque popover fill + stronger border + large shadow — the default for floating menus and popovers, so an\n open list reads as raised over the form fields it covers. */\n raised: 'border shadow-lg',\n /* Transparent fill + visible border — static cards, embedded info blocks. */\n outline: 'border bg-transparent',\n /* Translucent + blur, no border, medium shadow — image overlays. */\n glass: 'backdrop-blur-md shadow-md',\n /* Translucent + blur + subtle border — premium / hero overlays. */\n 'glass-outline': 'border backdrop-blur-md shadow-md',\n /* Opaque fill, no border, heavy shadow — modals, drawers, command palette. */\n elevated: 'shadow-xl',\n /* Opaque fill, no border, no shadow — embedded sub-panels inside another surface. */\n flat: '',\n /* Low-alpha tinted fill + neutral border, no shadow — section bands, tinted panels. */\n subtle: 'border',\n },\n\n tone: { neutral: '', primary: '', danger: '', success: '', warning: '', info: '' },\n\n radius: {\n none: 'rounded-none',\n sm: 'rounded-sm',\n md: 'rounded-md',\n lg: 'rounded-lg',\n xl: 'rounded-xl',\n '2xl': 'rounded-2xl',\n full: 'rounded-full',\n },\n\n padding: {\n none: 'p-0',\n xs: 'p-1',\n sm: 'p-2',\n md: 'p-3',\n lg: 'p-4',\n xl: 'p-6',\n '2xl': 'p-8',\n },\n\n /* Optional shadow override — beats variant's default shadow via tailwind-merge precedence. */\n elevation: {\n 0: 'shadow-none',\n 1: 'shadow-sm',\n 2: 'shadow-md',\n 3: 'shadow-lg',\n 4: 'shadow-xl',\n 5: 'shadow-2xl',\n },\n\n /* Optional ambient treatment — layers over the variant's bg-color/shadow. */\n ambient: {\n none: '',\n sheen: 'surface-sheen',\n glow: 'surface-glow',\n bevel: 'surface-bevel',\n },\n },\n\n compoundVariants: [\n /* solid / elevated / flat share the same palette — opaque tone bg + tone foreground. */\n { variant: ['solid', 'elevated', 'flat'], tone: 'neutral', class: Tones.solid.neutral },\n { variant: ['solid', 'elevated', 'flat'], tone: 'primary', class: Tones.solid.primary },\n { variant: ['solid', 'elevated', 'flat'], tone: 'danger', class: Tones.solid.danger },\n { variant: ['solid', 'elevated', 'flat'], tone: 'success', class: Tones.solid.success },\n { variant: ['solid', 'elevated', 'flat'], tone: 'warning', class: Tones.solid.warning },\n { variant: ['solid', 'elevated', 'flat'], tone: 'info', class: Tones.solid.info },\n\n /* soft — muted/tinted bg, tone-readable text. */\n { variant: 'soft', tone: 'neutral', class: Tones.soft.neutral },\n { variant: 'soft', tone: 'primary', class: Tones.soft.primary },\n { variant: 'soft', tone: 'danger', class: Tones.soft.danger },\n { variant: 'soft', tone: 'success', class: Tones.soft.success },\n { variant: 'soft', tone: 'warning', class: Tones.soft.warning },\n { variant: 'soft', tone: 'info', class: Tones.soft.info },\n\n /* surface — popover bg + tone-accent border. */\n { variant: 'surface', tone: 'neutral', class: Tones.surface.neutral },\n { variant: 'surface', tone: 'primary', class: Tones.surface.primary },\n { variant: 'surface', tone: 'danger', class: Tones.surface.danger },\n { variant: 'surface', tone: 'success', class: Tones.surface.success },\n { variant: 'surface', tone: 'warning', class: Tones.surface.warning },\n { variant: 'surface', tone: 'info', class: Tones.surface.info },\n\n /* raised — popover bg + stronger tone border. */\n { variant: 'raised', tone: 'neutral', class: Tones.raised.neutral },\n { variant: 'raised', tone: 'primary', class: Tones.raised.primary },\n { variant: 'raised', tone: 'danger', class: Tones.raised.danger },\n { variant: 'raised', tone: 'success', class: Tones.raised.success },\n { variant: 'raised', tone: 'warning', class: Tones.raised.warning },\n { variant: 'raised', tone: 'info', class: Tones.raised.info },\n\n /* outline — transparent fill, tone border + tone text. */\n { variant: 'outline', tone: 'neutral', class: Tones.outline.neutral },\n { variant: 'outline', tone: 'primary', class: Tones.outline.primary },\n { variant: 'outline', tone: 'danger', class: Tones.outline.danger },\n { variant: 'outline', tone: 'success', class: Tones.outline.success },\n { variant: 'outline', tone: 'warning', class: Tones.outline.warning },\n { variant: 'outline', tone: 'info', class: Tones.outline.info },\n\n /* glass — translucent tinted fill + blur. */\n { variant: 'glass', tone: 'neutral', class: Tones.glass.neutral },\n { variant: 'glass', tone: 'primary', class: Tones.glass.primary },\n { variant: 'glass', tone: 'danger', class: Tones.glass.danger },\n { variant: 'glass', tone: 'success', class: Tones.glass.success },\n { variant: 'glass', tone: 'warning', class: Tones.glass.warning },\n { variant: 'glass', tone: 'info', class: Tones.glass.info },\n\n /* glass-outline — glass + tone border at 50% alpha. */\n { variant: 'glass-outline', tone: 'neutral', class: Tones.glassOutline.neutral },\n { variant: 'glass-outline', tone: 'primary', class: Tones.glassOutline.primary },\n { variant: 'glass-outline', tone: 'danger', class: Tones.glassOutline.danger },\n { variant: 'glass-outline', tone: 'success', class: Tones.glassOutline.success },\n { variant: 'glass-outline', tone: 'warning', class: Tones.glassOutline.warning },\n { variant: 'glass-outline', tone: 'info', class: Tones.glassOutline.info },\n\n /* subtle — low-alpha tinted fill + neutral border, no shadow. */\n { variant: 'subtle', tone: 'neutral', class: Tones.subtle.neutral },\n { variant: 'subtle', tone: 'primary', class: Tones.subtle.primary },\n { variant: 'subtle', tone: 'danger', class: Tones.subtle.danger },\n { variant: 'subtle', tone: 'success', class: Tones.subtle.success },\n { variant: 'subtle', tone: 'warning', class: Tones.subtle.warning },\n { variant: 'subtle', tone: 'info', class: Tones.subtle.info },\n ],\n\n defaultVariants: {\n variant: 'surface',\n tone: 'neutral',\n radius: 'md',\n padding: 'none',\n },\n});\n\n/** Represents the union of every surface variant prop. */\nexport type SurfaceVariants = VariantProps<typeof surfaceVariants>;\n\n/* Compile-time lock: enum values ≡ tv variant/tone value-sets (drift = type error). */\ntype AssertExact<A, B> = [A] extends [B] ? ([B] extends [A] ? true : never) : never;\nconst _assertSurfaceVariant: AssertExact<\n SurfaceVariant,\n NonNullable<VariantProps<typeof surfaceVariants>['variant']>\n> = true;\nconst _assertSurfaceTone: AssertExact<SurfaceTone, NonNullable<VariantProps<typeof surfaceVariants>['tone']>> = true;\nvoid _assertSurfaceVariant;\nvoid _assertSurfaceTone;\n\n/** Represents the semantic colour axis — the shared `Tone` (neutral · primary · danger · success · warning · info). */\nexport type SurfaceTone = Tone;\n\n/** Represents the corner-roundness axis (none · sm · md · lg · xl · 2xl · full). */\nexport type SurfaceRadius = NonNullable<SurfaceVariants['radius']>;\n\n/** Represents the interior-padding axis (none · xs · sm · md · lg · xl · 2xl). */\nexport type SurfacePadding = NonNullable<SurfaceVariants['padding']>;\n\n/** Represents the shadow-depth override (0–5); omitted means the variant decides. */\nexport type SurfaceElevation = NonNullable<SurfaceVariants['elevation']>;\n\n/** Represents the optional ambient treatment (none · sheen · glow · bevel); omitted = none. */\nexport type SurfaceAmbient = NonNullable<SurfaceVariants['ambient']>;\n"],"names":[],"mappings":";;AAOO,MAAM,iBAAiB;AAAA;AAAA,EAE5B,OAAO;AAAA;AAAA,EAEP,MAAM;AAAA;AAAA,EAEN,SAAS;AAAA;AAAA,EAET,QAAQ;AAAA;AAAA,EAER,SAAS;AAAA;AAAA,EAET,OAAO;AAAA;AAAA,EAEP,cAAc;AAAA;AAAA,EAEd,UAAU;AAAA;AAAA,EAEV,MAAM;AAAA;AAAA,EAEN,QAAQ;AACV;AAKO,MAAM,kBAAkB,GAAG;AAAA,EAChC,MAAM;AAAA,EACN,UAAU;AAAA,IACR,SAAS;AAAA;AAAA,MAEP,OAAO;AAAA;AAAA,MAEP,MAAM;AAAA;AAAA,MAEN,SAAS;AAAA;AAAA;AAAA,MAGT,QAAQ;AAAA;AAAA,MAER,SAAS;AAAA;AAAA,MAET,OAAO;AAAA;AAAA,MAEP,iBAAiB;AAAA;AAAA,MAEjB,UAAU;AAAA;AAAA,MAEV,MAAM;AAAA;AAAA,MAEN,QAAQ;AAAA,IAAA;AAAA,IAGV,MAAM,EAAE,SAAS,IAAI,SAAS,IAAI,QAAQ,IAAI,SAAS,IAAI,SAAS,IAAI,MAAM,GAAA;AAAA,IAE9E,QAAQ;AAAA,MACN,MAAM;AAAA,MACN,IAAI;AAAA,MACJ,IAAI;AAAA,MACJ,IAAI;AAAA,MACJ,IAAI;AAAA,MACJ,OAAO;AAAA,MACP,MAAM;AAAA,IAAA;AAAA,IAGR,SAAS;AAAA,MACP,MAAM;AAAA,MACN,IAAI;AAAA,MACJ,IAAI;AAAA,MAC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AAM,WAAW,OAAO,MAAM,OAAO,QAAA;AAAA,IAC1D,EAAE,SAAS,UAAU,MAAM,QAAQ,OAAO,MAAM,OAAO,KAAA;AAAA,EAAK;AAAA,EAG9D,iBAAiB;AAAA,IACf,SAAS;AAAA,IACT,MAAM;AAAA,IACN,QAAQ;AAAA,IACR,SAAS;AAAA,EAAA;AAEb,CAAC;"}
|
|
1
|
+
{"version":3,"file":"SurfaceStyles-BYvRlsWe.js","sources":["../../src/foundation/styles/SurfaceStyles.ts"],"sourcesContent":["/* Provides the cross-domain surface style engine — variant × tone × radius × padding × elevation. */\n\nimport { tv, type VariantProps } from './Tv';\nimport { Tones } from './constants/Tones';\nimport { Tone } from './enums/StyleTokens';\n\n/** Defines the visual-recipe axis of a surface (solid · soft · surface · outline · glass · etc.). */\nexport const SurfaceVariant = {\n /** Refers to an opaque fill, no border, light shadow. */\n Solid: 'solid',\n /** Refers to a muted/tinted fill, no border, light shadow. */\n Soft: 'soft',\n /** Refers to an opaque fill + visible border + medium shadow. */\n Surface: 'surface',\n /** Refers to an opaque popover fill + stronger border + heavy shadow — open menus, listboxes and popovers. */\n Raised: 'raised',\n /** Refers to a transparent fill + visible border. */\n Outline: 'outline',\n /** Refers to a translucent + blur fill, no border, medium shadow. */\n Glass: 'glass',\n /** Refers to a translucent + blur fill + subtle border. */\n GlassOutline: 'glass-outline',\n /** Refers to an opaque fill, no border, heavy shadow. */\n Elevated: 'elevated',\n /** Refers to an opaque fill, no border, no shadow. */\n Flat: 'flat',\n /** Refers to a low-alpha tinted fill + neutral border, no shadow. */\n Subtle: 'subtle',\n} as const;\n\nexport type SurfaceVariant = (typeof SurfaceVariant)[keyof typeof SurfaceVariant];\n\n/** Provides the tailwind-variants config for every \"block with a visual treatment\" surface. */\nexport const surfaceVariants = tv({\n base: 'outline-hidden transition-colors',\n variants: {\n variant: {\n /* Opaque fill, no border, light shadow — tooltips, chips, inline pills. */\n solid: 'shadow-sm',\n /* Muted/tinted fill, no border, light shadow — chat bubbles, inline groups. */\n soft: 'shadow-sm',\n /* Opaque fill + visible border + medium shadow — cards, panels, toasts. */\n surface: 'border shadow-md',\n /* Opaque popover fill + stronger border + large shadow — the default for floating menus and popovers, so an\n open list reads as raised over the form fields it covers. */\n raised: 'border shadow-lg',\n /* Transparent fill + visible border — static cards, embedded info blocks. */\n outline: 'border bg-transparent',\n /* Translucent + blur, no border, medium shadow — image overlays. */\n glass: 'backdrop-blur-md shadow-md',\n /* Translucent + blur + subtle border — premium / hero overlays. */\n 'glass-outline': 'border backdrop-blur-md shadow-md',\n /* Opaque fill, no border, heavy shadow — modals, drawers, command palette. */\n elevated: 'shadow-xl',\n /* Opaque fill, no border, no shadow — embedded sub-panels inside another surface. */\n flat: '',\n /* Low-alpha tinted fill + neutral border, no shadow — section bands, tinted panels. */\n subtle: 'border',\n },\n\n tone: { neutral: '', primary: '', danger: '', success: '', warning: '', info: '' },\n\n radius: {\n none: 'rounded-none',\n sm: 'rounded-sm',\n md: 'rounded-md',\n lg: 'rounded-lg',\n xl: 'rounded-xl',\n '2xl': 'rounded-2xl',\n full: 'rounded-full',\n },\n\n padding: {\n none: 'p-0',\n xs: 'p-1',\n sm: 'p-2',\n md: 'p-3',\n lg: 'p-4',\n xl: 'p-6',\n '2xl': 'p-8',\n },\n\n /* Optional shadow override — beats variant's default shadow via tailwind-merge precedence. */\n elevation: {\n 0: 'shadow-none',\n 1: 'shadow-sm',\n 2: 'shadow-md',\n 3: 'shadow-lg',\n 4: 'shadow-xl',\n 5: 'shadow-2xl',\n },\n\n /* Optional ambient treatment — layers over the variant's bg-color/shadow. */\n ambient: {\n none: '',\n sheen: 'surface-sheen',\n glow: 'surface-glow',\n bevel: 'surface-bevel',\n },\n },\n\n compoundVariants: [\n /* solid / elevated / flat share the same palette — opaque tone bg + tone foreground. */\n { variant: ['solid', 'elevated', 'flat'], tone: 'neutral', class: Tones.solid.neutral },\n { variant: ['solid', 'elevated', 'flat'], tone: 'primary', class: Tones.solid.primary },\n { variant: ['solid', 'elevated', 'flat'], tone: 'danger', class: Tones.solid.danger },\n { variant: ['solid', 'elevated', 'flat'], tone: 'success', class: Tones.solid.success },\n { variant: ['solid', 'elevated', 'flat'], tone: 'warning', class: Tones.solid.warning },\n { variant: ['solid', 'elevated', 'flat'], tone: 'info', class: Tones.solid.info },\n\n /* soft — muted/tinted bg, tone-readable text. */\n { variant: 'soft', tone: 'neutral', class: Tones.soft.neutral },\n { variant: 'soft', tone: 'primary', class: Tones.soft.primary },\n { variant: 'soft', tone: 'danger', class: Tones.soft.danger },\n { variant: 'soft', tone: 'success', class: Tones.soft.success },\n { variant: 'soft', tone: 'warning', class: Tones.soft.warning },\n { variant: 'soft', tone: 'info', class: Tones.soft.info },\n\n /* surface — popover bg + tone-accent border. */\n { variant: 'surface', tone: 'neutral', class: Tones.surface.neutral },\n { variant: 'surface', tone: 'primary', class: Tones.surface.primary },\n { variant: 'surface', tone: 'danger', class: Tones.surface.danger },\n { variant: 'surface', tone: 'success', class: Tones.surface.success },\n { variant: 'surface', tone: 'warning', class: Tones.surface.warning },\n { variant: 'surface', tone: 'info', class: Tones.surface.info },\n\n /* raised — popover bg + stronger tone border. */\n { variant: 'raised', tone: 'neutral', class: Tones.raised.neutral },\n { variant: 'raised', tone: 'primary', class: Tones.raised.primary },\n { variant: 'raised', tone: 'danger', class: Tones.raised.danger },\n { variant: 'raised', tone: 'success', class: Tones.raised.success },\n { variant: 'raised', tone: 'warning', class: Tones.raised.warning },\n { variant: 'raised', tone: 'info', class: Tones.raised.info },\n\n /* outline — transparent fill, tone border + tone text. */\n { variant: 'outline', tone: 'neutral', class: Tones.outline.neutral },\n { variant: 'outline', tone: 'primary', class: Tones.outline.primary },\n { variant: 'outline', tone: 'danger', class: Tones.outline.danger },\n { variant: 'outline', tone: 'success', class: Tones.outline.success },\n { variant: 'outline', tone: 'warning', class: Tones.outline.warning },\n { variant: 'outline', tone: 'info', class: Tones.outline.info },\n\n /* glass — translucent tinted fill + blur. */\n { variant: 'glass', tone: 'neutral', class: Tones.glass.neutral },\n { variant: 'glass', tone: 'primary', class: Tones.glass.primary },\n { variant: 'glass', tone: 'danger', class: Tones.glass.danger },\n { variant: 'glass', tone: 'success', class: Tones.glass.success },\n { variant: 'glass', tone: 'warning', class: Tones.glass.warning },\n { variant: 'glass', tone: 'info', class: Tones.glass.info },\n\n /* glass-outline — glass + tone border at 50% alpha. */\n { variant: 'glass-outline', tone: 'neutral', class: Tones.glassOutline.neutral },\n { variant: 'glass-outline', tone: 'primary', class: Tones.glassOutline.primary },\n { variant: 'glass-outline', tone: 'danger', class: Tones.glassOutline.danger },\n { variant: 'glass-outline', tone: 'success', class: Tones.glassOutline.success },\n { variant: 'glass-outline', tone: 'warning', class: Tones.glassOutline.warning },\n { variant: 'glass-outline', tone: 'info', class: Tones.glassOutline.info },\n\n /* subtle — low-alpha tinted fill + neutral border, no shadow. */\n { variant: 'subtle', tone: 'neutral', class: Tones.subtle.neutral },\n { variant: 'subtle', tone: 'primary', class: Tones.subtle.primary },\n { variant: 'subtle', tone: 'danger', class: Tones.subtle.danger },\n { variant: 'subtle', tone: 'success', class: Tones.subtle.success },\n { variant: 'subtle', tone: 'warning', class: Tones.subtle.warning },\n { variant: 'subtle', tone: 'info', class: Tones.subtle.info },\n ],\n\n defaultVariants: {\n variant: 'surface',\n tone: 'neutral',\n radius: 'md',\n padding: 'none',\n },\n});\n\n/** Represents the union of every surface variant prop. */\nexport type SurfaceVariants = VariantProps<typeof surfaceVariants>;\n\n/* Compile-time lock: enum values ≡ tv variant/tone value-sets (drift = type error). */\ntype AssertExact<A, B> = [A] extends [B] ? ([B] extends [A] ? true : never) : never;\nconst _assertSurfaceVariant: AssertExact<\n SurfaceVariant,\n NonNullable<VariantProps<typeof surfaceVariants>['variant']>\n> = true;\nconst _assertSurfaceTone: AssertExact<SurfaceTone, NonNullable<VariantProps<typeof surfaceVariants>['tone']>> = true;\nvoid _assertSurfaceVariant;\nvoid _assertSurfaceTone;\n\n/** Represents the semantic colour axis — the shared `Tone` (neutral · primary · danger · success · warning · info). */\nexport type SurfaceTone = Tone;\n\n/** Represents the corner-roundness axis (none · sm · md · lg · xl · 2xl · full). */\nexport type SurfaceRadius = NonNullable<SurfaceVariants['radius']>;\n\n/** Represents the interior-padding axis (none · xs · sm · md · lg · xl · 2xl). */\nexport type SurfacePadding = NonNullable<SurfaceVariants['padding']>;\n\n/** Represents the shadow-depth override (0–5); omitted means the variant decides. */\nexport type SurfaceElevation = NonNullable<SurfaceVariants['elevation']>;\n\n/** Represents the optional ambient treatment (none · sheen · glow · bevel); omitted = none. */\nexport type SurfaceAmbient = NonNullable<SurfaceVariants['ambient']>;\n"],"names":[],"mappings":";;AAOO,MAAM,iBAAiB;AAAA;AAAA,EAE5B,OAAO;AAAA;AAAA,EAEP,MAAM;AAAA;AAAA,EAEN,SAAS;AAAA;AAAA,EAET,QAAQ;AAAA;AAAA,EAER,SAAS;AAAA;AAAA,EAET,OAAO;AAAA;AAAA,EAEP,cAAc;AAAA;AAAA,EAEd,UAAU;AAAA;AAAA,EAEV,MAAM;AAAA;AAAA,EAEN,QAAQ;AACV;AAKO,MAAM,kBAAkB,GAAG;AAAA,EAChC,MAAM;AAAA,EACN,UAAU;AAAA,IACR,SAAS;AAAA;AAAA,MAEP,OAAO;AAAA;AAAA,MAEP,MAAM;AAAA;AAAA,MAEN,SAAS;AAAA;AAAA;AAAA,MAGT,QAAQ;AAAA;AAAA,MAER,SAAS;AAAA;AAAA,MAET,OAAO;AAAA;AAAA,MAEP,iBAAiB;AAAA;AAAA,MAEjB,UAAU;AAAA;AAAA,MAEV,MAAM;AAAA;AAAA,MAEN,QAAQ;AAAA,IAAA;AAAA,IAGV,MAAM,EAAE,SAAS,IAAI,SAAS,IAAI,QAAQ,IAAI,SAAS,IAAI,SAAS,IAAI,MAAM,GAAA;AAAA,IAE9E,QAAQ;AAAA,MACN,MAAM;AAAA,MACN,IAAI;AAAA,MACJ,IAAI;AAAA,MACJ,IAAI;AAAA,MACJ,IAA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AAU,OAAO,MAAM,OAAO,OAAA;AAAA,IACzD,EAAE,SAAS,UAAU,MAAM,WAAW,OAAO,MAAM,OAAO,QAAA;AAAA,IAC1D,EAAE,SAAS,UAAU,MAAM,WAAW,OAAO,MAAM,OAAO,QAAA;AAAA,IAC1D,EAAE,SAAS,UAAU,MAAM,QAAQ,OAAO,MAAM,OAAO,KAAA;AAAA,EAAK;AAAA,EAG9D,iBAAiB;AAAA,IACf,SAAS;AAAA,IACT,MAAM;AAAA,IACN,QAAQ;AAAA,IACR,SAAS;AAAA,EAAA;AAEb,CAAC;"}
|
|
@@ -6,9 +6,9 @@ import { u as useLocaleDefaults } from "./UseLocaleDefaults-DnL2Ctbe.js";
|
|
|
6
6
|
import { Trash2, X } from "lucide-vue-next";
|
|
7
7
|
import { S as Severity } from "./Severity-D0C5oAt-.js";
|
|
8
8
|
import { a as SeverityIcons, S as SeverityIconClasses } from "./SeverityIcons-KuC3ZBkI.js";
|
|
9
|
-
import { s as surfaceVariants } from "./SurfaceStyles-
|
|
9
|
+
import { s as surfaceVariants } from "./SurfaceStyles-BYvRlsWe.js";
|
|
10
10
|
import { _ as _sfc_main$3 } from "./Icon.vue_vue_type_script_setup_true_lang-Ca4wsJw9.js";
|
|
11
|
-
import { _ as _sfc_main$5 } from "./ReportAction.vue_vue_type_script_setup_true_lang-
|
|
11
|
+
import { _ as _sfc_main$5 } from "./ReportAction.vue_vue_type_script_setup_true_lang-DCnPCczd.js";
|
|
12
12
|
import { _ as _sfc_main$4 } from "./Portal.vue_vue_type_script_setup_true_lang-C2_xSIMy.js";
|
|
13
13
|
import { P as Presence } from "./Presence-DDk0ZtAr.js";
|
|
14
14
|
import { _ as _sfc_main$6 } from "./Announce.vue_vue_type_script_setup_true_lang-DbqODft3.js";
|
|
@@ -717,4 +717,4 @@ export {
|
|
|
717
717
|
toastHost as t,
|
|
718
718
|
useToastHost as u
|
|
719
719
|
};
|
|
720
|
-
//# sourceMappingURL=ToastHost.vue_vue_type_script_setup_true_lang-
|
|
720
|
+
//# sourceMappingURL=ToastHost.vue_vue_type_script_setup_true_lang-J1ZPZXn3.js.map
|