@alfadocs/ui-kit-debug 0.10.0 → 0.12.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/_chunks/_commonjsHelpers-C6fGbg64.js +7 -0
- package/dist/_chunks/_commonjsHelpers-C6fGbg64.js.map +1 -0
- package/dist/_chunks/{ai-prompt-input-bAJwYu84.js → ai-prompt-input-noh-N3cf.js} +2 -2
- package/dist/_chunks/{ai-prompt-input-bAJwYu84.js.map → ai-prompt-input-noh-N3cf.js.map} +1 -1
- package/dist/_chunks/{contact-card-VJIUqKB2.js → contact-card-DTQUMetD.js} +22 -38
- package/dist/_chunks/contact-card-DTQUMetD.js.map +1 -0
- package/dist/_chunks/external-link-C6F25E6k.js +16 -0
- package/dist/_chunks/external-link-C6F25E6k.js.map +1 -0
- package/dist/_chunks/{file-upload-DIecAfC-.js → file-upload-nMh-1jDD.js} +2 -2
- package/dist/_chunks/{file-upload-DIecAfC-.js.map → file-upload-nMh-1jDD.js.map} +1 -1
- package/dist/_chunks/{index-CeY1nNvd.js → index-CFoBa86t.js} +61 -63
- package/dist/_chunks/{index-CeY1nNvd.js.map → index-CFoBa86t.js.map} +1 -1
- package/dist/_chunks/{link-BGpwaFik.js → link-DmM5IevO.js} +16 -26
- package/dist/_chunks/link-DmM5IevO.js.map +1 -0
- package/dist/_chunks/map-pin-B8STOPMJ.js +21 -0
- package/dist/_chunks/map-pin-B8STOPMJ.js.map +1 -0
- package/dist/_chunks/map-view-Dd48BxVB.js +1941 -0
- package/dist/_chunks/map-view-Dd48BxVB.js.map +1 -0
- package/dist/_chunks/{pdf-viewer-CNETPubN.js → pdf-viewer-CnEJvmXC.js} +407 -382
- package/dist/_chunks/pdf-viewer-CnEJvmXC.js.map +1 -0
- package/dist/_chunks/whatsapp-button-Bj5FIhpC.js +175 -0
- package/dist/_chunks/whatsapp-button-Bj5FIhpC.js.map +1 -0
- package/dist/agent-catalog.json +53 -1
- package/dist/components/ai-prompt-input/index.js +1 -1
- package/dist/components/contact-card/index.js +1 -1
- package/dist/components/file-upload/index.js +1 -1
- package/dist/components/index.d.ts +2 -0
- package/dist/components/index.d.ts.map +1 -1
- package/dist/components/link/index.js +1 -1
- package/dist/components/map-view/index.d.ts +3 -0
- package/dist/components/map-view/index.d.ts.map +1 -0
- package/dist/components/map-view/index.js +5 -0
- package/dist/components/map-view/index.js.map +1 -0
- package/dist/components/map-view/map-view.agent.d.ts +4 -0
- package/dist/components/map-view/map-view.agent.d.ts.map +1 -0
- package/dist/components/map-view/map-view.d.ts +78 -0
- package/dist/components/map-view/map-view.d.ts.map +1 -0
- package/dist/components/pdf-viewer/index.js +1 -1
- package/dist/components/pdf-viewer/pdf-viewer.d.ts +62 -0
- package/dist/components/pdf-viewer/pdf-viewer.d.ts.map +1 -1
- package/dist/components/whatsapp-button/index.d.ts +3 -0
- package/dist/components/whatsapp-button/index.d.ts.map +1 -0
- package/dist/components/whatsapp-button/index.js +5 -0
- package/dist/components/whatsapp-button/index.js.map +1 -0
- package/dist/components/whatsapp-button/whatsapp-button.d.ts +32 -0
- package/dist/components/whatsapp-button/whatsapp-button.d.ts.map +1 -0
- package/dist/i18n/config.js +47 -5
- package/dist/i18n/config.js.map +1 -1
- package/dist/i18n/resources.d.ts +42 -0
- package/dist/i18n/resources.d.ts.map +1 -1
- package/dist/index.js +348 -344
- package/dist/index.js.map +1 -1
- package/dist/locales/de.json +15 -1
- package/dist/locales/en.json +15 -1
- package/dist/locales/it.json +15 -1
- package/dist/tokens/google-maps-theme.d.ts +15 -0
- package/dist/tokens/google-maps-theme.d.ts.map +1 -0
- package/dist/tokens.css +1 -1
- package/package.json +15 -1
- package/dist/_chunks/contact-card-VJIUqKB2.js.map +0 -1
- package/dist/_chunks/link-BGpwaFik.js.map +0 -1
- package/dist/_chunks/pdf-viewer-CNETPubN.js.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pdf-viewer-CnEJvmXC.js","sources":["../../node_modules/lucide-react/dist/esm/icons/zoom-in.js","../../node_modules/lucide-react/dist/esm/icons/zoom-out.js","../../src/components/pdf-viewer/pdf-viewer.agent.ts","../../src/components/pdf-viewer/pdf-viewer.tsx"],"sourcesContent":["/**\n * @license lucide-react v1.8.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.js';\n\nconst __iconNode = [\n [\"circle\", { cx: \"11\", cy: \"11\", r: \"8\", key: \"4ej97u\" }],\n [\"line\", { x1: \"21\", x2: \"16.65\", y1: \"21\", y2: \"16.65\", key: \"13gj7c\" }],\n [\"line\", { x1: \"11\", x2: \"11\", y1: \"8\", y2: \"14\", key: \"1vmskp\" }],\n [\"line\", { x1: \"8\", x2: \"14\", y1: \"11\", y2: \"11\", key: \"durymu\" }]\n];\nconst ZoomIn = createLucideIcon(\"zoom-in\", __iconNode);\n\nexport { __iconNode, ZoomIn as default };\n//# sourceMappingURL=zoom-in.js.map\n","/**\n * @license lucide-react v1.8.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.js';\n\nconst __iconNode = [\n [\"circle\", { cx: \"11\", cy: \"11\", r: \"8\", key: \"4ej97u\" }],\n [\"line\", { x1: \"21\", x2: \"16.65\", y1: \"21\", y2: \"16.65\", key: \"13gj7c\" }],\n [\"line\", { x1: \"8\", x2: \"14\", y1: \"11\", y2: \"11\", key: \"durymu\" }]\n];\nconst ZoomOut = createLucideIcon(\"zoom-out\", __iconNode);\n\nexport { __iconNode, ZoomOut as default };\n//# sourceMappingURL=zoom-out.js.map\n","import type { AgentAdapter } from '../../agent/types';\nimport type { PDFViewerHandle } from './pdf-viewer';\n\nexport const pdfViewerAgent: AgentAdapter<PDFViewerHandle> = {\n id: 'pdf-viewer',\n capabilities: ['paginate', 'view_change', 'filter'],\n state: {},\n actions: {\n go_to_page: {\n safety: 'read',\n argsType: '{ page: number }',\n description: 'Navigate to a specific 1-indexed page.',\n invoke: (handle, args: { page: number }) => {\n handle.goToPage(args.page);\n },\n },\n set_zoom: {\n safety: 'read',\n argsType: '{ zoom: PDFZoomPreset }',\n description: 'Apply a zoom preset.',\n invoke: (\n handle,\n args: { zoom: Parameters<PDFViewerHandle['setZoom']>[0] },\n ) => {\n handle.setZoom(args.zoom);\n },\n },\n search: {\n safety: 'read',\n argsType: '{ query: string }',\n description:\n 'Search the document for the given query and highlight matches.',\n invoke: (handle, args: { query: string }) => {\n handle.search(args.query);\n },\n },\n print: {\n safety: 'read',\n description: 'Open the browser print dialog for the document.',\n invoke: (handle) => {\n handle.print();\n },\n },\n },\n domHooks: {\n root: { attr: 'data-component', value: 'pdf-viewer' },\n instanceId: {\n attr: 'data-component-id',\n sourceProp: 'id',\n description: 'Sourced from the id prop.',\n },\n },\n};\n","/* ------------------------------------------------------------------ */\n/* PDFViewer — thin React wrapper over Mozilla's pdfjs-dist. */\n/* */\n/* - Worker: loaded once at module scope via Vite's `?url` asset */\n/* import; consumers never configure it (08-third-party §PDF Viewer). */\n/* - Lazy rendering: an IntersectionObserver renders only visible + */\n/* ±1 buffer pages; off-screen pages release GPU memory by setting */\n/* `canvas.width = 0` while the wrapper <article> keeps its reserved */\n/* height so scroll position is stable. */\n/* - Toolbar: WAI-ARIA `role=\"toolbar\"` with roving tabindex (same */\n/* pattern as RichTextEditor — see 05-accessibility.mdx §42). */\n/* - Find bar: Radix Popover; Cmd/Ctrl+F opens; matches decorated in */\n/* the text layer with a `--warning`-tinted background. */\n/* - i18n: every string via `t('pdf.*')`. Icons flipped via `rtl:…`. */\n/* */\n/* TODO: */\n/* - Full PDF.js `printService` integration (A4 / US Letter, 150 DPI,*/\n/* hidden high-DPI canvas). For now `print()` calls `window.print()`*/\n/* which renders the viewer chrome — the `@media print` rule lives */\n/* in a future theme bridge. */\n/* - AnnotationLayer for form fields and links (08-third-party). */\n/* - Accessibility-tag surfacing via `aria-describedby` per the user */\n/* story's screen-reader acceptance row. */\n/* ------------------------------------------------------------------ */\n\nimport {\n forwardRef,\n useCallback,\n useEffect,\n useId,\n useImperativeHandle,\n useMemo,\n useRef,\n useState,\n type CSSProperties,\n type KeyboardEvent as ReactKeyboardEvent,\n type ReactNode,\n} from 'react';\nimport * as pdfjsLib from 'pdfjs-dist';\nimport type {\n PDFDocumentProxy,\n PDFPageProxy,\n} from 'pdfjs-dist/types/src/display/api';\nimport type { PageViewport } from 'pdfjs-dist/types/src/display/display_utils';\nimport { cva } from 'class-variance-authority';\nimport { useTranslation } from 'react-i18next';\nimport * as RadixPopover from '@radix-ui/react-popover';\nimport {\n ChevronLeft,\n ChevronRight,\n ZoomIn,\n ZoomOut,\n Search,\n Printer,\n X,\n} from 'lucide-react';\n\n/* ------------------------------------------------------------------ */\n/* Worker setup — one-shot at module scope */\n/* ------------------------------------------------------------------ */\n\n// Vite resolves `?url` to a static URL string at build time. This keeps\n// PDF.js off the main bundle and lets the consumer not think about it.\nimport pdfjsWorkerUrl from 'pdfjs-dist/build/pdf.worker.min.mjs?url';\n\nimport { Spinner } from '../spinner';\nimport { Alert } from '../alert';\nimport { useAgentRegistration } from '../../agent/registry';\nimport { pdfViewerAgent } from './pdf-viewer.agent';\n\npdfjsLib.GlobalWorkerOptions.workerSrc = pdfjsWorkerUrl;\n\n/* ------------------------------------------------------------------ */\n/* Public types */\n/* ------------------------------------------------------------------ */\n\nexport type PDFZoomPreset = 'fit-width' | 'fit-page' | 'actual-size' | number;\n\nexport type PDFPageRotation = 0 | 90 | 180 | 270;\n\n/**\n * Arguments passed to `renderPageOverlay` for each rendered page.\n *\n * `pageWidthCss` and `pageHeightCss` are post-zoom, post-rotation CSS\n * pixel dimensions — exactly the rendered box the consumer is\n * positioning content over. They update on resize, zoom, and rotation\n * changes; the render-prop re-runs on every change so positioned\n * children stay in sync with the page geometry without the consumer\n * touching a `ResizeObserver`.\n */\nexport interface PDFPageOverlayArgs {\n /** 1-based page number. */\n pageNumber: number;\n /** CSS-pixel width of the rendered page (post-zoom, post-rotation). */\n pageWidthCss: number;\n /** CSS-pixel height of the rendered page. */\n pageHeightCss: number;\n /**\n * Effective rotation of the rendered viewport in degrees. Reflects\n * `pageRotation` (if set) overriding the page's intrinsic `/Rotate`,\n * otherwise the intrinsic rotation.\n */\n rotation: PDFPageRotation;\n}\n\nexport interface PDFViewerProps {\n /** Opaque instance id — emitted as `data-component-id` for the agent registry. */\n id?: string;\n /** PDF source — URL string, ArrayBuffer, or Uint8Array. */\n src: string | ArrayBuffer | Uint8Array;\n /** Initial page (1-based). Default 1. */\n initialPage?: number;\n /** Initial zoom preset. Default 'fit-width'. */\n initialZoom?: PDFZoomPreset;\n /**\n * Force every page to render at this rotation, overriding the page's\n * intrinsic `/Rotate` metadata. Useful for scanned PDFs that opened\n * sideways, and for the signing-flow consumer that lets users\n * straighten misrotated pages before placing signature fields.\n * `undefined` (default) honours each page's intrinsic rotation.\n */\n pageRotation?: PDFPageRotation;\n /**\n * Render a layer of arbitrary React content positioned over each\n * rendered PDF page — signature fields, redaction boxes, annotation\n * pins, anything that needs to live in PDF coordinate space.\n *\n * The render-prop is invoked **only for pages currently inside the\n * IntersectionObserver buffer** (visible ±1), and the returned tree\n * unmounts when the page leaves the buffer. Consumer-held timers /\n * fetches / subscriptions in overlay children therefore tear down\n * automatically with the page. The overlay container is absolutely\n * positioned, sized to the rendered page, and has\n * `pointer-events: auto` so consumer children can be interactive.\n * Consumers position children themselves (typically\n * `position: absolute; inset-inline-start: %; inset-block-start: %`).\n *\n * The render-prop re-runs on resize, zoom, and rotation changes so\n * positioned children stay aligned without the consumer wiring a\n * `ResizeObserver`. Pages already declare `data-page-number` on the\n * `<article>` ancestor; consumer-rendered children should be\n * keyboard-reachable per the kit's a11y contract.\n *\n * Composition note: PDF.js's `AnnotationLayer` (for native form\n * fields and link annotations) is not yet wired in — see the file\n * header TODO. When it lands, `renderPageOverlay` will compose\n * **above** the AnnotationLayer in z-order, since interactive\n * consumer content should sit on top of intrinsic page widgets.\n */\n renderPageOverlay?: (args: PDFPageOverlayArgs) => ReactNode;\n /** Emits when the currently-most-visible page changes. */\n onPageChange?: (page: number) => void;\n /** Emits once the PDF document has loaded. */\n onLoadComplete?: (info: { numPages: number; title?: string }) => void;\n /** Emits on any load / render error. */\n onError?: (error: Error) => void;\n /** Show the toolbar. Default `true`. */\n toolbar?: boolean;\n /** Accessible label for the viewer region. */\n ariaLabel?: string;\n /** Extra class names on the wrapper. */\n className?: string;\n}\n\nexport interface PDFViewerHandle {\n goToPage: (page: number) => void;\n setZoom: (zoom: PDFZoomPreset) => void;\n search: (query: string) => void;\n print: () => void;\n}\n\n/* ------------------------------------------------------------------ */\n/* CVA */\n/* ------------------------------------------------------------------ */\n\nconst wrapperVariants = cva(\n [\n 'ds:pdf-viewer-alfadocs ds:flex ds:flex-col',\n 'ds:gap-[var(--spacing-sm)]',\n 'ds:bg-[var(--background)] ds:text-[var(--foreground)]',\n 'ds:rounded-[var(--radius-md)] ds:border ds:border-[color:var(--border)]',\n 'ds:overflow-hidden',\n 'ds:focus-visible:outline-[length:var(--focus-ring-width)]',\n 'ds:focus-visible:outline-solid',\n 'ds:focus-visible:outline-[var(--ring)]',\n 'ds:forced-colors:focus-visible:outline-[CanvasText]',\n ].join(' '),\n);\n\nconst toolbarVariants = cva(\n [\n 'ds:flex ds:flex-wrap ds:items-center ds:gap-[var(--spacing-xs)]',\n 'ds:ps-[var(--spacing-sm)] ds:pe-[var(--spacing-sm)]',\n 'ds:pt-[var(--spacing-xs)] ds:pb-[var(--spacing-xs)]',\n 'ds:bg-[var(--background)]',\n 'ds:border-b ds:border-[color:var(--border)]',\n ].join(' '),\n);\n\nconst toolbarButtonVariants = cva(\n [\n 'ds:inline-flex ds:items-center ds:justify-center',\n 'ds:min-block-size-[var(--min-target-size)]',\n 'ds:min-inline-size-[var(--min-target-size)]',\n 'ds:gap-[var(--spacing-xs)]',\n 'ds:ps-[var(--spacing-sm)] ds:pe-[var(--spacing-sm)]',\n 'ds:rounded-[var(--radius-sm)] ds:bg-transparent ds:text-[var(--foreground)]',\n 'ds:transition-colors ds:duration-[var(--animation-duration)] ds:motion-reduce:transition-none',\n 'ds:hover:bg-[var(--muted)]',\n 'ds:focus-visible:outline-[length:var(--focus-ring-width)]',\n 'ds:focus-visible:outline-solid',\n 'ds:focus-visible:outline-[var(--ring)]',\n 'ds:focus-visible:outline-offset-[length:var(--focus-ring-offset)]',\n 'ds:forced-colors:focus-visible:outline-[CanvasText]',\n 'ds:aria-disabled:opacity-[var(--opacity-50)] ds:aria-disabled:cursor-not-allowed',\n ].join(' '),\n);\n\nconst pageInputVariants = cva(\n [\n 'ds:min-block-size-[var(--min-target-size)]',\n 'ds:inline-size-[4rem] ds:text-center',\n 'ds:ps-[var(--spacing-xs)] ds:pe-[var(--spacing-xs)]',\n 'ds:rounded-[var(--radius-sm)] ds:border ds:border-[color:var(--border)]',\n 'ds:bg-[var(--background)] ds:text-[var(--foreground)]',\n 'ds:focus-visible:outline-[length:var(--focus-ring-width)]',\n 'ds:focus-visible:outline-solid',\n 'ds:focus-visible:outline-[var(--ring)]',\n 'ds:forced-colors:focus-visible:outline-[CanvasText]',\n ].join(' '),\n);\n\nconst zoomSelectVariants = cva(\n [\n 'ds:min-block-size-[var(--min-target-size)]',\n 'ds:ps-[var(--spacing-sm)] ds:pe-[var(--spacing-sm)]',\n 'ds:rounded-[var(--radius-sm)] ds:border ds:border-[color:var(--border)]',\n 'ds:bg-[var(--background)] ds:text-[var(--foreground)]',\n 'ds:focus-visible:outline-[length:var(--focus-ring-width)]',\n 'ds:focus-visible:outline-solid',\n 'ds:focus-visible:outline-[var(--ring)]',\n 'ds:forced-colors:focus-visible:outline-[CanvasText]',\n ].join(' '),\n);\n\nconst pagesContainerVariants = cva(\n [\n 'ds:relative ds:flex ds:flex-col ds:items-center',\n 'ds:gap-[var(--spacing-md)]',\n 'ds:p-[var(--spacing-md)]',\n 'ds:bg-[var(--muted)]',\n 'ds:overflow-auto',\n 'ds:min-block-size-[30rem]',\n 'ds:max-block-size-[80vh]',\n ].join(' '),\n);\n\nconst pageArticleVariants = cva(\n [\n 'ds:relative ds:flex ds:items-center ds:justify-center',\n 'ds:bg-[var(--background)]',\n 'ds:shadow-[var(--shadow-md)]',\n 'ds:rounded-[var(--radius-sm)]',\n ].join(' '),\n);\n\n/* ------------------------------------------------------------------ */\n/* Helpers */\n/* ------------------------------------------------------------------ */\n\nconst ZOOM_PRESETS: ReadonlyArray<PDFZoomPreset> = [\n 'fit-width',\n 'fit-page',\n 'actual-size',\n 0.5,\n 0.75,\n 1,\n 1.25,\n 1.5,\n 2,\n];\n\nfunction isNumberZoom(z: PDFZoomPreset): z is number {\n return typeof z === 'number';\n}\n\nfunction resolveScale(\n zoom: PDFZoomPreset,\n viewport: PageViewport,\n container: HTMLElement | null,\n): number {\n if (isNumberZoom(zoom)) return zoom;\n if (zoom === 'actual-size') return 1;\n if (!container) return 1;\n const style = window.getComputedStyle(container);\n const padX =\n parseFloat(style.paddingInlineStart || '0') +\n parseFloat(style.paddingInlineEnd || '0');\n const padY =\n parseFloat(style.paddingBlockStart || '0') +\n parseFloat(style.paddingBlockEnd || '0');\n const availW = Math.max(container.clientWidth - padX, 1);\n const availH = Math.max(container.clientHeight - padY, 1);\n const baseW = viewport.width;\n const baseH = viewport.height;\n if (zoom === 'fit-width') return availW / baseW;\n // fit-page\n return Math.min(availW / baseW, availH / baseH);\n}\n\ninterface LoadedDocument {\n doc: PDFDocumentProxy;\n numPages: number;\n title?: string;\n}\n\n/* ------------------------------------------------------------------ */\n/* PDFViewer */\n/* ------------------------------------------------------------------ */\n\nexport const PDFViewer = forwardRef<PDFViewerHandle, PDFViewerProps>(\n (\n {\n id,\n src,\n initialPage = 1,\n initialZoom = 'fit-width',\n pageRotation,\n renderPageOverlay,\n onPageChange,\n onLoadComplete,\n onError,\n toolbar = true,\n ariaLabel,\n className,\n },\n ref,\n ) => {\n const { t } = useTranslation();\n const rawId = useId();\n const viewerId = useMemo(\n () => `pdf-${rawId.replace(/[^a-zA-Z0-9-_]/g, '')}`,\n [rawId],\n );\n\n /* ---- RTL / reduced motion ------------------------------------ */\n const [isRtl, setIsRtl] = useState(false);\n const [reducedMotion, setReducedMotion] = useState(false);\n useEffect(() => {\n if (typeof document === 'undefined') return undefined;\n setIsRtl(document.documentElement.dir === 'rtl');\n const mql = window.matchMedia('(prefers-reduced-motion: reduce)');\n const sync = (): void => setReducedMotion(mql.matches);\n sync();\n mql.addEventListener('change', sync);\n return () => mql.removeEventListener('change', sync);\n }, []);\n\n /* ---- Document state ------------------------------------------ */\n const [loaded, setLoaded] = useState<LoadedDocument | null>(null);\n const [loadError, setLoadError] = useState<Error | null>(null);\n const [currentPage, setCurrentPage] = useState(initialPage);\n const [zoom, setZoomState] = useState<PDFZoomPreset>(initialZoom);\n const [visibleRange, setVisibleRange] = useState<{\n start: number;\n end: number;\n }>({ start: Math.max(1, initialPage - 1), end: initialPage + 1 });\n const [announcement, setAnnouncement] = useState<string>('');\n const [searchOpen, setSearchOpen] = useState(false);\n const [searchQuery, setSearchQuery] = useState('');\n const [searchMatches, setSearchMatches] = useState<{\n current: number;\n total: number;\n }>({ current: 0, total: 0 });\n\n const onPageChangeRef =\n useRef<PDFViewerProps['onPageChange']>(onPageChange);\n const onLoadCompleteRef =\n useRef<PDFViewerProps['onLoadComplete']>(onLoadComplete);\n const onErrorRef = useRef<PDFViewerProps['onError']>(onError);\n useEffect(() => {\n onPageChangeRef.current = onPageChange;\n onLoadCompleteRef.current = onLoadComplete;\n onErrorRef.current = onError;\n }, [onPageChange, onLoadComplete, onError]);\n\n /* ---- Load the PDF document ----------------------------------- */\n // Ref tracking the currently-loaded document so the cleanup path sees\n // the latest proxy (state closed over in the effect would be stale).\n const loadedRef = useRef<LoadedDocument | null>(null);\n useEffect(() => {\n loadedRef.current = loaded;\n }, [loaded]);\n useEffect(() => {\n let cancelled = false;\n setLoaded(null);\n setLoadError(null);\n\n // `getDocument` accepts a URL string, Uint8Array, or an object with a\n // `data` field. Narrow to what pdfjs expects at runtime. We always pass\n // an options object so that `disableJavaScript` and `isEvalSupported`\n // flow through — patient-uploaded PDFs must not execute embedded JS.\n // See security-hardening.mdx.\n const baseOptions = {\n disableJavaScript: true,\n isEvalSupported: false,\n } as const;\n const task = pdfjsLib.getDocument(\n typeof src === 'string'\n ? { url: src, ...baseOptions }\n : src instanceof Uint8Array\n ? { data: src, ...baseOptions }\n : { data: new Uint8Array(src), ...baseOptions },\n );\n\n task.promise.then(\n async (doc) => {\n if (cancelled) return;\n let title: string | undefined;\n try {\n const meta = await doc.getMetadata();\n const info = meta?.info as { Title?: string } | undefined;\n title = info?.Title;\n } catch {\n title = undefined;\n }\n if (cancelled) {\n // Unmounted while metadata was resolving — destroy the doc we\n // just acquired so the worker channel and font resources are\n // released.\n try {\n await doc.destroy();\n } catch {\n /* ignore */\n }\n return;\n }\n const next: LoadedDocument = { doc, numPages: doc.numPages, title };\n setLoaded(next);\n onLoadCompleteRef.current?.({ numPages: doc.numPages, title });\n },\n (err: unknown) => {\n if (cancelled) return;\n const error = err instanceof Error ? err : new Error(String(err));\n setLoadError(error);\n onErrorRef.current?.(error);\n },\n );\n\n return () => {\n cancelled = true;\n task.destroy();\n // Release the previously-loaded PDFDocumentProxy when src changes\n // or the component unmounts. PDFDocumentProxy holds fonts, embedded\n // resources, and the worker channel — without this call, switching\n // PDFs progressively leaks memory in a long-running SPA.\n const prev = loadedRef.current;\n if (prev) {\n try {\n void prev.doc.destroy();\n } catch {\n /* ignore */\n }\n loadedRef.current = null;\n }\n };\n }, [src]);\n\n /* ---- Current-page announcement ------------------------------- */\n useEffect(() => {\n if (!loaded) return;\n setAnnouncement(\n t('pdf.pageOf', { current: currentPage, total: loaded.numPages }),\n );\n onPageChangeRef.current?.(currentPage);\n }, [currentPage, loaded, t]);\n\n /* ---- Imperative handle --------------------------------------- */\n const pagesContainerRef = useRef<HTMLDivElement>(null);\n const pageArticleRefs = useRef<Array<HTMLElement | null>>([]);\n\n const goToPage = useCallback(\n (page: number) => {\n if (!loaded) return;\n const clamped = Math.max(1, Math.min(page, loaded.numPages));\n setCurrentPage(clamped);\n const article = pageArticleRefs.current[clamped - 1];\n if (article) {\n article.scrollIntoView({\n behavior: reducedMotion ? 'auto' : 'auto',\n block: 'start',\n });\n }\n },\n [loaded, reducedMotion],\n );\n\n const setZoom = useCallback((next: PDFZoomPreset) => {\n setZoomState(next);\n }, []);\n\n const internalPrint = useCallback(() => {\n // TODO: wire PDF.js printService for accurate, chrome-free output.\n if (typeof window !== 'undefined') window.print();\n }, []);\n\n const search = useCallback((query: string) => {\n setSearchQuery(query);\n setSearchOpen(query.length > 0);\n }, []);\n\n const agentHandle = useMemo<PDFViewerHandle>(\n () => ({\n goToPage,\n setZoom,\n search,\n print: internalPrint,\n }),\n [goToPage, setZoom, search, internalPrint],\n );\n useImperativeHandle(ref, () => agentHandle, [agentHandle]);\n useAgentRegistration(pdfViewerAgent, agentHandle, id);\n\n /* ---- Keyboard shortcuts on the viewer ------------------------ */\n const handleViewerKeyDown = useCallback(\n (event: ReactKeyboardEvent<HTMLDivElement>): void => {\n if (!loaded) return;\n const mod = event.metaKey || event.ctrlKey;\n\n if (event.key === 'PageDown') {\n event.preventDefault();\n goToPage(currentPage + 1);\n return;\n }\n if (event.key === 'PageUp') {\n event.preventDefault();\n goToPage(currentPage - 1);\n return;\n }\n if (event.key === 'Home') {\n event.preventDefault();\n goToPage(1);\n return;\n }\n if (event.key === 'End') {\n event.preventDefault();\n goToPage(loaded.numPages);\n return;\n }\n\n if (mod && event.key.toLowerCase() === 'f') {\n event.preventDefault();\n setSearchOpen(true);\n return;\n }\n if (mod && (event.key === '+' || event.key === '=')) {\n event.preventDefault();\n setZoomState((z) => (isNumberZoom(z) ? Math.min(z * 1.25, 4) : 1.25));\n return;\n }\n if (mod && event.key === '-') {\n event.preventDefault();\n setZoomState((z) =>\n isNumberZoom(z) ? Math.max(z / 1.25, 0.25) : 0.75,\n );\n return;\n }\n if (mod && event.key === '0') {\n event.preventDefault();\n setZoomState('fit-width');\n return;\n }\n if (mod && event.key.toLowerCase() === 'p') {\n event.preventDefault();\n internalPrint();\n }\n },\n [currentPage, goToPage, internalPrint, loaded],\n );\n\n /* ---- Intersection observer — visible page tracking ----------- */\n // `currentPage` is referenced only for a fallback inside the observer\n // callback. Including it in the effect deps would destroy and re-create\n // the observer every time the callback updates currentPage — on a\n // 100-page PDF that's O(n) observe() calls on every scroll tick.\n const currentPageRef = useRef<number>(currentPage);\n useEffect(() => {\n currentPageRef.current = currentPage;\n }, [currentPage]);\n useEffect(() => {\n if (!loaded) return undefined;\n const container = pagesContainerRef.current;\n if (!container) return undefined;\n\n const visibility = new Map<number, number>();\n const observer = new IntersectionObserver(\n (entries) => {\n for (const entry of entries) {\n const pageAttr = (entry.target as HTMLElement).dataset.pageNumber;\n if (!pageAttr) continue;\n const n = Number(pageAttr);\n visibility.set(n, entry.intersectionRatio);\n }\n // Compute new \"most visible\" page + visible range\n let best = currentPageRef.current;\n let bestRatio = 0;\n let minVisible = Infinity;\n let maxVisible = -Infinity;\n for (const [page, ratio] of visibility.entries()) {\n if (ratio > bestRatio) {\n best = page;\n bestRatio = ratio;\n }\n if (ratio > 0) {\n minVisible = Math.min(minVisible, page);\n maxVisible = Math.max(maxVisible, page);\n }\n }\n if (bestRatio > 0 && best !== currentPageRef.current) {\n setCurrentPage(best);\n }\n if (minVisible !== Infinity) {\n setVisibleRange({\n start: Math.max(1, minVisible - 1),\n end: Math.min(loaded.numPages, maxVisible + 1),\n });\n }\n },\n { root: container, threshold: [0, 0.25, 0.5, 0.75, 1] },\n );\n\n pageArticleRefs.current.forEach((el) => {\n if (el) observer.observe(el);\n });\n return () => observer.disconnect();\n }, [loaded]);\n\n /* ---- Resize observer — recompute scale on fit presets -------- */\n const [containerSizeTick, setContainerSizeTick] = useState(0);\n useEffect(() => {\n const container = pagesContainerRef.current;\n if (!container || typeof ResizeObserver === 'undefined') return undefined;\n const ro = new ResizeObserver(() => {\n if (zoom === 'fit-width' || zoom === 'fit-page') {\n setContainerSizeTick((v) => v + 1);\n }\n });\n ro.observe(container);\n return () => ro.disconnect();\n }, [zoom]);\n\n /* ---- Toolbar roving tabindex --------------------------------- */\n const toolbarButtonsRef = useRef<Array<HTMLElement | null>>([]);\n const [toolbarFocusIndex, setToolbarFocusIndex] = useState(0);\n const registerToolbarButton = useCallback(\n (index: number) => (el: HTMLElement | null) => {\n toolbarButtonsRef.current[index] = el;\n },\n [],\n );\n const focusToolbarButton = useCallback((index: number) => {\n const btn = toolbarButtonsRef.current[index];\n if (btn) btn.focus();\n }, []);\n const toolbarCount = 8; // see render list below\n const handleToolbarKeyDown = useCallback(\n (event: ReactKeyboardEvent<HTMLElement>) => {\n const forward = isRtl ? 'ArrowLeft' : 'ArrowRight';\n const backward = isRtl ? 'ArrowRight' : 'ArrowLeft';\n let next: number | null = null;\n if (event.key === forward)\n next = (toolbarFocusIndex + 1) % toolbarCount;\n else if (event.key === backward)\n next = (toolbarFocusIndex - 1 + toolbarCount) % toolbarCount;\n else if (event.key === 'Home') next = 0;\n else if (event.key === 'End') next = toolbarCount - 1;\n if (next !== null) {\n event.preventDefault();\n setToolbarFocusIndex(next);\n focusToolbarButton(next);\n }\n },\n [focusToolbarButton, isRtl, toolbarFocusIndex],\n );\n\n /* ---- Render ---------------------------------------------------*/\n if (loadError) {\n return (\n <div\n className={[wrapperVariants(), className].filter(Boolean).join(' ')}\n aria-label={ariaLabel ?? t('pdf.error')}\n >\n <div className=\"ds:p-[var(--spacing-lg)]\">\n <Alert variant=\"error\" live=\"polite\">\n <Alert.Description>\n {t('pdf.error')}: {loadError.message}\n </Alert.Description>\n </Alert>\n </div>\n </div>\n );\n }\n\n return (\n // eslint-disable-next-line jsx-a11y/no-noninteractive-element-interactions -- region-level keyboard shortcuts (search, zoom) intentionally captured at the wrapper for the entire PDF viewer\n <div\n id={viewerId}\n role=\"region\"\n aria-label={ariaLabel ?? t('pdf.toolbarLabel')}\n className={[wrapperVariants(), className].filter(Boolean).join(' ')}\n dir={isRtl ? 'rtl' : undefined}\n onKeyDown={handleViewerKeyDown}\n tabIndex={-1}\n data-component=\"pdf-viewer\"\n data-component-id={id}\n // Exposed for CI assertion (story `WorkerSameOrigin`) — the\n // worker URL must be same-origin so a strict CSP can block\n // cross-origin worker loads. Read by the play function via\n // `getAttribute('data-pdfjs-worker-src')`.\n data-pdfjs-worker-src={pdfjsWorkerUrl}\n >\n {toolbar ? (\n <PDFToolbar\n currentPage={currentPage}\n numPages={loaded?.numPages ?? 0}\n zoom={zoom}\n onPrev={() => goToPage(currentPage - 1)}\n onNext={() => goToPage(currentPage + 1)}\n onJump={(p) => goToPage(p)}\n onZoomIn={() => {\n setZoomState((z) =>\n isNumberZoom(z) ? Math.min(z * 1.25, 4) : 1.25,\n );\n }}\n onZoomOut={() => {\n setZoomState((z) =>\n isNumberZoom(z) ? Math.max(z / 1.25, 0.25) : 0.75,\n );\n }}\n onZoomPreset={(v) => setZoomState(v)}\n onOpenSearch={() => setSearchOpen(true)}\n onPrint={internalPrint}\n searchOpen={searchOpen}\n onSearchOpenChange={setSearchOpen}\n searchQuery={searchQuery}\n onSearchQueryChange={(v) => {\n setSearchQuery(v);\n }}\n searchMatches={searchMatches}\n register={registerToolbarButton}\n focusIndex={toolbarFocusIndex}\n setFocusIndex={setToolbarFocusIndex}\n onToolbarKeyDown={handleToolbarKeyDown}\n isRtl={isRtl}\n />\n ) : null}\n\n {/* aria-live announcements for page / zoom changes */}\n <div aria-live=\"polite\" aria-atomic=\"true\" className=\"ds:sr-only\">\n {announcement}\n </div>\n\n <div\n ref={pagesContainerRef}\n className={pagesContainerVariants()}\n data-testid=\"pdf-pages-container\"\n >\n {loaded ? (\n Array.from({ length: loaded.numPages }, (_, i) => i + 1).map(\n (pageNumber) => (\n <PDFPage\n key={pageNumber}\n pageNumber={pageNumber}\n totalPages={loaded.numPages}\n doc={loaded.doc}\n zoom={zoom}\n pageRotation={pageRotation}\n renderPageOverlay={renderPageOverlay}\n container={pagesContainerRef.current}\n resizeTick={containerSizeTick}\n shouldRender={\n pageNumber >= visibleRange.start &&\n pageNumber <= visibleRange.end\n }\n registerRef={(el) => {\n pageArticleRefs.current[pageNumber - 1] = el;\n }}\n searchQuery={searchQuery}\n onMatchCount={(count) => {\n // Aggregate simplistically: sum across visible pages.\n setSearchMatches((prev) => {\n if (count === 0 && prev.total === 0) return prev;\n return {\n current: Math.min(prev.current || 1, count || 1),\n total: Math.max(prev.total, count),\n };\n });\n }}\n />\n ),\n )\n ) : (\n <div className=\"ds:inline-flex ds:items-center ds:gap-[var(--spacing-sm)] ds:text-[var(--muted-foreground)] ds:p-[var(--spacing-lg)]\">\n <Spinner size=\"sm\" label={t('pdf.loading')} />\n <span>{t('pdf.loading')}</span>\n </div>\n )}\n </div>\n </div>\n );\n },\n);\n\nPDFViewer.displayName = 'PDFViewer';\n\n/* ------------------------------------------------------------------ */\n/* PDFToolbar */\n/* ------------------------------------------------------------------ */\n\ninterface PDFToolbarProps {\n currentPage: number;\n numPages: number;\n zoom: PDFZoomPreset;\n onPrev: () => void;\n onNext: () => void;\n onJump: (page: number) => void;\n onZoomIn: () => void;\n onZoomOut: () => void;\n onZoomPreset: (v: PDFZoomPreset) => void;\n onOpenSearch: () => void;\n onPrint: () => void;\n searchOpen: boolean;\n onSearchOpenChange: (v: boolean) => void;\n searchQuery: string;\n onSearchQueryChange: (v: string) => void;\n searchMatches: { current: number; total: number };\n register: (index: number) => (el: HTMLElement | null) => void;\n focusIndex: number;\n setFocusIndex: (n: number) => void;\n onToolbarKeyDown: (event: ReactKeyboardEvent<HTMLElement>) => void;\n isRtl: boolean;\n}\n\nfunction PDFToolbar(props: PDFToolbarProps): ReactNode {\n const { t } = useTranslation();\n const {\n currentPage,\n numPages,\n zoom,\n onPrev,\n onNext,\n onJump,\n onZoomIn,\n onZoomOut,\n onZoomPreset,\n onOpenSearch,\n onPrint,\n searchOpen,\n onSearchOpenChange,\n searchQuery,\n onSearchQueryChange,\n searchMatches,\n register,\n focusIndex,\n setFocusIndex,\n onToolbarKeyDown,\n } = props;\n\n const [pageInput, setPageInput] = useState(String(currentPage));\n useEffect(() => {\n setPageInput(String(currentPage));\n }, [currentPage]);\n\n const prevDisabled = currentPage <= 1;\n const nextDisabled = currentPage >= numPages;\n\n function commitPageInput(): void {\n const parsed = Number(pageInput);\n if (Number.isFinite(parsed) && parsed >= 1) {\n onJump(Math.min(parsed, numPages));\n } else {\n setPageInput(String(currentPage));\n }\n }\n\n function renderButton(opts: {\n index: number;\n label: string;\n disabled?: boolean;\n onActivate: () => void;\n icon: ReactNode;\n }): ReactNode {\n return (\n <button\n type=\"button\"\n ref={register(opts.index)}\n tabIndex={opts.index === focusIndex ? 0 : -1}\n onFocus={() => setFocusIndex(opts.index)}\n onKeyDown={onToolbarKeyDown}\n aria-label={opts.label}\n aria-disabled={opts.disabled || undefined}\n title={opts.label}\n onClick={(event) => {\n if (opts.disabled) {\n event.preventDefault();\n return;\n }\n opts.onActivate();\n }}\n className={toolbarButtonVariants()}\n >\n {opts.icon}\n </button>\n );\n }\n\n return (\n <div\n role=\"toolbar\"\n aria-label={t('pdf.toolbarLabel')}\n className={toolbarVariants()}\n >\n {renderButton({\n index: 0,\n label: t('pdf.previousPage'),\n disabled: prevDisabled,\n onActivate: onPrev,\n icon: (\n <ChevronLeft\n aria-hidden=\"true\"\n className=\"ds:block-size-4 ds:inline-size-4 ds:rtl:rotate-180\"\n />\n ),\n })}\n\n {renderButton({\n index: 1,\n label: t('pdf.nextPage'),\n disabled: nextDisabled,\n onActivate: onNext,\n icon: (\n <ChevronRight\n aria-hidden=\"true\"\n className=\"ds:block-size-4 ds:inline-size-4 ds:rtl:rotate-180\"\n />\n ),\n })}\n\n <input\n type=\"number\"\n min={1}\n max={Math.max(numPages, 1)}\n value={pageInput}\n onChange={(e) => setPageInput(e.target.value)}\n onKeyDown={(e) => {\n if (e.key === 'Enter') {\n e.preventDefault();\n commitPageInput();\n }\n }}\n onBlur={commitPageInput}\n onFocus={() => setFocusIndex(2)}\n ref={register(2) as (el: HTMLInputElement | null) => void}\n tabIndex={focusIndex === 2 ? 0 : -1}\n aria-label={t('pdf.currentPageInput')}\n className={pageInputVariants()}\n />\n\n <span\n aria-hidden=\"true\"\n className=\"type-body-sm ds:text-[var(--muted-foreground)]\"\n >\n {t('pdf.pageOf', { current: currentPage, total: numPages || 0 })}\n </span>\n\n <span\n aria-hidden=\"true\"\n className=\"ds:inline-block ds:block-size-6 ds:inline-size-px ds:bg-[var(--border)] ds:ms-[var(--spacing-xs)] ds:me-[var(--spacing-xs)]\"\n />\n\n {renderButton({\n index: 3,\n label: t('pdf.zoom.out'),\n onActivate: onZoomOut,\n icon: (\n <ZoomOut\n aria-hidden=\"true\"\n className=\"ds:block-size-4 ds:inline-size-4\"\n />\n ),\n })}\n\n {renderButton({\n index: 4,\n label: t('pdf.zoom.in'),\n onActivate: onZoomIn,\n icon: (\n <ZoomIn\n aria-hidden=\"true\"\n className=\"ds:block-size-4 ds:inline-size-4\"\n />\n ),\n })}\n\n <select\n aria-label={t('pdf.zoom.preset')}\n value={typeof zoom === 'number' ? String(zoom) : zoom}\n onChange={(e) => {\n const v = e.target.value;\n if (v === 'fit-width' || v === 'fit-page' || v === 'actual-size') {\n onZoomPreset(v);\n } else {\n const parsed = Number(v);\n if (Number.isFinite(parsed)) onZoomPreset(parsed);\n }\n }}\n ref={register(5) as (el: HTMLSelectElement | null) => void}\n tabIndex={focusIndex === 5 ? 0 : -1}\n onFocus={() => setFocusIndex(5)}\n onKeyDown={onToolbarKeyDown}\n className={zoomSelectVariants()}\n >\n <option value=\"fit-width\">{t('pdf.zoom.fitWidth')}</option>\n <option value=\"fit-page\">{t('pdf.zoom.fitPage')}</option>\n <option value=\"actual-size\">{t('pdf.zoom.actualSize')}</option>\n {ZOOM_PRESETS.filter(isNumberZoom).map((n) => (\n <option key={n} value={String(n)}>\n {`${Math.round(n * 100)}%`}\n </option>\n ))}\n </select>\n\n <RadixPopover.Root open={searchOpen} onOpenChange={onSearchOpenChange}>\n <RadixPopover.Trigger asChild>\n {renderButton({\n index: 6,\n label: t('pdf.search.open'),\n onActivate: onOpenSearch,\n icon: (\n <Search\n aria-hidden=\"true\"\n className=\"ds:block-size-4 ds:inline-size-4\"\n />\n ),\n })}\n </RadixPopover.Trigger>\n <RadixPopover.Portal>\n <RadixPopover.Content\n sideOffset={8}\n className={[\n 'ds:z-[var(--z-popover)]',\n 'ds:bg-[var(--popover)] ds:text-[var(--popover-foreground)]',\n 'ds:rounded-[var(--radius-md)] ds:border ds:border-[color:var(--border)]',\n 'ds:shadow-[var(--shadow-lg)]',\n 'ds:p-[var(--spacing-sm)]',\n 'ds:flex ds:items-center ds:gap-[var(--spacing-xs)]',\n ].join(' ')}\n >\n <input\n type=\"search\"\n // eslint-disable-next-line jsx-a11y/no-autofocus -- focuses the search input when the toolbar opens to capture immediate typing\n autoFocus\n value={searchQuery}\n onChange={(e) => onSearchQueryChange(e.target.value)}\n placeholder={t('pdf.search.placeholder')}\n aria-label={t('pdf.search.placeholder')}\n className={pageInputVariants({\n className: 'ds:inline-size-[16rem] ds:text-start',\n })}\n />\n <span\n aria-live=\"polite\"\n className=\"type-meta ds:text-[var(--muted-foreground)]\"\n >\n {searchMatches.total > 0\n ? t('pdf.search.countOfTotal', {\n current: searchMatches.current,\n total: searchMatches.total,\n })\n : searchQuery\n ? t('pdf.search.noResults')\n : ''}\n </span>\n <RadixPopover.Close asChild>\n <button\n type=\"button\"\n aria-label={t('pdf.search.close')}\n className={toolbarButtonVariants()}\n >\n <X\n aria-hidden=\"true\"\n className=\"ds:block-size-4 ds:inline-size-4\"\n />\n </button>\n </RadixPopover.Close>\n </RadixPopover.Content>\n </RadixPopover.Portal>\n </RadixPopover.Root>\n\n {renderButton({\n index: 7,\n label: t('pdf.print'),\n onActivate: onPrint,\n icon: (\n <Printer\n aria-hidden=\"true\"\n className=\"ds:block-size-4 ds:inline-size-4\"\n />\n ),\n })}\n </div>\n );\n}\n\n/* ------------------------------------------------------------------ */\n/* PDFPage — renders one canvas + text layer */\n/* ------------------------------------------------------------------ */\n\ninterface PDFPageProps {\n pageNumber: number;\n totalPages: number;\n doc: PDFDocumentProxy;\n zoom: PDFZoomPreset;\n pageRotation: PDFPageRotation | undefined;\n renderPageOverlay: ((args: PDFPageOverlayArgs) => ReactNode) | undefined;\n container: HTMLElement | null;\n resizeTick: number;\n shouldRender: boolean;\n registerRef: (el: HTMLElement | null) => void;\n searchQuery: string;\n onMatchCount: (count: number) => void;\n}\n\nfunction PDFPage(props: PDFPageProps): ReactNode {\n const {\n pageNumber,\n totalPages,\n doc,\n zoom,\n pageRotation,\n renderPageOverlay,\n container,\n resizeTick,\n shouldRender,\n registerRef,\n searchQuery,\n onMatchCount,\n } = props;\n const { t } = useTranslation();\n\n const canvasRef = useRef<HTMLCanvasElement>(null);\n const textLayerRef = useRef<HTMLDivElement>(null);\n const [dims, setDims] = useState<{ width: number; height: number }>({\n width: 612,\n height: 792,\n });\n const [pageProxy, setPageProxy] = useState<PDFPageProxy | null>(null);\n\n /* Get the page proxy once */\n useEffect(() => {\n let cancelled = false;\n doc.getPage(pageNumber).then((p) => {\n if (!cancelled) setPageProxy(p);\n });\n return () => {\n cancelled = true;\n };\n }, [doc, pageNumber]);\n\n /* Compute dimensions from viewport + zoom (+ optional rotation override) */\n useEffect(() => {\n if (!pageProxy) return;\n // `getViewport` accepts an optional `rotation` that overrides the\n // page's intrinsic `/Rotate`. Pass it through only when the\n // consumer set `pageRotation` explicitly so the default path\n // matches the previous behaviour byte-for-byte.\n const viewportOpts = (scale: number) =>\n pageRotation === undefined\n ? { scale }\n : { scale, rotation: pageRotation };\n const baseViewport = pageProxy.getViewport(viewportOpts(1));\n const scale = resolveScale(zoom, baseViewport, container);\n const scaled = pageProxy.getViewport(viewportOpts(scale));\n setDims({\n width: Math.floor(scaled.width),\n height: Math.floor(scaled.height),\n });\n }, [pageProxy, zoom, container, resizeTick, pageRotation]);\n\n // Derived (not stored) so the overlay receives the correct rotation\n // on the first render that has `pageProxy` — storing it as state\n // would force a second pass through the reconciler before the\n // overlay arg caught up. `pageRotation` (consumer override) wins;\n // otherwise the page's intrinsic `/Rotate` (read from\n // `pageProxy.rotate`). The `as unknown as { rotate?: number }`\n // narrow is needed because `pdfjs-dist`'s public types don't yet\n // expose `.rotate` on `PDFPageProxy` — TODO: remove the cast once\n // upstream types ship it.\n const effectiveRotation: PDFPageRotation =\n pageRotation ??\n (((pageProxy as unknown as { rotate?: number } | null)?.rotate ??\n 0) as PDFPageRotation);\n\n /* Render the canvas + text layer when shouldRender flips on */\n useEffect(() => {\n if (!pageProxy || !shouldRender) {\n // Release GPU memory if we've been culled.\n const canvas = canvasRef.current;\n if (canvas && !shouldRender) {\n canvas.width = 0;\n }\n return undefined;\n }\n\n const canvas = canvasRef.current;\n const textLayerEl = textLayerRef.current;\n if (!canvas) return undefined;\n const ctx = canvas.getContext('2d');\n if (!ctx) return undefined;\n\n const viewportOpts = (scale: number) =>\n pageRotation === undefined\n ? { scale }\n : { scale, rotation: pageRotation };\n const baseViewport = pageProxy.getViewport(viewportOpts(1));\n const scale = resolveScale(zoom, baseViewport, container);\n const viewport = pageProxy.getViewport(viewportOpts(scale));\n const dpr = Math.max(1, window.devicePixelRatio || 1);\n\n canvas.width = Math.floor(viewport.width * dpr);\n canvas.height = Math.floor(viewport.height * dpr);\n ctx.setTransform(dpr, 0, 0, dpr, 0, 0);\n\n const renderTask = pageProxy.render({\n canvas,\n canvasContext: ctx,\n viewport,\n });\n\n let cancelled = false;\n let textLayer: pdfjsLib.TextLayer | null = null;\n\n renderTask.promise\n .then(async () => {\n if (cancelled || !textLayerEl) return;\n // Clear prior runs before layering.\n textLayerEl.textContent = '';\n const textContent = await pageProxy.getTextContent();\n if (cancelled) return;\n textLayer = new pdfjsLib.TextLayer({\n textContentSource: textContent,\n container: textLayerEl,\n viewport,\n });\n await textLayer.render();\n // Highlight matches if a search query is active.\n highlightMatches(textLayerEl, searchQuery, onMatchCount);\n })\n .catch(() => {\n // Render cancelled mid-flight — nothing actionable.\n });\n\n return () => {\n cancelled = true;\n try {\n renderTask.cancel();\n } catch {\n /* ignore */\n }\n if (textLayer) {\n try {\n textLayer.cancel();\n } catch {\n /* ignore */\n }\n }\n };\n }, [\n pageProxy,\n shouldRender,\n zoom,\n container,\n resizeTick,\n searchQuery,\n onMatchCount,\n pageRotation,\n ]);\n\n /* Re-run highlight when search query changes without re-rendering */\n useEffect(() => {\n if (!shouldRender) return;\n const textLayerEl = textLayerRef.current;\n if (!textLayerEl) return;\n highlightMatches(textLayerEl, searchQuery, onMatchCount);\n }, [searchQuery, shouldRender, onMatchCount]);\n\n // Inline style — permitted per 23-constraints §Runtime-computed\n // dimensions (PDF.js page viewport × devicePixelRatio). Wrapper height\n // mirrors the canvas so scroll position stays stable even when the\n // page is culled.\n const canvasStyle: CSSProperties = {\n width: dims.width,\n height: dims.height,\n };\n const articleStyle: CSSProperties = {\n width: dims.width,\n height: dims.height,\n };\n\n return (\n <article\n ref={(el) => {\n registerRef(el);\n }}\n data-page-number={pageNumber}\n aria-label={t('pdf.pageOf', { current: pageNumber, total: totalPages })}\n className={pageArticleVariants()}\n // eslint-disable-next-line react/forbid-dom-props -- runtime-computed PDF page dimensions\n style={articleStyle}\n >\n {/* eslint-disable-next-line react/forbid-dom-props -- runtime-computed canvas dimensions */}\n <canvas ref={canvasRef} style={canvasStyle} />\n <div\n ref={textLayerRef}\n aria-hidden=\"false\"\n className={[\n 'ds:absolute ds:inset-0',\n 'ds:overflow-hidden',\n 'ds:select-text',\n 'ds:opacity-100',\n 'ds:[&>span]:absolute ds:[&>span]:whitespace-pre',\n 'ds:[&>span]:text-transparent ds:[&>span]:origin-[0_0]',\n 'ds:[&_[data-match=true]]:bg-[color-mix(in_srgb,var(--warning)_35%,transparent)]',\n 'ds:[&_[data-match=current]]:bg-[color-mix(in_srgb,var(--warning)_60%,transparent)]',\n ].join(' ')}\n />\n {/* Consumer overlay layer — sits above canvas + text layer. Only */}\n {/* mounted while the page is inside the IntersectionObserver */}\n {/* buffer; unmounting tears down consumer-held timers / fetches */}\n {/* the same way the canvas releases GPU memory. Sized via the */}\n {/* article's `width`/`height` style, so it tracks zoom + rotation */}\n {/* without a per-page ResizeObserver. `pointer-events: auto` is */}\n {/* on so consumer children can be interactive while the text */}\n {/* layer underneath remains selectable (transparent text spans). */}\n {shouldRender && renderPageOverlay ? (\n <div\n // `role=\"group\"` + a translated `aria-label` give screen-reader\n // users a stable landmark when interactive overlays exist on a\n // page — without this, consumers' Buttons announce naked, with\n // no cue that they belong to the page above. The label is\n // translation-managed via the existing `pdf.*` namespace.\n role=\"group\"\n aria-label={t('pdf.pageOverlay', { page: pageNumber })}\n className=\"ds:absolute ds:inset-0 ds:pointer-events-auto\"\n data-pdf-page-overlay=\"\"\n data-page-number={pageNumber}\n >\n {renderPageOverlay({\n pageNumber,\n pageWidthCss: dims.width,\n pageHeightCss: dims.height,\n rotation: effectiveRotation,\n })}\n </div>\n ) : null}\n </article>\n );\n}\n\n/* ------------------------------------------------------------------ */\n/* Search-highlight helper */\n/* ------------------------------------------------------------------ */\n\nfunction highlightMatches(\n container: HTMLElement,\n query: string,\n onCount: (count: number) => void,\n): void {\n // Wipe prior highlights.\n const prior = container.querySelectorAll('[data-match]');\n prior.forEach((el) => {\n (el as HTMLElement).removeAttribute('data-match');\n });\n if (!query) {\n onCount(0);\n return;\n }\n const lower = query.toLowerCase();\n let matchCount = 0;\n const spans = container.querySelectorAll<HTMLSpanElement>('span');\n spans.forEach((span) => {\n const text = span.textContent ?? '';\n if (text.toLowerCase().includes(lower)) {\n span.setAttribute('data-match', 'true');\n matchCount += 1;\n }\n });\n onCount(matchCount);\n}\n\nexport { toolbarButtonVariants, toolbarVariants, wrapperVariants };\n"],"names":["__iconNode","ZoomIn","createLucideIcon","ZoomOut","pdfViewerAgent","handle","args","pdfjsLib","pdfjsWorkerUrl","wrapperVariants","cva","toolbarVariants","toolbarButtonVariants","pageInputVariants","zoomSelectVariants","pagesContainerVariants","pageArticleVariants","ZOOM_PRESETS","isNumberZoom","z","resolveScale","zoom","viewport","container","style","padX","padY","availW","availH","baseW","baseH","PDFViewer","forwardRef","id","src","initialPage","initialZoom","pageRotation","renderPageOverlay","onPageChange","onLoadComplete","onError","toolbar","ariaLabel","className","ref","t","useTranslation","rawId","useId","viewerId","useMemo","isRtl","setIsRtl","useState","reducedMotion","setReducedMotion","useEffect","mql","sync","loaded","setLoaded","loadError","setLoadError","currentPage","setCurrentPage","setZoomState","visibleRange","setVisibleRange","announcement","setAnnouncement","searchOpen","setSearchOpen","searchQuery","setSearchQuery","searchMatches","setSearchMatches","onPageChangeRef","useRef","onLoadCompleteRef","onErrorRef","loadedRef","cancelled","baseOptions","task","doc","title","meta","info","next","_a","err","error","prev","pagesContainerRef","pageArticleRefs","goToPage","useCallback","page","clamped","article","setZoom","internalPrint","search","query","agentHandle","useImperativeHandle","useAgentRegistration","handleViewerKeyDown","event","mod","currentPageRef","visibility","observer","entries","entry","pageAttr","n","best","bestRatio","minVisible","maxVisible","ratio","el","containerSizeTick","setContainerSizeTick","ro","v","toolbarButtonsRef","toolbarFocusIndex","setToolbarFocusIndex","registerToolbarButton","index","focusToolbarButton","btn","toolbarCount","handleToolbarKeyDown","forward","backward","jsx","Alert","jsxs","PDFToolbar","p","_","i","pageNumber","PDFPage","count","Spinner","props","numPages","onPrev","onNext","onJump","onZoomIn","onZoomOut","onZoomPreset","onOpenSearch","onPrint","onSearchOpenChange","onSearchQueryChange","register","focusIndex","setFocusIndex","onToolbarKeyDown","pageInput","setPageInput","prevDisabled","nextDisabled","commitPageInput","parsed","renderButton","opts","ChevronLeft","ChevronRight","e","RadixPopover","Search","X","Printer","totalPages","resizeTick","shouldRender","registerRef","onMatchCount","canvasRef","textLayerRef","dims","setDims","pageProxy","setPageProxy","viewportOpts","scale","baseViewport","scaled","effectiveRotation","canvas","textLayerEl","ctx","dpr","renderTask","textLayer","textContent","high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+
import { jsxs as c, jsx as i } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as y, useMemo as A } from "react";
|
|
3
|
+
import { c as m } from "./index-D2ZczOXr.js";
|
|
4
|
+
import { useTranslation as C } from "react-i18next";
|
|
5
|
+
function u({ className: a }) {
|
|
6
|
+
return /* @__PURE__ */ i(
|
|
7
|
+
"svg",
|
|
8
|
+
{
|
|
9
|
+
"aria-hidden": "true",
|
|
10
|
+
viewBox: "0 0 24 24",
|
|
11
|
+
fill: "currentColor",
|
|
12
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
13
|
+
className: a,
|
|
14
|
+
children: /* @__PURE__ */ i("path", { d: "M17.472 14.382c-.297-.149-1.758-.867-2.03-.967-.273-.099-.471-.149-.67.15-.197.297-.767.966-.94 1.164-.173.199-.347.223-.644.075-.297-.15-1.255-.463-2.39-1.475-.883-.788-1.48-1.761-1.653-2.059-.173-.297-.018-.458.13-.606.134-.133.298-.347.446-.52.149-.174.198-.298.298-.497.099-.198.05-.371-.025-.52-.075-.149-.669-1.612-.916-2.207-.242-.579-.487-.5-.669-.51-.173-.008-.371-.01-.57-.01-.198 0-.52.074-.792.372-.272.297-1.04 1.016-1.04 2.479 0 1.462 1.065 2.875 1.213 3.074.149.198 2.096 3.2 5.077 4.487.71.306 1.263.489 1.694.625.712.227 1.36.195 1.871.118.571-.085 1.758-.719 2.006-1.413.248-.694.248-1.289.173-1.413-.074-.124-.272-.198-.57-.347m-5.421 7.403h-.004a9.87 9.87 0 0 1-5.031-1.378l-.361-.214-3.741.982.998-3.648-.235-.374a9.86 9.86 0 0 1-1.51-5.26c.001-5.45 4.436-9.884 9.888-9.884 2.64 0 5.122 1.03 6.988 2.898a9.825 9.825 0 0 1 2.893 6.994c-.003 5.45-4.437 9.884-9.885 9.884m8.413-18.297A11.815 11.815 0 0 0 12.05 0C5.495 0 .16 5.335.157 11.892c0 2.096.547 4.142 1.588 5.945L.057 24l6.305-1.654a11.882 11.882 0 0 0 5.683 1.448h.005c6.554 0 11.89-5.335 11.893-11.893a11.821 11.821 0 0 0-3.48-8.413Z" })
|
|
15
|
+
}
|
|
16
|
+
);
|
|
17
|
+
}
|
|
18
|
+
const _ = m(
|
|
19
|
+
[
|
|
20
|
+
"ds:relative ds:inline-flex ds:items-center ds:justify-center",
|
|
21
|
+
"ds:font-medium ds:whitespace-nowrap",
|
|
22
|
+
"ds:bg-[var(--brand-whatsapp)] ds:text-[var(--brand-whatsapp-foreground)]",
|
|
23
|
+
"ds:hover:bg-[var(--brand-whatsapp-hover)]",
|
|
24
|
+
"ds:active:opacity-90",
|
|
25
|
+
"ds:transition-[background-color,box-shadow,opacity]",
|
|
26
|
+
"ds:duration-[var(--animation-duration)]",
|
|
27
|
+
"ds:focus-visible:outline-[length:var(--focus-ring-width)] ds:focus-visible:outline-solid",
|
|
28
|
+
// Focus ring colour is `var(--ring)` (= `--primary` in light, ditto
|
|
29
|
+
// through theme cascade) — NOT `--brand-whatsapp`. Painting the
|
|
30
|
+
// ring brand-green on a brand-green surface makes it invisible.
|
|
31
|
+
"ds:focus-visible:outline-[var(--ring)] ds:focus-visible:outline-offset-[length:var(--focus-ring-offset)]",
|
|
32
|
+
// Under Windows High Contrast Mode the bg + shadow are stripped;
|
|
33
|
+
// repaint a solid border + swap the focus ring to CanvasText so
|
|
34
|
+
// the affordance stays identifiable.
|
|
35
|
+
"ds:forced-colors:border ds:forced-colors:border-[ButtonBorder]",
|
|
36
|
+
"ds:forced-colors:focus-visible:outline-[CanvasText]",
|
|
37
|
+
"ds:disabled:opacity-50 ds:disabled:cursor-not-allowed",
|
|
38
|
+
"ds:motion-reduce:transition-none"
|
|
39
|
+
].join(" "),
|
|
40
|
+
{
|
|
41
|
+
variants: {
|
|
42
|
+
variant: {
|
|
43
|
+
// Pill — inline rounded button. Visible label is the brand
|
|
44
|
+
// affordance text; glyph sits leading.
|
|
45
|
+
pill: "ds:rounded-[var(--radius-full)] ds:gap-[var(--spacing-xs)]",
|
|
46
|
+
// FAB — circular floating action button. Glyph only; the
|
|
47
|
+
// label resolves into `aria-label`.
|
|
48
|
+
fab: [
|
|
49
|
+
"ds:rounded-full ds:shadow-[var(--shadow-lg)]",
|
|
50
|
+
"ds:hover:shadow-[var(--shadow-xl)] ds:active:shadow-[var(--shadow-md)]"
|
|
51
|
+
].join(" ")
|
|
52
|
+
},
|
|
53
|
+
size: {
|
|
54
|
+
sm: "",
|
|
55
|
+
md: "",
|
|
56
|
+
lg: ""
|
|
57
|
+
}
|
|
58
|
+
},
|
|
59
|
+
compoundVariants: [
|
|
60
|
+
{
|
|
61
|
+
variant: "pill",
|
|
62
|
+
size: "sm",
|
|
63
|
+
class: 'ds:h-9 ds:ps-3 ds:pe-3.5 ds:text-[length:var(--font-size-sm)] ds:[&_svg]:size-4 ds:min-h-[var(--min-target-size)] ds:sm:min-h-0 ds:before:absolute ds:before:inset-x-[calc((var(--min-target-size)-100%)/-2)] ds:before:inset-y-[calc((var(--min-target-size)-100%)/-2)] ds:before:content-[""] ds:sm:before:hidden'
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
variant: "pill",
|
|
67
|
+
size: "md",
|
|
68
|
+
class: "ds:h-10 ds:ps-4 ds:pe-5 ds:text-[length:var(--font-size-base)] ds:[&_svg]:size-5"
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
variant: "pill",
|
|
72
|
+
size: "lg",
|
|
73
|
+
class: "ds:h-12 ds:ps-5 ds:pe-6 ds:text-[length:var(--font-size-lg)] ds:[&_svg]:size-6"
|
|
74
|
+
},
|
|
75
|
+
// FAB — fixed square dimensions; the `sm` case mirrors the
|
|
76
|
+
// FloatingActionButton's pseudo-target expansion below the
|
|
77
|
+
// `sm:` breakpoint so a 40px circle still hits 44/48 px on
|
|
78
|
+
// mobile.
|
|
79
|
+
{
|
|
80
|
+
variant: "fab",
|
|
81
|
+
size: "sm",
|
|
82
|
+
class: 'ds:h-10 ds:w-10 ds:[&_svg]:size-5 ds:before:absolute ds:before:inset-x-[calc((var(--min-target-size)-100%)/-2)] ds:before:inset-y-[calc((var(--min-target-size)-100%)/-2)] ds:before:content-[""] ds:sm:before:hidden'
|
|
83
|
+
},
|
|
84
|
+
{
|
|
85
|
+
variant: "fab",
|
|
86
|
+
size: "md",
|
|
87
|
+
class: "ds:h-14 ds:w-14 ds:[&_svg]:size-7"
|
|
88
|
+
},
|
|
89
|
+
{
|
|
90
|
+
variant: "fab",
|
|
91
|
+
size: "lg",
|
|
92
|
+
class: "ds:h-16 ds:w-16 ds:[&_svg]:size-8"
|
|
93
|
+
}
|
|
94
|
+
],
|
|
95
|
+
defaultVariants: {
|
|
96
|
+
variant: "pill",
|
|
97
|
+
size: "md"
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
), j = m("", {
|
|
101
|
+
variants: {
|
|
102
|
+
position: {
|
|
103
|
+
static: "",
|
|
104
|
+
"bottom-end": "ds:fixed ds:z-[var(--z-fixed)] ds:bottom-[calc(var(--spacing-lg)+env(safe-area-inset-bottom,0px))] ds:end-[var(--spacing-lg)]",
|
|
105
|
+
"bottom-start": "ds:fixed ds:z-[var(--z-fixed)] ds:bottom-[calc(var(--spacing-lg)+env(safe-area-inset-bottom,0px))] ds:start-[var(--spacing-lg)]"
|
|
106
|
+
}
|
|
107
|
+
},
|
|
108
|
+
defaultVariants: { position: "static" }
|
|
109
|
+
});
|
|
110
|
+
function B(a, o) {
|
|
111
|
+
const s = a.replace(/\D/g, "");
|
|
112
|
+
if (s.length === 0)
|
|
113
|
+
return null;
|
|
114
|
+
const r = `https://wa.me/${s}`;
|
|
115
|
+
return o ? `${r}?text=${encodeURIComponent(o)}` : r;
|
|
116
|
+
}
|
|
117
|
+
const N = y(
|
|
118
|
+
({
|
|
119
|
+
phoneNumber: a,
|
|
120
|
+
message: o,
|
|
121
|
+
variant: s = "pill",
|
|
122
|
+
size: r = "md",
|
|
123
|
+
position: h,
|
|
124
|
+
label: g,
|
|
125
|
+
className: w,
|
|
126
|
+
...n
|
|
127
|
+
}, z) => {
|
|
128
|
+
const { t: p } = C(), f = A(
|
|
129
|
+
() => B(a, o),
|
|
130
|
+
[a, o]
|
|
131
|
+
), e = g ?? p(s === "fab" ? "whatsApp.fabLabel" : "whatsApp.label"), x = [
|
|
132
|
+
_({ variant: s, size: r }),
|
|
133
|
+
j({ position: h }),
|
|
134
|
+
w
|
|
135
|
+
].filter(Boolean).join(" "), d = f === null, v = {
|
|
136
|
+
ref: z,
|
|
137
|
+
...d ? {} : {
|
|
138
|
+
href: f,
|
|
139
|
+
target: "_blank",
|
|
140
|
+
rel: "noopener noreferrer"
|
|
141
|
+
},
|
|
142
|
+
"aria-disabled": d ? !0 : void 0,
|
|
143
|
+
"data-component": "whatsapp-button",
|
|
144
|
+
"data-variant": s,
|
|
145
|
+
onClick: (l) => {
|
|
146
|
+
var b;
|
|
147
|
+
d && l.preventDefault(), (b = n.onClick) == null || b.call(n, l);
|
|
148
|
+
},
|
|
149
|
+
className: x
|
|
150
|
+
}, t = d ? null : p("link.opensInNewTab", "Opens in a new tab");
|
|
151
|
+
if (s === "fab") {
|
|
152
|
+
const l = typeof e == "string" ? t ? `${e} — ${t}` : e : void 0;
|
|
153
|
+
return /* @__PURE__ */ c("a", { ...n, ...v, "aria-label": l, children: [
|
|
154
|
+
/* @__PURE__ */ i(u, {}),
|
|
155
|
+
typeof e != "string" ? /* @__PURE__ */ c("span", { className: "ds:sr-only", children: [
|
|
156
|
+
e,
|
|
157
|
+
t ? ` — ${t}` : null
|
|
158
|
+
] }) : null
|
|
159
|
+
] });
|
|
160
|
+
}
|
|
161
|
+
return /* @__PURE__ */ c("a", { ...n, ...v, children: [
|
|
162
|
+
/* @__PURE__ */ i(u, {}),
|
|
163
|
+
/* @__PURE__ */ i("span", { children: e }),
|
|
164
|
+
t ? /* @__PURE__ */ c("span", { className: "ds:sr-only", children: [
|
|
165
|
+
" — ",
|
|
166
|
+
t
|
|
167
|
+
] }) : null
|
|
168
|
+
] });
|
|
169
|
+
}
|
|
170
|
+
);
|
|
171
|
+
N.displayName = "WhatsAppButton";
|
|
172
|
+
export {
|
|
173
|
+
N as W
|
|
174
|
+
};
|
|
175
|
+
//# sourceMappingURL=whatsapp-button-Bj5FIhpC.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"whatsapp-button-Bj5FIhpC.js","sources":["../../src/components/whatsapp-button/whatsapp-button.tsx"],"sourcesContent":["/* ------------------------------------------------------------------ */\n/* WhatsAppButton — kit-tokened Click-to-Chat affordance. */\n/* */\n/* Replaces the booking website's loose green-circle-with-caption */\n/* combo (see HTP screenshot in the rebrand discussion) with a single */\n/* well-anchored affordance. Two variants: */\n/* */\n/* - `pill` — inline rounded button, brand green + white glyph + */\n/* label. Drops anywhere in card / header chrome. */\n/* - `fab` — circular floating action button, glyph only, */\n/* persistently anchored in the page corner. Carries an */\n/* `aria-label` so the SR announcement is \"Open WhatsApp */\n/* chat\" without rendering a loose visible caption. */\n/* */\n/* WhatsApp brand guidance requires the canonical #25D366 surface and */\n/* the official phone-bubble glyph — those live in `--brand-whatsapp` */\n/* tokens (added under `src/tokens/index.css`) so all four themes can */\n/* shift the green for accessible contrast without bleeding the brand */\n/* requirement into component code. */\n/* ------------------------------------------------------------------ */\n\nimport {\n forwardRef,\n useMemo,\n type AnchorHTMLAttributes,\n type ReactNode,\n} from 'react';\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport { useTranslation } from 'react-i18next';\n\n/* ------------------------------------------------------------------ */\n/* WhatsApp glyph */\n/* */\n/* Inlined SVG — no external icon dep. The path matches WhatsApp's */\n/* official brand mark (speech bubble + phone). `currentColor` lets */\n/* the kit's `--brand-whatsapp-foreground` paint the glyph from a */\n/* single CVA class, so accessible-theme shifts apply without code. */\n/* ------------------------------------------------------------------ */\n\nfunction WhatsAppGlyph({ className }: { className?: string }): ReactNode {\n return (\n <svg\n aria-hidden=\"true\"\n viewBox=\"0 0 24 24\"\n fill=\"currentColor\"\n xmlns=\"http://www.w3.org/2000/svg\"\n className={className}\n >\n <path d=\"M17.472 14.382c-.297-.149-1.758-.867-2.03-.967-.273-.099-.471-.149-.67.15-.197.297-.767.966-.94 1.164-.173.199-.347.223-.644.075-.297-.15-1.255-.463-2.39-1.475-.883-.788-1.48-1.761-1.653-2.059-.173-.297-.018-.458.13-.606.134-.133.298-.347.446-.52.149-.174.198-.298.298-.497.099-.198.05-.371-.025-.52-.075-.149-.669-1.612-.916-2.207-.242-.579-.487-.5-.669-.51-.173-.008-.371-.01-.57-.01-.198 0-.52.074-.792.372-.272.297-1.04 1.016-1.04 2.479 0 1.462 1.065 2.875 1.213 3.074.149.198 2.096 3.2 5.077 4.487.71.306 1.263.489 1.694.625.712.227 1.36.195 1.871.118.571-.085 1.758-.719 2.006-1.413.248-.694.248-1.289.173-1.413-.074-.124-.272-.198-.57-.347m-5.421 7.403h-.004a9.87 9.87 0 0 1-5.031-1.378l-.361-.214-3.741.982.998-3.648-.235-.374a9.86 9.86 0 0 1-1.51-5.26c.001-5.45 4.436-9.884 9.888-9.884 2.64 0 5.122 1.03 6.988 2.898a9.825 9.825 0 0 1 2.893 6.994c-.003 5.45-4.437 9.884-9.885 9.884m8.413-18.297A11.815 11.815 0 0 0 12.05 0C5.495 0 .16 5.335.157 11.892c0 2.096.547 4.142 1.588 5.945L.057 24l6.305-1.654a11.882 11.882 0 0 0 5.683 1.448h.005c6.554 0 11.89-5.335 11.893-11.893a11.821 11.821 0 0 0-3.48-8.413Z\" />\n </svg>\n );\n}\n\n/* ------------------------------------------------------------------ */\n/* CVA */\n/* ------------------------------------------------------------------ */\n\nconst rootVariants = cva(\n [\n 'ds:relative ds:inline-flex ds:items-center ds:justify-center',\n 'ds:font-medium ds:whitespace-nowrap',\n 'ds:bg-[var(--brand-whatsapp)] ds:text-[var(--brand-whatsapp-foreground)]',\n 'ds:hover:bg-[var(--brand-whatsapp-hover)]',\n 'ds:active:opacity-90',\n 'ds:transition-[background-color,box-shadow,opacity]',\n 'ds:duration-[var(--animation-duration)]',\n 'ds:focus-visible:outline-[length:var(--focus-ring-width)] ds:focus-visible:outline-solid',\n // Focus ring colour is `var(--ring)` (= `--primary` in light, ditto\n // through theme cascade) — NOT `--brand-whatsapp`. Painting the\n // ring brand-green on a brand-green surface makes it invisible.\n 'ds:focus-visible:outline-[var(--ring)] ds:focus-visible:outline-offset-[length:var(--focus-ring-offset)]',\n // Under Windows High Contrast Mode the bg + shadow are stripped;\n // repaint a solid border + swap the focus ring to CanvasText so\n // the affordance stays identifiable.\n 'ds:forced-colors:border ds:forced-colors:border-[ButtonBorder]',\n 'ds:forced-colors:focus-visible:outline-[CanvasText]',\n 'ds:disabled:opacity-50 ds:disabled:cursor-not-allowed',\n 'ds:motion-reduce:transition-none',\n ].join(' '),\n {\n variants: {\n variant: {\n // Pill — inline rounded button. Visible label is the brand\n // affordance text; glyph sits leading.\n pill: 'ds:rounded-[var(--radius-full)] ds:gap-[var(--spacing-xs)]',\n // FAB — circular floating action button. Glyph only; the\n // label resolves into `aria-label`.\n fab: [\n 'ds:rounded-full ds:shadow-[var(--shadow-lg)]',\n 'ds:hover:shadow-[var(--shadow-xl)] ds:active:shadow-[var(--shadow-md)]',\n ].join(' '),\n },\n size: {\n sm: '',\n md: '',\n lg: '',\n },\n },\n compoundVariants: [\n {\n variant: 'pill',\n size: 'sm',\n class:\n 'ds:h-9 ds:ps-3 ds:pe-3.5 ds:text-[length:var(--font-size-sm)] ds:[&_svg]:size-4 ds:min-h-[var(--min-target-size)] ds:sm:min-h-0 ds:before:absolute ds:before:inset-x-[calc((var(--min-target-size)-100%)/-2)] ds:before:inset-y-[calc((var(--min-target-size)-100%)/-2)] ds:before:content-[\"\"] ds:sm:before:hidden',\n },\n {\n variant: 'pill',\n size: 'md',\n class:\n 'ds:h-10 ds:ps-4 ds:pe-5 ds:text-[length:var(--font-size-base)] ds:[&_svg]:size-5',\n },\n {\n variant: 'pill',\n size: 'lg',\n class:\n 'ds:h-12 ds:ps-5 ds:pe-6 ds:text-[length:var(--font-size-lg)] ds:[&_svg]:size-6',\n },\n // FAB — fixed square dimensions; the `sm` case mirrors the\n // FloatingActionButton's pseudo-target expansion below the\n // `sm:` breakpoint so a 40px circle still hits 44/48 px on\n // mobile.\n {\n variant: 'fab',\n size: 'sm',\n class:\n 'ds:h-10 ds:w-10 ds:[&_svg]:size-5 ds:before:absolute ds:before:inset-x-[calc((var(--min-target-size)-100%)/-2)] ds:before:inset-y-[calc((var(--min-target-size)-100%)/-2)] ds:before:content-[\"\"] ds:sm:before:hidden',\n },\n {\n variant: 'fab',\n size: 'md',\n class: 'ds:h-14 ds:w-14 ds:[&_svg]:size-7',\n },\n {\n variant: 'fab',\n size: 'lg',\n class: 'ds:h-16 ds:w-16 ds:[&_svg]:size-8',\n },\n ],\n defaultVariants: {\n variant: 'pill',\n size: 'md',\n },\n },\n);\n\nconst positionVariants = cva('', {\n variants: {\n position: {\n static: '',\n 'bottom-end':\n 'ds:fixed ds:z-[var(--z-fixed)] ds:bottom-[calc(var(--spacing-lg)+env(safe-area-inset-bottom,0px))] ds:end-[var(--spacing-lg)]',\n 'bottom-start':\n 'ds:fixed ds:z-[var(--z-fixed)] ds:bottom-[calc(var(--spacing-lg)+env(safe-area-inset-bottom,0px))] ds:start-[var(--spacing-lg)]',\n },\n },\n defaultVariants: { position: 'static' },\n});\n\n/* ------------------------------------------------------------------ */\n/* URL builder */\n/* ------------------------------------------------------------------ */\n\n/**\n * Build a `wa.me` deep-link from an E.164 phone number and an\n * optional prefilled message. The number is stripped to digits — the\n * `wa.me` host requires digits only (no `+`, no separators).\n *\n * Returns `null` (not an empty `wa.me/` URL) when the input contains\n * no digits — the caller is then responsible for rendering a disabled\n * affordance rather than shipping a broken link. In dev a `console.warn`\n * fires so the typo is visible during development.\n */\nfunction buildWaMeUrl(phoneNumber: string, message?: string): string | null {\n const digits = phoneNumber.replace(/\\D/g, '');\n if (digits.length === 0) {\n if (\n typeof import.meta !== 'undefined' &&\n typeof import.meta.env !== 'undefined' &&\n import.meta.env.DEV === true\n ) {\n console.warn(\n `[WhatsAppButton] phoneNumber \"${phoneNumber}\" contains no digits — ` +\n `the affordance will render disabled. Pass an E.164 number ` +\n `(e.g. \"+393331234567\") to fix.`,\n );\n }\n return null;\n }\n const base = `https://wa.me/${digits}`;\n if (!message) return base;\n return `${base}?text=${encodeURIComponent(message)}`;\n}\n\n/* ------------------------------------------------------------------ */\n/* Props */\n/* ------------------------------------------------------------------ */\n\nexport interface WhatsAppButtonProps\n extends\n Omit<AnchorHTMLAttributes<HTMLAnchorElement>, 'href' | 'children'>,\n VariantProps<typeof rootVariants>,\n VariantProps<typeof positionVariants> {\n /**\n * Phone number to chat to. E.164 format is recommended\n * (e.g. `+393331234567`). Any non-digit characters are stripped\n * before the URL is built — `wa.me` requires digits only.\n */\n phoneNumber: string;\n /**\n * Optional prefilled message. The receiver sees this in their\n * compose box. Keep it short and human — long pasted text is the\n * single most common reason consumers drop the affordance.\n */\n message?: string;\n /**\n * Override the visible / accessible label. Defaults to\n * `t('whatsApp.label')` for the pill variant and\n * `t('whatsApp.fabLabel')` for the FAB.\n */\n label?: ReactNode;\n}\n\n/* ------------------------------------------------------------------ */\n/* WhatsAppButton */\n/* ------------------------------------------------------------------ */\n\nexport const WhatsAppButton = forwardRef<\n HTMLAnchorElement,\n WhatsAppButtonProps\n>(\n (\n {\n phoneNumber,\n message,\n variant = 'pill',\n size = 'md',\n position,\n label,\n className,\n ...rest\n },\n ref,\n ) => {\n const { t } = useTranslation();\n const href = useMemo(\n () => buildWaMeUrl(phoneNumber, message),\n [phoneNumber, message],\n );\n const resolvedLabel =\n label ??\n (variant === 'fab' ? t('whatsApp.fabLabel') : t('whatsApp.label'));\n\n const composedClassName = [\n rootVariants({ variant, size }),\n positionVariants({ position }),\n className,\n ]\n .filter(Boolean)\n .join(' ');\n\n // When the input has no digits, render an `aria-disabled` anchor\n // with the same chrome but no `href` — assistive tech announces the\n // disabled state and click does nothing. `buildWaMeUrl` already\n // emitted a dev-mode warning above. `target` / `rel` are stripped\n // too because they're meaningless without `href`.\n const isDisabled = href === null;\n const commonAnchorProps = {\n ref,\n ...(isDisabled\n ? {}\n : {\n href: href as string,\n target: '_blank' as const,\n rel: 'noopener noreferrer' as const,\n }),\n 'aria-disabled': isDisabled ? true : undefined,\n 'data-component': 'whatsapp-button' as const,\n 'data-variant': variant,\n onClick: (event: React.MouseEvent<HTMLAnchorElement>) => {\n if (isDisabled) event.preventDefault();\n rest.onClick?.(event);\n },\n className: composedClassName,\n };\n\n // Screen-reader cue for the new-tab behaviour. WCAG 3.2.5 / G201:\n // user-initiated link openings to a new context should be\n // announced. Reused `link.opensInNewTab` from the kit's `ui` ns —\n // single source of truth across every external-link affordance.\n const opensInNewTabSrText = isDisabled\n ? null\n : t('link.opensInNewTab', 'Opens in a new tab');\n\n if (variant === 'fab') {\n // FAB — circular, glyph-only. The accessible name lives on the\n // anchor's `aria-label` (resolved label). No visible caption,\n // which is exactly what the redesign fixes vs. the legacy\n // green-circle-with-loose-text affordance.\n const fabAriaLabel =\n typeof resolvedLabel === 'string'\n ? opensInNewTabSrText\n ? `${resolvedLabel} — ${opensInNewTabSrText}`\n : resolvedLabel\n : undefined;\n return (\n <a {...rest} {...commonAnchorProps} aria-label={fabAriaLabel}>\n <WhatsAppGlyph />\n {typeof resolvedLabel !== 'string' ? (\n <span className=\"ds:sr-only\">\n {resolvedLabel}\n {opensInNewTabSrText ? ` — ${opensInNewTabSrText}` : null}\n </span>\n ) : null}\n </a>\n );\n }\n\n return (\n <a {...rest} {...commonAnchorProps}>\n <WhatsAppGlyph />\n <span>{resolvedLabel}</span>\n {opensInNewTabSrText ? (\n <span className=\"ds:sr-only\"> — {opensInNewTabSrText}</span>\n ) : null}\n </a>\n );\n },\n);\nWhatsAppButton.displayName = 'WhatsAppButton';\n"],"names":["WhatsAppGlyph","className","jsx","rootVariants","cva","positionVariants","buildWaMeUrl","phoneNumber","message","digits","base","WhatsAppButton","forwardRef","variant","size","position","label","rest","ref","t","useTranslation","href","useMemo","resolvedLabel","composedClassName","isDisabled","commonAnchorProps","event","_a","opensInNewTabSrText","fabAriaLabel","jsxs"],"mappings":";;;;AAuCA,SAASA,EAAc,EAAE,WAAAC,KAAgD;AACvE,SACE,gBAAAC;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,eAAY;AAAA,MACZ,SAAQ;AAAA,MACR,MAAK;AAAA,MACL,OAAM;AAAA,MACN,WAAAD;AAAA,MAEA,UAAA,gBAAAC,EAAC,QAAA,EAAK,GAAE,4lCAA2lC;AAAA,IAAA;AAAA,EAAA;AAGzmC;AAMA,MAAMC,IAAeC;AAAA,EACnB;AAAA,IACE;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA,IAIA;AAAA;AAAA;AAAA;AAAA,IAIA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EAAA,EACA,KAAK,GAAG;AAAA,EACV;AAAA,IACE,UAAU;AAAA,MACR,SAAS;AAAA;AAAA;AAAA,QAGP,MAAM;AAAA;AAAA;AAAA,QAGN,KAAK;AAAA,UACH;AAAA,UACA;AAAA,QAAA,EACA,KAAK,GAAG;AAAA,MAAA;AAAA,MAEZ,MAAM;AAAA,QACJ,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,IAAI;AAAA,MAAA;AAAA,IACN;AAAA,IAEF,kBAAkB;AAAA,MAChB;AAAA,QACE,SAAS;AAAA,QACT,MAAM;AAAA,QACN,OACE;AAAA,MAAA;AAAA,MAEJ;AAAA,QACE,SAAS;AAAA,QACT,MAAM;AAAA,QACN,OACE;AAAA,MAAA;AAAA,MAEJ;AAAA,QACE,SAAS;AAAA,QACT,MAAM;AAAA,QACN,OACE;AAAA,MAAA;AAAA;AAAA;AAAA;AAAA;AAAA,MAMJ;AAAA,QACE,SAAS;AAAA,QACT,MAAM;AAAA,QACN,OACE;AAAA,MAAA;AAAA,MAEJ;AAAA,QACE,SAAS;AAAA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2
|
"schemaVersion": 1,
|
|
3
|
-
"packageVersion": "0.
|
|
3
|
+
"packageVersion": "0.12.0",
|
|
4
4
|
"components": [
|
|
5
5
|
{
|
|
6
6
|
"kind": "component",
|
|
@@ -1628,6 +1628,44 @@
|
|
|
1628
1628
|
}
|
|
1629
1629
|
}
|
|
1630
1630
|
},
|
|
1631
|
+
{
|
|
1632
|
+
"kind": "component",
|
|
1633
|
+
"id": "map-view",
|
|
1634
|
+
"capabilities": [],
|
|
1635
|
+
"state": [],
|
|
1636
|
+
"actions": [
|
|
1637
|
+
{
|
|
1638
|
+
"name": "pan_to",
|
|
1639
|
+
"safety": "read",
|
|
1640
|
+
"argsType": "{ position: { lat: number; lng: number } }",
|
|
1641
|
+
"description": "Pan the map to a new centre without changing zoom."
|
|
1642
|
+
},
|
|
1643
|
+
{
|
|
1644
|
+
"name": "set_zoom",
|
|
1645
|
+
"safety": "read",
|
|
1646
|
+
"argsType": "{ zoom: number }",
|
|
1647
|
+
"description": "Set the map zoom level (typical range 1–20)."
|
|
1648
|
+
},
|
|
1649
|
+
{
|
|
1650
|
+
"name": "select_marker",
|
|
1651
|
+
"safety": "read",
|
|
1652
|
+
"argsType": "{ id: string | null }",
|
|
1653
|
+
"description": "Select a marker by id, or pass null to clear the selection."
|
|
1654
|
+
}
|
|
1655
|
+
],
|
|
1656
|
+
"domHooks": {
|
|
1657
|
+
"root": {
|
|
1658
|
+
"attr": "data-component",
|
|
1659
|
+
"value": "map-view",
|
|
1660
|
+
"description": "Marks the element as a kit MapView."
|
|
1661
|
+
},
|
|
1662
|
+
"instanceId": {
|
|
1663
|
+
"attr": "data-component-id",
|
|
1664
|
+
"sourceProp": "id",
|
|
1665
|
+
"description": "Sourced from the id prop."
|
|
1666
|
+
}
|
|
1667
|
+
}
|
|
1668
|
+
},
|
|
1631
1669
|
{
|
|
1632
1670
|
"kind": "component",
|
|
1633
1671
|
"id": "matrix-rain",
|
|
@@ -3904,6 +3942,20 @@
|
|
|
3904
3942
|
}
|
|
3905
3943
|
}
|
|
3906
3944
|
},
|
|
3945
|
+
{
|
|
3946
|
+
"kind": "component",
|
|
3947
|
+
"id": "whatsapp-button",
|
|
3948
|
+
"capabilities": [],
|
|
3949
|
+
"state": [],
|
|
3950
|
+
"actions": [],
|
|
3951
|
+
"domHooks": {
|
|
3952
|
+
"root": {
|
|
3953
|
+
"attr": "data-component",
|
|
3954
|
+
"value": "whatsapp-button",
|
|
3955
|
+
"description": "Marks the element as a kit WhatsAppButton."
|
|
3956
|
+
}
|
|
3957
|
+
}
|
|
3958
|
+
},
|
|
3907
3959
|
{
|
|
3908
3960
|
"kind": "component",
|
|
3909
3961
|
"id": "workflow-card",
|
|
@@ -47,6 +47,7 @@ export * from './kbd';
|
|
|
47
47
|
export * from './key-value-pair';
|
|
48
48
|
export * from './list';
|
|
49
49
|
export * from './logo';
|
|
50
|
+
export * from './map-view';
|
|
50
51
|
export * from './rating';
|
|
51
52
|
export * from './skeleton';
|
|
52
53
|
export * from './sparkline';
|
|
@@ -117,6 +118,7 @@ export * from './signature-capture';
|
|
|
117
118
|
export * from './slot-grid';
|
|
118
119
|
export * from './tooth-scheme';
|
|
119
120
|
export * from './transaction-chip';
|
|
121
|
+
export * from './whatsapp-button';
|
|
120
122
|
export * from './workflow';
|
|
121
123
|
export * from '../patterns/leo-assistant';
|
|
122
124
|
export * from '../patterns/patient-shell';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/components/index.ts"],"names":[],"mappings":"AAMA,OAAO,EACL,uBAAuB,EACvB,aAAa,EACb,qBAAqB,EACrB,SAAS,EACT,QAAQ,EACR,YAAY,EACZ,cAAc,EACd,WAAW,EACX,iBAAiB,EACjB,yBAAyB,GAC1B,MAAM,UAAU,CAAC;AAClB,YAAY,EACV,SAAS,EACT,eAAe,EACf,4BAA4B,EAC5B,eAAe,EACf,uBAAuB,EACvB,aAAa,EACb,cAAc,GACf,MAAM,UAAU,CAAC;A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,cAAc,mBAAmB,CAAC;AAGlC,cAAc,SAAS,CAAC;AAGxB,cAAc,mBAAmB,CAAC;AAClC,cAAc,kBAAkB,CAAC;AACjC,cAAc,oBAAoB,CAAC;AACnC,cAAc,kBAAkB,CAAC;AACjC,cAAc,cAAc,CAAC;AAC7B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,oBAAoB,CAAC;AACnC,cAAc,kBAAkB,CAAC;AACjC,cAAc,mBAAmB,CAAC;AAClC,cAAc,oBAAoB,CAAC;AACnC,cAAc,oBAAoB,CAAC;AAGnC,cAAc,YAAY,CAAC;AAC3B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,cAAc,CAAC;AAC7B,cAAc,oBAAoB,CAAC;AACnC,cAAc,qBAAqB,CAAC;AACpC,cAAc,aAAa,CAAC;AAC5B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,oBAAoB,CAAC;AACnC,cAAc,mBAAmB,CAAC;AAClC,cAAc,YAAY,CAAC;AAO3B,cAAc,2BAA2B,CAAC;AAC1C,cAAc,2BAA2B,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/map-view/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AACrC,YAAY,EACV,YAAY,EACZ,aAAa,EACb,SAAS,EACT,SAAS,GACV,MAAM,YAAY,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"map-view.agent.d.ts","sourceRoot":"","sources":["../../../src/components/map-view/map-view.agent.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACtD,OAAO,KAAK,EAAE,aAAa,EAAa,MAAM,YAAY,CAAC;AAE3D,eAAO,MAAM,YAAY,EAAE,YAAY,CAAC,aAAa,CA2CpD,CAAC"}
|