Skip to content

Commit 3a9054e

Browse files
committed
feat(agent-html): add Text primitive component and support
This commit adds the Text primitive component to the agent-html DSL, including: - Add Text tag to all tag sets and UI tag union type - Add variant prop support for Text component - Add validation to block element children inside Text nodes - Create test fixtures and tests for basic Text usage - Update example dashboard to use new Text components - Refactor example shell to use dialog for source view
1 parent ec5a81e commit 3a9054e

30 files changed

Lines changed: 741 additions & 330 deletions

.agents/skills/agent-html/references/examples.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,20 @@ Use the closest valid fixture before inventing new structure.
1313
- `card-tabs-grid.xml`
1414
- `complex-dashboard.xml`
1515
- `icon-basic.xml`
16+
- `image-basic.xml`
1617
- `minimal-page.xml`
18+
- `text-basic.xml`
1719

1820
## Invalid Patterns
1921

2022
- `bare-text-under-grid.xml`
2123
- `carousel-missing-content.xml`
2224
- `chart-missing-series.xml`
25+
- `image-invalid-fit.xml`
26+
- `image-invalid-src.xml`
27+
- `image-with-child.xml`
2328
- `layout-gap-not-allowed.xml`
2429
- `missing-tabs-trigger-value.xml`
30+
- `text-with-child.xml`
2531
- `unknown-icon-name.xml`
2632
- `unknown-tag.xml`

.agents/skills/agent-html/references/grammar.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,12 +85,16 @@
8585
- `ChartTooltip:hideLabel?="true|false" -> none`
8686

8787
- `Icon:name=string -> none`
88+
- `Image:src=string, alt=string, fit?="cover|contain" -> none`
89+
- `Text:variant?="h1|h2|h3|h4|p|lead|large|small|muted|inline-code" -> Text`
8890

8991
## Canonical Example
9092

9193
```xml
9294
<Page title="Gallery Preview">
9395
<Stack>
96+
<Text variant="muted">Use Text for standalone copy inside layout nodes.</Text>
97+
9498
<Card>
9599
<CardHeader>
96100
<CardTitle>Controls</CardTitle>

apps/agent-html/src/agent-html-example/cases/complex-dashboard.ahtml

Lines changed: 110 additions & 101 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)