diff --git a/.storybook/main.ts b/.storybook/main.ts index 52bf4ad..7d0b104 100644 --- a/.storybook/main.ts +++ b/.storybook/main.ts @@ -6,10 +6,11 @@ import { mergeConfig } from 'vite'; const config: StorybookConfig = { stories: ['../stories/**/*.mdx', '../stories/**/*.stories.ts'], addons: [ - '@storybook/addon-links', + '@storybook/addon-a11y', '@storybook/addon-essentials', + '@storybook/addon-links', '@storybook/addon-interactions', - '@storybook/addon-a11y' + '@storybook/addon-toolbar' ], core: { disableTelemetry: true diff --git a/.storybook/preview.ts b/.storybook/preview.ts index 846da51..28086b1 100644 --- a/.storybook/preview.ts +++ b/.storybook/preview.ts @@ -1,4 +1,6 @@ import type { Preview } from '@storybook/svelte'; +import { init, locale, register } from 'svelte-i18n'; + // See src/routes/+layout.svelte // Order is important! import '../src/theme.postcss'; @@ -6,7 +8,36 @@ import '../src/theme.postcss'; import '../src/app.postcss'; import './fix.css'; +register('de', () => import('../src/lib/i18n/locales/de.json')); +register('en', () => import('../src/lib/i18n/locales/en.json')); +register('he', () => import('../src/lib/i18n/locales/he.json')); +init({ fallbackLocale: 'en', initialLocale: 'en' }); +locale.set('en'); + const preview: Preview = { + globalTypes: { + locale: { + description: 'Internationalization locale', + defaultValue: 'en', + toolbar: { + icon: 'globe', + items: [ + { + value: 'de', + title: 'German' + }, + { + value: 'en', + title: 'English' + }, + { + value: 'he', + title: 'Hebrew' + } + ] + } + } + }, parameters: { actions: { argTypesRegex: '^on[A-Z].*' }, controls: { diff --git a/stories/icons/AlertFill16.stories.ts b/stories/icons/AlertFill16.stories.ts new file mode 100644 index 0000000..a1b5c5c --- /dev/null +++ b/stories/icons/AlertFill16.stories.ts @@ -0,0 +1,18 @@ +import type { Meta, StoryObj } from '@storybook/svelte'; +import AlertFill16 from 'svelte-octicons/lib/AlertFill16.svelte'; + +const meta = { + title: 'Icons/AlertFill16', + component: AlertFill16, + tags: ['autodocs'], + argTypes: { + fill: { + control: 'color' + } + } +} satisfies Meta; + +export default meta; +type Story = StoryObj; + +export const Plain: Story = {}; diff --git a/stories/icons/Info16.stories.ts b/stories/icons/Info16.stories.ts new file mode 100644 index 0000000..f10bcae --- /dev/null +++ b/stories/icons/Info16.stories.ts @@ -0,0 +1,18 @@ +import type { Meta, StoryObj } from '@storybook/svelte'; +import Info16 from 'svelte-octicons/lib/Info16.svelte'; + +const meta = { + title: 'Icons/Info16', + component: Info16, + tags: ['autodocs'], + argTypes: { + fill: { + control: 'color' + } + } +} satisfies Meta; + +export default meta; +type Story = StoryObj; + +export const Plain: Story = {}; diff --git a/stories/icons/Repo24.stories.ts b/stories/icons/Repo24.stories.ts new file mode 100644 index 0000000..a3d61ea --- /dev/null +++ b/stories/icons/Repo24.stories.ts @@ -0,0 +1,18 @@ +import type { Meta, StoryObj } from '@storybook/svelte'; +import Repo24 from 'svelte-octicons/lib/Repo24.svelte'; + +const meta = { + title: 'Icons/Repo24', + component: Repo24, + tags: ['autodocs'], + argTypes: { + fill: { + control: 'color' + } + } +} satisfies Meta; + +export default meta; +type Story = StoryObj; + +export const Plain: Story = {}; diff --git a/stories/icons/Upload16.stories.ts b/stories/icons/Upload16.stories.ts new file mode 100644 index 0000000..67c6913 --- /dev/null +++ b/stories/icons/Upload16.stories.ts @@ -0,0 +1,18 @@ +import type { Meta, StoryObj } from '@storybook/svelte'; +import Upload16 from 'svelte-octicons/lib/Upload16.svelte'; + +const meta = { + title: 'Icons/Upload16', + component: Upload16, + tags: ['autodocs'], + argTypes: { + fill: { + control: 'color' + } + } +} satisfies Meta; + +export default meta; +type Story = StoryObj; + +export const Plain: Story = {}; diff --git a/stories/pages/ImportProject.stories.ts b/stories/pages/ImportProject.stories.ts new file mode 100644 index 0000000..d36cd35 --- /dev/null +++ b/stories/pages/ImportProject.stories.ts @@ -0,0 +1,14 @@ +import type { Meta, StoryObj } from '@storybook/svelte'; + +import ImportProject from '$lib/components/pages/ImportProject.svelte'; + +const meta = { + title: 'Pages/ImportProject', + component: ImportProject, + tags: ['autodocs'] +} satisfies Meta; + +export default meta; +type Story = StoryObj; + +export const Plain: Story = {}; diff --git a/stories/templates/ImportProject.stories.ts b/stories/templates/ImportProject.stories.ts new file mode 100644 index 0000000..b7af624 --- /dev/null +++ b/stories/templates/ImportProject.stories.ts @@ -0,0 +1,14 @@ +import type { Meta, StoryObj } from '@storybook/svelte'; + +import ImportProject from '$lib/components/templates/ImportProject.svelte'; + +const meta = { + title: 'Templates/ImportProject', + component: ImportProject, + tags: ['autodocs'] +} satisfies Meta; + +export default meta; +type Story = StoryObj; + +export const Plain: Story = {};