Skip to content

Commit

Permalink
Add some pydis styling
Browse files Browse the repository at this point in the history
  • Loading branch information
jb3 committed Aug 24, 2024
1 parent 8826a5c commit 4f8835a
Show file tree
Hide file tree
Showing 40 changed files with 7,235 additions and 5,828 deletions.
4 changes: 3 additions & 1 deletion .storybook/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@ import type { StorybookConfig } from "@storybook/react-vite";

const config: StorybookConfig = {
stories: ["../src/**/*.mdx", "../src/**/*.stories.@(js|jsx|mjs|ts|tsx)"],
addons: [],
addons: [
'@storybook/addon-viewport'
],
framework: {
name: "@storybook/react-vite",
options: {}
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
"react-dom": "^18.2.0"
},
"devDependencies": {
"storybook": "^8.1.10",
"@storybook/addon-viewport": "^8.2.9",
"@storybook/react": "^8.1.10",
"@storybook/react-vite": "^8.1.10",
"@types/react": "^18.2.43",
Expand All @@ -35,6 +35,7 @@
"eslint-plugin-react-refresh": "^0.4.5",
"eslint-plugin-storybook": "^0.8.0",
"prettier": "3.3.1",
"storybook": "^8.1.10",
"typescript": "^5.2.2",
"vite": "^5.0.8"
}
Expand Down
6,024 changes: 6,024 additions & 0 deletions pnpm-lock.yaml

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions src/login/KcContext.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import type { KcEnvName, ThemeName } from "../kc.gen";
export type KcContextExtension = {
themeName: ThemeName;
properties: Record<KcEnvName, string> & {};
realm: Record<KcEnvName, string> & {};
};

export type KcContextExtensionPerPage = {};
Expand Down
3 changes: 3 additions & 0 deletions src/login/KcPageStory.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ const kcContextExtension: KcContextExtension = {
themeName: themeNames[0],
properties: {
...kcEnvDefaults
},
realm: {
displayNameHtml: '<div class="kc-logo-text"><span>Python Discord</span></div>',
}
};
const kcContextExtensionPerPage: KcContextExtensionPerPage = {};
Expand Down
18 changes: 18 additions & 0 deletions src/login/pages/Code.stories.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import React from "react";
import type { Meta, StoryObj } from "@storybook/react";
import { createKcPageStory } from "../KcPageStory";

const { KcPageStory } = createKcPageStory({ pageId: "code.ftl" });

const meta = {
title: "login/code.ftl",
component: KcPageStory
} satisfies Meta<typeof KcPageStory>;

export default meta;

type Story = StoryObj<typeof meta>;

export const Default: Story = {
render: () => <KcPageStory />
};
18 changes: 18 additions & 0 deletions src/login/pages/DeleteAccountConfirm.stories.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import React from "react";
import type { Meta, StoryObj } from "@storybook/react";
import { createKcPageStory } from "../KcPageStory";

const { KcPageStory } = createKcPageStory({ pageId: "delete-account-confirm.ftl" });

const meta = {
title: "login/delete-account-confirm.ftl",
component: KcPageStory
} satisfies Meta<typeof KcPageStory>;

export default meta;

type Story = StoryObj<typeof meta>;

export const Default: Story = {
render: () => <KcPageStory />
};
18 changes: 18 additions & 0 deletions src/login/pages/DeleteCredential.stories.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import React from "react";
import type { Meta, StoryObj } from "@storybook/react";
import { createKcPageStory } from "../KcPageStory";

const { KcPageStory } = createKcPageStory({ pageId: "delete-credential.ftl" });

const meta = {
title: "login/delete-credential.ftl",
component: KcPageStory
} satisfies Meta<typeof KcPageStory>;

export default meta;

type Story = StoryObj<typeof meta>;

export const Default: Story = {
render: () => <KcPageStory />
};
28 changes: 28 additions & 0 deletions src/login/pages/Error.stories.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import React from "react";
import type { Meta, StoryObj } from "@storybook/react";
import { createKcPageStory } from "../KcPageStory";

const { KcPageStory } = createKcPageStory({ pageId: "error.ftl" });

const meta = {
title: "login/error.ftl",
component: KcPageStory
} satisfies Meta<typeof KcPageStory>;

export default meta;

type Story = StoryObj<typeof meta>;

export const Default: Story = {
render: () => <KcPageStory />
};

export const WithAnotherMessage: Story = {
render: () => (
<KcPageStory
kcContext={{
message: { summary: "With another error message" }
}}
/>
)
};
18 changes: 18 additions & 0 deletions src/login/pages/FrontchannelLogout.stories.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import React from "react";
import type { Meta, StoryObj } from "@storybook/react";
import { createKcPageStory } from "../KcPageStory";

const { KcPageStory } = createKcPageStory({ pageId: "frontchannel-logout.ftl" });

const meta = {
title: "login/frontchannel-logout.ftl",
component: KcPageStory
} satisfies Meta<typeof KcPageStory>;

export default meta;

type Story = StoryObj<typeof meta>;

export const Default: Story = {
render: () => <KcPageStory />
};
18 changes: 18 additions & 0 deletions src/login/pages/IdpReviewUserProfile.stories.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import React from "react";
import type { Meta, StoryObj } from "@storybook/react";
import { createKcPageStory } from "../KcPageStory";

const { KcPageStory } = createKcPageStory({ pageId: "idp-review-user-profile.ftl" });

const meta = {
title: "login/idp-review-user-profile.ftl",
component: KcPageStory
} satisfies Meta<typeof KcPageStory>;

export default meta;

type Story = StoryObj<typeof meta>;

export const Default: Story = {
render: () => <KcPageStory />
};
57 changes: 57 additions & 0 deletions src/login/pages/Info.stories.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
import React from "react";
import type { Meta, StoryObj } from "@storybook/react";
import { createKcPageStory } from "../KcPageStory";

const { KcPageStory } = createKcPageStory({ pageId: "info.ftl" });

const meta = {
title: "login/info.ftl",
component: KcPageStory
} satisfies Meta<typeof KcPageStory>;

export default meta;

type Story = StoryObj<typeof meta>;

export const Default: Story = {
render: () => (
<KcPageStory
kcContext={{
message: {
summary: "Server info message"
}
}}
/>
)
};

export const WithLinkBack: Story = {
render: () => (
<KcPageStory
kcContext={{
message: {
summary: "Server message"
},
actionUri: undefined
}}
/>
)
};

export const WithRequiredActions: Story = {
render: () => (
<KcPageStory
kcContext={{
message: {
summary: "Required actions: "
},
requiredActions: ["CONFIGURE_TOTP", "UPDATE_PROFILE", "VERIFY_EMAIL", "CUSTOM_ACTION"],
"x-keycloakify": {
messages: {
"requiredAction.CUSTOM_ACTION": "Custom action"
}
}
}}
/>
)
};
Loading

0 comments on commit 4f8835a

Please sign in to comment.