storybook 10.2.0-alpha.11 → 10.2.0-alpha.13

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.
Files changed (70) hide show
  1. package/dist/_browser-chunks/chunk-AFVOZMXQ.js +23 -0
  2. package/dist/_browser-chunks/{chunk-RBABWY22.js → chunk-BGSDJMFM.js} +6 -4
  3. package/dist/_node-chunks/{builder-manager-MNAUTRWW.js → builder-manager-YTW4R3NB.js} +13 -12
  4. package/dist/_node-chunks/{camelcase-6H4Z5R35.js → camelcase-ALOK3DTL.js} +7 -7
  5. package/dist/_node-chunks/{chunk-URWJMVZI.js → chunk-2VHYFREG.js} +7 -7
  6. package/dist/_node-chunks/{chunk-UYMZAYR4.js → chunk-5CARBEGS.js} +9 -9
  7. package/dist/_node-chunks/{chunk-2DZGIXSN.js → chunk-5E6TIJW7.js} +6 -6
  8. package/dist/_node-chunks/chunk-5U7IR6W2.js +61 -0
  9. package/dist/_node-chunks/{chunk-KU4SWNDM.js → chunk-AE6TGTGX.js} +7 -7
  10. package/dist/_node-chunks/{chunk-WHIAK7AH.js → chunk-AOMUVL33.js} +12 -12
  11. package/dist/_node-chunks/chunk-B3NH4IRY.js +35 -0
  12. package/dist/_node-chunks/{chunk-7FH4U6XC.js → chunk-BIJENBOW.js} +15 -12
  13. package/dist/_node-chunks/{chunk-O7O53MP7.js → chunk-FCBELYHM.js} +12 -12
  14. package/dist/_node-chunks/chunk-JUCUYWH2.js +23 -0
  15. package/dist/_node-chunks/chunk-KTAHXSER.js +18 -0
  16. package/dist/_node-chunks/{chunk-FWVZUHZX.js → chunk-KXFFKIVX.js} +6 -6
  17. package/dist/_node-chunks/{chunk-TFY6QV57.js → chunk-L4JVY7CQ.js} +7 -7
  18. package/dist/_node-chunks/{chunk-GRH5JFTX.js → chunk-NGFKU3PK.js} +7 -7
  19. package/dist/_node-chunks/{chunk-MAQAZSXK.js → chunk-NL75DTGM.js} +6 -6
  20. package/dist/_node-chunks/{chunk-L22DGLKT.js → chunk-NRCGIPSW.js} +6 -6
  21. package/dist/_node-chunks/{chunk-UNUWAUGG.js → chunk-OOTLIMKW.js} +6 -6
  22. package/dist/_node-chunks/{chunk-F3OHO2BC.js → chunk-OWZXELHP.js} +13 -13
  23. package/dist/_node-chunks/{chunk-TOMGRF4A.js → chunk-QMDFRT4S.js} +10 -10
  24. package/dist/_node-chunks/{chunk-HXFHXVEW.js → chunk-QV7LTTOW.js} +20 -20
  25. package/dist/_node-chunks/{chunk-UOHDPKIW.js → chunk-TOLCEUYZ.js} +7 -7
  26. package/dist/_node-chunks/{chunk-KAIK7772.js → chunk-TWCN75ID.js} +9 -9
  27. package/dist/_node-chunks/{chunk-CMQYFTBQ.js → chunk-VOVBTC53.js} +6 -6
  28. package/dist/_node-chunks/{chunk-MAMDH2R3.js → chunk-WKDY7YZY.js} +7 -7
  29. package/dist/_node-chunks/{chunk-WQ4WQYSZ.js → chunk-X2PNK4N4.js} +7 -7
  30. package/dist/_node-chunks/chunk-XQU357NR.js +20 -0
  31. package/dist/_node-chunks/{chunk-5L22ATN3.js → chunk-XX6B7MPS.js} +8 -8
  32. package/dist/_node-chunks/{chunk-RJY225Z5.js → chunk-ZSUT22UW.js} +7 -7
  33. package/dist/_node-chunks/{dist-ZOBQQCBA.js → dist-I4XBT6AL.js} +9 -9
  34. package/dist/_node-chunks/{globby-WNZSV3ZO.js → globby-RG2TFVNI.js} +9 -9
  35. package/dist/_node-chunks/{lib-YUWKNDR2.js → lib-E2AGGQV3.js} +7 -7
  36. package/dist/_node-chunks/{mdx-N42X6CFJ-K5BCUPEA.js → mdx-N42X6CFJ-SGUMZ4YL.js} +8 -8
  37. package/dist/_node-chunks/{p-limit-ROJSQI7F.js → p-limit-J4UZO65T.js} +7 -7
  38. package/dist/babel/index.js +10 -10
  39. package/dist/bin/core.js +12 -12
  40. package/dist/bin/dispatcher.js +11 -11
  41. package/dist/bin/loader.js +9 -9
  42. package/dist/cli/index.js +18 -18
  43. package/dist/common/index.js +19 -19
  44. package/dist/components/index.d.ts +1 -0
  45. package/dist/components/index.js +5 -0
  46. package/dist/core-server/index.d.ts +27 -2
  47. package/dist/core-server/index.js +45 -43
  48. package/dist/core-server/presets/common-manager.js +18 -14
  49. package/dist/core-server/presets/common-override-preset.js +9 -9
  50. package/dist/core-server/presets/common-preset.js +25 -24
  51. package/dist/csf/index.js +5 -2
  52. package/dist/csf-tools/index.js +10 -9
  53. package/dist/manager/globals-runtime.js +93 -25
  54. package/dist/manager/runtime.js +87 -886
  55. package/dist/manager-api/index.d.ts +86 -20
  56. package/dist/manager-api/index.js +52 -6
  57. package/dist/mocking-utils/index.js +8 -8
  58. package/dist/node-logger/index.js +9 -9
  59. package/dist/preview/runtime.js +24 -4
  60. package/dist/preview-api/index.d.ts +26 -1
  61. package/dist/preview-api/index.js +5 -1
  62. package/dist/server-errors.js +11 -11
  63. package/dist/telemetry/index.js +22 -22
  64. package/dist/theming/index.js +5 -2
  65. package/dist/types/index.d.ts +1 -0
  66. package/package.json +1 -1
  67. package/dist/_node-chunks/chunk-2CGMTALY.js +0 -61
  68. package/dist/_node-chunks/chunk-KX7OAVXY.js +0 -18
  69. package/dist/_node-chunks/chunk-P663SP7U.js +0 -20
  70. package/dist/_node-chunks/chunk-RI4IBKXZ.js +0 -23
@@ -63,7 +63,7 @@ import {
63
63
 
64
64
  // src/core-server/presets/common-manager.ts
65
65
  import { global as global3 } from "@storybook/global";
66
- import { addons as addons8 } from "storybook/manager-api";
66
+ import { addons as addons8, Tag } from "storybook/manager-api";
67
67
 
68
68
  // src/controls/manager.tsx
69
69
  import React28 from "react";
@@ -75,7 +75,6 @@ import { color } from "storybook/theming";
75
75
 
76
76
  // src/controls/components/ControlsPanel.tsx
77
77
  import React26, { useEffect as useEffect8, useMemo as useMemo3, useState as useState11 } from "react";
78
- import { ScrollArea } from "storybook/internal/components";
79
78
  import { global } from "@storybook/global";
80
79
  import {
81
80
  useArgTypes,
@@ -3240,7 +3239,7 @@ var TableWrapper2 = styled19.table(({ theme: theme3, compact, inAddonPanel, inTa
3240
3239
  },
3241
3240
  // End Resets
3242
3241
  fontSize: theme3.typography.size.s2 - 1,
3243
- lineHeight: "20px",
3242
+ lineHeight: "19px",
3244
3243
  textAlign: "left",
3245
3244
  width: "100%",
3246
3245
  // Margin collapse
@@ -3501,8 +3500,9 @@ var slideIn = keyframes({
3501
3500
  to: {}
3502
3501
  }), Container2 = styled20.div({
3503
3502
  containerType: "size",
3504
- position: "sticky",
3503
+ position: "absolute",
3505
3504
  bottom: 0,
3505
+ width: "100%",
3506
3506
  height: 41,
3507
3507
  overflow: "hidden",
3508
3508
  zIndex: 1
@@ -3521,6 +3521,7 @@ var slideIn = keyframes({
3521
3521
  display: "flex",
3522
3522
  flex: "99 0 auto",
3523
3523
  alignItems: "center",
3524
+ marginInlineStart: 7,
3524
3525
  marginInlineEnd: 10,
3525
3526
  gap: 6
3526
3527
  }), Actions = styled20.div(({ theme: theme3 }) => ({
@@ -3605,11 +3606,14 @@ var slideIn = keyframes({
3605
3606
  var clean = (obj) => Object.entries(obj).reduce(
3606
3607
  (acc, [key, value2]) => value2 !== void 0 ? Object.assign(acc, { [key]: value2 }) : acc,
3607
3608
  {}
3608
- ), AddonWrapper = styled21.div(({ showSaveFromUI }) => ({
3609
- display: "grid",
3610
- gridTemplateRows: showSaveFromUI ? "1fr 41px" : "1fr",
3609
+ ), AddonWrapper = styled21.div(({ showSaveFromUI, theme: theme3 }) => ({
3611
3610
  height: "100%",
3612
- maxHeight: "100vh"
3611
+ maxHeight: "100vh",
3612
+ paddingBottom: showSaveFromUI ? 41 : 0,
3613
+ backgroundColor: theme3.background.content,
3614
+ table: {
3615
+ backgroundColor: theme3.background.app
3616
+ }
3613
3617
  })), ControlsPanel = ({ saveStory, createStory }) => {
3614
3618
  let api = useStorybookApi(), [isLoading, setIsLoading] = useState11(!0), [args, updateArgs, resetArgs, initialArgs] = useArgs(), [globals] = useGlobals(), rows = useArgTypes(), {
3615
3619
  expanded,
@@ -3627,7 +3631,7 @@ var clean = (obj) => Object.entries(obj).reduce(
3627
3631
  () => !!args && !!initialArgs && !dequal(clean(args), clean(initialArgs)),
3628
3632
  [args, initialArgs]
3629
3633
  ), showSaveFromUI = hasControls && storyData.type === "story" && storyData.subtype !== "test" && hasUpdatedArgs && global.CONFIG_TYPE === "DEVELOPMENT" && disableSaveFromUI !== !0;
3630
- return React26.createElement(AddonWrapper, { showSaveFromUI }, React26.createElement(ScrollArea, { vertical: !0 }, React26.createElement(
3634
+ return React26.createElement(AddonWrapper, { showSaveFromUI }, React26.createElement(
3631
3635
  ArgsTable,
3632
3636
  {
3633
3637
  key: path,
@@ -3641,7 +3645,7 @@ var clean = (obj) => Object.entries(obj).reduce(
3641
3645
  sort,
3642
3646
  isLoading
3643
3647
  }
3644
- )), showSaveFromUI && React26.createElement(SaveStory, { resetArgs, saveStory, createStory }));
3648
+ ), showSaveFromUI && React26.createElement(SaveStory, { resetArgs, saveStory, createStory }));
3645
3649
  };
3646
3650
 
3647
3651
  // src/controls/components/Title.tsx
@@ -3721,7 +3725,7 @@ var manager_default = addons.register(ADDON_ID6, (api) => {
3721
3725
  title: Title,
3722
3726
  type: types.PANEL,
3723
3727
  paramKey: PARAM_KEY5,
3724
- render: ({ active }) => !active || !api.getCurrentStoryData() ? null : React28.createElement(AddonPanel, { active, hasScrollbar: !1 }, React28.createElement(ControlsPanel, { saveStory, createStory }))
3728
+ render: ({ active }) => !active || !api.getCurrentStoryData() ? null : React28.createElement(AddonPanel, { active }, React28.createElement(ControlsPanel, { saveStory, createStory }))
3725
3729
  }), channel.on(SAVE_STORY_RESPONSE, (data) => {
3726
3730
  if (!data.success)
3727
3731
  return;
@@ -3763,7 +3767,7 @@ import { STORY_CHANGED as STORY_CHANGED2 } from "storybook/internal/core-events"
3763
3767
 
3764
3768
  // src/actions/components/ActionLogger/index.tsx
3765
3769
  import React31, { Fragment, forwardRef, useEffect as useEffect9, useRef as useRef5 } from "react";
3766
- import { ActionBar, ScrollArea as ScrollArea2 } from "storybook/internal/components";
3770
+ import { ActionBar, ScrollArea } from "storybook/internal/components";
3767
3771
 
3768
3772
  // ../../node_modules/react-inspector/dist/index.mjs
3769
3773
  import React92 from "react";
@@ -4766,7 +4770,7 @@ var Action = styled22.div({
4766
4770
 
4767
4771
  // src/actions/components/ActionLogger/index.tsx
4768
4772
  var UnstyledWrapped = forwardRef(
4769
- ({ children, className }, ref) => React31.createElement(ScrollArea2, { ref, horizontal: !0, vertical: !0, className }, children)
4773
+ ({ children, className }, ref) => React31.createElement(ScrollArea, { ref, horizontal: !0, vertical: !0, className }, children)
4770
4774
  );
4771
4775
  UnstyledWrapped.displayName = "UnstyledWrapped";
4772
4776
  var Wrapper8 = styled23(UnstyledWrapped)({
@@ -7052,7 +7056,7 @@ var TAG_FILTERS = "tag-filters", STATIC_FILTER = "static-filter", tagFiltersMana
7052
7056
  let tags = item.tags ?? [];
7053
7057
  return (
7054
7058
  // we can filter out the primary story, but we still want to show autodocs
7055
- (tags.includes("dev") || item.type === "docs") && tags.filter((tag) => staticExcludeTags[tag]).length === 0
7059
+ (tags.includes(Tag.DEV) || item.type === "docs") && tags.filter((tag) => staticExcludeTags[tag]).length === 0
7056
7060
  );
7057
7061
  });
7058
7062
  }), common_manager_default = [
@@ -1,21 +1,21 @@
1
- import CJS_COMPAT_NODE_URL_aucdos01fk5 from 'node:url';
2
- import CJS_COMPAT_NODE_PATH_aucdos01fk5 from 'node:path';
3
- import CJS_COMPAT_NODE_MODULE_aucdos01fk5 from "node:module";
1
+ import CJS_COMPAT_NODE_URL_xc3mu1pf9x from 'node:url';
2
+ import CJS_COMPAT_NODE_PATH_xc3mu1pf9x from 'node:path';
3
+ import CJS_COMPAT_NODE_MODULE_xc3mu1pf9x from "node:module";
4
4
 
5
- var __filename = CJS_COMPAT_NODE_URL_aucdos01fk5.fileURLToPath(import.meta.url);
6
- var __dirname = CJS_COMPAT_NODE_PATH_aucdos01fk5.dirname(__filename);
7
- var require = CJS_COMPAT_NODE_MODULE_aucdos01fk5.createRequire(import.meta.url);
5
+ var __filename = CJS_COMPAT_NODE_URL_xc3mu1pf9x.fileURLToPath(import.meta.url);
6
+ var __dirname = CJS_COMPAT_NODE_PATH_xc3mu1pf9x.dirname(__filename);
7
+ var require = CJS_COMPAT_NODE_MODULE_xc3mu1pf9x.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
  glob
14
- } from "../../_node-chunks/chunk-KU4SWNDM.js";
14
+ } from "../../_node-chunks/chunk-AE6TGTGX.js";
15
15
  import {
16
16
  slash
17
- } from "../../_node-chunks/chunk-P663SP7U.js";
18
- import "../../_node-chunks/chunk-FWVZUHZX.js";
17
+ } from "../../_node-chunks/chunk-XQU357NR.js";
18
+ import "../../_node-chunks/chunk-KXFFKIVX.js";
19
19
 
20
20
  // src/core-server/utils/remove-mdx-entries.ts
21
21
  import { isAbsolute, join, relative } from "node:path";
@@ -1,53 +1,54 @@
1
- import CJS_COMPAT_NODE_URL_aucdos01fk5 from 'node:url';
2
- import CJS_COMPAT_NODE_PATH_aucdos01fk5 from 'node:path';
3
- import CJS_COMPAT_NODE_MODULE_aucdos01fk5 from "node:module";
1
+ import CJS_COMPAT_NODE_URL_xc3mu1pf9x from 'node:url';
2
+ import CJS_COMPAT_NODE_PATH_xc3mu1pf9x from 'node:path';
3
+ import CJS_COMPAT_NODE_MODULE_xc3mu1pf9x from "node:module";
4
4
 
5
- var __filename = CJS_COMPAT_NODE_URL_aucdos01fk5.fileURLToPath(import.meta.url);
6
- var __dirname = CJS_COMPAT_NODE_PATH_aucdos01fk5.dirname(__filename);
7
- var require = CJS_COMPAT_NODE_MODULE_aucdos01fk5.createRequire(import.meta.url);
5
+ var __filename = CJS_COMPAT_NODE_URL_xc3mu1pf9x.fileURLToPath(import.meta.url);
6
+ var __dirname = CJS_COMPAT_NODE_PATH_xc3mu1pf9x.dirname(__filename);
7
+ var require = CJS_COMPAT_NODE_MODULE_xc3mu1pf9x.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-O7O53MP7.js";
12
+ import "../../_node-chunks/chunk-FCBELYHM.js";
13
13
  import {
14
14
  parseStaticDir,
15
15
  sendTelemetryError,
16
16
  throttle
17
- } from "../../_node-chunks/chunk-F3OHO2BC.js";
18
- import "../../_node-chunks/chunk-RI4IBKXZ.js";
19
- import "../../_node-chunks/chunk-UOHDPKIW.js";
20
- import "../../_node-chunks/chunk-2DZGIXSN.js";
17
+ } from "../../_node-chunks/chunk-OWZXELHP.js";
18
+ import "../../_node-chunks/chunk-JUCUYWH2.js";
19
+ import "../../_node-chunks/chunk-TOLCEUYZ.js";
20
+ import "../../_node-chunks/chunk-5E6TIJW7.js";
21
21
  import {
22
22
  globalSettings
23
- } from "../../_node-chunks/chunk-KAIK7772.js";
23
+ } from "../../_node-chunks/chunk-TWCN75ID.js";
24
24
  import {
25
25
  invariant
26
- } from "../../_node-chunks/chunk-CMQYFTBQ.js";
27
- import "../../_node-chunks/chunk-L22DGLKT.js";
26
+ } from "../../_node-chunks/chunk-VOVBTC53.js";
27
+ import "../../_node-chunks/chunk-NRCGIPSW.js";
28
28
  import {
29
29
  resolvePackageDir
30
- } from "../../_node-chunks/chunk-RJY225Z5.js";
30
+ } from "../../_node-chunks/chunk-ZSUT22UW.js";
31
31
  import {
32
32
  isAbsolute,
33
33
  join
34
- } from "../../_node-chunks/chunk-MAQAZSXK.js";
34
+ } from "../../_node-chunks/chunk-NL75DTGM.js";
35
35
  import {
36
36
  loadConfig
37
- } from "../../_node-chunks/chunk-7FH4U6XC.js";
37
+ } from "../../_node-chunks/chunk-BIJENBOW.js";
38
+ import "../../_node-chunks/chunk-B3NH4IRY.js";
38
39
  import {
39
40
  require_dist
40
- } from "../../_node-chunks/chunk-URWJMVZI.js";
41
- import "../../_node-chunks/chunk-UYMZAYR4.js";
42
- import "../../_node-chunks/chunk-GRH5JFTX.js";
41
+ } from "../../_node-chunks/chunk-2VHYFREG.js";
42
+ import "../../_node-chunks/chunk-5CARBEGS.js";
43
+ import "../../_node-chunks/chunk-NGFKU3PK.js";
43
44
  import {
44
45
  require_picocolors
45
- } from "../../_node-chunks/chunk-WQ4WQYSZ.js";
46
+ } from "../../_node-chunks/chunk-X2PNK4N4.js";
46
47
  import {
47
48
  __commonJS,
48
49
  __require,
49
50
  __toESM
50
- } from "../../_node-chunks/chunk-FWVZUHZX.js";
51
+ } from "../../_node-chunks/chunk-KXFFKIVX.js";
51
52
 
52
53
  // ../../node_modules/shell-quote/quote.js
53
54
  var require_quote = __commonJS({
@@ -515,7 +516,7 @@ import { isCsfFactoryPreview } from "storybook/internal/csf-tools";
515
516
  var import_ts_dedent = __toESM(require_dist(), 1);
516
517
 
517
518
  // src/core-server/utils/get-component-variable-name.ts
518
- var getComponentVariableName = async (name) => (await import("../../_node-chunks/camelcase-6H4Z5R35.js")).default(name.replace(/^[^a-zA-Z_$]*/, ""), { pascalCase: !0 }).replace(/[^a-zA-Z_$]+/, "");
519
+ var getComponentVariableName = async (name) => (await import("../../_node-chunks/camelcase-ALOK3DTL.js")).default(name.replace(/^[^a-zA-Z_$]*/, ""), { pascalCase: !0 }).replace(/[^a-zA-Z_$]+/, "");
519
520
 
520
521
  // src/core-server/utils/new-story-templates/csf-factory-template.ts
521
522
  async function getCsfFactoryTemplateForNewStoryFile(data) {
@@ -780,7 +781,7 @@ async function searchFiles({
780
781
  ignoredFiles = IGNORED_FILES,
781
782
  fileExtensions = FILE_EXTENSIONS
782
783
  }) {
783
- let { globby, isDynamicPattern } = await import("../../_node-chunks/globby-WNZSV3ZO.js"), hasSearchSpecialGlobChars = isDynamicPattern(searchQuery, { cwd }), searchQueryHasExtension = /(\.[a-z]+)$/i.test(searchQuery), fileExtensionsPattern = `{${fileExtensions.join(",")}}`, globbedSearchQuery = hasSearchSpecialGlobChars ? searchQuery : searchQueryHasExtension ? [`**/*${searchQuery}*`, `**/*${searchQuery}*/**`] : [
784
+ let { globby, isDynamicPattern } = await import("../../_node-chunks/globby-RG2TFVNI.js"), hasSearchSpecialGlobChars = isDynamicPattern(searchQuery, { cwd }), searchQueryHasExtension = /(\.[a-z]+)$/i.test(searchQuery), fileExtensionsPattern = `{${fileExtensions.join(",")}}`, globbedSearchQuery = hasSearchSpecialGlobChars ? searchQuery : searchQueryHasExtension ? [`**/*${searchQuery}*`, `**/*${searchQuery}*/**`] : [
784
785
  `**/*${searchQuery}*.${fileExtensionsPattern}`,
785
786
  `**/*${searchQuery}*/**/*.${fileExtensionsPattern}`
786
787
  ];
package/dist/csf/index.js CHANGED
@@ -10,8 +10,11 @@ import {
10
10
  mountDestructured,
11
11
  normalizeArrays,
12
12
  normalizeProjectAnnotations
13
- } from "../_browser-chunks/chunk-RBABWY22.js";
13
+ } from "../_browser-chunks/chunk-BGSDJMFM.js";
14
14
  import "../_browser-chunks/chunk-MEXTPDJG.js";
15
+ import {
16
+ Tag
17
+ } from "../_browser-chunks/chunk-AFVOZMXQ.js";
15
18
  import "../_browser-chunks/chunk-XLJZ7AOP.js";
16
19
  import {
17
20
  combineParameters
@@ -1888,7 +1891,7 @@ function defineStory(input, meta) {
1888
1891
  }, test = this.extend({
1889
1892
  ...annotations,
1890
1893
  name,
1891
- tags: ["test-fn", "!autodocs", ...annotations.tags ?? []],
1894
+ tags: [Tag.TEST_FN, `!${Tag.AUTODOCS}`, ...annotations.tags ?? []],
1892
1895
  play
1893
1896
  });
1894
1897
  return __children.push(test), test;
@@ -1,10 +1,10 @@
1
- import CJS_COMPAT_NODE_URL_aucdos01fk5 from 'node:url';
2
- import CJS_COMPAT_NODE_PATH_aucdos01fk5 from 'node:path';
3
- import CJS_COMPAT_NODE_MODULE_aucdos01fk5 from "node:module";
1
+ import CJS_COMPAT_NODE_URL_xc3mu1pf9x from 'node:url';
2
+ import CJS_COMPAT_NODE_PATH_xc3mu1pf9x from 'node:path';
3
+ import CJS_COMPAT_NODE_MODULE_xc3mu1pf9x from "node:module";
4
4
 
5
- var __filename = CJS_COMPAT_NODE_URL_aucdos01fk5.fileURLToPath(import.meta.url);
6
- var __dirname = CJS_COMPAT_NODE_PATH_aucdos01fk5.dirname(__filename);
7
- var require = CJS_COMPAT_NODE_MODULE_aucdos01fk5.createRequire(import.meta.url);
5
+ var __filename = CJS_COMPAT_NODE_URL_xc3mu1pf9x.fileURLToPath(import.meta.url);
6
+ var __dirname = CJS_COMPAT_NODE_PATH_xc3mu1pf9x.dirname(__filename);
7
+ var require = CJS_COMPAT_NODE_MODULE_xc3mu1pf9x.createRequire(import.meta.url);
8
8
 
9
9
  // ------------------------------------------------------------
10
10
  // end of CJS compatibility banner, injected by Storybook's esbuild configuration
@@ -38,9 +38,10 @@ import {
38
38
  vitestTransform,
39
39
  writeConfig,
40
40
  writeCsf
41
- } from "../_node-chunks/chunk-7FH4U6XC.js";
42
- import "../_node-chunks/chunk-URWJMVZI.js";
43
- import "../_node-chunks/chunk-FWVZUHZX.js";
41
+ } from "../_node-chunks/chunk-BIJENBOW.js";
42
+ import "../_node-chunks/chunk-B3NH4IRY.js";
43
+ import "../_node-chunks/chunk-2VHYFREG.js";
44
+ import "../_node-chunks/chunk-KXFFKIVX.js";
44
45
  export {
45
46
  BadMetaError,
46
47
  ConfigFile,
@@ -7868,9 +7868,12 @@ var import_memoizerific, createReset, createGlobal, init_global = __esm({
7868
7868
  ...resetStyles,
7869
7869
  body: {
7870
7870
  ...resetStyles.body,
7871
+ position: "fixed",
7872
+ width: "100vw",
7873
+ height: "100vh",
7874
+ overflow: "hidden",
7871
7875
  color: color2.defaultText,
7872
- background: background2.app,
7873
- overflow: "hidden"
7876
+ background: background2.app
7874
7877
  },
7875
7878
  hr: {
7876
7879
  ...resetStyles.hr,
@@ -11888,13 +11891,13 @@ var require_space_separated_tokens = __commonJS({
11888
11891
  "../../node_modules/hastscript/node_modules/space-separated-tokens/index.js"(exports) {
11889
11892
  "use strict";
11890
11893
  exports.parse = parse9;
11891
- exports.stringify = stringify7;
11894
+ exports.stringify = stringify8;
11892
11895
  var empty = "", space = " ", whiteSpace = /[ \t\n\r\f]+/g;
11893
11896
  function parse9(value) {
11894
11897
  var input2 = String(value || empty).trim();
11895
11898
  return input2 === empty ? [] : input2.split(whiteSpace);
11896
11899
  }
11897
- function stringify7(values) {
11900
+ function stringify8(values) {
11898
11901
  return values.join(space).trim();
11899
11902
  }
11900
11903
  }
@@ -11905,14 +11908,14 @@ var require_comma_separated_tokens = __commonJS({
11905
11908
  "../../node_modules/hastscript/node_modules/comma-separated-tokens/index.js"(exports) {
11906
11909
  "use strict";
11907
11910
  exports.parse = parse9;
11908
- exports.stringify = stringify7;
11911
+ exports.stringify = stringify8;
11909
11912
  var comma = ",", space = " ", empty = "";
11910
11913
  function parse9(value) {
11911
11914
  for (var values = [], input2 = String(value || empty), index4 = input2.indexOf(comma), lastIndex = 0, end2 = !1, val; !end2; )
11912
11915
  index4 === -1 && (index4 = input2.length, end2 = !0), val = input2.slice(lastIndex, index4).trim(), (val || !end2) && values.push(val), lastIndex = index4 + 1, index4 = input2.indexOf(comma, lastIndex);
11913
11916
  return values;
11914
11917
  }
11915
- function stringify7(values, options) {
11918
+ function stringify8(values, options) {
11916
11919
  var settings = options || {}, left2 = settings.padLeft === !1 ? empty : space, right2 = settings.padRight ? space : empty;
11917
11920
  return values[values.length - 1] === empty && (values = values.concat(empty)), values.join(right2 + comma + left2).trim();
11918
11921
  }
@@ -12877,18 +12880,18 @@ var require_prism_core = __commonJS({
12877
12880
  function Token(type5, content, alias, matchedStr) {
12878
12881
  this.type = type5, this.content = content, this.alias = alias, this.length = (matchedStr || "").length | 0;
12879
12882
  }
12880
- Token.stringify = function stringify7(o, language) {
12883
+ Token.stringify = function stringify8(o, language) {
12881
12884
  if (typeof o == "string")
12882
12885
  return o;
12883
12886
  if (Array.isArray(o)) {
12884
12887
  var s3 = "";
12885
12888
  return o.forEach(function(e) {
12886
- s3 += stringify7(e, language);
12889
+ s3 += stringify8(e, language);
12887
12890
  }), s3;
12888
12891
  }
12889
12892
  var env = {
12890
12893
  type: o.type,
12891
- content: stringify7(o.content, language),
12894
+ content: stringify8(o.content, language),
12892
12895
  tag: "span",
12893
12896
  classes: ["token", o.type],
12894
12897
  attributes: {},
@@ -13198,7 +13201,7 @@ var require_core = __commonJS({
13198
13201
  register(clike);
13199
13202
  register(js);
13200
13203
  refract.util.encode = encode2;
13201
- refract.Token.stringify = stringify7;
13204
+ refract.Token.stringify = stringify8;
13202
13205
  function register(grammar) {
13203
13206
  if (typeof grammar != "function" || !grammar.displayName)
13204
13207
  throw new Error("Expected `function` for `grammar`, got `" + grammar + "`");
@@ -13238,7 +13241,7 @@ var require_core = __commonJS({
13238
13241
  own.call(languages2, language) && typeof languages2[language] == "object" && list.push(language);
13239
13242
  return list;
13240
13243
  }
13241
- function stringify7(value, language, parent) {
13244
+ function stringify8(value, language, parent) {
13242
13245
  var env;
13243
13246
  return typeof value == "string" ? { type: "text", value } : refract.util.type(value) === "Array" ? stringifyAll(value, language) : (env = {
13244
13247
  type: value.type,
@@ -15292,9 +15295,9 @@ var require_stringify = __commonJS({
15292
15295
  "../../node_modules/picoquery/lib/stringify.js"(exports) {
15293
15296
  "use strict";
15294
15297
  Object.defineProperty(exports, "__esModule", { value: !0 });
15295
- exports.stringify = stringify7;
15298
+ exports.stringify = stringify8;
15296
15299
  var object_util_js_1 = require_object_util();
15297
- function stringify7(input2, options) {
15300
+ function stringify8(input2, options) {
15298
15301
  if (input2 === null || typeof input2 != "object")
15299
15302
  return "";
15300
15303
  let optionsObj = options ?? {};
@@ -17310,7 +17313,7 @@ var require_dist = __commonJS({
17310
17313
  };
17311
17314
  }
17312
17315
  let storedStringifyRules = stringifyRules2();
17313
- function stringify7(result) {
17316
+ function stringify8(result) {
17314
17317
  return transform(storedStringifyRules, result);
17315
17318
  }
17316
17319
  let reservedWords2 = [
@@ -17944,7 +17947,7 @@ var require_dist = __commonJS({
17944
17947
  function traverse(node2, onEnter, onLeave) {
17945
17948
  _traverse(node2, void 0, void 0, onEnter, onLeave);
17946
17949
  }
17947
- exports2.catharsisTransform = catharsisTransform, exports2.identityTransformRules = identityTransformRules, exports2.jtpTransform = jtpTransform, exports2.parse = parse9, exports2.stringify = stringify7, exports2.stringifyRules = stringifyRules2, exports2.transform = transform, exports2.traverse = traverse, exports2.tryParse = tryParse, exports2.visitorKeys = visitorKeys;
17950
+ exports2.catharsisTransform = catharsisTransform, exports2.identityTransformRules = identityTransformRules, exports2.jtpTransform = jtpTransform, exports2.parse = parse9, exports2.stringify = stringify8, exports2.stringifyRules = stringifyRules2, exports2.transform = transform, exports2.traverse = traverse, exports2.tryParse = tryParse, exports2.visitorKeys = visitorKeys;
17948
17951
  }));
17949
17952
  }
17950
17953
  });
@@ -40608,6 +40611,7 @@ __export(manager_api_exports, {
40608
40611
  ManagerContext: () => ManagerContext,
40609
40612
  Provider: () => ManagerProvider,
40610
40613
  RequestResponseError: () => RequestResponseError,
40614
+ Tag: () => Tag,
40611
40615
  addons: () => addons,
40612
40616
  combineParameters: () => combineParameters2,
40613
40617
  controlOrMetaKey: () => controlOrMetaKey,
@@ -41436,6 +41440,26 @@ init_client_logger();
41436
41440
  init_dist();
41437
41441
  init_dist();
41438
41442
 
41443
+ // src/shared/constants/tags.ts
41444
+ var Tag = {
41445
+ /** Indicates that autodocs should be generated for this component */
41446
+ AUTODOCS: "autodocs",
41447
+ /** MDX documentation attached to a component's stories file */
41448
+ ATTACHED_MDX: "attached-mdx",
41449
+ /** Standalone MDX documentation not attached to stories */
41450
+ UNATTACHED_MDX: "unattached-mdx",
41451
+ /** Story has a play function */
41452
+ PLAY_FN: "play-fn",
41453
+ /** Story has a test function */
41454
+ TEST_FN: "test-fn",
41455
+ /** Development environment tag */
41456
+ DEV: "dev",
41457
+ /** Test environment tag */
41458
+ TEST: "test",
41459
+ /** Manifest generation tag */
41460
+ MANIFEST: "manifest"
41461
+ };
41462
+
41439
41463
  // src/preview-api/modules/store/parameters.ts
41440
41464
  var combineParameters = (...parameterSets) => {
41441
41465
  let mergeKeys = {}, definedParametersSets = parameterSets.filter(Boolean), combined = definedParametersSets.reduce((acc, parameters2) => (Object.entries(parameters2).forEach(([key, value]) => {
@@ -49113,11 +49137,11 @@ function toHaveAccessibleName(htmlElement, expectedAccessibleName) {
49113
49137
  }
49114
49138
  };
49115
49139
  }
49116
- function printAttribute(stringify7, name, value) {
49117
- return value === void 0 ? name : `${name}=${stringify7(value)}`;
49140
+ function printAttribute(stringify8, name, value) {
49141
+ return value === void 0 ? name : `${name}=${stringify8(value)}`;
49118
49142
  }
49119
- function getAttributeComment(stringify7, name, value) {
49120
- return value === void 0 ? `element.hasAttribute(${stringify7(name)})` : `element.getAttribute(${stringify7(name)}) === ${stringify7(value)}`;
49143
+ function getAttributeComment(stringify8, name, value) {
49144
+ return value === void 0 ? `element.hasAttribute(${stringify8(name)})` : `element.getAttribute(${stringify8(name)}) === ${stringify8(value)}`;
49121
49145
  }
49122
49146
  function toHaveAttribute(htmlElement, name, expectedValue) {
49123
49147
  checkHtmlElement(htmlElement, toHaveAttribute, this);
@@ -59475,7 +59499,7 @@ var TITLE_PATH_SEPARATOR = /\s*\/\s*/, denormalizeStoryParameters = ({
59475
59499
  entries: Object.values(index4.entries).reduce(
59476
59500
  (acc, entry) => (acc[entry.id] = {
59477
59501
  ...entry,
59478
- tags: entry.tags ? ["dev", "test", ...entry.tags] : ["dev"]
59502
+ tags: entry.tags ? [Tag.DEV, Tag.TEST, ...entry.tags] : [Tag.DEV]
59479
59503
  }, acc),
59480
59504
  {}
59481
59505
  )
@@ -60269,6 +60293,7 @@ var defaultShortcuts = Object.freeze({
60269
60293
  expandAll: [controlOrMetaKey2(), "shift", "ArrowDown"],
60270
60294
  remount: ["alt", "R"],
60271
60295
  openInEditor: ["alt", "shift", "E"],
60296
+ openInIsolation: ["alt", "shift", "I"],
60272
60297
  copyStoryLink: ["alt", "shift", "L"]
60273
60298
  // TODO: bring this back once we want to add shortcuts for this
60274
60299
  // copyStoryName: ['alt', 'shift', 'C'],
@@ -60336,7 +60361,9 @@ var init11 = ({ store: store2, fullAPI, provider }) => {
60336
60361
  handleShortcutFeature(feature, event) {
60337
60362
  let {
60338
60363
  ui: { enableShortcuts },
60339
- storyId
60364
+ storyId,
60365
+ refId,
60366
+ viewMode
60340
60367
  } = store2.getState();
60341
60368
  if (enableShortcuts)
60342
60369
  switch (event?.preventDefault && event.preventDefault(), feature) {
@@ -60429,6 +60456,13 @@ var init11 = ({ store: store2, fullAPI, provider }) => {
60429
60456
  });
60430
60457
  break;
60431
60458
  }
60459
+ case "openInIsolation": {
60460
+ if (storyId && viewMode === "story") {
60461
+ let { previewHref } = fullAPI.getStoryHrefs(storyId, { refId });
60462
+ window.open(previewHref, "_blank", "noopener,noreferrer");
60463
+ }
60464
+ break;
60465
+ }
60432
60466
  // TODO: bring this back once we want to add shortcuts for this
60433
60467
  // case 'copyStoryName': {
60434
60468
  // const storyData = fullAPI.getCurrentStoryData();
@@ -60438,7 +60472,10 @@ var init11 = ({ store: store2, fullAPI, provider }) => {
60438
60472
  // break;
60439
60473
  // }
60440
60474
  case "copyStoryLink": {
60441
- (0, import_copy_to_clipboard.default)(window.location.href);
60475
+ if (storyId) {
60476
+ let { managerHref } = fullAPI.getStoryHrefs(storyId, { refId });
60477
+ (0, import_copy_to_clipboard.default)(managerHref);
60478
+ }
60442
60479
  break;
60443
60480
  }
60444
60481
  default:
@@ -61968,11 +62005,17 @@ var LocationProvider = (...args) => BrowserRouter(...args), BaseLocationProvider
61968
62005
 
61969
62006
  // src/manager-api/modules/url.ts
61970
62007
  init_dist();
61971
- var { window: globalWindow4 } = scope, parseBoolean = (value) => {
62008
+ var import_picoquery5 = __toESM(require_main(), 1);
62009
+ var parseBoolean = (value) => {
61972
62010
  if (value === "true" || value === "1")
61973
62011
  return !0;
61974
62012
  if (value === "false" || value === "0")
61975
62013
  return !1;
62014
+ }, parseSerializedParam = (param) => Object.fromEntries(
62015
+ param.split(";").map((pair) => pair.split(":")).map(([key, value]) => [key, encodeURIComponent(value)]).filter(([key, value]) => key && value)
62016
+ ), mergeSerializedParams = (params, extraParams) => {
62017
+ let pairs = parseSerializedParam(params), extra = parseSerializedParam(extraParams);
62018
+ return Object.entries({ ...pairs, ...extra }).map(([key, value]) => `${key}:${value}`).join(";");
61976
62019
  }, prevParams, initialUrlSupport = ({
61977
62020
  state: { location: location4, path, viewMode, storyId: storyIdFromUrl },
61978
62021
  singleStory
@@ -62004,6 +62047,26 @@ var { window: globalWindow4 } = scope, parseBoolean = (value) => {
62004
62047
  let params = Object.entries(queryParams).filter(([, v]) => v).sort(([a3], [b]) => a3 < b ? -1 : 1).map(([k, v]) => `${k}=${v}`), to = [path, ...params].join("&");
62005
62048
  return navigate(to, options);
62006
62049
  }, api = {
62050
+ getStoryHrefs(storyId, options = {}) {
62051
+ let { id: currentStoryId, refId: currentRefId } = fullAPI.getCurrentStoryData() ?? {}, isCurrentStory = storyId === currentStoryId && options.refId === currentRefId, { customQueryParams, location: location4, refs } = store2.getState(), {
62052
+ base,
62053
+ inheritArgs = isCurrentStory,
62054
+ inheritGlobals = !0,
62055
+ queryParams = {},
62056
+ refId,
62057
+ viewMode = "story"
62058
+ } = options;
62059
+ if (refId && !refs[refId])
62060
+ throw new Error(`Invalid refId: ${refId}`);
62061
+ let originAddress = scope.window.location.origin + location4.pathname, networkAddress = scope.STORYBOOK_NETWORK_ADDRESS ?? originAddress, managerBase = base === "origin" ? originAddress : base === "network" ? networkAddress : location4.pathname, previewBase = refId ? refs[refId].url + "/iframe.html" : scope.PREVIEW_URL || `${managerBase}iframe.html`, refParam = refId ? `&refId=${encodeURIComponent(refId)}` : "", { args = "", globals = "", ...otherParams } = queryParams, argsParam = inheritArgs ? mergeSerializedParams(customQueryParams?.args ?? "", args) : args, globalsParam = inheritGlobals ? mergeSerializedParams(customQueryParams?.globals ?? "", globals) : globals, customParams = (0, import_picoquery5.stringify)(otherParams, {
62062
+ nesting: !0,
62063
+ nestingSyntax: "js"
62064
+ });
62065
+ return argsParam = argsParam && `&args=${argsParam}`, globalsParam = globalsParam && `&globals=${globalsParam}`, customParams = customParams && `&${customParams}`, {
62066
+ managerHref: `${managerBase}?path=/${viewMode}/${refId ? `${refId}_` : ""}${storyId}${argsParam}${globalsParam}${customParams}`,
62067
+ previewHref: `${previewBase}?id=${storyId}&viewMode=${viewMode}${refParam}${argsParam}${refId ? "" : globalsParam}${customParams}`
62068
+ };
62069
+ },
62007
62070
  getQueryParam(key) {
62008
62071
  let { customQueryParams } = store2.getState();
62009
62072
  return customQueryParams ? customQueryParams[key] : void 0;
@@ -62046,7 +62109,7 @@ var { window: globalWindow4 } = scope, parseBoolean = (value) => {
62046
62109
  provider.channel?.on(SET_CURRENT_STORY, () => updateArgsParam());
62047
62110
  let handleOrId;
62048
62111
  return provider.channel?.on(STORY_ARGS_UPDATED, () => {
62049
- "requestIdleCallback" in globalWindow4 ? (handleOrId && globalWindow4.cancelIdleCallback(handleOrId), handleOrId = globalWindow4.requestIdleCallback(updateArgsParam, { timeout: 1e3 })) : (handleOrId && clearTimeout(handleOrId), setTimeout(updateArgsParam, 100));
62112
+ "requestIdleCallback" in scope.window ? (handleOrId && scope.window.cancelIdleCallback(handleOrId), handleOrId = scope.window.requestIdleCallback(updateArgsParam, { timeout: 1e3 })) : (handleOrId && clearTimeout(handleOrId), setTimeout(updateArgsParam, 100));
62050
62113
  }), provider.channel?.on(GLOBALS_UPDATED, ({ userGlobals, initialGlobals: initialGlobals5 }) => {
62051
62114
  let { path, hash: hash4 = "", queryParams } = api.getUrlState(), globalsString = buildArgsParam(initialGlobals5, userGlobals);
62052
62115
  navigateTo(`${path}${hash4}`, { ...queryParams, globals: globalsString }, { replace: !0 }), api.setQueryParams({ globals: globalsString });
@@ -62067,7 +62130,7 @@ init_dist();
62067
62130
  var import_memoizerific8 = __toESM(require_memoizerific(), 1), import_semver = __toESM(require_semver2(), 1);
62068
62131
 
62069
62132
  // src/manager-api/version.ts
62070
- var version = "10.2.0-alpha.11";
62133
+ var version = "10.2.0-alpha.13";
62071
62134
 
62072
62135
  // src/manager-api/modules/versions.ts
62073
62136
  var { VERSIONCHECK } = scope, getVersionCheckData = (0, import_memoizerific8.default)(1)(() => {
@@ -70712,6 +70775,7 @@ var fadeIn = keyframes({
70712
70775
  return import_react104.default.createElement(
70713
70776
  Button,
70714
70777
  {
70778
+ type: "button",
70715
70779
  padding: "small",
70716
70780
  ariaLabel: "Close modal",
70717
70781
  variant: "ghost",
@@ -77669,6 +77733,7 @@ var XMLNS = "http://www.w3.org/2000/svg", rotate = keyframes({
77669
77733
  }) => typeof percentage == "number" ? import_react188.default.createElement(Wrapper7, { size, ...props }, children, import_react188.default.createElement(Circle, { size, width, xmlns: XMLNS }, import_react188.default.createElement("circle", null)), running && import_react188.default.createElement(Circle, { size, width, xmlns: XMLNS, spinner: !0 }, import_react188.default.createElement("circle", { strokeDashoffset: Math.PI * (size - Math.ceil(width)) * (1 - percentage / 100) })), import_react188.default.createElement(Circle, { size, width, xmlns: XMLNS, progress: !0 }, import_react188.default.createElement("circle", { strokeDashoffset: Math.PI * (size - Math.ceil(width)) * (1 - percentage / 100) }))) : import_react188.default.createElement(Wrapper7, { size, ...props }, children);
77670
77734
 
77671
77735
  // src/components/components/utils/getStoryHref.ts
77736
+ init_client_logger();
77672
77737
  function parseQuery(queryString) {
77673
77738
  let query = {}, pairs = queryString.split("&");
77674
77739
  for (let i = 0; i < pairs.length; i++) {
@@ -77678,6 +77743,9 @@ function parseQuery(queryString) {
77678
77743
  return query;
77679
77744
  }
77680
77745
  var getStoryHref = (baseUrl, storyId, additionalParams = {}) => {
77746
+ deprecate(
77747
+ "getStoryHref is deprecated and will be removed in Storybook 11, use the api.getStoryHrefs method instead"
77748
+ );
77681
77749
  let [url, paramsStr] = baseUrl.split("?"), params = paramsStr ? {
77682
77750
  ...parseQuery(paramsStr),
77683
77751
  ...additionalParams,