@wow-two-beta/fe 0.0.24 → 0.0.26

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +0,0 @@
1
- {"version":3,"file":"BackToTopButton.vue_vue_type_script_setup_true_lang-dge5C6We.js","sources":["../../src/presentation/actions/buttonGroup/ButtonGroup.vue","../../src/presentation/actions/fabButton/FabButton.variants.ts","../../src/presentation/actions/fabButton/FabButton.vue","../../src/presentation/actions/copyButton/CopyButton.vue","../../src/presentation/actions/googleSignInButton/GoogleSignInButton.vue","../../src/presentation/actions/disclosureButton/DisclosureButton.vue","../../src/presentation/actions/toolbar/ToolbarContext.ts","../../src/presentation/actions/toolbar/Toolbar.vue","../../src/presentation/actions/toolbar/ToolbarButton.vue","../../src/presentation/actions/toolbar/ToolbarLink.vue","../../src/presentation/actions/toolbar/ToolbarSeparator.vue","../../src/presentation/actions/toolbar/index.ts","../../src/presentation/actions/speedDialGroup/SpeedDialGroupContext.ts","../../src/presentation/actions/speedDialGroup/SpeedDialGroupList.vue","../../src/presentation/actions/speedDialGroup/SpeedDialGroupTrigger.vue","../../src/presentation/actions/speedDialGroup/SpeedDialGroup.vue","../../src/presentation/actions/speedDialGroup/SpeedDialGroupAction.vue","../../src/presentation/actions/speedDialGroup/index.ts","../../src/presentation/actions/backToTopButton/BackToTopButton.vue"],"sourcesContent":["<script lang=\"ts\">\nimport type { HTMLAttributes } from 'vue';\nimport type { Orientation } from '../../../foundation/styles';\n\n/* Native div attributes stay in attribute fallthrough rather than becoming runtime props. */\nexport interface ButtonGroupProps extends /* @vue-ignore */ HTMLAttributes {\n /** The visual orientation. Default `horizontal`. */\n readonly orientation?: Orientation;\n\n /** The attached state — groups children with collapsed inner radii (connected look). Default `true`. */\n readonly isAttached?: boolean;\n}\n</script>\n\n<script setup lang=\"ts\">\nimport { computed, useAttrs, useTemplateRef } from 'vue';\nimport type { ClassValue } from 'clsx';\nimport { cn, Orientation as OrientationValue } from '../../../foundation/styles';\n\n/* `inheritAttrs: false` so `class` folds into the component's own `cn()` call — plain fallthrough\n appends outside it and loses tailwind-merge conflict resolution. */\n/** Renders a row or column of related buttons, collapsing their inner radii into one connected control. */\ndefineOptions({ name: 'ButtonGroup', inheritAttrs: false });\n\nconst props = withDefaults(defineProps<ButtonGroupProps>(), {\n orientation: OrientationValue.Horizontal,\n isAttached: true,\n});\n\ndefineSlots<{\n /** The buttons the group lays out and joins into one connected control. */\n default(): unknown;\n}>();\n\nconst attrs = useAttrs();\n\nconst OwnedAttributes: ReadonlySet<string> = new Set(['class']);\nconst passthroughAttrs = computed(() =>\n Object.fromEntries(Object.entries(attrs).filter(([key]) => !OwnedAttributes.has(key))),\n);\n\nconst isHorizontal = computed(() => props.orientation === OrientationValue.Horizontal);\n\nconst rootClass = computed(() =>\n cn(\n 'inline-flex',\n isHorizontal.value ? 'flex-row' : 'flex-col',\n props.isAttached\n ? isHorizontal.value\n ? '[&>*]:rounded-none [&>*:first-child]:rounded-l-md [&>*:last-child]:rounded-r-md [&>*:not(:first-child)]:-ml-px'\n : '[&>*]:rounded-none [&>*:first-child]:rounded-t-md [&>*:last-child]:rounded-b-md [&>*:not(:first-child)]:-mt-px'\n : 'gap-2',\n attrs.class as ClassValue,\n ),\n);\n\nconst root = useTemplateRef<HTMLDivElement>('root');\n\n/** The rendered element — the Vue stand-in for the React original's forwarded ref. */\ndefineExpose({ el: root });\n</script>\n\n<template>\n <!-- Visually groups action-children — collapses inner radii when `isAttached`. -->\n <div ref=\"root\" role=\"group\" :data-orientation=\"orientation\" :class=\"rootClass\" v-bind=\"passthroughAttrs\">\n <slot />\n </div>\n</template>\n","import { tv, OverlayPosition, type VariantProps } from '../../../foundation/styles';\n\n/** Defines the FabButton's visual surface style. */\nexport const FabButtonVariant = {\n /** Refers to the primary brand-filled surface. */\n Primary: 'primary',\n /** Refers to the neutral card surface with a hairline border. */\n Secondary: 'secondary',\n /** Refers to the destructive / error-filled surface. */\n Destructive: 'destructive',\n} as const;\n\nexport type FabButtonVariant = (typeof FabButtonVariant)[keyof typeof FabButtonVariant];\n\n/** Defines the FabButton's diameter. */\nexport const FabButtonSize = {\n /** Refers to the small (2.5rem) diameter. */\n Sm: 'sm',\n /** Refers to the medium (3.5rem) default diameter. */\n Md: 'md',\n /** Refers to the large (4rem) diameter. */\n Lg: 'lg',\n} as const;\n\nexport type FabButtonSize = (typeof FabButtonSize)[keyof typeof FabButtonSize];\n\nexport const fabVariants = tv({\n base: 'fixed inline-flex items-center justify-center rounded-full shadow-lg transition-all hover:shadow-xl focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50',\n variants: {\n variant: {\n primary: 'bg-primary text-primary-foreground hover:bg-primary/90',\n secondary: 'bg-card text-card-foreground border border-border hover:bg-muted',\n destructive: 'bg-destructive text-destructive-foreground hover:bg-destructive/90',\n },\n size: {\n sm: 'h-10 w-10',\n md: 'h-14 w-14',\n lg: 'h-16 w-16',\n },\n position: {\n 'bottom-right': 'bottom-6 right-6',\n 'bottom-left': 'bottom-6 left-6',\n 'bottom-center': 'bottom-6 left-1/2 -translate-x-1/2',\n 'top-right': 'top-6 right-6',\n 'top-left': 'top-6 left-6',\n 'top-center': 'top-6 left-1/2 -translate-x-1/2',\n },\n },\n defaultVariants: {\n variant: 'primary',\n size: 'md',\n position: 'bottom-right',\n },\n});\n\nexport type FabButtonVariants = VariantProps<typeof fabVariants>;\n\n/* Compile-time lock: enum values ≡ tv axis keys (drift = type error). */\ntype AssertExact<A, B> = [A] extends [B] ? ([B] extends [A] ? true : never) : never;\nconst _assertFabVariant: AssertExact<FabButtonVariant, NonNullable<FabButtonVariants['variant']>> = true;\nconst _assertFabSize: AssertExact<FabButtonSize, NonNullable<FabButtonVariants['size']>> = true;\nconst _assertFabPosition: AssertExact<OverlayPosition, NonNullable<FabButtonVariants['position']>> = true;\nvoid _assertFabVariant;\nvoid _assertFabSize;\nvoid _assertFabPosition;\n","<script lang=\"ts\">\nimport type { ButtonHTMLAttributes } from 'vue';\nimport { AriaAttribute } from '../../../foundation/dom';\nimport { type OverlayPosition } from '../../../foundation/styles';\nimport type { FabButtonVariants, FabButtonVariant, FabButtonSize } from './FabButton.variants';\n\n/** @internal An attribute name this component derives or requires. */\ntype RequiredAttribute = typeof AriaAttribute.Label;\n\n/* The required accessible label rides on the ignored heritage rather than the body — FabButton content\n is typically icon-only, so the name is mandatory, but it must reach the DOM as an attribute. */\ntype FabButtonAttributes = ButtonHTMLAttributes & Record<RequiredAttribute, string>;\n\n/* Both heritage types are `@vue-ignore`d — native button attributes belong in attribute\n fallthrough, and `FabButtonVariants` resolves through `typeof fabVariants`, which the SFC prop\n compiler cannot walk. */\ntype FabButtonBase = FabButtonAttributes & Omit<FabButtonVariants, 'variant' | 'size' | 'position'>;\n\nexport interface FabButtonProps extends /* @vue-ignore */ FabButtonBase {\n /** The visual surface style. */\n readonly variant?: FabButtonVariant;\n /** The button diameter. */\n readonly size?: FabButtonSize;\n /** The anchor position on the viewport. */\n readonly position?: OverlayPosition;\n /** The button type. Default `ButtonType.Button`. */\n readonly type?: ButtonType;\n}\n</script>\n\n<script setup lang=\"ts\">\nimport { computed, useAttrs, useTemplateRef } from 'vue';\nimport type { ClassValue } from 'clsx';\nimport { ButtonType } from '../../../foundation/dom';\nimport { cn } from '../../../foundation/styles';\nimport { fabVariants } from './FabButton.variants';\n\n/* `inheritAttrs: false` so `class` folds into the component's own `cn()` call — plain fallthrough\n appends outside it and loses tailwind-merge conflict resolution. */\n/** Renders a floating action button — a circular, shadowed control pinned to a corner of the viewport. */\ndefineOptions({ name: 'FabButton', inheritAttrs: false });\n\n/* `aria-label` is deliberately NOT a declared prop: Vue camelizes prop keys, so a declared\n `'aria-label'` would arrive as `props.ariaLabel` and never render. It stays a fallthrough attr;\n the interface keeps the requirement through the `@vue-ignore`d heritage. */\n/* `children` has no prop counterpart — it is the default slot. */\nconst props = withDefaults(defineProps<FabButtonProps>(), { type: ButtonType.Button });\n\ndefineSlots<{\n /** The button's content — typically a single icon. */\n default(): unknown;\n}>();\n\nconst attrs = useAttrs();\n\nconst OwnedAttributes: ReadonlySet<string> = new Set(['class']);\nconst passthroughAttrs = computed(() =>\n Object.fromEntries(Object.entries(attrs).filter(([key]) => !OwnedAttributes.has(key))),\n);\n\nconst rootClass = computed(() =>\n cn(fabVariants({ variant: props.variant, size: props.size, position: props.position }), attrs.class as ClassValue),\n);\n\nconst root = useTemplateRef<HTMLButtonElement>('root');\n\n/** The rendered element — the Vue stand-in for the React original's forwarded ref. */\ndefineExpose({ el: root });\n</script>\n\n<template>\n <!-- Floating Action Button — fixed-position circular button with shadow. -->\n <button ref=\"root\" :type=\"type\" :class=\"rootClass\" v-bind=\"passthroughAttrs\">\n <slot />\n </button>\n</template>\n","<script lang=\"ts\">\nimport { AriaAttribute, DomEvent, type HandlerProp } from '../../../foundation/dom';\nimport type { ButtonProps } from '../button';\n\n/** @internal The attributes this component renders itself rather than forwarding. */\nconst OwnedAttributes = [AriaAttribute.Label] as const;\n\n/** @internal An attribute name from {@link OwnedAttributes}. */\ntype OwnedAttribute = (typeof OwnedAttributes)[number];\n\n/** @internal The `ButtonProps` handler this component replaces with its own emit. */\ntype ReplacedButtonProp = keyof Pick<ButtonProps, HandlerProp<typeof DomEvent.Error>>;\n\n/** Defines the forwarded `ButtonProps`, with the owned attributes re-added as required. */\ntype CopyButtonAttributes = Omit<ButtonProps, ReplacedButtonProp | OwnedAttribute> & Record<OwnedAttribute, string>;\n\n/** Defines props for the clipboard-copy button. */\nexport interface CopyButtonProps extends /* @vue-ignore */ CopyButtonAttributes {\n /** The text to copy when the button is activated. */\n readonly text: string;\n\n /** The reset window for the `copied` state in ms. Default 2000. Set 0 to hold `copied` until the next mount. */\n readonly resetAfter?: number;\n\n /** The accessible name to announce while `copied` is true. Falls back to `aria-label` when omitted. */\n readonly copiedAriaLabel?: string;\n\n /** The visual surface style. Default `ghost`. */\n readonly variant?: ButtonVariant;\n}\n</script>\n\n<script setup lang=\"ts\">\nimport { computed, useAttrs, watch } from 'vue';\nimport { Check, Copy } from 'lucide-vue-next';\n\nimport { Icon } from '../../../foundation/icons';\nimport { useClipboard } from '../../../foundation/clipboard';\nimport { AttributeValue } from '../../../foundation/dom';\nimport { OptionalExtensions } from '../../../foundation/optionals';\nimport Button from '../button/Button.vue';\nimport { ButtonVariant } from '../button';\n\n/** Renders a clipboard-copy button — for code blocks, ID / URL fields, and inline copy affordances. */\ndefineOptions({ name: 'CopyButton', inheritAttrs: false });\n\nconst props = withDefaults(defineProps<CopyButtonProps>(), {\n resetAfter: 2000,\n variant: ButtonVariant.Ghost,\n});\n\nconst emit = defineEmits<{\n /** Fires when `navigator.clipboard.writeText` rejects, once per error transition. */\n error: [error: Error];\n}>();\n\nconst slots = defineSlots<{\n /** The content — receives `{ copied, error }` for a state-driven swap. Icon-only Copy/Check when omitted. */\n default?: (props: { copied: boolean; error: Error | null }) => unknown;\n}>();\n\n/** @internal {@link OwnedAttributes} as a lookup, for filtering the fallthrough set. */\nconst OwnedAttributeLookup: ReadonlySet<string> = new Set(OwnedAttributes);\n\nconst attrs = useAttrs();\n\nconst { copied, error, copy } = useClipboard({ resetAfter: () => props.resetAfter });\n\n/** The fallthrough attributes minus the ones this component renders itself. */\nconst passthroughAttrs = computed(() =>\n Object.fromEntries(Object.entries(attrs).filter(([key]) => !OwnedAttributeLookup.has(key))),\n);\n\n/** The accessible name for the current state — `copiedAriaLabel` while copied, `aria-label` otherwise. */\nconst effectiveAriaLabel = computed(() => {\n const label = attrs[AriaAttribute.Label] as string | undefined;\n return copied.value ? (props.copiedAriaLabel ?? label) : label;\n});\n\n/** The state icon shown when the consumer supplies no content. */\nconst fallbackIcon = computed(() => (copied.value ? Check : Copy));\n\n/** Emits `error` on each transition into a failed copy. */\nwatch(error, (next) => {\n if (next) emit(DomEvent.Error, next);\n});\n\n/** Copies the current text, discarding the settled promise. */\nfunction handleClick(): void {\n void copy(props.text);\n}\n</script>\n\n<template>\n <Button\n :variant=\"variant\"\n :aria-label=\"effectiveAriaLabel\"\n :data-copied=\"OptionalExtensions.from(copied, AttributeValue.True)\"\n v-bind=\"passthroughAttrs\"\n @click=\"handleClick\"\n >\n <slot v-if=\"slots.default\" :copied=\"copied\" :error=\"error\" />\n <Icon v-else :icon=\"fallbackIcon\" :size=\"16\" />\n </Button>\n</template>\n","<script lang=\"ts\">\nimport type { GoogleButtonOptions } from '../../../foundation/oauth';\n\n/** Defines the props for {@link GoogleSignInButton}. */\nexport interface GoogleSignInButtonProps {\n /** The button surface. Default `outline`. */\n readonly theme?: GoogleButtonOptions['theme'];\n\n /** The button height band. Default `large`. */\n readonly size?: GoogleButtonOptions['size'];\n\n /** The label wording. Default `signin_with`. */\n readonly text?: GoogleButtonOptions['text'];\n\n /** The button outline. Default `rectangular`. */\n readonly shape?: GoogleButtonOptions['shape'];\n\n /** The rendered width in px. GIS caps this at 400; omit to size to the host element. */\n readonly width?: number;\n\n /** The logo placement. Default `left`. */\n readonly logoAlignment?: GoogleButtonOptions['logo_alignment'];\n\n /** The BCP-47 locale for the button copy. Defaults to the browser's. */\n readonly locale?: string;\n}\n</script>\n\n<script setup lang=\"ts\">\nimport { computed, nextTick, ref, watch } from 'vue';\n\nimport { GoogleIdentityStatus, useGoogleIdentity } from '../../../foundation/oauth';\n\n/**\n * Renders the Google sign-in button — the Google-owned control for the GIS ID-token flow.\n *\n * The button itself is drawn by Google into the host element, not by this package: the ID-token flow\n * requires Google's own branding, so `theme` / `size` / `shape` are forwarded to GIS rather than\n * mapped onto house variants. Everything below the pixels is ours — script loading, `initialize`, and\n * the credential handoff live in the ancestor's `provideGoogleIdentity` owner.\n *\n * The owner receives a signed JWT ID token, not a session. Post it to the\n * product's identity endpoint for server-side verification, and let the response drive `AuthProvider`.\n */\ndefineOptions({ name: 'GoogleSignInButton', inheritAttrs: false });\n\nconst props = withDefaults(defineProps<GoogleSignInButtonProps>(), {\n theme: 'outline',\n size: 'large',\n text: 'signin_with',\n shape: 'rectangular',\n logoAlignment: 'left',\n});\n\nconst host = ref<HTMLElement | null>(null);\nconst identity = useGoogleIdentity();\nconst isConfigured = computed(() => identity.status.value !== GoogleIdentityStatus.Unresolved);\n\n/* GIS reads these once per `renderButton` call, so a prop change has to re-render the button rather\n than mutate it. Collected into one computed so the watcher below fires on any of them. */\nconst buttonOptions = computed<GoogleButtonOptions>(() => ({\n theme: props.theme,\n size: props.size,\n text: props.text,\n shape: props.shape,\n width: props.width,\n logo_alignment: props.logoAlignment,\n locale: props.locale,\n}));\n\nconst isReady = computed(() => identity.status.value === GoogleIdentityStatus.Ready);\n\n/* `immediate` covers the case where the script resolved before this watcher was registered; the\n `nextTick` covers the opposite one, where `isReady` flips in the same tick the host is created and\n the ref is not populated yet. */\nwatch(\n [isReady, buttonOptions, host],\n async () => {\n if (!isReady.value) {\n host.value?.replaceChildren();\n return;\n }\n await nextTick();\n if (!isReady.value) return;\n\n const target = host.value;\n if (!target) return;\n\n // GIS appends; without the clear, a re-render stacks a second button under the first.\n target.replaceChildren();\n identity.renderButton(target, buttonOptions.value);\n },\n { immediate: true },\n);\n</script>\n\n<template>\n <div v-if=\"isConfigured\" ref=\"host\" v-bind=\"$attrs\" />\n</template>\n","<script lang=\"ts\">\nimport type { ButtonHTMLAttributes } from 'vue';\nimport type { Side } from '../../../foundation/styles';\n\n/* Native button attributes stay in attribute fallthrough rather than becoming runtime props. */\nexport interface DisclosureButtonProps extends /* @vue-ignore */ Omit<ButtonHTMLAttributes, 'children' | 'onChange'> {\n /** The controlled open state. */\n readonly open?: boolean;\n /** The uncontrolled initial state. */\n readonly defaultOpen?: boolean;\n /** The side the chevron sits on (`left` · `right`). Default `right`. */\n readonly chevronSide?: Side;\n /** The button type. Default `ButtonType.Button`. */\n readonly type?: ButtonType;\n}\n</script>\n\n<script setup lang=\"ts\">\nimport { computed, useAttrs, useTemplateRef } from 'vue';\nimport { ChevronDown } from 'lucide-vue-next';\nimport type { ClassValue } from 'clsx';\nimport { ButtonType, dataAttr } from '../../../foundation/dom';\nimport { cn, Side as SideValue } from '../../../foundation/styles';\nimport { Icon } from '../../../foundation/icons';\nimport { useControlled } from '../../../foundation/state';\n\n/* `inheritAttrs: false` so `class` folds into the component's own `cn()` call — plain fallthrough\n appends outside it and loses tailwind-merge conflict resolution. */\n/** Renders a full-width labelled button with a rotating chevron that expands or collapses a section. */\ndefineOptions({ name: 'DisclosureButton', inheritAttrs: false });\n\n/* `children` became the default slot (the visible, left-aligned label); `onOpenChange` the\n `update:open` emit. */\nconst props = withDefaults(defineProps<DisclosureButtonProps>(), {\n chevronSide: SideValue.Right,\n type: ButtonType.Button,\n defaultOpen: false,\n open: undefined,\n});\n\nconst emit = defineEmits<{\n /** Fires when the reader expands or collapses the section, carrying the new open state. */\n 'update:open': [open: boolean];\n}>();\n\ndefineSlots<{\n /** The button's own label, left-aligned beside the chevron. */\n default(): unknown;\n}>();\n\nconst attrs = useAttrs();\n\nconst { value: open, setValue: setOpen } = useControlled<boolean>({\n controlled: () => props.open,\n default: props.defaultOpen,\n onChange: (next) => emit('update:open', next),\n});\n\nconst OwnedAttributes: ReadonlySet<string> = new Set(['class']);\nconst passthroughAttrs = computed(() =>\n Object.fromEntries(Object.entries(attrs).filter(([key]) => !OwnedAttributes.has(key))),\n);\n\nconst chevronClass = computed(() => cn('transition-transform', open.value && 'rotate-180'));\n\nconst rootClass = computed(() =>\n cn(\n 'inline-flex w-full items-center justify-between gap-2 rounded-md px-3 py-2 text-sm font-medium text-foreground transition-colors hover:bg-muted focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50',\n attrs.class as ClassValue,\n ),\n);\n\n/* Chained after the consumer's own click (attribute fallthrough puts theirs first) and skipped\n when they called `preventDefault()` — the original's `onClick?.(e); if (!e.defaultPrevented)`. */\nfunction handleClick(event: MouseEvent): void {\n if (event.defaultPrevented) return;\n setOpen(!open.value);\n}\n\nconst root = useTemplateRef<HTMLButtonElement>('root');\n\n/** The rendered element — the Vue stand-in for the React original's forwarded ref. */\ndefineExpose({ el: root });\n</script>\n\n<template>\n <!-- Button with a rotating chevron — sets `aria-expanded` + `data-state=\"open|closed\"`. -->\n <button\n ref=\"root\"\n :type=\"type\"\n :aria-expanded=\"open\"\n :data-state=\"open ? 'open' : 'closed'\"\n :data-disabled=\"dataAttr(attrs.disabled as boolean | undefined)\"\n :class=\"rootClass\"\n v-bind=\"passthroughAttrs\"\n @click=\"handleClick\"\n >\n <Icon v-if=\"chevronSide === SideValue.Left\" :icon=\"ChevronDown\" :size=\"16\" :class=\"chevronClass\" />\n <span class=\"flex-1 text-left\"><slot /></span>\n <Icon v-if=\"chevronSide === SideValue.Right\" :icon=\"ChevronDown\" :size=\"16\" :class=\"chevronClass\" />\n </button>\n</template>\n","import { inject, type InjectionKey } from 'vue';\nimport type { Orientation } from '../../../foundation/styles';\n\nexport interface ToolbarContextValue {\n /** The toolbar's layout axis. Live getter — read it, don't destructure it. */\n readonly orientation: Orientation;\n}\n\nexport const ToolbarKey: InjectionKey<ToolbarContextValue> = Symbol('wow-two.toolbar');\n\n/** Reads the surrounding `Toolbar`. Throws outside one — the parts are not standalone. */\nexport function useToolbarContext(): ToolbarContextValue {\n const context = inject(ToolbarKey, null);\n if (!context) throw new Error('Toolbar.* must be used inside <Toolbar>');\n return context;\n}\n","<script lang=\"ts\">\nimport type { HTMLAttributes } from 'vue';\nimport type { Orientation } from '../../../foundation/styles';\n\n/* Native div attributes stay in attribute fallthrough rather than becoming runtime props. */\nexport interface ToolbarProps extends /* @vue-ignore */ HTMLAttributes {\n /** The layout axis — drives both the arrow-key navigation and the flex direction. Default `horizontal`. */\n readonly orientation?: Orientation;\n}\n</script>\n\n<script setup lang=\"ts\">\nimport { computed, provide, useAttrs, useTemplateRef, type ComponentPublicInstance } from 'vue';\nimport type { ClassValue } from 'clsx';\nimport { cn, Orientation as OrientationValue } from '../../../foundation/styles';\nimport { RovingFocusGroup } from '../../../foundation/primitives';\nimport { ToolbarKey } from './ToolbarContext';\n\n/* `inheritAttrs: false` so `class` folds into the component's own `cn()` call — plain fallthrough\n appends outside it and loses tailwind-merge conflict resolution. */\n/** Renders a bordered strip of actions that arrow keys walk through as a single tab stop. */\ndefineOptions({ name: 'Toolbar', inheritAttrs: false });\n\nconst props = withDefaults(defineProps<ToolbarProps>(), {\n orientation: OrientationValue.Horizontal,\n});\n\ndefineSlots<{\n /** The toolbar items — buttons, links, and separators sharing one roving tab stop. */\n default(): unknown;\n}>();\n\nconst attrs = useAttrs();\n\n/* Live getter, not a snapshot — `ToolbarSeparator` re-reads it to flip its own axis. */\nprovide(ToolbarKey, {\n get orientation() {\n return props.orientation;\n },\n});\n\nconst OwnedAttributes: ReadonlySet<string> = new Set(['class']);\nconst passthroughAttrs = computed(() =>\n Object.fromEntries(Object.entries(attrs).filter(([key]) => !OwnedAttributes.has(key))),\n);\n\nconst rootClass = computed(() =>\n cn(\n 'inline-flex items-center gap-1 rounded-md border border-border bg-background p-1',\n props.orientation === OrientationValue.Vertical && 'flex-col items-stretch',\n attrs.class as ClassValue,\n ),\n);\n\nconst root = useTemplateRef<ComponentPublicInstance>('root');\n\n/** The rendered element — the Vue stand-in for the React original's forwarded ref. */\nconst el = computed<HTMLElement | null>(() => {\n const node = root.value?.$el;\n return node instanceof HTMLElement ? node : null;\n});\n\ndefineExpose({ el });\n</script>\n\n<template>\n <RovingFocusGroup\n ref=\"root\"\n :orientation=\"orientation\"\n can-loop\n role=\"toolbar\"\n :aria-orientation=\"orientation\"\n :data-orientation=\"orientation\"\n :class=\"rootClass\"\n v-bind=\"passthroughAttrs\"\n >\n <slot />\n </RovingFocusGroup>\n</template>\n","<script lang=\"ts\">\nimport type { ButtonHTMLAttributes } from 'vue';\n\n/* Native button attributes stay in attribute fallthrough rather than becoming runtime props. */\nexport interface ToolbarButtonProps extends /* @vue-ignore */ Omit<ButtonHTMLAttributes, 'children'> {\n /** The as-child flag — renders as the single child via `Primitive`, dropping item chrome. */\n readonly asChild?: boolean;\n}\n</script>\n\n<script setup lang=\"ts\">\nimport { computed, useAttrs } from 'vue';\nimport type { ClassValue } from 'clsx';\nimport { ButtonType, HtmlElement } from '../../../foundation/dom';\nimport { cn } from '../../../foundation/styles';\nimport { Primitive, useRovingFocusItem } from '../../../foundation/primitives';\n\n/* `inheritAttrs: false` so `class` folds into the component's own `cn()` call — plain fallthrough\n appends outside it and loses tailwind-merge conflict resolution. */\n/** Renders one action button inside a toolbar, taking its turn in the group's roving tab stop. */\ndefineOptions({ name: 'ToolbarButton', inheritAttrs: false });\n\nconst props = withDefaults(defineProps<ToolbarButtonProps>(), { asChild: false });\n\ndefineSlots<{\n /** The button's label, or — under `asChild` — the single element that becomes the item. */\n default(): unknown;\n}>();\n\nconst attrs = useAttrs();\n\n/* Reactive object — `tabindex` tracks the group's tab stop, so read through it rather than\n destructuring. The function `ref` registers this item's node with the group. */\nconst roving = useRovingFocusItem();\n\nconst OwnedAttributes: ReadonlySet<string> = new Set(['class']);\nconst passthroughAttrs = computed(() =>\n Object.fromEntries(Object.entries(attrs).filter(([key]) => !OwnedAttributes.has(key))),\n);\n\nconst rootClass = computed(() =>\n props.asChild\n ? cn(attrs.class as ClassValue)\n : cn(\n 'inline-flex h-8 items-center justify-center rounded-sm px-2 text-sm transition-colors hover:bg-muted focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50',\n attrs.class as ClassValue,\n ),\n);\n\n/* Chained after the consumer's own keydown (attribute fallthrough puts theirs first) and skipped\n when they called `preventDefault()` — the original's explicit `if (e.defaultPrevented) return`. */\nfunction handleKeydown(event: KeyboardEvent): void {\n if (event.defaultPrevented) return;\n roving.onKeydown(event);\n}\n</script>\n\n<template>\n <Primitive\n :ref=\"roving.ref\"\n :as=\"HtmlElement.Button\"\n :as-child=\"asChild\"\n :type=\"asChild ? undefined : ButtonType.Button\"\n :tabindex=\"roving.tabindex\"\n :data-roving-focus-item=\"roving['data-roving-focus-item']\"\n :class=\"rootClass\"\n v-bind=\"passthroughAttrs\"\n @focus=\"roving.onFocus()\"\n @keydown=\"handleKeydown\"\n >\n <slot />\n </Primitive>\n</template>\n","<script lang=\"ts\">\nimport type { AnchorHTMLAttributes } from 'vue';\n\n/* Native anchor attributes stay in attribute fallthrough rather than becoming runtime props. */\nexport type ToolbarLinkProps = /* @vue-ignore */ Omit<AnchorHTMLAttributes, 'children'>;\n</script>\n\n<script setup lang=\"ts\">\nimport { computed, useAttrs } from 'vue';\nimport type { ClassValue } from 'clsx';\nimport { cn } from '../../../foundation/styles';\nimport { useRovingFocusItem } from '../../../foundation/primitives';\n\n/* `inheritAttrs: false` so `class` folds into the component's own `cn()` call — plain fallthrough\n appends outside it and loses tailwind-merge conflict resolution. */\n/** Renders one anchor inside a toolbar, taking its turn in the group's roving tab stop. */\ndefineOptions({ name: 'ToolbarLink', inheritAttrs: false });\n\ndefineSlots<{\n /** The anchor's own label. */\n default(): unknown;\n}>();\n\nconst attrs = useAttrs();\n\n/* Reactive object — `tabindex` tracks the group's tab stop, so read through it rather than\n destructuring. The function `ref` registers this item's node with the group. */\nconst roving = useRovingFocusItem();\n\nconst OwnedAttributes: ReadonlySet<string> = new Set(['class']);\nconst passthroughAttrs = computed(() =>\n Object.fromEntries(Object.entries(attrs).filter(([key]) => !OwnedAttributes.has(key))),\n);\n\nconst rootClass = computed(() =>\n cn(\n 'inline-flex h-8 items-center justify-center rounded-sm px-2 text-sm text-foreground underline-offset-2 transition-colors hover:bg-muted hover:underline focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring',\n attrs.class as ClassValue,\n ),\n);\n\n/* Chained after the consumer's own keydown (attribute fallthrough puts theirs first) and skipped\n when they called `preventDefault()` — the original's explicit `if (e.defaultPrevented) return`. */\nfunction handleKeydown(event: KeyboardEvent): void {\n if (event.defaultPrevented) return;\n roving.onKeydown(event);\n}\n</script>\n\n<template>\n <a\n :ref=\"roving.ref\"\n :tabindex=\"roving.tabindex\"\n :data-roving-focus-item=\"roving['data-roving-focus-item']\"\n :class=\"rootClass\"\n v-bind=\"passthroughAttrs\"\n @focus=\"roving.onFocus()\"\n @keydown=\"handleKeydown\"\n >\n <slot />\n </a>\n</template>\n","<script setup lang=\"ts\">\nimport { computed, useAttrs } from 'vue';\nimport type { ClassValue } from 'clsx';\nimport { cn, Orientation } from '../../../foundation/styles';\nimport { useToolbarContext } from './ToolbarContext';\n\n/* `inheritAttrs: false` so `class` folds into the component's own `cn()` call — plain fallthrough\n appends outside it and loses tailwind-merge conflict resolution. */\n/** Renders a hairline rule between two toolbar groups, turned across the toolbar's own axis. */\ndefineOptions({ name: 'ToolbarSeparator', inheritAttrs: false });\n\nconst attrs = useAttrs();\nconst context = useToolbarContext();\n\nconst isVertical = computed(() => context.orientation === Orientation.Vertical);\n\nconst OwnedAttributes: ReadonlySet<string> = new Set(['class']);\nconst passthroughAttrs = computed(() =>\n Object.fromEntries(Object.entries(attrs).filter(([key]) => !OwnedAttributes.has(key))),\n);\n\nconst rootClass = computed(() =>\n cn('shrink-0 bg-border', isVertical.value ? 'mx-1 h-px' : 'my-1 w-px self-stretch', attrs.class as ClassValue),\n);\n</script>\n\n<template>\n <div\n role=\"separator\"\n :aria-orientation=\"isVertical ? 'horizontal' : 'vertical'\"\n :class=\"rootClass\"\n v-bind=\"passthroughAttrs\"\n />\n</template>\n","import ToolbarRoot from './Toolbar.vue';\nimport ToolbarButton from './ToolbarButton.vue';\nimport ToolbarLink from './ToolbarLink.vue';\nimport ToolbarSeparator from './ToolbarSeparator.vue';\n\n/**\n * The toolbar root, carrying its parts as properties so `<Toolbar.Button>` /\n * `<Toolbar.Separator>` resolve in a template — the counterpart of the React\n * original's `Object.assign`. Each part is also exported on its own name.\n */\nconst Toolbar: typeof ToolbarRoot & {\n Button: typeof ToolbarButton;\n LinkItem: typeof ToolbarLink;\n SeparatorLayout: typeof ToolbarSeparator;\n} = Object.assign(ToolbarRoot, {\n Button: ToolbarButton,\n LinkItem: ToolbarLink,\n SeparatorLayout: ToolbarSeparator,\n});\n\nexport { Toolbar, ToolbarButton, ToolbarLink, ToolbarSeparator };\nexport type { ToolbarProps } from './Toolbar.vue';\nexport type { ToolbarButtonProps } from './ToolbarButton.vue';\nexport type { ToolbarLinkProps } from './ToolbarLink.vue';\nexport { ToolbarKey, useToolbarContext, type ToolbarContextValue } from './ToolbarContext';\n","import { inject, type InjectionKey, type ShallowRef } from 'vue';\nimport type { OverlayPosition } from '../../../foundation/styles';\n\n/** The overlay anchor position of a SpeedDialGroup (shared overlay vocabulary). */\nexport type SpeedDialGroupPosition = OverlayPosition;\n\n/** Defines the axis a SpeedDialGroup's action items fan out along. */\nexport const SpeedDialGroupDirection = {\n /** Refers to items stacking upward from the trigger. */\n Up: 'up',\n /** Refers to items stacking downward from the trigger. */\n Down: 'down',\n /** Refers to items stacking to the left of the trigger. */\n Left: 'left',\n /** Refers to items stacking to the right of the trigger. */\n Right: 'right',\n} as const;\n\nexport type SpeedDialGroupDirection = (typeof SpeedDialGroupDirection)[keyof typeof SpeedDialGroupDirection];\n\nexport interface SpeedDialGroupContextValue {\n /** The open state. Live getter — read it, don't destructure it. */\n readonly open: boolean;\n\n /** Sets the open state (and fires the root's `open-change`). */\n setOpen: (open: boolean) => void;\n\n /**\n * The trigger's element, published by `SpeedDialGroupTrigger` on mount. Escape and\n * action-select return focus here — the React original held a `MutableRefObject`\n * threaded through `composeRefs`; a Vue child writes its own element into this ref\n * instead.\n */\n triggerEl: ShallowRef<HTMLElement | null>;\n\n /** The resolved fan-out axis. Live getter. */\n readonly direction: SpeedDialGroupDirection;\n\n /** The viewport anchor. Live getter. */\n readonly position: SpeedDialGroupPosition;\n}\n\nexport const SpeedDialGroupKey: InjectionKey<SpeedDialGroupContextValue> = Symbol('wow-two.speedDial');\n\n/** Reads the surrounding `SpeedDialGroup`. Throws outside one — the parts are not standalone. */\nexport function useSpeedDialContext(): SpeedDialGroupContextValue {\n const context = inject(SpeedDialGroupKey, null);\n if (!context) throw new Error('SpeedDialGroup.* must be used inside <SpeedDialGroup>');\n return context;\n}\n","<script setup lang=\"ts\">\nimport { computed, useAttrs } from 'vue';\nimport type { ClassValue } from 'clsx';\nimport { cn } from '../../../foundation/styles';\n\n/**\n * Renders the `<ul>` an open speed dial fans its action items into.\n *\n * `Presence`-clonable list: a single element that takes the `data-state` and `ref`\n * `Presence` injects. Marked `group` so each action item animates off its\n * `data-[state]`; carries its own fade so `Presence` has an animation on *this*\n * node to watch before unmount. Internal — not exported from the barrel.\n */\ndefineOptions({ name: 'SpeedDialGroupList', inheritAttrs: false });\n\ndefineSlots<{\n /** The `SpeedDialGroupAction` items the list fans out, each its own `<li>`. */\n default(): unknown;\n}>();\n\nconst attrs = useAttrs();\n\nconst OwnedAttributes: ReadonlySet<string> = new Set(['class']);\nconst passthroughAttrs = computed(() =>\n Object.fromEntries(Object.entries(attrs).filter(([key]) => !OwnedAttributes.has(key))),\n);\n\nconst rootClass = computed(() =>\n cn(\n 'group absolute flex',\n /* list fade gated on data-state; motion-safe so reduced-motion users\n get no movement. */\n 'motion-safe:data-[state=open]:animate-(--animate-fade-in)',\n 'motion-safe:data-[state=closed]:animate-(--animate-fade-out)',\n 'motion-reduce:animate-none',\n /* Per-item enter stagger: ramp `animation-delay` on the first few items\n while opening only (closed → delay 0 so no item outlasts the list's\n own fade-out, which gates unmount). */\n 'motion-safe:group-data-[state=open]:[&>li:nth-child(2)]:[animation-delay:40ms]',\n 'motion-safe:group-data-[state=open]:[&>li:nth-child(3)]:[animation-delay:80ms]',\n 'motion-safe:group-data-[state=open]:[&>li:nth-child(4)]:[animation-delay:120ms]',\n 'motion-safe:group-data-[state=open]:[&>li:nth-child(n+5)]:[animation-delay:160ms]',\n attrs.class as ClassValue,\n ),\n);\n</script>\n\n<template>\n <ul role=\"menu\" :class=\"rootClass\" v-bind=\"passthroughAttrs\">\n <slot />\n </ul>\n</template>\n","<script lang=\"ts\">\nimport type { ButtonHTMLAttributes, VNodeChild } from 'vue';\nimport type { FabButtonVariant, FabButtonSize } from '../fabButton/FabButton.variants';\n\n/* Native button attributes stay in attribute fallthrough rather than becoming runtime props. */\nexport interface SpeedDialGroupTriggerProps extends /* @vue-ignore */ Omit<ButtonHTMLAttributes, 'children'> {\n /** The glyph shown while closed. Defaults to a `Plus` icon. Prefer the `closed-icon` named slot. */\n readonly closedIcon?: VNodeChild;\n\n /** The glyph shown while open. Defaults to an `X` icon. Prefer the `open-icon` named slot. */\n readonly openIcon?: VNodeChild;\n\n /** The FabButton surface style. */\n readonly variant?: FabButtonVariant;\n\n /** The FabButton diameter. */\n readonly size?: FabButtonSize;\n}\n</script>\n\n<script setup lang=\"ts\">\nimport { useLocale } from '../../../foundation/i18n';\nimport { computed, defineComponent, useAttrs, useTemplateRef, watchPostEffect } from 'vue';\nimport type { ClassValue } from 'clsx';\nimport { Plus, X } from 'lucide-vue-next';\nimport { AriaAttribute } from '../../../foundation/dom';\nimport { cn } from '../../../foundation/styles';\nimport { Icon } from '../../../foundation/icons';\nimport FabButton from '../fabButton/FabButton.vue';\nimport { useSpeedDialContext } from './SpeedDialGroupContext';\n\nconst locale = useLocale();\n\n/** Renders the speed dial's pinned FAB, swapping its glyph as the dial opens and closes. */\ndefineOptions({ name: 'SpeedDialGroupTrigger', inheritAttrs: false });\n\nconst props = withDefaults(defineProps<SpeedDialGroupTriggerProps>(), {\n /* `VNodeChild` includes `boolean`, so Vue's boolean casting turns an absent node-valued prop\n into `false` rather than `undefined` — which reads as \"supplied\" at every `!== undefined`\n check. An explicit `undefined` default suppresses the cast. */\n closedIcon: undefined,\n openIcon: undefined,\n});\n\ndefineSlots<{\n /** The glyph shown while the dial is open. Falls back to `openIcon`, then to an `X` icon. */\n 'open-icon'?(): unknown;\n\n /** The glyph shown while the dial is closed. Falls back to `closedIcon`, then to a `Plus` icon. */\n 'closed-icon'?(): unknown;\n}>();\n\nconst attrs = useAttrs();\nconst context = useSpeedDialContext();\n\n/* `aria-label` is read off `attrs`, not `props`: Vue camelizes declared prop keys, so a declared\n `'aria-label'` would arrive as `props.ariaLabel` and never render. It is stripped from the\n forwarded attrs and re-bound below, so the resolved value is the one that lands. */\nconst ariaLabel = computed(\n () =>\n (attrs[AriaAttribute.Label] as string | undefined) ??\n locale.t('SpeedDialGroupTrigger.label', undefined, 'Toggle actions'),\n);\n\nconst OwnedAttributes: ReadonlySet<string> = new Set(['class', AriaAttribute.Label]);\nconst passthroughAttrs = computed(() =>\n Object.fromEntries(Object.entries(attrs).filter(([key]) => !OwnedAttributes.has(key))),\n);\n\n/* Stable render-only wrappers for the node-valued props, so each can render as the fallback of its\n named-slot twin. */\nconst ClosedIconProp = defineComponent({ render: () => props.closedIcon });\nconst OpenIconProp = defineComponent({ render: () => props.openIcon });\n\nconst fab = useTemplateRef('fab');\n\n/* Publishes the trigger element into the root's context — Escape and action-select return focus\n here. The React original threaded a shared `MutableRefObject` through `composeRefs`. */\nwatchPostEffect(() => {\n const node = fab.value?.el;\n const elementType = node?.ownerDocument.defaultView?.HTMLElement;\n context.triggerEl.value = elementType && node instanceof elementType ? node : null;\n});\n\nconst rootClass = computed(() =>\n cn('static !bottom-auto !left-auto !right-auto !top-auto !translate-x-0', attrs.class as ClassValue),\n);\n\n/* Chained after the consumer's own click (attribute fallthrough puts theirs first) and skipped\n when they called `preventDefault()` — the original's `onClick?.(e); if (e.defaultPrevented) return`. */\nfunction handleClick(event: MouseEvent): void {\n if (event.defaultPrevented) return;\n context.setOpen(!context.open);\n}\n</script>\n\n<template>\n <FabButton\n ref=\"fab\"\n v-bind=\"passthroughAttrs\"\n :aria-label=\"ariaLabel\"\n aria-haspopup=\"menu\"\n :aria-expanded=\"context.open\"\n :variant=\"variant\"\n :size=\"size\"\n :position=\"context.position\"\n :class=\"rootClass\"\n @click=\"handleClick\"\n >\n <template v-if=\"context.open\">\n <slot name=\"open-icon\">\n <OpenIconProp v-if=\"openIcon !== undefined\" />\n <Icon v-else :icon=\"X\" :size=\"20\" />\n </slot>\n </template>\n <template v-else>\n <slot name=\"closed-icon\">\n <ClosedIconProp v-if=\"closedIcon !== undefined\" />\n <Icon v-else :icon=\"Plus\" :size=\"20\" />\n </slot>\n </template>\n </FabButton>\n</template>\n","<script lang=\"ts\">\nimport type { SpeedDialGroupDirection, SpeedDialGroupPosition } from './SpeedDialGroupContext';\n\nexport interface SpeedDialGroupProps {\n /** The viewport anchor. Default `bottom-right`. */\n readonly position?: SpeedDialGroupPosition;\n\n /** The axis the action items fan out along. Defaults to the one implied by `position`. */\n readonly direction?: SpeedDialGroupDirection;\n\n /** The controlled open state. */\n readonly open?: boolean;\n\n /** The uncontrolled initial state. */\n readonly defaultOpen?: boolean;\n\n /** The pixel gap between stacked action items. Default 12. */\n readonly gap?: number;\n}\n</script>\n\n<script setup lang=\"ts\">\nimport { computed, provide, shallowRef, useAttrs, useSlots, useTemplateRef, watch, type VNode } from 'vue';\nimport type { ClassValue } from 'clsx';\nimport { cn, OverlayPosition } from '../../../foundation/styles';\nimport { Key } from '../../../foundation/dom';\nimport { Presence, renderableChildren } from '../../../foundation/primitives';\nimport { useControlled } from '../../../foundation/state';\nimport { useEscape } from '../../../foundation/shortcuts';\nimport { useOutsideClick } from '../../../foundation/dom';\nimport { SpeedDialGroupDirection as SpeedDialGroupDirectionValue, SpeedDialGroupKey } from './SpeedDialGroupContext';\nimport SpeedDialGroupList from './SpeedDialGroupList.vue';\nimport SpeedDialGroupTrigger from './SpeedDialGroupTrigger.vue';\n\n/* `inheritAttrs: false` so `class` folds into the component's own `cn()` call — plain fallthrough\n appends outside it and loses tailwind-merge conflict resolution. */\n/** Renders a pinned trigger that fans a stack of action buttons out across the viewport when opened. */\ndefineOptions({ name: 'SpeedDialGroup', inheritAttrs: false });\n\n/* `className` is Vue's `class` fallthrough attr; `children` is the default slot. */\nconst props = withDefaults(defineProps<SpeedDialGroupProps>(), {\n position: OverlayPosition.BottomRight,\n direction: undefined,\n gap: 12,\n defaultOpen: false,\n open: undefined,\n});\n\nconst emit = defineEmits<{\n /** Fires when the dial opens or closes, carrying the new open state. */\n 'update:open': [open: boolean];\n}>();\n\nconst attrs = useAttrs();\nconst slots = useSlots();\n\nconst OwnedAttributes: ReadonlySet<string> = new Set(['class']);\nconst passthroughAttrs = computed(() =>\n Object.fromEntries(Object.entries(attrs).filter(([key]) => !OwnedAttributes.has(key))),\n);\n\nconst PositionToDirection: Record<SpeedDialGroupPosition, SpeedDialGroupDirection> = {\n 'bottom-right': SpeedDialGroupDirectionValue.Up,\n 'bottom-left': SpeedDialGroupDirectionValue.Up,\n 'bottom-center': SpeedDialGroupDirectionValue.Up,\n 'top-right': SpeedDialGroupDirectionValue.Down,\n 'top-left': SpeedDialGroupDirectionValue.Down,\n 'top-center': SpeedDialGroupDirectionValue.Down,\n};\n\nconst PositionOffsets: Record<SpeedDialGroupPosition, string> = {\n 'bottom-right': 'bottom-6 right-6',\n 'bottom-left': 'bottom-6 left-6',\n 'bottom-center': 'bottom-6 left-1/2 -translate-x-1/2',\n 'top-right': 'top-6 right-6',\n 'top-left': 'top-6 left-6',\n 'top-center': 'top-6 left-1/2 -translate-x-1/2',\n};\n\nconst DirectionToStack: Record<SpeedDialGroupDirection, string> = {\n [SpeedDialGroupDirectionValue.Up]: 'flex-col-reverse bottom-full mb-3',\n [SpeedDialGroupDirectionValue.Down]: 'flex-col top-full mt-3',\n [SpeedDialGroupDirectionValue.Left]: 'flex-row-reverse right-full mr-3',\n [SpeedDialGroupDirectionValue.Right]: 'flex-row top-1/2 -translate-y-1/2 left-full ml-3',\n};\n\nconst { value: open, setValue: setOpen } = useControlled<boolean>({\n controlled: () => props.open,\n default: props.defaultOpen,\n onChange: (next) => emit('update:open', next),\n});\n\nconst rootEl = useTemplateRef<HTMLDivElement>('rootEl');\nconst triggerEl = shallowRef<HTMLElement | null>(null);\n\nconst resolvedDirection = computed(() => props.direction ?? PositionToDirection[props.position]);\n\nuseEscape((event) => {\n if (event.defaultPrevented) return;\n setOpen(false);\n}, open);\n\n// Restore only while the closing dial owns focus; never queue a callback that can steal it later.\nwatch(\n open,\n (isOpen) => {\n const root = rootEl.value;\n if (!isOpen && root?.contains(root.ownerDocument.activeElement)) triggerEl.value?.focus();\n },\n { flush: 'pre' },\n);\n\nuseOutsideClick(\n rootEl,\n () => {\n if (open.value) setOpen(false);\n },\n open,\n);\n\nprovide(SpeedDialGroupKey, {\n get open() {\n return open.value;\n },\n setOpen,\n triggerEl,\n get direction() {\n return resolvedDirection.value;\n },\n get position() {\n return props.position;\n },\n});\n\n/* The trigger renders always (a closed dial must still be openable); only the action items are\n gated behind `open`. The React original partitioned `Children.toArray` on `child.type`; the\n same split runs over the slot's vnodes, so the authoring shape is unchanged. */\nfunction splitChildren(keepTrigger: boolean): Array<VNode> {\n return renderableChildren(slots.default?.()).filter(\n (child) => (child.type === SpeedDialGroupTrigger) === keepTrigger,\n );\n}\n\nconst rootClass = computed(() => cn('fixed', PositionOffsets[props.position], attrs.class as ClassValue));\nconst stackClass = computed(() => DirectionToStack[resolvedDirection.value]);\n\nfunction handleKeydown(event: KeyboardEvent): void {\n if (\n event.defaultPrevented ||\n event.isComposing ||\n !open.value ||\n (event.key !== Key.ArrowDown && event.key !== Key.ArrowUp)\n )\n return;\n const root = rootEl.value;\n if (!root) return;\n const items = Array.from(root.querySelectorAll<HTMLButtonElement>('[role=\"menuitem\"]')).filter(\n (item) => !item.matches(':disabled,[aria-disabled=\"true\"],[data-disabled],[hidden]') && !item.closest('[inert]'),\n );\n if (items.length === 0) return;\n event.preventDefault();\n const currentIndex = items.indexOf(root.ownerDocument.activeElement as HTMLButtonElement);\n const nextIndex =\n currentIndex === -1\n ? event.key === Key.ArrowDown\n ? 0\n : items.length - 1\n : (currentIndex + (event.key === Key.ArrowDown ? 1 : -1) + items.length) % items.length;\n items[nextIndex]?.focus();\n}\n\n/** The rendered element — the Vue stand-in for the React original's forwarded ref. */\ndefineExpose({ el: rootEl });\n</script>\n\n<template>\n <div\n ref=\"rootEl\"\n :data-state=\"open ? 'open' : 'closed'\"\n :class=\"rootClass\"\n v-bind=\"passthroughAttrs\"\n @keydown=\"handleKeydown\"\n >\n <!-- `Presence` clones `data-state` (\"open\" | \"closed\") + a `ref` onto the list and defers\n unmount until its fade-out ends — keeps the exit from being killed by the hard `!open`\n unmount. Items pop in/out off the list's `group` state (see `SpeedDialGroupAction`),\n staggered on enter. -->\n <Presence :is-present=\"open\">\n <SpeedDialGroupList :data-direction=\"resolvedDirection\" :style=\"{ gap: `${gap}px` }\" :class=\"stackClass\">\n <component :is=\"node\" v-for=\"(node, index) in splitChildren(false)\" :key=\"node.key ?? index\" />\n </SpeedDialGroupList>\n </Presence>\n <component :is=\"node\" v-for=\"(node, index) in splitChildren(true)\" :key=\"node.key ?? index\" />\n </div>\n</template>\n","<script lang=\"ts\">\nimport type { ButtonHTMLAttributes, VNodeChild } from 'vue';\nimport { AriaAttribute } from '../../../foundation/dom';\n\n/** @internal An attribute name this component derives or requires. */\ntype RequiredAttribute = typeof AriaAttribute.Label;\n\n/* The required accessible label rides on the ignored heritage rather than the body — action items\n are icon-only, so the name is mandatory, but it must reach the DOM as an attribute. */\ntype SpeedDialGroupActionAttributes = Omit<ButtonHTMLAttributes, 'children'> & Record<RequiredAttribute, string>;\n\n/* Native button attributes stay in attribute fallthrough rather than becoming runtime props. */\nexport interface SpeedDialGroupActionProps extends /* @vue-ignore */ SpeedDialGroupActionAttributes {\n /** The action's glyph. Prefer the `icon` named slot; this prop stays for parity with the React API. */\n readonly icon?: VNodeChild;\n\n /** The label chip rendered beside the button. Prefer the `tooltip` named slot. */\n readonly tooltip?: VNodeChild;\n\n /** The button type. Default `ButtonType.Button`. */\n readonly type?: ButtonType;\n}\n</script>\n\n<script setup lang=\"ts\">\nimport { computed, defineComponent, useAttrs, useSlots, useTemplateRef } from 'vue';\nimport type { ClassValue } from 'clsx';\nimport { ButtonType } from '../../../foundation/dom';\nimport { cn, Side } from '../../../foundation/styles';\nimport { SpeedDialGroupDirection, useSpeedDialContext } from './SpeedDialGroupContext';\n\n/* `aria-label` is deliberately NOT a declared prop: Vue camelizes prop keys, so a declared\n `'aria-label'` would arrive as `props.ariaLabel` and never render. It stays a fallthrough attr;\n the interface keeps the requirement through the `@vue-ignore`d heritage. */\n/** Renders one icon button of an open speed dial, with an optional label chip beside it. */\ndefineOptions({ name: 'SpeedDialGroupAction', inheritAttrs: false });\n\nconst props = withDefaults(defineProps<SpeedDialGroupActionProps>(), {\n type: ButtonType.Button,\n /* `VNodeChild` includes `boolean`, so Vue's boolean casting turns an absent node-valued prop\n into `false` rather than `undefined` — which reads as \"supplied\" at every `!== undefined`\n check. An explicit `undefined` default suppresses the cast. */\n icon: undefined,\n tooltip: undefined,\n});\n\nconst emit = defineEmits<{\n /** Fires when the action is chosen — the dial closes and focus returns to the trigger afterwards. */\n select: [];\n}>();\n\ndefineSlots<{\n /** The action's glyph. Preferred over the `icon` prop. */\n icon?(): unknown;\n /** The glyph, in the plain-children shape a Vue caller reaches for. Same slot as `icon`. */\n default?(): unknown;\n /** The label chip beside the button. Preferred over the `tooltip` prop. */\n tooltip?(): unknown;\n}>();\n\nconst attrs = useAttrs();\nconst slots = useSlots();\nconst context = useSpeedDialContext();\n\nconst DirectionLabelSide: Record<SpeedDialGroupDirection, Side> = {\n [SpeedDialGroupDirection.Up]: Side.Right,\n [SpeedDialGroupDirection.Down]: Side.Right,\n [SpeedDialGroupDirection.Left]: Side.Right,\n [SpeedDialGroupDirection.Right]: Side.Left,\n};\n\n/* Stable render-only wrappers for the node-valued props, so each can render as the fallback of its\n named-slot twin. */\nconst IconProp = defineComponent({ render: () => props.icon });\nconst TooltipProp = defineComponent({ render: () => props.tooltip });\n\nconst labelSide = computed(() => DirectionLabelSide[context.direction]);\nconst hasTooltip = computed(() => props.tooltip !== undefined || slots.tooltip !== undefined);\n\nconst OwnedAttributes: ReadonlySet<string> = new Set(['class']);\nconst passthroughAttrs = computed(() =>\n Object.fromEntries(Object.entries(attrs).filter(([key]) => !OwnedAttributes.has(key))),\n);\n\nconst buttonClass = computed(() =>\n cn(\n 'inline-flex h-10 w-10 items-center justify-center rounded-full bg-card text-card-foreground shadow-md transition-all hover:shadow-lg focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring',\n attrs.class as ClassValue,\n ),\n);\n\n/* Chained after the consumer's own click (attribute fallthrough puts theirs first) and skipped\n when they called `preventDefault()` — the original's `onClick?.(e); if (e.defaultPrevented) return`. */\nfunction handleClick(event: MouseEvent): void {\n if (\n event.defaultPrevented ||\n !context.open ||\n root.value?.matches(':disabled,[aria-disabled=\"true\"],[data-disabled]')\n )\n return;\n emit('select');\n context.setOpen(false);\n}\n\nconst root = useTemplateRef<HTMLButtonElement>('root');\nfunction handleClickCapture(event: MouseEvent): void {\n if (context.open && !root.value?.matches(':disabled,[aria-disabled=\"true\"],[data-disabled]')) return;\n event.preventDefault();\n event.stopImmediatePropagation();\n}\n\n/** The rendered element — the Vue stand-in for the React original's forwarded ref. */\ndefineExpose({ el: root });\n</script>\n\n<template>\n <li\n role=\"none\"\n :data-side=\"labelSide\"\n :class=\"\n cn(\n 'flex items-center gap-2',\n /* fade+scale each action off the list's `group` state; motion-safe so\n reduced-motion users get no movement (delay ramp lives on the list). */\n 'motion-safe:group-data-[state=open]:animate-(--animate-pop-in)',\n 'motion-safe:group-data-[state=closed]:animate-(--animate-pop-out)',\n 'motion-reduce:animate-none',\n )\n \"\n >\n <span\n v-if=\"hasTooltip && labelSide === Side.Left\"\n class=\"rounded-md bg-popover px-2 py-1 text-xs text-popover-foreground shadow\"\n >\n <slot name=\"tooltip\"><TooltipProp v-if=\"tooltip !== undefined\" /></slot>\n </span>\n <button\n ref=\"root\"\n v-bind=\"passthroughAttrs\"\n :type=\"type\"\n role=\"menuitem\"\n :class=\"buttonClass\"\n @click.capture=\"handleClickCapture\"\n @click=\"handleClick\"\n >\n <!-- The default slot is the fallback, not a second API: React typed `children` away,\n so a Vue caller writing `<SpeedDialGroupAction><Pencil /></SpeedDialGroupAction>` — the\n idiomatic shape — got a silently empty button. Precedence stays `icon` slot →\n default slot → `icon` prop. -->\n <slot name=\"icon\">\n <slot><IconProp v-if=\"icon !== undefined\" /></slot>\n </slot>\n </button>\n <span\n v-if=\"hasTooltip && labelSide === Side.Right\"\n class=\"rounded-md bg-popover px-2 py-1 text-xs text-popover-foreground shadow\"\n >\n <slot name=\"tooltip\"><TooltipProp v-if=\"tooltip !== undefined\" /></slot>\n </span>\n </li>\n</template>\n","import SpeedDialGroupRoot from './SpeedDialGroup.vue';\nimport SpeedDialGroupTrigger from './SpeedDialGroupTrigger.vue';\nimport SpeedDialGroupAction from './SpeedDialGroupAction.vue';\n\n/**\n * The dial root, carrying its parts as properties so `<SpeedDialGroup.Trigger>` /\n * `<SpeedDialGroup.Action>` resolve in a template — the counterpart of the React\n * original's `Object.assign`. Each part is also exported on its own name.\n */\nconst SpeedDialGroup: typeof SpeedDialGroupRoot & {\n Trigger: typeof SpeedDialGroupTrigger;\n Action: typeof SpeedDialGroupAction;\n} = Object.assign(SpeedDialGroupRoot, {\n Trigger: SpeedDialGroupTrigger,\n Action: SpeedDialGroupAction,\n});\n\nexport { SpeedDialGroup, SpeedDialGroupAction, SpeedDialGroupTrigger };\nexport {\n SpeedDialGroupDirection,\n SpeedDialGroupKey,\n useSpeedDialContext,\n type SpeedDialGroupContextValue,\n type SpeedDialGroupPosition,\n} from './SpeedDialGroupContext';\nexport type { SpeedDialGroupProps } from './SpeedDialGroup.vue';\nexport type { SpeedDialGroupTriggerProps } from './SpeedDialGroupTrigger.vue';\nexport type { SpeedDialGroupActionProps } from './SpeedDialGroupAction.vue';\nexport default SpeedDialGroup;\n","<script lang=\"ts\">\nimport type { ButtonHTMLAttributes, VNodeChild } from 'vue';\nimport type { OverlayPosition } from '../../../foundation/styles';\n\n/* Native button attributes stay in attribute fallthrough rather than becoming runtime props. */\nexport interface BackToTopButtonProps extends /* @vue-ignore */ ButtonHTMLAttributes {\n /** The scroll distance (px) before the button appears. Default 400. */\n readonly threshold?: number;\n\n /** The scrollable element to scope to. Defaults to the window. */\n readonly scrollContainer?: HTMLElement | null;\n\n /** The anchor position on the viewport. Default `bottom-right`. */\n readonly position?: OverlayPosition;\n\n /** The visible label. Omit for icon-only. Prefer the `label` named slot. */\n readonly label?: VNodeChild;\n\n /** The button type. Default `ButtonType.Button`. */\n readonly type?: ButtonType;\n}\n</script>\n\n<script setup lang=\"ts\">\nimport { useLocale } from '../../../foundation/i18n';\nimport { computed, defineComponent, shallowRef, useAttrs, useTemplateRef, watchPostEffect } from 'vue';\nimport { ArrowUp } from 'lucide-vue-next';\nimport type { ClassValue } from 'clsx';\nimport { AriaAttribute, ButtonType } from '../../../foundation/dom';\nimport { cn, OverlayPosition as OverlayPositionValue } from '../../../foundation/styles';\nimport { Icon } from '../../../foundation/icons';\n\nconst locale = useLocale();\n\n/* `inheritAttrs: false` so `class` folds into the component's own `cn()` call — plain fallthrough\n appends outside it and loses tailwind-merge conflict resolution. */\n/** Renders a floating button that appears past a scroll threshold and returns the page to the top. */\ndefineOptions({ name: 'BackToTopButton', inheritAttrs: false });\n\nconst props = withDefaults(defineProps<BackToTopButtonProps>(), {\n threshold: 400,\n position: OverlayPositionValue.BottomRight,\n type: ButtonType.Button,\n scrollContainer: null,\n /* `VNodeChild` includes `boolean`, so Vue's boolean casting turns an absent node-valued prop\n into `false` rather than `undefined` — which reads as \"supplied\" at every `!== undefined`\n check. An explicit `undefined` default suppresses the cast. */\n label: undefined,\n});\n\nconst slots = defineSlots<{\n /** The visible label beside the arrow. Falls back to the `label` prop, then to icon-only. */\n label?(): unknown;\n}>();\n\nconst attrs = useAttrs();\n\nconst PositionClasses: Record<OverlayPosition, string> = {\n 'bottom-right': 'bottom-6 right-6',\n 'bottom-left': 'bottom-6 left-6',\n 'bottom-center': 'bottom-6 left-1/2 -translate-x-1/2',\n 'top-right': 'top-6 right-6',\n 'top-left': 'top-6 left-6',\n 'top-center': 'top-6 left-1/2 -translate-x-1/2',\n};\n\n/* Stable render-only wrapper for the node-valued `label` prop, so it can render as the fallback of\n its named-slot twin. */\nconst LabelProp = defineComponent({ render: () => props.label });\n\nconst hasLabel = computed(() => props.label !== undefined || slots.label !== undefined);\n\nconst visible = shallowRef(false);\n\n/* `watchPostEffect` is the `useEffect` counterpart: it re-subscribes whenever `threshold` or\n `scrollContainer` changes, and reads once on attach. */\nwatchPostEffect((onCleanup) => {\n if (typeof window === 'undefined') return;\n const element: HTMLElement | Window = props.scrollContainer ?? window;\n const read = (): void => {\n const y = 'scrollY' in element ? (element as Window).scrollY : (element as HTMLElement).scrollTop;\n visible.value = y >= props.threshold;\n };\n read();\n const target = element as EventTarget;\n target.addEventListener('scroll', read, { passive: true });\n onCleanup(() => target.removeEventListener('scroll', read));\n});\n\n/* `aria-label` is read off `attrs`, not `props`: Vue camelizes declared prop keys, so a declared\n `'aria-label'` would arrive as `props.ariaLabel` and never render. It is stripped from the\n forwarded attrs and re-bound below, so the resolved value is the one that lands. */\nconst ariaLabel = computed(\n () =>\n (attrs[AriaAttribute.Label] as string | undefined) ?? locale.t('BackToTopButton.label', undefined, 'Back to top'),\n);\n\nconst OwnedAttributes: ReadonlySet<string> = new Set(['class', AriaAttribute.Label]);\nconst passthroughAttrs = computed(() =>\n Object.fromEntries(Object.entries(attrs).filter(([key]) => !OwnedAttributes.has(key))),\n);\n\nconst rootClass = computed(() =>\n cn(\n 'fixed z-banner inline-flex items-center justify-center gap-2 rounded-full bg-card text-card-foreground shadow-lg ring-1 ring-border transition-all hover:shadow-xl focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring',\n hasLabel.value ? 'h-11 px-4 text-sm font-medium' : 'h-11 w-11',\n PositionClasses[props.position],\n attrs.class as ClassValue,\n ),\n);\n\n/* Chained after the consumer's own click (attribute fallthrough puts theirs first) and skipped\n when they called `preventDefault()` — the original's `onClick?.(e); if (e.defaultPrevented) return`. */\nfunction handleClick(event: MouseEvent): void {\n if (event.defaultPrevented) return;\n const reducedMotion =\n typeof window !== 'undefined' && window.matchMedia?.('(prefers-reduced-motion: reduce)').matches;\n const target = props.scrollContainer ?? window;\n if ('scrollTo' in target) {\n target.scrollTo({ top: 0, behavior: reducedMotion ? 'auto' : 'smooth' });\n }\n}\n\nconst root = useTemplateRef<HTMLButtonElement>('root');\n\n/** The rendered element — the Vue stand-in for the React original's forwarded ref. */\ndefineExpose({ el: root });\n</script>\n\n<template>\n <!-- Floating button revealed past `threshold` scroll — smooth-scrolls to top. -->\n <button\n v-if=\"visible\"\n ref=\"root\"\n :type=\"type\"\n :aria-label=\"ariaLabel\"\n :class=\"rootClass\"\n v-bind=\"passthroughAttrs\"\n @click=\"handleClick\"\n >\n <Icon :icon=\"ArrowUp\" :size=\"16\" />\n <slot name=\"label\"><LabelProp v-if=\"label !== undefined\" /></slot>\n </button>\n</template>\n"],"names":["OwnedAttributes","OrientationValue","_openBlock","_createElementBlock","_mergeProps","_renderSlot","_useSlots","_createBlock","Button","_unref","Icon","$attrs","SideValue","_createElementVNode","_hoisted_2","_hoisted_1","ToolbarRoot","ToolbarButton","ToolbarLink","ToolbarSeparator","FabButton","SpeedDialGroupDirectionValue","SpeedDialGroupTrigger","_createVNode","SpeedDialGroupList","_Fragment","_renderList","_resolveDynamicComponent","_normalizeClass","SpeedDialGroupRoot","SpeedDialGroupAction"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAwBA,UAAM,QAAQ;AAUd,UAAM,QAAQ,SAAA;AAEd,UAAMA,mBAAuC,oBAAI,IAAI,CAAC,OAAO,CAAC;AAC9D,UAAM,mBAAmB;AAAA,MAAS,MAChC,OAAO,YAAY,OAAO,QAAQ,KAAK,EAAE,OAAO,CAAC,CAAC,GAAG,MAAM,CAACA,iBAAgB,IAAI,GAAG,CAAC,CAAC;AAAA,IAAA;AAGvF,UAAM,eAAe,SAAS,MAAM,MAAM,gBAAgBC,YAAiB,UAAU;AAErF,UAAM,YAAY;AAAA,MAAS,MACzB;AAAA,QACE;AAAA,QACA,aAAa,QAAQ,aAAa;AAAA,QAClC,MAAM,aACF,aAAa,QACX,mHACA,m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EAAA,KAAA,EAAA,CAAA;;;;;;"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"UseClipboard-x6nEdQ9f.js","sources":["../../src/foundation/clipboard/ClipboardResult.ts","../../src/foundation/clipboard/ClipboardSupport.ts","../../src/foundation/clipboard/LegacyCopy.ts","../../src/foundation/clipboard/CopyText.ts","../../src/foundation/clipboard/hooks/UseClipboard.ts"],"sourcesContent":["import type { ClipboardFailure } from './models/ClipboardFailure';\nimport type { Result } from '../results';\n\nimport { toError } from '../errors';\nexport type { ClipboardFailure } from './models/ClipboardFailure';\nexport type { ClipboardWriteResult } from './models/ClipboardWriteResult';\n\n/** The `status` discriminant of a {@link ClipboardWriteResult} — for a consumer's own switch or status→copy map. */\nexport type ClipboardWriteStatus = 'copied' | ClipboardFailure['status'];\n\n/** One MIME-typed payload read off the system clipboard. */\nexport interface ClipboardReadItem {\n /** The MIME type the platform reported — `text/plain`, `text/html`, `image/png`, … */\n readonly type: string;\n\n /** The payload itself. Read it with `blob.text()` for textual types, or hand it to `URL.createObjectURL`. */\n readonly blob: Blob;\n}\nexport type { ClipboardReadTextResult } from './models/ClipboardReadTextResult';\nexport type { ClipboardReadItemsResult } from './models/ClipboardReadItemsResult';\n\n/** The `status` discriminant shared by both read results. */\nexport type ClipboardReadStatus = 'read' | ClipboardFailure['status'];\n\n/** Tunes a clipboard read. */\nexport interface ClipboardReadOptions {\n /**\n * Called with the normalized error on a `denied` or `failed` result — the seam for a toast or telemetry hook.\n * Never called for `unsupported`, which is a capability fact rather than a failure. A throw from this callback\n * is swallowed. Called at most once per operation, on the final result.\n */\n readonly onError?: (error: Error) => void;\n}\n\n/** Tunes a clipboard write. */\nexport interface ClipboardCopyOptions extends ClipboardReadOptions {\n /**\n * Whether a write the Clipboard API cannot complete retries through the deprecated\n * `document.execCommand('copy')` path. Defaults to `false`.\n *\n * Opt in for reach — older Safari and any non-secure context have no `navigator.clipboard` at all, and\n * `execCommand` is the only write available there. Leave it off to stay on standards-track APIs only. See\n * `LegacyCopy.ts` for the deprecation caveats and for exactly when the retry runs.\n */\n readonly legacyFallback?: boolean;\n}\n\n/** The shape every result family shares, so one reporter can serve every entry point. */\ntype ClipboardOutcome = Result<unknown, ClipboardFailure>;\n\n/** Reads a caught value's `name` as a string. Guarded, so a throwing getter reads as absent. */\nfunction nameOf(value: unknown): string | undefined {\n try {\n if (typeof value !== 'object' || value === null) return undefined;\n const name: unknown = (value as { name?: unknown }).name;\n return typeof name === 'string' ? name : undefined;\n } catch {\n return undefined;\n }\n}\n\n/**\n * Checks whether a caught value is the platform refusing rather than breaking — the split behind `denied`.\n * Exported for the sibling modules; absent from the barrel, where the statuses are the answer callers want.\n *\n * @param value The caught value.\n */\nexport function isPermissionRefusal(value: unknown): boolean {\n const name = nameOf(value);\n return name === 'NotAllowedError' || name === 'SecurityError';\n}\n\n/**\n * Turns a caught value into the `denied` or `failed` arm it belongs in. Serves reads and writes alike — the\n * returned {@link ClipboardFailure} is assignable to every result union in the slice. Exported for the sibling\n * modules; absent from the barrel. Never throws: `toError` is total.\n *\n * @param error The caught value.\n */\nexport function toClipboardFailure(error: unknown): ClipboardFailure {\n const failure = toError(error);\n return isPermissionRefusal(error) ? { status: 'denied', error: failure } : { status: 'failed', error: failure };\n}\n\n/**\n * Hands a consumer's callback the failure carried by `result`, absorbing a throw from the callback itself. A\n * reporter that throws must not convert a typed result into an unhandled rejection.\n *\n * Called once per entry point, on the FINAL result — so a write that degrades through the legacy fallback\n * reports the outcome the caller receives, not each intermediate attempt. Exported for the sibling modules;\n * absent from the barrel.\n *\n * @param result The outcome about to be returned.\n * @param onError The consumer's reporter, if they supplied one.\n * @returns `result`, unchanged — so a call site can `return reportClipboardOutcome(...)`.\n */\nexport function reportClipboardOutcome<TResult extends ClipboardOutcome>(\n result: TResult,\n onError: ((error: Error) => void) | undefined,\n): TResult {\n if (onError === undefined) return result;\n if (result.ok || !('error' in result.failure)) return result;\n\n try {\n onError(result.failure.error);\n } catch {\n // The consumer's own reporter failed. There is nothing useful left to do with that — the result still\n // reaches the caller, which is the guarantee that matters.\n }\n return result;\n}\n","/** The `ClipboardItem` constructor, narrowed to the one overload this slice calls. */\nexport type ClipboardItemConstructor = new (items: Record<string, Blob>) => ClipboardItem;\n\n/** Reads a member off an object, guarded — a throwing getter reads as `undefined`. */\nfunction member(source: object, key: string): unknown {\n try {\n return (source as Record<string, unknown>)[key];\n } catch {\n return undefined;\n }\n}\n\n/**\n * Reads `navigator.clipboard` if it is there and usable. Guarded end-to-end; returns `undefined` under SSR.\n * Exported for the sibling modules; absent from the barrel.\n */\nexport function clipboardApi(): Clipboard | undefined {\n try {\n if (typeof navigator === 'undefined') return undefined;\n const clipboard = member(navigator, 'clipboard');\n if (typeof clipboard !== 'object' || clipboard === null) return undefined;\n return clipboard as Clipboard;\n } catch {\n return undefined;\n }\n}\n\n/** The Clipboard API methods this slice calls. */\nexport const ClipboardMethodName = {\n /** Names `clipboard.writeText` — the plain-text write, implemented in every engine with a clipboard. */\n WriteText: 'writeText',\n\n /** Names `clipboard.write` — the `ClipboardItem` write, for images and multi-flavour payloads. */\n Write: 'write',\n\n /** Names `clipboard.readText` — the plain-text read. */\n ReadText: 'readText',\n\n /** Names `clipboard.read` — the `ClipboardItem` read. */\n Read: 'read',\n} as const;\n\n/** The Clipboard API methods this slice calls. */\nexport type ClipboardMethodName = (typeof ClipboardMethodName)[keyof typeof ClipboardMethodName];\n\n/**\n * Resolves one of the Clipboard API's methods, bound to the clipboard object, or `undefined` when this engine\n * does not implement it. The single gate every operation passes through. Exported for the sibling modules;\n * absent from the barrel.\n *\n * Bound rather than returned bare: a caller invoking a detached `writeText` would lose its receiver and get a\n * `TypeError` (\"Illegal invocation\") from the real implementation.\n *\n * @param name The method to resolve — `writeText`, `write`, `readText`, or `read`.\n */\nexport function clipboardMethod<TName extends ClipboardMethodName>(name: TName): Clipboard[TName] | undefined {\n const clipboard = clipboardApi();\n if (clipboard === undefined) return undefined;\n\n const method = member(clipboard, name);\n if (typeof method !== 'function') return undefined;\n\n try {\n return (method as (...args: unknown[]) => unknown).bind(clipboard) as Clipboard[TName];\n } catch {\n return undefined;\n }\n}\n\n/**\n * Reads the `ClipboardItem` constructor, which multi-format writes need and which Node and older Safari lack.\n * Exported for the sibling modules; absent from the barrel.\n */\nexport function clipboardItemConstructor(): ClipboardItemConstructor | undefined {\n try {\n const constructor = member(globalThis, 'ClipboardItem');\n if (typeof constructor !== 'function') return undefined;\n return constructor as ClipboardItemConstructor;\n } catch {\n return undefined;\n }\n}\n\n/**\n * Whether plain-text copying is available — `navigator.clipboard.writeText`.\n *\n * `false` under SSR, in a non-secure context, and on engines predating the Clipboard API. It does NOT predict\n * the permission: a copy can still come back `denied` if the call has no user gesture behind it. Treat it as\n * \"is the road there\", not \"will the trip succeed\".\n */\nexport function canCopy(): boolean {\n return clipboardMethod(ClipboardMethodName.WriteText) !== undefined;\n}\n\n/**\n * Whether multi-format copying is available — `navigator.clipboard.write` plus a `ClipboardItem` constructor.\n * Strictly narrower than {@link canCopy}: every engine shipped `writeText` first.\n */\nexport function canCopyItems(): boolean {\n return clipboardMethod(ClipboardMethodName.Write) !== undefined && clipboardItemConstructor() !== undefined;\n}\n\n/**\n * Whether reading from the clipboard is available — `navigator.clipboard.readText`.\n *\n * Returns `false` when the method is absent, including under SSR. Even where present,\n * reading remains subject to browser permission and user-activation requirements. If all you need is the payload the\n * user just pasted, do not read at all — handle the `paste` event with `getPasteItems`, which needs no\n * permission and no prompt.\n */\nexport function canReadClipboard(): boolean {\n return clipboardMethod(ClipboardMethodName.ReadText) !== undefined;\n}\n\n/**\n * Whether the deprecated `document.execCommand('copy')` path is available — the only write that exists in a\n * non-secure context or on older Safari. Requires a document; `false` under SSR.\n *\n * A `true` here does not mean the copy will succeed: `execCommand` still requires the call to sit inside a user\n * gesture, and reports its own refusal by returning `false`.\n */\nexport function canLegacyCopy(): boolean {\n try {\n if (typeof document === 'undefined') return false;\n return typeof member(document, 'execCommand') === 'function';\n } catch {\n return false;\n }\n}\n","import { AriaAttribute } from '../dom';\nimport { toClipboardFailure, type ClipboardCopyOptions, type ClipboardWriteResult } from './ClipboardResult';\nimport { canLegacyCopy } from './ClipboardSupport';\n\n/** Off-screen but laid out — selection requires a rendered element, so `display: none` would copy nothing. */\nconst HiddenTextareaCss =\n 'position:fixed;top:0;left:0;width:1px;height:1px;padding:0;margin:0;border:none;outline:none;box-shadow:none;background:transparent;opacity:0;pointer-events:none;';\n\n/** Restores focus to whatever held it before the textarea took it. Guarded — a stand-in may have no `focus`. */\nfunction restoreFocus(previous: Element | null): void {\n try {\n if (previous === null) return;\n const focus = (previous as { focus?: unknown }).focus;\n if (typeof focus !== 'function') return;\n (previous as HTMLElement).focus({ preventScroll: true });\n } catch {\n // The previously focused element is gone or refuses focus. Not worth failing a completed copy over.\n }\n}\n\n/** Detaches the temporary textarea, preferring `remove()` and falling back to the parent. Never throws. */\nfunction detach(element: HTMLTextAreaElement): void {\n try {\n if (typeof element.remove === 'function') {\n element.remove();\n return;\n }\n element.parentNode?.removeChild(element);\n } catch {\n // Nothing further to try. The failure to detach must not mask the copy's own result.\n }\n}\n\n/**\n * Copies `text` through the deprecated `document.execCommand('copy')` path.\n *\n * Synchronous, unlike every other write in this slice — `execCommand` is. Requires a user gesture: outside one\n * the command reports its own refusal by returning `false`, which surfaces here as `failed` (the legacy API has\n * no way to say \"denied\" specifically). Returns `unsupported` under SSR or where `execCommand` is gone.\n *\n * Exported for the sibling modules and for a consumer that wants the legacy path explicitly; the temporary\n * element is removed on every path, including a throw from `execCommand` itself.\n *\n * Never throws.\n *\n * @param text The text to place on the clipboard.\n * @deprecated Prefer `copyText`, which uses the Clipboard API and falls back here only on `legacyFallback: true`.\n */\nexport function legacyCopyText(text: string): ClipboardWriteResult {\n if (!canLegacyCopy()) return { ok: false, failure: { status: 'unsupported' } };\n\n let element: HTMLTextAreaElement | undefined;\n let previouslyFocused: Element | null = null;\n\n try {\n const body: unknown = document.body;\n if (typeof body !== 'object' || body === null) return { ok: false, failure: { status: 'unsupported' } };\n\n previouslyFocused = document.activeElement;\n\n element = document.createElement('textarea');\n element.value = text;\n element.setAttribute(AriaAttribute.Hidden, 'true');\n element.setAttribute('tabindex', '-1');\n element.setAttribute('readonly', 'readonly');\n element.style.cssText = HiddenTextareaCss;\n\n (body as HTMLElement).appendChild(element);\n\n element.focus({ preventScroll: true });\n element.select();\n element.setSelectionRange(0, text.length);\n\n const copied = document.execCommand('copy');\n return copied\n ? { ok: true, value: undefined }\n : {\n ok: false,\n failure: { status: 'failed', error: new Error('document.execCommand(\"copy\") reported failure.') },\n };\n } catch (error) {\n return { ok: false, failure: toClipboardFailure(error) };\n } finally {\n if (element !== undefined) detach(element);\n restoreFocus(previouslyFocused);\n }\n}\n\n/**\n * Retries a write that the Clipboard API could not complete through the legacy path, when the caller opted in.\n *\n * The retry runs whenever `modern` is not `copied` — not only on `unsupported`. A `denied` from\n * `navigator.clipboard` is exactly the case `execCommand` can still serve: the legacy command is gated on the\n * user gesture the call already sits in, not on the Clipboard API's permission.\n *\n * Which result wins:\n * - the legacy attempt, when it copied — a success outranks any diagnosis;\n * - otherwise `modern`, when the Clipboard API was actually present (its `denied` / `failed` is the more\n * specific account of what went wrong);\n * - otherwise the legacy attempt's own result — with no Clipboard API at all, `modern` is a bare `unsupported`\n * and the legacy failure says more.\n *\n * Exported for the sibling write modules; absent from the barrel. Never throws.\n *\n * @param modern The result the Clipboard API path produced.\n * @param text The plain-text payload, or `undefined` when the write has no text arm to degrade to.\n * @param options The caller's options — the retry runs only on `legacyFallback: true`.\n */\nexport function withLegacyFallback(\n modern: ClipboardWriteResult,\n text: string | undefined,\n options: ClipboardCopyOptions | undefined,\n): ClipboardWriteResult {\n if (modern.ok) return modern;\n if (options?.legacyFallback !== true) return modern;\n if (text === undefined) return modern;\n\n const legacy = legacyCopyText(text);\n if (legacy.ok) return legacy;\n return modern.failure.status === 'unsupported' ? legacy : modern;\n}\n","import {\n reportClipboardOutcome,\n toClipboardFailure,\n type ClipboardCopyOptions,\n type ClipboardWriteResult,\n} from './ClipboardResult';\nimport { clipboardMethod } from './ClipboardSupport';\nimport { withLegacyFallback } from './LegacyCopy';\n\n/** Runs the Clipboard API write, mapping every outcome onto the result union. Never throws. */\nasync function writeTextThroughApi(text: string): Promise<ClipboardWriteResult> {\n const writeText = clipboardMethod('writeText');\n if (writeText === undefined) return { ok: false, failure: { status: 'unsupported' } };\n\n try {\n await writeText(text);\n return { ok: true, value: undefined };\n } catch (error) {\n return { ok: false, failure: toClipboardFailure(error) };\n }\n}\n\n/**\n * Writes `text` to the system clipboard.\n *\n * Call it from a user gesture: browsers require transient activation for a clipboard write, and without one the\n * platform refuses — which surfaces as `denied`, not `unsupported`, since the API was in fact present.\n *\n * Resolves to `unsupported` under SSR, in a non-secure context, and on engines with no Clipboard API. Pass\n * `legacyFallback: true` to retry those through the deprecated `document.execCommand` path.\n *\n * Never throws, never rejects.\n *\n * @param text The text to place on the clipboard. An empty string is a valid payload — it clears the clipboard.\n * @param options Error reporting and the legacy-fallback opt-in.\n */\nexport async function copyText(text: string, options?: ClipboardCopyOptions): Promise<ClipboardWriteResult> {\n try {\n if (typeof text !== 'string') {\n return reportClipboardOutcome(\n { ok: false, failure: { status: 'failed', error: new TypeError('copyText expects a string.') } } as const,\n options?.onError,\n );\n }\n\n const result = withLegacyFallback(await writeTextThroughApi(text), text, options);\n return reportClipboardOutcome(result, options?.onError);\n } catch (error) {\n // Unreachable by design — every helper above is itself total. Kept so a future edit to one of them cannot\n // turn this entry point into a rejecting promise.\n return reportClipboardOutcome({ ok: false, failure: toClipboardFailure(error) }, options?.onError);\n }\n}\n","import { onScopeDispose, shallowRef, toValue, type MaybeRefOrGetter, type ShallowRef } from 'vue';\nimport { copyText } from '../CopyText';\nimport type { ClipboardWriteResult } from '../ClipboardResult';\n\nexport interface UseClipboardOptions {\n /** Reset `copied` back to false after this many ms. Default 2000. Set 0 to keep state until explicitly reset. */\n resetAfter?: MaybeRefOrGetter<number>;\n}\n\nexport interface ClipboardControls {\n /** True for `resetAfter` ms after a successful copy. */\n copied: Readonly<ShallowRef<boolean>>;\n\n /** Last error from `navigator.clipboard.writeText`, if any. */\n error: Readonly<ShallowRef<Error | null>>;\n\n /** Writes text and returns the completed success or failure to the caller. */\n copy: (text: string) => Promise<ClipboardWriteResult>;\n\n /** Force-clear the `copied` flag. */\n reset: () => void;\n}\n\n/**\n * Wraps `navigator.clipboard.writeText` with a transient `copied` flag for\n * post-action UI (icon swap, \"Copied!\" tooltip). Pass `resetAfter: 0` to\n * keep `copied` true until you call `reset()`.\n *\n * `resetAfter` may be a ref or getter; it is read at copy time, so a window\n * changed between copies takes effect on the next one.\n */\nexport function useClipboard({ resetAfter = 2000 }: UseClipboardOptions = {}): ClipboardControls {\n const copied = shallowRef(false);\n const error = shallowRef<Error | null>(null);\n let timeout: ReturnType<typeof setTimeout> | null = null;\n let generation = 0;\n let disposed = false;\n\n const reset = (): void => {\n generation++;\n if (timeout) clearTimeout(timeout);\n timeout = null;\n copied.value = false;\n error.value = null;\n };\n\n const copy = async (text: string): Promise<ClipboardWriteResult> => {\n const operation = ++generation;\n if (timeout) clearTimeout(timeout);\n timeout = null;\n const result = await copyText(text);\n if (disposed || operation !== generation) return result;\n if (result.ok) {\n error.value = null;\n copied.value = true;\n const resetWindow = toValue(resetAfter);\n if (resetWindow > 0) {\n if (timeout) clearTimeout(timeout);\n timeout = setTimeout(() => {\n timeout = null;\n copied.value = false;\n }, resetWindow);\n }\n } else {\n copied.value = false;\n error.value =\n result.failure.status === 'unsupported' ? new Error('Clipboard is unavailable.') : result.failure.error;\n }\n return result;\n };\n\n onScopeDispose(() => {\n disposed = true;\n if (timeout) clearTimeout(timeout);\n });\n\n return { copied, error, copy, reset };\n}\n"],"names":[],"mappings":";;;AAmDA,SAAS,OAAO,OAAoC;AAClD,MAAI;AACF,QAAI,OAAO,UAAU,YAAY,UAAU,KAAM,QAAO;AACxD,UAAM,OAAiB,MAA6B;AACpD,WAAO,OAAO,SAAS,WAA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