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:
André Jaenisch 2024-02-20 15:08:56 +01:00
parent 21a7fc1b54
commit b0366f26ed
No known key found for this signature in database
GPG key ID: 5A668E771F1ED854
8 changed files with 110 additions and 4 deletions

View file

@ -1,5 +1,5 @@
import type { Meta, StoryObj } from '@storybook/svelte';
import AlertFill16 from 'svelte-octicons/lib/AlertFill16.svelte';
import { AlertFill16 } from 'svelte-octicons';
const meta = {
title: 'Icons/AlertFill16',

View file

@ -1,5 +1,5 @@
import type { Meta, StoryObj } from '@storybook/svelte';
import Info16 from 'svelte-octicons/lib/Info16.svelte';
import { Info16 } from 'svelte-octicons';
const meta = {
title: 'Icons/Info16',

View 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 = {};

View file

@ -1,5 +1,5 @@
import type { Meta, StoryObj } from '@storybook/svelte';
import Repo24 from 'svelte-octicons/lib/Repo24.svelte';
import { Repo24 } from 'svelte-octicons';
const meta = {
title: 'Icons/Repo24',

View 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 = {};

View file

@ -1,5 +1,5 @@
import type { Meta, StoryObj } from '@storybook/svelte';
import Upload16 from 'svelte-octicons/lib/Upload16.svelte';
import { Upload16 } from 'svelte-octicons';
const meta = {
title: 'Icons/Upload16',

View 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'
}
}
}
};

View 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'
}
}
}
};