forked from viamrobotics/prime
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
2024-01-19 PRIME design maintenance (viamrobotics#473)
- Loading branch information
1 parent
48551f0
commit 66612e9
Showing
12 changed files
with
85 additions
and
185 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 |
---|---|---|
|
@@ -20,5 +20,6 @@ module.exports = { | |
}, | ||
rules: { | ||
'no-console': 'off', | ||
'sonarjs/no-duplicate-string': 'off', | ||
}, | ||
}; |
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
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
74 changes: 26 additions & 48 deletions
74
packages/storybook/src/stories/toggle-buttons.stories.svelte
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 |
---|---|---|
@@ -1,59 +1,37 @@ | ||
<script lang="ts"> | ||
import { Meta, Story } from '@storybook/addon-svelte-csf'; | ||
import { ToggleButtons } from '@viamrobotics/prime-core'; | ||
import { Label, ToggleButtons } from '@viamrobotics/prime-core'; | ||
</script> | ||
|
||
<Meta title="Elements/ToggleButtons" /> | ||
|
||
<Story name="Basic"> | ||
<ToggleButtons | ||
options={['Opt 1', 'Opt 2', 'Opt 3']} | ||
selected="Opt 1" | ||
/> | ||
</Story> | ||
|
||
<Story name="With legend"> | ||
<ToggleButtons | ||
options={['Opt 1', 'Opt 2']} | ||
selected="Opt 1" | ||
> | ||
<svelte:fragment slot="legend">These are your options</svelte:fragment> | ||
</ToggleButtons> | ||
</Story> | ||
|
||
<Story name="Required"> | ||
<ToggleButtons | ||
options={['To be', 'Not to be']} | ||
selected="Opt 1" | ||
required | ||
> | ||
<svelte:fragment slot="legend">Answer the question</svelte:fragment> | ||
</ToggleButtons> | ||
<Label> | ||
Favorite animal | ||
<div | ||
class="w-fit" | ||
slot="input" | ||
> | ||
<ToggleButtons | ||
options={['Fan lizard', 'Mountain banshee', 'Buzzard wasp']} | ||
selected="Fan lizard" | ||
/> | ||
</div> | ||
</Label> | ||
</Story> | ||
|
||
<Story name="Disabled"> | ||
<ToggleButtons | ||
options={['Frank', 'Dave']} | ||
selected="Frank" | ||
disabled | ||
> | ||
<svelte:fragment slot="legend" | ||
>I'm afraid that's something I cannot allow to happen. | ||
</svelte:fragment> | ||
</ToggleButtons> | ||
</Story> | ||
|
||
<Story name="Full Width"> | ||
<div class="flex flex-row gap-2"> | ||
<ToggleButtons | ||
options={['Left', 'Right']} | ||
selected="Left" | ||
/> | ||
|
||
<ToggleButtons | ||
options={['Left', 'Right']} | ||
selected="Right" | ||
cx="w-full" | ||
/> | ||
</div> | ||
<Label> | ||
Favorite animal | ||
<div | ||
class="w-fit" | ||
slot="input" | ||
> | ||
<ToggleButtons | ||
options={['Fan lizard', 'Mountain banshee', 'Buzzard wasp']} | ||
selected="Fan lizard" | ||
disabled | ||
/> | ||
</div> | ||
</Label> | ||
</Story> |
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
Oops, something went wrong.