mirror of https://github.com/ghostfolio/ghostfolio
Karel De Smet
2 weeks ago
committed by
GitHub
9 changed files with 390 additions and 379 deletions
@ -1,30 +1,32 @@ |
|||||
import { Meta, Story, moduleMetadata } from '@storybook/angular'; |
import { moduleMetadata } from '@storybook/angular'; |
||||
|
import type { Meta, StoryObj } from '@storybook/angular'; |
||||
|
|
||||
import { LogoComponent } from './logo.component'; |
import { GfLogoComponent } from './logo.component'; |
||||
|
|
||||
export default { |
export default { |
||||
title: 'Logo', |
title: 'Logo', |
||||
component: LogoComponent, |
component: GfLogoComponent, |
||||
decorators: [ |
decorators: [ |
||||
moduleMetadata({ |
moduleMetadata({ |
||||
imports: [] |
imports: [] |
||||
}) |
}) |
||||
] |
] |
||||
} as Meta<LogoComponent>; |
} as Meta<GfLogoComponent>; |
||||
|
|
||||
const Template: Story<LogoComponent> = (args: LogoComponent) => ({ |
type Story = StoryObj<GfLogoComponent>; |
||||
props: args |
|
||||
}); |
|
||||
|
|
||||
export const Default = Template.bind({}); |
export const Default: Story = { |
||||
Default.args = {}; |
args: {} |
||||
|
}; |
||||
|
|
||||
export const Large = Template.bind({}); |
export const Large: Story = { |
||||
Large.args = { |
args: { |
||||
size: 'large' |
size: 'large' |
||||
|
} |
||||
}; |
}; |
||||
|
|
||||
export const NoLabel = Template.bind({}); |
export const NoLabel: Story = { |
||||
NoLabel.args = { |
args: { |
||||
showLabel: false |
showLabel: false |
||||
|
} |
||||
}; |
}; |
||||
|
@ -1,25 +1,23 @@ |
|||||
import { GfLogoModule } from '@ghostfolio/ui/logo'; |
import { GfLogoComponent } from '@ghostfolio/ui/logo'; |
||||
|
|
||||
import { RouterTestingModule } from '@angular/router/testing'; |
import { RouterTestingModule } from '@angular/router/testing'; |
||||
import { Meta, Story, moduleMetadata } from '@storybook/angular'; |
import { moduleMetadata } from '@storybook/angular'; |
||||
|
import type { Meta, StoryObj } from '@storybook/angular'; |
||||
|
|
||||
import { NoTransactionsInfoComponent } from './no-transactions-info.component'; |
import { GfNoTransactionsInfoComponent } from './no-transactions-info.component'; |
||||
|
|
||||
export default { |
export default { |
||||
title: 'No Transactions Info', |
title: 'No Transactions Info', |
||||
component: NoTransactionsInfoComponent, |
component: GfNoTransactionsInfoComponent, |
||||
decorators: [ |
decorators: [ |
||||
moduleMetadata({ |
moduleMetadata({ |
||||
imports: [GfLogoModule, RouterTestingModule] |
imports: [GfLogoComponent, RouterTestingModule] |
||||
}) |
}) |
||||
] |
] |
||||
} as Meta<NoTransactionsInfoComponent>; |
} as Meta<GfNoTransactionsInfoComponent>; |
||||
|
|
||||
const Template: Story<NoTransactionsInfoComponent> = ( |
type Story = StoryObj<GfNoTransactionsInfoComponent>; |
||||
args: NoTransactionsInfoComponent |
|
||||
) => ({ |
|
||||
props: args |
|
||||
}); |
|
||||
|
|
||||
export const Default = Template.bind({}); |
export const Default: Story = { |
||||
Default.args = {}; |
args: {} |
||||
|
}; |
||||
|
@ -1,29 +1,28 @@ |
|||||
import { CommonModule } from '@angular/common'; |
import { CommonModule } from '@angular/common'; |
||||
import { RouterTestingModule } from '@angular/router/testing'; |
import { RouterTestingModule } from '@angular/router/testing'; |
||||
import { Meta, Story, moduleMetadata } from '@storybook/angular'; |
import { moduleMetadata } from '@storybook/angular'; |
||||
|
import type { Meta, StoryObj } from '@storybook/angular'; |
||||
|
|
||||
import { PremiumIndicatorComponent } from './premium-indicator.component'; |
import { GfPremiumIndicatorComponent } from './premium-indicator.component'; |
||||
|
|
||||
export default { |
export default { |
||||
title: 'Premium Indicator', |
title: 'Premium Indicator', |
||||
component: PremiumIndicatorComponent, |
component: GfPremiumIndicatorComponent, |
||||
decorators: [ |
decorators: [ |
||||
moduleMetadata({ |
moduleMetadata({ |
||||
imports: [CommonModule, RouterTestingModule] |
imports: [CommonModule, RouterTestingModule] |
||||
}) |
}) |
||||
] |
] |
||||
} as Meta<PremiumIndicatorComponent>; |
} as Meta<GfPremiumIndicatorComponent>; |
||||
|
|
||||
const Template: Story<PremiumIndicatorComponent> = ( |
type Story = StoryObj<GfPremiumIndicatorComponent>; |
||||
args: PremiumIndicatorComponent |
|
||||
) => ({ |
|
||||
props: args |
|
||||
}); |
|
||||
|
|
||||
export const Default = Template.bind({}); |
export const Default: Story = { |
||||
Default.args = {}; |
args: {} |
||||
|
}; |
||||
|
|
||||
export const WithoutLink = Template.bind({}); |
export const WithoutLink = { |
||||
WithoutLink.args = { |
args: { |
||||
enableLink: false |
enableLink: false |
||||
|
} |
||||
}; |
}; |
||||
|
@ -1,50 +1,53 @@ |
|||||
import { Meta, Story, moduleMetadata } from '@storybook/angular'; |
import { moduleMetadata } from '@storybook/angular'; |
||||
|
import type { Meta, StoryObj } from '@storybook/angular'; |
||||
import { NgxSkeletonLoaderModule } from 'ngx-skeleton-loader'; |
import { NgxSkeletonLoaderModule } from 'ngx-skeleton-loader'; |
||||
|
|
||||
import { TrendIndicatorComponent } from './trend-indicator.component'; |
import { GfTrendIndicatorComponent } from './trend-indicator.component'; |
||||
|
|
||||
export default { |
export default { |
||||
title: 'Trend Indicator', |
title: 'Trend Indicator', |
||||
component: TrendIndicatorComponent, |
component: GfTrendIndicatorComponent, |
||||
decorators: [ |
decorators: [ |
||||
moduleMetadata({ |
moduleMetadata({ |
||||
imports: [NgxSkeletonLoaderModule] |
imports: [NgxSkeletonLoaderModule] |
||||
}) |
}) |
||||
] |
] |
||||
} as Meta<TrendIndicatorComponent>; |
} as Meta<GfTrendIndicatorComponent>; |
||||
|
|
||||
const Template: Story<TrendIndicatorComponent> = ( |
type Story = StoryObj<GfTrendIndicatorComponent>; |
||||
args: TrendIndicatorComponent |
|
||||
) => ({ |
|
||||
props: args |
|
||||
}); |
|
||||
|
|
||||
export const Loading = Template.bind({}); |
export const Loading: Story = { |
||||
Loading.args = { |
args: { |
||||
isLoading: true |
isLoading: true |
||||
|
} |
||||
}; |
}; |
||||
|
|
||||
export const Default = Template.bind({}); |
export const Default: Story = { |
||||
Default.args = {}; |
args: {} |
||||
|
}; |
||||
|
|
||||
export const Delayed = Template.bind({}); |
export const Delayed: Story = { |
||||
Delayed.args = { |
args: { |
||||
marketState: 'delayed', |
dateRange: '1d', |
||||
range: '1d' |
marketState: 'delayed' |
||||
|
} |
||||
}; |
}; |
||||
|
|
||||
export const Down = Template.bind({}); |
export const Down: Story = { |
||||
Down.args = { |
args: { |
||||
value: -1 |
value: -1 |
||||
|
} |
||||
}; |
}; |
||||
|
|
||||
export const Up = Template.bind({}); |
export const Up: Story = { |
||||
Up.args = { |
args: { |
||||
value: 1 |
value: 1 |
||||
|
} |
||||
}; |
}; |
||||
|
|
||||
export const MarketClosed = Template.bind({}); |
export const MarketClosed: Story = { |
||||
MarketClosed.args = { |
args: { |
||||
marketState: 'closed', |
dateRange: '1d', |
||||
range: '1d' |
marketState: 'closed' |
||||
|
} |
||||
}; |
}; |
||||
|
@ -1,71 +1,77 @@ |
|||||
import { Meta, Story, moduleMetadata } from '@storybook/angular'; |
import { moduleMetadata } from '@storybook/angular'; |
||||
|
import type { Meta, StoryObj } from '@storybook/angular'; |
||||
import { NgxSkeletonLoaderModule } from 'ngx-skeleton-loader'; |
import { NgxSkeletonLoaderModule } from 'ngx-skeleton-loader'; |
||||
|
|
||||
import { ValueComponent } from './value.component'; |
import { GfValueComponent } from './value.component'; |
||||
|
|
||||
export default { |
export default { |
||||
title: 'Value', |
title: 'Value', |
||||
component: ValueComponent, |
component: GfValueComponent, |
||||
decorators: [ |
decorators: [ |
||||
moduleMetadata({ |
moduleMetadata({ |
||||
imports: [NgxSkeletonLoaderModule] |
imports: [NgxSkeletonLoaderModule] |
||||
}) |
}) |
||||
] |
] |
||||
} as Meta<ValueComponent>; |
} as Meta<GfValueComponent>; |
||||
|
|
||||
const Template: Story<ValueComponent> = (args: ValueComponent) => ({ |
type Story = StoryObj<GfValueComponent>; |
||||
props: args |
|
||||
}); |
|
||||
|
|
||||
export const Loading = Template.bind({}); |
export const Loading: Story = { |
||||
Loading.args = { |
args: { |
||||
value: undefined |
value: undefined |
||||
|
} |
||||
}; |
}; |
||||
|
|
||||
export const Currency = Template.bind({}); |
export const Currency: Story = { |
||||
Currency.args = { |
args: { |
||||
isCurrency: true, |
isCurrency: true, |
||||
locale: 'en-US', |
locale: 'en-US', |
||||
unit: 'USD', |
unit: 'USD', |
||||
value: 7 |
value: 7 |
||||
|
} |
||||
}; |
}; |
||||
|
|
||||
export const Label = Template.bind({}); |
export const Label: Story = { |
||||
Label.args = { |
args: { |
||||
locale: 'en-US', |
locale: 'en-US', |
||||
value: 7.25 |
value: 7.25 |
||||
|
} |
||||
}; |
}; |
||||
|
|
||||
export const PerformancePositive = Template.bind({}); |
export const PerformancePositive: Story = { |
||||
PerformancePositive.args = { |
args: { |
||||
locale: 'en-US', |
|
||||
colorizeSign: true, |
colorizeSign: true, |
||||
isPercent: true, |
isPercent: true, |
||||
|
locale: 'en-US', |
||||
value: 0.0136810853673890378 |
value: 0.0136810853673890378 |
||||
|
}, |
||||
|
name: 'Performance (positive)' |
||||
}; |
}; |
||||
PerformancePositive.storyName = 'Performance (positive)'; |
|
||||
|
|
||||
export const PerformanceNegative = Template.bind({}); |
export const PerformanceNegative: Story = { |
||||
PerformanceNegative.args = { |
args: { |
||||
locale: 'en-US', |
|
||||
colorizeSign: true, |
colorizeSign: true, |
||||
isPercent: true, |
isPercent: true, |
||||
|
locale: 'en-US', |
||||
value: -0.0136810853673890378 |
value: -0.0136810853673890378 |
||||
|
}, |
||||
|
name: 'Performance (negative)' |
||||
}; |
}; |
||||
PerformanceNegative.storyName = 'Performance (negative)'; |
|
||||
|
|
||||
export const PerformanceCloseToZero = Template.bind({}); |
export const PerformanceCloseToZero: Story = { |
||||
PerformanceCloseToZero.args = { |
args: { |
||||
locale: 'en-US', |
|
||||
colorizeSign: true, |
colorizeSign: true, |
||||
isPercent: true, |
isPercent: true, |
||||
|
locale: 'en-US', |
||||
value: -2.388915360475e-8 |
value: -2.388915360475e-8 |
||||
|
}, |
||||
|
name: 'Performance (negative zero)' |
||||
}; |
}; |
||||
PerformanceCloseToZero.storyName = 'Performance (negative zero)'; |
|
||||
|
|
||||
export const Precision = Template.bind({}); |
export const Precision: Story = { |
||||
Precision.args = { |
args: { |
||||
locale: 'en-US', |
locale: 'en-US', |
||||
precision: 3, |
precision: 3, |
||||
value: 7.2534802394809285309 |
value: 7.2534802394809285309 |
||||
|
} |
||||
}; |
}; |
||||
|
Loading…
Reference in new issue