Skip to content

Commit fbb411a

Browse files
authored
feat(ipa): Add <Example> component (#53)
1 parent b2b6044 commit fbb411a

20 files changed

Lines changed: 19497 additions & 27 deletions

File tree

.prettierrc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,5 @@
11
proseWrap: always
22
printWidth: 80
3+
singleQuote: false
4+
semi: true
5+
trailingComma: all

ipa/dev/component-fixtures.mdx

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ description:
99
production builds."
1010
---
1111

12-
import { Guidelines, Guideline } from "@site/src/components/ipa";
12+
import { Guidelines, Guideline, Example } from "@site/src/components/ipa";
1313

1414
# Component fixtures
1515

@@ -61,3 +61,28 @@ independently.
6161
<p>Second child — separated from the first by a top border.</p>
6262
<p>Third child — separator styling applies between every adjacent pair.</p>
6363
</Guidelines>
64+
65+
## `<Example>`
66+
67+
`<Example.Correct>` and `<Example.Incorrect>` render collapsible code examples
68+
with a visual correct/incorrect indicator.
69+
70+
### Correct example
71+
72+
<Example.Correct>
73+
74+
```yaml
75+
name: list-resources
76+
```
77+
78+
</Example.Correct>
79+
80+
### Incorrect example
81+
82+
<Example.Incorrect title="Missing name field">
83+
84+
```yaml
85+
{}
86+
```
87+
88+
</Example.Incorrect>

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@
4040
"@docusaurus/theme-classic": "^3.8.1",
4141
"@docusaurus/theme-search-algolia": "^3.8.1",
4242
"@easyops-cn/docusaurus-search-local": "^0.51.1",
43+
"clsx": "^2.1.1",
4344
"zod": "^4.3.6"
4445
}
4546
}

0 commit comments

Comments
 (0)