vibe-design-system 2.5.38 → 2.5.40
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/package.json
CHANGED
|
@@ -493,6 +493,11 @@ const COMPONENT_EXTRA_ARGS = {
|
|
|
493
493
|
],
|
|
494
494
|
};
|
|
495
495
|
|
|
496
|
+
/** Render'da args'a uygulanacak fallback (useState(estimate.toString()) gibi kullanımlar için; args/Controls undefined yapsa bile). */
|
|
497
|
+
const RENDER_ARGS_FALLBACKS = {
|
|
498
|
+
TaskEstimateInput: ", estimate: (args && args.estimate) ?? 0, value: (args && args.value) ?? 0, task: (args && args.task) ?? { id: \"1\", title: \"Example\", estimate: 0 }",
|
|
499
|
+
};
|
|
500
|
+
|
|
496
501
|
/** Recursive list of .tsx/.jsx file paths under dir (relative to dir). Index.tsx / index.tsx first for deterministic "first usage". */
|
|
497
502
|
function getAllTsxJsxUnderDir(dir) {
|
|
498
503
|
if (!fs.existsSync(dir)) return [];
|
|
@@ -1083,9 +1088,12 @@ function buildStoryFileContent(comp) {
|
|
|
1083
1088
|
}
|
|
1084
1089
|
|
|
1085
1090
|
// Wrap in Suspense so lazy load errors render fallback instead of crashing
|
|
1091
|
+
const argsFallback = (componentName && RENDER_ARGS_FALLBACKS[componentName]) || "";
|
|
1092
|
+
const argsParam = argsFallback ? "(args = {})" : "(args)";
|
|
1093
|
+
const propsArg = argsFallback ? `{ ...args${argsFallback} }` : "args";
|
|
1086
1094
|
const renderLine = useReactNodeChildrenRender
|
|
1087
1095
|
? ` render: (args) => React.createElement(React.Suspense, { fallback: null }, React.createElement(ComponentRef, { ...args, children: args.children || React.createElement('span', null, 'Example') })),`
|
|
1088
|
-
: ` render:
|
|
1096
|
+
: ` render: ${argsParam} => React.createElement(React.Suspense, { fallback: null }, React.createElement(ComponentRef, ${propsArg})),`;
|
|
1089
1097
|
const childrenArgLine = (label) => (!omitChildren && !useReactNodeChildrenRender ? ` children: ${JSON.stringify(label)},` : null);
|
|
1090
1098
|
|
|
1091
1099
|
if (!variants.length) {
|