mirror of
https://github.com/MBombeck/HealthLog.git
synced 2026-11-12 22:26:13 +00:00
v1.4.27 — Mobile capability and maintainer-finding cleanup. ResponsiveSheet primitive (bottom-sheet on narrow viewports, centred dialog on desktop) applied to BD, Weight, Glucose, Mood, Activity forms. Maintainer-finding cleanups across Coach, Insights, Reports, Privacy. GeoLite2 offline geocoding with resilience layer (graceful fallback when EULA not yet propagated). E2E gap-fill coverage. 450-line release notes attached to the GitHub Release.
56 lines
1.9 KiB
TypeScript
56 lines
1.9 KiB
TypeScript
"use client";
|
|
|
|
import * as React from "react";
|
|
import { Popover as PopoverPrimitive } from "radix-ui";
|
|
|
|
import { cn } from "@/lib/utils";
|
|
|
|
/**
|
|
* Popover primitive — Radix `Popover` wrapped with the same Dracula
|
|
* surface tokens the rest of the shadcn primitives use.
|
|
*
|
|
* v1.4.27 MB3 — introduced so the Coach composer hint can swap off
|
|
* the `<Tooltip>` primitive. Radix tooltips never tap-toggle reliably
|
|
* on touch surfaces; popovers do. The mouse-hover preview that the
|
|
* tooltip used to provide on desktop is dropped intentionally —
|
|
* tap-to-open is the same gesture on every device.
|
|
*/
|
|
function Popover({
|
|
...props
|
|
}: React.ComponentProps<typeof PopoverPrimitive.Root>) {
|
|
return <PopoverPrimitive.Root data-slot="popover" {...props} />;
|
|
}
|
|
|
|
function PopoverTrigger({
|
|
...props
|
|
}: React.ComponentProps<typeof PopoverPrimitive.Trigger>) {
|
|
return <PopoverPrimitive.Trigger data-slot="popover-trigger" {...props} />;
|
|
}
|
|
|
|
function PopoverContent({
|
|
className,
|
|
align = "center",
|
|
sideOffset = 4,
|
|
children,
|
|
...props
|
|
}: React.ComponentProps<typeof PopoverPrimitive.Content>) {
|
|
return (
|
|
<PopoverPrimitive.Portal>
|
|
<PopoverPrimitive.Content
|
|
data-slot="popover-content"
|
|
align={align}
|
|
sideOffset={sideOffset}
|
|
className={cn(
|
|
"bg-popover text-popover-foreground border-border animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 max-w-xs origin-(--radix-popover-content-transform-origin) rounded-md border p-3 text-xs shadow-md outline-none",
|
|
className,
|
|
)}
|
|
{...props}
|
|
>
|
|
{children}
|
|
</PopoverPrimitive.Content>
|
|
</PopoverPrimitive.Portal>
|
|
);
|
|
}
|
|
|
|
export { Popover, PopoverTrigger, PopoverContent };
|