Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
86 changes: 86 additions & 0 deletions packages/react-ui/src/components/Label/stories/Label.stories.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
import type { Meta, StoryObj } from "@storybook/react";
import { Label } from "../Label";

type Story = StoryObj<typeof Label>;

export const Default: Story = {
args: {
children: "Just a label",
required: false,
disabled: false,
className: "openui-label",
style: { color: "black" },
},
parameters: {
docs: {
description: {
story: "A basic label component.",
},
},
},
};

export const Required: Story = {
args: {
children: "Required label",
required: true,
disabled: false,
},
parameters: {
docs: {
description: {
story: "A label with a required indicator.",
},
},
},
};

export const Disabled: Story = {
args: {
children: "Disabled label",
required: false,
disabled: true,
},
parameters: {
docs: {
description: {
story: "A disabled label state.",
},
},
},
};

const meta: Meta<typeof Label> = {
title: "Components/Label",
component: Label,
parameters: {
layout: "centered",
docs: {
description: {
component: "```tsx\nimport { Label } from '@openuidev/react-ui';\n```",
},
},
},
argTypes: {
children: {
control: "text",
},
required: {
control: "boolean",
table: {
category: "State",
defaultValue: { summary: "false" },
},
},
disabled: {
control: "boolean",
table: {
category: "State",
defaultValue: { summary: "false" },
},
},
},
tags: ["autodocs", "!dev"],
};

export default meta;
76 changes: 76 additions & 0 deletions packages/react-ui/src/components/Modal/stories/Modal.stories.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
import type { Meta, StoryObj } from "@storybook/react";
import { useState } from "react";
import { Button } from "../../Button";
import { Modal } from "../Modal";

type Story = StoryObj<typeof Modal>;

export const Default: Story = {
args: {
title: "Modal title",
children: "This is the modal content.",
size: "md",
},
render: (args) => {
const [open, setOpen] = useState(false);

return (
<>
<Button onClick={() => setOpen(true)} variant="primary">
Open modal
</Button>

<Modal title={args.title} size={args.size} open={open} onOpenChange={setOpen}>
{args.children}
</Modal>
</>
);
},
parameters: {
docs: {
description: {
story: "A basic modal component opened by a button.",
},
},
},
};

const meta: Meta<typeof Modal> = {
title: "Components/Modal",
component: Modal,
parameters: {
layout: "centered",
docs: {
description: {
component: "```tsx\nimport { Modal } from '@openuidev/react-ui';\n```",
},
},
controls: {
exclude: ["open", "onOpenChange"],
},
},
argTypes: {
title: {
control: "text",
},
children: {
control: "text",
},
size: {
control: "radio",
options: ["sm", "md", "lg"],
table: {
defaultValue: { summary: "md" },
},
},
open: {
control: false,
table: {
disable: true,
},
},
},
tags: ["autodocs", "!dev"],
};

export default meta;
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
import type { Meta, StoryObj } from "@storybook/react";
import { SectionV2 } from "../SectionV2";

type Story = StoryObj<typeof SectionV2>;

export const Default: Story = {
args: {
trigger: "Section title",
children: "This is the section content.",
},
parameters: {
docs: {
description: {
story: "A basic section block with a trigger and content.",
},
},
},
};

export const WithLongContent: Story = {
args: {
trigger: "Details",
children: "This section can be used to group related content under a visual section heading.",
},
parameters: {
docs: {
description: {
story: "A section block with longer content.",
},
},
},
};

const meta: Meta<typeof SectionV2> = {
title: "Components/SectionBlock",
component: SectionV2,
parameters: {
layout: "centered",
docs: {
description: {
component: "```tsx\nimport { SectionV2 } from '@openuidev/react-ui';\n```",
},
},
},
argTypes: {
trigger: {
control: "text",
},
children: {
control: "text",
},
},
tags: ["autodocs", "!dev"],
};

export default meta;
Loading
Loading