mirror of https://github.com/hashicorp/consul
ui: Add new component blueprint (#12421)
This adds a new component blueprint for all our components. We've been using README.mdx files for quite some time to document our components for other engineers. This adds a default file to help new engineers get started writing useful documentation. These README.mdx file are also very useful for building out components in isolation from scratch and and some point will be used to run automated component testing.pull/12453/head
parent
b95f010ac0
commit
79a07c7a3d
@ -0,0 +1,67 @@
|
|||||||
|
<!-- START component-docs:@tagName -->
|
||||||
|
# <%= classifiedModuleName %>
|
||||||
|
<!-- END component-docs:@tagName -->
|
||||||
|
|
||||||
|
```hbs preview-template
|
||||||
|
<figure>
|
||||||
|
|
||||||
|
<figcaption>
|
||||||
|
Provide a widget for controlling things
|
||||||
|
</figcaption>
|
||||||
|
|
||||||
|
<select
|
||||||
|
onchange={{action (mut this.type) value="target.value"}}
|
||||||
|
>
|
||||||
|
<option>type-1</option>
|
||||||
|
</select>
|
||||||
|
</figure>
|
||||||
|
|
||||||
|
<figure>
|
||||||
|
|
||||||
|
<figcaption>
|
||||||
|
Provide a some data and use the component
|
||||||
|
</figcaption>
|
||||||
|
|
||||||
|
<DataSource
|
||||||
|
@src={{uri '/partition/namespace/dc-1/services'}}
|
||||||
|
as |source|>
|
||||||
|
|
||||||
|
<<%= classifiedModuleName %>
|
||||||
|
|
||||||
|
>
|
||||||
|
</<%= classifiedModuleName %>>
|
||||||
|
|
||||||
|
</DataSource>
|
||||||
|
|
||||||
|
</figure>
|
||||||
|
```
|
||||||
|
|
||||||
|
## Attributes
|
||||||
|
|
||||||
|
<!-- START component-docs:@attrs -->
|
||||||
|
<!-- END component-docs:@attrs -->
|
||||||
|
|
||||||
|
## Arguments
|
||||||
|
|
||||||
|
<!-- START component-docs:@args -->
|
||||||
|
<!-- END component-docs:@args -->
|
||||||
|
|
||||||
|
## Slots
|
||||||
|
|
||||||
|
<!-- START component-docs:@slots -->
|
||||||
|
<!-- END component-docs:@slots -->
|
||||||
|
|
||||||
|
## CSS Parts
|
||||||
|
|
||||||
|
<!-- START component-docs:@cssparts -->
|
||||||
|
<!-- END component-docs:@cssparts -->
|
||||||
|
|
||||||
|
## CSS Properties
|
||||||
|
|
||||||
|
<!-- START component-docs:@cssprops -->
|
||||||
|
<!-- END component-docs:@cssprops -->
|
||||||
|
|
||||||
|
## Contextual Components
|
||||||
|
|
||||||
|
<!-- START component-docs:@components -->
|
||||||
|
<!-- END component-docs:@components -->
|
@ -0,0 +1 @@
|
|||||||
|
{{yield}}
|
@ -0,0 +1,4 @@
|
|||||||
|
module.exports = Object.assign(
|
||||||
|
require('ember-source/blueprints/component/index.js')
|
||||||
|
);
|
||||||
|
|
Loading…
Reference in new issue