Setup a very basic storybook

This commit is contained in:
garronej 2023-04-17 00:15:41 +02:00
parent 8c8eef22ce
commit 045c20844f
15 changed files with 5915 additions and 391 deletions

View file

@ -1,4 +1,4 @@
import { getKcContext } from "keycloakify/login";
import { createGetKcContext } from "keycloakify/login";
export type KcContextExtension =
// NOTE: A 'keycloakify' field must be added
@ -12,13 +12,11 @@ export type KcContextExtension =
| { pageId: "register.ftl"; authorizedMailDomains: string[]; };
//NOTE: In most of the cases you do not need to overload the KcContext, you can
// just call getKcContext(...) without type arguments.
// just call createGetKcContext(...) without type arguments.
// You want to overload the KcContext only if:
// - You have custom plugins that add some values to the context (like https://github.com/micedre/keycloak-mail-whitelisting that adds authorizedMailDomains)
// - You want to add support for extra pages that are not yey featured by default, see: https://docs.keycloakify.dev/contributing#adding-support-for-a-new-page
export const { kcContext } = getKcContext<KcContextExtension>({
// Uncomment to test the login page for development.
//mockPageId: "login.ftl",
export const { getKcContext } = createGetKcContext<KcContextExtension>({
mockData: [
{
pageId: "login.ftl",
@ -94,4 +92,10 @@ export const { kcContext } = getKcContext<KcContextExtension>({
]
});
export const { kcContext } = getKcContext({
// Uncomment to test the login page for development.
//mockPageId: "login.ftl",
});
export type KcContext = NonNullable<typeof kcContext>;