mirror of
https://github.com/temetro/temetro.git
synced 2026-08-30 12:19:07 +00:00
929bec8f31
Stop blocking AI imports/proposals on missing non-critical fields. Records the chat agent drafts now save with safe placeholders, auto-generated file numbers, and a source="ai" marker that surfaces an "Added by AI" badge so a clinician can review/edit them later. Backend: - add `source` (manual|ai) column to patients/appointments/prescriptions (migration 0014) + canonical types, services, validation schemas - relax patient/appointment validation: empty file number allowed, demographic + type/provider/initials fall back to placeholders (initials derived from name) - patients.generateFileNumber() auto-assigns an MRN when one is missing - proposeAppointment accepts a name when no file number resolves; AI commits + /api/ai/import stamp source="ai" Frontend: - `source` on Appointment/Patient/Prescription types; AI commits send source="ai" - reusable <AiBadge> shown on the Patients table/detail and prescriptions list Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
1.3 KiB
1.3 KiB
coss Label
When to use
- Visible accessible labels for inputs and controls.
- Simple
htmlFor/idassociations in forms and settings UIs.
Install
npx shadcn@latest add @coss/label
Manual deps from docs:
# No extra runtime dependency required for this primitive.
Canonical imports
import { Label } from "@/components/ui/label"
Minimal pattern
<Label htmlFor="email">Email</Label>
Patterns from coss particles
Key patterns
Label paired with input:
const id = useId()
<div className="flex flex-col gap-2">
<Label htmlFor={id}>Email</Label>
<Input id={id} type="email" placeholder="name@example.com" />
</div>
Label wrapping a checkbox:
<Label>
<Checkbox />
Accept terms and conditions
</Label>
Prefer FieldLabel within Field for validation-aware forms.
More examples
See p-field-1, p-input-1, p-checkbox-1 for label-in-form patterns.
Common pitfalls
- Using
aria-labelwhen visibleLabeltext exists and can be associated. - Mismatching
htmlFor/idbetween label and control. - Using label component as generic typography instead of form labeling.
Useful particle references
- with checkbox:
checkbox-demo - label-specific particles: no dedicated
p-label-*family; use form referencesp-field-1,p-input-1,p-checkbox-1.