-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docs(chip): added examples, props, and slots tables
- Loading branch information
Craig Howell
committed
Oct 9, 2022
1 parent
5d7e228
commit 87c6d29
Showing
3 changed files
with
136 additions
and
6 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -52,4 +52,5 @@ | |
<slot name="avatar" /> | ||
<slot name="label" /> | ||
<slot name="close" /> | ||
<slot /> | ||
</span> |
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,105 @@ | ||
import type { Slot, Prop } from '../../docs'; | ||
|
||
export const props: Prop[] = [ | ||
{ | ||
id: '1', | ||
prop: 'type', | ||
type: "'info' | 'warn' | 'success' | 'error' | 'default'", | ||
default: 'default' | ||
}, | ||
{ | ||
id: '2', | ||
prop: 'type', | ||
type: "'xs' | 'sm' | 'md' | 'lg' | 'xl'", | ||
default: 'md' | ||
} | ||
]; | ||
|
||
export const slots: Slot[] = [ | ||
{ | ||
id: '1', | ||
slot: 'avatar', | ||
component: '<Chip.Avatar slot="avatar" />' | ||
}, | ||
{ | ||
id: '2', | ||
slot: 'label', | ||
component: '<Chip.Label slot="label" />' | ||
}, | ||
{ | ||
id: '3', | ||
slot: 'close', | ||
component: '<Chip.Close slot="close" />' | ||
}, | ||
{ | ||
id: '4', | ||
slot: 'default', | ||
component: '' | ||
} | ||
]; | ||
|
||
export const avatarProps: Prop[] = [ | ||
{ | ||
id: '1', | ||
prop: 'src', | ||
type: 'string', | ||
default: '' | ||
}, | ||
{ | ||
id: '2', | ||
prop: 'alt', | ||
type: 'string', | ||
default: 'user-avatar' | ||
} | ||
]; | ||
|
||
export const labelSlots: Slot[] = [ | ||
{ | ||
id: '1', | ||
slot: 'default', | ||
component: '' | ||
} | ||
]; | ||
|
||
export const example = ` | ||
<script lang="ts"> | ||
import { Chip } from 'stwui'; | ||
</script> | ||
<Chip size="xs"> | ||
<Chip.Avatar slot="avatar" src="image.png" /> | ||
<Chip.Label slot="label">Castor Troy</Chip.Label> | ||
</Chip> | ||
<Chip size="sm" type="success"> | ||
<Chip.Avatar slot="avatar" src="image.png" /> | ||
<Chip.Label slot="label">Castor Troy</Chip.Label> | ||
</Chip> | ||
<Chip type="warn"> | ||
<Chip.Avatar slot="avatar" src="image.png" /> | ||
<Chip.Label slot="label">Castor Troy</Chip.Label> | ||
</Chip> | ||
<Chip size="lg" type="error"> | ||
<Chip.Avatar slot="avatar" src="image.png" /> | ||
<Chip.Label slot="label">Castor Troy</Chip.Label> | ||
</Chip> | ||
<Chip size="xl"> | ||
<Chip.Avatar slot="avatar" src="image.png" /> | ||
<Chip.Label slot="label">Castor Troy</Chip.Label> | ||
</Chip>`; | ||
|
||
export const closeExample = ` | ||
<script lang="ts"> | ||
import { Chip } from 'stwui'; | ||
</script> | ||
<Chip type="info"> | ||
<Chip.Avatar slot="avatar" src="image.png" /> | ||
<Chip.Label slot="label">Castor Troy</Chip.Label> | ||
<Chip.Close slot="close" /> | ||
</Chip> | ||
<Chip> | ||
<Chip.Avatar slot="avatar" src="image.png" /> | ||
<Chip.Label slot="label">Castor Troy</Chip.Label> | ||
<Chip.Close slot="close" /> | ||
</Chip>`; |
87c6d29
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
stwui – ./
stwui-n00nday.vercel.app
stwui.vercel.app
stwui-git-main-n00nday.vercel.app