mirror of
https://github.com/temetro/temetro.git
synced 2026-09-04 14:55:28 +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>
87 lines
1.9 KiB
Markdown
87 lines
1.9 KiB
Markdown
# coss Tabs
|
|
|
|
## When to use
|
|
|
|
- Mutually exclusive content panels in one region.
|
|
- Settings/detail screens split into scoped views.
|
|
|
|
## Install
|
|
|
|
```bash
|
|
npx shadcn@latest add @coss/tabs
|
|
```
|
|
|
|
Manual deps from docs:
|
|
|
|
```bash
|
|
# No extra runtime dependency required for this primitive.
|
|
```
|
|
|
|
## Canonical imports
|
|
|
|
```tsx
|
|
import { Tabs, TabsList, TabsPanel, TabsTab } from "@/components/ui/tabs"
|
|
```
|
|
|
|
## Minimal pattern
|
|
|
|
```tsx
|
|
<Tabs defaultValue="tab-1">
|
|
<TabsList>
|
|
<TabsTab value="tab-1">Tab 1</TabsTab>
|
|
<TabsTab value="tab-2">Tab 2</TabsTab>
|
|
<TabsTab value="tab-3">Tab 3</TabsTab>
|
|
</TabsList>
|
|
<TabsPanel value="tab-1">Tab 1 content</TabsPanel>
|
|
<TabsPanel value="tab-2">Tab 2 content</TabsPanel>
|
|
<TabsPanel value="tab-3">Tab 3 content</TabsPanel>
|
|
</Tabs>
|
|
```
|
|
|
|
## Patterns from coss particles
|
|
|
|
### Key patterns
|
|
|
|
Controlled tabs with external state:
|
|
|
|
```tsx
|
|
const [value, setValue] = useState("tab-1")
|
|
|
|
<Tabs value={value} onValueChange={setValue}>
|
|
<TabsList>
|
|
<TabsTab value="tab-1">Tab 1</TabsTab>
|
|
<TabsTab value="tab-2">Tab 2</TabsTab>
|
|
</TabsList>
|
|
<TabsPanel value="tab-1">Content 1</TabsPanel>
|
|
<TabsPanel value="tab-2">Content 2</TabsPanel>
|
|
</Tabs>
|
|
```
|
|
|
|
Underline variant:
|
|
|
|
```tsx
|
|
<Tabs defaultValue="tab-1" variant="underline">
|
|
<TabsList>
|
|
<TabsTab value="tab-1">Tab 1</TabsTab>
|
|
<TabsTab value="tab-2">Tab 2</TabsTab>
|
|
</TabsList>
|
|
...
|
|
</Tabs>
|
|
```
|
|
|
|
### More examples
|
|
|
|
- underline variant: `p-tabs-2`
|
|
- vertical orientation: `p-tabs-3`
|
|
- underline with vertical orientation: `p-tabs-4`
|
|
|
|
## Common pitfalls
|
|
|
|
- Mismatching `TabsTab value` and `TabsPanel value` pairs.
|
|
- Using tabs for workflows that require route-level navigation instead.
|
|
- Mounting expensive panel content without considering visibility/performance.
|
|
|
|
## Useful particle references
|
|
|
|
See `p-tabs-1` through `p-tabs-4` for variants and orientations. Related: `p-toolbar-1`, `p-card-1`.
|