@invana/ui 0.0.27 → 0.0.29
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +101 -0
- package/dist/index.cjs +722 -95
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +683 -114
- package/dist/index.d.ts +683 -114
- package/dist/index.js +706 -96
- package/dist/index.js.map +1 -1
- package/dist/styles.css +1 -1
- package/package.json +2 -2
package/README.md
ADDED
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
# @invana/ui
|
|
2
|
+
|
|
3
|
+
Invana's React component library — shadcn-style primitives over Radix, plus the composed
|
|
4
|
+
components the Invana products share.
|
|
5
|
+
|
|
6
|
+
```bash
|
|
7
|
+
pnpm add @invana/ui
|
|
8
|
+
```
|
|
9
|
+
|
|
10
|
+
Peer dependencies: `react` and `react-dom` (18 or 19).
|
|
11
|
+
|
|
12
|
+
## Styles
|
|
13
|
+
|
|
14
|
+
Two ways in, and the difference matters.
|
|
15
|
+
|
|
16
|
+
**Recommended — compile the tokens yourself.** Your Tailwind v4 build sees `@invana/styling`'s
|
|
17
|
+
`@theme` block, so the design tokens (including the type ladder) are real tokens in your build:
|
|
18
|
+
|
|
19
|
+
```css
|
|
20
|
+
@import "tailwindcss";
|
|
21
|
+
|
|
22
|
+
/* your own source globs, plus this package's so its classes are generated */
|
|
23
|
+
@source "./src/**/*.{ts,tsx}";
|
|
24
|
+
@source "../../node_modules/@invana/ui/dist/**/*.js";
|
|
25
|
+
|
|
26
|
+
@import "@invana/styling/index.css";
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
**Or ship the precompiled sheet**, if you are not running Tailwind:
|
|
30
|
+
|
|
31
|
+
```ts
|
|
32
|
+
import '@invana/ui/styles.css';
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
The precompiled sheet gives you CSS custom properties but **not** the `@theme` tokens — your own
|
|
36
|
+
Tailwind will regenerate `text-sm` at its stock `0.875rem` rather than the kit's alias. Prefer the
|
|
37
|
+
first form when you have a Tailwind build.
|
|
38
|
+
|
|
39
|
+
## Usage
|
|
40
|
+
|
|
41
|
+
```tsx
|
|
42
|
+
import { Button, Card, NavHorizontal, cn } from '@invana/ui';
|
|
43
|
+
|
|
44
|
+
export function Toolbar({ active }: { active: boolean }) {
|
|
45
|
+
return (
|
|
46
|
+
<Card className={cn('p-4', active && 'ring-1 ring-ring')}>
|
|
47
|
+
<Button variant="outline">Run</Button>
|
|
48
|
+
</Card>
|
|
49
|
+
);
|
|
50
|
+
}
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
`cn` is the class merger used throughout the kit — `clsx` + `tailwind-merge`.
|
|
54
|
+
|
|
55
|
+
## What's in it
|
|
56
|
+
|
|
57
|
+
**Primitives** (`components/ui`) — accordion, alert, alert-dialog, avatar, badge, breadcrumb,
|
|
58
|
+
button, button-group, card, carousel, command, dialog, dropdown-menu, hover-card, item, kbd,
|
|
59
|
+
menubar, navigation-menu, pagination, popover, progress, resizable, scroll-area, separator, sheet,
|
|
60
|
+
sidebar, skeleton, sonner, spinner, status-dot, table, tabs, toggle, toggle-group, tooltip.
|
|
61
|
+
|
|
62
|
+
**Composed** (`components/ui-extended`) — layout and navigation (`NavHorizontal`, `NavVertical`,
|
|
63
|
+
`TabbedPanel`, `PanelStack`, `PanelBox`, `Toolbar`, `TreeView`, `ContextBar`, `FilterBar`,
|
|
64
|
+
`SectionHeader`, `RecordHeader`, `EmptyState`, `Tour`), charts and readouts (`BarChartH`,
|
|
65
|
+
`BarChartV`, `DivergingBar`, `Sparkline`, `HeatStrip`, `Legend`, `MetricTile`, `TaskGantt`,
|
|
66
|
+
`TimelineList`, `PropertyList`), and the Invana-domain composites (`ChatSession`, `EmissionCard`,
|
|
67
|
+
`CitationList`, `ProposalCard`, `DiagnosisCard`, `ClarifyCard`, `CannotAnswerCard`, `AgentChip`,
|
|
68
|
+
`BoundChip`, `TaskNode`, `Terminal`, `DiffList`, `ClampedText`, `RichSelect`).
|
|
69
|
+
|
|
70
|
+
**Typography** (`components/typography`) — exported both individually as `TypographyH1` …
|
|
71
|
+
`TypographyPre`, and as a `Typography` namespace object:
|
|
72
|
+
|
|
73
|
+
```tsx
|
|
74
|
+
import { Typography, TypographyH1 } from '@invana/ui';
|
|
75
|
+
|
|
76
|
+
<TypographyH1>Runs</TypographyH1>
|
|
77
|
+
<Typography.Lead>Everything that ran today.</Typography.Lead>
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
`H1`–`H6`, `P`, `Lead`, `Large`, `Small`, `Muted`, `Blockquote`, `Code`, `List`, `Pre`.
|
|
81
|
+
|
|
82
|
+
Also exported: `cn` and the `useOverflowItems` hook.
|
|
83
|
+
|
|
84
|
+
## Type scale
|
|
85
|
+
|
|
86
|
+
Components declare no font size. Default text inherits the root, and text that is deliberately
|
|
87
|
+
subordinate — a count, a timing, a row's subtitle — uses `text-meta`. Setting `html` to 13px gives
|
|
88
|
+
you an application; 16px gives you a site, and every component follows. Don't hard-code
|
|
89
|
+
`text-sm` / `text-xs` in consuming code: they are compatibility aliases, not options.
|
|
90
|
+
|
|
91
|
+
## Documentation
|
|
92
|
+
|
|
93
|
+
Every component has a Storybook story. From the monorepo root:
|
|
94
|
+
|
|
95
|
+
```bash
|
|
96
|
+
pnpm --filter @invana/stoybook dev
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
## License
|
|
100
|
+
|
|
101
|
+
MIT © Ravi Raja Merugu
|