Skip to content

Commit 9b32e44

Browse files
author
Ben Siggery
committed
add tagging functionality
1 parent 8bdad7c commit 9b32e44

File tree

1 file changed

+22
-19
lines changed

1 file changed

+22
-19
lines changed

apps/pie-storybook/utilities/index.ts

+22-19
Original file line numberDiff line numberDiff line change
@@ -102,24 +102,27 @@ export const createVariantStory = <T>(
102102

103103
const propCombinations = generateCombinations(propOptions);
104104

105-
return () => html`
106-
<div style="display: block; width: 100%;">
107-
${propCombinations.map(
108-
(props) => html`
109-
<div style="border: 1px solid black; padding: 16px; margin-bottom: 16px; width: 100%; box-sizing: border-box;">
110-
<div style="display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; font-family: monospace; background-color: #f9f9f9; padding: 8px; border-radius: 4px;">
111-
${Object.entries(props as Record<string, any>).map(
112-
([key, value]) => html`
113-
<div><strong>${key}:</strong> ${JSON.stringify(value)}</div>
114-
`
115-
)}
105+
return {
106+
render: () => html`
107+
<div style="display: block; width: 100%;">
108+
${propCombinations.map(
109+
(props) => html`
110+
<div style="border: 1px solid black; padding: 16px; margin-bottom: 16px; width: 100%; box-sizing: border-box;">
111+
<div style="display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; font-family: monospace; background-color: #f9f9f9; padding: 8px; border-radius: 4px;">
112+
${Object.entries(props as Record<string, any>).map(
113+
([key, value]) => html`
114+
<div><strong>${key}:</strong> ${JSON.stringify(value)}</div>
115+
`
116+
)}
117+
</div>
118+
<div style="margin-top: 16px; border: 2px dashed #aaa; padding: 8px; border-radius: 4px;">
119+
${template({ ...props, slot: slotContent })}
120+
</div>
116121
</div>
117-
<div style="margin-top: 16px; border: 2px dashed #aaa; padding: 8px; border-radius: 4px;">
118-
${template({ ...props, slot: slotContent })}
119-
</div>
120-
</div>
121-
`
122-
)}
123-
</div>
124-
`;
122+
`
123+
)}
124+
</div>
125+
`,
126+
tags: ['!dev'], // Add the default tag here
127+
};
125128
};

0 commit comments

Comments
 (0)