@robr0/design-system 0.6.0 → 0.8.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/LICENSE +53 -2
- package/README.md +36 -5
- package/components/AgentPlan/AgentPlan.css +231 -0
- package/components/AgentPlan/AgentPlan.d.ts +41 -0
- package/components/AgentPlan/AgentPlan.js +99 -0
- package/components/AgentStatus/AgentStatus.css +26 -11
- package/components/Card/Card.css +9 -0
- package/components/Card/Card.d.ts +6 -0
- package/components/Card/Card.js +2 -1
- package/components/Composer/Composer.css +18 -0
- package/components/Composer/Composer.d.ts +3 -0
- package/components/Composer/Composer.js +12 -1
- package/components/DataTable/DataTable.css +105 -0
- package/components/DataTable/DataTable.d.ts +81 -0
- package/components/DataTable/DataTable.js +235 -0
- package/components/EventCalendar/EventCalendar.css +328 -0
- package/components/EventCalendar/EventCalendar.d.ts +51 -0
- package/components/EventCalendar/EventCalendar.js +213 -0
- package/components/ModelPicker/ModelPicker.css +238 -0
- package/components/ModelPicker/ModelPicker.d.ts +60 -0
- package/components/ModelPicker/ModelPicker.js +217 -0
- package/components/NotificationCenter/NotificationCenter.css +262 -0
- package/components/NotificationCenter/NotificationCenter.d.ts +72 -0
- package/components/NotificationCenter/NotificationCenter.js +128 -0
- package/components/Prose/Prose.css +18 -1
- package/components/Reasoning/Reasoning.css +19 -4
- package/components/ShaderField/ShaderField.css +24 -0
- package/components/ShaderField/ShaderField.d.ts +68 -0
- package/components/ShaderField/ShaderField.js +54 -0
- package/components/ShaderField/field.glsl.d.ts +39 -0
- package/components/ShaderField/field.glsl.js +178 -0
- package/components/ShaderField/useShaderField.d.ts +103 -0
- package/components/ShaderField/useShaderField.js +409 -0
- package/components/Timeline/Timeline.css +17 -0
- package/components/Timeline/Timeline.d.ts +2 -0
- package/components/Timeline/Timeline.js +1 -0
- package/components/registry.json +48 -0
- package/components/registry.json.d.ts +48 -0
- package/components/registry.json.js +1 -1
- package/index.d.ts +6 -0
- package/index.js +19 -0
- package/package.json +5 -1
- package/tokens/registry.json +1 -0
- package/tokens/registry.json.d.ts +1 -0
- package/tokens/registry.json.js +1 -1
- package/tokens/tokens-dark.css +1 -1
- package/tokens/tokens-light.css +2 -2
- package/tokens/tokens-motion.css +2 -0
package/LICENSE
CHANGED
|
@@ -1,6 +1,21 @@
|
|
|
1
|
-
|
|
1
|
+
Copyright (c) 2026 Rob Ritacca. All rights reserved, except as granted below.
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
This repository holds two kinds of material under two different licenses.
|
|
4
|
+
The SOFTWARE is free to use under the MIT License. The CONTENT is not
|
|
5
|
+
licensed for reuse.
|
|
6
|
+
|
|
7
|
+
If you installed this as an npm package, you received the Software only.
|
|
8
|
+
The MIT License below is the license for everything in that package.
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
================================================================================
|
|
12
|
+
SOFTWARE — MIT License
|
|
13
|
+
================================================================================
|
|
14
|
+
|
|
15
|
+
Applies to the design system and the code that builds and documents it:
|
|
16
|
+
component source and CSS, the design tokens, Storybook stories, the build,
|
|
17
|
+
generator and validator scripts, configuration, and the website's application
|
|
18
|
+
code (layouts, routing, hooks, and UI components).
|
|
4
19
|
|
|
5
20
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
21
|
of this software and associated documentation files (the "Software"), to deal
|
|
@@ -19,3 +34,39 @@ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
|
19
34
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
35
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
36
|
SOFTWARE.
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
================================================================================
|
|
40
|
+
CONTENT — All rights reserved
|
|
41
|
+
================================================================================
|
|
42
|
+
|
|
43
|
+
Applies to the authored material published on robertritacca.com and stored in
|
|
44
|
+
this repository, including:
|
|
45
|
+
|
|
46
|
+
- Written prose on any page: body copy, headings, descriptions, and
|
|
47
|
+
microcopy across the website and the root specification documents.
|
|
48
|
+
- Case studies and the client work they describe
|
|
49
|
+
(website/src/app/work/, website/src/data/case-studies.json).
|
|
50
|
+
- Essays and long-form writing
|
|
51
|
+
(website/src/app/writing/, website/src/data/essays.json).
|
|
52
|
+
- The project journal entries (website/src/data/site-updates.json).
|
|
53
|
+
- Photographs, illustrations, client logos, cover images, and other media.
|
|
54
|
+
- The name "Rob Ritacca", the RR logo and wordmark, and any likeness,
|
|
55
|
+
photograph, biography, or professional history of Rob Ritacca.
|
|
56
|
+
|
|
57
|
+
No license is granted to this material. Without prior written permission you
|
|
58
|
+
may not copy, reproduce, republish, mirror, redistribute, sell, or create
|
|
59
|
+
derivative works from it, and you may not use it to train, fine-tune, or
|
|
60
|
+
otherwise build a machine learning model. You may not present it as your own
|
|
61
|
+
work, and you may not use the name, logo, likeness, or professional history of
|
|
62
|
+
Rob Ritacca to imply authorship, endorsement, or affiliation.
|
|
63
|
+
|
|
64
|
+
You are welcome to read the site, quote short passages with attribution and a
|
|
65
|
+
link to the source, link to any page, and use automated tools to read and cite
|
|
66
|
+
pages as a human reader would. Nothing here restricts rights you already have
|
|
67
|
+
under applicable copyright law.
|
|
68
|
+
|
|
69
|
+
Client logos and trademarks shown in case studies belong to their respective
|
|
70
|
+
owners and appear as references to real work, not as a grant of any rights.
|
|
71
|
+
|
|
72
|
+
Permission requests: rob.ritacca@gmail.com
|
package/README.md
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
[](https://www.npmjs.com/package/@robr0/design-system)
|
|
6
6
|
<!-- npm-badge:end -->
|
|
7
7
|
|
|
8
|
-
A personal portfolio site, the AI-ready React design system behind it, and the AI layer that lets the site answer questions about itself. Claude Code builds all of it from the written specs in this repo (`CLAUDE.md` for the rules, `design.md` for the design language, `content-design.md` for how every word reads
|
|
8
|
+
A personal portfolio site, the AI-ready React design system behind it, and the AI layer that lets the site answer questions about itself. Claude Code builds all of it from the written specs in this repo (`CLAUDE.md` for the rules, `design.md` for the design language, `content-design.md` for how every word reads), and generated registries keep this README and the docs site from drifting. The design system is the backbone every portfolio page is built on, so the work is presented consistently and to the same craft standards throughout.
|
|
9
9
|
|
|
10
10
|
**[→ Live site](https://robertritacca.com/)** · **[→ Storybook](https://design-system-iota-one.vercel.app/?path=/docs/robr0-ds--docs)**
|
|
11
11
|
|
|
@@ -18,7 +18,7 @@ The **live site** is the portfolio built on the design system. **Storybook** is
|
|
|
18
18
|
| Part | Description |
|
|
19
19
|
|---|---|
|
|
20
20
|
| **Portfolio website** (`/website`) | Next.js app with case studies, work history, writing, and about pages, all built exclusively with the design system components below. **[Live site →](https://robertritacca.com/)** |
|
|
21
|
-
| **Design system** (`/src`) | <!-- component-count -->
|
|
21
|
+
| **Design system** (`/src`) | <!-- component-count -->84<!-- /component-count --> React components, a three-tier token architecture, dark mode, a WebGL2 ambient background that themes itself from your tokens, and a full documentation site. Built to production standards. **[Storybook →](https://design-system-iota-one.vercel.app/?path=/docs/robr0-ds--docs)** |
|
|
22
22
|
| **AI layer** (`ai` components in `/src`, chat in `/website`, `/evals`) | A site-wide chat that answers questions about the work: built from the library's own `ai` components, grounded in a corpus generated from the site's published content, and scored by a golden-set eval. |
|
|
23
23
|
|
|
24
24
|
---
|
|
@@ -28,9 +28,32 @@ The **live site** is the portfolio built on the design system. **Storybook** is
|
|
|
28
28
|
### Components
|
|
29
29
|
|
|
30
30
|
<!-- component-list:start -->
|
|
31
|
-
Accordion · Agent status · AI button · Alert · Alert dialog · App layout · App sidebar · Avatar · Badge · Breadcrumb · Button · Button group · Card · Carousel · Chart · Chat header · Chat marker · Chat message · Chat thread · Checkbox · Chip · Circular button · Code block · Colour picker · Combobox · Command palette · Composer · Contact card · Context menu · Contribution graph · Date input · Date picker · Dialog · Divider · Document chip · Drawer · Dropdown · Dropdown menu · Empty state · Entity card · Field · Figure · File input · Input · Instructions · Interrupt card · Kbd · Link list · Message actions · Message card · Navigation · Nav list · Pagination · Popover · Progress bar · Prompt suggestions · Prose · Quote · Radio button · Reasoning · Section title · Segmented control · Selection card · Skeleton · Slider · Source chip · Spinner · Stat · Swatch · Table · Tabs · Textarea · Timeline · Toast · Toggle group · Toggle switch · Tool call · Tooltip
|
|
31
|
+
Accordion · Agent plan · Agent status · AI button · Alert · Alert dialog · App layout · App sidebar · Avatar · Badge · Breadcrumb · Button · Button group · Card · Carousel · Chart · Chat header · Chat marker · Chat message · Chat thread · Checkbox · Chip · Circular button · Code block · Colour picker · Combobox · Command palette · Composer · Contact card · Context menu · Contribution graph · Data table · Date input · Date picker · Dialog · Divider · Document chip · Drawer · Dropdown · Dropdown menu · Empty state · Entity card · Event calendar · Field · Figure · File input · Input · Instructions · Interrupt card · Kbd · Link list · Message actions · Message card · Model picker · Navigation · Nav list · Notification centre · Pagination · Popover · Progress bar · Prompt suggestions · Prose · Quote · Radio button · Reasoning · Section title · Segmented control · Selection card · Shader field · Skeleton · Slider · Source chip · Spinner · Stat · Swatch · Table · Tabs · Textarea · Timeline · Toast · Toggle group · Toggle switch · Tool call · Tooltip
|
|
32
32
|
<!-- component-list:end -->
|
|
33
33
|
|
|
34
|
+
### Ambient background
|
|
35
|
+
|
|
36
|
+
The package ships more than components. **Shader field** is a WebGL2 canvas that sums soft Gaussian light sources into an ambient field of colour, and every source reads a semantic colour token at runtime. Override a primitive and the background re-themes with the rest of the system, in both themes, with nothing wired up:
|
|
37
|
+
|
|
38
|
+
```tsx
|
|
39
|
+
import { ShaderField, type ShaderFieldStatus } from '@robr0/design-system';
|
|
40
|
+
|
|
41
|
+
const [status, setStatus] = useState<ShaderFieldStatus>('pending');
|
|
42
|
+
|
|
43
|
+
<div style={{ position: 'fixed', inset: 0, zIndex: -1 }}>
|
|
44
|
+
{status === 'unavailable' && <YourCssFallback />}
|
|
45
|
+
<ShaderField params={{ streak: 0.4 }} onStatusChange={setStatus} />
|
|
46
|
+
</div>
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
Eight parameters describe the look, and a composition is a table of token names with positions and drift periods, so a negative weight cuts a shadow through the field instead of adding light to it.
|
|
50
|
+
|
|
51
|
+
It asks two things of you, both deliberate. It fills a positioned ancestor you provide, because where a background sits is a layout decision rather than a rendering one. And it never decides what to paint instead of itself: it reports `pending`, `active` or `unavailable`, and one fallback covers every way it can fail (no WebGL2, a blocked or lost GPU context, a renderer that stalls before its first frame, or `enabled={false}` as a kill switch). `pending` is the state worth handling. Paint neither layer while the context comes up, or the swap a frame later reads as two backgrounds loading in sequence.
|
|
52
|
+
|
|
53
|
+
It is also the one place a `prefers-reduced-motion` check lives in JavaScript rather than in the motion tokens, because the CSS guard cannot see a `requestAnimationFrame` loop. Set the preference and it draws a single static frame.
|
|
54
|
+
|
|
55
|
+
The background behind this site is that component, with eight blurred CSS discs kept painted underneath as its fallback. The **[component page](https://robertritacca.com/components/shader-field)** is a live demo, and the **[setup guide](https://robertritacca.com/docs/get-started)** has the wiring.
|
|
56
|
+
|
|
34
57
|
### Using the package
|
|
35
58
|
|
|
36
59
|
The design system is published as [`@robr0/design-system`](https://www.npmjs.com/package/@robr0/design-system) (React 19+ is a peer dependency). The **[full setup guide](https://robertritacca.com/docs/get-started)** expands on everything in this section:
|
|
@@ -116,14 +139,14 @@ Answers are measured, not assumed. `evals/chat` holds a golden set that runs thr
|
|
|
116
139
|
- **Vite 7**: dev server and library build
|
|
117
140
|
- **Next.js 16**: portfolio site and design system documentation
|
|
118
141
|
- **Storybook 10**: component explorer
|
|
119
|
-
- **Vitest + Playwright**: every Storybook story runs as a render test in headless Chromium
|
|
142
|
+
- **Vitest + Playwright + axe**: every Storybook story runs as a render test in headless Chromium, with an accessibility audit on each
|
|
120
143
|
- **CSS custom properties**: all theming via semantic tokens, no CSS-in-JS
|
|
121
144
|
|
|
122
145
|
---
|
|
123
146
|
|
|
124
147
|
## Quality & CI
|
|
125
148
|
|
|
126
|
-
Every push and pull request runs a GitHub Actions pipeline ([`ci.yml`](.github/workflows/ci.yml)) with four jobs: lint + library build, story tests
|
|
149
|
+
Every push and pull request runs a GitHub Actions pipeline ([`ci.yml`](.github/workflows/ci.yml)) with four jobs: lint + library build, story tests, Storybook build, and website lint + build. The story tests render every Storybook story in headless Chromium via Vitest and run an axe accessibility audit on each, so a violation fails the build exactly like a render error. The same checklist runs locally with one command:
|
|
127
150
|
|
|
128
151
|
```bash
|
|
129
152
|
npm run verify # lint + library type-check + package build + story tests + Storybook build + website lint + build
|
|
@@ -143,3 +166,11 @@ npm run storybook # http://localhost:6006
|
|
|
143
166
|
npm install
|
|
144
167
|
npm run dev --workspace website # http://localhost:3000
|
|
145
168
|
```
|
|
169
|
+
|
|
170
|
+
---
|
|
171
|
+
|
|
172
|
+
## License
|
|
173
|
+
|
|
174
|
+
Two licenses, one repository. The **software** (components, tokens, scripts, and the website's application code) is MIT, so use it in anything. The **content** (page prose, case studies, essays, images, and the name and likeness of Rob Ritacca) is all rights reserved and not licensed for reuse. See [`LICENSE`](LICENSE) for the full terms.
|
|
175
|
+
|
|
176
|
+
The npm package contains the software only.
|
|
@@ -0,0 +1,231 @@
|
|
|
1
|
+
/* ============================================
|
|
2
|
+
AGENT PLAN COMPONENT
|
|
3
|
+
A collapsible checklist of an agent's task:
|
|
4
|
+
a progress header and one row per step.
|
|
5
|
+
|
|
6
|
+
The container stays neutral, like ToolCall —
|
|
7
|
+
colour lives in each step's indicator, so a
|
|
8
|
+
long plan reads as a list rather than a wall
|
|
9
|
+
of tinted rows. A thin connector ties the
|
|
10
|
+
indicators into one path through the task.
|
|
11
|
+
============================================ */
|
|
12
|
+
|
|
13
|
+
.ds-agent-plan {
|
|
14
|
+
display: flex;
|
|
15
|
+
flex-direction: column;
|
|
16
|
+
width: 100%;
|
|
17
|
+
background-color: var(--color-bg-container-primary);
|
|
18
|
+
border: var(--border-xs) solid var(--color-bg-container-border);
|
|
19
|
+
border-radius: var(--radius-md);
|
|
20
|
+
overflow: hidden;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
/* ============================================
|
|
24
|
+
HEADER
|
|
25
|
+
============================================ */
|
|
26
|
+
|
|
27
|
+
.ds-agent-plan__header {
|
|
28
|
+
display: flex;
|
|
29
|
+
align-items: center;
|
|
30
|
+
gap: var(--gap-sm);
|
|
31
|
+
width: 100%;
|
|
32
|
+
padding: var(--padding-xs) var(--padding-sm-md);
|
|
33
|
+
background: none;
|
|
34
|
+
border: none;
|
|
35
|
+
text-align: left;
|
|
36
|
+
cursor: pointer;
|
|
37
|
+
transition: background-color var(--motion-duration-fast) var(--motion-ease-standard);
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
.ds-agent-plan__header:hover {
|
|
41
|
+
background-color: var(--color-bg-container-secondary);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
.ds-agent-plan__header:focus-visible {
|
|
45
|
+
outline: 2px solid var(--color-action-primary-bg);
|
|
46
|
+
outline-offset: -2px;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
.ds-agent-plan__title {
|
|
50
|
+
flex: 1 1 auto;
|
|
51
|
+
min-width: 0;
|
|
52
|
+
overflow: hidden;
|
|
53
|
+
text-overflow: ellipsis;
|
|
54
|
+
white-space: nowrap;
|
|
55
|
+
color: var(--color-text-primary);
|
|
56
|
+
font-family: var(--font-paragraph-sm-em-family);
|
|
57
|
+
font-size: var(--font-paragraph-sm-em-size);
|
|
58
|
+
font-weight: var(--font-paragraph-sm-em-weight);
|
|
59
|
+
line-height: var(--font-paragraph-sm-em-line-height);
|
|
60
|
+
letter-spacing: var(--font-paragraph-sm-em-letter-spacing);
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
.ds-agent-plan__count {
|
|
64
|
+
flex: none;
|
|
65
|
+
color: var(--color-text-tertiary);
|
|
66
|
+
font-family: var(--font-paragraph-sm-family);
|
|
67
|
+
font-size: var(--font-paragraph-sm-size);
|
|
68
|
+
font-weight: var(--font-paragraph-sm-weight);
|
|
69
|
+
line-height: var(--font-paragraph-sm-line-height);
|
|
70
|
+
letter-spacing: var(--font-paragraph-sm-letter-spacing);
|
|
71
|
+
font-variant-numeric: tabular-nums;
|
|
72
|
+
white-space: nowrap;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
.ds-agent-plan__chevron {
|
|
76
|
+
--icon-size: var(--icon-size-sm);
|
|
77
|
+
|
|
78
|
+
flex: none;
|
|
79
|
+
color: var(--color-icon-secondary);
|
|
80
|
+
transition: transform var(--motion-duration-slow) var(--motion-ease-standard);
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
.ds-agent-plan--open .ds-agent-plan__chevron {
|
|
84
|
+
transform: rotate(180deg);
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
/* ============================================
|
|
88
|
+
PANEL
|
|
89
|
+
Same grid-rows collapse as ToolCall, so the
|
|
90
|
+
list opens and closes without measuring.
|
|
91
|
+
============================================ */
|
|
92
|
+
|
|
93
|
+
.ds-agent-plan__panel {
|
|
94
|
+
display: grid;
|
|
95
|
+
grid-template-rows: 0fr;
|
|
96
|
+
visibility: hidden;
|
|
97
|
+
transition:
|
|
98
|
+
grid-template-rows var(--motion-duration-slow) var(--motion-ease-standard),
|
|
99
|
+
visibility var(--motion-duration-slow) var(--motion-ease-standard);
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
.ds-agent-plan--open .ds-agent-plan__panel {
|
|
103
|
+
grid-template-rows: 1fr;
|
|
104
|
+
visibility: visible;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
.ds-agent-plan__content {
|
|
108
|
+
overflow: hidden;
|
|
109
|
+
min-height: 0;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
.ds-agent-plan--open .ds-agent-plan__content {
|
|
113
|
+
border-top: var(--border-xs) solid var(--color-divider);
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
/* ============================================
|
|
117
|
+
STEPS
|
|
118
|
+
============================================ */
|
|
119
|
+
|
|
120
|
+
.ds-agent-plan__steps {
|
|
121
|
+
display: flex;
|
|
122
|
+
flex-direction: column;
|
|
123
|
+
margin: 0;
|
|
124
|
+
padding: var(--padding-sm) var(--padding-sm-md);
|
|
125
|
+
list-style: none;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
.ds-agent-plan__step {
|
|
129
|
+
position: relative;
|
|
130
|
+
display: flex;
|
|
131
|
+
align-items: flex-start;
|
|
132
|
+
gap: var(--gap-sm);
|
|
133
|
+
padding: var(--padding-xxs) 0;
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
/* Connector — a thin line linking each indicator to the next */
|
|
137
|
+
.ds-agent-plan__step:not(:last-child)::before {
|
|
138
|
+
content: '';
|
|
139
|
+
position: absolute;
|
|
140
|
+
top: calc(var(--padding-xxs) + var(--icon-size-sm));
|
|
141
|
+
bottom: calc(-1 * var(--padding-xxs));
|
|
142
|
+
left: calc(var(--icon-size-sm) / 2);
|
|
143
|
+
width: var(--border-xs);
|
|
144
|
+
background-color: var(--color-divider);
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
.ds-agent-plan__indicator {
|
|
148
|
+
display: inline-flex;
|
|
149
|
+
align-items: center;
|
|
150
|
+
justify-content: center;
|
|
151
|
+
flex: none;
|
|
152
|
+
color: var(--color-icon-secondary);
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
.ds-agent-plan__indicator .material-symbols-rounded {
|
|
156
|
+
--icon-size: var(--icon-size-sm);
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
.ds-agent-plan__step-body {
|
|
160
|
+
display: flex;
|
|
161
|
+
flex-direction: column;
|
|
162
|
+
min-width: 0;
|
|
163
|
+
/* Align the first text line with the indicator's optical centre */
|
|
164
|
+
padding-top: calc((var(--icon-size-sm) - var(--font-paragraph-sm-line-height)) / 2);
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
.ds-agent-plan__label {
|
|
168
|
+
color: var(--color-text-primary);
|
|
169
|
+
font-family: var(--font-paragraph-sm-family);
|
|
170
|
+
font-size: var(--font-paragraph-sm-size);
|
|
171
|
+
font-weight: var(--font-paragraph-sm-weight);
|
|
172
|
+
line-height: var(--font-paragraph-sm-line-height);
|
|
173
|
+
letter-spacing: var(--font-paragraph-sm-letter-spacing);
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
.ds-agent-plan__detail {
|
|
177
|
+
color: var(--color-text-tertiary);
|
|
178
|
+
font-family: var(--font-paragraph-sm-family);
|
|
179
|
+
font-size: var(--font-paragraph-sm-size);
|
|
180
|
+
font-weight: var(--font-paragraph-sm-weight);
|
|
181
|
+
line-height: var(--font-paragraph-sm-line-height);
|
|
182
|
+
letter-spacing: var(--font-paragraph-sm-letter-spacing);
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
/* ============================================
|
|
186
|
+
STEP STATES
|
|
187
|
+
============================================ */
|
|
188
|
+
|
|
189
|
+
.ds-agent-plan__step--completed .ds-agent-plan__indicator {
|
|
190
|
+
color: var(--color-status-positive-text);
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
.ds-agent-plan__step--completed .ds-agent-plan__label {
|
|
194
|
+
color: var(--color-text-tertiary);
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
.ds-agent-plan__step--active .ds-agent-plan__indicator {
|
|
198
|
+
color: var(--color-status-info-text);
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
.ds-agent-plan__step--active .ds-agent-plan__label {
|
|
202
|
+
font-family: var(--font-paragraph-sm-em-family);
|
|
203
|
+
font-weight: var(--font-paragraph-sm-em-weight);
|
|
204
|
+
letter-spacing: var(--font-paragraph-sm-em-letter-spacing);
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
.ds-agent-plan__step--failed .ds-agent-plan__indicator {
|
|
208
|
+
color: var(--color-status-error-text);
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
.ds-agent-plan__step--failed .ds-agent-plan__label {
|
|
212
|
+
color: var(--color-status-error-text);
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
/* ============================================
|
|
216
|
+
SCREEN READER TEXT
|
|
217
|
+
Status is colour + glyph for sighted users;
|
|
218
|
+
this span announces it.
|
|
219
|
+
============================================ */
|
|
220
|
+
|
|
221
|
+
.ds-agent-plan__sr {
|
|
222
|
+
position: absolute;
|
|
223
|
+
width: 1px;
|
|
224
|
+
height: 1px;
|
|
225
|
+
padding: 0;
|
|
226
|
+
margin: -1px;
|
|
227
|
+
overflow: hidden;
|
|
228
|
+
clip: rect(0, 0, 0, 0);
|
|
229
|
+
white-space: nowrap;
|
|
230
|
+
border: 0;
|
|
231
|
+
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
export type AgentPlanStepStatus = 'pending' | 'active' | 'completed' | 'failed';
|
|
3
|
+
export interface AgentPlanStep {
|
|
4
|
+
/** What this step does, in one line. */
|
|
5
|
+
label: string;
|
|
6
|
+
/** Where the step has got to. Defaults to `pending`. */
|
|
7
|
+
status?: AgentPlanStepStatus;
|
|
8
|
+
/** Optional supporting line under the label, e.g. the file it touched. */
|
|
9
|
+
detail?: string;
|
|
10
|
+
}
|
|
11
|
+
/** Props owned by AgentPlan itself — everything else falls through to the root element. */
|
|
12
|
+
type AgentPlanOwnProps = {
|
|
13
|
+
/** The plan, in order. Step status drives each row's indicator and colour. */
|
|
14
|
+
steps: AgentPlanStep[];
|
|
15
|
+
/**
|
|
16
|
+
* Header text. Left unset, it is computed from the steps —
|
|
17
|
+
* "3 steps left", or "All steps complete" once everything is done.
|
|
18
|
+
*/
|
|
19
|
+
title?: string;
|
|
20
|
+
/** Open state for controlled use. Pair with `onOpenChange`. */
|
|
21
|
+
open?: boolean;
|
|
22
|
+
/** Open state for uncontrolled use. */
|
|
23
|
+
defaultOpen?: boolean;
|
|
24
|
+
/** Fires whenever the step list opens or closes. */
|
|
25
|
+
onOpenChange?: (open: boolean) => void;
|
|
26
|
+
/** Additional CSS classes */
|
|
27
|
+
className?: string;
|
|
28
|
+
};
|
|
29
|
+
export interface AgentPlanProps extends AgentPlanOwnProps, Omit<React.ComponentPropsWithoutRef<'div'>, keyof AgentPlanOwnProps> {
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* AgentPlan shows the steps an agent intends to take and where it has got to:
|
|
33
|
+
* a collapsible checklist with one row per step, a live progress readout in
|
|
34
|
+
* the header, and completed work ticked off as the run advances.
|
|
35
|
+
*
|
|
36
|
+
* It complements the other agent primitives — AgentStatus says what is
|
|
37
|
+
* happening right now, ToolCall records one action, AgentPlan holds the
|
|
38
|
+
* whole task.
|
|
39
|
+
*/
|
|
40
|
+
export declare const AgentPlan: React.ForwardRefExoticComponent<AgentPlanProps & React.RefAttributes<HTMLDivElement>>;
|
|
41
|
+
export {};
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
import { jsxs, jsx } from "react/jsx-runtime";
|
|
2
|
+
import React, { useId, useState, useCallback } from "react";
|
|
3
|
+
import { Spinner } from "../Spinner/Spinner.js";
|
|
4
|
+
import "./AgentPlan.css";
|
|
5
|
+
import "../../fonts/material-symbols.css";
|
|
6
|
+
const STEP_ICONS = {
|
|
7
|
+
pending: "circle",
|
|
8
|
+
completed: "check_circle",
|
|
9
|
+
failed: "error"
|
|
10
|
+
};
|
|
11
|
+
const STEP_STATUS_TEXT = {
|
|
12
|
+
pending: "Not started",
|
|
13
|
+
active: "In progress",
|
|
14
|
+
completed: "Completed",
|
|
15
|
+
failed: "Failed"
|
|
16
|
+
};
|
|
17
|
+
const AgentPlan = React.forwardRef(
|
|
18
|
+
({
|
|
19
|
+
steps,
|
|
20
|
+
title,
|
|
21
|
+
open,
|
|
22
|
+
defaultOpen = true,
|
|
23
|
+
onOpenChange,
|
|
24
|
+
className = "",
|
|
25
|
+
...rest
|
|
26
|
+
}, ref) => {
|
|
27
|
+
const baseClass = "ds-agent-plan";
|
|
28
|
+
const id = useId();
|
|
29
|
+
const panelId = `${id}-panel`;
|
|
30
|
+
const triggerId = `${id}-trigger`;
|
|
31
|
+
const isControlled = open !== void 0;
|
|
32
|
+
const [uncontrolledOpen, setUncontrolledOpen] = useState(defaultOpen);
|
|
33
|
+
const isOpen = isControlled ? open : uncontrolledOpen;
|
|
34
|
+
const toggle = useCallback(() => {
|
|
35
|
+
const next = !isOpen;
|
|
36
|
+
if (!isControlled) setUncontrolledOpen(next);
|
|
37
|
+
onOpenChange?.(next);
|
|
38
|
+
}, [isOpen, isControlled, onOpenChange]);
|
|
39
|
+
const total = steps.length;
|
|
40
|
+
const completed = steps.filter((step) => step.status === "completed").length;
|
|
41
|
+
const remaining = total - completed;
|
|
42
|
+
const resolvedTitle = title ?? (total > 0 && remaining === 0 ? "All steps complete" : `${remaining} step${remaining === 1 ? "" : "s"} left`);
|
|
43
|
+
const classes = [baseClass, isOpen ? `${baseClass}--open` : "", className].filter(Boolean).join(" ");
|
|
44
|
+
return /* @__PURE__ */ jsxs("div", { ...rest, ref, className: classes, children: [
|
|
45
|
+
/* @__PURE__ */ jsxs(
|
|
46
|
+
"button",
|
|
47
|
+
{
|
|
48
|
+
type: "button",
|
|
49
|
+
id: triggerId,
|
|
50
|
+
className: `${baseClass}__header`,
|
|
51
|
+
"aria-expanded": isOpen,
|
|
52
|
+
"aria-controls": panelId,
|
|
53
|
+
onClick: toggle,
|
|
54
|
+
children: [
|
|
55
|
+
/* @__PURE__ */ jsx("span", { className: `${baseClass}__title`, children: resolvedTitle }),
|
|
56
|
+
total > 0 && /* @__PURE__ */ jsxs("span", { className: `${baseClass}__count`, children: [
|
|
57
|
+
completed,
|
|
58
|
+
"/",
|
|
59
|
+
total
|
|
60
|
+
] }),
|
|
61
|
+
/* @__PURE__ */ jsx("span", { className: `${baseClass}__chevron material-symbols-rounded`, "aria-hidden": "true", children: "expand_more" })
|
|
62
|
+
]
|
|
63
|
+
}
|
|
64
|
+
),
|
|
65
|
+
/* @__PURE__ */ jsx(
|
|
66
|
+
"div",
|
|
67
|
+
{
|
|
68
|
+
className: `${baseClass}__panel`,
|
|
69
|
+
id: panelId,
|
|
70
|
+
role: "region",
|
|
71
|
+
"aria-labelledby": triggerId,
|
|
72
|
+
children: /* @__PURE__ */ jsx("div", { className: `${baseClass}__content`, children: /* @__PURE__ */ jsx("ol", { className: `${baseClass}__steps`, children: steps.map((step, index) => {
|
|
73
|
+
const status = step.status ?? "pending";
|
|
74
|
+
return /* @__PURE__ */ jsxs(
|
|
75
|
+
"li",
|
|
76
|
+
{
|
|
77
|
+
className: `${baseClass}__step ${baseClass}__step--${status}`,
|
|
78
|
+
"aria-current": status === "active" ? "step" : void 0,
|
|
79
|
+
children: [
|
|
80
|
+
/* @__PURE__ */ jsx("span", { className: `${baseClass}__indicator`, "aria-hidden": "true", children: status === "active" ? /* @__PURE__ */ jsx(Spinner, { size: "sm", variant: "inherit" }) : /* @__PURE__ */ jsx("span", { className: "material-symbols-rounded", children: STEP_ICONS[status] }) }),
|
|
81
|
+
/* @__PURE__ */ jsxs("span", { className: `${baseClass}__step-body`, children: [
|
|
82
|
+
/* @__PURE__ */ jsx("span", { className: `${baseClass}__label`, children: step.label }),
|
|
83
|
+
step.detail && /* @__PURE__ */ jsx("span", { className: `${baseClass}__detail`, children: step.detail })
|
|
84
|
+
] }),
|
|
85
|
+
/* @__PURE__ */ jsx("span", { className: `${baseClass}__sr`, children: STEP_STATUS_TEXT[status] })
|
|
86
|
+
]
|
|
87
|
+
},
|
|
88
|
+
index
|
|
89
|
+
);
|
|
90
|
+
}) }) })
|
|
91
|
+
}
|
|
92
|
+
)
|
|
93
|
+
] });
|
|
94
|
+
}
|
|
95
|
+
);
|
|
96
|
+
AgentPlan.displayName = "AgentPlan";
|
|
97
|
+
export {
|
|
98
|
+
AgentPlan
|
|
99
|
+
};
|
|
@@ -22,8 +22,8 @@
|
|
|
22
22
|
.ds-agent-status {
|
|
23
23
|
--ds-agent-color: var(--color-text-secondary);
|
|
24
24
|
--ds-agent-label-color: var(--color-text-secondary);
|
|
25
|
-
--ds-agent-shimmer-base: var(--color-text-
|
|
26
|
-
--ds-agent-shimmer-sweep: var(--color-text-
|
|
25
|
+
--ds-agent-shimmer-base: var(--color-text-tertiary);
|
|
26
|
+
--ds-agent-shimmer-sweep: var(--color-text-primary);
|
|
27
27
|
--ds-agent-dot-dim: 0.2;
|
|
28
28
|
--ds-agent-dot-rest: 0.82;
|
|
29
29
|
--ds-agent-cycle: var(--motion-duration-loop-matrix);
|
|
@@ -33,11 +33,16 @@
|
|
|
33
33
|
display: inline-flex;
|
|
34
34
|
align-items: center;
|
|
35
35
|
gap: var(--gap-sm-md);
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
36
|
+
|
|
37
|
+
/* The label is set in the title-body face, not the paragraph one: a status
|
|
38
|
+
is a heading for the work underneath it, not prose. The two sets share
|
|
39
|
+
16px/24px metrics, so the row's geometry is identical either way — only
|
|
40
|
+
the weight and tracking change. */
|
|
41
|
+
font-family: var(--font-title-body-family);
|
|
42
|
+
font-size: var(--font-title-body-size);
|
|
43
|
+
font-weight: var(--font-title-body-weight);
|
|
44
|
+
line-height: var(--font-title-body-line-height);
|
|
45
|
+
letter-spacing: var(--font-title-body-letter-spacing);
|
|
41
46
|
}
|
|
42
47
|
|
|
43
48
|
/* ============================================
|
|
@@ -112,13 +117,19 @@
|
|
|
112
117
|
/* A gradient between the shimmer base and sweep colours, moving left to
|
|
113
118
|
right: with an oversized background image, background-position 100% shows
|
|
114
119
|
its right edge, 0% its left, so counting down walks the sweep band across
|
|
115
|
-
the text.
|
|
120
|
+
the text.
|
|
121
|
+
|
|
122
|
+
The base is the dimmer colour and the sweep the brighter one, so what
|
|
123
|
+
travels is a highlight rather than a shadow — the same "the sweep only
|
|
124
|
+
brightens it" reading `waiting` has always had. The band is narrow
|
|
125
|
+
(12% of a 250% image, so under a third of the text at a time): spread
|
|
126
|
+
wide it washes the whole label at once and stops reading as movement. */
|
|
116
127
|
.ds-agent-status__label--shimmer {
|
|
117
128
|
background-image: linear-gradient(
|
|
118
129
|
100deg,
|
|
119
|
-
var(--ds-agent-shimmer-base)
|
|
130
|
+
var(--ds-agent-shimmer-base) 44%,
|
|
120
131
|
var(--ds-agent-shimmer-sweep) 50%,
|
|
121
|
-
var(--ds-agent-shimmer-base)
|
|
132
|
+
var(--ds-agent-shimmer-base) 56%
|
|
122
133
|
);
|
|
123
134
|
background-size: 250% 100%;
|
|
124
135
|
background-clip: text;
|
|
@@ -189,9 +200,13 @@
|
|
|
189
200
|
--ds-agent-matrix-size: var(--icon-size-sm);
|
|
190
201
|
|
|
191
202
|
gap: var(--gap-sm);
|
|
203
|
+
|
|
204
|
+
/* The small metrics, carrying the same title weight down a size: the scale
|
|
205
|
+
has no 14px title face, and dropping to the paragraph weight here would
|
|
206
|
+
make one size of the component read as a heading and the other as prose. */
|
|
192
207
|
font-family: var(--font-paragraph-sm-family);
|
|
193
208
|
font-size: var(--font-paragraph-sm-size);
|
|
194
|
-
font-weight: var(--font-
|
|
209
|
+
font-weight: var(--font-title-body-weight);
|
|
195
210
|
line-height: var(--font-paragraph-sm-line-height);
|
|
196
211
|
letter-spacing: var(--font-paragraph-sm-letter-spacing);
|
|
197
212
|
}
|
package/components/Card/Card.css
CHANGED
|
@@ -106,6 +106,15 @@
|
|
|
106
106
|
background: var(--color-bg-container-secondary);
|
|
107
107
|
}
|
|
108
108
|
|
|
109
|
+
/* A drawn cover (the `cover` prop) fills the same slot the image would, so a
|
|
110
|
+
grid of cards keeps one cover shape whichever kind it was given. */
|
|
111
|
+
.ds-card--case-study__cover-slot,
|
|
112
|
+
.ds-card--case-study__cover-slot > * {
|
|
113
|
+
display: block;
|
|
114
|
+
width: 100%;
|
|
115
|
+
height: 100%;
|
|
116
|
+
}
|
|
117
|
+
|
|
109
118
|
.ds-card--case-study__cover-image {
|
|
110
119
|
width: 100%;
|
|
111
120
|
height: 100%;
|
|
@@ -18,6 +18,12 @@ type CardOwnProps = {
|
|
|
18
18
|
href?: string;
|
|
19
19
|
/** Cover image src */
|
|
20
20
|
coverSrc?: string;
|
|
21
|
+
/**
|
|
22
|
+
* Cover content rendered in place of the image — for a cover that is drawn
|
|
23
|
+
* rather than photographed (an SVG, a chart, a live preview). Takes
|
|
24
|
+
* precedence over `coverSrc`, and fills the same fixed-ratio slot.
|
|
25
|
+
*/
|
|
26
|
+
cover?: React.ReactNode;
|
|
21
27
|
/** Cover image alt text */
|
|
22
28
|
coverAlt?: string;
|
|
23
29
|
/** Path to the company logo shown in the eyebrow */
|
package/components/Card/Card.js
CHANGED
|
@@ -13,6 +13,7 @@ const Card = React.forwardRef(
|
|
|
13
13
|
className = "",
|
|
14
14
|
href,
|
|
15
15
|
coverSrc,
|
|
16
|
+
cover,
|
|
16
17
|
coverAlt,
|
|
17
18
|
companyLogo,
|
|
18
19
|
companyName,
|
|
@@ -22,7 +23,7 @@ const Card = React.forwardRef(
|
|
|
22
23
|
}, ref) => {
|
|
23
24
|
if (variant === "case-study") {
|
|
24
25
|
const inner = /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
25
|
-
/* @__PURE__ */ jsx("div", { className: "ds-card--case-study__cover-wrap", children: coverSrc ? /* @__PURE__ */ jsx(
|
|
26
|
+
/* @__PURE__ */ jsx("div", { className: "ds-card--case-study__cover-wrap", children: cover ? /* @__PURE__ */ jsx("div", { className: "ds-card--case-study__cover-slot", children: cover }) : coverSrc ? /* @__PURE__ */ jsx(
|
|
26
27
|
"img",
|
|
27
28
|
{
|
|
28
29
|
src: coverSrc,
|
|
@@ -58,8 +58,26 @@
|
|
|
58
58
|
|
|
59
59
|
.ds-composer__content {
|
|
60
60
|
display: flex;
|
|
61
|
+
/* The textarea keeps its own natural height rather than stretching to the
|
|
62
|
+
zone's — the measurement below reads it, so a stretched textarea would
|
|
63
|
+
feed its own height back in and the zone could never shrink. */
|
|
64
|
+
align-items: flex-start;
|
|
65
|
+
box-sizing: border-box;
|
|
61
66
|
width: 100%;
|
|
62
67
|
padding: var(--padding-md) var(--padding-lg) var(--padding-sm);
|
|
68
|
+
/* Growing and shrinking is animated, which needs two pixel heights to run
|
|
69
|
+
between — `auto` has nothing to interpolate. So the zone states its own
|
|
70
|
+
height: the measured textarea (published as --ds-composer-text-height on
|
|
71
|
+
every resize) plus the block padding it owns. The fallback is a single
|
|
72
|
+
row, which is what the shell renders before the first measurement. */
|
|
73
|
+
height: calc(
|
|
74
|
+
var(--ds-composer-text-height, var(--font-paragraph-line-height)) + var(--padding-md) +
|
|
75
|
+
var(--padding-sm)
|
|
76
|
+
);
|
|
77
|
+
/* Mid-transition the textarea is already at its new height, so the extra
|
|
78
|
+
line is clipped on the way in and released on the way out. */
|
|
79
|
+
overflow: hidden;
|
|
80
|
+
transition: height var(--motion-duration-instant) var(--motion-ease-emphasized);
|
|
63
81
|
}
|
|
64
82
|
|
|
65
83
|
.ds-composer__textarea {
|