@aginies/ui 0.0.0-stage → 0.1.0

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 CHANGED
@@ -1,3 +1,150 @@
1
- # Temporary Holding Version
1
+ # @aginies/ui
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ The components of the Aginies Design System for React: buttons, forms, tables, navigation,
4
+ feedback, chat, agent runs and dashboard widgets, styled by `agn-` classes over the
5
+ [`@aginies/tokens`](../tokens) custom properties. No Tailwind, no CSS-in-JS, no component
6
+ library underneath.
7
+
8
+ ## Install
9
+
10
+ ```sh
11
+ npm install @aginies/ui @aginies/tokens
12
+ # optional, recommended: icons from the package instead of a CDN (see "Icons")
13
+ npm install lucide-react
14
+ ```
15
+
16
+ Peer dependencies: `react` and `react-dom` 18 or later; `lucide-react` 0.400 or later is optional.
17
+
18
+ ## Styles
19
+
20
+ Import the two stylesheets once, at the app root, **in this order**:
21
+
22
+ ```js
23
+ import '@aginies/tokens/tokens.css' // the custom properties: colour, type, space, density
24
+ import '@aginies/ui/styles.css' // the agn- component classes that read them
25
+ ```
26
+
27
+ `@aginies/ui/styles.css` does not carry the tokens, so they exist once on the page and a
28
+ product that already loads `@aginies/tokens` keeps a single copy.
29
+
30
+ **Fonts are the host's job.** The tokens name the three families; load them yourself, for
31
+ example with the variable fontsource packages:
32
+
33
+ ```sh
34
+ npm install @fontsource-variable/bricolage-grotesque @fontsource-variable/instrument-sans @fontsource-variable/jetbrains-mono
35
+ ```
36
+
37
+ ```js
38
+ import '@fontsource-variable/bricolage-grotesque' // display: headings, stat values
39
+ import '@fontsource-variable/instrument-sans' // body: everything read or operated
40
+ import '@fontsource-variable/jetbrains-mono' // mono: eyebrows, tags, IDs, code
41
+ ```
42
+
43
+ ## Theme and density
44
+
45
+ Light is the default. Set the theme and density with attributes, on the root or on any
46
+ subtree:
47
+
48
+ ```html
49
+ <html data-theme="dark"> <!-- light | dark; unset follows prefers-color-scheme -->
50
+ <section data-density="comfortable"> <!-- compact (default, 32px controls) | comfortable (40/44px) -->
51
+ ```
52
+
53
+ `ThemeToggle` and `useTheme` switch `data-theme` for you; `Room` inverts the theme inside
54
+ itself, the way aginies.com does by section.
55
+
56
+ **White label.** Tenant branding overrides the signal tokens on the root and nothing else:
57
+
58
+ ```css
59
+ :root {
60
+ --signal: #0b4f5c;
61
+ --signal-2: #083e48; /* hover/pressed */
62
+ --signal-ink: #ffffff; /* text on a signal fill */
63
+ --signal-soft: rgb(11 79 92 / 0.12); /* focus halo, selected wash */
64
+ }
65
+ ```
66
+
67
+ Keep `--signal-ink` at 4.5:1 on `--signal`; every component reads these four, so a tenant
68
+ colour reaches the primary button, focus, checked controls and the active canvas edge at once.
69
+
70
+ ## Components
71
+
72
+ ```jsx
73
+ import { Button, PageHeader, Tag } from '@aginies/ui'
74
+
75
+ <PageHeader eyebrow='Build' title='Agents' actions={<Button variant='primary' icon='plus'>New agent</Button>} />
76
+ <Tag tone='ok' dot>Ready</Tag>
77
+ ```
78
+
79
+ Every export is typed (`dist/index.d.ts`); the prop interfaces carry the usage notes.
80
+
81
+ - **Core** — Icon, ProductIcon, AginiesMark + AginiesLogo, Eyebrow, Kbd, Text
82
+ - **Actions** — Button, ButtonIcon, ButtonGroup, ButtonStateful, Menu, Pill, Chip + ChipGroup, CommandPalette, ThemeToggle (+ useTheme)
83
+ - **Forms** — FormElement, Input, Textarea, Select, Checkbox, Switch, CheckboxButton, RadioGroup, Combobox, SegmentedControl, SecretField, TagInput
84
+ - **Pickers** — Datepicker + Calendar, Timepicker + DatetimePicker, Slider, ColorPicker, Counter, DuelingPicklist, FileSelector, RichTextEditor, VisualPicker, Expression, DockedFormFooter
85
+ - **Data** — DataTable, TreeGrid, Tree, Tile, SummaryDetail, Avatar, Badge, Tag, BlockIcon, FileCard, Feed, ActivityTimeline, Illustration, Stat, MiniChart + Sparkline, Kanban, CalendarView, Gantt, DescriptionList, Amount, CodeBlock, JsonTree, DiffView, Heatmap
86
+ - **Layout** — Card, Toolbar, PageLayout, Room
87
+ - **Navigation** — GlobalHeader, VerticalNavigation, Tabs, Breadcrumbs, Path, ProgressIndicator, SplitView, AppLauncher, PageHeader, BuilderHeader, BrandBand, Accordion, Carousel, SetupAssistant, WelcomeMat, MobileTabBar, Pagination, Stepper
88
+ - **Feedback** — AginiesLoader, Skeleton + PageSkeleton, Alert, Toast, ScopedNotification, Notification, Modal + Prompt, Popover, Tooltip, Spinner, ProgressBar, ProgressRing, SidePanel, DockedComposer, DockedUtilityBar, Publisher, EmptyState
89
+ - **Chat** — ChatThread, ChatMessage, ChatEvent, ChatSuggestions, ChatComposer, ToolCallCard, StreamingIndicator, TranscriptPanel
90
+ - **Agent** (`widgets`) — ApprovalCard, RunTimeline, TraceSpans, RunStatus, AgentRunCard, CostBars, CanvasBlock + CanvasEdge + CanvasNote, QueueCard, CallCard
91
+ - **Widgets** (`dashboard`) — ready-made combinations for dashboards and desks: KpiWidget, ChartCard, TaskListWidget, AiInsightWidget, FilterBar, RecordSummaryWidget, TeamWorkloadWidget, ActivityWidget, QuickActions, NotificationsWidget, AgentFlowWidget, LeaderboardWidget, AgendaWidget, OnboardingWidget, CommentsWidget
92
+
93
+ The bundle starts with `'use client'`, so it works from the Next.js App Router.
94
+
95
+ ## Rules that matter to a consumer
96
+
97
+ - **One primary per view.** `variant='primary'` is the signal colour; everything else is
98
+ neutral, and ghost inside toolbars and cards.
99
+ - **Sentence case** for every visible string, buttons included ("Save changes", "Yeni ajan").
100
+ Column headers and eyebrows are uppercase by style; type them in sentence case.
101
+ - **Status is never colour alone.** A tone comes with a word or a glyph: `circle-check` ok,
102
+ `triangle-alert` warn, `circle-alert` bad, `info`, `loader-circle` running, `hand` human
103
+ approval, `sparkles` AI-generated.
104
+ - **`lang="tr"` on Turkish text that is uppercased by style** (eyebrows, column headers, tags),
105
+ or on an ancestor, so `i` becomes `İ` and not `I`.
106
+ - Icon-only buttons (`ButtonIcon`) always take `label`: it is the accessible name.
107
+
108
+ ## Icons
109
+
110
+ `Icon name='circle-check'` renders a Lucide glyph as inline SVG (stroke 2 at 16px and below,
111
+ 1.75 above). Where the glyphs come from:
112
+
113
+ 1. **`lucide-react`, when installed** — imported once with a dynamic `import('lucide-react')`
114
+ and cached. Supported from 0.400 through the 1.x line.
115
+ 2. **Otherwise the Lucide UMD bundle** (`lucide@0.468.0`) loaded once from unpkg, as in the
116
+ design system's own previews.
117
+
118
+ Props and markup are the same either way. Glyphs appear after mount (server rendering emits
119
+ the empty `svg`, sized, so layout does not shift). Install `lucide-react` in production: it
120
+ removes the third-party script and works under a strict Content-Security-Policy. Because the
121
+ import is a literal `import('lucide-react')`, a bundler that treats an unresolvable import as
122
+ an error will want the package installed (or marked external) even when you rely on the
123
+ fallback.
124
+
125
+ `ProductIcon` (the seven product glyphs), `AginiesMark` and `AginiesLogo` are inline SVG and
126
+ need neither.
127
+
128
+ ## Developing this package
129
+
130
+ `src/` is generated. The Aginies Design System is the source of truth; this package mirrors
131
+ it with one command:
132
+
133
+ ```sh
134
+ DS_DIR=/path/to/design-system bun run --filter @aginies/ui sync
135
+ ```
136
+
137
+ `scripts/sync-from-ds.ts` copies the component sources, concatenates the export fragments
138
+ into `src/index.js`, the stylesheets into `src/styles.css` and the group declarations into
139
+ `src/index.d.ts`, applies the one package-specific patch (the `lucide-react` icon source
140
+ above; it fails loudly if the design system's `Icon.jsx` no longer has the code it patches)
141
+ and removes files that are gone upstream. Fix components in the design system and re-sync;
142
+ an edit under `src/` is overwritten by the next sync, which is also why Biome skips
143
+ `packages/ui/src`.
144
+
145
+ ```sh
146
+ bun run --filter @aginies/ui build # dist/index.js, index.cjs, index.d.ts, styles.css
147
+ bun run --filter @aginies/ui test # server render + every export declared
148
+ bun run --filter @aginies/ui type-check # the declarations as a consumer sees them
149
+ bun run --filter @aginies/ui type-check:strict # also lib-checks src/index.d.ts itself
150
+ ```