Skip to content

Open source website builder and Webflow alternative. Webstudio is an advanced visual builder that connects to any headless CMS, supports all CSS properties, and can be hosted anywhere, including with us.

Add stories for TextField

Andrey Okonetchnikov12cdd55171d7
diff --git a/packages/design-system/src/components/text-field.stories.tsx b/packages/design-system/src/components/text-field.stories.tsx
new file mode 100644
index 0000000000..9b2a57695f
--- /dev/null
+++ b/packages/design-system/src/components/text-field.stories.tsx
@@ -0,0 +1,53 @@
+import React from "react";
+import { ComponentStory } from "@storybook/react";
+import { TextField } from "./text-field";
+import { Flex } from "./flex";
+
+export default {
+ component: TextField,
+};
+
+export const Default: ComponentStory<typeof TextField> = () => {
+ return <TextField />;
+};
+
+export const Type: ComponentStory<typeof TextField> = () => {
+ return <TextField type="number" />;
+};
+
+export const Sizes: ComponentStory<typeof TextField> = () => {
+ return (
+ <Flex direction="column" gap={3}>
+ <TextField size={1} />
+ <TextField size={2} />
+ </Flex>
+ );
+};
+
+export const Variants: ComponentStory<typeof TextField> = () => {
+ return (
+ <Flex direction="column" gap={3}>
+ <TextField />
+ <TextField variant="ghost" />
+ </Flex>
+ );
+};
+
+export const State: ComponentStory<typeof TextField> = () => {
+ return (
+ <Flex direction="column" gap={3}>
+ <TextField />
+ <TextField state="invalid" />
+ <TextField state="valid" />
+ </Flex>
+ );
+};
+
+export const Cursor: ComponentStory<typeof TextField> = () => {
+ return (
+ <Flex direction="column" gap={3}>
+ <TextField cursor="default" />
+ <TextField cursor="text" />
+ </Flex>
+ );
+};