"use client"; import * as React from "react"; import { XIcon } from "lucide-react"; import { Dialog as DialogPrimitive } from "radix-ui"; import { cn } from "@/lib/utils"; import { Button } from "@/components/ui/button"; import { useTranslations } from "@/lib/i18n/context"; function Dialog({ ...props }: React.ComponentProps) { return ; } function DialogTrigger({ ...props }: React.ComponentProps) { return ; } function DialogPortal({ ...props }: React.ComponentProps) { return ; } function DialogClose({ ...props }: React.ComponentProps) { return ; } function DialogOverlay({ className, ...props }: React.ComponentProps) { return ( ); } function DialogContent({ className, children, showCloseButton = true, ...props }: React.ComponentProps & { showCloseButton?: boolean; }) { const { t } = useTranslations(); return ( ` at the viewport's // dynamic height with internal scroll so long forms (medication // editor, API endpoint, intake import) never spill past the // viewport on short / soft-keyboard-collapsed mobile screens. // Consumers that need a different ceiling can override via // `className`. // // `grid-cols-[minmax(0,1fr)]` pins the implicit column. A bare // `grid` gives its single column an `auto` track, which sizes to the // widest child's max-content and grows the box past the dialog's own // `max-w-*` — and because `overflow-y:auto` makes `overflow-x` // compute to `auto`, that surplus becomes a horizontal scrollbar // rather than a visible spill. `minmax(0,1fr)` caps the track at the // dialog width so an over-wide child is contained instead of // dragging the surface out with it. // // `overflow-x-clip` pairs with it: `overflow-y-auto` alone promotes // the other axis from `visible` to `auto`, so a single over-wide // child made the whole dialog pannable sideways. A dialog scrolls // vertically; anything that genuinely needs sideways scroll brings // its own `overflow-x-auto` wrapper. Consumers that set `overflow-*` // themselves still win — `` passes // `overflow-hidden` and scrolls its body instead. "bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] z-50 grid max-h-[calc(100dvh-2rem)] w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] grid-cols-[minmax(0,1fr)] gap-4 overflow-x-clip overflow-y-auto rounded-lg border p-6 shadow-lg duration-200 outline-none sm:max-w-lg", className, )} {...props} > {children} {showCloseButton && ( // v1.4.27 R3d MB2 — widen the icon-only close-X tap target // to a 36 px floor per WCAG 2.5.8 minimum target size. // 36 px (not 44 px) is the intentional exception for fixed // icon-only close affordances per Decision I — 44 px would // crowd the dialog header out of proportion. {/* v1.4.34 IW-G — read `common.close` so screen readers hear the localised label instead of literal English. */} {t("common.close")} )} ); } function DialogHeader({ className, ...props }: React.ComponentProps<"div">) { return (
); } function DialogFooter({ className, showCloseButton = false, children, ...props }: React.ComponentProps<"div"> & { showCloseButton?: boolean; }) { const { t } = useTranslations(); return (
{children} {showCloseButton && ( )}
); } function DialogTitle({ className, ...props }: React.ComponentProps) { return ( ); } function DialogDescription({ className, ...props }: React.ComponentProps) { return ( ); } export { Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, };