@storybook/react 11.0.0-rc.2 → 11.0.0-rc.3

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,9 +1,11 @@
1
1
  import {
2
2
  buildComponentDocgenFromResolved,
3
3
  isExtractable,
4
- posix,
5
4
  resolveStoryFileComponents
6
- } from "./chunk-E7AXB5JU.js";
5
+ } from "./chunk-XMHC3CJ5.js";
6
+ import {
7
+ posix
8
+ } from "./chunk-M3SEC5XW.js";
7
9
  import {
8
10
  extractArgTypes
9
11
  } from "./chunk-SC3QXTHH.js";
@@ -1107,8 +1107,8 @@ var require_stringify = __commonJS({
1107
1107
  // ../../../node_modules/json5/lib/index.js
1108
1108
  var require_lib = __commonJS({
1109
1109
  "../../../node_modules/json5/lib/index.js"(exports, module) {
1110
- var parse = require_parse(), stringify = require_stringify(), JSON5 = {
1111
- parse,
1110
+ var parse2 = require_parse(), stringify = require_stringify(), JSON5 = {
1111
+ parse: parse2,
1112
1112
  stringify
1113
1113
  };
1114
1114
  module.exports = JSON5;
@@ -1144,12 +1144,12 @@ var require_tsconfig_loader = __commonJS({
1144
1144
  exports.loadTsconfig = exports.walkForTsConfig = exports.tsConfigLoader = void 0;
1145
1145
  var path = __require("path"), fs = __require("fs"), JSON5 = require_lib(), StripBom = require_strip_bom();
1146
1146
  function tsConfigLoader(_a) {
1147
- var getEnv = _a.getEnv, cwd = _a.cwd, _b = _a.loadSync, loadSync = _b === void 0 ? loadSyncDefault : _b, TS_NODE_PROJECT = getEnv("TS_NODE_PROJECT"), TS_NODE_BASEURL = getEnv("TS_NODE_BASEURL"), loadResult = loadSync(cwd, TS_NODE_PROJECT, TS_NODE_BASEURL);
1147
+ var getEnv = _a.getEnv, cwd2 = _a.cwd, _b = _a.loadSync, loadSync = _b === void 0 ? loadSyncDefault : _b, TS_NODE_PROJECT = getEnv("TS_NODE_PROJECT"), TS_NODE_BASEURL = getEnv("TS_NODE_BASEURL"), loadResult = loadSync(cwd2, TS_NODE_PROJECT, TS_NODE_BASEURL);
1148
1148
  return loadResult;
1149
1149
  }
1150
1150
  exports.tsConfigLoader = tsConfigLoader;
1151
- function loadSyncDefault(cwd, filename, baseUrl) {
1152
- var configPath = resolveConfigPath(cwd, filename);
1151
+ function loadSyncDefault(cwd2, filename, baseUrl) {
1152
+ var configPath = resolveConfigPath(cwd2, filename);
1153
1153
  if (!configPath)
1154
1154
  return {
1155
1155
  tsConfigPath: void 0,
@@ -1163,14 +1163,14 @@ var require_tsconfig_loader = __commonJS({
1163
1163
  paths: config && config.compilerOptions && config.compilerOptions.paths
1164
1164
  };
1165
1165
  }
1166
- function resolveConfigPath(cwd, filename) {
1166
+ function resolveConfigPath(cwd2, filename) {
1167
1167
  if (filename) {
1168
- var absolutePath = fs.lstatSync(filename).isDirectory() ? path.resolve(filename, "./tsconfig.json") : path.resolve(cwd, filename);
1168
+ var absolutePath = fs.lstatSync(filename).isDirectory() ? path.resolve(filename, "./tsconfig.json") : path.resolve(cwd2, filename);
1169
1169
  return absolutePath;
1170
1170
  }
1171
- if (fs.statSync(cwd).isFile())
1172
- return path.resolve(cwd);
1173
- var configAbsolutePath = walkForTsConfig(cwd);
1171
+ if (fs.statSync(cwd2).isFile())
1172
+ return path.resolve(cwd2);
1173
+ var configAbsolutePath = walkForTsConfig(cwd2);
1174
1174
  return configAbsolutePath ? path.resolve(configAbsolutePath) : void 0;
1175
1175
  }
1176
1176
  function walkForTsConfig(directory, readdirSync) {
@@ -1231,14 +1231,14 @@ var require_config_loader = __commonJS({
1231
1231
  Object.defineProperty(exports, "__esModule", { value: !0 });
1232
1232
  exports.configLoader = exports.loadConfig = void 0;
1233
1233
  var TsConfigLoader2 = require_tsconfig_loader(), path = __require("path");
1234
- function loadConfig2(cwd) {
1235
- return cwd === void 0 && (cwd = process.cwd()), configLoader({ cwd });
1234
+ function loadConfig2(cwd2) {
1235
+ return cwd2 === void 0 && (cwd2 = process.cwd()), configLoader({ cwd: cwd2 });
1236
1236
  }
1237
1237
  exports.loadConfig = loadConfig2;
1238
1238
  function configLoader(_a) {
1239
- var cwd = _a.cwd, explicitParams = _a.explicitParams, _b = _a.tsConfigLoader, tsConfigLoader = _b === void 0 ? TsConfigLoader2.tsConfigLoader : _b;
1239
+ var cwd2 = _a.cwd, explicitParams = _a.explicitParams, _b = _a.tsConfigLoader, tsConfigLoader = _b === void 0 ? TsConfigLoader2.tsConfigLoader : _b;
1240
1240
  if (explicitParams) {
1241
- var absoluteBaseUrl = path.isAbsolute(explicitParams.baseUrl) ? explicitParams.baseUrl : path.join(cwd, explicitParams.baseUrl);
1241
+ var absoluteBaseUrl = path.isAbsolute(explicitParams.baseUrl) ? explicitParams.baseUrl : path.join(cwd2, explicitParams.baseUrl);
1242
1242
  return {
1243
1243
  resultType: "success",
1244
1244
  configFileAbsolutePath: "",
@@ -1250,7 +1250,7 @@ var require_config_loader = __commonJS({
1250
1250
  };
1251
1251
  }
1252
1252
  var loadResult = tsConfigLoader({
1253
- cwd,
1253
+ cwd: cwd2,
1254
1254
  getEnv: function(key) {
1255
1255
  return process.env[key];
1256
1256
  }
@@ -1441,9 +1441,9 @@ var require_register = __commonJS({
1441
1441
  return coreModules;
1442
1442
  }
1443
1443
  function register(params) {
1444
- var cwd, explicitParams;
1444
+ var cwd2, explicitParams;
1445
1445
  if (params)
1446
- cwd = params.cwd, (params.baseUrl || params.paths) && (explicitParams = params);
1446
+ cwd2 = params.cwd, (params.baseUrl || params.paths) && (explicitParams = params);
1447
1447
  else {
1448
1448
  var minimist = require_minimist(), argv = minimist(process.argv.slice(2), {
1449
1449
  // eslint-disable-next-line id-denylist
@@ -1452,10 +1452,10 @@ var require_register = __commonJS({
1452
1452
  project: ["P"]
1453
1453
  }
1454
1454
  });
1455
- cwd = argv.project;
1455
+ cwd2 = argv.project;
1456
1456
  }
1457
1457
  var configLoaderResult = (0, config_loader_1.configLoader)({
1458
- cwd: cwd ?? process.cwd(),
1458
+ cwd: cwd2 ?? process.cwd(),
1459
1459
  explicitParams
1460
1460
  });
1461
1461
  if (configLoaderResult.resultType === "failed")
@@ -1510,6 +1510,296 @@ var require_lib2 = __commonJS({
1510
1510
  }
1511
1511
  });
1512
1512
 
1513
+ // ../../../node_modules/pathe/dist/shared/pathe.M-eThtNZ.mjs
1514
+ var _lazyMatch = () => {
1515
+ var __lib__ = (() => {
1516
+ var m = Object.defineProperty, V = Object.getOwnPropertyDescriptor, G = Object.getOwnPropertyNames, T = Object.prototype.hasOwnProperty, q = (r, e) => {
1517
+ for (var n in e) m(r, n, { get: e[n], enumerable: !0 });
1518
+ }, H = (r, e, n, a) => {
1519
+ if (e && typeof e == "object" || typeof e == "function") for (let t of G(e)) !T.call(r, t) && t !== n && m(r, t, { get: () => e[t], enumerable: !(a = V(e, t)) || a.enumerable });
1520
+ return r;
1521
+ }, J = (r) => H(m({}, "__esModule", { value: !0 }), r), w = {};
1522
+ q(w, { default: () => re });
1523
+ var A = (r) => Array.isArray(r), d = (r) => typeof r == "function", Q = (r) => r.length === 0, W = (r) => typeof r == "number", K = (r) => typeof r == "object" && r !== null, X = (r) => r instanceof RegExp, b = (r) => typeof r == "string", h = (r) => r === void 0, Y = (r) => {
1524
+ let e = /* @__PURE__ */ new Map();
1525
+ return (n) => {
1526
+ let a = e.get(n);
1527
+ if (a) return a;
1528
+ let t = r(n);
1529
+ return e.set(n, t), t;
1530
+ };
1531
+ }, rr = (r, e, n = {}) => {
1532
+ let a = { cache: {}, input: r, index: 0, indexMax: 0, options: n, output: [] };
1533
+ if (v(e)(a) && a.index === r.length) return a.output;
1534
+ throw new Error(`Failed to parse at index ${a.indexMax}`);
1535
+ }, i = (r, e) => A(r) ? er(r, e) : b(r) ? ar(r, e) : nr(r, e), er = (r, e) => {
1536
+ let n = {};
1537
+ for (let a of r) {
1538
+ if (a.length !== 1) throw new Error(`Invalid character: "${a}"`);
1539
+ let t = a.charCodeAt(0);
1540
+ n[t] = !0;
1541
+ }
1542
+ return (a) => {
1543
+ let t = a.index, o = a.input;
1544
+ for (; a.index < o.length && o.charCodeAt(a.index) in n; ) a.index += 1;
1545
+ let u = a.index;
1546
+ if (u > t) {
1547
+ if (!h(e) && !a.options.silent) {
1548
+ let s = a.input.slice(t, u), c = d(e) ? e(s, o, String(t)) : e;
1549
+ h(c) || a.output.push(c);
1550
+ }
1551
+ a.indexMax = Math.max(a.indexMax, a.index);
1552
+ }
1553
+ return !0;
1554
+ };
1555
+ }, nr = (r, e) => {
1556
+ let n = r.source, a = r.flags.replace(/y|$/, "y"), t = new RegExp(n, a);
1557
+ return g((o) => {
1558
+ t.lastIndex = o.index;
1559
+ let u = t.exec(o.input);
1560
+ if (u) {
1561
+ if (!h(e) && !o.options.silent) {
1562
+ let s = d(e) ? e(...u, o.input, String(o.index)) : e;
1563
+ h(s) || o.output.push(s);
1564
+ }
1565
+ return o.index += u[0].length, o.indexMax = Math.max(o.indexMax, o.index), !0;
1566
+ } else return !1;
1567
+ });
1568
+ }, ar = (r, e) => (n) => {
1569
+ if (n.input.startsWith(r, n.index)) {
1570
+ if (!h(e) && !n.options.silent) {
1571
+ let t = d(e) ? e(r, n.input, String(n.index)) : e;
1572
+ h(t) || n.output.push(t);
1573
+ }
1574
+ return n.index += r.length, n.indexMax = Math.max(n.indexMax, n.index), !0;
1575
+ } else return !1;
1576
+ }, C = (r, e, n, a) => {
1577
+ let t = v(r);
1578
+ return g(_(M((o) => {
1579
+ let u = 0;
1580
+ for (; u < n; ) {
1581
+ let s = o.index;
1582
+ if (!t(o) || (u += 1, o.index === s)) break;
1583
+ }
1584
+ return u >= e;
1585
+ })));
1586
+ }, tr = (r, e) => C(r, 0, 1), f = (r, e) => C(r, 0, 1 / 0), x = (r, e) => {
1587
+ let n = r.map(v);
1588
+ return g(_(M((a) => {
1589
+ for (let t = 0, o = n.length; t < o; t++) if (!n[t](a)) return !1;
1590
+ return !0;
1591
+ })));
1592
+ }, l = (r, e) => {
1593
+ let n = r.map(v);
1594
+ return g(_((a) => {
1595
+ for (let t = 0, o = n.length; t < o; t++) if (n[t](a)) return !0;
1596
+ return !1;
1597
+ }));
1598
+ }, M = (r, e = !1) => {
1599
+ let n = v(r);
1600
+ return (a) => {
1601
+ let t = a.index, o = a.output.length, u = n(a);
1602
+ return (!u || e) && (a.index = t, a.output.length !== o && (a.output.length = o)), u;
1603
+ };
1604
+ }, _ = (r, e) => v(r), g = /* @__PURE__ */ (() => {
1605
+ let r = 0;
1606
+ return (e) => {
1607
+ let n = v(e), a = r += 1;
1608
+ return (t) => {
1609
+ var o;
1610
+ if (t.options.memoization === !1) return n(t);
1611
+ let u = t.index, s = (o = t.cache)[a] || (o[a] = /* @__PURE__ */ new Map()), c = s.get(u);
1612
+ if (c === !1) return !1;
1613
+ if (W(c)) return t.index = c, !0;
1614
+ if (c) return t.index = c.index, c.output?.length && t.output.push(...c.output), !0;
1615
+ {
1616
+ let Z = t.output.length;
1617
+ if (n(t)) {
1618
+ let D = t.index, U = t.output.length;
1619
+ if (U > Z) {
1620
+ let ee = t.output.slice(Z, U);
1621
+ s.set(u, { index: D, output: ee });
1622
+ } else s.set(u, D);
1623
+ return !0;
1624
+ } else return s.set(u, !1), !1;
1625
+ }
1626
+ };
1627
+ };
1628
+ })(), E = (r) => {
1629
+ let e;
1630
+ return (n) => (e || (e = v(r())), e(n));
1631
+ }, v = Y((r) => {
1632
+ if (d(r)) return Q(r) ? E(r) : r;
1633
+ if (b(r) || X(r)) return i(r);
1634
+ if (A(r)) return x(r);
1635
+ if (K(r)) return l(Object.values(r));
1636
+ throw new Error("Invalid rule");
1637
+ }), P = "abcdefghijklmnopqrstuvwxyz", ir = (r) => {
1638
+ let e = "";
1639
+ for (; r > 0; ) {
1640
+ let n = (r - 1) % 26;
1641
+ e = P[n] + e, r = Math.floor((r - 1) / 26);
1642
+ }
1643
+ return e;
1644
+ }, O = (r) => {
1645
+ let e = 0;
1646
+ for (let n = 0, a = r.length; n < a; n++) e = e * 26 + P.indexOf(r[n]) + 1;
1647
+ return e;
1648
+ }, S = (r, e) => {
1649
+ if (e < r) return S(e, r);
1650
+ let n = [];
1651
+ for (; r <= e; ) n.push(r++);
1652
+ return n;
1653
+ }, or = (r, e, n) => S(r, e).map((a) => String(a).padStart(n, "0")), R = (r, e) => S(O(r), O(e)).map(ir), p = (r) => r, z = (r) => ur((e) => rr(e, r, { memoization: !1 }).join("")), ur = (r) => {
1654
+ let e = {};
1655
+ return (n) => e[n] ?? (e[n] = r(n));
1656
+ }, sr = i(/^\*\*\/\*$/, ".*"), cr = i(/^\*\*\/(\*)?([ a-zA-Z0-9._-]+)$/, (r, e, n) => `.*${e ? "" : "(?:^|/)"}${n.replaceAll(".", "\\.")}`), lr = i(/^\*\*\/(\*)?([ a-zA-Z0-9._-]*)\{([ a-zA-Z0-9._-]+(?:,[ a-zA-Z0-9._-]+)*)\}$/, (r, e, n, a) => `.*${e ? "" : "(?:^|/)"}${n.replaceAll(".", "\\.")}(?:${a.replaceAll(",", "|").replaceAll(".", "\\.")})`), y = i(/\\./, p), pr = i(/[$.*+?^(){}[\]\|]/, (r) => `\\${r}`), vr = i(/./, p), hr = i(/^(?:!!)*!(.*)$/, (r, e) => `(?!^${L(e)}$).*?`), dr = i(/^(!!)+/, ""), fr = l([hr, dr]), xr = i(/\/(\*\*\/)+/, "(?:/.+/|/)"), gr = i(/^(\*\*\/)+/, "(?:^|.*/)"), mr = i(/\/(\*\*)$/, "(?:/.*|$)"), _r = i(/\*\*/, ".*"), j = l([xr, gr, mr, _r]), Sr = i(/\*\/(?!\*\*\/)/, "[^/]*/"), yr = i(/\*/, "[^/]*"), N = l([Sr, yr]), k = i("?", "[^/]"), $r = i("[", p), wr = i("]", p), Ar = i(/[!^]/, "^/"), br = i(/[a-z]-[a-z]|[0-9]-[0-9]/i, p), Cr = i(/[$.*+?^(){}[\|]/, (r) => `\\${r}`), Mr = i(/[^\]]/, p), Er = l([y, Cr, br, Mr]), B = x([$r, tr(Ar), f(Er), wr]), Pr = i("{", "(?:"), Or = i("}", ")"), Rr = i(/(\d+)\.\.(\d+)/, (r, e, n) => or(+e, +n, Math.min(e.length, n.length)).join("|")), zr = i(/([a-z]+)\.\.([a-z]+)/, (r, e, n) => R(e, n).join("|")), jr = i(/([A-Z]+)\.\.([A-Z]+)/, (r, e, n) => R(e.toLowerCase(), n.toLowerCase()).join("|").toUpperCase()), Nr = l([Rr, zr, jr]), I = x([Pr, Nr, Or]), kr = i("{", "(?:"), Br = i("}", ")"), Ir = i(",", "|"), Fr = i(/[$.*+?^(){[\]\|]/, (r) => `\\${r}`), Lr = i(/[^}]/, p), Zr = E(() => F), Dr = l([j, N, k, B, I, Zr, y, Fr, Ir, Lr]), F = x([kr, f(Dr), Br]), Ur = f(l([sr, cr, lr, fr, j, N, k, B, I, F, y, pr, vr])), Vr = Ur, Gr = z(Vr), L = Gr, Tr = i(/\\./, p), qr = i(/./, p), Hr = i(/\*\*\*+/, "*"), Jr = i(/([^/{[(!])\*\*/, (r, e) => `${e}*`), Qr = i(/(^|.)\*\*(?=[^*/)\]}])/, (r, e) => `${e}*`), Wr = f(l([Tr, Hr, Jr, Qr, qr])), Kr = Wr, Xr = z(Kr), Yr = Xr, $ = (r, e) => {
1657
+ let n = Array.isArray(r) ? r : [r];
1658
+ if (!n.length) return !1;
1659
+ let a = n.map($.compile), t = n.every((s) => /(\/(?:\*\*)?|\[\/\])$/.test(s)), o = e.replace(/[\\\/]+/g, "/").replace(/\/$/, t ? "/" : "");
1660
+ return a.some((s) => s.test(o));
1661
+ };
1662
+ $.compile = (r) => new RegExp(`^${L(Yr(r))}$`, "s");
1663
+ var re = $;
1664
+ return J(w);
1665
+ })();
1666
+ return __lib__.default || __lib__;
1667
+ }, _match, zeptomatch = (path, pattern) => (_match || (_match = _lazyMatch(), _lazyMatch = null), _match(path, pattern)), _DRIVE_LETTER_START_RE = /^[A-Za-z]:\//;
1668
+ function normalizeWindowsPath(input = "") {
1669
+ return input && input.replace(/\\/g, "/").replace(_DRIVE_LETTER_START_RE, (r) => r.toUpperCase());
1670
+ }
1671
+ var _UNC_REGEX = /^[/\\]{2}/, _IS_ABSOLUTE_RE = /^[/\\](?![/\\])|^[/\\]{2}(?!\.)|^[A-Za-z]:[/\\]/, _DRIVE_LETTER_RE = /^[A-Za-z]:$/, _ROOT_FOLDER_RE = /^\/([A-Za-z]:)?$/, _EXTNAME_RE = /.(\.[^./]+|\.)$/, _PATH_ROOT_RE = /^[/\\]|^[a-zA-Z]:[/\\]/, sep = "/", normalize = function(path) {
1672
+ if (path.length === 0)
1673
+ return ".";
1674
+ path = normalizeWindowsPath(path);
1675
+ let isUNCPath = path.match(_UNC_REGEX), isPathAbsolute = isAbsolute(path), trailingSeparator = path[path.length - 1] === "/";
1676
+ return path = normalizeString(path, !isPathAbsolute), path.length === 0 ? isPathAbsolute ? "/" : trailingSeparator ? "./" : "." : (trailingSeparator && (path += "/"), _DRIVE_LETTER_RE.test(path) && (path += "/"), isUNCPath ? isPathAbsolute ? `//${path}` : `//./${path}` : isPathAbsolute && !isAbsolute(path) ? `/${path}` : path);
1677
+ }, join = function(...segments) {
1678
+ let path = "";
1679
+ for (let seg of segments)
1680
+ if (seg)
1681
+ if (path.length > 0) {
1682
+ let pathTrailing = path[path.length - 1] === "/", segLeading = seg[0] === "/";
1683
+ pathTrailing && segLeading ? path += seg.slice(1) : path += pathTrailing || segLeading ? seg : `/${seg}`;
1684
+ } else
1685
+ path += seg;
1686
+ return normalize(path);
1687
+ };
1688
+ function cwd() {
1689
+ return typeof process < "u" && typeof process.cwd == "function" ? process.cwd().replace(/\\/g, "/") : "/";
1690
+ }
1691
+ var resolve = function(...arguments_) {
1692
+ arguments_ = arguments_.map((argument) => normalizeWindowsPath(argument));
1693
+ let resolvedPath = "", resolvedAbsolute = !1;
1694
+ for (let index = arguments_.length - 1; index >= -1 && !resolvedAbsolute; index--) {
1695
+ let path = index >= 0 ? arguments_[index] : cwd();
1696
+ !path || path.length === 0 || (resolvedPath = `${path}/${resolvedPath}`, resolvedAbsolute = isAbsolute(path));
1697
+ }
1698
+ return resolvedPath = normalizeString(resolvedPath, !resolvedAbsolute), resolvedAbsolute && !isAbsolute(resolvedPath) ? `/${resolvedPath}` : resolvedPath.length > 0 ? resolvedPath : ".";
1699
+ };
1700
+ function normalizeString(path, allowAboveRoot) {
1701
+ let res = "", lastSegmentLength = 0, lastSlash = -1, dots = 0, char = null;
1702
+ for (let index = 0; index <= path.length; ++index) {
1703
+ if (index < path.length)
1704
+ char = path[index];
1705
+ else {
1706
+ if (char === "/")
1707
+ break;
1708
+ char = "/";
1709
+ }
1710
+ if (char === "/") {
1711
+ if (!(lastSlash === index - 1 || dots === 1)) if (dots === 2) {
1712
+ if (res.length < 2 || lastSegmentLength !== 2 || res[res.length - 1] !== "." || res[res.length - 2] !== ".") {
1713
+ if (res.length > 2) {
1714
+ let lastSlashIndex = res.lastIndexOf("/");
1715
+ lastSlashIndex === -1 ? (res = "", lastSegmentLength = 0) : (res = res.slice(0, lastSlashIndex), lastSegmentLength = res.length - 1 - res.lastIndexOf("/")), lastSlash = index, dots = 0;
1716
+ continue;
1717
+ } else if (res.length > 0) {
1718
+ res = "", lastSegmentLength = 0, lastSlash = index, dots = 0;
1719
+ continue;
1720
+ }
1721
+ }
1722
+ allowAboveRoot && (res += res.length > 0 ? "/.." : "..", lastSegmentLength = 2);
1723
+ } else
1724
+ res.length > 0 ? res += `/${path.slice(lastSlash + 1, index)}` : res = path.slice(lastSlash + 1, index), lastSegmentLength = index - lastSlash - 1;
1725
+ lastSlash = index, dots = 0;
1726
+ } else char === "." && dots !== -1 ? ++dots : dots = -1;
1727
+ }
1728
+ return res;
1729
+ }
1730
+ var isAbsolute = function(p) {
1731
+ return _IS_ABSOLUTE_RE.test(p);
1732
+ }, toNamespacedPath = function(p) {
1733
+ return normalizeWindowsPath(p);
1734
+ }, extname = function(p) {
1735
+ if (p === "..") return "";
1736
+ let match = _EXTNAME_RE.exec(normalizeWindowsPath(p));
1737
+ return match && match[1] || "";
1738
+ }, relative = function(from, to) {
1739
+ let _from = resolve(from).replace(_ROOT_FOLDER_RE, "$1").split("/"), _to = resolve(to).replace(_ROOT_FOLDER_RE, "$1").split("/");
1740
+ if (_to[0][1] === ":" && _from[0][1] === ":" && _from[0] !== _to[0])
1741
+ return _to.join("/");
1742
+ let _fromCopy = [..._from];
1743
+ for (let segment of _fromCopy) {
1744
+ if (_to[0] !== segment)
1745
+ break;
1746
+ _from.shift(), _to.shift();
1747
+ }
1748
+ return [..._from.map(() => ".."), ..._to].join("/");
1749
+ }, dirname = function(p) {
1750
+ let segments = normalizeWindowsPath(p).replace(/\/$/, "").split("/").slice(0, -1);
1751
+ return segments.length === 1 && _DRIVE_LETTER_RE.test(segments[0]) && (segments[0] += "/"), segments.join("/") || (isAbsolute(p) ? "/" : ".");
1752
+ }, format = function(p) {
1753
+ let ext = p.ext ? p.ext.startsWith(".") ? p.ext : `.${p.ext}` : "", segments = [p.root, p.dir, p.base ?? (p.name ?? "") + ext].filter(
1754
+ Boolean
1755
+ );
1756
+ return normalizeWindowsPath(
1757
+ p.root ? resolve(...segments) : segments.join("/")
1758
+ );
1759
+ }, basename = function(p, extension) {
1760
+ let segments = normalizeWindowsPath(p).split("/"), lastSegment = "";
1761
+ for (let i = segments.length - 1; i >= 0; i--) {
1762
+ let val = segments[i];
1763
+ if (val) {
1764
+ lastSegment = val;
1765
+ break;
1766
+ }
1767
+ }
1768
+ return extension && lastSegment.endsWith(extension) ? lastSegment.slice(0, -extension.length) : lastSegment;
1769
+ }, parse = function(p) {
1770
+ let root = _PATH_ROOT_RE.exec(p)?.[0]?.replace(/\\/g, "/") || "", base = basename(p), extension = extname(base);
1771
+ return {
1772
+ root,
1773
+ dir: dirname(p),
1774
+ base,
1775
+ ext: extension,
1776
+ name: base.slice(0, base.length - extension.length)
1777
+ };
1778
+ }, matchesGlob = (path, pattern) => zeptomatch(pattern, normalize(path)), _path = {
1779
+ __proto__: null,
1780
+ basename,
1781
+ dirname,
1782
+ extname,
1783
+ format,
1784
+ isAbsolute,
1785
+ join,
1786
+ matchesGlob,
1787
+ normalize,
1788
+ normalizeString,
1789
+ parse,
1790
+ relative,
1791
+ resolve,
1792
+ sep,
1793
+ toNamespacedPath
1794
+ };
1795
+
1796
+ // ../../../node_modules/pathe/dist/index.mjs
1797
+ var delimiter = globalThis.process?.platform === "win32" ? ";" : ":", _platforms = { posix: void 0, win32: void 0 }, mix = (del = delimiter) => new Proxy(_path, {
1798
+ get(_, prop) {
1799
+ return prop === "delimiter" ? del : prop === "posix" ? posix : prop === "win32" ? win32 : _platforms[prop] || _path[prop];
1800
+ }
1801
+ }), posix = /* @__PURE__ */ mix(":"), win32 = /* @__PURE__ */ mix(";");
1802
+
1513
1803
  // src/componentManifest/utils.ts
1514
1804
  import { readFileSync, statSync as statSync2 } from "node:fs";
1515
1805
  import {
@@ -1519,22 +1809,22 @@ import {
1519
1809
  import { logger } from "storybook/internal/node-logger";
1520
1810
 
1521
1811
  // ../../../node_modules/empathic/find.mjs
1522
- import { join as join2 } from "node:path";
1812
+ import { join as join3 } from "node:path";
1523
1813
  import { existsSync, statSync } from "node:fs";
1524
1814
 
1525
1815
  // ../../../node_modules/empathic/walk.mjs
1526
- import { dirname } from "node:path";
1816
+ import { dirname as dirname2 } from "node:path";
1527
1817
 
1528
1818
  // ../../../node_modules/empathic/resolve.mjs
1529
- import { isAbsolute, join, resolve } from "node:path";
1819
+ import { isAbsolute as isAbsolute2, join as join2, resolve as resolve2 } from "node:path";
1530
1820
  function absolute(input, root) {
1531
- return isAbsolute(input) ? input : resolve(root || ".", input);
1821
+ return isAbsolute2(input) ? input : resolve2(root || ".", input);
1532
1822
  }
1533
1823
 
1534
1824
  // ../../../node_modules/empathic/walk.mjs
1535
1825
  function up(base, options) {
1536
- let { last, cwd } = options || {}, tmp = absolute(base, cwd), root = absolute(last || "/", cwd), prev, arr = [];
1537
- for (; prev !== root && (arr.push(tmp), tmp = dirname(prev = tmp), tmp !== prev); )
1826
+ let { last, cwd: cwd2 } = options || {}, tmp = absolute(base, cwd2), root = absolute(last || "/", cwd2), prev, arr = [];
1827
+ for (; prev !== root && (arr.push(tmp), tmp = dirname2(prev = tmp), tmp !== prev); )
1538
1828
  ;
1539
1829
  return arr;
1540
1830
  }
@@ -1543,7 +1833,7 @@ function up(base, options) {
1543
1833
  function up2(name, options) {
1544
1834
  let dir, tmp, start = options && options.cwd || "";
1545
1835
  for (dir of up(start, options))
1546
- if (tmp = join2(dir, name), existsSync(tmp)) return tmp;
1836
+ if (tmp = join3(dir, name), existsSync(tmp)) return tmp;
1547
1837
  }
1548
1838
 
1549
1839
  // src/componentManifest/utils.ts
@@ -1612,7 +1902,7 @@ var memoStore = /* @__PURE__ */ new WeakMap(), asyncMemoStore = /* @__PURE__ */
1612
1902
  }, cachedFindUp = cached(up2, { name: "findUp" }), cachedResolveImport = cached(resolveImport, {
1613
1903
  name: "resolveImport"
1614
1904
  }), findTsconfigPath = cached(
1615
- (cwd) => findTsconfigPathCommon(cwd),
1905
+ (cwd2) => findTsconfigPathCommon(cwd2),
1616
1906
  {
1617
1907
  name: "findTsconfigPath"
1618
1908
  }
@@ -1648,6 +1938,10 @@ function getImportTag(docgen) {
1648
1938
  }
1649
1939
 
1650
1940
  export {
1941
+ join,
1942
+ isAbsolute,
1943
+ relative,
1944
+ posix,
1651
1945
  groupByToMap,
1652
1946
  invariant,
1653
1947
  cached,
@@ -1,4 +1,4 @@
1
- import { createRequire as CJS_COMPAT_CREATE_REQUIRE_4ivfdpbtpvp } from "node:module";var require = CJS_COMPAT_CREATE_REQUIRE_4ivfdpbtpvp(import.meta.url);
1
+ import { createRequire as CJS_COMPAT_CREATE_REQUIRE_nvv6a8j4fqg } from "node:module";var require = CJS_COMPAT_CREATE_REQUIRE_nvv6a8j4fqg(import.meta.url);
2
2
  var __create = Object.create;
3
3
  var __defProp = Object.defineProperty;
4
4
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
@@ -2,8 +2,9 @@ import {
2
2
  cached,
3
3
  cachedReadFileSync,
4
4
  cachedResolveImport,
5
- matchPath
6
- } from "./chunk-CJ2XYAXX.js";
5
+ matchPath,
6
+ relative
7
+ } from "./chunk-M3SEC5XW.js";
7
8
  import {
8
9
  require_dist
9
10
  } from "./chunk-QKPKKS4R.js";
@@ -1032,12 +1033,12 @@ var require_resolve = __commonJS({
1032
1033
  });
1033
1034
 
1034
1035
  // src/componentManifest/reactDocgen.ts
1035
- var import_ts_dedent = __toESM(require_dist(), 1);
1036
1036
  import { existsSync } from "node:fs";
1037
1037
  import { dirname, sep } from "node:path";
1038
1038
  import { supportedExtensions as supportedExtensions2 } from "storybook/internal/common";
1039
1039
  import { parseModule } from "storybook/internal/csf-tools";
1040
1040
  import { logger } from "storybook/internal/node-logger";
1041
+ var import_ts_dedent = __toESM(require_dist(), 1);
1041
1042
  import {
1042
1043
  builtinHandlers as docgenHandlers,
1043
1044
  builtinResolvers as docgenResolver,
@@ -1291,7 +1292,7 @@ var parseWithReactDocgen = cached(
1291
1292
  path,
1292
1293
  code: "/* File not found or unreadable */",
1293
1294
  name: "Component file could not be read",
1294
- message: `Could not read the component file located at "${path}".
1295
+ message: `Could not read the component file located at "${relative(process.cwd(), path)}".
1295
1296
  Prefer relative imports if possible.`
1296
1297
  }
1297
1298
  ]
@@ -1321,7 +1322,10 @@ Prefer relative imports if possible.`
1321
1322
  errors
1322
1323
  };
1323
1324
  } catch (e) {
1324
- let message = e instanceof Error ? e.message : String(e);
1325
+ let message = (e instanceof Error ? e.message : String(e)).replaceAll(
1326
+ path,
1327
+ relative(process.cwd(), path)
1328
+ );
1325
1329
  return {
1326
1330
  docgens,
1327
1331
  errors: [
@@ -1347,7 +1351,7 @@ Prefer relative imports if possible.`
1347
1351
  name: errors.at(-1)?.name ?? "No component definition found",
1348
1352
  message: errors.map(
1349
1353
  (e) => import_ts_dedent.dedent`
1350
- File: ${e.path}
1354
+ File: ${relative(process.cwd(), e.path)}
1351
1355
  Error:
1352
1356
  ${e.message}
1353
1357
  Code:
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  ComponentMetaManager,
3
3
  loadDocgenTypeScript
4
- } from "./chunk-E7AXB5JU.js";
4
+ } from "./chunk-XMHC3CJ5.js";
5
5
 
6
6
  // src/componentManifest/componentMetaManagerSingleton.ts
7
7
  import { logger } from "storybook/internal/node-logger";
@@ -11,8 +11,10 @@ import {
11
11
  getImportTag,
12
12
  groupByToMap,
13
13
  invariant,
14
- matchPath
15
- } from "./chunk-CJ2XYAXX.js";
14
+ matchPath,
15
+ posix,
16
+ relative
17
+ } from "./chunk-M3SEC5XW.js";
16
18
  import {
17
19
  __commonJS,
18
20
  __toESM
@@ -1563,7 +1565,7 @@ var require_proxyLanguageService = __commonJS({
1563
1565
  };
1564
1566
  }
1565
1567
  function getEncodedSemanticClassifications(language, getEncodedSemanticClassifications2) {
1566
- return (filePath, span, format2) => {
1568
+ return (filePath, span, format) => {
1567
1569
  let fileName = filePath.replace(windowsPathReg, "/"), [serviceScript, targetScript, sourceScript] = (0, utils_1.getServiceScript)(language, fileName);
1568
1570
  if (targetScript?.associatedOnly)
1569
1571
  return {
@@ -1577,7 +1579,7 @@ var require_proxyLanguageService = __commonJS({
1577
1579
  spans: [],
1578
1580
  endOfLineState: 0
1579
1581
  };
1580
- let mappingOffset = (0, transform_1.getMappingOffset)(language, serviceScript), start = mapped.start + mappingOffset, end = mapped.end + mappingOffset, result = getEncodedSemanticClassifications2(targetScript.id, { start, length: end - start }, format2), spans = [];
1582
+ let mappingOffset = (0, transform_1.getMappingOffset)(language, serviceScript), start = mapped.start + mappingOffset, end = mapped.end + mappingOffset, result = getEncodedSemanticClassifications2(targetScript.id, { start, length: end - start }, format), spans = [];
1581
1583
  for (let i = 0; i < result.spans.length; i += 3)
1582
1584
  for (let [_, sourceStart, sourceEnd] of (0, transform_1.toSourceRanges)(sourceScript, language, serviceScript, result.spans[i], result.spans[i] + result.spans[i + 1], !1, language_core_1.isSemanticTokensEnabled)) {
1583
1585
  spans.push(sourceStart, sourceEnd - sourceStart, result.spans[i + 2]);
@@ -1585,7 +1587,7 @@ var require_proxyLanguageService = __commonJS({
1585
1587
  }
1586
1588
  return result.spans = spans, result;
1587
1589
  } else
1588
- return getEncodedSemanticClassifications2(fileName, span, format2);
1590
+ return getEncodedSemanticClassifications2(fileName, span, format);
1589
1591
  };
1590
1592
  }
1591
1593
  function getSyntacticDiagnostics(language, languageService, getSyntacticDiagnostics2) {
@@ -1833,23 +1835,23 @@ var require_path_browserify = __commonJS({
1833
1835
  }
1834
1836
  return res;
1835
1837
  }
1836
- function _format(sep2, pathObject) {
1838
+ function _format(sep, pathObject) {
1837
1839
  var dir = pathObject.dir || pathObject.root, base = pathObject.base || (pathObject.name || "") + (pathObject.ext || "");
1838
- return dir ? dir === pathObject.root ? dir + base : dir + sep2 + base : base;
1840
+ return dir ? dir === pathObject.root ? dir + base : dir + sep + base : base;
1839
1841
  }
1840
1842
  var posix2 = {
1841
1843
  // path.resolve([from ...], to)
1842
1844
  resolve: function() {
1843
- for (var resolvedPath = "", resolvedAbsolute = !1, cwd2, i = arguments.length - 1; i >= -1 && !resolvedAbsolute; i--) {
1845
+ for (var resolvedPath = "", resolvedAbsolute = !1, cwd, i = arguments.length - 1; i >= -1 && !resolvedAbsolute; i--) {
1844
1846
  var path2;
1845
- i >= 0 ? path2 = arguments[i] : (cwd2 === void 0 && (cwd2 = process.cwd()), path2 = cwd2), assertPath(path2), path2.length !== 0 && (resolvedPath = path2 + "/" + resolvedPath, resolvedAbsolute = path2.charCodeAt(0) === 47);
1847
+ i >= 0 ? path2 = arguments[i] : (cwd === void 0 && (cwd = process.cwd()), path2 = cwd), assertPath(path2), path2.length !== 0 && (resolvedPath = path2 + "/" + resolvedPath, resolvedAbsolute = path2.charCodeAt(0) === 47);
1846
1848
  }
1847
1849
  return resolvedPath = normalizeStringPosix(resolvedPath, !resolvedAbsolute), resolvedAbsolute ? resolvedPath.length > 0 ? "/" + resolvedPath : "/" : resolvedPath.length > 0 ? resolvedPath : ".";
1848
1850
  },
1849
1851
  normalize: function(path2) {
1850
1852
  if (assertPath(path2), path2.length === 0) return ".";
1851
- var isAbsolute3 = path2.charCodeAt(0) === 47, trailingSeparator = path2.charCodeAt(path2.length - 1) === 47;
1852
- return path2 = normalizeStringPosix(path2, !isAbsolute3), path2.length === 0 && !isAbsolute3 && (path2 = "."), path2.length > 0 && trailingSeparator && (path2 += "/"), isAbsolute3 ? "/" + path2 : path2;
1853
+ var isAbsolute2 = path2.charCodeAt(0) === 47, trailingSeparator = path2.charCodeAt(path2.length - 1) === 47;
1854
+ return path2 = normalizeStringPosix(path2, !isAbsolute2), path2.length === 0 && !isAbsolute2 && (path2 = "."), path2.length > 0 && trailingSeparator && (path2 += "/"), isAbsolute2 ? "/" + path2 : path2;
1853
1855
  },
1854
1856
  isAbsolute: function(path2) {
1855
1857
  return assertPath(path2), path2.length > 0 && path2.charCodeAt(0) === 47;
@@ -1959,8 +1961,8 @@ var require_path_browserify = __commonJS({
1959
1961
  assertPath(path2);
1960
1962
  var ret = { root: "", dir: "", base: "", ext: "", name: "" };
1961
1963
  if (path2.length === 0) return ret;
1962
- var code = path2.charCodeAt(0), isAbsolute3 = code === 47, start;
1963
- isAbsolute3 ? (ret.root = "/", start = 1) : start = 0;
1964
+ var code = path2.charCodeAt(0), isAbsolute2 = code === 47, start;
1965
+ isAbsolute2 ? (ret.root = "/", start = 1) : start = 0;
1964
1966
  for (var startDot = -1, startPart = 0, end = -1, matchedSlash = !0, i = path2.length - 1, preDotState = 0; i >= start; --i) {
1965
1967
  if (code = path2.charCodeAt(i), code === 47) {
1966
1968
  if (!matchedSlash) {
@@ -1973,7 +1975,7 @@ var require_path_browserify = __commonJS({
1973
1975
  }
1974
1976
  return startDot === -1 || end === -1 || // We saw a non-dot character immediately before the dot
1975
1977
  preDotState === 0 || // The (right-most) trimmed path component is exactly '..'
1976
- preDotState === 1 && startDot === end - 1 && startDot === startPart + 1 ? end !== -1 && (startPart === 0 && isAbsolute3 ? ret.base = ret.name = path2.slice(1, end) : ret.base = ret.name = path2.slice(startPart, end)) : (startPart === 0 && isAbsolute3 ? (ret.name = path2.slice(1, startDot), ret.base = path2.slice(1, end)) : (ret.name = path2.slice(startPart, startDot), ret.base = path2.slice(startPart, end)), ret.ext = path2.slice(startDot, end)), startPart > 0 ? ret.dir = path2.slice(0, startPart - 1) : isAbsolute3 && (ret.dir = "/"), ret;
1978
+ preDotState === 1 && startDot === end - 1 && startDot === startPart + 1 ? end !== -1 && (startPart === 0 && isAbsolute2 ? ret.base = ret.name = path2.slice(1, end) : ret.base = ret.name = path2.slice(startPart, end)) : (startPart === 0 && isAbsolute2 ? (ret.name = path2.slice(1, startDot), ret.base = path2.slice(1, end)) : (ret.name = path2.slice(startPart, startDot), ret.base = path2.slice(startPart, end)), ret.ext = path2.slice(startDot, end)), startPart > 0 ? ret.dir = path2.slice(0, startPart - 1) : isAbsolute2 && (ret.dir = "/"), ret;
1977
1979
  },
1978
1980
  sep: "/",
1979
1981
  delimiter: ":",
@@ -5284,296 +5286,6 @@ var ComponentMetaManager = class extends BaseComponentMetaManager {
5284
5286
  }
5285
5287
  }, isExtractable = (storyRef) => !!storyRef.component?.path && !!storyRef.component.importName;
5286
5288
 
5287
- // ../../../node_modules/pathe/dist/shared/pathe.M-eThtNZ.mjs
5288
- var _lazyMatch = () => {
5289
- var __lib__ = (() => {
5290
- var m = Object.defineProperty, V = Object.getOwnPropertyDescriptor, G = Object.getOwnPropertyNames, T = Object.prototype.hasOwnProperty, q = (r, e) => {
5291
- for (var n in e) m(r, n, { get: e[n], enumerable: !0 });
5292
- }, H = (r, e, n, a) => {
5293
- if (e && typeof e == "object" || typeof e == "function") for (let t of G(e)) !T.call(r, t) && t !== n && m(r, t, { get: () => e[t], enumerable: !(a = V(e, t)) || a.enumerable });
5294
- return r;
5295
- }, J = (r) => H(m({}, "__esModule", { value: !0 }), r), w = {};
5296
- q(w, { default: () => re });
5297
- var A = (r) => Array.isArray(r), d = (r) => typeof r == "function", Q = (r) => r.length === 0, W = (r) => typeof r == "number", K = (r) => typeof r == "object" && r !== null, X = (r) => r instanceof RegExp, b = (r) => typeof r == "string", h = (r) => r === void 0, Y = (r) => {
5298
- let e = /* @__PURE__ */ new Map();
5299
- return (n) => {
5300
- let a = e.get(n);
5301
- if (a) return a;
5302
- let t = r(n);
5303
- return e.set(n, t), t;
5304
- };
5305
- }, rr = (r, e, n = {}) => {
5306
- let a = { cache: {}, input: r, index: 0, indexMax: 0, options: n, output: [] };
5307
- if (v(e)(a) && a.index === r.length) return a.output;
5308
- throw new Error(`Failed to parse at index ${a.indexMax}`);
5309
- }, i = (r, e) => A(r) ? er(r, e) : b(r) ? ar(r, e) : nr(r, e), er = (r, e) => {
5310
- let n = {};
5311
- for (let a of r) {
5312
- if (a.length !== 1) throw new Error(`Invalid character: "${a}"`);
5313
- let t = a.charCodeAt(0);
5314
- n[t] = !0;
5315
- }
5316
- return (a) => {
5317
- let t = a.index, o = a.input;
5318
- for (; a.index < o.length && o.charCodeAt(a.index) in n; ) a.index += 1;
5319
- let u = a.index;
5320
- if (u > t) {
5321
- if (!h(e) && !a.options.silent) {
5322
- let s = a.input.slice(t, u), c = d(e) ? e(s, o, String(t)) : e;
5323
- h(c) || a.output.push(c);
5324
- }
5325
- a.indexMax = Math.max(a.indexMax, a.index);
5326
- }
5327
- return !0;
5328
- };
5329
- }, nr = (r, e) => {
5330
- let n = r.source, a = r.flags.replace(/y|$/, "y"), t = new RegExp(n, a);
5331
- return g((o) => {
5332
- t.lastIndex = o.index;
5333
- let u = t.exec(o.input);
5334
- if (u) {
5335
- if (!h(e) && !o.options.silent) {
5336
- let s = d(e) ? e(...u, o.input, String(o.index)) : e;
5337
- h(s) || o.output.push(s);
5338
- }
5339
- return o.index += u[0].length, o.indexMax = Math.max(o.indexMax, o.index), !0;
5340
- } else return !1;
5341
- });
5342
- }, ar = (r, e) => (n) => {
5343
- if (n.input.startsWith(r, n.index)) {
5344
- if (!h(e) && !n.options.silent) {
5345
- let t = d(e) ? e(r, n.input, String(n.index)) : e;
5346
- h(t) || n.output.push(t);
5347
- }
5348
- return n.index += r.length, n.indexMax = Math.max(n.indexMax, n.index), !0;
5349
- } else return !1;
5350
- }, C = (r, e, n, a) => {
5351
- let t = v(r);
5352
- return g(_(M((o) => {
5353
- let u = 0;
5354
- for (; u < n; ) {
5355
- let s = o.index;
5356
- if (!t(o) || (u += 1, o.index === s)) break;
5357
- }
5358
- return u >= e;
5359
- })));
5360
- }, tr = (r, e) => C(r, 0, 1), f = (r, e) => C(r, 0, 1 / 0), x = (r, e) => {
5361
- let n = r.map(v);
5362
- return g(_(M((a) => {
5363
- for (let t = 0, o = n.length; t < o; t++) if (!n[t](a)) return !1;
5364
- return !0;
5365
- })));
5366
- }, l = (r, e) => {
5367
- let n = r.map(v);
5368
- return g(_((a) => {
5369
- for (let t = 0, o = n.length; t < o; t++) if (n[t](a)) return !0;
5370
- return !1;
5371
- }));
5372
- }, M = (r, e = !1) => {
5373
- let n = v(r);
5374
- return (a) => {
5375
- let t = a.index, o = a.output.length, u = n(a);
5376
- return (!u || e) && (a.index = t, a.output.length !== o && (a.output.length = o)), u;
5377
- };
5378
- }, _ = (r, e) => v(r), g = /* @__PURE__ */ (() => {
5379
- let r = 0;
5380
- return (e) => {
5381
- let n = v(e), a = r += 1;
5382
- return (t) => {
5383
- var o;
5384
- if (t.options.memoization === !1) return n(t);
5385
- let u = t.index, s = (o = t.cache)[a] || (o[a] = /* @__PURE__ */ new Map()), c = s.get(u);
5386
- if (c === !1) return !1;
5387
- if (W(c)) return t.index = c, !0;
5388
- if (c) return t.index = c.index, c.output?.length && t.output.push(...c.output), !0;
5389
- {
5390
- let Z = t.output.length;
5391
- if (n(t)) {
5392
- let D = t.index, U = t.output.length;
5393
- if (U > Z) {
5394
- let ee = t.output.slice(Z, U);
5395
- s.set(u, { index: D, output: ee });
5396
- } else s.set(u, D);
5397
- return !0;
5398
- } else return s.set(u, !1), !1;
5399
- }
5400
- };
5401
- };
5402
- })(), E = (r) => {
5403
- let e;
5404
- return (n) => (e || (e = v(r())), e(n));
5405
- }, v = Y((r) => {
5406
- if (d(r)) return Q(r) ? E(r) : r;
5407
- if (b(r) || X(r)) return i(r);
5408
- if (A(r)) return x(r);
5409
- if (K(r)) return l(Object.values(r));
5410
- throw new Error("Invalid rule");
5411
- }), P = "abcdefghijklmnopqrstuvwxyz", ir = (r) => {
5412
- let e = "";
5413
- for (; r > 0; ) {
5414
- let n = (r - 1) % 26;
5415
- e = P[n] + e, r = Math.floor((r - 1) / 26);
5416
- }
5417
- return e;
5418
- }, O = (r) => {
5419
- let e = 0;
5420
- for (let n = 0, a = r.length; n < a; n++) e = e * 26 + P.indexOf(r[n]) + 1;
5421
- return e;
5422
- }, S = (r, e) => {
5423
- if (e < r) return S(e, r);
5424
- let n = [];
5425
- for (; r <= e; ) n.push(r++);
5426
- return n;
5427
- }, or = (r, e, n) => S(r, e).map((a) => String(a).padStart(n, "0")), R = (r, e) => S(O(r), O(e)).map(ir), p = (r) => r, z = (r) => ur((e) => rr(e, r, { memoization: !1 }).join("")), ur = (r) => {
5428
- let e = {};
5429
- return (n) => e[n] ?? (e[n] = r(n));
5430
- }, sr = i(/^\*\*\/\*$/, ".*"), cr = i(/^\*\*\/(\*)?([ a-zA-Z0-9._-]+)$/, (r, e, n) => `.*${e ? "" : "(?:^|/)"}${n.replaceAll(".", "\\.")}`), lr = i(/^\*\*\/(\*)?([ a-zA-Z0-9._-]*)\{([ a-zA-Z0-9._-]+(?:,[ a-zA-Z0-9._-]+)*)\}$/, (r, e, n, a) => `.*${e ? "" : "(?:^|/)"}${n.replaceAll(".", "\\.")}(?:${a.replaceAll(",", "|").replaceAll(".", "\\.")})`), y = i(/\\./, p), pr = i(/[$.*+?^(){}[\]\|]/, (r) => `\\${r}`), vr = i(/./, p), hr = i(/^(?:!!)*!(.*)$/, (r, e) => `(?!^${L(e)}$).*?`), dr = i(/^(!!)+/, ""), fr = l([hr, dr]), xr = i(/\/(\*\*\/)+/, "(?:/.+/|/)"), gr = i(/^(\*\*\/)+/, "(?:^|.*/)"), mr = i(/\/(\*\*)$/, "(?:/.*|$)"), _r = i(/\*\*/, ".*"), j = l([xr, gr, mr, _r]), Sr = i(/\*\/(?!\*\*\/)/, "[^/]*/"), yr = i(/\*/, "[^/]*"), N = l([Sr, yr]), k = i("?", "[^/]"), $r = i("[", p), wr = i("]", p), Ar = i(/[!^]/, "^/"), br = i(/[a-z]-[a-z]|[0-9]-[0-9]/i, p), Cr = i(/[$.*+?^(){}[\|]/, (r) => `\\${r}`), Mr = i(/[^\]]/, p), Er = l([y, Cr, br, Mr]), B = x([$r, tr(Ar), f(Er), wr]), Pr = i("{", "(?:"), Or = i("}", ")"), Rr = i(/(\d+)\.\.(\d+)/, (r, e, n) => or(+e, +n, Math.min(e.length, n.length)).join("|")), zr = i(/([a-z]+)\.\.([a-z]+)/, (r, e, n) => R(e, n).join("|")), jr = i(/([A-Z]+)\.\.([A-Z]+)/, (r, e, n) => R(e.toLowerCase(), n.toLowerCase()).join("|").toUpperCase()), Nr = l([Rr, zr, jr]), I = x([Pr, Nr, Or]), kr = i("{", "(?:"), Br = i("}", ")"), Ir = i(",", "|"), Fr = i(/[$.*+?^(){[\]\|]/, (r) => `\\${r}`), Lr = i(/[^}]/, p), Zr = E(() => F), Dr = l([j, N, k, B, I, Zr, y, Fr, Ir, Lr]), F = x([kr, f(Dr), Br]), Ur = f(l([sr, cr, lr, fr, j, N, k, B, I, F, y, pr, vr])), Vr = Ur, Gr = z(Vr), L = Gr, Tr = i(/\\./, p), qr = i(/./, p), Hr = i(/\*\*\*+/, "*"), Jr = i(/([^/{[(!])\*\*/, (r, e) => `${e}*`), Qr = i(/(^|.)\*\*(?=[^*/)\]}])/, (r, e) => `${e}*`), Wr = f(l([Tr, Hr, Jr, Qr, qr])), Kr = Wr, Xr = z(Kr), Yr = Xr, $ = (r, e) => {
5431
- let n = Array.isArray(r) ? r : [r];
5432
- if (!n.length) return !1;
5433
- let a = n.map($.compile), t = n.every((s) => /(\/(?:\*\*)?|\[\/\])$/.test(s)), o = e.replace(/[\\\/]+/g, "/").replace(/\/$/, t ? "/" : "");
5434
- return a.some((s) => s.test(o));
5435
- };
5436
- $.compile = (r) => new RegExp(`^${L(Yr(r))}$`, "s");
5437
- var re = $;
5438
- return J(w);
5439
- })();
5440
- return __lib__.default || __lib__;
5441
- }, _match, zeptomatch = (path2, pattern) => (_match || (_match = _lazyMatch(), _lazyMatch = null), _match(path2, pattern)), _DRIVE_LETTER_START_RE2 = /^[A-Za-z]:\//;
5442
- function normalizeWindowsPath2(input = "") {
5443
- return input && input.replace(/\\/g, "/").replace(_DRIVE_LETTER_START_RE2, (r) => r.toUpperCase());
5444
- }
5445
- var _UNC_REGEX2 = /^[/\\]{2}/, _IS_ABSOLUTE_RE2 = /^[/\\](?![/\\])|^[/\\]{2}(?!\.)|^[A-Za-z]:[/\\]/, _DRIVE_LETTER_RE2 = /^[A-Za-z]:$/, _ROOT_FOLDER_RE = /^\/([A-Za-z]:)?$/, _EXTNAME_RE = /.(\.[^./]+|\.)$/, _PATH_ROOT_RE = /^[/\\]|^[a-zA-Z]:[/\\]/, sep = "/", normalize2 = function(path2) {
5446
- if (path2.length === 0)
5447
- return ".";
5448
- path2 = normalizeWindowsPath2(path2);
5449
- let isUNCPath = path2.match(_UNC_REGEX2), isPathAbsolute = isAbsolute2(path2), trailingSeparator = path2[path2.length - 1] === "/";
5450
- return path2 = normalizeString2(path2, !isPathAbsolute), path2.length === 0 ? isPathAbsolute ? "/" : trailingSeparator ? "./" : "." : (trailingSeparator && (path2 += "/"), _DRIVE_LETTER_RE2.test(path2) && (path2 += "/"), isUNCPath ? isPathAbsolute ? `//${path2}` : `//./${path2}` : isPathAbsolute && !isAbsolute2(path2) ? `/${path2}` : path2);
5451
- }, join2 = function(...segments) {
5452
- let path2 = "";
5453
- for (let seg of segments)
5454
- if (seg)
5455
- if (path2.length > 0) {
5456
- let pathTrailing = path2[path2.length - 1] === "/", segLeading = seg[0] === "/";
5457
- pathTrailing && segLeading ? path2 += seg.slice(1) : path2 += pathTrailing || segLeading ? seg : `/${seg}`;
5458
- } else
5459
- path2 += seg;
5460
- return normalize2(path2);
5461
- };
5462
- function cwd() {
5463
- return typeof process < "u" && typeof process.cwd == "function" ? process.cwd().replace(/\\/g, "/") : "/";
5464
- }
5465
- var resolve = function(...arguments_) {
5466
- arguments_ = arguments_.map((argument) => normalizeWindowsPath2(argument));
5467
- let resolvedPath = "", resolvedAbsolute = !1;
5468
- for (let index = arguments_.length - 1; index >= -1 && !resolvedAbsolute; index--) {
5469
- let path2 = index >= 0 ? arguments_[index] : cwd();
5470
- !path2 || path2.length === 0 || (resolvedPath = `${path2}/${resolvedPath}`, resolvedAbsolute = isAbsolute2(path2));
5471
- }
5472
- return resolvedPath = normalizeString2(resolvedPath, !resolvedAbsolute), resolvedAbsolute && !isAbsolute2(resolvedPath) ? `/${resolvedPath}` : resolvedPath.length > 0 ? resolvedPath : ".";
5473
- };
5474
- function normalizeString2(path2, allowAboveRoot) {
5475
- let res = "", lastSegmentLength = 0, lastSlash = -1, dots = 0, char = null;
5476
- for (let index = 0; index <= path2.length; ++index) {
5477
- if (index < path2.length)
5478
- char = path2[index];
5479
- else {
5480
- if (char === "/")
5481
- break;
5482
- char = "/";
5483
- }
5484
- if (char === "/") {
5485
- if (!(lastSlash === index - 1 || dots === 1)) if (dots === 2) {
5486
- if (res.length < 2 || lastSegmentLength !== 2 || res[res.length - 1] !== "." || res[res.length - 2] !== ".") {
5487
- if (res.length > 2) {
5488
- let lastSlashIndex = res.lastIndexOf("/");
5489
- lastSlashIndex === -1 ? (res = "", lastSegmentLength = 0) : (res = res.slice(0, lastSlashIndex), lastSegmentLength = res.length - 1 - res.lastIndexOf("/")), lastSlash = index, dots = 0;
5490
- continue;
5491
- } else if (res.length > 0) {
5492
- res = "", lastSegmentLength = 0, lastSlash = index, dots = 0;
5493
- continue;
5494
- }
5495
- }
5496
- allowAboveRoot && (res += res.length > 0 ? "/.." : "..", lastSegmentLength = 2);
5497
- } else
5498
- res.length > 0 ? res += `/${path2.slice(lastSlash + 1, index)}` : res = path2.slice(lastSlash + 1, index), lastSegmentLength = index - lastSlash - 1;
5499
- lastSlash = index, dots = 0;
5500
- } else char === "." && dots !== -1 ? ++dots : dots = -1;
5501
- }
5502
- return res;
5503
- }
5504
- var isAbsolute2 = function(p) {
5505
- return _IS_ABSOLUTE_RE2.test(p);
5506
- }, toNamespacedPath = function(p) {
5507
- return normalizeWindowsPath2(p);
5508
- }, extname = function(p) {
5509
- if (p === "..") return "";
5510
- let match = _EXTNAME_RE.exec(normalizeWindowsPath2(p));
5511
- return match && match[1] || "";
5512
- }, relative = function(from, to) {
5513
- let _from = resolve(from).replace(_ROOT_FOLDER_RE, "$1").split("/"), _to = resolve(to).replace(_ROOT_FOLDER_RE, "$1").split("/");
5514
- if (_to[0][1] === ":" && _from[0][1] === ":" && _from[0] !== _to[0])
5515
- return _to.join("/");
5516
- let _fromCopy = [..._from];
5517
- for (let segment of _fromCopy) {
5518
- if (_to[0] !== segment)
5519
- break;
5520
- _from.shift(), _to.shift();
5521
- }
5522
- return [..._from.map(() => ".."), ..._to].join("/");
5523
- }, dirname3 = function(p) {
5524
- let segments = normalizeWindowsPath2(p).replace(/\/$/, "").split("/").slice(0, -1);
5525
- return segments.length === 1 && _DRIVE_LETTER_RE2.test(segments[0]) && (segments[0] += "/"), segments.join("/") || (isAbsolute2(p) ? "/" : ".");
5526
- }, format = function(p) {
5527
- let ext = p.ext ? p.ext.startsWith(".") ? p.ext : `.${p.ext}` : "", segments = [p.root, p.dir, p.base ?? (p.name ?? "") + ext].filter(
5528
- Boolean
5529
- );
5530
- return normalizeWindowsPath2(
5531
- p.root ? resolve(...segments) : segments.join("/")
5532
- );
5533
- }, basename = function(p, extension) {
5534
- let segments = normalizeWindowsPath2(p).split("/"), lastSegment = "";
5535
- for (let i = segments.length - 1; i >= 0; i--) {
5536
- let val = segments[i];
5537
- if (val) {
5538
- lastSegment = val;
5539
- break;
5540
- }
5541
- }
5542
- return extension && lastSegment.endsWith(extension) ? lastSegment.slice(0, -extension.length) : lastSegment;
5543
- }, parse = function(p) {
5544
- let root = _PATH_ROOT_RE.exec(p)?.[0]?.replace(/\\/g, "/") || "", base = basename(p), extension = extname(base);
5545
- return {
5546
- root,
5547
- dir: dirname3(p),
5548
- base,
5549
- ext: extension,
5550
- name: base.slice(0, base.length - extension.length)
5551
- };
5552
- }, matchesGlob = (path2, pattern) => zeptomatch(pattern, normalize2(path2)), _path = {
5553
- __proto__: null,
5554
- basename,
5555
- dirname: dirname3,
5556
- extname,
5557
- format,
5558
- isAbsolute: isAbsolute2,
5559
- join: join2,
5560
- matchesGlob,
5561
- normalize: normalize2,
5562
- normalizeString: normalizeString2,
5563
- parse,
5564
- relative,
5565
- resolve,
5566
- sep,
5567
- toNamespacedPath
5568
- };
5569
-
5570
- // ../../../node_modules/pathe/dist/index.mjs
5571
- var delimiter = globalThis.process?.platform === "win32" ? ";" : ":", _platforms = { posix: void 0, win32: void 0 }, mix = (del = delimiter) => new Proxy(_path, {
5572
- get(_, prop) {
5573
- return prop === "delimiter" ? del : prop === "posix" ? posix : prop === "win32" ? win32 : _platforms[prop] || _path[prop];
5574
- }
5575
- }), posix = /* @__PURE__ */ mix(":"), win32 = /* @__PURE__ */ mix(";");
5576
-
5577
5289
  // src/componentManifest/generateCodeSnippet.ts
5578
5290
  import {
5579
5291
  textOf,
@@ -5787,7 +5499,7 @@ function rewriteJsx(code, node, merged, edits, mark) {
5787
5499
  }
5788
5500
 
5789
5501
  // src/componentManifest/reactDocgenTypescript.ts
5790
- import { dirname as dirname4, join as join3, resolve as resolve2 } from "node:path";
5502
+ import { dirname as dirname3, join as join2, resolve } from "node:path";
5791
5503
  import {
5792
5504
  extractComponentJsDocInfo as extractComponentJsDocInfo2,
5793
5505
  resolveExportedSymbol
@@ -5901,17 +5613,18 @@ function getReactDocgenTypescriptError(path2, {
5901
5613
  localImportName,
5902
5614
  componentName
5903
5615
  }, docs) {
5616
+ let file = `File: ${relative(process.cwd(), path2)}`;
5904
5617
  return docs.length === 0 ? {
5905
5618
  name: "react-docgen-typescript found no component docs",
5906
5619
  message: [
5907
- `File: ${path2}`,
5620
+ file,
5908
5621
  "react-docgen-typescript did not return any component docs for this file."
5909
5622
  ].join(`
5910
5623
  `)
5911
5624
  } : {
5912
5625
  name: "react-docgen-typescript could not match component docs",
5913
5626
  message: [
5914
- `File: ${path2}`,
5627
+ file,
5915
5628
  "react-docgen-typescript returned component docs for this file, but none matched the story's component import.",
5916
5629
  `Looked for: componentName=${componentName}, localImportName=${localImportName ?? "<none>"}, importName=${importName ?? "<none>"}.`
5917
5630
  ].join(`
@@ -5939,15 +5652,15 @@ var parseWithReactDocgenTypescript = asyncCache(
5939
5652
  },
5940
5653
  { name: "parseWithReactDocgenTypescript" }
5941
5654
  ), findOwningTsconfigPath = cached(
5942
- (typescript, cwd2, filePath) => {
5943
- let configPath = findTsconfigPath(cwd2);
5655
+ (typescript, cwd, filePath) => {
5656
+ let configPath = findTsconfigPath(cwd);
5944
5657
  if (configPath)
5945
5658
  return findTsconfigPathIncludingFile(typescript, configPath, filePath, /* @__PURE__ */ new Set()) ?? configPath;
5946
5659
  },
5947
5660
  {
5948
- key: (typescript, cwd2, filePath) => `${normalizeFileName(typescript, resolve2(cwd2))}::${normalizeFileName(
5661
+ key: (typescript, cwd, filePath) => `${normalizeFileName(typescript, resolve(cwd))}::${normalizeFileName(
5949
5662
  typescript,
5950
- resolve2(filePath)
5663
+ resolve(filePath)
5951
5664
  )}`,
5952
5665
  name: "findOwningTsconfigPath"
5953
5666
  }
@@ -5972,8 +5685,8 @@ function findTsconfigPathIncludingFile(typescript, configPath, filePath, seenCon
5972
5685
  }
5973
5686
  }
5974
5687
  function getReferencedTsconfigPaths(typescript, configPath, config) {
5975
- return (Array.isArray(config?.references) ? config.references : []).map((reference) => reference.path).filter((referencePath) => typeof referencePath == "string").map((referencePath) => resolve2(dirname4(configPath), referencePath)).map(
5976
- (referencePath) => referencePath.endsWith(".json") ? referencePath : join3(referencePath, "tsconfig.json")
5688
+ return (Array.isArray(config?.references) ? config.references : []).map((reference) => reference.path).filter((referencePath) => typeof referencePath == "string").map((referencePath) => resolve(dirname3(configPath), referencePath)).map(
5689
+ (referencePath) => referencePath.endsWith(".json") ? referencePath : join2(referencePath, "tsconfig.json")
5977
5690
  ).filter((referencePath) => typescript.sys.fileExists(referencePath));
5978
5691
  }
5979
5692
  function parseTsconfig(typescript, configPath) {
@@ -5985,7 +5698,7 @@ function readTsconfig(typescript, configPath) {
5985
5698
  return cachedTsconfig;
5986
5699
  let { config } = typescript.readConfigFile(configPath, typescript.sys.readFile), state = {
5987
5700
  config,
5988
- parsed: typescript.parseJsonConfigFileContent(config, typescript.sys, dirname4(configPath))
5701
+ parsed: typescript.parseJsonConfigFileContent(config, typescript.sys, dirname3(configPath))
5989
5702
  };
5990
5703
  return tsconfigCache.set(cacheKey, state), state;
5991
5704
  }
@@ -5993,7 +5706,7 @@ function isSameFileName(typescript, left, right) {
5993
5706
  return normalizeFileName(typescript, left) === normalizeFileName(typescript, right);
5994
5707
  }
5995
5708
  function normalizeFileName(typescript, fileName) {
5996
- let normalized = resolve2(fileName).replace(/\\/g, "/");
5709
+ let normalized = resolve(fileName).replace(/\\/g, "/");
5997
5710
  return typescript.sys.useCaseSensitiveFileNames ? normalized : normalized.toLowerCase();
5998
5711
  }
5999
5712
 
@@ -6014,7 +5727,7 @@ import {
6014
5727
  } from "storybook/internal/csf-tools";
6015
5728
 
6016
5729
  // src/componentManifest/getComponentImports.ts
6017
- import { dirname as dirname5 } from "node:path";
5730
+ import { dirname as dirname4 } from "node:path";
6018
5731
  import {
6019
5732
  buildImportStatements,
6020
5733
  collectImportBindings as collectImportBindings2,
@@ -6029,7 +5742,7 @@ import { getTypeScriptForDocgenError, isModuleNotFoundError as isModuleNotFoundE
6029
5742
  import { logger as logger5 } from "storybook/internal/node-logger";
6030
5743
  var reactDocgenPromise;
6031
5744
  function loadReactDocgen() {
6032
- return reactDocgenPromise ??= import("./reactDocgen-WMOVFLAX.js").catch((error) => {
5745
+ return reactDocgenPromise ??= import("./reactDocgen-CS462JSF.js").catch((error) => {
6033
5746
  if (isModuleNotFoundError2(error)) {
6034
5747
  logger5.debug(`Skipping react-docgen, which is not installed: ${error}`);
6035
5748
  return;
@@ -6099,14 +5812,14 @@ var isReactDocgenTypescriptResolvable = () => {
6099
5812
  jsxDepth: componentDepth.get(c)
6100
5813
  }, path2, isPackage = !1;
6101
5814
  try {
6102
- component.importId && storyFilePath && (path2 = cachedResolveImport(matchPath(component.importId, dirname5(storyFilePath)), {
6103
- basedir: dirname5(storyFilePath)
5815
+ component.importId && storyFilePath && (path2 = cachedResolveImport(matchPath(component.importId, dirname4(storyFilePath)), {
5816
+ basedir: dirname4(storyFilePath)
6104
5817
  }));
6105
5818
  } catch (e) {
6106
5819
  logger6.debug(e);
6107
5820
  }
6108
5821
  try {
6109
- component.importId && !component.importId.startsWith(".") && storyFilePath && (cachedResolveImport(component.importId, { basedir: dirname5(storyFilePath) }), isPackage = !0);
5822
+ component.importId && !component.importId.startsWith(".") && storyFilePath && (cachedResolveImport(component.importId, { basedir: dirname4(storyFilePath) }), isPackage = !0);
6110
5823
  } catch {
6111
5824
  }
6112
5825
  let componentWithPackage = { ...component, isPackage }, target = docgenTargets?.get(c);
@@ -6138,7 +5851,7 @@ var isReactDocgenTypescriptResolvable = () => {
6138
5851
  let message = e instanceof Error ? e.message : String(e);
6139
5852
  logger6.debug(`react-docgen-typescript failed for ${docgenPath}: ${message}`), reactDocgenTypescriptError = isModuleNotFoundError3(e) && !isReactDocgenTypescriptResolvable() ? getDocgenPackageMissingError("react-docgen-typescript") : {
6140
5853
  name: "react-docgen-typescript parse error",
6141
- message: `File: ${docgenPath}
5854
+ message: `File: ${relative(process.cwd(), docgenPath)}
6142
5855
  ${message}`
6143
5856
  };
6144
5857
  }
@@ -6276,7 +5989,7 @@ function extractStorySnippets(csf, componentName, filterStoryIds, references, wi
6276
5989
  }
6277
5990
 
6278
5991
  // src/componentManifest/buildReactComponentDocgen.ts
6279
- import { getComponentIdFromEntry } from "storybook/internal/common";
5992
+ import { componentPathFromStory, getComponentIdFromEntry } from "storybook/internal/common";
6280
5993
  import {
6281
5994
  buildImportStatements as buildImportStatements2,
6282
5995
  createStoryReferenceResolver,
@@ -6316,8 +6029,9 @@ function getFallbackImport(packageName, componentName) {
6316
6029
  }).join(`
6317
6030
  `) : "";
6318
6031
  }
6032
+ var relativize = (fileName) => posix.relative(process.cwd(), fileName);
6319
6033
  function relativizeComponentMetaPaths(doc) {
6320
- let relativize = (fileName) => posix.relative(process.cwd(), fileName), relativizeProp = (prop) => ({
6034
+ let relativizeProp = (prop) => ({
6321
6035
  ...prop,
6322
6036
  parent: prop.parent ? { ...prop.parent, fileName: relativize(prop.parent.fileName) } : prop.parent,
6323
6037
  declarations: prop.declarations?.map((declaration) => ({
@@ -6327,6 +6041,7 @@ function relativizeComponentMetaPaths(doc) {
6327
6041
  });
6328
6042
  return {
6329
6043
  ...doc,
6044
+ filePath: relativize(doc.filePath),
6330
6045
  props: Object.fromEntries(
6331
6046
  Object.entries(doc.props).map(([name, prop]) => [name, relativizeProp(prop)])
6332
6047
  )
@@ -6336,8 +6051,11 @@ function getComponentDocgenData(component, docgenEngine) {
6336
6051
  let reactDocgen, reactDocgenTypescript, reactComponentMeta, docgenDescription, docgenJsDocTags, docgenError;
6337
6052
  if (docgenEngine === "react-docgen") {
6338
6053
  let result = component?.reactDocgen;
6339
- reactDocgen = result?.type === "success" ? result.data : void 0, docgenDescription = reactDocgen?.description, docgenError = result?.type === "error" ? result.error : void 0;
6340
- } else docgenEngine === "react-docgen-typescript" ? (reactDocgenTypescript = component?.reactDocgenTypescript, docgenDescription = reactDocgenTypescript?.description, docgenJsDocTags = component?.componentJsDocTags, docgenError = component?.reactDocgenTypescriptError) : (reactComponentMeta = component?.reactComponentMeta ? relativizeComponentMetaPaths(component.reactComponentMeta) : void 0, docgenDescription = reactComponentMeta?.description, docgenJsDocTags = component?.componentJsDocTags);
6054
+ reactDocgen = result?.type === "success" ? { ...result.data, definedInFile: relativize(result.data.definedInFile) } : void 0, docgenDescription = reactDocgen?.description, docgenError = result?.type === "error" ? result.error : void 0;
6055
+ } else docgenEngine === "react-docgen-typescript" ? (reactDocgenTypescript = component?.reactDocgenTypescript && {
6056
+ ...component.reactDocgenTypescript,
6057
+ filePath: relativize(component.reactDocgenTypescript.filePath)
6058
+ }, docgenDescription = reactDocgenTypescript?.description, docgenJsDocTags = component?.componentJsDocTags, docgenError = component?.reactDocgenTypescriptError) : (reactComponentMeta = component?.reactComponentMeta ? relativizeComponentMetaPaths(component.reactComponentMeta) : void 0, docgenDescription = reactComponentMeta?.description, docgenJsDocTags = component?.componentJsDocTags);
6341
6059
  return {
6342
6060
  docgenDescription,
6343
6061
  docgenError,
@@ -6352,6 +6070,7 @@ function createSubcomponentDocgen({
6352
6070
  declaredName,
6353
6071
  docgenEngine,
6354
6072
  packageName,
6073
+ storyPath,
6355
6074
  storyFilePath
6356
6075
  }) {
6357
6076
  let imports = buildImportStatements2({ refs: component ? [component] : [], packageName }).join(`
@@ -6369,7 +6088,7 @@ function createSubcomponentDocgen({
6369
6088
  );
6370
6089
  return {
6371
6090
  name: declaredName,
6372
- path: component?.path ?? storyFilePath,
6091
+ path: component?.path ? componentPathFromStory(storyFilePath, storyPath, component.path) : storyFilePath,
6373
6092
  description,
6374
6093
  summary,
6375
6094
  import: imports || void 0,
@@ -6469,6 +6188,7 @@ ${storyFile}`
6469
6188
  declaredName: subcomponent.name,
6470
6189
  docgenEngine,
6471
6190
  packageName,
6191
+ storyPath,
6472
6192
  storyFilePath
6473
6193
  })
6474
6194
  ])
@@ -6527,9 +6247,6 @@ function buildReactComponentDocgenFromResolved({
6527
6247
  }
6528
6248
 
6529
6249
  export {
6530
- join2 as join,
6531
- isAbsolute2 as isAbsolute,
6532
- posix,
6533
6250
  getCodeSnippet,
6534
6251
  invalidateParser,
6535
6252
  resolveStoryFileComponents,
@@ -1,12 +1,12 @@
1
1
  import {
2
2
  getSharedComponentMetaManager
3
- } from "./chunk-VEMSK7QJ.js";
3
+ } from "./chunk-RNO52GGS.js";
4
4
  import {
5
5
  extractArgTypesFromComponentMeta
6
- } from "./chunk-XPEWS4XG.js";
7
- import "./chunk-E7AXB5JU.js";
6
+ } from "./chunk-4UV6B7T7.js";
7
+ import "./chunk-XMHC3CJ5.js";
8
8
  import "./chunk-MYBSMCSW.js";
9
- import "./chunk-CJ2XYAXX.js";
9
+ import "./chunk-M3SEC5XW.js";
10
10
  import "./chunk-SC3QXTHH.js";
11
11
  import "./chunk-QKPKKS4R.js";
12
12
  import "./chunk-PQZIOGBY.js";
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  parseWithReactDocgen
3
- } from "./chunk-N7TOZR54.js";
3
+ } from "./chunk-RIMY5QBX.js";
4
4
  import {
5
5
  cachedReadFileSync
6
- } from "./chunk-CJ2XYAXX.js";
6
+ } from "./chunk-M3SEC5XW.js";
7
7
  import {
8
8
  extractArgTypes
9
9
  } from "./chunk-SC3QXTHH.js";
@@ -3,8 +3,8 @@ import {
3
3
  getReactDocgen,
4
4
  getReactDocgenImporter,
5
5
  parseWithReactDocgen
6
- } from "./chunk-N7TOZR54.js";
7
- import "./chunk-CJ2XYAXX.js";
6
+ } from "./chunk-RIMY5QBX.js";
7
+ import "./chunk-M3SEC5XW.js";
8
8
  import "./chunk-QKPKKS4R.js";
9
9
  import "./chunk-PQZIOGBY.js";
10
10
  export {
@@ -1,12 +1,12 @@
1
1
  import {
2
2
  buildDocgenPayloads
3
- } from "../_node-chunks/chunk-XPEWS4XG.js";
3
+ } from "../_node-chunks/chunk-4UV6B7T7.js";
4
4
  import {
5
5
  ComponentMetaManager,
6
6
  loadDocgenTypeScript
7
- } from "../_node-chunks/chunk-E7AXB5JU.js";
7
+ } from "../_node-chunks/chunk-XMHC3CJ5.js";
8
8
  import "../_node-chunks/chunk-MYBSMCSW.js";
9
- import "../_node-chunks/chunk-CJ2XYAXX.js";
9
+ import "../_node-chunks/chunk-M3SEC5XW.js";
10
10
  import "../_node-chunks/chunk-SC3QXTHH.js";
11
11
  import "../_node-chunks/chunk-QKPKKS4R.js";
12
12
  import "../_node-chunks/chunk-PQZIOGBY.js";
package/dist/preset.js CHANGED
@@ -3,23 +3,23 @@ import {
3
3
  } from "./_node-chunks/chunk-HRHJMJC7.js";
4
4
  import {
5
5
  getSharedComponentMetaManager
6
- } from "./_node-chunks/chunk-VEMSK7QJ.js";
6
+ } from "./_node-chunks/chunk-RNO52GGS.js";
7
7
  import {
8
8
  buildReactComponentDocgenFromResolved,
9
9
  buildStoryDocsFromResolved,
10
10
  getCodeSnippet,
11
11
  invalidateParser,
12
- isAbsolute,
13
- join,
14
- posix,
15
12
  resolveStoryFileComponents
16
- } from "./_node-chunks/chunk-E7AXB5JU.js";
13
+ } from "./_node-chunks/chunk-XMHC3CJ5.js";
17
14
  import {
18
15
  REACT_DOCGEN_TYPESCRIPT_APIS
19
16
  } from "./_node-chunks/chunk-MYBSMCSW.js";
20
17
  import {
21
- invalidateCache
22
- } from "./_node-chunks/chunk-CJ2XYAXX.js";
18
+ invalidateCache,
19
+ isAbsolute,
20
+ join,
21
+ posix
22
+ } from "./_node-chunks/chunk-M3SEC5XW.js";
23
23
  import "./_node-chunks/chunk-PQZIOGBY.js";
24
24
 
25
25
  // src/preset.ts
@@ -384,7 +384,7 @@ async function internal_getArgTypesData(_input, options) {
384
384
  return null;
385
385
  let absoluteComponentFilePath = path2.isAbsolute(componentFilePath) ? componentFilePath : join3(getProjectRoot(), componentFilePath);
386
386
  if ((await presets?.apply("features", {}))?.docgenServer) {
387
- let { extractArgTypesFromComponentFile } = await import("./_node-chunks/extractArgTypesFromComponentFile-JKOCA6RX.js");
387
+ let { extractArgTypesFromComponentFile } = await import("./_node-chunks/extractArgTypesFromComponentFile-UJJRVMGW.js");
388
388
  return extractArgTypesFromComponentFile({
389
389
  componentFilePath: absoluteComponentFilePath,
390
390
  componentExportName,
@@ -410,7 +410,7 @@ async function internal_getArgTypesData(_input, options) {
410
410
  reactDocgenTypescriptOptions
411
411
  });
412
412
  } else {
413
- let { extractArgTypesFromDocgen } = await import("./_node-chunks/extractReactDocgenInfo-L44YP4OM.js");
413
+ let { extractArgTypesFromDocgen } = await import("./_node-chunks/extractReactDocgenInfo-Z5DJORGO.js");
414
414
  argTypesData = extractArgTypesFromDocgen({
415
415
  componentFilePath: absoluteComponentFilePath,
416
416
  componentExportName
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@storybook/react",
3
- "version": "11.0.0-rc.2",
3
+ "version": "11.0.0-rc.3",
4
4
  "description": "Storybook React renderer",
5
5
  "keywords": [
6
6
  "storybook"
@@ -54,7 +54,7 @@
54
54
  "!src/**/*"
55
55
  ],
56
56
  "devDependencies": {
57
- "@storybook/component-meta-typescript": "11.0.0-rc.2",
57
+ "@storybook/component-meta-typescript": "11.0.0-rc.3",
58
58
  "@types/babel-plugin-react-docgen": "^4.2.3",
59
59
  "@types/escodegen": "^0.0.6",
60
60
  "@types/estree": "^1.0.6",
@@ -88,7 +88,7 @@
88
88
  "react-docgen": "^8.0.2",
89
89
  "react-docgen-typescript": "^2.2.2",
90
90
  "react-dom": "^18.0.0 || ^19.0.0",
91
- "storybook": "^11.0.0-rc.2",
91
+ "storybook": "^11.0.0-rc.3",
92
92
  "typescript": "^5.9.0 || ^6.0.0 || ^7.0.0"
93
93
  },
94
94
  "peerDependenciesMeta": {