@storybook/nextjs-vite 11.0.0-alpha.8 → 11.0.0-beta.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,10 +1,10 @@
1
- import CJS_COMPAT_NODE_URL_ojhqsgimw5j from 'node:url';
2
- import CJS_COMPAT_NODE_PATH_ojhqsgimw5j from 'node:path';
3
- import CJS_COMPAT_NODE_MODULE_ojhqsgimw5j from "node:module";
1
+ import CJS_COMPAT_NODE_URL_jo41gwj9z4q from 'node:url';
2
+ import CJS_COMPAT_NODE_PATH_jo41gwj9z4q from 'node:path';
3
+ import CJS_COMPAT_NODE_MODULE_jo41gwj9z4q from "node:module";
4
4
 
5
- var __filename = CJS_COMPAT_NODE_URL_ojhqsgimw5j.fileURLToPath(import.meta.url);
6
- var __dirname = CJS_COMPAT_NODE_PATH_ojhqsgimw5j.dirname(__filename);
7
- var require = CJS_COMPAT_NODE_MODULE_ojhqsgimw5j.createRequire(import.meta.url);
5
+ var __filename = CJS_COMPAT_NODE_URL_jo41gwj9z4q.fileURLToPath(import.meta.url);
6
+ var __dirname = CJS_COMPAT_NODE_PATH_jo41gwj9z4q.dirname(__filename);
7
+ var require = CJS_COMPAT_NODE_MODULE_jo41gwj9z4q.createRequire(import.meta.url);
8
8
 
9
9
  // ------------------------------------------------------------
10
10
  // end of CJS compatibility banner, injected by Storybook's esbuild configuration
@@ -14,7 +14,7 @@ import {
14
14
  __esm,
15
15
  __require,
16
16
  __toESM
17
- } from "./chunk-WFGLTBZJ.js";
17
+ } from "./chunk-SHLZ7EEE.js";
18
18
 
19
19
  // ../../../node_modules/tsx/dist/temporary-directory-CwHp0_NW.mjs
20
20
  import r from "node:path";
@@ -4830,7 +4830,7 @@ var import_esbuild, Pt, f2, Ne2, Ie2, Yt, Me2, $e2, Ue2, me2, ae2, ee2, nn2, rn2
4830
4830
  f2(Be, "u");
4831
4831
  f2(D, "o");
4832
4832
  typeof WebAssembly < "u" && (async () => {
4833
- let { parse: s4, init: e5 } = await import("./lexer-DQCqS3nf-MVVEBZEZ.js");
4833
+ let { parse: s4, init: e5 } = await import("./lexer-DQCqS3nf-IJUJWDAO.js");
4834
4834
  await e5, Se2 = s4;
4835
4835
  })();
4836
4836
  Pe2 = f2((s4, e5) => Se2 ? Se2(s4, e5) : fn2(s4, e5), "parseEsm"), gn = f2((s4) => {
@@ -1,10 +1,10 @@
1
- import CJS_COMPAT_NODE_URL_ojhqsgimw5j from 'node:url';
2
- import CJS_COMPAT_NODE_PATH_ojhqsgimw5j from 'node:path';
3
- import CJS_COMPAT_NODE_MODULE_ojhqsgimw5j from "node:module";
1
+ import CJS_COMPAT_NODE_URL_jo41gwj9z4q from 'node:url';
2
+ import CJS_COMPAT_NODE_PATH_jo41gwj9z4q from 'node:path';
3
+ import CJS_COMPAT_NODE_MODULE_jo41gwj9z4q from "node:module";
4
4
 
5
- var __filename = CJS_COMPAT_NODE_URL_ojhqsgimw5j.fileURLToPath(import.meta.url);
6
- var __dirname = CJS_COMPAT_NODE_PATH_ojhqsgimw5j.dirname(__filename);
7
- var require = CJS_COMPAT_NODE_MODULE_ojhqsgimw5j.createRequire(import.meta.url);
5
+ var __filename = CJS_COMPAT_NODE_URL_jo41gwj9z4q.fileURLToPath(import.meta.url);
6
+ var __dirname = CJS_COMPAT_NODE_PATH_jo41gwj9z4q.dirname(__filename);
7
+ var require = CJS_COMPAT_NODE_MODULE_jo41gwj9z4q.createRequire(import.meta.url);
8
8
 
9
9
  // ------------------------------------------------------------
10
10
  // end of CJS compatibility banner, injected by Storybook's esbuild configuration
@@ -1,10 +1,10 @@
1
- import CJS_COMPAT_NODE_URL_ojhqsgimw5j from 'node:url';
2
- import CJS_COMPAT_NODE_PATH_ojhqsgimw5j from 'node:path';
3
- import CJS_COMPAT_NODE_MODULE_ojhqsgimw5j from "node:module";
1
+ import CJS_COMPAT_NODE_URL_jo41gwj9z4q from 'node:url';
2
+ import CJS_COMPAT_NODE_PATH_jo41gwj9z4q from 'node:path';
3
+ import CJS_COMPAT_NODE_MODULE_jo41gwj9z4q from "node:module";
4
4
 
5
- var __filename = CJS_COMPAT_NODE_URL_ojhqsgimw5j.fileURLToPath(import.meta.url);
6
- var __dirname = CJS_COMPAT_NODE_PATH_ojhqsgimw5j.dirname(__filename);
7
- var require = CJS_COMPAT_NODE_MODULE_ojhqsgimw5j.createRequire(import.meta.url);
5
+ var __filename = CJS_COMPAT_NODE_URL_jo41gwj9z4q.fileURLToPath(import.meta.url);
6
+ var __dirname = CJS_COMPAT_NODE_PATH_jo41gwj9z4q.dirname(__filename);
7
+ var require = CJS_COMPAT_NODE_MODULE_jo41gwj9z4q.createRequire(import.meta.url);
8
8
 
9
9
  // ------------------------------------------------------------
10
10
  // end of CJS compatibility banner, injected by Storybook's esbuild configuration
@@ -12,7 +12,7 @@ var require = CJS_COMPAT_NODE_MODULE_ojhqsgimw5j.createRequire(import.meta.url);
12
12
  import {
13
13
  __commonJS,
14
14
  __require
15
- } from "./chunk-WFGLTBZJ.js";
15
+ } from "./chunk-SHLZ7EEE.js";
16
16
 
17
17
  // ../../../node_modules/yaml/dist/nodes/identity.js
18
18
  var require_identity = __commonJS({
@@ -1,10 +1,10 @@
1
- import CJS_COMPAT_NODE_URL_ojhqsgimw5j from 'node:url';
2
- import CJS_COMPAT_NODE_PATH_ojhqsgimw5j from 'node:path';
3
- import CJS_COMPAT_NODE_MODULE_ojhqsgimw5j from "node:module";
1
+ import CJS_COMPAT_NODE_URL_jo41gwj9z4q from 'node:url';
2
+ import CJS_COMPAT_NODE_PATH_jo41gwj9z4q from 'node:path';
3
+ import CJS_COMPAT_NODE_MODULE_jo41gwj9z4q from "node:module";
4
4
 
5
- var __filename = CJS_COMPAT_NODE_URL_ojhqsgimw5j.fileURLToPath(import.meta.url);
6
- var __dirname = CJS_COMPAT_NODE_PATH_ojhqsgimw5j.dirname(__filename);
7
- var require = CJS_COMPAT_NODE_MODULE_ojhqsgimw5j.createRequire(import.meta.url);
5
+ var __filename = CJS_COMPAT_NODE_URL_jo41gwj9z4q.fileURLToPath(import.meta.url);
6
+ var __dirname = CJS_COMPAT_NODE_PATH_jo41gwj9z4q.dirname(__filename);
7
+ var require = CJS_COMPAT_NODE_MODULE_jo41gwj9z4q.createRequire(import.meta.url);
8
8
 
9
9
  // ------------------------------------------------------------
10
10
  // end of CJS compatibility banner, injected by Storybook's esbuild configuration
@@ -14,7 +14,7 @@ import {
14
14
  __esm,
15
15
  __require,
16
16
  __toESM
17
- } from "./chunk-WFGLTBZJ.js";
17
+ } from "./chunk-SHLZ7EEE.js";
18
18
 
19
19
  // ../../../node_modules/jiti/dist/jiti.cjs
20
20
  var require_jiti = __commonJS({
@@ -1,17 +1,17 @@
1
- import CJS_COMPAT_NODE_URL_ojhqsgimw5j from 'node:url';
2
- import CJS_COMPAT_NODE_PATH_ojhqsgimw5j from 'node:path';
3
- import CJS_COMPAT_NODE_MODULE_ojhqsgimw5j from "node:module";
1
+ import CJS_COMPAT_NODE_URL_jo41gwj9z4q from 'node:url';
2
+ import CJS_COMPAT_NODE_PATH_jo41gwj9z4q from 'node:path';
3
+ import CJS_COMPAT_NODE_MODULE_jo41gwj9z4q from "node:module";
4
4
 
5
- var __filename = CJS_COMPAT_NODE_URL_ojhqsgimw5j.fileURLToPath(import.meta.url);
6
- var __dirname = CJS_COMPAT_NODE_PATH_ojhqsgimw5j.dirname(__filename);
7
- var require = CJS_COMPAT_NODE_MODULE_ojhqsgimw5j.createRequire(import.meta.url);
5
+ var __filename = CJS_COMPAT_NODE_URL_jo41gwj9z4q.fileURLToPath(import.meta.url);
6
+ var __dirname = CJS_COMPAT_NODE_PATH_jo41gwj9z4q.dirname(__filename);
7
+ var require = CJS_COMPAT_NODE_MODULE_jo41gwj9z4q.createRequire(import.meta.url);
8
8
 
9
9
  // ------------------------------------------------------------
10
10
  // end of CJS compatibility banner, injected by Storybook's esbuild configuration
11
11
  // ------------------------------------------------------------
12
12
  import {
13
13
  __esm
14
- } from "./chunk-WFGLTBZJ.js";
14
+ } from "./chunk-SHLZ7EEE.js";
15
15
 
16
16
  // ../../../node_modules/tsx/dist/lexer-DQCqS3nf.mjs
17
17
  function F(A, E = "@") {
@@ -9,6 +9,12 @@ declare const unstable_noStore: Mock<(...args: any[]) => any>;
9
9
  declare const refresh: Mock<(...args: any[]) => any>;
10
10
  declare const cacheLife: Mock<(...args: any[]) => any>;
11
11
  declare const cacheTag: Mock<(...args: any[]) => any>;
12
+ declare const io: Mock<() => Promise<undefined> & {
13
+ status: 'fulfilled';
14
+ value: undefined;
15
+ }>;
16
+ declare const navigation: Mock<() => Promise<void>>;
17
+ declare const prefetch: Mock<() => Promise<void>>;
12
18
  declare const unstable_cacheLife: Mock<(...args: any[]) => any>;
13
19
  declare const unstable_cacheTag: Mock<(...args: any[]) => any>;
14
20
  declare const cacheExports: {
@@ -17,6 +23,12 @@ declare const cacheExports: {
17
23
  revalidatePath: Mock<(...args: any[]) => any>;
18
24
  updateTag: Mock<(...args: any[]) => any>;
19
25
  refresh: Mock<(...args: any[]) => any>;
26
+ io: Mock<() => Promise<undefined> & {
27
+ status: 'fulfilled';
28
+ value: undefined;
29
+ }>;
30
+ navigation: Mock<() => Promise<void>>;
31
+ prefetch: Mock<() => Promise<void>>;
20
32
  unstable_noStore: Mock<(...args: any[]) => any>;
21
33
  cacheLife: Mock<(...args: any[]) => any>;
22
34
  cacheTag: Mock<(...args: any[]) => any>;
@@ -24,4 +36,4 @@ declare const cacheExports: {
24
36
  unstable_cacheTag: Mock<(...args: any[]) => any>;
25
37
  };
26
38
  //#endregion
27
- export { cacheLife, cacheTag, cacheExports as default, refresh, revalidatePath, revalidateTag, unstable_cache, unstable_cacheLife, unstable_cacheTag, unstable_noStore, updateTag };
39
+ export { cacheLife, cacheTag, cacheExports as default, io, navigation, prefetch, refresh, revalidatePath, revalidateTag, unstable_cache, unstable_cacheLife, unstable_cacheTag, unstable_noStore, updateTag };
@@ -2,12 +2,20 @@ import "../../_browser-chunks/chunk-UAWMPV5J.js";
2
2
 
3
3
  // src/export-mocks/cache/index.ts
4
4
  import { fn } from "storybook/test";
5
- var revalidatePath = fn().mockName("next/cache::revalidatePath"), revalidateTag = fn().mockName("next/cache::revalidateTag"), updateTag = fn().mockName("next/cache::updateTag"), unstable_cache = fn().mockName("next/cache::unstable_cache").mockImplementation((cb) => cb), unstable_noStore = fn().mockName("next/cache::unstable_noStore"), refresh = fn().mockName("next/cache::refresh"), cacheLife = fn().mockName("next/cache::cacheLife"), cacheTag = fn().mockName("next/cache::cacheTag"), unstable_cacheLife = cacheLife, unstable_cacheTag = cacheTag, cacheExports = {
5
+ var revalidatePath = fn().mockName("next/cache::revalidatePath"), revalidateTag = fn().mockName("next/cache::revalidateTag"), updateTag = fn().mockName("next/cache::updateTag"), unstable_cache = fn().mockName("next/cache::unstable_cache").mockImplementation((cb) => cb), unstable_noStore = fn().mockName("next/cache::unstable_noStore"), refresh = fn().mockName("next/cache::refresh"), cacheLife = fn().mockName("next/cache::cacheLife"), cacheTag = fn().mockName("next/cache::cacheTag"), resolvedIOPromise = Object.assign(Promise.resolve(void 0), {
6
+ status: "fulfilled",
7
+ value: void 0
8
+ }), io = fn(() => resolvedIOPromise).mockName("next/cache::io"), navigation = fn(async () => {
9
+ }).mockName("next/cache::navigation"), prefetch = fn(async () => {
10
+ }).mockName("next/cache::prefetch"), unstable_cacheLife = cacheLife, unstable_cacheTag = cacheTag, cacheExports = {
6
11
  unstable_cache,
7
12
  revalidateTag,
8
13
  revalidatePath,
9
14
  updateTag,
10
15
  refresh,
16
+ io,
17
+ navigation,
18
+ prefetch,
11
19
  unstable_noStore,
12
20
  cacheLife,
13
21
  cacheTag,
@@ -18,6 +26,9 @@ export {
18
26
  cacheLife,
19
27
  cacheTag,
20
28
  cache_default as default,
29
+ io,
30
+ navigation,
31
+ prefetch,
21
32
  refresh,
22
33
  revalidatePath,
23
34
  revalidateTag,
@@ -15,7 +15,7 @@ var linkAction = fn().mockName("next/link::Link"), removeTrailingSlash = (route)
15
15
  return path;
16
16
  let { pathname, query, hash } = parsePath(path);
17
17
  return process.env.__NEXT_TRAILING_SLASH ? /\.[^/]+\/?$/.test(pathname) ? `${removeTrailingSlash(pathname)}${query}${hash}` : `${pathname.endsWith("/") ? pathname : `${pathname}/`}${query}${hash}` : `${removeTrailingSlash(pathname)}${query}${hash}`;
18
- }, MockLink = React.forwardRef(function({
18
+ }, formatHash = (hash) => hash ? hash.startsWith("#") ? hash : `#${hash}` : "", MockLink = React.forwardRef(function({
19
19
  href,
20
20
  as,
21
21
  replace,
@@ -29,7 +29,7 @@ var linkAction = fn().mockName("next/link::Link"), removeTrailingSlash = (route)
29
29
  children,
30
30
  ...rest
31
31
  }, ref) {
32
- let resolvedHref = as ?? href, rawHref = typeof resolvedHref == "object" ? `${resolvedHref.pathname || ""}${resolvedHref.query ? "?" + new URLSearchParams(resolvedHref.query).toString() : ""}${resolvedHref.hash || ""}` : resolvedHref, hrefString = typeof rawHref == "string" ? normalizePathTrailingSlash(rawHref) : rawHref, navigate = (e) => {
32
+ let resolvedHref = as ?? href, rawHref = typeof resolvedHref == "object" ? `${resolvedHref.pathname || ""}${resolvedHref.query ? "?" + new URLSearchParams(resolvedHref.query).toString() : ""}${formatHash(resolvedHref.hash)}` : resolvedHref, hrefString = typeof rawHref == "string" ? normalizePathTrailingSlash(rawHref) : rawHref, navigate = (e) => {
33
33
  e.defaultPrevented || (e.preventDefault(), linkAction(hrefString, { replace, scroll, shallow, prefetch, locale }));
34
34
  }, handleClick = (e) => {
35
35
  onClick?.(e), navigate(e);
@@ -1,15 +1,15 @@
1
- import CJS_COMPAT_NODE_URL_ojhqsgimw5j from 'node:url';
2
- import CJS_COMPAT_NODE_PATH_ojhqsgimw5j from 'node:path';
3
- import CJS_COMPAT_NODE_MODULE_ojhqsgimw5j from "node:module";
1
+ import CJS_COMPAT_NODE_URL_jo41gwj9z4q from 'node:url';
2
+ import CJS_COMPAT_NODE_PATH_jo41gwj9z4q from 'node:path';
3
+ import CJS_COMPAT_NODE_MODULE_jo41gwj9z4q from "node:module";
4
4
 
5
- var __filename = CJS_COMPAT_NODE_URL_ojhqsgimw5j.fileURLToPath(import.meta.url);
6
- var __dirname = CJS_COMPAT_NODE_PATH_ojhqsgimw5j.dirname(__filename);
7
- var require = CJS_COMPAT_NODE_MODULE_ojhqsgimw5j.createRequire(import.meta.url);
5
+ var __filename = CJS_COMPAT_NODE_URL_jo41gwj9z4q.fileURLToPath(import.meta.url);
6
+ var __dirname = CJS_COMPAT_NODE_PATH_jo41gwj9z4q.dirname(__filename);
7
+ var require = CJS_COMPAT_NODE_MODULE_jo41gwj9z4q.createRequire(import.meta.url);
8
8
 
9
9
  // ------------------------------------------------------------
10
10
  // end of CJS compatibility banner, injected by Storybook's esbuild configuration
11
11
  // ------------------------------------------------------------
12
- import "../_node-chunks/chunk-WFGLTBZJ.js";
12
+ import "../_node-chunks/chunk-SHLZ7EEE.js";
13
13
 
14
14
  // src/node/index.ts
15
15
  function defineMain(config) {
package/dist/preset.js CHANGED
@@ -1,10 +1,10 @@
1
- import CJS_COMPAT_NODE_URL_ojhqsgimw5j from 'node:url';
2
- import CJS_COMPAT_NODE_PATH_ojhqsgimw5j from 'node:path';
3
- import CJS_COMPAT_NODE_MODULE_ojhqsgimw5j from "node:module";
1
+ import CJS_COMPAT_NODE_URL_jo41gwj9z4q from 'node:url';
2
+ import CJS_COMPAT_NODE_PATH_jo41gwj9z4q from 'node:path';
3
+ import CJS_COMPAT_NODE_MODULE_jo41gwj9z4q from "node:module";
4
4
 
5
- var __filename = CJS_COMPAT_NODE_URL_ojhqsgimw5j.fileURLToPath(import.meta.url);
6
- var __dirname = CJS_COMPAT_NODE_PATH_ojhqsgimw5j.dirname(__filename);
7
- var require = CJS_COMPAT_NODE_MODULE_ojhqsgimw5j.createRequire(import.meta.url);
5
+ var __filename = CJS_COMPAT_NODE_URL_jo41gwj9z4q.fileURLToPath(import.meta.url);
6
+ var __dirname = CJS_COMPAT_NODE_PATH_jo41gwj9z4q.dirname(__filename);
7
+ var require = CJS_COMPAT_NODE_MODULE_jo41gwj9z4q.createRequire(import.meta.url);
8
8
 
9
9
  // ------------------------------------------------------------
10
10
  // end of CJS compatibility banner, injected by Storybook's esbuild configuration
@@ -13,7 +13,7 @@ import {
13
13
  __commonJS,
14
14
  __require,
15
15
  __toESM
16
- } from "./_node-chunks/chunk-WFGLTBZJ.js";
16
+ } from "./_node-chunks/chunk-SHLZ7EEE.js";
17
17
 
18
18
  // ../../../node_modules/semver/internal/constants.js
19
19
  var require_constants = __commonJS({
@@ -1514,7 +1514,7 @@ var require_req = __commonJS({
1514
1514
  }
1515
1515
  if (tsx === void 0)
1516
1516
  try {
1517
- tsx = await import("./_node-chunks/api-36ETWK5Z.js");
1517
+ tsx = await import("./_node-chunks/api-RYEOTMOY.js");
1518
1518
  } catch (error) {
1519
1519
  importError.push(error);
1520
1520
  }
@@ -1524,7 +1524,7 @@ var require_req = __commonJS({
1524
1524
  }
1525
1525
  if (jiti === void 0)
1526
1526
  try {
1527
- jiti = (await import("./_node-chunks/jiti-KRLAMNB6.js")).default;
1527
+ jiti = (await import("./_node-chunks/jiti-FJOVEUDY.js")).default;
1528
1528
  } catch (error) {
1529
1529
  importError.push(error);
1530
1530
  }
@@ -1641,7 +1641,7 @@ var require_src2 = __commonJS({
1641
1641
  async function yamlLoader(_, content) {
1642
1642
  if (!yaml)
1643
1643
  try {
1644
- yaml = await import("./_node-chunks/dist-HR64DFGM.js");
1644
+ yaml = await import("./_node-chunks/dist-USTKF7YI.js");
1645
1645
  } catch (e) {
1646
1646
  throw new Error(
1647
1647
  `'yaml' is required for the YAML configuration files. Make sure it is installed
@@ -1,15 +1,15 @@
1
- import CJS_COMPAT_NODE_URL_ojhqsgimw5j from 'node:url';
2
- import CJS_COMPAT_NODE_PATH_ojhqsgimw5j from 'node:path';
3
- import CJS_COMPAT_NODE_MODULE_ojhqsgimw5j from "node:module";
1
+ import CJS_COMPAT_NODE_URL_jo41gwj9z4q from 'node:url';
2
+ import CJS_COMPAT_NODE_PATH_jo41gwj9z4q from 'node:path';
3
+ import CJS_COMPAT_NODE_MODULE_jo41gwj9z4q from "node:module";
4
4
 
5
- var __filename = CJS_COMPAT_NODE_URL_ojhqsgimw5j.fileURLToPath(import.meta.url);
6
- var __dirname = CJS_COMPAT_NODE_PATH_ojhqsgimw5j.dirname(__filename);
7
- var require = CJS_COMPAT_NODE_MODULE_ojhqsgimw5j.createRequire(import.meta.url);
5
+ var __filename = CJS_COMPAT_NODE_URL_jo41gwj9z4q.fileURLToPath(import.meta.url);
6
+ var __dirname = CJS_COMPAT_NODE_PATH_jo41gwj9z4q.dirname(__filename);
7
+ var require = CJS_COMPAT_NODE_MODULE_jo41gwj9z4q.createRequire(import.meta.url);
8
8
 
9
9
  // ------------------------------------------------------------
10
10
  // end of CJS compatibility banner, injected by Storybook's esbuild configuration
11
11
  // ------------------------------------------------------------
12
- import "../_node-chunks/chunk-WFGLTBZJ.js";
12
+ import "../_node-chunks/chunk-SHLZ7EEE.js";
13
13
 
14
14
  // src/vite-plugin/index.ts
15
15
  import vitePluginStorybookNextjs from "vite-plugin-storybook-nextjs";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@storybook/nextjs-vite",
3
- "version": "11.0.0-alpha.8",
3
+ "version": "11.0.0-beta.0",
4
4
  "description": "Storybook for Next.js and Vite: Develop, document, and test UI components in isolation",
5
5
  "keywords": [
6
6
  "storybook",
@@ -88,11 +88,11 @@
88
88
  "!src/**/*"
89
89
  ],
90
90
  "dependencies": {
91
- "@storybook/builder-vite": "11.0.0-alpha.8",
92
- "@storybook/react": "11.0.0-alpha.8",
93
- "@storybook/react-vite": "11.0.0-alpha.8",
91
+ "@storybook/builder-vite": "11.0.0-beta.0",
92
+ "@storybook/react": "11.0.0-beta.0",
93
+ "@storybook/react-vite": "11.0.0-beta.0",
94
94
  "styled-jsx": "5.1.6",
95
- "vite-plugin-storybook-nextjs": "11.0.0-alpha.8"
95
+ "vite-plugin-storybook-nextjs": "11.0.0-beta.0"
96
96
  },
97
97
  "devDependencies": {
98
98
  "@types/node": "^22.19.1",
@@ -108,7 +108,8 @@
108
108
  "next": "^15.0.0 || ^16.0.0",
109
109
  "react": "^18.0.0 || ^19.0.0",
110
110
  "react-dom": "^18.0.0 || ^19.0.0",
111
- "storybook": "^11.0.0-alpha.8",
111
+ "storybook": "^11.0.0-beta.0",
112
+ "typescript": "^5.9.0 || ^6.0.0 || ^7.0.0",
112
113
  "vite": "^6.3.0 || ^7.0.0 || ^8.0.0"
113
114
  },
114
115
  "peerDependenciesMeta": {
@@ -117,9 +118,6 @@
117
118
  },
118
119
  "@types/react-dom": {
119
120
  "optional": true
120
- },
121
- "typescript": {
122
- "optional": true
123
121
  }
124
122
  },
125
123
  "publishConfig": {
@@ -1,9 +1,16 @@
1
- import PropTypes from 'prop-types';
2
-
3
1
  import './button.css';
4
2
 
5
- /** Primary UI component for user interaction */
6
- export const Button = ({ primary, backgroundColor, size, label, ...props }) => {
3
+ /**
4
+ * Primary UI component for user interaction
5
+ *
6
+ * @param {object} props
7
+ * @param {boolean} [props.primary=false] Is this the principal call to action on the page?
8
+ * @param {string} [props.backgroundColor] What background color to use
9
+ * @param {'small' | 'medium' | 'large'} [props.size='medium'] How large should the button be?
10
+ * @param {string} props.label Button contents
11
+ * @param {() => void} [props.onClick] Optional click handler
12
+ */
13
+ export const Button = ({ primary = false, backgroundColor, size = 'medium', label, ...props }) => {
7
14
  const mode = primary ? 'storybook-button--primary' : 'storybook-button--secondary';
8
15
  return (
9
16
  <button
@@ -20,23 +27,3 @@ export const Button = ({ primary, backgroundColor, size, label, ...props }) => {
20
27
  </button>
21
28
  );
22
29
  };
23
-
24
- Button.propTypes = {
25
- /** Is this the principal call to action on the page? */
26
- primary: PropTypes.bool,
27
- /** What background color to use */
28
- backgroundColor: PropTypes.string,
29
- /** How large should the button be? */
30
- size: PropTypes.oneOf(['small', 'medium', 'large']),
31
- /** Button contents */
32
- label: PropTypes.string.isRequired,
33
- /** Optional click handler */
34
- onClick: PropTypes.func,
35
- };
36
-
37
- Button.defaultProps = {
38
- backgroundColor: null,
39
- primary: false,
40
- size: 'medium',
41
- onClick: undefined,
42
- };
@@ -1,8 +1,13 @@
1
- import PropTypes from 'prop-types';
2
-
3
1
  import { Button } from './Button';
4
2
  import './header.css';
5
3
 
4
+ /**
5
+ * @param {object} props
6
+ * @param {{ name: string }} [props.user] The signed-in user, if any
7
+ * @param {() => void} props.onLogin Called when the user clicks Log in
8
+ * @param {() => void} props.onLogout Called when the user clicks Log out
9
+ * @param {() => void} props.onCreateAccount Called when the user clicks Sign up
10
+ */
6
11
  export const Header = ({ user, onLogin, onLogout, onCreateAccount }) => (
7
12
  <header>
8
13
  <div className="storybook-header">
@@ -43,16 +48,3 @@ export const Header = ({ user, onLogin, onLogout, onCreateAccount }) => (
43
48
  </div>
44
49
  </header>
45
50
  );
46
-
47
- Header.propTypes = {
48
- user: PropTypes.shape({
49
- name: PropTypes.string.isRequired,
50
- }),
51
- onLogin: PropTypes.func.isRequired,
52
- onLogout: PropTypes.func.isRequired,
53
- onCreateAccount: PropTypes.func.isRequired,
54
- };
55
-
56
- Header.defaultProps = {
57
- user: null,
58
- };