storybook-addon-dependency-previews 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +192 -0
- package/dist/_virtual/_rolldown/runtime.cjs +29 -0
- package/dist/addon/index.cjs +12 -0
- package/dist/addon/index.cjs.map +1 -0
- package/dist/addon/index.d.cts +5 -0
- package/dist/addon/index.d.mts +5 -0
- package/dist/addon/index.mjs +11 -0
- package/dist/addon/index.mjs.map +1 -0
- package/dist/addon/preset.cjs +8 -0
- package/dist/addon/preset.cjs.map +1 -0
- package/dist/addon/preset.d.cts +5 -0
- package/dist/addon/preset.d.mts +5 -0
- package/dist/addon/preset.mjs +6 -0
- package/dist/addon/preset.mjs.map +1 -0
- package/dist/addon/vitePlugin.cjs +26 -0
- package/dist/addon/vitePlugin.cjs.map +1 -0
- package/dist/addon/vitePlugin.d.cts +9 -0
- package/dist/addon/vitePlugin.d.mts +9 -0
- package/dist/addon/vitePlugin.mjs +24 -0
- package/dist/addon/vitePlugin.mjs.map +1 -0
- package/dist/blocks/DependencyPreviews.cjs +102 -0
- package/dist/blocks/DependencyPreviews.cjs.map +1 -0
- package/dist/blocks/DependencyPreviews.d.cts +7 -0
- package/dist/blocks/DependencyPreviews.d.mts +7 -0
- package/dist/blocks/DependencyPreviews.mjs +100 -0
- package/dist/blocks/DependencyPreviews.mjs.map +1 -0
- package/dist/blocks/DependencyPreviews.module.css +14 -0
- package/dist/blocks/index.cjs +1 -0
- package/dist/blocks/index.d.cts +1 -0
- package/dist/blocks/index.d.mts +1 -0
- package/dist/blocks/index.mjs +1 -0
- package/dist/cli/sb-deps.cjs +321 -0
- package/dist/cli/sb-deps.cjs.map +1 -0
- package/dist/cli/sb-deps.d.cts +1 -0
- package/dist/cli/sb-deps.d.mts +1 -0
- package/dist/cli/sb-deps.mjs +319 -0
- package/dist/cli/sb-deps.mjs.map +1 -0
- package/dist/cli/scripts/depcruise.config.cjs +38 -0
- package/dist/cli/scripts/depcruise.config.cjs.map +1 -0
- package/dist/cli/scripts/depcruise.config.d.cts +6 -0
- package/dist/cli/scripts/depcruise.config.d.mts +7 -0
- package/dist/cli/scripts/depcruise.config.mjs +37 -0
- package/dist/cli/scripts/depcruise.config.mjs.map +1 -0
- package/dist/cli/scripts/postprocess.cjs +106 -0
- package/dist/cli/scripts/postprocess.cjs.map +1 -0
- package/dist/cli/scripts/postprocess.d.cts +1 -0
- package/dist/cli/scripts/postprocess.d.mts +1 -0
- package/dist/cli/scripts/postprocess.mjs +106 -0
- package/dist/cli/scripts/postprocess.mjs.map +1 -0
- package/dist/components/ComponentSourceLink.cjs +42 -0
- package/dist/components/ComponentSourceLink.cjs.map +1 -0
- package/dist/components/ComponentSourceLink.mjs +40 -0
- package/dist/components/ComponentSourceLink.mjs.map +1 -0
- package/dist/components/ComponentSourceLink.module.css +5 -0
- package/dist/components/CopyButton.cjs +112 -0
- package/dist/components/CopyButton.cjs.map +1 -0
- package/dist/components/CopyButton.mjs +110 -0
- package/dist/components/CopyButton.mjs.map +1 -0
- package/dist/components/CopyButton.module.css +76 -0
- package/dist/components/Expandable.cjs +51 -0
- package/dist/components/Expandable.cjs.map +1 -0
- package/dist/components/Expandable.mjs +49 -0
- package/dist/components/Expandable.mjs.map +1 -0
- package/dist/components/Expandable.module.css +110 -0
- package/dist/components/FullParityStory.cjs +47 -0
- package/dist/components/FullParityStory.cjs.map +1 -0
- package/dist/components/FullParityStory.mjs +44 -0
- package/dist/components/FullParityStory.mjs.map +1 -0
- package/dist/components/PathCopyMolecule.cjs +28 -0
- package/dist/components/PathCopyMolecule.cjs.map +1 -0
- package/dist/components/PathCopyMolecule.mjs +26 -0
- package/dist/components/PathCopyMolecule.mjs.map +1 -0
- package/dist/components/PathCopyMolecule.module.css +14 -0
- package/dist/components/PrimaryPreview.cjs +35 -0
- package/dist/components/PrimaryPreview.cjs.map +1 -0
- package/dist/components/PrimaryPreview.mjs +34 -0
- package/dist/components/PrimaryPreview.mjs.map +1 -0
- package/dist/components/SbHeading.cjs +18 -0
- package/dist/components/SbHeading.cjs.map +1 -0
- package/dist/components/SbHeading.mjs +16 -0
- package/dist/components/SbHeading.mjs.map +1 -0
- package/dist/components/SbHeading.module.css +23 -0
- package/dist/components/StoryLink.cjs +45 -0
- package/dist/components/StoryLink.cjs.map +1 -0
- package/dist/components/StoryLink.mjs +43 -0
- package/dist/components/StoryLink.mjs.map +1 -0
- package/dist/components/StoryLink.module.css +13 -0
- package/dist/components/TooltipTrigger.cjs +100 -0
- package/dist/components/TooltipTrigger.cjs.map +1 -0
- package/dist/components/TooltipTrigger.mjs +98 -0
- package/dist/components/TooltipTrigger.mjs.map +1 -0
- package/dist/components/TooltipTrigger.module.css +62 -0
- package/dist/components/icons/ArrowToRectangleIcon.cjs +19 -0
- package/dist/components/icons/ArrowToRectangleIcon.cjs.map +1 -0
- package/dist/components/icons/ArrowToRectangleIcon.mjs +18 -0
- package/dist/components/icons/ArrowToRectangleIcon.mjs.map +1 -0
- package/dist/components/icons/BuildIcon.cjs +19 -0
- package/dist/components/icons/BuildIcon.cjs.map +1 -0
- package/dist/components/icons/BuildIcon.mjs +18 -0
- package/dist/components/icons/BuildIcon.mjs.map +1 -0
- package/dist/components/icons/CopyIcon.cjs +19 -0
- package/dist/components/icons/CopyIcon.cjs.map +1 -0
- package/dist/components/icons/CopyIcon.mjs +18 -0
- package/dist/components/icons/CopyIcon.mjs.map +1 -0
- package/dist/components/icons/CubeIcon.cjs +19 -0
- package/dist/components/icons/CubeIcon.cjs.map +1 -0
- package/dist/components/icons/CubeIcon.mjs +18 -0
- package/dist/components/icons/CubeIcon.mjs.map +1 -0
- package/dist/components/icons/DoubleChevronDown.cjs +19 -0
- package/dist/components/icons/DoubleChevronDown.cjs.map +1 -0
- package/dist/components/icons/DoubleChevronDown.mjs +18 -0
- package/dist/components/icons/DoubleChevronDown.mjs.map +1 -0
- package/dist/components/icons/ExternalLinkIcon.cjs +19 -0
- package/dist/components/icons/ExternalLinkIcon.cjs.map +1 -0
- package/dist/components/icons/ExternalLinkIcon.mjs +18 -0
- package/dist/components/icons/ExternalLinkIcon.mjs.map +1 -0
- package/dist/components/icons/EyeOpen.cjs +23 -0
- package/dist/components/icons/EyeOpen.cjs.map +1 -0
- package/dist/components/icons/EyeOpen.mjs +22 -0
- package/dist/components/icons/EyeOpen.mjs.map +1 -0
- package/dist/components/icons/LoadingRipples.cjs +79 -0
- package/dist/components/icons/LoadingRipples.cjs.map +1 -0
- package/dist/components/icons/LoadingRipples.mjs +78 -0
- package/dist/components/icons/LoadingRipples.mjs.map +1 -0
- package/dist/components/icons/SquaresPlus.cjs +19 -0
- package/dist/components/icons/SquaresPlus.cjs.map +1 -0
- package/dist/components/icons/SquaresPlus.mjs +18 -0
- package/dist/components/icons/SquaresPlus.mjs.map +1 -0
- package/dist/components/icons/Svg.cjs +37 -0
- package/dist/components/icons/Svg.cjs.map +1 -0
- package/dist/components/icons/Svg.mjs +36 -0
- package/dist/components/icons/Svg.mjs.map +1 -0
- package/dist/components/icons/X.cjs +19 -0
- package/dist/components/icons/X.cjs.map +1 -0
- package/dist/components/icons/X.mjs +18 -0
- package/dist/components/icons/X.mjs.map +1 -0
- package/dist/constants.cjs +9 -0
- package/dist/constants.cjs.map +1 -0
- package/dist/constants.mjs +7 -0
- package/dist/constants.mjs.map +1 -0
- package/dist/hooks/useDependencyGraph.cjs +63 -0
- package/dist/hooks/useDependencyGraph.cjs.map +1 -0
- package/dist/hooks/useDependencyGraph.mjs +60 -0
- package/dist/hooks/useDependencyGraph.mjs.map +1 -0
- package/dist/hooks/useDynamicStory.cjs +83 -0
- package/dist/hooks/useDynamicStory.cjs.map +1 -0
- package/dist/hooks/useDynamicStory.mjs +82 -0
- package/dist/hooks/useDynamicStory.mjs.map +1 -0
- package/dist/hooks/useStoryParams.cjs +17 -0
- package/dist/hooks/useStoryParams.cjs.map +1 -0
- package/dist/hooks/useStoryParams.mjs +16 -0
- package/dist/hooks/useStoryParams.mjs.map +1 -0
- package/dist/index.cjs +15 -0
- package/dist/index.d.cts +6 -0
- package/dist/index.d.mts +6 -0
- package/dist/index.mjs +9 -0
- package/dist/manager.cjs +22 -0
- package/dist/manager.cjs.map +1 -0
- package/dist/manager.d.cts +1 -0
- package/dist/manager.d.mts +1 -0
- package/dist/manager.mjs +21 -0
- package/dist/manager.mjs.map +1 -0
- package/dist/panels/DefaultAutoDocsLayout.cjs +24 -0
- package/dist/panels/DefaultAutoDocsLayout.cjs.map +1 -0
- package/dist/panels/DefaultAutoDocsLayout.d.cts +10 -0
- package/dist/panels/DefaultAutoDocsLayout.d.mts +10 -0
- package/dist/panels/DefaultAutoDocsLayout.mjs +22 -0
- package/dist/panels/DefaultAutoDocsLayout.mjs.map +1 -0
- package/dist/panels/GraphView.cjs +78 -0
- package/dist/panels/GraphView.cjs.map +1 -0
- package/dist/panels/GraphView.d.cts +7 -0
- package/dist/panels/GraphView.d.mts +7 -0
- package/dist/panels/GraphView.mjs +77 -0
- package/dist/panels/GraphView.mjs.map +1 -0
- package/dist/panels/index.cjs +3 -0
- package/dist/panels/index.d.cts +3 -0
- package/dist/panels/index.d.mts +3 -0
- package/dist/panels/index.mjs +3 -0
- package/dist/preview.cjs +23 -0
- package/dist/preview.cjs.map +1 -0
- package/dist/preview.d.cts +9 -0
- package/dist/preview.d.mts +10 -0
- package/dist/preview.mjs +21 -0
- package/dist/preview.mjs.map +1 -0
- package/dist/types.cjs +0 -0
- package/dist/types.d.cts +104 -0
- package/dist/types.d.mts +104 -0
- package/dist/types.mjs +0 -0
- package/package.json +94 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"EyeOpen.mjs","names":[],"sources":["../../../src/components/icons/EyeOpen.tsx"],"sourcesContent":["import type { IconProps } from './iconTypes'\nimport { Svg } from './Svg'\n\nexport function EyeOpen(props: IconProps) {\n\treturn (\n\t\t<Svg {...props}>\n\t\t\t<path\n\t\t\t\tstrokeLinecap=\"round\"\n\t\t\t\tstrokeLinejoin=\"round\"\n\t\t\t\td=\"M2.036 12.322a1.012 1.012 0 0 1 0-.639C3.423 7.51 7.36 4.5 12 4.5c4.638 0 8.573 3.007 9.963 7.178.07.207.07.431 0 .639C20.577 16.49 16.64 19.5 12 19.5c-4.638 0-8.573-3.007-9.963-7.178Z\"\n\t\t\t/>\n\t\t\t<path\n\t\t\t\tstrokeLinecap=\"round\"\n\t\t\t\tstrokeLinejoin=\"round\"\n\t\t\t\td=\"M15 12a3 3 0 1 1-6 0 3 3 0 0 1 6 0Z\"\n\t\t\t/>\n\t\t</Svg>\n\t)\n}\n"],"mappings":";;;;AAGA,SAAgB,QAAQ,OAAkB;AACzC,QACC,qBAAC;EAAI,GAAI;aACR,oBAAC;GACA,eAAc;GACd,gBAAe;GACf,GAAE;IACD,EACF,oBAAC;GACA,eAAc;GACd,gBAAe;GACf,GAAE;IACD;GACG"}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
const require_runtime = require('../../_virtual/_rolldown/runtime.cjs');
|
|
2
|
+
const require_Svg = require('./Svg.cjs');
|
|
3
|
+
let react_jsx_runtime = require("react/jsx-runtime");
|
|
4
|
+
|
|
5
|
+
//#region src/components/icons/LoadingRipples.tsx
|
|
6
|
+
function LoadingRipples(props) {
|
|
7
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_Svg.Svg, {
|
|
8
|
+
...props,
|
|
9
|
+
viewBox: "0 0 100 100",
|
|
10
|
+
strokeWidth: 0,
|
|
11
|
+
width: "100",
|
|
12
|
+
height: "100",
|
|
13
|
+
style: {
|
|
14
|
+
shapeRendering: "auto",
|
|
15
|
+
background: "transparent"
|
|
16
|
+
},
|
|
17
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("g", { children: [
|
|
18
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("circle", {
|
|
19
|
+
strokeWidth: 2,
|
|
20
|
+
stroke: "#000000",
|
|
21
|
+
fill: "none",
|
|
22
|
+
r: "0",
|
|
23
|
+
cy: "50",
|
|
24
|
+
cx: "50",
|
|
25
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("animate", {
|
|
26
|
+
begin: "0s",
|
|
27
|
+
values: "0;40",
|
|
28
|
+
dur: "1s",
|
|
29
|
+
calcMode: "spline",
|
|
30
|
+
keySplines: "0 0.2 0.8 1",
|
|
31
|
+
keyTimes: "0;1",
|
|
32
|
+
repeatCount: "indefinite",
|
|
33
|
+
attributeName: "r"
|
|
34
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("animate", {
|
|
35
|
+
begin: "0s",
|
|
36
|
+
values: "1;0",
|
|
37
|
+
dur: "1s",
|
|
38
|
+
calcMode: "spline",
|
|
39
|
+
keySplines: "0.2 0 0.8 1",
|
|
40
|
+
keyTimes: "0;1",
|
|
41
|
+
repeatCount: "indefinite",
|
|
42
|
+
attributeName: "opacity"
|
|
43
|
+
})]
|
|
44
|
+
}),
|
|
45
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("circle", {
|
|
46
|
+
strokeWidth: 2,
|
|
47
|
+
stroke: "#b0b0b0",
|
|
48
|
+
fill: "none",
|
|
49
|
+
r: "0",
|
|
50
|
+
cy: "50",
|
|
51
|
+
cx: "50",
|
|
52
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("animate", {
|
|
53
|
+
begin: "-0.5s",
|
|
54
|
+
values: "0;40",
|
|
55
|
+
dur: "1s",
|
|
56
|
+
calcMode: "spline",
|
|
57
|
+
keySplines: "0 0.2 0.8 1",
|
|
58
|
+
keyTimes: "0;1",
|
|
59
|
+
repeatCount: "indefinite",
|
|
60
|
+
attributeName: "r"
|
|
61
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("animate", {
|
|
62
|
+
begin: "-0.5s",
|
|
63
|
+
values: "1;0",
|
|
64
|
+
dur: "1s",
|
|
65
|
+
calcMode: "spline",
|
|
66
|
+
keySplines: "0.2 0 0.8 1",
|
|
67
|
+
keyTimes: "0;1",
|
|
68
|
+
repeatCount: "indefinite",
|
|
69
|
+
attributeName: "opacity"
|
|
70
|
+
})]
|
|
71
|
+
}),
|
|
72
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("g", {})
|
|
73
|
+
] })
|
|
74
|
+
});
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
//#endregion
|
|
78
|
+
exports.LoadingRipples = LoadingRipples;
|
|
79
|
+
//# sourceMappingURL=LoadingRipples.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LoadingRipples.cjs","names":["Svg"],"sources":["../../../src/components/icons/LoadingRipples.tsx"],"sourcesContent":["import type { IconProps } from './iconTypes'\nimport { Svg } from './Svg'\n\n// <!-- [ldio] SVG content generated by https://loading.io -->\n\nexport function LoadingRipples(props: IconProps) {\n\treturn (\n\t\t<Svg\n\t\t\t{...props}\n\t\t\tviewBox=\"0 0 100 100\"\n\t\t\tstrokeWidth={0}\n\t\t\twidth=\"100\"\n\t\t\theight=\"100\"\n\t\t\tstyle={{ shapeRendering: 'auto', background: 'transparent' }}\n\t\t>\n\t\t\t<g>\n\t\t\t\t<circle\n\t\t\t\t\tstrokeWidth={2}\n\t\t\t\t\tstroke=\"#000000\"\n\t\t\t\t\tfill=\"none\"\n\t\t\t\t\tr=\"0\"\n\t\t\t\t\tcy=\"50\"\n\t\t\t\t\tcx=\"50\"\n\t\t\t\t>\n\t\t\t\t\t<animate\n\t\t\t\t\t\tbegin=\"0s\"\n\t\t\t\t\t\tvalues=\"0;40\"\n\t\t\t\t\t\tdur=\"1s\"\n\t\t\t\t\t\t{...{\n\t\t\t\t\t\t\tcalcMode: 'spline',\n\t\t\t\t\t\t\tkeySplines: '0 0.2 0.8 1',\n\t\t\t\t\t\t\tkeyTimes: '0;1',\n\t\t\t\t\t\t\trepeatCount: 'indefinite',\n\t\t\t\t\t\t\tattributeName: 'r',\n\t\t\t\t\t\t}}\n\t\t\t\t\t/>\n\t\t\t\t\t<animate\n\t\t\t\t\t\tbegin=\"0s\"\n\t\t\t\t\t\tvalues=\"1;0\"\n\t\t\t\t\t\tdur=\"1s\"\n\t\t\t\t\t\t{...{\n\t\t\t\t\t\t\tcalcMode: 'spline',\n\t\t\t\t\t\t\tkeySplines: '0.2 0 0.8 1',\n\t\t\t\t\t\t\tkeyTimes: '0;1',\n\t\t\t\t\t\t\trepeatCount: 'indefinite',\n\t\t\t\t\t\t\tattributeName: 'opacity',\n\t\t\t\t\t\t}}\n\t\t\t\t\t/>\n\t\t\t\t</circle>\n\t\t\t\t<circle\n\t\t\t\t\tstrokeWidth={2}\n\t\t\t\t\tstroke=\"#b0b0b0\"\n\t\t\t\t\tfill=\"none\"\n\t\t\t\t\tr=\"0\"\n\t\t\t\t\tcy=\"50\"\n\t\t\t\t\tcx=\"50\"\n\t\t\t\t>\n\t\t\t\t\t<animate\n\t\t\t\t\t\tbegin=\"-0.5s\"\n\t\t\t\t\t\tvalues=\"0;40\"\n\t\t\t\t\t\tdur=\"1s\"\n\t\t\t\t\t\t{...{\n\t\t\t\t\t\t\tcalcMode: 'spline',\n\t\t\t\t\t\t\tkeySplines: '0 0.2 0.8 1',\n\t\t\t\t\t\t\tkeyTimes: '0;1',\n\t\t\t\t\t\t\trepeatCount: 'indefinite',\n\t\t\t\t\t\t\tattributeName: 'r',\n\t\t\t\t\t\t}}\n\t\t\t\t\t/>\n\t\t\t\t\t<animate\n\t\t\t\t\t\tbegin=\"-0.5s\"\n\t\t\t\t\t\tvalues=\"1;0\"\n\t\t\t\t\t\tdur=\"1s\"\n\t\t\t\t\t\t{...{\n\t\t\t\t\t\t\tcalcMode: 'spline',\n\t\t\t\t\t\t\tkeySplines: '0.2 0 0.8 1',\n\t\t\t\t\t\t\tkeyTimes: '0;1',\n\t\t\t\t\t\t\trepeatCount: 'indefinite',\n\t\t\t\t\t\t\tattributeName: 'opacity',\n\t\t\t\t\t\t}}\n\t\t\t\t\t/>\n\t\t\t\t</circle>\n\t\t\t\t<g />\n\t\t\t</g>\n\t\t</Svg>\n\t)\n}\n"],"mappings":";;;;;AAKA,SAAgB,eAAe,OAAkB;AAChD,QACC,2CAACA;EACA,GAAI;EACJ,SAAQ;EACR,aAAa;EACb,OAAM;EACN,QAAO;EACP,OAAO;GAAE,gBAAgB;GAAQ,YAAY;GAAe;YAE5D,4CAAC;GACA,4CAAC;IACA,aAAa;IACb,QAAO;IACP,MAAK;IACL,GAAE;IACF,IAAG;IACH,IAAG;eAEH,2CAAC;KACA,OAAM;KACN,QAAO;KACP,KAAI;KAEH,UAAU;KACV,YAAY;KACZ,UAAU;KACV,aAAa;KACb,eAAe;MAEf,EACF,2CAAC;KACA,OAAM;KACN,QAAO;KACP,KAAI;KAEH,UAAU;KACV,YAAY;KACZ,UAAU;KACV,aAAa;KACb,eAAe;MAEf;KACM;GACT,4CAAC;IACA,aAAa;IACb,QAAO;IACP,MAAK;IACL,GAAE;IACF,IAAG;IACH,IAAG;eAEH,2CAAC;KACA,OAAM;KACN,QAAO;KACP,KAAI;KAEH,UAAU;KACV,YAAY;KACZ,UAAU;KACV,aAAa;KACb,eAAe;MAEf,EACF,2CAAC;KACA,OAAM;KACN,QAAO;KACP,KAAI;KAEH,UAAU;KACV,YAAY;KACZ,UAAU;KACV,aAAa;KACb,eAAe;MAEf;KACM;GACT,2CAAC,QAAI;MACF;GACC"}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import { Svg } from "./Svg.mjs";
|
|
2
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
+
|
|
4
|
+
//#region src/components/icons/LoadingRipples.tsx
|
|
5
|
+
function LoadingRipples(props) {
|
|
6
|
+
return /* @__PURE__ */ jsx(Svg, {
|
|
7
|
+
...props,
|
|
8
|
+
viewBox: "0 0 100 100",
|
|
9
|
+
strokeWidth: 0,
|
|
10
|
+
width: "100",
|
|
11
|
+
height: "100",
|
|
12
|
+
style: {
|
|
13
|
+
shapeRendering: "auto",
|
|
14
|
+
background: "transparent"
|
|
15
|
+
},
|
|
16
|
+
children: /* @__PURE__ */ jsxs("g", { children: [
|
|
17
|
+
/* @__PURE__ */ jsxs("circle", {
|
|
18
|
+
strokeWidth: 2,
|
|
19
|
+
stroke: "#000000",
|
|
20
|
+
fill: "none",
|
|
21
|
+
r: "0",
|
|
22
|
+
cy: "50",
|
|
23
|
+
cx: "50",
|
|
24
|
+
children: [/* @__PURE__ */ jsx("animate", {
|
|
25
|
+
begin: "0s",
|
|
26
|
+
values: "0;40",
|
|
27
|
+
dur: "1s",
|
|
28
|
+
calcMode: "spline",
|
|
29
|
+
keySplines: "0 0.2 0.8 1",
|
|
30
|
+
keyTimes: "0;1",
|
|
31
|
+
repeatCount: "indefinite",
|
|
32
|
+
attributeName: "r"
|
|
33
|
+
}), /* @__PURE__ */ jsx("animate", {
|
|
34
|
+
begin: "0s",
|
|
35
|
+
values: "1;0",
|
|
36
|
+
dur: "1s",
|
|
37
|
+
calcMode: "spline",
|
|
38
|
+
keySplines: "0.2 0 0.8 1",
|
|
39
|
+
keyTimes: "0;1",
|
|
40
|
+
repeatCount: "indefinite",
|
|
41
|
+
attributeName: "opacity"
|
|
42
|
+
})]
|
|
43
|
+
}),
|
|
44
|
+
/* @__PURE__ */ jsxs("circle", {
|
|
45
|
+
strokeWidth: 2,
|
|
46
|
+
stroke: "#b0b0b0",
|
|
47
|
+
fill: "none",
|
|
48
|
+
r: "0",
|
|
49
|
+
cy: "50",
|
|
50
|
+
cx: "50",
|
|
51
|
+
children: [/* @__PURE__ */ jsx("animate", {
|
|
52
|
+
begin: "-0.5s",
|
|
53
|
+
values: "0;40",
|
|
54
|
+
dur: "1s",
|
|
55
|
+
calcMode: "spline",
|
|
56
|
+
keySplines: "0 0.2 0.8 1",
|
|
57
|
+
keyTimes: "0;1",
|
|
58
|
+
repeatCount: "indefinite",
|
|
59
|
+
attributeName: "r"
|
|
60
|
+
}), /* @__PURE__ */ jsx("animate", {
|
|
61
|
+
begin: "-0.5s",
|
|
62
|
+
values: "1;0",
|
|
63
|
+
dur: "1s",
|
|
64
|
+
calcMode: "spline",
|
|
65
|
+
keySplines: "0.2 0 0.8 1",
|
|
66
|
+
keyTimes: "0;1",
|
|
67
|
+
repeatCount: "indefinite",
|
|
68
|
+
attributeName: "opacity"
|
|
69
|
+
})]
|
|
70
|
+
}),
|
|
71
|
+
/* @__PURE__ */ jsx("g", {})
|
|
72
|
+
] })
|
|
73
|
+
});
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
//#endregion
|
|
77
|
+
export { LoadingRipples };
|
|
78
|
+
//# sourceMappingURL=LoadingRipples.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LoadingRipples.mjs","names":[],"sources":["../../../src/components/icons/LoadingRipples.tsx"],"sourcesContent":["import type { IconProps } from './iconTypes'\nimport { Svg } from './Svg'\n\n// <!-- [ldio] SVG content generated by https://loading.io -->\n\nexport function LoadingRipples(props: IconProps) {\n\treturn (\n\t\t<Svg\n\t\t\t{...props}\n\t\t\tviewBox=\"0 0 100 100\"\n\t\t\tstrokeWidth={0}\n\t\t\twidth=\"100\"\n\t\t\theight=\"100\"\n\t\t\tstyle={{ shapeRendering: 'auto', background: 'transparent' }}\n\t\t>\n\t\t\t<g>\n\t\t\t\t<circle\n\t\t\t\t\tstrokeWidth={2}\n\t\t\t\t\tstroke=\"#000000\"\n\t\t\t\t\tfill=\"none\"\n\t\t\t\t\tr=\"0\"\n\t\t\t\t\tcy=\"50\"\n\t\t\t\t\tcx=\"50\"\n\t\t\t\t>\n\t\t\t\t\t<animate\n\t\t\t\t\t\tbegin=\"0s\"\n\t\t\t\t\t\tvalues=\"0;40\"\n\t\t\t\t\t\tdur=\"1s\"\n\t\t\t\t\t\t{...{\n\t\t\t\t\t\t\tcalcMode: 'spline',\n\t\t\t\t\t\t\tkeySplines: '0 0.2 0.8 1',\n\t\t\t\t\t\t\tkeyTimes: '0;1',\n\t\t\t\t\t\t\trepeatCount: 'indefinite',\n\t\t\t\t\t\t\tattributeName: 'r',\n\t\t\t\t\t\t}}\n\t\t\t\t\t/>\n\t\t\t\t\t<animate\n\t\t\t\t\t\tbegin=\"0s\"\n\t\t\t\t\t\tvalues=\"1;0\"\n\t\t\t\t\t\tdur=\"1s\"\n\t\t\t\t\t\t{...{\n\t\t\t\t\t\t\tcalcMode: 'spline',\n\t\t\t\t\t\t\tkeySplines: '0.2 0 0.8 1',\n\t\t\t\t\t\t\tkeyTimes: '0;1',\n\t\t\t\t\t\t\trepeatCount: 'indefinite',\n\t\t\t\t\t\t\tattributeName: 'opacity',\n\t\t\t\t\t\t}}\n\t\t\t\t\t/>\n\t\t\t\t</circle>\n\t\t\t\t<circle\n\t\t\t\t\tstrokeWidth={2}\n\t\t\t\t\tstroke=\"#b0b0b0\"\n\t\t\t\t\tfill=\"none\"\n\t\t\t\t\tr=\"0\"\n\t\t\t\t\tcy=\"50\"\n\t\t\t\t\tcx=\"50\"\n\t\t\t\t>\n\t\t\t\t\t<animate\n\t\t\t\t\t\tbegin=\"-0.5s\"\n\t\t\t\t\t\tvalues=\"0;40\"\n\t\t\t\t\t\tdur=\"1s\"\n\t\t\t\t\t\t{...{\n\t\t\t\t\t\t\tcalcMode: 'spline',\n\t\t\t\t\t\t\tkeySplines: '0 0.2 0.8 1',\n\t\t\t\t\t\t\tkeyTimes: '0;1',\n\t\t\t\t\t\t\trepeatCount: 'indefinite',\n\t\t\t\t\t\t\tattributeName: 'r',\n\t\t\t\t\t\t}}\n\t\t\t\t\t/>\n\t\t\t\t\t<animate\n\t\t\t\t\t\tbegin=\"-0.5s\"\n\t\t\t\t\t\tvalues=\"1;0\"\n\t\t\t\t\t\tdur=\"1s\"\n\t\t\t\t\t\t{...{\n\t\t\t\t\t\t\tcalcMode: 'spline',\n\t\t\t\t\t\t\tkeySplines: '0.2 0 0.8 1',\n\t\t\t\t\t\t\tkeyTimes: '0;1',\n\t\t\t\t\t\t\trepeatCount: 'indefinite',\n\t\t\t\t\t\t\tattributeName: 'opacity',\n\t\t\t\t\t\t}}\n\t\t\t\t\t/>\n\t\t\t\t</circle>\n\t\t\t\t<g />\n\t\t\t</g>\n\t\t</Svg>\n\t)\n}\n"],"mappings":";;;;AAKA,SAAgB,eAAe,OAAkB;AAChD,QACC,oBAAC;EACA,GAAI;EACJ,SAAQ;EACR,aAAa;EACb,OAAM;EACN,QAAO;EACP,OAAO;GAAE,gBAAgB;GAAQ,YAAY;GAAe;YAE5D,qBAAC;GACA,qBAAC;IACA,aAAa;IACb,QAAO;IACP,MAAK;IACL,GAAE;IACF,IAAG;IACH,IAAG;eAEH,oBAAC;KACA,OAAM;KACN,QAAO;KACP,KAAI;KAEH,UAAU;KACV,YAAY;KACZ,UAAU;KACV,aAAa;KACb,eAAe;MAEf,EACF,oBAAC;KACA,OAAM;KACN,QAAO;KACP,KAAI;KAEH,UAAU;KACV,YAAY;KACZ,UAAU;KACV,aAAa;KACb,eAAe;MAEf;KACM;GACT,qBAAC;IACA,aAAa;IACb,QAAO;IACP,MAAK;IACL,GAAE;IACF,IAAG;IACH,IAAG;eAEH,oBAAC;KACA,OAAM;KACN,QAAO;KACP,KAAI;KAEH,UAAU;KACV,YAAY;KACZ,UAAU;KACV,aAAa;KACb,eAAe;MAEf,EACF,oBAAC;KACA,OAAM;KACN,QAAO;KACP,KAAI;KAEH,UAAU;KACV,YAAY;KACZ,UAAU;KACV,aAAa;KACb,eAAe;MAEf;KACM;GACT,oBAAC,QAAI;MACF;GACC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
const require_runtime = require('../../_virtual/_rolldown/runtime.cjs');
|
|
2
|
+
const require_Svg = require('./Svg.cjs');
|
|
3
|
+
let react_jsx_runtime = require("react/jsx-runtime");
|
|
4
|
+
|
|
5
|
+
//#region src/components/icons/SquaresPlus.tsx
|
|
6
|
+
function SquaresPlus(props) {
|
|
7
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_Svg.Svg, {
|
|
8
|
+
...props,
|
|
9
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", {
|
|
10
|
+
strokeLinecap: "round",
|
|
11
|
+
strokeLinejoin: "round",
|
|
12
|
+
d: "M13.5 16.875h3.375m0 0h3.375m-3.375 0V13.5m0 3.375v3.375M6 10.5h2.25a2.25 2.25 0 0 0 2.25-2.25V6a2.25 2.25 0 0 0-2.25-2.25H6A2.25 2.25 0 0 0 3.75 6v2.25A2.25 2.25 0 0 0 6 10.5Zm0 9.75h2.25A2.25 2.25 0 0 0 10.5 18v-2.25a2.25 2.25 0 0 0-2.25-2.25H6a2.25 2.25 0 0 0-2.25 2.25V18A2.25 2.25 0 0 0 6 20.25Zm9.75-9.75H18a2.25 2.25 0 0 0 2.25-2.25V6A2.25 2.25 0 0 0 18 3.75h-2.25A2.25 2.25 0 0 0 13.5 6v2.25a2.25 2.25 0 0 0 2.25 2.25Z"
|
|
13
|
+
})
|
|
14
|
+
});
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
//#endregion
|
|
18
|
+
exports.SquaresPlus = SquaresPlus;
|
|
19
|
+
//# sourceMappingURL=SquaresPlus.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SquaresPlus.cjs","names":["Svg"],"sources":["../../../src/components/icons/SquaresPlus.tsx"],"sourcesContent":["import type { IconProps } from './iconTypes'\nimport { Svg } from './Svg'\n\nexport function SquaresPlus(props: IconProps) {\n\treturn (\n\t\t<Svg {...props}>\n\t\t\t<path\n\t\t\t\tstrokeLinecap=\"round\"\n\t\t\t\tstrokeLinejoin=\"round\"\n\t\t\t\td=\"M13.5 16.875h3.375m0 0h3.375m-3.375 0V13.5m0 3.375v3.375M6 10.5h2.25a2.25 2.25 0 0 0 2.25-2.25V6a2.25 2.25 0 0 0-2.25-2.25H6A2.25 2.25 0 0 0 3.75 6v2.25A2.25 2.25 0 0 0 6 10.5Zm0 9.75h2.25A2.25 2.25 0 0 0 10.5 18v-2.25a2.25 2.25 0 0 0-2.25-2.25H6a2.25 2.25 0 0 0-2.25 2.25V18A2.25 2.25 0 0 0 6 20.25Zm9.75-9.75H18a2.25 2.25 0 0 0 2.25-2.25V6A2.25 2.25 0 0 0 18 3.75h-2.25A2.25 2.25 0 0 0 13.5 6v2.25a2.25 2.25 0 0 0 2.25 2.25Z\"\n\t\t\t/>\n\t\t</Svg>\n\t)\n}\n"],"mappings":";;;;;AAGA,SAAgB,YAAY,OAAkB;AAC7C,QACC,2CAACA;EAAI,GAAI;YACR,2CAAC;GACA,eAAc;GACd,gBAAe;GACf,GAAE;IACD;GACG"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { Svg } from "./Svg.mjs";
|
|
2
|
+
import { jsx } from "react/jsx-runtime";
|
|
3
|
+
|
|
4
|
+
//#region src/components/icons/SquaresPlus.tsx
|
|
5
|
+
function SquaresPlus(props) {
|
|
6
|
+
return /* @__PURE__ */ jsx(Svg, {
|
|
7
|
+
...props,
|
|
8
|
+
children: /* @__PURE__ */ jsx("path", {
|
|
9
|
+
strokeLinecap: "round",
|
|
10
|
+
strokeLinejoin: "round",
|
|
11
|
+
d: "M13.5 16.875h3.375m0 0h3.375m-3.375 0V13.5m0 3.375v3.375M6 10.5h2.25a2.25 2.25 0 0 0 2.25-2.25V6a2.25 2.25 0 0 0-2.25-2.25H6A2.25 2.25 0 0 0 3.75 6v2.25A2.25 2.25 0 0 0 6 10.5Zm0 9.75h2.25A2.25 2.25 0 0 0 10.5 18v-2.25a2.25 2.25 0 0 0-2.25-2.25H6a2.25 2.25 0 0 0-2.25 2.25V18A2.25 2.25 0 0 0 6 20.25Zm9.75-9.75H18a2.25 2.25 0 0 0 2.25-2.25V6A2.25 2.25 0 0 0 18 3.75h-2.25A2.25 2.25 0 0 0 13.5 6v2.25a2.25 2.25 0 0 0 2.25 2.25Z"
|
|
12
|
+
})
|
|
13
|
+
});
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
//#endregion
|
|
17
|
+
export { SquaresPlus };
|
|
18
|
+
//# sourceMappingURL=SquaresPlus.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SquaresPlus.mjs","names":[],"sources":["../../../src/components/icons/SquaresPlus.tsx"],"sourcesContent":["import type { IconProps } from './iconTypes'\nimport { Svg } from './Svg'\n\nexport function SquaresPlus(props: IconProps) {\n\treturn (\n\t\t<Svg {...props}>\n\t\t\t<path\n\t\t\t\tstrokeLinecap=\"round\"\n\t\t\t\tstrokeLinejoin=\"round\"\n\t\t\t\td=\"M13.5 16.875h3.375m0 0h3.375m-3.375 0V13.5m0 3.375v3.375M6 10.5h2.25a2.25 2.25 0 0 0 2.25-2.25V6a2.25 2.25 0 0 0-2.25-2.25H6A2.25 2.25 0 0 0 3.75 6v2.25A2.25 2.25 0 0 0 6 10.5Zm0 9.75h2.25A2.25 2.25 0 0 0 10.5 18v-2.25a2.25 2.25 0 0 0-2.25-2.25H6a2.25 2.25 0 0 0-2.25 2.25V18A2.25 2.25 0 0 0 6 20.25Zm9.75-9.75H18a2.25 2.25 0 0 0 2.25-2.25V6A2.25 2.25 0 0 0 18 3.75h-2.25A2.25 2.25 0 0 0 13.5 6v2.25a2.25 2.25 0 0 0 2.25 2.25Z\"\n\t\t\t/>\n\t\t</Svg>\n\t)\n}\n"],"mappings":";;;;AAGA,SAAgB,YAAY,OAAkB;AAC7C,QACC,oBAAC;EAAI,GAAI;YACR,oBAAC;GACA,eAAc;GACd,gBAAe;GACf,GAAE;IACD;GACG"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
const require_runtime = require('../../_virtual/_rolldown/runtime.cjs');
|
|
2
|
+
let react_jsx_runtime = require("react/jsx-runtime");
|
|
3
|
+
|
|
4
|
+
//#region src/components/icons/Svg.tsx
|
|
5
|
+
function Svg({ altText, className, children, ...svgOverrides }) {
|
|
6
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("svg", {
|
|
7
|
+
...defaultIconAttributes(altText),
|
|
8
|
+
...svgOverrides,
|
|
9
|
+
className,
|
|
10
|
+
children
|
|
11
|
+
});
|
|
12
|
+
}
|
|
13
|
+
const staticAttrs = {
|
|
14
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
15
|
+
fill: "none",
|
|
16
|
+
viewBox: "0 0 24 24",
|
|
17
|
+
strokeWidth: 1.5,
|
|
18
|
+
stroke: "currentColor",
|
|
19
|
+
height: 24,
|
|
20
|
+
width: 24,
|
|
21
|
+
focusable: false
|
|
22
|
+
};
|
|
23
|
+
function defaultIconAttributes(altText) {
|
|
24
|
+
const dynamicAttrs = {
|
|
25
|
+
role: "img",
|
|
26
|
+
"aria-label": altText ? altText : undefined,
|
|
27
|
+
"aria-hidden": altText ? undefined : true
|
|
28
|
+
};
|
|
29
|
+
return {
|
|
30
|
+
...staticAttrs,
|
|
31
|
+
...dynamicAttrs
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
//#endregion
|
|
36
|
+
exports.Svg = Svg;
|
|
37
|
+
//# sourceMappingURL=Svg.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Svg.cjs","names":[],"sources":["../../../src/components/icons/Svg.tsx"],"sourcesContent":["import type { ReactNode } from 'react'\nimport type { IconProps } from './iconTypes'\n\ninterface SvgProps extends IconProps, SVGAttributes<SVGElement> {\n\tchildren?: ReactNode\n}\n\nexport function Svg({\n\taltText,\n\tclassName,\n\tchildren,\n\t...svgOverrides\n}: SvgProps) {\n\treturn (\n\t\t<svg\n\t\t\t{...defaultIconAttributes(altText)}\n\t\t\t{...svgOverrides}\n\t\t\tclassName={className}\n\t\t>\n\t\t\t{children}\n\t\t</svg>\n\t)\n}\n\nimport type { SVGAttributes } from 'react'\n\nconst staticAttrs: SVGAttributes<SVGElement> = {\n\txmlns: 'http://www.w3.org/2000/svg',\n\tfill: 'none',\n\tviewBox: '0 0 24 24',\n\tstrokeWidth: 1.5,\n\tstroke: 'currentColor',\n\theight: 24,\n\twidth: 24,\n\tfocusable: false,\n}\n\nfunction defaultIconAttributes(altText?: string): SVGAttributes<SVGElement> {\n\tconst dynamicAttrs: SVGAttributes<SVGElement> = {\n\t\trole: 'img',\n\t\t'aria-label': altText ? altText : undefined,\n\t\t'aria-hidden': altText ? undefined : true,\n\t}\n\treturn {\n\t\t...staticAttrs,\n\t\t...dynamicAttrs,\n\t}\n}\n"],"mappings":";;;;AAOA,SAAgB,IAAI,EACnB,SACA,WACA,UACA,GAAG,gBACS;AACZ,QACC,2CAAC;EACA,GAAI,sBAAsB,QAAQ;EAClC,GAAI;EACO;EAEV;GACI;;AAMR,MAAM,cAAyC;CAC9C,OAAO;CACP,MAAM;CACN,SAAS;CACT,aAAa;CACb,QAAQ;CACR,QAAQ;CACR,OAAO;CACP,WAAW;CACX;AAED,SAAS,sBAAsB,SAA6C;CAC3E,MAAM,eAA0C;EAC/C,MAAM;EACN,cAAc,UAAU,UAAU;EAClC,eAAe,UAAU,YAAY;EACrC;AACD,QAAO;EACN,GAAG;EACH,GAAG;EACH"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
|
|
3
|
+
//#region src/components/icons/Svg.tsx
|
|
4
|
+
function Svg({ altText, className, children, ...svgOverrides }) {
|
|
5
|
+
return /* @__PURE__ */ jsx("svg", {
|
|
6
|
+
...defaultIconAttributes(altText),
|
|
7
|
+
...svgOverrides,
|
|
8
|
+
className,
|
|
9
|
+
children
|
|
10
|
+
});
|
|
11
|
+
}
|
|
12
|
+
const staticAttrs = {
|
|
13
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
14
|
+
fill: "none",
|
|
15
|
+
viewBox: "0 0 24 24",
|
|
16
|
+
strokeWidth: 1.5,
|
|
17
|
+
stroke: "currentColor",
|
|
18
|
+
height: 24,
|
|
19
|
+
width: 24,
|
|
20
|
+
focusable: false
|
|
21
|
+
};
|
|
22
|
+
function defaultIconAttributes(altText) {
|
|
23
|
+
const dynamicAttrs = {
|
|
24
|
+
role: "img",
|
|
25
|
+
"aria-label": altText ? altText : undefined,
|
|
26
|
+
"aria-hidden": altText ? undefined : true
|
|
27
|
+
};
|
|
28
|
+
return {
|
|
29
|
+
...staticAttrs,
|
|
30
|
+
...dynamicAttrs
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
//#endregion
|
|
35
|
+
export { Svg };
|
|
36
|
+
//# sourceMappingURL=Svg.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Svg.mjs","names":[],"sources":["../../../src/components/icons/Svg.tsx"],"sourcesContent":["import type { ReactNode } from 'react'\nimport type { IconProps } from './iconTypes'\n\ninterface SvgProps extends IconProps, SVGAttributes<SVGElement> {\n\tchildren?: ReactNode\n}\n\nexport function Svg({\n\taltText,\n\tclassName,\n\tchildren,\n\t...svgOverrides\n}: SvgProps) {\n\treturn (\n\t\t<svg\n\t\t\t{...defaultIconAttributes(altText)}\n\t\t\t{...svgOverrides}\n\t\t\tclassName={className}\n\t\t>\n\t\t\t{children}\n\t\t</svg>\n\t)\n}\n\nimport type { SVGAttributes } from 'react'\n\nconst staticAttrs: SVGAttributes<SVGElement> = {\n\txmlns: 'http://www.w3.org/2000/svg',\n\tfill: 'none',\n\tviewBox: '0 0 24 24',\n\tstrokeWidth: 1.5,\n\tstroke: 'currentColor',\n\theight: 24,\n\twidth: 24,\n\tfocusable: false,\n}\n\nfunction defaultIconAttributes(altText?: string): SVGAttributes<SVGElement> {\n\tconst dynamicAttrs: SVGAttributes<SVGElement> = {\n\t\trole: 'img',\n\t\t'aria-label': altText ? altText : undefined,\n\t\t'aria-hidden': altText ? undefined : true,\n\t}\n\treturn {\n\t\t...staticAttrs,\n\t\t...dynamicAttrs,\n\t}\n}\n"],"mappings":";;;AAOA,SAAgB,IAAI,EACnB,SACA,WACA,UACA,GAAG,gBACS;AACZ,QACC,oBAAC;EACA,GAAI,sBAAsB,QAAQ;EAClC,GAAI;EACO;EAEV;GACI;;AAMR,MAAM,cAAyC;CAC9C,OAAO;CACP,MAAM;CACN,SAAS;CACT,aAAa;CACb,QAAQ;CACR,QAAQ;CACR,OAAO;CACP,WAAW;CACX;AAED,SAAS,sBAAsB,SAA6C;CAC3E,MAAM,eAA0C;EAC/C,MAAM;EACN,cAAc,UAAU,UAAU;EAClC,eAAe,UAAU,YAAY;EACrC;AACD,QAAO;EACN,GAAG;EACH,GAAG;EACH"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
const require_runtime = require('../../_virtual/_rolldown/runtime.cjs');
|
|
2
|
+
const require_Svg = require('./Svg.cjs');
|
|
3
|
+
let react_jsx_runtime = require("react/jsx-runtime");
|
|
4
|
+
|
|
5
|
+
//#region src/components/icons/X.tsx
|
|
6
|
+
function X(props) {
|
|
7
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_Svg.Svg, {
|
|
8
|
+
...props,
|
|
9
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", {
|
|
10
|
+
strokeLinecap: "round",
|
|
11
|
+
strokeLinejoin: "round",
|
|
12
|
+
d: "M6 18 18 6M6 6l12 12"
|
|
13
|
+
})
|
|
14
|
+
});
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
//#endregion
|
|
18
|
+
exports.X = X;
|
|
19
|
+
//# sourceMappingURL=X.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"X.cjs","names":["Svg"],"sources":["../../../src/components/icons/X.tsx"],"sourcesContent":["import type { IconProps } from './iconTypes'\nimport { Svg } from './Svg'\n\nexport function X(props: IconProps) {\n\treturn (\n\t\t<Svg {...props}>\n\t\t\t<path\n\t\t\t\tstrokeLinecap=\"round\"\n\t\t\t\tstrokeLinejoin=\"round\"\n\t\t\t\td=\"M6 18 18 6M6 6l12 12\"\n\t\t\t/>\n\t\t</Svg>\n\t)\n}\n"],"mappings":";;;;;AAGA,SAAgB,EAAE,OAAkB;AACnC,QACC,2CAACA;EAAI,GAAI;YACR,2CAAC;GACA,eAAc;GACd,gBAAe;GACf,GAAE;IACD;GACG"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { Svg } from "./Svg.mjs";
|
|
2
|
+
import { jsx } from "react/jsx-runtime";
|
|
3
|
+
|
|
4
|
+
//#region src/components/icons/X.tsx
|
|
5
|
+
function X(props) {
|
|
6
|
+
return /* @__PURE__ */ jsx(Svg, {
|
|
7
|
+
...props,
|
|
8
|
+
children: /* @__PURE__ */ jsx("path", {
|
|
9
|
+
strokeLinecap: "round",
|
|
10
|
+
strokeLinejoin: "round",
|
|
11
|
+
d: "M6 18 18 6M6 6l12 12"
|
|
12
|
+
})
|
|
13
|
+
});
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
//#endregion
|
|
17
|
+
export { X };
|
|
18
|
+
//# sourceMappingURL=X.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"X.mjs","names":[],"sources":["../../../src/components/icons/X.tsx"],"sourcesContent":["import type { IconProps } from './iconTypes'\nimport { Svg } from './Svg'\n\nexport function X(props: IconProps) {\n\treturn (\n\t\t<Svg {...props}>\n\t\t\t<path\n\t\t\t\tstrokeLinecap=\"round\"\n\t\t\t\tstrokeLinejoin=\"round\"\n\t\t\t\td=\"M6 18 18 6M6 6l12 12\"\n\t\t\t/>\n\t\t</Svg>\n\t)\n}\n"],"mappings":";;;;AAGA,SAAgB,EAAE,OAAkB;AACnC,QACC,oBAAC;EAAI,GAAI;YACR,oBAAC;GACA,eAAc;GACd,gBAAe;GACf,GAAE;IACD;GACG"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.cjs","names":[],"sources":["../src/constants.ts"],"sourcesContent":["export const ADDON_ID = 'storybook/dependency-previews'\nexport const PANEL_ID = `${ADDON_ID}/panel`\n"],"mappings":";;AAAA,MAAa,WAAW;AACxB,MAAa,WAAW,GAAG,SAAS"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.mjs","names":[],"sources":["../src/constants.ts"],"sourcesContent":["export const ADDON_ID = 'storybook/dependency-previews'\nexport const PANEL_ID = `${ADDON_ID}/panel`\n"],"mappings":";AAAA,MAAa,WAAW;AACxB,MAAa,WAAW,GAAG,SAAS"}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
const require_runtime = require('../_virtual/_rolldown/runtime.cjs');
|
|
2
|
+
const require_useStoryParams = require('./useStoryParams.cjs');
|
|
3
|
+
let react = require("react");
|
|
4
|
+
let react_jsx_runtime = require("react/jsx-runtime");
|
|
5
|
+
|
|
6
|
+
//#region src/hooks/useDependencyGraph.tsx
|
|
7
|
+
const DependencyGraphContext = (0, react.createContext)({
|
|
8
|
+
graph: null,
|
|
9
|
+
node: null
|
|
10
|
+
});
|
|
11
|
+
function useDependencyGraph() {
|
|
12
|
+
return (0, react.useContext)(DependencyGraphContext);
|
|
13
|
+
}
|
|
14
|
+
function DependencyGraphProvider({ children }) {
|
|
15
|
+
const storyParams = require_useStoryParams.useStoryParams();
|
|
16
|
+
const filePath = storyParams?.__filePath;
|
|
17
|
+
const refinedFilePath = filePath?.replace(/^.+\/src\//, "src/").replace(".stories.", ".").replace(".story.", ".").replace(/\?.+$/, "");
|
|
18
|
+
const graph = storyParams.dependencyPreviews?.dependenciesJson;
|
|
19
|
+
const currentStoryId = storyParams._storyId;
|
|
20
|
+
const storyIdToNode = (0, react.useMemo)(() => {
|
|
21
|
+
if (!graph) return null;
|
|
22
|
+
const map = {};
|
|
23
|
+
for (const [_path, deps] of Object.entries(graph)) {
|
|
24
|
+
if (deps.storyId) {
|
|
25
|
+
map[deps.storyId] = deps;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
return map;
|
|
29
|
+
}, [graph]);
|
|
30
|
+
const node = (0, react.useMemo)(() => {
|
|
31
|
+
if (!graph) {
|
|
32
|
+
return null;
|
|
33
|
+
}
|
|
34
|
+
const docsStoryId = currentStoryId ? currentStoryId.replace(/--[^-]+$/, "--docs") : null;
|
|
35
|
+
const byStoryId = docsStoryId && storyIdToNode?.[docsStoryId] ? storyIdToNode[docsStoryId] : null;
|
|
36
|
+
const byPath = refinedFilePath ? graph[refinedFilePath] : null;
|
|
37
|
+
const result = byStoryId ?? byPath ?? null;
|
|
38
|
+
return result;
|
|
39
|
+
}, [
|
|
40
|
+
graph,
|
|
41
|
+
storyIdToNode,
|
|
42
|
+
currentStoryId,
|
|
43
|
+
refinedFilePath
|
|
44
|
+
]);
|
|
45
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(DependencyGraphContext.Provider, {
|
|
46
|
+
value: {
|
|
47
|
+
graph,
|
|
48
|
+
node
|
|
49
|
+
},
|
|
50
|
+
children
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
function filterOutStoryAndNonComponentFiles(array) {
|
|
54
|
+
return array.filter((info) => {
|
|
55
|
+
return Boolean(info.storyId) && !info.componentPath.includes(".stories.") && !info.componentPath.includes(".story.");
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
//#endregion
|
|
60
|
+
exports.DependencyGraphProvider = DependencyGraphProvider;
|
|
61
|
+
exports.filterOutStoryAndNonComponentFiles = filterOutStoryAndNonComponentFiles;
|
|
62
|
+
exports.useDependencyGraph = useDependencyGraph;
|
|
63
|
+
//# sourceMappingURL=useDependencyGraph.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useDependencyGraph.cjs","names":["useStoryParams"],"sources":["../../src/hooks/useDependencyGraph.tsx"],"sourcesContent":["import { createContext, useContext, useMemo, type ReactNode } from 'react'\nimport type { Deps, Graph, StoryInfo } from '../types'\nimport { useStoryParams } from './useStoryParams'\n\nexport interface DependencyGraphContextType {\n\tgraph: Graph | null\n\tnode: Deps | null\n}\n\nexport const DependencyGraphContext = createContext<DependencyGraphContextType>(\n\t{\n\t\tgraph: null,\n\t\tnode: null,\n\t},\n)\n\nexport function useDependencyGraph() {\n\treturn useContext(DependencyGraphContext)\n}\n\nexport function DependencyGraphProvider({ children }: { children: ReactNode }) {\n\tconst storyParams = useStoryParams()\n\tconst filePath = storyParams?.__filePath\n\tconst refinedFilePath = filePath\n\t\t?.replace(/^.+\\/src\\//, 'src/') // remove host from the path\n\t\t.replace('.stories.', '.') // remove .stories extension\n\t\t.replace('.story.', '.') // remove .story extension\n\t\t.replace(/\\?.+$/, '') // remove any query string parameters\n\n\tconst graph = storyParams.dependencyPreviews?.dependenciesJson\n\tconst currentStoryId = storyParams._storyId\n\n\t// Build a lookup map from storyId to graph entry\n\tconst storyIdToNode = useMemo(() => {\n\t\tif (!graph) return null\n\t\tconst map: Record<string, Deps> = {}\n\t\tfor (const [_path, deps] of Object.entries(graph)) {\n\t\t\tif (deps.storyId) {\n\t\t\t\tmap[deps.storyId] = deps\n\t\t\t}\n\t\t}\n\t\treturn map\n\t}, [graph])\n\n\tconst node = useMemo((): Deps | null => {\n\t\tif (!graph) {\n\t\t\treturn null\n\t\t}\n\n\t\t// Try multiple lookup strategies:\n\t\t// 1. By storyId (most reliable in production)\n\t\t// 2. By refined file path (works in dev with import.meta.url)\n\n\t\t// The dependency graph stores --docs story IDs, but users may be viewing\n\t\t// individual story variants (e.g., --primary, --secondary).\n\t\t// Normalize by converting the current storyId to its --docs variant.\n\t\tconst docsStoryId = currentStoryId\n\t\t\t? currentStoryId.replace(/--[^-]+$/, '--docs')\n\t\t\t: null\n\n\t\tconst byStoryId =\n\t\t\tdocsStoryId && storyIdToNode?.[docsStoryId]\n\t\t\t\t? storyIdToNode[docsStoryId]\n\t\t\t\t: null\n\t\tconst byPath = refinedFilePath ? graph[refinedFilePath] : null\n\n\t\tconst result = byStoryId ?? byPath ?? null\n\n\t\treturn result\n\t}, [graph, storyIdToNode, currentStoryId, refinedFilePath])\n\n\treturn (\n\t\t<DependencyGraphContext.Provider\n\t\t\tvalue={{\n\t\t\t\tgraph,\n\t\t\t\tnode,\n\t\t\t}}\n\t\t>\n\t\t\t{children}\n\t\t</DependencyGraphContext.Provider>\n\t)\n}\n\nexport function filterOutStoryAndNonComponentFiles(\n\tarray: Array<StoryInfo>,\n): Array<StoryInfo> {\n\treturn array.filter((info) => {\n\t\treturn (\n\t\t\tBoolean(info.storyId) &&\n\t\t\t!info.componentPath.includes('.stories.') &&\n\t\t\t!info.componentPath.includes('.story.')\n\t\t)\n\t})\n}\n"],"mappings":";;;;;;AASA,MAAa,kDACZ;CACC,OAAO;CACP,MAAM;CACN,CACD;AAED,SAAgB,qBAAqB;AACpC,8BAAkB,uBAAuB;;AAG1C,SAAgB,wBAAwB,EAAE,YAAqC;CAC9E,MAAM,cAAcA,uCAAgB;CACpC,MAAM,WAAW,aAAa;CAC9B,MAAM,kBAAkB,UACrB,QAAQ,cAAc,OAAO,CAC9B,QAAQ,aAAa,IAAI,CACzB,QAAQ,WAAW,IAAI,CACvB,QAAQ,SAAS,GAAG;CAEtB,MAAM,QAAQ,YAAY,oBAAoB;CAC9C,MAAM,iBAAiB,YAAY;CAGnC,MAAM,yCAA8B;AACnC,MAAI,CAAC,MAAO,QAAO;EACnB,MAAM,MAA4B,EAAE;AACpC,OAAK,MAAM,CAAC,OAAO,SAAS,OAAO,QAAQ,MAAM,EAAE;AAClD,OAAI,KAAK,SAAS;AACjB,QAAI,KAAK,WAAW;;;AAGtB,SAAO;IACL,CAAC,MAAM,CAAC;CAEX,MAAM,gCAAkC;AACvC,MAAI,CAAC,OAAO;AACX,UAAO;;EAUR,MAAM,cAAc,iBACjB,eAAe,QAAQ,YAAY,SAAS,GAC5C;EAEH,MAAM,YACL,eAAe,gBAAgB,eAC5B,cAAc,eACd;EACJ,MAAM,SAAS,kBAAkB,MAAM,mBAAmB;EAE1D,MAAM,SAAS,aAAa,UAAU;AAEtC,SAAO;IACL;EAAC;EAAO;EAAe;EAAgB;EAAgB,CAAC;AAE3D,QACC,2CAAC,uBAAuB;EACvB,OAAO;GACN;GACA;GACA;EAEA;GACgC;;AAIpC,SAAgB,mCACf,OACmB;AACnB,QAAO,MAAM,QAAQ,SAAS;AAC7B,SACC,QAAQ,KAAK,QAAQ,IACrB,CAAC,KAAK,cAAc,SAAS,YAAY,IACzC,CAAC,KAAK,cAAc,SAAS,UAAU;GAEvC"}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { useStoryParams } from "./useStoryParams.mjs";
|
|
2
|
+
import { createContext, useContext, useMemo } from "react";
|
|
3
|
+
import { jsx } from "react/jsx-runtime";
|
|
4
|
+
|
|
5
|
+
//#region src/hooks/useDependencyGraph.tsx
|
|
6
|
+
const DependencyGraphContext = createContext({
|
|
7
|
+
graph: null,
|
|
8
|
+
node: null
|
|
9
|
+
});
|
|
10
|
+
function useDependencyGraph() {
|
|
11
|
+
return useContext(DependencyGraphContext);
|
|
12
|
+
}
|
|
13
|
+
function DependencyGraphProvider({ children }) {
|
|
14
|
+
const storyParams = useStoryParams();
|
|
15
|
+
const filePath = storyParams?.__filePath;
|
|
16
|
+
const refinedFilePath = filePath?.replace(/^.+\/src\//, "src/").replace(".stories.", ".").replace(".story.", ".").replace(/\?.+$/, "");
|
|
17
|
+
const graph = storyParams.dependencyPreviews?.dependenciesJson;
|
|
18
|
+
const currentStoryId = storyParams._storyId;
|
|
19
|
+
const storyIdToNode = useMemo(() => {
|
|
20
|
+
if (!graph) return null;
|
|
21
|
+
const map = {};
|
|
22
|
+
for (const [_path, deps] of Object.entries(graph)) {
|
|
23
|
+
if (deps.storyId) {
|
|
24
|
+
map[deps.storyId] = deps;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
return map;
|
|
28
|
+
}, [graph]);
|
|
29
|
+
const node = useMemo(() => {
|
|
30
|
+
if (!graph) {
|
|
31
|
+
return null;
|
|
32
|
+
}
|
|
33
|
+
const docsStoryId = currentStoryId ? currentStoryId.replace(/--[^-]+$/, "--docs") : null;
|
|
34
|
+
const byStoryId = docsStoryId && storyIdToNode?.[docsStoryId] ? storyIdToNode[docsStoryId] : null;
|
|
35
|
+
const byPath = refinedFilePath ? graph[refinedFilePath] : null;
|
|
36
|
+
const result = byStoryId ?? byPath ?? null;
|
|
37
|
+
return result;
|
|
38
|
+
}, [
|
|
39
|
+
graph,
|
|
40
|
+
storyIdToNode,
|
|
41
|
+
currentStoryId,
|
|
42
|
+
refinedFilePath
|
|
43
|
+
]);
|
|
44
|
+
return /* @__PURE__ */ jsx(DependencyGraphContext.Provider, {
|
|
45
|
+
value: {
|
|
46
|
+
graph,
|
|
47
|
+
node
|
|
48
|
+
},
|
|
49
|
+
children
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
function filterOutStoryAndNonComponentFiles(array) {
|
|
53
|
+
return array.filter((info) => {
|
|
54
|
+
return Boolean(info.storyId) && !info.componentPath.includes(".stories.") && !info.componentPath.includes(".story.");
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
//#endregion
|
|
59
|
+
export { DependencyGraphProvider, filterOutStoryAndNonComponentFiles, useDependencyGraph };
|
|
60
|
+
//# sourceMappingURL=useDependencyGraph.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useDependencyGraph.mjs","names":[],"sources":["../../src/hooks/useDependencyGraph.tsx"],"sourcesContent":["import { createContext, useContext, useMemo, type ReactNode } from 'react'\nimport type { Deps, Graph, StoryInfo } from '../types'\nimport { useStoryParams } from './useStoryParams'\n\nexport interface DependencyGraphContextType {\n\tgraph: Graph | null\n\tnode: Deps | null\n}\n\nexport const DependencyGraphContext = createContext<DependencyGraphContextType>(\n\t{\n\t\tgraph: null,\n\t\tnode: null,\n\t},\n)\n\nexport function useDependencyGraph() {\n\treturn useContext(DependencyGraphContext)\n}\n\nexport function DependencyGraphProvider({ children }: { children: ReactNode }) {\n\tconst storyParams = useStoryParams()\n\tconst filePath = storyParams?.__filePath\n\tconst refinedFilePath = filePath\n\t\t?.replace(/^.+\\/src\\//, 'src/') // remove host from the path\n\t\t.replace('.stories.', '.') // remove .stories extension\n\t\t.replace('.story.', '.') // remove .story extension\n\t\t.replace(/\\?.+$/, '') // remove any query string parameters\n\n\tconst graph = storyParams.dependencyPreviews?.dependenciesJson\n\tconst currentStoryId = storyParams._storyId\n\n\t// Build a lookup map from storyId to graph entry\n\tconst storyIdToNode = useMemo(() => {\n\t\tif (!graph) return null\n\t\tconst map: Record<string, Deps> = {}\n\t\tfor (const [_path, deps] of Object.entries(graph)) {\n\t\t\tif (deps.storyId) {\n\t\t\t\tmap[deps.storyId] = deps\n\t\t\t}\n\t\t}\n\t\treturn map\n\t}, [graph])\n\n\tconst node = useMemo((): Deps | null => {\n\t\tif (!graph) {\n\t\t\treturn null\n\t\t}\n\n\t\t// Try multiple lookup strategies:\n\t\t// 1. By storyId (most reliable in production)\n\t\t// 2. By refined file path (works in dev with import.meta.url)\n\n\t\t// The dependency graph stores --docs story IDs, but users may be viewing\n\t\t// individual story variants (e.g., --primary, --secondary).\n\t\t// Normalize by converting the current storyId to its --docs variant.\n\t\tconst docsStoryId = currentStoryId\n\t\t\t? currentStoryId.replace(/--[^-]+$/, '--docs')\n\t\t\t: null\n\n\t\tconst byStoryId =\n\t\t\tdocsStoryId && storyIdToNode?.[docsStoryId]\n\t\t\t\t? storyIdToNode[docsStoryId]\n\t\t\t\t: null\n\t\tconst byPath = refinedFilePath ? graph[refinedFilePath] : null\n\n\t\tconst result = byStoryId ?? byPath ?? null\n\n\t\treturn result\n\t}, [graph, storyIdToNode, currentStoryId, refinedFilePath])\n\n\treturn (\n\t\t<DependencyGraphContext.Provider\n\t\t\tvalue={{\n\t\t\t\tgraph,\n\t\t\t\tnode,\n\t\t\t}}\n\t\t>\n\t\t\t{children}\n\t\t</DependencyGraphContext.Provider>\n\t)\n}\n\nexport function filterOutStoryAndNonComponentFiles(\n\tarray: Array<StoryInfo>,\n): Array<StoryInfo> {\n\treturn array.filter((info) => {\n\t\treturn (\n\t\t\tBoolean(info.storyId) &&\n\t\t\t!info.componentPath.includes('.stories.') &&\n\t\t\t!info.componentPath.includes('.story.')\n\t\t)\n\t})\n}\n"],"mappings":";;;;;AASA,MAAa,yBAAyB,cACrC;CACC,OAAO;CACP,MAAM;CACN,CACD;AAED,SAAgB,qBAAqB;AACpC,QAAO,WAAW,uBAAuB;;AAG1C,SAAgB,wBAAwB,EAAE,YAAqC;CAC9E,MAAM,cAAc,gBAAgB;CACpC,MAAM,WAAW,aAAa;CAC9B,MAAM,kBAAkB,UACrB,QAAQ,cAAc,OAAO,CAC9B,QAAQ,aAAa,IAAI,CACzB,QAAQ,WAAW,IAAI,CACvB,QAAQ,SAAS,GAAG;CAEtB,MAAM,QAAQ,YAAY,oBAAoB;CAC9C,MAAM,iBAAiB,YAAY;CAGnC,MAAM,gBAAgB,cAAc;AACnC,MAAI,CAAC,MAAO,QAAO;EACnB,MAAM,MAA4B,EAAE;AACpC,OAAK,MAAM,CAAC,OAAO,SAAS,OAAO,QAAQ,MAAM,EAAE;AAClD,OAAI,KAAK,SAAS;AACjB,QAAI,KAAK,WAAW;;;AAGtB,SAAO;IACL,CAAC,MAAM,CAAC;CAEX,MAAM,OAAO,cAA2B;AACvC,MAAI,CAAC,OAAO;AACX,UAAO;;EAUR,MAAM,cAAc,iBACjB,eAAe,QAAQ,YAAY,SAAS,GAC5C;EAEH,MAAM,YACL,eAAe,gBAAgB,eAC5B,cAAc,eACd;EACJ,MAAM,SAAS,kBAAkB,MAAM,mBAAmB;EAE1D,MAAM,SAAS,aAAa,UAAU;AAEtC,SAAO;IACL;EAAC;EAAO;EAAe;EAAgB;EAAgB,CAAC;AAE3D,QACC,oBAAC,uBAAuB;EACvB,OAAO;GACN;GACA;GACA;EAEA;GACgC;;AAIpC,SAAgB,mCACf,OACmB;AACnB,QAAO,MAAM,QAAQ,SAAS;AAC7B,SACC,QAAQ,KAAK,QAAQ,IACrB,CAAC,KAAK,cAAc,SAAS,YAAY,IACzC,CAAC,KAAK,cAAc,SAAS,UAAU;GAEvC"}
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
const require_runtime = require('../_virtual/_rolldown/runtime.cjs');
|
|
2
|
+
const require_useStoryParams = require('./useStoryParams.cjs');
|
|
3
|
+
let react = require("react");
|
|
4
|
+
|
|
5
|
+
//#region src/hooks/useDynamicStory.ts
|
|
6
|
+
function findStoryImporter(storiesGlob, storyFilePath) {
|
|
7
|
+
if (!storyFilePath) {
|
|
8
|
+
return null;
|
|
9
|
+
}
|
|
10
|
+
const norm = (p) => "/" + p.replace(/^[./]+/, "").replace(/\\/g, "/");
|
|
11
|
+
const wanted = norm(storyFilePath);
|
|
12
|
+
return storiesGlob[wanted] || Object.entries(storiesGlob).find(([k]) => k.endsWith(wanted))?.[1];
|
|
13
|
+
}
|
|
14
|
+
function useDynamicStory(storyInfo) {
|
|
15
|
+
const { dependencyPreviews } = require_useStoryParams.useStoryParams();
|
|
16
|
+
const modules = dependencyPreviews.storyModules;
|
|
17
|
+
const importer = (0, react.useMemo)(() => findStoryImporter(modules, storyInfo.storyFilePath), [modules, storyInfo.storyFilePath]);
|
|
18
|
+
const [csfModule, setCsfModule] = (0, react.useState)(null);
|
|
19
|
+
const [err, setErr] = (0, react.useState)(null);
|
|
20
|
+
const [isLoading, setIsLoading] = (0, react.useState)(true);
|
|
21
|
+
(0, react.useEffect)(() => {
|
|
22
|
+
let alive = true;
|
|
23
|
+
setIsLoading(true);
|
|
24
|
+
(async () => {
|
|
25
|
+
try {
|
|
26
|
+
if (!importer) throw new Error(`No story module found at this path: ${storyInfo.storyFilePath}`);
|
|
27
|
+
const mod = await importer();
|
|
28
|
+
if (alive) setCsfModule(mod);
|
|
29
|
+
} catch (e) {
|
|
30
|
+
if (alive) setErr(e?.message || String(e));
|
|
31
|
+
} finally {
|
|
32
|
+
setIsLoading(false);
|
|
33
|
+
}
|
|
34
|
+
})();
|
|
35
|
+
return () => {
|
|
36
|
+
alive = false;
|
|
37
|
+
};
|
|
38
|
+
}, [importer, storyInfo.componentPath]);
|
|
39
|
+
const primaryExport = getPrimaryStoryExport(csfModule, storyInfo);
|
|
40
|
+
const Component = csfModule?.default?.component;
|
|
41
|
+
const primaryId = storyInfo.storyId?.replace(/--docs$/, getPrimaryId(csfModule));
|
|
42
|
+
return {
|
|
43
|
+
isLoading,
|
|
44
|
+
primaryExport,
|
|
45
|
+
primaryId,
|
|
46
|
+
csfModule,
|
|
47
|
+
Component,
|
|
48
|
+
error: err
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
function getPrimaryId(csfModule) {
|
|
52
|
+
if (!csfModule) return "--default";
|
|
53
|
+
if ("Default" in csfModule) return "--default";
|
|
54
|
+
if ("Primary" in csfModule) return "--primary";
|
|
55
|
+
return "--" + slugifyExportName(csfModule?.__namedExportsOrder?.[0] || "default");
|
|
56
|
+
}
|
|
57
|
+
function slugifyExportName(name) {
|
|
58
|
+
return name.replace(/([a-z0-9])([A-Z])/g, "$1-$2").replace(/([A-Z]+)([A-Z][a-z])/g, "$1-$2").replace(/[_\s]+/g, "-").replace(/[^a-zA-Z0-9-]/g, "-").toLowerCase().replace(/--+/g, "-").replace(/^-+|-+$/g, "");
|
|
59
|
+
}
|
|
60
|
+
/** Choose a sensible story:
|
|
61
|
+
* 1) If the module has `Primary`, use it.
|
|
62
|
+
* 2) If we have a docs/primary id, try to match the export name in the id.
|
|
63
|
+
* 3) Else fall back to the first named export.
|
|
64
|
+
*/
|
|
65
|
+
function getPrimaryStoryExport(mod, info) {
|
|
66
|
+
if (!mod) return null;
|
|
67
|
+
if ("Default" in mod) return mod.Default;
|
|
68
|
+
if ("Primary" in mod) return mod.Primary;
|
|
69
|
+
if (info?.storyId && !info.storyId.endsWith("--docs")) {
|
|
70
|
+
const exportName = info.storyId.split("--").pop();
|
|
71
|
+
const match = Object.keys(mod).find((k) => k !== "default" && k.toLowerCase() === exportName);
|
|
72
|
+
if (match) return mod[match];
|
|
73
|
+
}
|
|
74
|
+
const order = mod.__namedExportsOrder || [];
|
|
75
|
+
const first = order.find((k) => k !== "default");
|
|
76
|
+
if (first && first in mod) return mod[first];
|
|
77
|
+
const anyKey = Object.keys(mod).find((k) => k !== "default" && typeof mod[k] === "function");
|
|
78
|
+
return anyKey ? mod[anyKey] : null;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
//#endregion
|
|
82
|
+
exports.useDynamicStory = useDynamicStory;
|
|
83
|
+
//# sourceMappingURL=useDynamicStory.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useDynamicStory.cjs","names":["useStoryParams"],"sources":["../../src/hooks/useDynamicStory.ts"],"sourcesContent":["import { useEffect, useMemo, useState } from 'react'\nimport type { CsfModule, StoryInfo, StoryModules } from '../types'\nimport { useStoryParams } from './useStoryParams'\n\n// grab all stories; Vite will code-split them\n\nfunction findStoryImporter(\n\tstoriesGlob: StoryModules,\n\tstoryFilePath: string | undefined | null,\n) {\n\tif (!storyFilePath) {\n\t\treturn null\n\t}\n\t// normalize to Vite’s absolute-style keys\n\tconst norm = (p: string) =>\n\t\t'/' + p.replace(/^[./]+/, '').replace(/\\\\/g, '/')\n\tconst wanted = norm(storyFilePath)\n\t// exact match first, else suffix match as a fallback\n\treturn (\n\t\tstoriesGlob[wanted] ||\n\t\tObject.entries(storiesGlob).find(([k]) => k.endsWith(wanted))?.[1]\n\t)\n}\n\nexport function useDynamicStory(storyInfo: StoryInfo) {\n\tconst { dependencyPreviews } = useStoryParams()\n\tconst modules = dependencyPreviews.storyModules\n\tconst importer = useMemo(\n\t\t() => findStoryImporter(modules, storyInfo.storyFilePath),\n\t\t[modules, storyInfo.storyFilePath],\n\t)\n\tconst [csfModule, setCsfModule] = useState<CsfModule | null>(null)\n\tconst [err, setErr] = useState<string | null>(null)\n\tconst [isLoading, setIsLoading] = useState(true)\n\n\tuseEffect(() => {\n\t\tlet alive = true\n\t\tsetIsLoading(true)\n\t\t;(async () => {\n\t\t\ttry {\n\t\t\t\tif (!importer)\n\t\t\t\t\tthrow new Error(\n\t\t\t\t\t\t`No story module found at this path: ${storyInfo.storyFilePath}`,\n\t\t\t\t\t)\n\t\t\t\tconst mod = await importer()\n\t\t\t\tif (alive) setCsfModule(mod as CsfModule)\n\t\t\t} catch (e: any) {\n\t\t\t\tif (alive) setErr(e?.message || String(e))\n\t\t\t} finally {\n\t\t\t\tsetIsLoading(false)\n\t\t\t}\n\t\t})()\n\t\treturn () => {\n\t\t\talive = false\n\t\t}\n\t}, [importer, storyInfo.componentPath])\n\n\tconst primaryExport = getPrimaryStoryExport(csfModule, storyInfo)\n\tconst Component = csfModule?.default?.component\n\tconst primaryId = storyInfo.storyId?.replace(\n\t\t/--docs$/,\n\t\tgetPrimaryId(csfModule),\n\t)\n\n\treturn {\n\t\tisLoading,\n\t\tprimaryExport,\n\t\tprimaryId,\n\t\tcsfModule,\n\t\tComponent,\n\t\terror: err,\n\t}\n}\n\nfunction getPrimaryId(csfModule: CsfModule | undefined | null) {\n\tif (!csfModule) return '--default'\n\tif ('Default' in csfModule) return '--default'\n\tif ('Primary' in csfModule) return '--primary'\n\treturn (\n\t\t'--' +\n\t\tslugifyExportName(csfModule?.__namedExportsOrder?.[0] || 'default')\n\t)\n}\n\n// Kebab-case like Storybook: \"ErrorStrings\" -> \"error-strings\"\nfunction slugifyExportName(name: string) {\n\treturn (\n\t\tname\n\t\t\t// split camelCase / PascalCase boundaries\n\t\t\t.replace(/([a-z0-9])([A-Z])/g, '$1-$2')\n\t\t\t.replace(/([A-Z]+)([A-Z][a-z])/g, '$1-$2') // ABCDef -> ABC-Def\n\t\t\t// underscores/spaces -> dashes\n\t\t\t.replace(/[_\\s]+/g, '-')\n\t\t\t// strip anything not alnum or dash\n\t\t\t.replace(/[^a-zA-Z0-9-]/g, '-')\n\t\t\t// lowercase + collapse/trim dashes\n\t\t\t.toLowerCase()\n\t\t\t.replace(/--+/g, '-')\n\t\t\t.replace(/^-+|-+$/g, '')\n\t)\n}\n\n/** Choose a sensible story:\n * 1) If the module has `Primary`, use it.\n * 2) If we have a docs/primary id, try to match the export name in the id.\n * 3) Else fall back to the first named export.\n */\nfunction getPrimaryStoryExport(mod: any, info?: StoryInfo) {\n\tif (!mod) return null\n\n\t// 1) Prefer \"Default\" or \"Primary\" if present\n\tif ('Default' in mod) return mod.Default\n\tif ('Primary' in mod) return mod.Primary\n\n\t// 2) If we have a storyId like \"…--errorstrings\", try to match export name\n\tif (info?.storyId && !info.storyId.endsWith('--docs')) {\n\t\tconst exportName = info.storyId.split('--').pop() // e.g. \"errorstrings\"\n\t\tconst match = Object.keys(mod).find(\n\t\t\t(k) => k !== 'default' && k.toLowerCase() === exportName,\n\t\t)\n\t\tif (match) return (mod as any)[match]\n\t}\n\n\t// 3) Fall back to first named export\n\tconst order: string[] = mod.__namedExportsOrder || []\n\tconst first = order.find((k) => k !== 'default')\n\tif (first && first in mod) return (mod as any)[first]\n\n\t// Last resort: any non-default function export\n\tconst anyKey = Object.keys(mod).find(\n\t\t(k) => k !== 'default' && typeof mod[k] === 'function',\n\t)\n\treturn anyKey ? (mod as any)[anyKey] : null\n}\n"],"mappings":";;;;;AAMA,SAAS,kBACR,aACA,eACC;AACD,KAAI,CAAC,eAAe;AACnB,SAAO;;CAGR,MAAM,QAAQ,MACb,MAAM,EAAE,QAAQ,UAAU,GAAG,CAAC,QAAQ,OAAO,IAAI;CAClD,MAAM,SAAS,KAAK,cAAc;AAElC,QACC,YAAY,WACZ,OAAO,QAAQ,YAAY,CAAC,MAAM,CAAC,OAAO,EAAE,SAAS,OAAO,CAAC,GAAG;;AAIlE,SAAgB,gBAAgB,WAAsB;CACrD,MAAM,EAAE,uBAAuBA,uCAAgB;CAC/C,MAAM,UAAU,mBAAmB;CACnC,MAAM,oCACC,kBAAkB,SAAS,UAAU,cAAc,EACzD,CAAC,SAAS,UAAU,cAAc,CAClC;CACD,MAAM,CAAC,WAAW,oCAA2C,KAAK;CAClE,MAAM,CAAC,KAAK,8BAAkC,KAAK;CACnD,MAAM,CAAC,WAAW,oCAAyB,KAAK;AAEhD,4BAAgB;EACf,IAAI,QAAQ;AACZ,eAAa,KAAK;AACjB,GAAC,YAAY;AACb,OAAI;AACH,QAAI,CAAC,SACJ,OAAM,IAAI,MACT,uCAAuC,UAAU,gBACjD;IACF,MAAM,MAAM,MAAM,UAAU;AAC5B,QAAI,MAAO,cAAa,IAAiB;YACjC,GAAQ;AAChB,QAAI,MAAO,QAAO,GAAG,WAAW,OAAO,EAAE,CAAC;aACjC;AACT,iBAAa,MAAM;;MAEjB;AACJ,eAAa;AACZ,WAAQ;;IAEP,CAAC,UAAU,UAAU,cAAc,CAAC;CAEvC,MAAM,gBAAgB,sBAAsB,WAAW,UAAU;CACjE,MAAM,YAAY,WAAW,SAAS;CACtC,MAAM,YAAY,UAAU,SAAS,QACpC,WACA,aAAa,UAAU,CACvB;AAED,QAAO;EACN;EACA;EACA;EACA;EACA;EACA,OAAO;EACP;;AAGF,SAAS,aAAa,WAAyC;AAC9D,KAAI,CAAC,UAAW,QAAO;AACvB,KAAI,aAAa,UAAW,QAAO;AACnC,KAAI,aAAa,UAAW,QAAO;AACnC,QACC,OACA,kBAAkB,WAAW,sBAAsB,MAAM,UAAU;;AAKrE,SAAS,kBAAkB,MAAc;AACxC,QACC,KAEE,QAAQ,sBAAsB,QAAQ,CACtC,QAAQ,yBAAyB,QAAQ,CAEzC,QAAQ,WAAW,IAAI,CAEvB,QAAQ,kBAAkB,IAAI,CAE9B,aAAa,CACb,QAAQ,QAAQ,IAAI,CACpB,QAAQ,YAAY,GAAG;;;;;;;AAS3B,SAAS,sBAAsB,KAAU,MAAkB;AAC1D,KAAI,CAAC,IAAK,QAAO;AAGjB,KAAI,aAAa,IAAK,QAAO,IAAI;AACjC,KAAI,aAAa,IAAK,QAAO,IAAI;AAGjC,KAAI,MAAM,WAAW,CAAC,KAAK,QAAQ,SAAS,SAAS,EAAE;EACtD,MAAM,aAAa,KAAK,QAAQ,MAAM,KAAK,CAAC,KAAK;EACjD,MAAM,QAAQ,OAAO,KAAK,IAAI,CAAC,MAC7B,MAAM,MAAM,aAAa,EAAE,aAAa,KAAK,WAC9C;AACD,MAAI,MAAO,QAAQ,IAAY;;CAIhC,MAAM,QAAkB,IAAI,uBAAuB,EAAE;CACrD,MAAM,QAAQ,MAAM,MAAM,MAAM,MAAM,UAAU;AAChD,KAAI,SAAS,SAAS,IAAK,QAAQ,IAAY;CAG/C,MAAM,SAAS,OAAO,KAAK,IAAI,CAAC,MAC9B,MAAM,MAAM,aAAa,OAAO,IAAI,OAAO,WAC5C;AACD,QAAO,SAAU,IAAY,UAAU"}
|