-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #35 from 8845musign/add-generate-cmd
Add Scaffold of Component Page
- Loading branch information
Showing
5 changed files
with
98 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
--- | ||
name: pageComponent | ||
root: 'src' | ||
output: '.' | ||
ignore: [] | ||
questions: | ||
componentName: What is the component name (e.g., link-button)? | ||
--- | ||
|
||
# `components/react/examples/{{ inputs.componentName }}/Default.tsx` | ||
|
||
```typescript | ||
import { {{ inputs.componentName | pascal }} } from '@ubie/ubie-ui'; | ||
import type { FC } from 'react'; | ||
|
||
export const DefaultExample: FC = () => { | ||
return ( | ||
<{{ inputs.componentName | pascal }} /> | ||
); | ||
}; | ||
|
||
``` | ||
|
||
# `pages/components/examples/{{ inputs.componentName }}/default.astro` | ||
|
||
```astro | ||
--- | ||
import { DefaultExample } from '@components/react/examples/{{ inputs.componentName }}/Default'; | ||
import ExampleLayout from '@layouts/ExampleLayout.astro'; | ||
--- | ||
<ExampleLayout title="Default Example | {{ inputs.componentName | pascal }}"> | ||
<DefaultExample client:only="react" /> | ||
</ExampleLayout> | ||
``` | ||
|
||
|
||
|
||
# `pages/components/{{ inputs.componentName }}.mdx` | ||
|
||
```markdown | ||
--- | ||
title: '{{ inputs.componentName | pascal }}' | ||
exampleKey: '{{ inputs.componentName }}' | ||
layout: '@layouts/ComponentLayout.astro' | ||
description: '' | ||
thumbnail: '/assets/images/components/thumbnail-default.svg' | ||
--- | ||
|
||
## Feature | ||
|
||
Describe the characteristics of the component. Describe the use cases to which it is applicable and how it differs from other components. | ||
|
||
## Usage | ||
|
||
Please describe the specific use of the product. Detailed notes on use, code example, etc. | ||
|
||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.