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.

Add variables to storybook (#73)

Myles Scolnick5723806bb35a
diff --git a/frontend/.storybook/sb.css b/frontend/.storybook/sb.css
index 8c2be027bd..e09e2c595a 100644
--- a/frontend/.storybook/sb.css
+++ b/frontend/.storybook/sb.css
@@ -3,3 +3,11 @@
gap: 20px;
flex-direction: column;
}
+
+.sbdocs.sbdocs-wrapper {
+ @apply bg-background text-foreground;
+}
+
+.sbdocs.sbdocs-wrapper h1 {
+ @apply text-foreground !important;
+}
diff --git a/frontend/src/css/md.css b/frontend/src/css/md.css
index 0b388a3170..cac6f73e49 100644
--- a/frontend/src/css/md.css
+++ b/frontend/src/css/md.css
@@ -140,8 +140,9 @@
}
.markdown a {
- color: hsl(var(--link));
cursor: pointer;
+
+ @apply text-link;
}
.markdown a:hover,
@@ -150,7 +151,7 @@
}
.markdown a:visited {
- color: hsl(var(--link-visited));
+ @apply text-link-visited;
}
.markdown blockquote {
diff --git a/frontend/src/stories/cell.stories.tsx b/frontend/src/stories/cell.stories.tsx
index 25a0234aea..a45eb7a3ab 100644
--- a/frontend/src/stories/cell.stories.tsx
+++ b/frontend/src/stories/cell.stories.tsx
@@ -5,6 +5,7 @@ import { TooltipProvider } from "../components/ui/tooltip";
import { CellId } from "../core/model/ids";
const meta: Meta<typeof Cell> = {
+ title: "Cell",
component: Cell,
args: {},
};
diff --git a/frontend/src/stories/colors.stories.tsx b/frontend/src/stories/colors.stories.tsx
new file mode 100644
index 0000000000..18ac87c096
--- /dev/null
+++ b/frontend/src/stories/colors.stories.tsx
@@ -0,0 +1,136 @@
+/* Copyright 2023 Marimo. All rights reserved. */
+import { Meta, StoryObj } from "@storybook/react";
+
+const COLORS = [
+ "bg-background",
+ "bg-foreground",
+ "bg-muted",
+ "bg-muted-foreground",
+ "bg-popover",
+ "bg-popover-foreground",
+ "bg-card",
+ "bg-card-foreground",
+ "bg-border",
+ "bg-input",
+ "bg-primary",
+ "bg-primary-foreground",
+ "bg-secondary",
+ "bg-secondary-foreground",
+ "bg-accent",
+ "bg-accent-foreground",
+ "bg-destructive",
+ "bg-destructive-foreground",
+ "bg-error",
+ "bg-error-foreground",
+ "bg-success",
+ "bg-success-foreground",
+ "bg-action",
+ "bg-action-hover",
+ "bg-action-foreground",
+ "bg-link",
+ "bg-link-visited",
+ "bg-ring",
+];
+
+const meta: Meta = {
+ title: "Variables",
+ args: {},
+};
+
+export default meta;
+
+export const Colors: StoryObj = {
+ render: () => {
+ return (
+ <div className="grid grid-cols-5 gap-4 p-4">
+ {COLORS.map((color) => (
+ <div
+ key={color}
+ className="flex flex-col items-center justify-center gap-2"
+ >
+ <div
+ className={`h-24 w-24 rounded-md ${color} flex items-center justify-center border`}
+ />
+ <span className="text-sm text-center">{color.slice(3)}</span>
+ </div>
+ ))}
+ </div>
+ );
+ },
+};
+
+const ROUND = [
+ "rounded-none",
+ "rounded-sm",
+ "rounded-md",
+ "rounded-lg",
+ "rounded-xl",
+ "rounded-2xl",
+ "rounded-3xl",
+ "rounded-full",
+];
+
+export const Round: StoryObj = {
+ render: () => {
+ return (
+ <div className="grid grid-cols-5 gap-4 p-4">
+ {ROUND.map((round) => (
+ <div
+ key={round}
+ className="flex flex-col items-center justify-center gap-2"
+ >
+ <div
+ className={`h-24 w-24 bg-muted flex items-center justify-center border ${round}`}
+ />
+ <span className="text-sm text-center">{round.slice(8)}</span>
+ </div>
+ ))}
+ </div>
+ );
+ },
+};
+
+const SHADOWS = [
+ "shadow-xs",
+ "shadow-sm",
+ "shadow-md",
+ "shadow-lg",
+ "shadow-xl",
+ "shadow-2xl",
+ "shadow-inner",
+ "shadow-none",
+];
+const SOLID_SHADOWS = [
+ "shadow-xsSolid",
+ "shadow-smSolid",
+ "shadow-mdSolid",
+ "shadow-lgSolid",
+ "shadow-xlSolid",
+ "shadow-2xlSolid",
+];
+
+export const Shadows: StoryObj = {
+ render: () => {
+ const renderShadows = (shadows: string[]) => (
+ <div className="grid grid-cols-5 gap-4 p-4">
+ {shadows.map((shadow) => (
+ <div
+ key={shadow}
+ className="flex flex-col items-center justify-center gap-2"
+ >
+ <div
+ className={`h-24 w-24 bg-muted flex items-center justify-center border ${shadow}`}
+ />
+ <span className="text-sm text-center">{shadow.slice(7)}</span>
+ </div>
+ ))}
+ </div>
+ );
+ return (
+ <div className="flex flex-col">
+ {renderShadows(SHADOWS)}
+ {renderShadows(SOLID_SHADOWS)}
+ </div>
+ );
+ },
+};
diff --git a/frontend/tailwind.config.js b/frontend/tailwind.config.js
index 80f0d6e4c7..61f8c3fc7f 100644
--- a/frontend/tailwind.config.js
+++ b/frontend/tailwind.config.js
@@ -45,6 +45,8 @@ module.exports = {
ring: "hsl(var(--ring) / <alpha-value>)",
background: "hsl(var(--background) / <alpha-value>)",
foreground: "hsl(var(--foreground) / <alpha-value>)",
+ link: "hsl(var(--link))",
+ "link-visited": "hsl(var(--link-visited))",
primary: {
DEFAULT: "hsl(var(--primary) / <alpha-value>)",
foreground: "hsl(var(--primary-foreground) / <alpha-value>)",