diff --git a/.storybook/preview-head.html b/.storybook/preview-head.html index 17958c7..d5903b6 100644 --- a/.storybook/preview-head.html +++ b/.storybook/preview-head.html @@ -1,3 +1,9 @@ - + \ No newline at end of file diff --git a/src/account/PageStory.tsx b/src/account/PageStory.tsx index d4f8aad..77cb0fb 100644 --- a/src/account/PageStory.tsx +++ b/src/account/PageStory.tsx @@ -37,3 +37,12 @@ export function createPageStory(params: { return { PageStory }; } + +export const parameters = { + viewMode: "story", + previewTabs: { + "storybook/docs/panel": { + hidden: true + } + } +}; diff --git a/src/account/pages/Account.stories.tsx b/src/account/pages/Account.stories.tsx deleted file mode 100644 index 86d2bab..0000000 --- a/src/account/pages/Account.stories.tsx +++ /dev/null @@ -1,19 +0,0 @@ -import type { Meta, StoryObj } from "@storybook/react"; -import { createPageStory } from "../PageStory"; - -const pageId = "account.ftl"; - -const { PageStory } = createPageStory({ pageId }); - -const meta = { - title: `account/${pageId}`, - component: PageStory -} satisfies Meta; - -export default meta; - -type Story = StoryObj; - -export const Default: Story = { - render: () => -}; diff --git a/src/account/pages/Password.stories.tsx b/src/account/pages/Password.stories.tsx deleted file mode 100644 index a9b588d..0000000 --- a/src/account/pages/Password.stories.tsx +++ /dev/null @@ -1,29 +0,0 @@ -import type { Meta, StoryObj } from "@storybook/react"; -import { createPageStory } from "../PageStory"; - -const pageId = "password.ftl"; - -const { PageStory } = createPageStory({ pageId }); - -const meta = { - title: `account/${pageId}`, - component: PageStory -} satisfies Meta; - -export default meta; - -type Story = StoryObj; - -export const Default: Story = { - render: () => -}; - -export const WithMessage: Story = { - render: () => ( - - ) -}; diff --git a/src/login/PageStory.tsx b/src/login/PageStory.tsx index b167b77..c9ce79c 100644 --- a/src/login/PageStory.tsx +++ b/src/login/PageStory.tsx @@ -32,12 +32,11 @@ export function createPageStory(params: { overrides }); - return ( - <> - - - ); + return ; } return { PageStory }; } + +export const parameters = { +}; \ No newline at end of file diff --git a/src/login/pages/Login.stories.tsx b/src/login/pages/Login.stories.tsx deleted file mode 100644 index cf687bc..0000000 --- a/src/login/pages/Login.stories.tsx +++ /dev/null @@ -1,183 +0,0 @@ -import type { Meta, StoryObj } from "@storybook/react"; -import { createPageStory } from "../PageStory"; - -const pageId = "login.ftl"; - -const { PageStory } = createPageStory({ pageId }); - -const meta = { - title: `login/${pageId}`, - component: PageStory -} satisfies Meta; - -export default meta; - -type Story = StoryObj; - -export const Default: Story = { - render: () => -}; - -export const WithoutRegistration: Story = { - render: () => ( - - ) -}; - -export const WithoutRememberMe: Story = { - render: () => ( - - ) -}; - -export const WithoutPasswordReset: Story = { - render: () => ( - - ) -}; - -export const WithEmailAsUsername: Story = { - render: () => ( - - ) -}; - -export const WithPresetUsername: Story = { - render: () => ( - - ) -}; - -export const WithImmutablePresetUsername: Story = { - render: () => ( - - ) -}; - -export const WithSocialProviders: Story = { - render: () => ( - - ) -}; - -export const WithoutPasswordField: Story = { - render: () => ( - - ) -}; diff --git a/src/login/pages/Register.stories.tsx b/src/login/pages/Register.stories.tsx deleted file mode 100644 index 86ca040..0000000 --- a/src/login/pages/Register.stories.tsx +++ /dev/null @@ -1,115 +0,0 @@ -import type { Meta, StoryObj } from "@storybook/react"; -import { createPageStory } from "../PageStory"; - -const pageId = "register.ftl"; - -const { PageStory } = createPageStory({ pageId }); - -const meta = { - title: `login/${pageId}`, - component: PageStory -} satisfies Meta; - -export default meta; - -type Story = StoryObj; - -export const Default: Story = { - render: () => -}; - -export const WithFieldError: Story = { - render: () => ( - fieldName === "email", - exists: (fieldName: string) => fieldName === "email", - get: (fieldName: string) => (fieldName === "email" ? "I don't like your email address" : undefined), - printIfExists: (fieldName: string, x: T) => (fieldName === "email" ? x : undefined) - } - }} - /> - ) -}; - -export const WithEmailAsUsername: Story = { - render: () => ( - - ) -}; - -export const WithoutPassword: Story = { - render: () => ( - - ) -}; - -export const WithRecaptcha: Story = { - render: () => ( - - ) -}; - -export const WithRecaptchaFrench: Story = { - render: () => ( - - ) -}; - -export const WithPresets: Story = { - render: () => ( - - ) -}; diff --git a/src/main.tsx b/src/main.tsx index f16b622..374b519 100644 --- a/src/main.tsx +++ b/src/main.tsx @@ -3,6 +3,7 @@ import { createRoot } from "react-dom/client"; import { StrictMode, lazy, Suspense } from "react"; // The following block can be uncommented to test a specific page with `yarn dev` +// Don't forget to comment back or your bundle size will increase /* import { getKcContextMock } from "./login/PageStory";