fix: Use of 'Meta' from storybook instead of 'ComponentMeta'
This commit is contained in:
parent
e533e127bf
commit
a664195625
@ -1,24 +1,19 @@
|
|||||||
import React from "react";
|
import React from "react";
|
||||||
import type { ComponentMeta } from "@storybook/react";
|
import { Meta, StoryObj } from "@storybook/react";
|
||||||
import { createPageStory } from "../createPageStory";
|
import { createPageStory } from "../createPageStory";
|
||||||
|
|
||||||
const pageId = "account.ftl";
|
const pageId = "account.ftl";
|
||||||
|
|
||||||
const { PageStory } = createPageStory({ pageId });
|
const { PageStory } = createPageStory({ pageId });
|
||||||
|
|
||||||
const meta: ComponentMeta<any> = {
|
const meta = {
|
||||||
title: `account/${pageId}`,
|
title: "account/Account",
|
||||||
component: PageStory,
|
component: PageStory
|
||||||
parameters: {
|
} satisfies Meta<typeof PageStory>;
|
||||||
viewMode: "story",
|
|
||||||
previewTabs: {
|
|
||||||
"storybook/docs/panel": {
|
|
||||||
hidden: true
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
export default meta;
|
export default meta;
|
||||||
|
|
||||||
export const Default = () => <PageStory />;
|
type Story = StoryObj<typeof meta>;
|
||||||
|
|
||||||
|
export const Default: Story = {
|
||||||
|
render: () => <PageStory />
|
||||||
|
};
|
||||||
|
@ -1,23 +1,15 @@
|
|||||||
import React from "react";
|
import React from "react";
|
||||||
import type { ComponentMeta } from "@storybook/react";
|
import { Meta } from "@storybook/react";
|
||||||
import { createPageStory } from "../createPageStory";
|
import { createPageStory } from "../createPageStory";
|
||||||
|
|
||||||
const pageId = "password.ftl";
|
const pageId = "password.ftl";
|
||||||
|
|
||||||
const { PageStory } = createPageStory({ pageId });
|
const { PageStory } = createPageStory({ pageId });
|
||||||
|
|
||||||
const meta: ComponentMeta<any> = {
|
const meta = {
|
||||||
title: `account/${pageId}`,
|
title: "account/Password",
|
||||||
component: PageStory,
|
component: PageStory
|
||||||
parameters: {
|
} satisfies Meta<typeof PageStory>;
|
||||||
viewMode: "story",
|
|
||||||
previewTabs: {
|
|
||||||
"storybook/docs/panel": {
|
|
||||||
hidden: true
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
export default meta;
|
export default meta;
|
||||||
|
|
||||||
|
@ -1,26 +1,55 @@
|
|||||||
import React from "react";
|
import React from "react";
|
||||||
import type { ComponentMeta } from "@storybook/react";
|
import { Meta } from "@storybook/react";
|
||||||
import { createPageStory } from "../createPageStory";
|
import { createPageStory } from "../createPageStory";
|
||||||
|
|
||||||
const pageId = "sessions.ftl";
|
const pageId = "sessions.ftl";
|
||||||
|
|
||||||
const { PageStory } = createPageStory({ pageId });
|
const { PageStory } = createPageStory({ pageId });
|
||||||
|
|
||||||
const meta: ComponentMeta<any> = {
|
const meta = {
|
||||||
title: `account/${pageId}`,
|
title: "account/Sessions",
|
||||||
component: PageStory,
|
component: PageStory
|
||||||
parameters: {
|
} satisfies Meta<typeof PageStory>;
|
||||||
viewMode: "story",
|
|
||||||
previewTabs: {
|
|
||||||
"storybook/docs/panel": {
|
|
||||||
hidden: true
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
export default meta;
|
export default meta;
|
||||||
|
|
||||||
export const Default = () => <PageStory />;
|
export const Default = () => (
|
||||||
|
<PageStory
|
||||||
|
kcContext={{
|
||||||
|
sessions: {
|
||||||
|
sessions: [
|
||||||
|
{
|
||||||
|
expires: "2024-04-26T18:14:19Z",
|
||||||
|
clients: ["account"],
|
||||||
|
ipAddress: "172.20.0.1",
|
||||||
|
started: "2024-04-26T08:14:19Z",
|
||||||
|
lastAccess: "2024-04-26T08:30:54Z",
|
||||||
|
id: "af835e30-4821-43b1-b4f7-e732d3cc15d2"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
expires: "2024-04-26T18:14:09Z",
|
||||||
|
clients: ["security-admin-console", "account"],
|
||||||
|
ipAddress: "172.20.0.1",
|
||||||
|
started: "2024-04-26T08:14:09Z",
|
||||||
|
lastAccess: "2024-04-26T08:15:14Z",
|
||||||
|
id: "60a9d8b8-617d-441e-8643-08c3fe30e231"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
stateChecker: "xQ7EOgFrLi4EvnJ8dbXKhwFGWk_bkOp0X89mhilt1os"
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
);
|
||||||
|
|
||||||
export const WithMessage = () => <PageStory kcContext={{}} />;
|
export const WithError = () => (
|
||||||
|
<PageStory
|
||||||
|
kcContext={{
|
||||||
|
url: { passwordUrl: "/auth/realms/keycloakify/account/password" },
|
||||||
|
stateChecker: "xQ7EOgFrLi4EvnJ8dbXKhwFGWk_bkOp0X89mhilt1os",
|
||||||
|
message: {
|
||||||
|
summary: "Invalid existing password.",
|
||||||
|
type: "error"
|
||||||
|
}
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
);
|
||||||
|
@ -1,23 +1,15 @@
|
|||||||
import React from "react";
|
import React from "react";
|
||||||
import type { ComponentMeta } from "@storybook/react";
|
import { Meta } from "@storybook/react";
|
||||||
import { createPageStory } from "../createPageStory";
|
import { createPageStory } from "../createPageStory";
|
||||||
|
|
||||||
const pageId = "totp.ftl";
|
const pageId = "totp.ftl";
|
||||||
|
|
||||||
const { PageStory } = createPageStory({ pageId });
|
const { PageStory } = createPageStory({ pageId });
|
||||||
|
|
||||||
const meta: ComponentMeta<any> = {
|
const meta = {
|
||||||
title: `account/${pageId}`,
|
title: "account/Authenticator",
|
||||||
component: PageStory,
|
component: PageStory
|
||||||
parameters: {
|
} satisfies Meta<typeof PageStory>;
|
||||||
viewMode: "story",
|
|
||||||
previewTabs: {
|
|
||||||
"storybook/docs/panel": {
|
|
||||||
hidden: true
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
export default meta;
|
export default meta;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user