More homogeneous storybook setup

This commit is contained in:
Joseph Garrone
2024-06-03 00:11:19 +02:00
parent e011fb094c
commit ba4d9675a8
34 changed files with 1235 additions and 1130 deletions

View File

@ -1,40 +1,46 @@
import React from "react";
import type { ComponentMeta } from "@storybook/react";
import type { Meta, StoryObj } from "@storybook/react";
import { createPageStory, parameters } from "../createPageStory";
const pageId = "select-authenticator.ftl";
const { PageStory } = createPageStory({ pageId });
const meta: ComponentMeta<any> = {
const meta = {
title: `login/${pageId}`,
component: PageStory,
parameters
};
} satisfies Meta<typeof PageStory>;
export default meta;
export const Default = () => <PageStory />;
type Story = StoryObj<typeof meta>;
export const WithDifferentAuthenticationMethods = () => (
<PageStory
kcContext={{
auth: {
authenticationSelections: [
{
authExecId: "25697c4e-0c80-4f2c-8eb7-2c16347e8e8d",
displayName: "auth-username-password-form-display-name",
helpText: "auth-username-password-form-help-text",
iconCssClass: "kcAuthenticatorPasswordClass"
},
{
authExecId: "4cb60872-ce0d-4c8f-a806-e651ed77994b",
displayName: "webauthn-passwordless-display-name",
helpText: "webauthn-passwordless-help-text",
iconCssClass: "kcAuthenticatorWebAuthnPasswordlessClass"
}
]
}
}}
/>
);
export const Default: Story = {
render: () => <PageStory />
};
export const WithDifferentAuthenticationMethods: Story = {
render: () => (
<PageStory
kcContext={{
auth: {
authenticationSelections: [
{
authExecId: "25697c4e-0c80-4f2c-8eb7-2c16347e8e8d",
displayName: "auth-username-password-form-display-name",
helpText: "auth-username-password-form-help-text",
iconCssClass: "kcAuthenticatorPasswordClass"
},
{
authExecId: "4cb60872-ce0d-4c8f-a806-e651ed77994b",
displayName: "webauthn-passwordless-display-name",
helpText: "webauthn-passwordless-help-text",
iconCssClass: "kcAuthenticatorWebAuthnPasswordlessClass"
}
]
}
}}
/>
)
};