-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
159 additions
and
32 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
## Sizes | ||
|
||
There are three sizes of switch : small, medium (default), large | ||
|
||
<Canvas of={SwitchStories.Sizes}> | ||
<Story of={SwitchStories.Sizes} /> | ||
</Canvas> | ||
|
||
## Label | ||
|
||
Add label to provide textual hints on what the switch does. By default label is added to the right of the switch in the default slot. | ||
|
||
Use `slot="leftLabel"` to add label to the left of the switch | ||
|
||
<Canvas of={SwitchStories.Label}> | ||
<Story of={SwitchStories.Label} /> | ||
</Canvas> | ||
|
||
## Icon | ||
|
||
Use of on and off icons to provide visual clues of what the switch does. | ||
|
||
Note: The icons are currently fixed and not customisable | ||
|
||
<Canvas of={SwitchStories.Icon}> | ||
<Story of={SwitchStories.Icon} /> | ||
</Canvas> |
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,51 @@ | ||
import { html } from "lit-html"; | ||
|
||
const SizeTemplate = args => { | ||
return html` | ||
<div class="d-flex-column"> | ||
<sgds-switch size="sm">small</sgds-switch> | ||
<sgds-switch size="md">medium (default)</sgds-switch> | ||
<sgds-switch size="lg">large </sgds-switch> | ||
</div> | ||
`; | ||
}; | ||
|
||
const LabelTemplate = args => { | ||
return html` | ||
<div class="d-flex-column"> | ||
<sgds-switch>Label on the right</sgds-switch> | ||
<sgds-switch><span slot="leftLabel"> Label on the left</span></sgds-switch> | ||
</div> | ||
`; | ||
}; | ||
|
||
const IconTemplate = args => { | ||
return html` | ||
<div class="d-flex-column"> | ||
<sgds-switch icon>Off with icon</sgds-switch> | ||
<sgds-switch icon checked>On with icon</sgds-switch> | ||
</div> | ||
`; | ||
}; | ||
|
||
export const Sizes = { | ||
render: SizeTemplate.bind({}), | ||
name: "Sizes", | ||
args: {}, | ||
parameters: {}, | ||
tags: ["!dev"] | ||
}; | ||
export const Label = { | ||
render: LabelTemplate.bind({}), | ||
name: "Labels", | ||
args: {}, | ||
parameters: {}, | ||
tags: ["!dev"] | ||
}; | ||
export const Icon = { | ||
render: IconTemplate.bind({}), | ||
name: "Icon", | ||
args: {}, | ||
parameters: {}, | ||
tags: ["!dev"] | ||
}; |
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