mirror of https://github.com/ghostfolio/ghostfolio
committed by
Thomas Kaul
13 changed files with 60 additions and 23 deletions
@ -0,0 +1 @@ |
|||
export * from './lib/toggle'; |
@ -0,0 +1 @@ |
|||
export * from './toggle.component'; |
@ -0,0 +1,42 @@ |
|||
import { CommonModule } from '@angular/common'; |
|||
import { ReactiveFormsModule } from '@angular/forms'; |
|||
import { MatRadioModule } from '@angular/material/radio'; |
|||
import { moduleMetadata } from '@storybook/angular'; |
|||
import type { Meta, StoryObj } from '@storybook/angular'; |
|||
|
|||
import { GfToggleComponent } from './toggle.component'; |
|||
|
|||
const DEFAULT_OPTIONS = [ |
|||
{ label: 'Today', value: '1d' }, |
|||
{ label: 'YTD', value: 'ytd' }, |
|||
{ label: '1Y', value: '1y' }, |
|||
{ label: '5Y', value: '5y' }, |
|||
{ label: 'Max', value: 'max' } |
|||
]; |
|||
|
|||
export default { |
|||
title: 'Toggle', |
|||
component: GfToggleComponent, |
|||
decorators: [ |
|||
moduleMetadata({ |
|||
imports: [CommonModule, MatRadioModule, ReactiveFormsModule] |
|||
}) |
|||
] |
|||
} as Meta<GfToggleComponent>; |
|||
|
|||
type Story = StoryObj<GfToggleComponent>; |
|||
|
|||
export const Default: Story = { |
|||
args: { |
|||
options: DEFAULT_OPTIONS, |
|||
defaultValue: '1d' |
|||
} |
|||
}; |
|||
|
|||
export const Loading: Story = { |
|||
args: { |
|||
options: DEFAULT_OPTIONS, |
|||
defaultValue: '1d', |
|||
isLoading: true |
|||
} |
|||
}; |
Loading…
Reference in new issue