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>
81 lines
1.8 KiB
TypeScript
81 lines
1.8 KiB
TypeScript
"use client";
|
|
|
|
import { Field as FieldPrimitive } from "@base-ui/react/field";
|
|
import type React from "react";
|
|
import { cn } from "@/lib/utils";
|
|
|
|
export function Field({
|
|
className,
|
|
...props
|
|
}: FieldPrimitive.Root.Props): React.ReactElement {
|
|
return (
|
|
<FieldPrimitive.Root
|
|
className={cn("flex flex-col items-start gap-2", className)}
|
|
data-slot="field"
|
|
{...props}
|
|
/>
|
|
);
|
|
}
|
|
|
|
export function FieldLabel({
|
|
className,
|
|
...props
|
|
}: FieldPrimitive.Label.Props): React.ReactElement {
|
|
return (
|
|
<FieldPrimitive.Label
|
|
className={cn(
|
|
"inline-flex items-center gap-2 font-medium text-base/4.5 text-foreground data-disabled:opacity-64 sm:text-sm/4",
|
|
className,
|
|
)}
|
|
data-slot="field-label"
|
|
{...props}
|
|
/>
|
|
);
|
|
}
|
|
|
|
export function FieldItem({
|
|
className,
|
|
...props
|
|
}: FieldPrimitive.Item.Props): React.ReactElement {
|
|
return (
|
|
<FieldPrimitive.Item
|
|
className={cn("flex", className)}
|
|
data-slot="field-item"
|
|
{...props}
|
|
/>
|
|
);
|
|
}
|
|
|
|
export function FieldDescription({
|
|
className,
|
|
...props
|
|
}: FieldPrimitive.Description.Props): React.ReactElement {
|
|
return (
|
|
<FieldPrimitive.Description
|
|
className={cn("text-muted-foreground text-xs", className)}
|
|
data-slot="field-description"
|
|
{...props}
|
|
/>
|
|
);
|
|
}
|
|
|
|
export function FieldError({
|
|
className,
|
|
...props
|
|
}: FieldPrimitive.Error.Props): React.ReactElement {
|
|
return (
|
|
<FieldPrimitive.Error
|
|
className={cn("text-destructive-foreground text-xs", className)}
|
|
data-slot="field-error"
|
|
{...props}
|
|
/>
|
|
);
|
|
}
|
|
|
|
export const FieldControl: typeof FieldPrimitive.Control =
|
|
FieldPrimitive.Control;
|
|
export const FieldValidity: typeof FieldPrimitive.Validity =
|
|
FieldPrimitive.Validity;
|
|
|
|
export { FieldPrimitive };
|