-
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(rating): added examples and props table
- Loading branch information
Craig Howell
authored and
Craig Howell
committed
Oct 12, 2022
1 parent
2550d8f
commit 61c8fd0
Showing
3 changed files
with
112 additions
and
5 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
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,86 @@ | ||
import type { Prop } from '../../docs'; | ||
|
||
export const props: Prop[] = [ | ||
{ | ||
id: '1', | ||
prop: 'half', | ||
type: 'boolean', | ||
default: 'false' | ||
}, | ||
{ | ||
id: '2', | ||
prop: 'outOf', | ||
type: 'number', | ||
default: '5' | ||
}, | ||
{ | ||
id: '3', | ||
prop: 'name', | ||
type: 'string', | ||
default: '' | ||
}, | ||
{ | ||
id: '4', | ||
prop: 'value', | ||
type: 'number', | ||
default: '0' | ||
}, | ||
{ | ||
id: '5', | ||
prop: 'size', | ||
type: "'sm' | 'md' | 'lg'", | ||
default: 'md' | ||
}, | ||
{ | ||
id: '6', | ||
prop: 'showValue', | ||
type: 'boolean', | ||
default: 'false' | ||
} | ||
]; | ||
|
||
export const example = ` | ||
<script lang="ts"> | ||
import { Rating } from 'stwui'; | ||
</script> | ||
<Rating name="rating-1" showValue /> | ||
<br /> | ||
<Rating name="rating-2" value={3} class="text-orange-400" />`; | ||
|
||
export const halfExample = ` | ||
<script lang="ts"> | ||
import { Rating } from 'stwui'; | ||
</script> | ||
<Rating name="rating-3" half /> | ||
<br /> | ||
<Rating name="rating-4" value={3} half class="text-orange-400" />`; | ||
|
||
export const sizeExample = ` | ||
<script lang="ts"> | ||
import { Rating } from 'stwui'; | ||
</script> | ||
<Rating name="rating-5" size="sm" /> | ||
<br /> | ||
<Rating name="rating-6" value={3} class="text-orange-400" /> | ||
<br /> | ||
<Rating name="rating-7" value={3} size="lg" class="text-purple-400" />`; | ||
|
||
export const showValueExample = ` | ||
<script lang="ts"> | ||
import { Rating } from 'stwui'; | ||
</script> | ||
<Rating name="rating-5" size="sm" showValue /> | ||
<br /> | ||
<Rating name="rating-6" value={3} class="text-orange-400" showValue /> | ||
<br /> | ||
<Rating name="rating-7" value={3} size="lg" class="text-purple-400" showValue /> | ||
<br /> | ||
<Rating name="rating-8" size="sm" half showValue /> | ||
<br /> | ||
<Rating name="rating-9" value={3} half class="text-orange-400" showValue /> | ||
<br /> | ||
<Rating name="rating-10" value={3.5} half size="lg" class="text-purple-400" showValue />`; |