mirror of
https://github.com/hanzoai/ui.git
synced 2026-11-21 00:18:41 +00:00
- Fix gray/zinc alias confusion (gray→neutral, zinc→zen) - Consolidate duplicate gray color definition - Add finance components to ui/ directory - Clean up documentation structure - Remove test artifacts and backup files The color aliases were incorrectly mapped: Before: gray→zen, zinc→neutral (wrong) After: gray→neutral, zinc→zen (correct) This ensures Hanzo's branded 'zen' color properly maps to zinc while gray correctly references the standard neutral palette. Verified: - Production build: 544 pages ✓ - All tests passing: 219/219 ✓ - Visual verification: /colors page working ✓ - Code review: Approved ✓ Ready for deployment to ui.hanzo.ai
81 lines
1.5 KiB
Plaintext
81 lines
1.5 KiB
Plaintext
---
|
|
title: Positions List
|
|
description: Display current trading positions with P&L tracking.
|
|
component: true
|
|
---
|
|
|
|
<ComponentPreview
|
|
name="positions-list"
|
|
description="Active positions display"
|
|
/>
|
|
|
|
## Installation
|
|
|
|
<Tabs defaultValue="cli">
|
|
|
|
<TabsList>
|
|
<TabsTrigger value="cli">CLI</TabsTrigger>
|
|
<TabsTrigger value="manual">Manual</TabsTrigger>
|
|
</TabsList>
|
|
|
|
<TabsContent value="cli">
|
|
|
|
```bash
|
|
npx @hanzo/ui@latest add positions-list
|
|
```
|
|
|
|
</TabsContent>
|
|
|
|
<TabsContent value="manual">
|
|
|
|
<Steps>
|
|
|
|
<Step>Install the following dependencies:</Step>
|
|
|
|
```bash
|
|
npm install @hanzo/ui
|
|
```
|
|
|
|
<Step>Copy and paste the following code into your project.</Step>
|
|
|
|
<ComponentSource name="positions-list" />
|
|
|
|
<Step>Update the import paths to match your project setup.</Step>
|
|
|
|
</Steps>
|
|
|
|
</TabsContent>
|
|
|
|
</Tabs>
|
|
|
|
## Usage
|
|
|
|
```tsx
|
|
import { PositionsList } from "@hanzo/ui/finance"
|
|
|
|
export default function Demo() {
|
|
const positions = [
|
|
{
|
|
id: "1",
|
|
symbol: "AAPL",
|
|
side: "buy",
|
|
shares: 100,
|
|
entryPrice: 150.0,
|
|
currentPrice: 175.5,
|
|
pnl: 2550,
|
|
pnlPercent: 17.0,
|
|
},
|
|
]
|
|
|
|
return <PositionsList positions={positions} />
|
|
}
|
|
```
|
|
|
|
## Props
|
|
|
|
| Prop | Type | Default | Description |
|
|
| --------- | ---------- | ------- | ----------------------------- |
|
|
| positions | Position[] | [] | Array of position objects |
|
|
| onClose | function | - | Callback when position closed |
|
|
| showPnL | boolean | true | Show profit/loss column |
|