import React from "react"; import type { Meta, StoryObj } from "@storybook/react"; import { createKcPageStory } from "../KcPageStory"; const { KcPageStory } = createKcPageStory({ pageId: "login.ftl" }); const meta = { title: "login/login.ftl", component: KcPageStory } satisfies Meta; export default meta; type Story = StoryObj; export const Default: Story = { render: () => }; export const WithInvalidCredential: Story = { render: () => ( { const fieldNames = [fieldName, ...otherFieldNames]; return fieldNames.includes("username") || fieldNames.includes("password"); }, get: (fieldName: string) => { if (fieldName === "username" || fieldName === "password") { return "Invalid username or password."; } return ""; } } }} /> ) }; 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: () => ( ) }; export const WithErrorMessage: Story = { render: () => ( The login process will restart from the beginning.", type: "error" } }} /> ) }; export const WithOneSocialProvider: Story = { render: args => ( ) }; export const WithTwoSocialProviders: Story = { render: args => ( ) }; export const WithNoSocialProviders: Story = { render: args => ( ) }; export const WithMoreThanTwoSocialProviders: Story = { render: args => ( ) }; export const WithSocialProvidersAndWithoutRememberMe: Story = { render: args => ( ) };