2023-04-17 04:01:44 +02:00
|
|
|
import React from "react";
|
|
|
|
import type { ComponentMeta } from "@storybook/react";
|
2023-04-20 01:54:40 +02:00
|
|
|
import { createPageStory } from "../createPageStory";
|
2023-04-17 04:01:44 +02:00
|
|
|
|
|
|
|
const pageId = "login.ftl";
|
|
|
|
|
|
|
|
const { PageStory } = createPageStory({ pageId });
|
|
|
|
|
|
|
|
const meta: ComponentMeta<any> = {
|
2023-04-20 02:52:49 +02:00
|
|
|
title: `login/${pageId}`,
|
|
|
|
component: PageStory,
|
|
|
|
parameters: {
|
|
|
|
viewMode: "story",
|
|
|
|
previewTabs: {
|
2023-04-20 00:13:25 +02:00
|
|
|
"storybook/docs/panel": {
|
|
|
|
"hidden": true
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2023-04-17 04:01:44 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
export default meta;
|
|
|
|
|
|
|
|
export const Default = () => <PageStory />;
|
|
|
|
|
|
|
|
export const WithoutPasswordField = () => (
|
|
|
|
<PageStory
|
|
|
|
kcContext={{
|
|
|
|
realm: { password: false }
|
|
|
|
}}
|
|
|
|
/>
|
|
|
|
);
|
|
|
|
|
|
|
|
export const WithoutRegistration = () => (
|
|
|
|
<PageStory
|
|
|
|
kcContext={{
|
|
|
|
realm: { registrationAllowed: false }
|
|
|
|
}}
|
|
|
|
/>
|
|
|
|
);
|
|
|
|
|
|
|
|
export const WithoutRememberMe = () => (
|
|
|
|
<PageStory
|
|
|
|
kcContext={{
|
|
|
|
realm: { rememberMe: false }
|
|
|
|
}}
|
|
|
|
/>
|
|
|
|
);
|
|
|
|
|
|
|
|
export const WithoutPasswordReset = () => (
|
|
|
|
<PageStory
|
|
|
|
kcContext={{
|
|
|
|
realm: { resetPasswordAllowed: false }
|
|
|
|
}}
|
|
|
|
/>
|
|
|
|
);
|
|
|
|
|
|
|
|
export const WithEmailAsUsername = () => (
|
|
|
|
<PageStory
|
|
|
|
kcContext={{
|
|
|
|
realm: { loginWithEmailAllowed: false }
|
|
|
|
}}
|
|
|
|
/>
|
|
|
|
);
|
|
|
|
|
|
|
|
export const WithPresetUsername = () => (
|
|
|
|
<PageStory
|
|
|
|
kcContext={{
|
|
|
|
login: { username: "max.mustermann@mail.com" }
|
|
|
|
}}
|
|
|
|
/>
|
|
|
|
);
|
|
|
|
|
|
|
|
export const WithImmutablePresetUsername = () => (
|
|
|
|
<PageStory
|
|
|
|
kcContext={{
|
2023-08-15 08:59:00 +02:00
|
|
|
auth: {
|
|
|
|
attemptedUsername: "max.mustermann@mail.com",
|
|
|
|
showUsername: true
|
|
|
|
},
|
|
|
|
usernameHidden: true,
|
|
|
|
message: { type: "info", summary: "Please re-authenticate to continue" }
|
2023-04-17 04:01:44 +02:00
|
|
|
}}
|
|
|
|
/>
|
|
|
|
);
|
|
|
|
|
|
|
|
export const WithSocialProviders = () => (
|
|
|
|
<PageStory
|
|
|
|
kcContext={{
|
|
|
|
social: {
|
|
|
|
displayInfo: true,
|
|
|
|
providers: [
|
|
|
|
{ loginUrl: "google", alias: "google", providerId: "google", displayName: "Google" },
|
|
|
|
{ loginUrl: "microsoft", alias: "microsoft", providerId: "microsoft", displayName: "Microsoft" },
|
|
|
|
{ loginUrl: "facebook", alias: "facebook", providerId: "facebook", displayName: "Facebook" },
|
|
|
|
{ loginUrl: "instagram", alias: "instagram", providerId: "instagram", displayName: "Instagram" },
|
|
|
|
{ loginUrl: "twitter", alias: "twitter", providerId: "twitter", displayName: "Twitter" },
|
|
|
|
{ loginUrl: "linkedin", alias: "linkedin", providerId: "linkedin", displayName: "LinkedIn" },
|
|
|
|
{ loginUrl: "stackoverflow", alias: "stackoverflow", providerId: "stackoverflow", displayName: "Stackoverflow" },
|
|
|
|
{ loginUrl: "github", alias: "github", providerId: "github", displayName: "Github" },
|
|
|
|
{ loginUrl: "gitlab", alias: "gitlab", providerId: "gitlab", displayName: "Gitlab" },
|
|
|
|
{ loginUrl: "bitbucket", alias: "bitbucket", providerId: "bitbucket", displayName: "Bitbucket" },
|
|
|
|
{ loginUrl: "paypal", alias: "paypal", providerId: "paypal", displayName: "PayPal" },
|
|
|
|
{ loginUrl: "openshift", alias: "openshift", providerId: "openshift", displayName: "OpenShift" }
|
|
|
|
]
|
|
|
|
}
|
|
|
|
}}
|
|
|
|
/>
|
|
|
|
);
|