feat: create stories for Profile
I also updated the icons to reflect all in use. Signed-off-by: André Jaenisch <andre.jaenisch@posteo.de>
This commit is contained in:
parent
21a7fc1b54
commit
b0366f26ed
8 changed files with 110 additions and 4 deletions
|
@ -1,5 +1,5 @@
|
||||||
import type { Meta, StoryObj } from '@storybook/svelte';
|
import type { Meta, StoryObj } from '@storybook/svelte';
|
||||||
import AlertFill16 from 'svelte-octicons/lib/AlertFill16.svelte';
|
import { AlertFill16 } from 'svelte-octicons';
|
||||||
|
|
||||||
const meta = {
|
const meta = {
|
||||||
title: 'Icons/AlertFill16',
|
title: 'Icons/AlertFill16',
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
import type { Meta, StoryObj } from '@storybook/svelte';
|
import type { Meta, StoryObj } from '@storybook/svelte';
|
||||||
import Info16 from 'svelte-octicons/lib/Info16.svelte';
|
import { Info16 } from 'svelte-octicons';
|
||||||
|
|
||||||
const meta = {
|
const meta = {
|
||||||
title: 'Icons/Info16',
|
title: 'Icons/Info16',
|
||||||
|
|
18
stories/icons/NorthStar24.stories.ts
Normal file
18
stories/icons/NorthStar24.stories.ts
Normal file
|
@ -0,0 +1,18 @@
|
||||||
|
import type { Meta, StoryObj } from '@storybook/svelte';
|
||||||
|
import { NorthStar24 } from 'svelte-octicons';
|
||||||
|
|
||||||
|
const meta = {
|
||||||
|
title: 'Icons/NorthStar24',
|
||||||
|
component: NorthStar24,
|
||||||
|
tags: ['autodocs'],
|
||||||
|
argTypes: {
|
||||||
|
fill: {
|
||||||
|
control: 'color'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} satisfies Meta<NorthStar24>;
|
||||||
|
|
||||||
|
export default meta;
|
||||||
|
type Story = StoryObj<typeof meta>;
|
||||||
|
|
||||||
|
export const Plain: Story = {};
|
|
@ -1,5 +1,5 @@
|
||||||
import type { Meta, StoryObj } from '@storybook/svelte';
|
import type { Meta, StoryObj } from '@storybook/svelte';
|
||||||
import Repo24 from 'svelte-octicons/lib/Repo24.svelte';
|
import { Repo24 } from 'svelte-octicons';
|
||||||
|
|
||||||
const meta = {
|
const meta = {
|
||||||
title: 'Icons/Repo24',
|
title: 'Icons/Repo24',
|
||||||
|
|
18
stories/icons/Star16.stories.ts
Normal file
18
stories/icons/Star16.stories.ts
Normal file
|
@ -0,0 +1,18 @@
|
||||||
|
import type { Meta, StoryObj } from '@storybook/svelte';
|
||||||
|
import { Star16 } from 'svelte-octicons';
|
||||||
|
|
||||||
|
const meta = {
|
||||||
|
title: 'Icons/Star16',
|
||||||
|
component: Star16,
|
||||||
|
tags: ['autodocs'],
|
||||||
|
argTypes: {
|
||||||
|
fill: {
|
||||||
|
control: 'color'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} satisfies Meta<Star16>;
|
||||||
|
|
||||||
|
export default meta;
|
||||||
|
type Story = StoryObj<typeof meta>;
|
||||||
|
|
||||||
|
export const Plain: Story = {};
|
|
@ -1,5 +1,5 @@
|
||||||
import type { Meta, StoryObj } from '@storybook/svelte';
|
import type { Meta, StoryObj } from '@storybook/svelte';
|
||||||
import Upload16 from 'svelte-octicons/lib/Upload16.svelte';
|
import { Upload16 } from 'svelte-octicons';
|
||||||
|
|
||||||
const meta = {
|
const meta = {
|
||||||
title: 'Icons/Upload16',
|
title: 'Icons/Upload16',
|
||||||
|
|
35
stories/pages/Profile.stories.ts
Normal file
35
stories/pages/Profile.stories.ts
Normal file
|
@ -0,0 +1,35 @@
|
||||||
|
import type { Meta, StoryObj } from '@storybook/svelte';
|
||||||
|
|
||||||
|
import Profile from '$lib/components/pages/Profile.svelte';
|
||||||
|
|
||||||
|
const meta = {
|
||||||
|
title: 'Pages/Profile',
|
||||||
|
component: Profile,
|
||||||
|
tags: ['autodocs'],
|
||||||
|
argTypes: {
|
||||||
|
data: { controls: 'object' }
|
||||||
|
}
|
||||||
|
} satisfies Meta<Profile>;
|
||||||
|
|
||||||
|
export default meta;
|
||||||
|
type Story = StoryObj<typeof meta>;
|
||||||
|
|
||||||
|
export const Plain: Story = {
|
||||||
|
args: {
|
||||||
|
data: {
|
||||||
|
user: {
|
||||||
|
avatar: '',
|
||||||
|
created_at: new Date(),
|
||||||
|
created_at_formatted: (function () {
|
||||||
|
const locale = 'en-US';
|
||||||
|
return new Intl.DateTimeFormat(locale).format(new Date());
|
||||||
|
})(),
|
||||||
|
created_with: 'Anvil',
|
||||||
|
display_name: 'Jane Doe',
|
||||||
|
instance: 'domain.example',
|
||||||
|
pronoun: 'she/her',
|
||||||
|
username: 'jane_doe'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
35
stories/templates/Profile.stories.ts
Normal file
35
stories/templates/Profile.stories.ts
Normal file
|
@ -0,0 +1,35 @@
|
||||||
|
import type { Meta, StoryObj } from '@storybook/svelte';
|
||||||
|
|
||||||
|
import Profile from '$lib/components/templates/Profile.svelte';
|
||||||
|
|
||||||
|
const meta = {
|
||||||
|
title: 'Templates/Profile',
|
||||||
|
component: Profile,
|
||||||
|
tags: ['autodocs'],
|
||||||
|
argTypes: {
|
||||||
|
data: { controls: 'object' }
|
||||||
|
}
|
||||||
|
} satisfies Meta<Profile>;
|
||||||
|
|
||||||
|
export default meta;
|
||||||
|
type Story = StoryObj<typeof meta>;
|
||||||
|
|
||||||
|
export const Plain: Story = {
|
||||||
|
args: {
|
||||||
|
data: {
|
||||||
|
user: {
|
||||||
|
avatar: '',
|
||||||
|
created_at: new Date(),
|
||||||
|
created_at_formatted: (function () {
|
||||||
|
const locale = 'en-US';
|
||||||
|
return new Intl.DateTimeFormat(locale).format(new Date());
|
||||||
|
})(),
|
||||||
|
created_with: 'Anvil',
|
||||||
|
display_name: 'Jane Doe',
|
||||||
|
instance: 'domain.example',
|
||||||
|
pronoun: 'she/her',
|
||||||
|
username: 'jane_doe'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
Loading…
Reference in a new issue