feat(devx): introduce storybook

First shot at introducing storybook, with stories for the keycloak
theme pages already in the repo.
This commit is contained in:
Waldemar Reusch 2023-03-12 00:41:14 +01:00
parent 38dd7a946e
commit 8cdc6b7730
9 changed files with 7120 additions and 157 deletions

View file

@ -0,0 +1,29 @@
import { ComponentMeta } from '@storybook/react';
import KcApp from '../KcApp';
import { useKcStoryData } from '../../../.storybook/data'
export default {
title: 'My Extra Page 2',
component: KcApp,
parameters: {
layout: 'fullscreen',
},
} as ComponentMeta<typeof KcApp>;
const pageId = 'my-extra-page-2.ftl'
export const Default = () => {
const { kcContext } = useKcStoryData({ pageId })
return <KcApp kcContext={kcContext} />
}
export const InFrench = () => {
const { kcContext } = useKcStoryData({ pageId, locale: { currentLanguageTag: 'fr' } })
return <KcApp kcContext={kcContext} />
}
export const WithCustomValue = () => {
const { kcContext } = useKcStoryData({ pageId, someCustomValue: 'Foo Bar Baz' })
return <KcApp kcContext={kcContext} />
}