Skip to content

A reactive notebook for Python — run reproducible experiments, query with SQL, execute as a script, deploy as an app, and version with git. Stored as pure Python. All in a modern, AI-native editor.

fix: storybook builds (#1124)

Myles Scolnicka375ad20946b
diff --git a/frontend/package.json b/frontend/package.json
index 19d98d0636..bb841e134a 100644
--- a/frontend/package.json
+++ b/frontend/package.json
@@ -156,7 +156,7 @@
"@storybook/addon-essentials": "^8.0.5",
"@storybook/addon-interactions": "^8.0.5",
"@storybook/addon-links": "^8.0.5",
- "@storybook/blocks": "^8.0.5",
+ "@storybook/blocks": "^8.0.8",
"@storybook/react": "^8.0.5",
"@storybook/react-vite": "^8.0.5",
"@storybook/testing-library": "^0.2.2",
diff --git a/frontend/pnpm-lock.yaml b/frontend/pnpm-lock.yaml
index d6bafaab7f..62451dda13 100644
--- a/frontend/pnpm-lock.yaml
+++ b/frontend/pnpm-lock.yaml
@@ -356,7 +356,7 @@ devDependencies:
specifier: ^8.0.5
version: 8.0.8([email protected])
'@storybook/blocks':
- specifier: ^8.0.5
+ specifier: ^8.0.8
'@storybook/react':
specifier: ^8.0.5
diff --git a/frontend/src/stories/number-field.mdx b/frontend/src/stories/number-field.mdx
new file mode 100644
index 0000000000..1e0a4a3840
--- /dev/null
+++ b/frontend/src/stories/number-field.mdx
@@ -0,0 +1,17 @@
+import { Meta, Story } from "@storybook/blocks";
+import * as NumberFieldStories from './number-field.stories';
+
+import { NumberField } from "@/components/ui/number-field";
+import { Label } from "@/components/ui/label";
+
+<Meta of={NumberFieldStories} />
+
+# NumberField
+
+<Story of={NumberFieldStories.Default} />
+
+<Story of={NumberFieldStories.Disabled} />
+
+<Story of={NumberFieldStories.WithLabel} />
+
+<Story of={NumberFieldStories.MinAndMax} />
diff --git a/frontend/src/stories/number-field.stories.mdx b/frontend/src/stories/number-field.stories.mdx
deleted file mode 100644
index 8fd6ca8874..0000000000
--- a/frontend/src/stories/number-field.stories.mdx
+++ /dev/null
@@ -1,30 +0,0 @@
-import { Meta, Story } from "@storybook/addon-docs";
-
-import { NumberField } from "@/components/ui/number-field";
-import { Label } from "@/components/ui/label";
-
-<Meta title="NumberField" component={NumberField} />
-
-# NumberField
-
-<Story name="Default">
- <NumberField placeholder="..." />
-</Story>
-
-<Story name="Disabled">
- <NumberField placeholder="..." isDisabled />
-</Story>
-
-<Story name="With Label">
- <div className="grid w-full gap-1.5">
- <Label htmlFor="message">Your message</Label>
- <NumberField placeholder="..." id="message" />
- </div>
-</Story>
-
-<Story name="Min and Max">
- <div className="grid w-full gap-1.5">
- <NumberField placeholder="..." minValue={-10} maxValue={100} />
- <NumberField placeholder="..." minValue={10} maxValue={100} />
- </div>
-</Story>
diff --git a/frontend/src/stories/number-field.stories.tsx b/frontend/src/stories/number-field.stories.tsx
new file mode 100644
index 0000000000..6270b8ff5b
--- /dev/null
+++ b/frontend/src/stories/number-field.stories.tsx
@@ -0,0 +1,40 @@
+/* Copyright 2024 Marimo. All rights reserved. */
+import { NumberField } from "@/components/ui/number-field";
+import { Label } from "@/components/ui/label";
+
+export default {
+ title: "NumberField",
+ component: NumberField,
+};
+
+export const Default = {
+ render: () => <NumberField placeholder="..." />,
+ name: "Default",
+};
+
+export const Disabled = {
+ render: () => <NumberField placeholder="..." isDisabled={true} />,
+ name: "Disabled",
+};
+
+export const WithLabel = {
+ render: () => (
+ <div className="grid w-full gap-1.5">
+ <Label htmlFor="message">Your message</Label>
+ <NumberField placeholder="..." id="message" />
+ </div>
+ ),
+
+ name: "With Label",
+};
+
+export const MinAndMax = {
+ render: () => (
+ <div className="grid w-full gap-1.5">
+ <NumberField placeholder="..." minValue={-10} maxValue={100} />
+ <NumberField placeholder="..." minValue={10} maxValue={100} />
+ </div>
+ ),
+
+ name: "Min and Max",
+};