feat(storybook): progress on many more pages
This commit is contained in:
1 parent
dbe320b2fc
commit
1e1a638011
30 files changed
+1061
-300
No files matched your search
@@ -1,27 +0,0 @@
|
|||||||
import { KcContextBase, getKcContext } from "keycloakify/lib/getKcContext";
|
|
||||||
import type { DeepPartial } from "keycloakify/lib/tools/DeepPartial";
|
|
||||||
import type { ExtendsKcContextBase } from "keycloakify/lib/getKcContext/getKcContextFromWindow";
|
|
||||||
import type { KcContextExtension } from "keycloak-theme/kcContext";
|
|
||||||
|
|
||||||
|
|
||||||
export const useKcStoryData = (mockData: (
|
|
||||||
{ pageId: KcContextBase['pageId'] | KcContextExtension['pageId'] } & DeepPartial<ExtendsKcContextBase<KcContextExtension>>
|
|
||||||
)) => {
|
|
||||||
const { kcContext } = getKcContext<KcContextExtension>({ mockPageId: mockData.pageId, mockData: [mockData] })
|
|
||||||
return { kcContext: kcContext as NonNullable<typeof kcContext> }
|
|
||||||
}
|
|
||||||
|
|
||||||
export const socialProviders = [
|
|
||||||
{ 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' },
|
|
||||||
]
|
|
||||||
+14
-16
@@ -1,18 +1,16 @@
|
|||||||
module.exports = {
|
module.exports = {
|
||||||
"stories": [
|
"stories": [
|
||||||
"../src/keycloak-theme/pages/Login.stories.tsx",
|
"../src/keycloak-theme/**/*.stories.tsx",
|
||||||
"../src/keycloak-theme/pages/Register.stories.tsx",
|
],
|
||||||
"../src/keycloak-theme/pages/MyExtraPage1.stories.tsx",
|
"addons": [
|
||||||
"../src/keycloak-theme/pages/MyExtraPage2.stories.tsx",
|
"@storybook/addon-links",
|
||||||
],
|
"@storybook/addon-essentials",
|
||||||
"addons": [
|
"@storybook/addon-interactions",
|
||||||
"@storybook/addon-links",
|
"@storybook/preset-create-react-app"
|
||||||
"@storybook/addon-essentials",
|
],
|
||||||
"@storybook/addon-interactions",
|
"framework": "@storybook/react",
|
||||||
"@storybook/preset-create-react-app"
|
"core": {
|
||||||
],
|
"builder": "@storybook/builder-webpack5"
|
||||||
"framework": "@storybook/react",
|
},
|
||||||
"core": {
|
"staticDirs": ['../public']
|
||||||
"builder": "@storybook/builder-webpack5"
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
+10
-6
@@ -1,9 +1,13 @@
|
|||||||
export const parameters = {
|
export const parameters = {
|
||||||
actions: { argTypesRegex: "^on[A-Z].*" },
|
actions: {argTypesRegex: "^on[A-Z].*"},
|
||||||
controls: {
|
controls: {
|
||||||
matchers: {
|
matchers: {
|
||||||
color: /(background|color)$/i,
|
color: /(background|color)$/i,
|
||||||
date: /Date$/,
|
date: /Date$/,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
options: {
|
||||||
|
storySort: (a, b) =>
|
||||||
|
a[1].kind === b[1].kind ? 0 : a[1].id.localeCompare(b[1].id, undefined, {numeric: true}),
|
||||||
},
|
},
|
||||||
},
|
|
||||||
}
|
}
|
||||||
Loaded 3 of 30 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user