chore:format

This commit is contained in:
2025-09-26 16:06:30 +02:00
parent d8f7921970
commit 9ce6f963f1
13 changed files with 318 additions and 314 deletions

View File

@@ -1,20 +1,17 @@
import type { StorybookConfig } from '@storybook/sveltekit'; import type { StorybookConfig } from '@storybook/sveltekit';
const config: StorybookConfig = { const config: StorybookConfig = {
"stories": [ stories: ['../src/**/*.mdx', '../src/**/*.stories.@(js|ts|svelte)'],
"../src/**/*.mdx", addons: [
"../src/**/*.stories.@(js|ts|svelte)" '@storybook/addon-svelte-csf',
'@chromatic-com/storybook',
'@storybook/addon-docs',
'@storybook/addon-a11y',
'@storybook/addon-vitest'
], ],
"addons": [ framework: {
"@storybook/addon-svelte-csf", name: '@storybook/sveltekit',
"@chromatic-com/storybook", options: {}
"@storybook/addon-docs",
"@storybook/addon-a11y",
"@storybook/addon-vitest"
],
"framework": {
"name": "@storybook/sveltekit",
"options": {}
} }
}; };
export default config; export default config;

View File

@@ -1,14 +1,14 @@
import type { Preview } from '@storybook/sveltekit' import type { Preview } from '@storybook/sveltekit';
const preview: Preview = { const preview: Preview = {
parameters: { parameters: {
controls: { controls: {
matchers: { matchers: {
color: /(background|color)$/i, color: /(background|color)$/i,
date: /Date$/i, date: /Date$/i
}, }
}, }
}, }
}; };
export default preview; export default preview;

View File

@@ -12,11 +12,11 @@
backgroundColor: { control: 'color' }, backgroundColor: { control: 'color' },
size: { size: {
control: { type: 'select' }, control: { type: 'select' },
options: ['small', 'medium', 'large'], options: ['small', 'medium', 'large']
}, }
}, },
args: { args: {
onclick: fn(), onclick: fn()
} }
}); });
</script> </script>

View File

@@ -1,21 +1,22 @@
import { Meta } from "@storybook/addon-docs/blocks"; import { Meta } from '@storybook/addon-docs/blocks';
import Github from "./assets/github.svg"; import Github from './assets/github.svg';
import Discord from "./assets/discord.svg"; import Discord from './assets/discord.svg';
import Youtube from "./assets/youtube.svg"; import Youtube from './assets/youtube.svg';
import Tutorials from "./assets/tutorials.svg"; import Tutorials from './assets/tutorials.svg';
import Styling from "./assets/styling.png"; import Styling from './assets/styling.png';
import Context from "./assets/context.png"; import Context from './assets/context.png';
import Assets from "./assets/assets.png"; import Assets from './assets/assets.png';
import Docs from "./assets/docs.png"; import Docs from './assets/docs.png';
import Share from "./assets/share.png"; import Share from './assets/share.png';
import FigmaPlugin from "./assets/figma-plugin.png"; import FigmaPlugin from './assets/figma-plugin.png';
import Testing from "./assets/testing.png"; import Testing from './assets/testing.png';
import Accessibility from "./assets/accessibility.png"; import Accessibility from './assets/accessibility.png';
import Theming from "./assets/theming.png"; import Theming from './assets/theming.png';
import AddonLibrary from "./assets/addon-library.png"; import AddonLibrary from './assets/addon-library.png';
export const RightArrow = () => <svg export const RightArrow = () => (
<svg
viewBox="0 0 14 14" viewBox="0 0 14 14"
width="8px" width="8px"
height="14px" height="14px"
@@ -30,6 +31,7 @@ export const RightArrow = () => <svg
> >
<path d="m11.1 7.35-5.5 5.5a.5.5 0 0 1-.7-.7L10.04 7 4.9 1.85a.5.5 0 1 1 .7-.7l5.5 5.5c.2.2.2.5 0 .7Z" /> <path d="m11.1 7.35-5.5 5.5a.5.5 0 0 1-.7-.7L10.04 7 4.9 1.85a.5.5 0 1 1 .7-.7l5.5 5.5c.2.2.2.5 0 .7Z" />
</svg> </svg>
);
<Meta title="Configure your project" /> <Meta title="Configure your project" />
@@ -38,6 +40,7 @@ export const RightArrow = () => <svg
# Configure your project # Configure your project
Because Storybook works separately from your app, you'll need to configure it for your specific stack and setup. Below, explore guides for configuring Storybook with popular frameworks and tools. If you get stuck, learn how you can ask for help from our community. Because Storybook works separately from your app, you'll need to configure it for your specific stack and setup. Below, explore guides for configuring Storybook with popular frameworks and tools. If you get stuck, learn how you can ask for help from our community.
</div> </div>
<div className="sb-section"> <div className="sb-section">
<div className="sb-section-item"> <div className="sb-section-item">
@@ -84,6 +87,7 @@ export const RightArrow = () => <svg
# Do more with Storybook # Do more with Storybook
Now that you know the basics, let's explore other parts of Storybook that will improve your experience. This list is just to get you started. You can customise Storybook in many ways to fit your needs. Now that you know the basics, let's explore other parts of Storybook that will improve your experience. This list is just to get you started. You can customise Storybook in many ways to fit your needs.
</div> </div>
<div className="sb-section"> <div className="sb-section">
@@ -203,6 +207,7 @@ export const RightArrow = () => <svg
target="_blank" target="_blank"
>Discover tutorials<RightArrow /></a> >Discover tutorials<RightArrow /></a>
</div> </div>
</div> </div>
<style> <style>

View File

@@ -11,12 +11,12 @@
tags: ['autodocs'], tags: ['autodocs'],
parameters: { parameters: {
// More on how to position stories at: https://storybook.js.org/docs/configure/story-layout // More on how to position stories at: https://storybook.js.org/docs/configure/story-layout
layout: 'fullscreen', layout: 'fullscreen'
}, },
args: { args: {
onLogin: fn(), onLogin: fn(),
onLogout: fn(), onLogout: fn(),
onCreateAccount: fn(), onCreateAccount: fn()
} }
}); });
</script> </script>

View File

@@ -10,12 +10,14 @@
component: Page, component: Page,
parameters: { parameters: {
// More on how to position stories at: https://storybook.js.org/docs/configure/story-layout // More on how to position stories at: https://storybook.js.org/docs/configure/story-layout
layout: 'fullscreen', layout: 'fullscreen'
}, }
}); });
</script> </script>
<Story name="Logged In" play={async ({ canvasElement }) => { <Story
name="Logged In"
play={async ({ canvasElement }) => {
const canvas = within(canvasElement); const canvas = within(canvasElement);
const loginButton = canvas.getByRole('button', { name: /Log in/i }); const loginButton = canvas.getByRole('button', { name: /Log in/i });
await expect(loginButton).toBeInTheDocument(); await expect(loginButton).toBeInTheDocument();