Skip to content

Infisical is the open-source platform for securing secrets, certificates, access, and AI Agents.

improvement: use display font for access restricted title and add stories

Scott Wilson8d7580d29810
diff --git a/frontend/src/components/v3/platform/AccessRestricted/AccessRestrictedDialog.stories.tsx b/frontend/src/components/v3/platform/AccessRestricted/AccessRestrictedDialog.stories.tsx
new file mode 100644
index 0000000000..c31981ff1b
--- /dev/null
+++ b/frontend/src/components/v3/platform/AccessRestricted/AccessRestrictedDialog.stories.tsx
@@ -0,0 +1,85 @@
+import type { Meta, StoryObj } from "@storybook/react-vite";
+
+import { Button } from "../../generic/Button";
+import { AccessRestrictedDialog } from "./AccessRestrictedDialog";
+
+const meta = {
+ title: "Platform/Access Restricted Dialog",
+ component: AccessRestrictedDialog,
+ parameters: {
+ layout: "padded"
+ },
+ decorators: [
+ (Story) => (
+ <div className="w-full max-w-6xl">
+ <Story />
+ </div>
+ )
+ ],
+ tags: ["autodocs"]
+} satisfies Meta<typeof AccessRestrictedDialog>;
+
+export default meta;
+type Story = StoryObj<typeof meta>;
+
+export const Default: Story = {
+ parameters: {
+ docs: {
+ description: {
+ story:
+ "Use as the page- or tab-level permission gate: a dialog-look panel floating over a redacted stand-in for the gated content. It renders in normal document flow, so the surrounding page chrome stays usable by both pointer and keyboard."
+ }
+ }
+ }
+};
+
+export const WithRequirement: Story = {
+ name: "Example: With Requirement",
+ args: {
+ requirement: {
+ action: "read",
+ subject: "audit-logs"
+ }
+ },
+ parameters: {
+ docs: {
+ description: {
+ story:
+ "Pass the missing CASL action/subject so an operator can hand the exact permission to whoever edits their role. Permission gates derive this via toPermissionRequirement."
+ }
+ }
+ }
+};
+
+export const WithAction: Story = {
+ name: "Example: With Action",
+ args: {
+ requirement: {
+ action: "read",
+ subject: "project"
+ },
+ action: <Button variant="project">Request Access</Button>
+ },
+ parameters: {
+ docs: {
+ description: {
+ story:
+ "Surfaces with a self-serve flow (e.g. request access) can append a call to action after the standard navigation buttons."
+ }
+ }
+ }
+};
+
+export const CustomCopy: Story = {
+ name: "Example: Custom Copy",
+ args: {
+ description: "Only project admins can view and manage certificate approval policies."
+ },
+ parameters: {
+ docs: {
+ description: {
+ story: "Override the description when the page has a more specific access rule."
+ }
+ }
+ }
+};
diff --git a/frontend/src/components/v3/platform/AccessRestricted/AccessRestrictedDialog.tsx b/frontend/src/components/v3/platform/AccessRestricted/AccessRestrictedDialog.tsx
index 3d247f588a..d9d26bc860 100644
--- a/frontend/src/components/v3/platform/AccessRestricted/AccessRestrictedDialog.tsx
+++ b/frontend/src/components/v3/platform/AccessRestricted/AccessRestrictedDialog.tsx
@@ -115,7 +115,8 @@ export const AccessRestrictedDialog = ({
<LockIcon />
Access Restricted
</Badge>
- <h2 id={titleId} className="text-3xl leading-tight font-semibold">
+ {/* Alliance ships only weight 400, so font-normal rather than a faux-bolded semibold. */}
+ <h2 id={titleId} className="font-alliance text-3xl leading-tight font-normal">
{title}
<br />
<span className="text-2xl">{subtitle}</span>
diff --git a/frontend/src/components/v3/platform/AccessRestricted/AccessRestrictedNotice.stories.tsx b/frontend/src/components/v3/platform/AccessRestricted/AccessRestrictedNotice.stories.tsx
new file mode 100644
index 0000000000..1e579630cf
--- /dev/null
+++ b/frontend/src/components/v3/platform/AccessRestricted/AccessRestrictedNotice.stories.tsx
@@ -0,0 +1,48 @@
+import type { Meta, StoryObj } from "@storybook/react-vite";
+
+import { AccessRestrictedNotice } from "./AccessRestrictedNotice";
+
+const meta = {
+ title: "Platform/Access Restricted Notice",
+ component: AccessRestrictedNotice,
+ parameters: {
+ layout: "padded"
+ },
+ decorators: [
+ (Story) => (
+ <div className="w-full max-w-4xl">
+ <Story />
+ </div>
+ )
+ ],
+ tags: ["autodocs"]
+} satisfies Meta<typeof AccessRestrictedNotice>;
+
+export default meta;
+type Story = StoryObj<typeof meta>;
+
+export const Default: Story = {
+ parameters: {
+ docs: {
+ description: {
+ story:
+ "Use for a single restricted section inside an otherwise usable page; it sits where the section's content would go. Page- and tab-level gates use AccessRestrictedDialog instead."
+ }
+ }
+ }
+};
+
+export const CustomCopy: Story = {
+ name: "Example: Custom Copy",
+ args: {
+ title: "Audit Logs Restricted",
+ description: "Your role doesn't include permission to view this user's audit logs."
+ },
+ parameters: {
+ docs: {
+ description: {
+ story: "Override the title and description when the section has a more specific message."
+ }
+ }
+ }
+};