diff --git a/apps/storybook/.gitignore b/apps/storybook/.gitignore
index 8c444bd2f4..5689902ae1 100644
--- a/apps/storybook/.gitignore
+++ b/apps/storybook/.gitignore
@@ -8,7 +8,9 @@ pnpm-debug.log*
lerna-debug.log*
node_modules
-storybook-static
+storybook-static/*
+!storybook-static/favicon.ico
+!storybook-static/sb-cover.jpg
dist
dist-ssr
*.local
diff --git a/apps/storybook/.storybook/main.js b/apps/storybook/.storybook/main.ts
similarity index 66%
rename from apps/storybook/.storybook/main.js
rename to apps/storybook/.storybook/main.ts
index 5fa1ab07ce..bc68cb15c0 100644
--- a/apps/storybook/.storybook/main.js
+++ b/apps/storybook/.storybook/main.ts
@@ -1,14 +1,16 @@
-import { dirname, join } from "path";
+import type { StorybookConfig } from "@storybook/nextjs";
+import path, { dirname, join } from "path";
-const path = require("path");
-
-module.exports = {
+const config: StorybookConfig = {
stories: [
"../intro.stories.mdx",
- "../../../packages/ui/components/**/*.stories.mdx",
- "../../../packages/atoms/**/*.stories.mdx",
- "../../../packages/features/**/*.stories.mdx",
+ "../../../packages/ui/components/**/*.stories.mdx", // legacy SB6 stories
"../../../packages/ui/components/**/*.stories.@(js|jsx|ts|tsx)",
+ "../../../packages/ui/components/**/*.docs.mdx",
+ "../../../packages/features/**/*.stories.@(js|jsx|ts|tsx)",
+ "../../../packages/features/**/*.docs.mdx",
+ "../../../packages/atoms/**/*.stories.@(js|jsx|ts|tsx)",
+ "../../../packages/atoms/**/*.docs.mdx",
],
addons: [
@@ -17,23 +19,23 @@ module.exports = {
getAbsolutePath("@storybook/addon-interactions"),
getAbsolutePath("storybook-addon-rtl-direction"),
getAbsolutePath("storybook-react-i18next"),
- getAbsolutePath("@storybook/addon-mdx-gfm"),
],
framework: {
- name: getAbsolutePath("@storybook/nextjs"),
+ name: getAbsolutePath("@storybook/nextjs") as "@storybook/nextjs",
options: {
- builder: {
- fsCache: true,
- lazyCompilation: true,
- },
+ // builder: {
+ // fsCache: true,
+ // lazyCompilation: true,
+ // },
},
},
staticDirs: ["../public"],
webpackFinal: async (config, { configType }) => {
+ config.resolve = config.resolve || {};
config.resolve.fallback = {
fs: false,
assert: false,
@@ -61,6 +63,8 @@ module.exports = {
zlib: false,
};
+ config.module = config.module || {};
+ config.module.rules = config.module.rules || [];
config.module.rules.push({
test: /\.css$/,
use: [
@@ -85,6 +89,8 @@ module.exports = {
},
};
+export default config;
+
function getAbsolutePath(value) {
return dirname(require.resolve(join(value, "package.json")));
}
diff --git a/apps/storybook/.storybook/preview.jsx b/apps/storybook/.storybook/preview.jsx
deleted file mode 100644
index 0ff662d639..0000000000
--- a/apps/storybook/.storybook/preview.jsx
+++ /dev/null
@@ -1,44 +0,0 @@
-import { I18nextProvider } from "react-i18next";
-
-import "../styles/globals.css";
-import "../styles/storybook-styles.css";
-import i18n from "./i18next";
-
-export const parameters = {
- actions: { argTypesRegex: "^on[A-Z].*" },
- controls: {
- matchers: {
- color: /(background|color)$/i,
- date: /Date$/,
- },
- },
-
- globals: {
- locale: "en",
- locales: {
- en: "English",
- fr: "Français",
- },
- },
- i18n,
-};
-
-const withI18next = (Story) => (
-
-
-
-
-
-);
-
-export const decorators = [withI18next];
-
-window.getEmbedNamespace = () => {
- const url = new URL(document.URL);
- const namespace = url.searchParams.get("embed");
- return namespace;
-};
-
-window.getEmbedTheme = () => {
- return "auto";
-};
diff --git a/apps/storybook/.storybook/preview.tsx b/apps/storybook/.storybook/preview.tsx
new file mode 100644
index 0000000000..620f7a9ff6
--- /dev/null
+++ b/apps/storybook/.storybook/preview.tsx
@@ -0,0 +1,73 @@
+// adds tooltip context to all stories
+import { TooltipProvider } from "@radix-ui/react-tooltip";
+import type { Preview } from "@storybook/react";
+import React from "react";
+import { I18nextProvider } from "react-i18next";
+
+import type { EmbedThemeConfig } from "@calcom/embed-core/src/types";
+// adds trpc context to all stories (esp. booker)
+import { StorybookTrpcProvider } from "@calcom/ui";
+
+import "../styles/globals.css";
+import "../styles/storybook-styles.css";
+import i18n from "./i18next";
+
+const preview: Preview = {
+ parameters: {
+ actions: { argTypesRegex: "^on[A-Z].*" },
+
+ controls: {
+ matchers: {
+ color: /(background|color)$/i,
+ date: /Date$/,
+ },
+ },
+
+ globals: {
+ locale: "en",
+ locales: {
+ en: "English",
+ fr: "Français",
+ },
+ },
+
+ i18n,
+
+ nextjs: {
+ appDirectory: true,
+ },
+ },
+
+ decorators: [
+ (Story) => (
+
+
+
+
+
+
+
+
+
+ ),
+ ],
+};
+
+export default preview;
+
+declare global {
+ interface Window {
+ getEmbedNamespace: () => string | null;
+ getEmbedTheme: () => EmbedThemeConfig | null;
+ }
+}
+
+window.getEmbedNamespace = () => {
+ const url = new URL(document.URL);
+ const namespace = url.searchParams.get("embed");
+ return namespace;
+};
+
+window.getEmbedTheme = () => {
+ return "auto";
+};
diff --git a/apps/storybook/components/CustomArgsTable.tsx b/apps/storybook/components/CustomArgsTable.tsx
index e8feabf577..1bb51bbdd9 100644
--- a/apps/storybook/components/CustomArgsTable.tsx
+++ b/apps/storybook/components/CustomArgsTable.tsx
@@ -1,6 +1,6 @@
import { ArgsTable } from "@storybook/addon-docs";
-import { SortType } from "@storybook/components";
-import { PropDescriptor } from "@storybook/store";
+import type { SortType } from "@storybook/blocks";
+import type { PropDescriptor } from "@storybook/preview-api";
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- ignore storybook addon types component as any so we have to do
type Component = any;
diff --git a/apps/storybook/package.json b/apps/storybook/package.json
index 1b16a80ca3..0cc7d6cb30 100644
--- a/apps/storybook/package.json
+++ b/apps/storybook/package.json
@@ -20,7 +20,10 @@
"@radix-ui/react-slider": "^1.0.0",
"@radix-ui/react-switch": "^1.0.0",
"@radix-ui/react-tooltip": "^1.0.0",
+ "@storybook/addon-docs": "^7.6.3",
+ "@storybook/blocks": "^7.6.3",
"@storybook/nextjs": "^7.6.3",
+ "@storybook/preview-api": "^7.6.3",
"next": "^13.4.6",
"react": "^18.2.0",
"react-dom": "^18.2.0",
@@ -33,7 +36,6 @@
"@storybook/addon-essentials": "^7.6.3",
"@storybook/addon-interactions": "^7.6.3",
"@storybook/addon-links": "^7.6.3",
- "@storybook/addon-mdx-gfm": "^7.6.3",
"@storybook/nextjs": "^7.6.3",
"@storybook/react": "^7.6.3",
"@storybook/testing-library": "^0.2.2",
diff --git a/packages/atoms/booker/Booker.docs.mdx b/packages/atoms/booker/Booker.docs.mdx
new file mode 100644
index 0000000000..f92c09c954
--- /dev/null
+++ b/packages/atoms/booker/Booker.docs.mdx
@@ -0,0 +1,12 @@
+import { Meta, Canvas, ArgsTable } from "@storybook/blocks";
+import { Title } from "@calcom/storybook/components";
+import { Booker } from "./Booker";
+import * as BookerStories from "./Booker.stories";
+
+
+
+
+
+
+
+