-
Notifications
You must be signed in to change notification settings - Fork 6
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
1 parent
6264a37
commit ed8a6dc
Showing
4 changed files
with
135 additions
and
0 deletions.
There are no files selected for viewing
29 changes: 29 additions & 0 deletions
29
packages/core/src/components/spinner/stories/spinner.args.ts
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,29 @@ | ||
export const SpinnerStoryArgs = { | ||
decorators: [], | ||
parameters: { | ||
actions: { | ||
handles: [], | ||
}, | ||
docs: { | ||
description: { | ||
component: | ||
'Spinners are inline block elements that usually appear near another element. Read the [Ionic documentation](https://ionicframework.com/docs/api/Spinner) for more information about this component.', | ||
}, | ||
}, | ||
}, | ||
argTypes: { | ||
type: { | ||
control: 'select', | ||
options: ['primary', 'secondary', 'dark'], | ||
defaultValue: { summary: 'primary' }, | ||
description: | ||
'The type of the Spinner, the component will receive the color according to its type.', | ||
}, | ||
size: { | ||
control: 'text', | ||
defaultValue: { summary: 20 }, | ||
description: | ||
'The type of the Spinner, the component will receive the color according to its type.', | ||
}, | ||
}, | ||
} |
34 changes: 34 additions & 0 deletions
34
packages/core/src/components/spinner/stories/spinner.core.stories.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,34 @@ | ||
import { Meta, StoryObj } from '@storybook/web-components' | ||
import { html } from 'lit' | ||
|
||
import { SpinnerStoryArgs } from './spinner.args' | ||
|
||
export default { | ||
title: 'Components/Spinner', | ||
...SpinnerStoryArgs, | ||
} as Meta | ||
|
||
const createSpinner = (args) => { | ||
return html`<atom-spinner type="${args.type}" />` | ||
} | ||
|
||
export const Primary: StoryObj = { | ||
render: (args) => createSpinner(args), | ||
args: { | ||
type: 'primary', | ||
}, | ||
} | ||
|
||
export const Secondary: StoryObj = { | ||
render: (args) => createSpinner(args), | ||
args: { | ||
type: 'secondary', | ||
}, | ||
} | ||
|
||
export const Dark: StoryObj = { | ||
render: (args) => createSpinner(args), | ||
args: { | ||
type: 'dark', | ||
}, | ||
} |
34 changes: 34 additions & 0 deletions
34
packages/core/src/components/spinner/stories/spinner.react.stories.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,34 @@ | ||
import { AtomSpinner } from '@juntossomosmais/atomium/react' | ||
import { Meta, StoryObj } from '@storybook/react' | ||
import React from 'react' | ||
|
||
import { SpinnerStoryArgs } from './spinner.args' | ||
|
||
export default { | ||
title: 'Components/Spinner', | ||
component: AtomSpinner, | ||
...SpinnerStoryArgs, | ||
} as Meta | ||
|
||
const createSpinner = (args) => <AtomSpinner color={args.color} /> | ||
|
||
export const Primary: StoryObj = { | ||
render: (args) => createSpinner(args), | ||
args: { | ||
type: 'primary', | ||
}, | ||
} | ||
|
||
export const Secondary: StoryObj = { | ||
render: (args) => createSpinner(args), | ||
args: { | ||
type: 'secondary', | ||
}, | ||
} | ||
|
||
export const Dark: StoryObj = { | ||
render: (args) => createSpinner(args), | ||
args: { | ||
type: 'dark', | ||
}, | ||
} |
38 changes: 38 additions & 0 deletions
38
packages/core/src/components/spinner/stories/spinner.vue.stories.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,38 @@ | ||
import { AtomSpinner } from '@juntossomosmais/atomium/vue' | ||
import { Meta, StoryObj } from '@storybook/vue3' | ||
|
||
import { SpinnerStoryArgs } from './spinner.args' | ||
|
||
export default { | ||
title: 'Components/Spinner', | ||
...SpinnerStoryArgs, | ||
} as Meta | ||
|
||
const createSpinner = (args) => ({ | ||
components: { AtomSpinner }, | ||
setup() { | ||
return { args } | ||
}, | ||
template: `<AtomSpinner type="${args.type}"/>`, | ||
}) | ||
|
||
export const Primary: StoryObj = { | ||
render: (args) => createSpinner(args), | ||
args: { | ||
type: 'primary', | ||
}, | ||
} | ||
|
||
export const Secondary: StoryObj = { | ||
render: (args) => createSpinner(args), | ||
args: { | ||
type: 'secondary', | ||
}, | ||
} | ||
|
||
export const Dark: StoryObj = { | ||
render: (args) => createSpinner(args), | ||
args: { | ||
type: 'dark', | ||
}, | ||
} |