This repository has been archived by the owner on Mar 4, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 54
feat(Checkbox): add labelPosition
prop
#1578
Merged
Merged
Changes from 7 commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
9b30190
wip
layershifter 0739c06
Merge branch 'master' of https://github.com/stardust-ui/react into fe…
layershifter 063df1e
polish styles
layershifter ae0463e
add changelog entry
layershifter 2496eef
use knobs in example
layershifter a38b41a
remove cruft styles
layershifter 08b495d
fix hardcoded value
layershifter 61975f8
fix styles
layershifter 688d890
merge master
layershifter c167640
Merge branches 'feat/checkbox-label' and 'master' of https://github.c…
layershifter File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
11 changes: 11 additions & 0 deletions
11
docs/src/examples/components/Checkbox/Slots/CheckboxExampleLabel.shorthand.tsx
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,11 @@ | ||
import { Checkbox, Flex } from '@stardust-ui/react' | ||
import * as React from 'react' | ||
|
||
const CheckboxExampleLabel = () => ( | ||
<Flex> | ||
<Checkbox label="At start" labelPosition="start" /> | ||
<Checkbox label="At end" /> | ||
</Flex> | ||
) | ||
|
||
export default CheckboxExampleLabel |
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,16 @@ | ||
import * as React from 'react' | ||
|
||
import ComponentExample from 'docs/src/components/ComponentDoc/ComponentExample' | ||
import ExampleSection from 'docs/src/components/ComponentDoc/ExampleSection' | ||
|
||
const Slots = () => ( | ||
<ExampleSection title="Slots"> | ||
<ComponentExample | ||
title="Label" | ||
description="A checkbox can have a label." | ||
examplePath="components/Checkbox/Slots/CheckboxExampleLabel" | ||
/> | ||
</ExampleSection> | ||
) | ||
|
||
export default Slots |
16 changes: 16 additions & 0 deletions
16
docs/src/examples/components/Checkbox/States/CheckboxExampleChecked.shorthand.tsx
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,16 @@ | ||
import { useBooleanKnob } from '@stardust-ui/docs-components' | ||
import { Checkbox } from '@stardust-ui/react' | ||
import * as React from 'react' | ||
|
||
const CheckboxExampleChecked = () => { | ||
const [checked] = useBooleanKnob({ name: 'checked', initialValue: true }) | ||
|
||
return ( | ||
<> | ||
<Checkbox checked={checked} label="Checked" /> | ||
<Checkbox checked={checked} label="Checked toggle" toggle /> | ||
</> | ||
) | ||
} | ||
|
||
export default CheckboxExampleChecked |
File renamed without changes.
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,21 @@ | ||
import * as React from 'react' | ||
|
||
import ComponentExample from 'docs/src/components/ComponentDoc/ComponentExample' | ||
import ExampleSection from 'docs/src/components/ComponentDoc/ExampleSection' | ||
|
||
const States = () => ( | ||
<ExampleSection title="States"> | ||
<ComponentExample | ||
title="Checked" | ||
description="A checkbox can be checked." | ||
examplePath="components/Checkbox/States/CheckboxExampleChecked" | ||
/> | ||
<ComponentExample | ||
title="Disabled" | ||
description="A checkbox can be read-only and unable to change states." | ||
examplePath="components/Checkbox/States/CheckboxExampleDisabled" | ||
/> | ||
</ExampleSection> | ||
) | ||
|
||
export default States |
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
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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Not sure about this selector. Do we really need this complication?