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>
96 lines
3.2 KiB
Markdown
96 lines
3.2 KiB
Markdown
# Package Info
|
|
|
|
Display dependency information and version changes.
|
|
|
|
The `PackageInfo` component displays package dependency information including version changes and change type badges.
|
|
|
|
See `scripts/package-info.tsx` for this example.
|
|
|
|
## Installation
|
|
|
|
```bash
|
|
npx ai-elements@latest add package-info
|
|
```
|
|
|
|
## Features
|
|
|
|
- Version change display (current → new)
|
|
- Color-coded change type badges
|
|
- Dependencies list
|
|
- Description support
|
|
|
|
## Change Types
|
|
|
|
| Type | Color | Use Case |
|
|
| --------- | ------ | ------------------ |
|
|
| `major` | Red | Breaking changes |
|
|
| `minor` | Yellow | New features |
|
|
| `patch` | Green | Bug fixes |
|
|
| `added` | Blue | New dependency |
|
|
| `removed` | Gray | Removed dependency |
|
|
|
|
## Props
|
|
|
|
### `<PackageInfo />`
|
|
|
|
| Prop | Type | Default | Description |
|
|
|------|------|---------|-------------|
|
|
| `name` | `string` | Required | Package name. |
|
|
| `currentVersion` | `string` | - | Current installed version. |
|
|
| `newVersion` | `string` | - | New version being installed. |
|
|
| `changeType` | `unknown` | - | Type of version change. |
|
|
| `...props` | `React.HTMLAttributes<HTMLDivElement>` | - | Spread to the container div. |
|
|
|
|
### `<PackageInfoHeader />`
|
|
|
|
| Prop | Type | Default | Description |
|
|
|------|------|---------|-------------|
|
|
| `...props` | `React.HTMLAttributes<HTMLDivElement>` | - | Spread to the header div. |
|
|
|
|
### `<PackageInfoName />`
|
|
|
|
| Prop | Type | Default | Description |
|
|
|------|------|---------|-------------|
|
|
| `children` | `React.ReactNode` | - | Custom name content. Defaults to the name from context. |
|
|
| `...props` | `React.HTMLAttributes<HTMLDivElement>` | - | Spread to the container div. |
|
|
|
|
### `<PackageInfoChangeType />`
|
|
|
|
| Prop | Type | Default | Description |
|
|
|------|------|---------|-------------|
|
|
| `children` | `React.ReactNode` | - | Custom change type label. Defaults to the changeType from context. |
|
|
| `...props` | `React.HTMLAttributes<HTMLDivElement>` | - | Spread to the Badge component. |
|
|
|
|
### `<PackageInfoVersion />`
|
|
|
|
| Prop | Type | Default | Description |
|
|
|------|------|---------|-------------|
|
|
| `children` | `React.ReactNode` | - | Custom version content. Defaults to version transition display. |
|
|
| `...props` | `React.HTMLAttributes<HTMLDivElement>` | - | Spread to the container div. |
|
|
|
|
### `<PackageInfoDescription />`
|
|
|
|
| Prop | Type | Default | Description |
|
|
|------|------|---------|-------------|
|
|
| `...props` | `React.HTMLAttributes<HTMLParagraphElement>` | - | Spread to the p element. |
|
|
|
|
### `<PackageInfoContent />`
|
|
|
|
| Prop | Type | Default | Description |
|
|
|------|------|---------|-------------|
|
|
| `...props` | `React.HTMLAttributes<HTMLDivElement>` | - | Spread to the container div. |
|
|
|
|
### `<PackageInfoDependencies />`
|
|
|
|
| Prop | Type | Default | Description |
|
|
|------|------|---------|-------------|
|
|
| `...props` | `React.HTMLAttributes<HTMLDivElement>` | - | Spread to the container div. |
|
|
|
|
### `<PackageInfoDependency />`
|
|
|
|
| Prop | Type | Default | Description |
|
|
|------|------|---------|-------------|
|
|
| `name` | `string` | Required | Dependency name. |
|
|
| `version` | `string` | - | Dependency version. |
|
|
| `...props` | `React.HTMLAttributes<HTMLDivElement>` | - | Spread to the row div. |
|