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>
85 lines
1.6 KiB
Markdown
85 lines
1.6 KiB
Markdown
# coss Group
|
|
|
|
## When to use
|
|
|
|
- Connected controls with shared visual boundary.
|
|
- Composed action clusters using buttons, toggles, and menu triggers.
|
|
|
|
## Install
|
|
|
|
```bash
|
|
npx shadcn@latest add @coss/group
|
|
```
|
|
|
|
Manual deps from docs:
|
|
|
|
```bash
|
|
npm install @base-ui/react
|
|
```
|
|
|
|
## Canonical imports
|
|
|
|
```tsx
|
|
import { Button } from "@/components/ui/button"
|
|
import { Group, GroupSeparator } from "@/components/ui/group"
|
|
```
|
|
|
|
## Minimal pattern
|
|
|
|
```tsx
|
|
<Group>
|
|
<Button>Button</Button>
|
|
<GroupSeparator />
|
|
<Button>Button</Button>
|
|
</Group>
|
|
```
|
|
|
|
## Patterns from coss particles
|
|
|
|
### Key patterns
|
|
|
|
Button group with separator:
|
|
|
|
```tsx
|
|
<Group>
|
|
<Button variant="outline">Copy</Button>
|
|
<GroupSeparator />
|
|
<Button variant="outline">Paste</Button>
|
|
<GroupSeparator />
|
|
<Button variant="outline">Cut</Button>
|
|
</Group>
|
|
```
|
|
|
|
Group with input and button:
|
|
|
|
```tsx
|
|
<Group>
|
|
<Input type="text" placeholder="Enter URL..." />
|
|
<GroupSeparator />
|
|
<Button>Go</Button>
|
|
</Group>
|
|
```
|
|
|
|
Sizes: `sm`, `default`, `lg`. Orientation: vertical via `orientation="vertical"`.
|
|
|
|
### More examples
|
|
|
|
See `p-group-1` through `p-group-9` for input, sizes, disabled, vertical, and labeled text patterns.
|
|
|
|
## Common pitfalls
|
|
|
|
- Forgetting `GroupSeparator` between controls in connected groups.
|
|
- Mixing control sizes/variants that break shared group silhouette.
|
|
- Using standalone controls where a grouped action model is expected.
|
|
|
|
## Useful particle references
|
|
|
|
- with input: `p-group-2`
|
|
- small size: `p-group-3`
|
|
- large size: `p-group-4`
|
|
- with disabled button: `p-group-5`
|
|
- with default buttons: `p-group-6`
|
|
- with start labeled text: `p-group-7`
|
|
- with end text: `p-group-8`
|
|
- vertical: `p-group-9`
|