mirror of
https://github.com/temetro/temetro.git
synced 2026-07-26 11:58:14 +00:00
4d6a5dc008
Components: - Replace components/ui primitives with COSS equivalents from the @coss/* shadcn registry. Add menu/preview-card/group; remove the superseded dropdown-menu, hover-card, button-group; keep carousel (no COSS equivalent). - Migrate live call sites to canonical COSS APIs preserving layout/behavior: sidebar menus (nav-user, team-switcher, nav-notifications), chat-input radio menu, patient dialogs/cards, auth forms (FieldGroup -> flex column), settings. - ai-elements: migrate the live conversation/message with behavior parity (Tooltip via render, Group/GroupText); repoint dormant files (hover-card -> preview-card, dropdown-menu -> menu, button-group -> group, InputGroupButton -> Button). Residual pre-existing Base UI type drift stays behind ignoreBuildErrors. Theme: - Adopt COSS default neutral tokens in globals.css with light + dark palettes. - Add next-themes (defaultTheme=dark, enableSystem) and drop the forced dark class. Align font variables to the COSS contract (--font-sans/-heading/-mono). Make scrollbars theme-aware. i18n: - Add i18next + react-i18next (lib/i18n/config.ts, locales/en/translation.json, components/i18n-provider.tsx mounted in layout). Convert auth forms, sidebar nav, and settings tabs to useTranslation() as the reference pattern. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
62 lines
2.1 KiB
TypeScript
62 lines
2.1 KiB
TypeScript
"use client";
|
|
|
|
import { PreviewCard as PreviewCardPrimitive } from "@base-ui/react/preview-card";
|
|
import type React from "react";
|
|
import { cn } from "@/lib/utils";
|
|
|
|
export const PreviewCard: typeof PreviewCardPrimitive.Root =
|
|
PreviewCardPrimitive.Root;
|
|
|
|
export function PreviewCardTrigger({
|
|
...props
|
|
}: PreviewCardPrimitive.Trigger.Props): React.ReactElement {
|
|
return (
|
|
<PreviewCardPrimitive.Trigger data-slot="preview-card-trigger" {...props} />
|
|
);
|
|
}
|
|
|
|
export function PreviewCardPopup({
|
|
className,
|
|
children,
|
|
align = "center",
|
|
sideOffset = 4,
|
|
anchor,
|
|
portalProps,
|
|
...props
|
|
}: PreviewCardPrimitive.Popup.Props & {
|
|
align?: PreviewCardPrimitive.Positioner.Props["align"];
|
|
sideOffset?: PreviewCardPrimitive.Positioner.Props["sideOffset"];
|
|
anchor?: PreviewCardPrimitive.Positioner.Props["anchor"];
|
|
portalProps?: PreviewCardPrimitive.Portal.Props;
|
|
}): React.ReactElement {
|
|
return (
|
|
<PreviewCardPrimitive.Portal {...portalProps}>
|
|
<PreviewCardPrimitive.Positioner
|
|
align={align}
|
|
anchor={anchor}
|
|
className="z-50"
|
|
data-slot="preview-card-positioner"
|
|
sideOffset={sideOffset}
|
|
>
|
|
<PreviewCardPrimitive.Popup
|
|
className={cn(
|
|
"relative flex w-64 origin-(--transform-origin) text-balance rounded-lg border bg-popover not-dark:bg-clip-padding p-4 text-popover-foreground text-sm shadow-lg/5 transition-[scale,opacity] before:pointer-events-none before:absolute before:inset-0 before:rounded-[calc(var(--radius-lg)-1px)] before:shadow-[0_1px_--theme(--color-black/4%)] data-ending-style:scale-98 data-starting-style:scale-98 data-ending-style:opacity-0 data-starting-style:opacity-0 dark:before:shadow-[0_-1px_--theme(--color-white/6%)]",
|
|
className,
|
|
)}
|
|
data-slot="preview-card-content"
|
|
{...props}
|
|
>
|
|
{children}
|
|
</PreviewCardPrimitive.Popup>
|
|
</PreviewCardPrimitive.Positioner>
|
|
</PreviewCardPrimitive.Portal>
|
|
);
|
|
}
|
|
|
|
export {
|
|
PreviewCardPrimitive,
|
|
PreviewCard as HoverCard,
|
|
PreviewCardTrigger as HoverCardTrigger,
|
|
PreviewCardPopup as HoverCardContent,
|
|
};
|