parent
a4ee33f6df
commit
68868df41a
@ -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 {
|
||||
title: 'Logo',
|
||||
component: LogoComponent,
|
||||
component: GfLogoComponent,
|
||||
decorators: [
|
||||
moduleMetadata({
|
||||
imports: []
|
||||
})
|
||||
]
|
||||
} as Meta<LogoComponent>;
|
||||
} as Meta<GfLogoComponent>;
|
||||
|
||||
const Template: Story<LogoComponent> = (args: LogoComponent) => ({
|
||||
props: args
|
||||
});
|
||||
type Story = StoryObj<GfLogoComponent>;
|
||||
|
||||
export const Default = Template.bind({});
|
||||
Default.args = {};
|
||||
export const Default: Story = {
|
||||
args: {}
|
||||
};
|
||||
|
||||
export const Large = Template.bind({});
|
||||
Large.args = {
|
||||
export const Large: Story = {
|
||||
args: {
|
||||
size: 'large'
|
||||
}
|
||||
};
|
||||
|
||||
export const NoLabel = Template.bind({});
|
||||
NoLabel.args = {
|
||||
export const NoLabel: Story = {
|
||||
args: {
|
||||
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 { 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 {
|
||||
title: 'No Transactions Info',
|
||||
component: NoTransactionsInfoComponent,
|
||||
component: GfNoTransactionsInfoComponent,
|
||||
decorators: [
|
||||
moduleMetadata({
|
||||
imports: [GfLogoModule, RouterTestingModule]
|
||||
imports: [GfLogoComponent, RouterTestingModule]
|
||||
})
|
||||
]
|
||||
} as Meta<NoTransactionsInfoComponent>;
|
||||
} as Meta<GfNoTransactionsInfoComponent>;
|
||||
|
||||
const Template: Story<NoTransactionsInfoComponent> = (
|
||||
args: NoTransactionsInfoComponent
|
||||
) => ({
|
||||
props: args
|
||||
});
|
||||
type Story = StoryObj<GfNoTransactionsInfoComponent>;
|
||||
|
||||
export const Default = Template.bind({});
|
||||
Default.args = {};
|
||||
export const Default: Story = {
|
||||
args: {}
|
||||
};
|
||||
|
@ -1,29 +1,28 @@
|
||||
import { CommonModule } from '@angular/common';
|
||||
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 {
|
||||
title: 'Premium Indicator',
|
||||
component: PremiumIndicatorComponent,
|
||||
component: GfPremiumIndicatorComponent,
|
||||
decorators: [
|
||||
moduleMetadata({
|
||||
imports: [CommonModule, RouterTestingModule]
|
||||
})
|
||||
]
|
||||
} as Meta<PremiumIndicatorComponent>;
|
||||
} as Meta<GfPremiumIndicatorComponent>;
|
||||
|
||||
const Template: Story<PremiumIndicatorComponent> = (
|
||||
args: PremiumIndicatorComponent
|
||||
) => ({
|
||||
props: args
|
||||
});
|
||||
type Story = StoryObj<GfPremiumIndicatorComponent>;
|
||||
|
||||
export const Default = Template.bind({});
|
||||
Default.args = {};
|
||||
export const Default: Story = {
|
||||
args: {}
|
||||
};
|
||||
|
||||
export const WithoutLink = Template.bind({});
|
||||
WithoutLink.args = {
|
||||
export const WithoutLink = {
|
||||
args: {
|
||||
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 { TrendIndicatorComponent } from './trend-indicator.component';
|
||||
import { GfTrendIndicatorComponent } from './trend-indicator.component';
|
||||
|
||||
export default {
|
||||
title: 'Trend Indicator',
|
||||
component: TrendIndicatorComponent,
|
||||
component: GfTrendIndicatorComponent,
|
||||
decorators: [
|
||||
moduleMetadata({
|
||||
imports: [NgxSkeletonLoaderModule]
|
||||
})
|
||||
]
|
||||
} as Meta<TrendIndicatorComponent>;
|
||||
} as Meta<GfTrendIndicatorComponent>;
|
||||
|
||||
const Template: Story<TrendIndicatorComponent> = (
|
||||
args: TrendIndicatorComponent
|
||||
) => ({
|
||||
props: args
|
||||
});
|
||||
type Story = StoryObj<GfTrendIndicatorComponent>;
|
||||
|
||||
export const Loading = Template.bind({});
|
||||
Loading.args = {
|
||||
export const Loading: Story = {
|
||||
args: {
|
||||
isLoading: true
|
||||
}
|
||||
};
|
||||
|
||||
export const Default = Template.bind({});
|
||||
Default.args = {};
|
||||
export const Default: Story = {
|
||||
args: {}
|
||||
};
|
||||
|
||||
export const Delayed = Template.bind({});
|
||||
Delayed.args = {
|
||||
marketState: 'delayed',
|
||||
range: '1d'
|
||||
export const Delayed: Story = {
|
||||
args: {
|
||||
dateRange: '1d',
|
||||
marketState: 'delayed'
|
||||
}
|
||||
};
|
||||
|
||||
export const Down = Template.bind({});
|
||||
Down.args = {
|
||||
export const Down: Story = {
|
||||
args: {
|
||||
value: -1
|
||||
}
|
||||
};
|
||||
|
||||
export const Up = Template.bind({});
|
||||
Up.args = {
|
||||
export const Up: Story = {
|
||||
args: {
|
||||
value: 1
|
||||
}
|
||||
};
|
||||
|
||||
export const MarketClosed = Template.bind({});
|
||||
MarketClosed.args = {
|
||||
marketState: 'closed',
|
||||
range: '1d'
|
||||
export const MarketClosed: Story = {
|
||||
args: {
|
||||
dateRange: '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 { ValueComponent } from './value.component';
|
||||
import { GfValueComponent } from './value.component';
|
||||
|
||||
export default {
|
||||
title: 'Value',
|
||||
component: ValueComponent,
|
||||
component: GfValueComponent,
|
||||
decorators: [
|
||||
moduleMetadata({
|
||||
imports: [NgxSkeletonLoaderModule]
|
||||
})
|
||||
]
|
||||
} as Meta<ValueComponent>;
|
||||
} as Meta<GfValueComponent>;
|
||||
|
||||
const Template: Story<ValueComponent> = (args: ValueComponent) => ({
|
||||
props: args
|
||||
});
|
||||
type Story = StoryObj<GfValueComponent>;
|
||||
|
||||
export const Loading = Template.bind({});
|
||||
Loading.args = {
|
||||
export const Loading: Story = {
|
||||
args: {
|
||||
value: undefined
|
||||
}
|
||||
};
|
||||
|
||||
export const Currency = Template.bind({});
|
||||
Currency.args = {
|
||||
export const Currency: Story = {
|
||||
args: {
|
||||
isCurrency: true,
|
||||
locale: 'en-US',
|
||||
unit: 'USD',
|
||||
value: 7
|
||||
}
|
||||
};
|
||||
|
||||
export const Label = Template.bind({});
|
||||
Label.args = {
|
||||
export const Label: Story = {
|
||||
args: {
|
||||
locale: 'en-US',
|
||||
value: 7.25
|
||||
}
|
||||
};
|
||||
|
||||
export const PerformancePositive = Template.bind({});
|
||||
PerformancePositive.args = {
|
||||
locale: 'en-US',
|
||||
export const PerformancePositive: Story = {
|
||||
args: {
|
||||
colorizeSign: true,
|
||||
isPercent: true,
|
||||
locale: 'en-US',
|
||||
value: 0.0136810853673890378
|
||||
},
|
||||
name: 'Performance (positive)'
|
||||
};
|
||||
PerformancePositive.storyName = 'Performance (positive)';
|
||||
|
||||
export const PerformanceNegative = Template.bind({});
|
||||
PerformanceNegative.args = {
|
||||
locale: 'en-US',
|
||||
export const PerformanceNegative: Story = {
|
||||
args: {
|
||||
colorizeSign: true,
|
||||
isPercent: true,
|
||||
locale: 'en-US',
|
||||
value: -0.0136810853673890378
|
||||
},
|
||||
name: 'Performance (negative)'
|
||||
};
|
||||
PerformanceNegative.storyName = 'Performance (negative)';
|
||||
|
||||
export const PerformanceCloseToZero = Template.bind({});
|
||||
PerformanceCloseToZero.args = {
|
||||
locale: 'en-US',
|
||||
export const PerformanceCloseToZero: Story = {
|
||||
args: {
|
||||
colorizeSign: true,
|
||||
isPercent: true,
|
||||
locale: 'en-US',
|
||||
value: -2.388915360475e-8
|
||||
},
|
||||
name: 'Performance (negative zero)'
|
||||
};
|
||||
PerformanceCloseToZero.storyName = 'Performance (negative zero)';
|
||||
|
||||
export const Precision = Template.bind({});
|
||||
Precision.args = {
|
||||
export const Precision: Story = {
|
||||
args: {
|
||||
locale: 'en-US',
|
||||
precision: 3,
|
||||
value: 7.2534802394809285309
|
||||
}
|
||||
};
|
||||
|
Loading…
Reference in new issue