storybook-addon-design-system-docs 1.0.1 → 1.0.2

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.
package/dist/index.js CHANGED
@@ -253,7 +253,7 @@ var Wrapper = styled.div(({ theme }) => ({
253
253
  minHeight: "100vh",
254
254
  boxSizing: "border-box",
255
255
  gap: "3rem",
256
- [`@media (min-width: 600px)`]: {}
256
+ "@media (min-width: 600px)": {}
257
257
  }));
258
258
  var Container = styled.div(() => ({
259
259
  maxWidth: "1000px",
@@ -766,7 +766,7 @@ function ShadowsSection({ entries }) {
766
766
  }
767
767
  ),
768
768
  /* @__PURE__ */ jsx(ShadowLabel, { children: label === "DEFAULT" ? "shadow" : `shadow-${label}` }),
769
- /* @__PURE__ */ jsx(ShadowValue, { title: value, children: value === "none" ? "none" : value.length > 50 ? value.substring(0, 47) + "..." : value })
769
+ /* @__PURE__ */ jsx(ShadowValue, { title: value, children: value === "none" ? "none" : value.length > 50 ? `${value.substring(0, 47)}...` : value })
770
770
  ] }, label)) });
771
771
  }
772
772
  function ShadowsPage(props) {
@@ -1173,10 +1173,19 @@ function validateAssetConfig(configs) {
1173
1173
  }
1174
1174
  }
1175
1175
  function normalizeAssetGroup(config, sidebarGroup = "Assets/", configDir) {
1176
- let storyPath = config.path ?? sidebarGroup;
1177
- if (storyPath.endsWith("/")) {
1178
- storyPath = `${storyPath}${config.name}`;
1176
+ const rawPath = config.path;
1177
+ let titlePrefix;
1178
+ if (rawPath?.startsWith("/")) {
1179
+ titlePrefix = rawPath.slice(1);
1180
+ } else if (rawPath) {
1181
+ titlePrefix = sidebarGroup ? `${sidebarGroup}/${rawPath}` : rawPath;
1182
+ } else {
1183
+ titlePrefix = sidebarGroup;
1184
+ }
1185
+ if (titlePrefix && !titlePrefix.endsWith("/")) {
1186
+ titlePrefix += "/";
1179
1187
  }
1188
+ const storyPath = titlePrefix ? `${titlePrefix}${config.name}` : config.name;
1180
1189
  const source = path3.isAbsolute(config.source) ? config.source : configDir ? path3.resolve(configDir, config.source) : config.source;
1181
1190
  const variants = {
1182
1191
  ...DEFAULT_VARIANT_CONFIG,
@@ -7817,8 +7826,8 @@ function normalizeAddonOptions(options) {
7817
7826
  };
7818
7827
  }
7819
7828
  function validateSidebarGroup(sidebarGroup) {
7820
- if (typeof sidebarGroup !== "string" || !sidebarGroup.trim()) {
7821
- throw new Error("sidebarGroup must be a non-empty string");
7829
+ if (typeof sidebarGroup !== "string") {
7830
+ throw new Error("sidebarGroup must be a string");
7822
7831
  }
7823
7832
  }
7824
7833
  function validateSections(sections) {
@@ -7841,27 +7850,24 @@ function isValidSectionName(name) {
7841
7850
  return typeof name === "string" && VALID_SECTIONS.includes(name);
7842
7851
  }
7843
7852
  function isValidSectionObject(section) {
7844
- return typeof section === "object" && section !== null && isValidSectionName(section.name) && (section.path === void 0 || typeof section.path === "string" && section.path.trim().length > 0);
7853
+ return typeof section === "object" && section !== null && isValidSectionName(section.name) && (section.path === void 0 || typeof section.path === "string");
7845
7854
  }
7846
7855
  function normalizeSection(section, sidebarGroup) {
7847
7856
  const name = typeof section === "string" ? section : section.name;
7848
- let path5 = typeof section === "string" ? sidebarGroup : section.path ?? sidebarGroup;
7849
- if (path5 === "/") {
7850
- return { name, path: name };
7851
- }
7852
- if (typeof section === "object" && section.path !== void 0) {
7853
- if (section.path === "/") {
7854
- return { name, path: name };
7855
- }
7856
- if (!path5.endsWith("/")) {
7857
- return { name, path: `${path5}/${name}` };
7858
- }
7859
- return { name, path: `${path5}${name}` };
7857
+ const rawPath = typeof section === "string" ? void 0 : section.path;
7858
+ let titlePrefix;
7859
+ if (rawPath?.startsWith("/")) {
7860
+ titlePrefix = rawPath.slice(1);
7861
+ } else if (rawPath) {
7862
+ titlePrefix = sidebarGroup ? `${sidebarGroup}/${rawPath}` : rawPath;
7863
+ } else {
7864
+ titlePrefix = sidebarGroup;
7860
7865
  }
7861
- if (!path5.endsWith("/")) {
7862
- path5 = `${path5}/`;
7866
+ if (titlePrefix && !titlePrefix.endsWith("/")) {
7867
+ titlePrefix += "/";
7863
7868
  }
7864
- return { name, path: `${path5}${name}` };
7869
+ const path5 = titlePrefix ? `${titlePrefix}${name}` : name;
7870
+ return { name, path: path5 };
7865
7871
  }
7866
7872
  function normalizeSections(sections, sidebarGroup) {
7867
7873
  return sections.map((section) => normalizeSection(section, sidebarGroup));