@usetheo/ui 0.7.0-next.0 → 0.8.0-next.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/CHANGELOG.md CHANGED
@@ -7,6 +7,135 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ## [0.8.0-next.0] - 2026-05-23
11
+
12
+ Minor — adds eight cross-cutting primitives revealed by the systematic
13
+ review of the remaining 11 dashboard pages (Projects, Environments,
14
+ Team, Billing, Domains, Settings, Profile, Login, Register,
15
+ Verification, Recovery, DeviceSuccess) + recurring PaaS UI patterns.
16
+ Each component is used in ≥3 distinct sites in the consumer dashboard.
17
+ 6 are true primitives (Table, StatusDot, CopyButton, Timestamp,
18
+ StatTile, DangerZone); 2 are composites by taxonomy gate
19
+ (ConfirmDialog depends on Dialog/Input/Button; CodeBlock depends on
20
+ CopyButton). Zero breaking change; zero new peer-deps.
21
+
22
+ Plan: `.claude/knowledge-base/plans/dashboard-paas-primitives-2-plan.md`.
23
+ Edge-case review: `.claude/knowledge-base/reviews/edge-cases/dashboard-paas-primitives-2-edge-cases-2026-05-23.md`.
24
+ Consumer brief: `theo/docs/handoff/2026-05-23-theo-ui-cloud-dashboard-gaps-brief-2.md`.
25
+
26
+ ### Added
27
+
28
+ - **`<Table>` primitive (NEW)** — semantic data-table with sub-components
29
+ `Table.Header`, `Table.Body`, `Table.Row`, `Table.Cell`,
30
+ `Table.HeaderCell`. Supports `density` (`default` / `compact` via
31
+ Context), per-cell `align` (`left` / `center` / `right`), `numeric`
32
+ cells (`font-mono tabular-nums`), and sortable header cells
33
+ (`onSort` + `sortDirection` with ChevronUp/ChevronDown affordance
34
+ + `aria-sort`). `sortDirection` without `onSort` is a no-op (header
35
+ stays static); `sortDirection="none"` with `onSort` renders both
36
+ chevrons dimmed (`opacity-30`). 10 unit tests + 4 Ladle stories.
37
+ Brief #2 consumer: TheoCloud dashboard.
38
+ - **`<StatusDot>` primitive (NEW)** — semantic status indicator
39
+ (small colored circle + optional label). Five `status` kinds:
40
+ `live` (success), `building` (warning, auto-pulses), `failed`
41
+ (destructive), `idle` (muted), `warning` (warning, static). Three
42
+ sizes (`xs` 6px / `sm` 8px default / `md` 10px). When neither
43
+ `label` nor `aria-label` is provided, auto-applies
44
+ `aria-label={status}` + emits a dev-only warning (color-only
45
+ status is invisible to screen readers). 12 unit tests + 3 stories.
46
+ Brief #2 consumer: TheoCloud dashboard (7+ sites).
47
+ - **`<CopyButton>` primitive (NEW)** — click-to-copy primitive wrapping
48
+ `navigator.clipboard.writeText`. Icon swap (Copy → Check on success,
49
+ Copy → X on failure), `aria-live="polite"` announcement for screen
50
+ readers, optional `label`, `ghost`/`outline` variants, two sizes,
51
+ `onCopied` callback, configurable `feedbackDuration` (default
52
+ 1500ms). SSR-safe (guards `navigator?.clipboard?.writeText`); HTTP
53
+ non-localhost contexts (where the Clipboard API is undefined) fall
54
+ back to the failed state instead of throwing. Auto-cleans the
55
+ revert timer on unmount; debounces double-clicks. 12 unit tests +
56
+ 4 Ladle stories. Brief #2 consumer: TheoCloud dashboard.
57
+ - **`<Timestamp>` primitive (NEW)** — accessible `<time datetime>`
58
+ element with `relative` (default) / `absolute` / `both` formats.
59
+ Uses zero-dep `Intl.RelativeTimeFormat`. Auto-refreshes via
60
+ `setInterval` (default 60s, `refreshInterval={0}` disables).
61
+ Native `title` HTML attribute carries the absolute time on hover
62
+ (no Tooltip component dependency — keeps Timestamp a true
63
+ primitive). `aria-label` always carries the full date. Invalid
64
+ date renders an empty `<time>` element; invalid locale falls back
65
+ to default with a dev warning. `value` accepts ISO string, Date,
66
+ or **Unix milliseconds** (documented in JSDoc — passing seconds
67
+ renders ~1970). 13 unit tests + 4 Ladle stories. Brief #2
68
+ consumer: TheoCloud dashboard (every dashboard page).
69
+ - **`<StatTile>` primitive (NEW)** — big-number stat tile for
70
+ dashboard summary rows. `value` + `label` + optional `icon` +
71
+ optional `delta` (`{value, trend}` with `trend: "up" | "down" |
72
+ "flat"` driving TrendingUp/TrendingDown/Minus icons and
73
+ success/destructive/muted color). Dual mode (button/div) based on
74
+ `onClick` — same pattern as `AccountMenu`/`ProjectSwitcher`. Value
75
+ uses `font-display tabular-nums whitespace-nowrap`. 7 unit tests
76
+ + 4 Ladle stories. Brief #2 consumer: TheoCloud Overview
77
+ dashboard (3 tiles per page).
78
+ - **`<DangerZone>` primitive (NEW)** — destructive-actions section
79
+ with sub-component `DangerZone.Action`. Red-bordered container
80
+ (`border-destructive/30`) with title bar (default `"Danger Zone"`)
81
+ and action rows. Each row carries `title` + `description` +
82
+ consumer-provided `action` slot (typically a destructive
83
+ `<Button>`). Rows separated by hairline dividers; last row drops
84
+ the bottom border via `last:border-b-0`. Consumer supplies the
85
+ destructive button — DangerZone never imports `<Button>`, keeping
86
+ it a true primitive. 6 unit tests + 3 Ladle stories. Brief #2
87
+ consumer: Settings + Profile + Team + Billing pages.
88
+ - **`<ConfirmDialog>` composite (NEW)** — controlled confirmation
89
+ modal built on `Dialog`. Auto-focuses Cancel on open (deliberate
90
+ — NOT the destructive button). `intent="destructive"` styles the
91
+ confirm button with the destructive variant. `confirmationPhrase`
92
+ enables typed-confirmation guard (case-sensitive, empty string
93
+ treated as no phrase). Pressing Enter in the input triggers
94
+ confirm when matched. Async `onConfirm` shows `Loader2` spinner
95
+ while pending; resolve closes the dialog; reject keeps it open
96
+ so consumers can surface their own error. Phrase input resets
97
+ whenever the dialog closes. 13 unit tests + 4 Ladle stories.
98
+ Composite (depends on Dialog + Button + Input). Brief #2
99
+ consumer: 6+ destructive flows (Settings delete, Team remove,
100
+ Billing cancel, Profile delete, Domains remove, Environments
101
+ delete).
102
+ - **`<CodeBlock>` composite (NEW)** — terminal command / code-snippet
103
+ surface. Pre-rendered code inside a `<pre>` with optional
104
+ `terminal` prefix per line (`"$ "`), optional `caption` (file
105
+ name), and optional inline `<CopyButton>` positioned top-right.
106
+ The CopyButton receives the RAW `code` (without the visual `"$ "`
107
+ prefix) — consumers paste only the executable command. `language`
108
+ prop is reserved for future syntax highlighting (v1 ignored).
109
+ 7 unit tests + 4 Ladle stories. Composite (depends on
110
+ CopyButton). Brief #2 consumer: Overview EmptyState, Projects
111
+ EmptyState, Domains DNS records, API token display, LoginPage
112
+ CLI hint.
113
+
114
+ ### Implementation notes
115
+
116
+ - **Taxonomy gate** classified ConfirmDialog + CodeBlock as composites
117
+ (D2 in the plan). Brief #2 listed all 8 as primitives, but the
118
+ validate-quality-gates.ts script is hard-fail for any
119
+ `primitives/` file that imports another `@usetheo/ui` component.
120
+ - **Timestamp uses native `title` HTML attribute** (D3) instead of
121
+ the `<Tooltip>` component, to keep the file a true primitive
122
+ without sibling-primitive imports.
123
+ - **Zero new peer-deps.** Every component uses only `lucide-react`
124
+ + Radix (both already peer) + `cn()`.
125
+ - **Bundle delta** — `dist/index.js` grew from 395763 B to 417113 B
126
+ (+21350 B / +5.4%); `dist/index.d.ts` grew +11808 B / +7.5%. Both
127
+ exceeded the ±5% tolerance by a small margin (8 components ≈ +2.5 KB
128
+ each on average). The baseline was rebaselined in the same release
129
+ (`scripts/baselines/bundle-sizes.json`) — expected and explicit per
130
+ plan D6.
131
+ - 10 SHOULD TEST edge cases from the `/edge-case-plan` review
132
+ incorporated into the TDD blocks (EC-1 through EC-10 — empty
133
+ CopyButton value, unmount during timer, clipboard undefined,
134
+ Table sort direction without onSort, dimmed affordance for
135
+ `none`, StatusDot dev warning, Timestamp Unix seconds vs ms,
136
+ invalid locale fallback, ConfirmDialog empty phrase semantics,
137
+ Enter-to-confirm in phrase input).
138
+
10
139
  ## [0.7.0-next.0] - 2026-05-23
11
140
 
12
141
  Minor — adds four PaaS-shape primitives to cover the gaps surfaced by the
package/README.md CHANGED
@@ -13,8 +13,8 @@ A React component library built for AI agent surfaces and cloud dashboards. **10
13
13
  <!-- BEGIN:counts -->
14
14
  [![license](https://img.shields.io/badge/license-Apache--2.0-7C3AED?style=flat-square)](./LICENSE)
15
15
  [![react](https://img.shields.io/badge/react-18+-7C3AED?style=flat-square&logo=react&logoColor=white)](https://react.dev)
16
- [![tests](https://img.shields.io/badge/tests-1174%20passing-success?style=flat-square)](#quality-gates)
17
- [![components](https://img.shields.io/badge/components-124-7C3AED?style=flat-square)](#component-catalog)
16
+ [![tests](https://img.shields.io/badge/tests-1250%20passing-success?style=flat-square)](#quality-gates)
17
+ [![components](https://img.shields.io/badge/components-132-7C3AED?style=flat-square)](#component-catalog)
18
18
  [![shadcn](https://img.shields.io/badge/shadcn-compatible-000?style=flat-square)](https://ui.shadcn.com/docs/registry)
19
19
  <!-- END:counts -->
20
20
 
@@ -133,13 +133,13 @@ import { ThemeProvider, ThemeScript } from "@usetheo/ui";
133
133
  ## Component catalog
134
134
 
135
135
  <!-- BEGIN:component-catalog-intro -->
136
- **124 components**, organized by mechanical rule: a *primitive* imports no other `@usetheo/ui` component; a *composite* does.
136
+ **132 components**, organized by mechanical rule: a *primitive* imports no other `@usetheo/ui` component; a *composite* does.
137
137
  <!-- END:component-catalog-intro -->
138
138
 
139
139
  <details>
140
140
  <summary>
141
141
  <!-- BEGIN:primitives-count -->
142
- **Primitives** (81) — building blocks
142
+ **Primitives** (87) — building blocks
143
143
  <!-- END:primitives-count -->
144
144
  </summary>
145
145
 
@@ -147,15 +147,16 @@ import { ThemeProvider, ThemeScript } from "@usetheo/ui";
147
147
  `AgentErrorCard` · `AgentEvent` · `AgentHandoff` · `AgentProfile` · `AgentStartingState` · `AgentStreaming`
148
148
  `ArtifactPreview` · `AttachmentChip` · `AuditLogEntry` · `AutoCompactNotice` · `Avatar` · `Badge`
149
149
  `BrowserControls` · `BuildLogStream` · `Button` · `CapabilityIndicator` · `Card` · `ChatThread`
150
- `Checkbox` · `ContextCard` · `ContextWindowBar` · `CostMeter` · `CreatedFilesCard` · `CronJobCard`
151
- `Dialog` · `DiffViewer` · `EmptyState` · `FolderContextCard` · `FolderSelector` · `FormField`
152
- `HookConfig` · `HookEventLog` · `Input` · `IntentSelector` · `Label` · `LaneBoard`
153
- `LoginSplit` · `MCPServerCard` · `MemoryEditor` · `MentionMenu` · `MetricsPanel` · `ModelCard`
154
- `ModelSelector` · `PermissionMatrix` · `PlanBadge` · `Progress` · `ProgressChecklist` · `ProjectSwitcher`
155
- `QuickActionChips` · `RadioGroup` · `RecentFoldersList` · `RuleCard` · `RunStats` · `RunningTasksPanel`
156
- `ScrollArea` · `Select` · `SessionListItem` · `SessionTimeline` · `Sheet` · `Sidebar`
157
- `Skeleton` · `SkillCard` · `SocialAuthRow` · `StepsRail` · `SubAgentDispatch` · `Switch`
158
- `SystemPromptEditor` · `Tabs` · `TaskNode` · `TaskPlan` · `TerminalPanel` · `Textarea`
150
+ `Checkbox` · `ContextCard` · `ContextWindowBar` · `CopyButton` · `CostMeter` · `CreatedFilesCard`
151
+ `CronJobCard` · `DangerZone` · `Dialog` · `DiffViewer` · `EmptyState` · `FolderContextCard`
152
+ `FolderSelector` · `FormField` · `HookConfig` · `HookEventLog` · `Input` · `IntentSelector`
153
+ `Label` · `LaneBoard` · `LoginSplit` · `MCPServerCard` · `MemoryEditor` · `MentionMenu`
154
+ `MetricsPanel` · `ModelCard` · `ModelSelector` · `PermissionMatrix` · `PlanBadge` · `Progress`
155
+ `ProgressChecklist` · `ProjectSwitcher` · `QuickActionChips` · `RadioGroup` · `RecentFoldersList` · `RuleCard`
156
+ `RunStats` · `RunningTasksPanel` · `ScrollArea` · `Select` · `SessionListItem` · `SessionTimeline`
157
+ `Sheet` · `Sidebar` · `Skeleton` · `SkillCard` · `SocialAuthRow` · `StatTile`
158
+ `StatusDot` · `StepsRail` · `SubAgentDispatch` · `Switch` · `SystemPromptEditor` · `Table`
159
+ `Tabs` · `TaskNode` · `TaskPlan` · `TerminalPanel` · `Textarea` · `Timestamp`
159
160
  `Toast` · `Toaster` · `TokenUsageChart` · `ToolCall` · `ToolCallCard` · `ToolResult`
160
161
  `ToolsList` · `Tooltip` · `TopNav`
161
162
  <!-- END:primitives -->
@@ -165,12 +166,12 @@ import { ThemeProvider, ThemeScript } from "@usetheo/ui";
165
166
  <details>
166
167
  <summary>
167
168
  <!-- BEGIN:composites-count -->
168
- **Composites** (43) — assembled flows
169
+ **Composites** (45) — assembled flows
169
170
  <!-- END:composites-count -->
170
171
  </summary>
171
172
 
172
173
  <!-- BEGIN:composites -->
173
- `AccountMenu` · `AgentComposer` · `AgentEditor` · `AgentStream` · `AgentTimeline` · `ApprovalCard` · `ChatComposer` · `ChatMessage` · `ChatMessageAction` · `ChatMessageActions` · `ChatMessageBranch` · `ChatMessageBranchContent` · `ChatMessageBranchNext` · `ChatMessageBranchPage` · `ChatMessageBranchPrevious` · `ChatMessageBranchSelector` · `ChatMessageContent` · `ChatMessageResponse` · `ChatMessageRoot` · `ChatMessageToolbar` · `CommandPalette` · `CronJobsList` · `DataPart` · `DeploymentRow` · `DomainConfig` · `EnvVarEditor` · `FilePart` · `MCPServerList` · `PermissionModal` · `PreviewEnvCard` · `PreviewPanel` · `ProjectCard` · `ReasoningPart` · `RollbackUI` · `RuleEditor` · `SkillEditor` · `SkillsList` · `SourceDocumentPart` · `SourceUrlPart` · `TaskHeader` · `TextPart` · `ToolCallPart` · `UsageMeter`
174
+ `AccountMenu` · `AgentComposer` · `AgentEditor` · `AgentStream` · `AgentTimeline` · `ApprovalCard` · `ChatComposer` · `ChatMessage` · `ChatMessageAction` · `ChatMessageActions` · `ChatMessageBranch` · `ChatMessageBranchContent` · `ChatMessageBranchNext` · `ChatMessageBranchPage` · `ChatMessageBranchPrevious` · `ChatMessageBranchSelector` · `ChatMessageContent` · `ChatMessageResponse` · `ChatMessageRoot` · `ChatMessageToolbar` · `CodeBlock` · `CommandPalette` · `ConfirmDialog` · `CronJobsList` · `DataPart` · `DeploymentRow` · `DomainConfig` · `EnvVarEditor` · `FilePart` · `MCPServerList` · `PermissionModal` · `PreviewEnvCard` · `PreviewPanel` · `ProjectCard` · `ReasoningPart` · `RollbackUI` · `RuleEditor` · `SkillEditor` · `SkillsList` · `SourceDocumentPart` · `SourceUrlPart` · `TaskHeader` · `TextPart` · `ToolCallPart` · `UsageMeter`
174
175
  <!-- END:composites -->
175
176
 
176
177
  </details>