Skip to content

Commit b957223

Browse files
authored
Merge pull request #338 from kit-data-manager/storybook-updates
optimized readability of storybook
2 parents 9c69c23 + 0d6056d commit b957223

File tree

4 files changed

+4
-267
lines changed

4 files changed

+4
-267
lines changed

packages/stencil-library/src/components/pid-collapsible/pid-collapsible.stories.ts

Lines changed: 1 addition & 128 deletions
Original file line numberDiff line numberDiff line change
@@ -26,14 +26,6 @@ const meta: Meta = {
2626
type: { summary: 'boolean' },
2727
},
2828
},
29-
expanded: {
30-
description: 'Whether the component is in expanded mode (full size)',
31-
control: { type: 'boolean' },
32-
table: {
33-
defaultValue: { summary: 'false' },
34-
type: { summary: 'boolean' },
35-
},
36-
},
3729
initialWidth: {
3830
description: 'Initial width when expanded',
3931
control: { type: 'text' },
@@ -64,14 +56,6 @@ const meta: Meta = {
6456
type: { summary: 'boolean' },
6557
},
6658
},
67-
resizable: {
68-
description: 'Whether the component can be resized',
69-
control: { type: 'boolean' },
70-
table: {
71-
defaultValue: { summary: 'false' },
72-
type: { summary: 'boolean' },
73-
},
74-
},
7559
darkMode: {
7660
description: 'The dark mode setting for the component',
7761
control: 'select',
@@ -85,11 +69,9 @@ const meta: Meta = {
8569
args: {
8670
open: false,
8771
emphasize: true,
88-
expanded: false,
8972
lineHeight: 24,
9073
showFooter: false,
91-
resizable: false,
92-
darkMode: 'system',
74+
darkMode: 'light',
9375
},
9476
};
9577

@@ -110,12 +92,10 @@ export const Default: Story = {
11092
<pid-collapsible
11193
open=${args.open}
11294
emphasize=${args.emphasize}
113-
expanded=${args.expanded}
11495
initialWidth=${args.initialWidth}
11596
initialHeight=${args.initialHeight}
11697
lineHeight=${args.lineHeight}
11798
showFooter=${args.showFooter}
118-
resizable=${args.resizable}
11999
darkMode=${args.darkMode}
120100
@toggle=${e => console.log('Toggle event:', e.detail)}
121101
@resize=${e => console.log('Resize event:', e.detail)}
@@ -160,12 +140,10 @@ export const OpenByDefault: Story = {
160140
<pid-collapsible
161141
open=${args.open}
162142
emphasize=${args.emphasize}
163-
expanded=${args.expanded}
164143
initialWidth=${args.initialWidth}
165144
initialHeight=${args.initialHeight}
166145
lineHeight=${args.lineHeight}
167146
showFooter=${args.showFooter}
168-
resizable=${args.resizable}
169147
darkMode=${args.darkMode}
170148
@toggle=${e => console.log('Toggle event:', e.detail)}
171149
@resize=${e => console.log('Resize event:', e.detail)}
@@ -214,12 +192,10 @@ export const WithFooterAndResize: Story = {
214192
<pid-collapsible
215193
open=${args.open}
216194
emphasize=${args.emphasize}
217-
expanded=${args.expanded}
218195
initialWidth=${args.initialWidth}
219196
initialHeight=${args.initialHeight}
220197
lineHeight=${args.lineHeight}
221198
showFooter=${args.showFooter}
222-
resizable=${args.resizable}
223199
darkMode=${args.darkMode}
224200
@toggle=${e => console.log('Toggle event:', e.detail)}
225201
@resize=${e => console.log('Resize event:', e.detail)}
@@ -269,96 +245,6 @@ export const WithFooterAndResize: Story = {
269245
},
270246
};
271247

272-
/**
273-
* Adaptive collapsible component that responds to resize events
274-
*/
275-
export const AdaptiveWithResizeEvents: Story = {
276-
args: {
277-
open: true,
278-
emphasize: true,
279-
resizable: true,
280-
showFooter: true,
281-
initialWidth: '500px',
282-
initialHeight: '300px',
283-
darkMode: 'system',
284-
},
285-
render: args => {
286-
// Create a unique ID for this instance
287-
const resizeInfoId = `resize-info-${Math.random().toString(36).substring(2, 9)}`;
288-
289-
// Setup the resize event handler
290-
const handleResize = e => {
291-
const resizeInfo = document.getElementById(resizeInfoId);
292-
if (resizeInfo) {
293-
resizeInfo.textContent = `Width: ${Math.round(e.detail.width)}px × Height: ${Math.round(e.detail.height)}px`;
294-
}
295-
};
296-
297-
return html`
298-
<div class="rounded-md bg-gray-50 p-4">
299-
<div class="mb-4 rounded border border-blue-200 bg-blue-50 p-3 text-sm">Resize the component to see resize events in the footer.</div>
300-
301-
<pid-collapsible
302-
open=${args.open}
303-
emphasize=${args.emphasize}
304-
expanded=${args.expanded}
305-
initialWidth=${args.initialWidth}
306-
initialHeight=${args.initialHeight}
307-
lineHeight=${args.lineHeight}
308-
showFooter=${args.showFooter}
309-
resizable=${args.resizable}
310-
darkMode=${args.darkMode}
311-
@toggle=${e => console.log('Toggle event:', e.detail)}
312-
@collapsibleResize=${handleResize}
313-
>
314-
<span slot="summary" class="font-medium">Adaptive Collapsible</span>
315-
<div class="flex-grow p-4">
316-
<p class="mb-2">This collapsible demonstrates the adaptive resizing feature.</p>
317-
<p>Resize events will be shown in the footer.</p>
318-
</div>
319-
<div slot="footer" class="bg-blue-50 p-2 text-center text-sm" id=${resizeInfoId}>Resize the component to see dimensions</div>
320-
</pid-collapsible>
321-
</div>
322-
`;
323-
},
324-
parameters: {
325-
docs: {
326-
source: {
327-
code: `
328-
<pid-collapsible
329-
open="true"
330-
emphasize="true"
331-
showFooter="true"
332-
resizable="true"
333-
initialWidth="500px"
334-
initialHeight="300px"
335-
darkMode="system"
336-
@collapsibleResize="handleResizeEvent">
337-
<span slot="summary">Adaptive Collapsible</span>
338-
<div>
339-
<p>This collapsible demonstrates the adaptive resizing feature.</p>
340-
<p>Resize events will be shown in the footer.</p>
341-
</div>
342-
<div slot="footer" id="resize-info">
343-
Resize the component to see dimensions
344-
</div>
345-
</pid-collapsible>
346-
347-
<script>
348-
// Handle resize events
349-
document.querySelector('pid-collapsible').addEventListener('collapsibleResize', e => {
350-
const resizeInfo = document.getElementById('resize-info');
351-
if (resizeInfo) {
352-
resizeInfo.textContent = \`Width: \${Math.round(e.detail.width)}px × Height: \${Math.round(e.detail.height)}px\`;
353-
}
354-
});
355-
</script>
356-
`,
357-
},
358-
},
359-
},
360-
};
361-
362248
/**
363249
* Demonstrates the dark mode appearance
364250
*/
@@ -374,12 +260,10 @@ export const DarkMode: Story = {
374260
<pid-collapsible
375261
open=${args.open}
376262
emphasize=${args.emphasize}
377-
expanded=${args.expanded}
378263
initialWidth=${args.initialWidth}
379264
initialHeight=${args.initialHeight}
380265
lineHeight=${args.lineHeight}
381266
showFooter=${args.showFooter}
382-
resizable=${args.resizable}
383267
darkMode=${args.darkMode}
384268
@toggle=${e => console.log('Toggle event:', e.detail)}
385269
@resize=${e => console.log('Resize event:', e.detail)}
@@ -430,12 +314,10 @@ export const LightMode: Story = {
430314
<pid-collapsible
431315
open=${args.open}
432316
emphasize=${args.emphasize}
433-
expanded=${args.expanded}
434317
initialWidth=${args.initialWidth}
435318
initialHeight=${args.initialHeight}
436319
lineHeight=${args.lineHeight}
437320
showFooter=${args.showFooter}
438-
resizable=${args.resizable}
439321
darkMode=${args.darkMode}
440322
@toggle=${e => console.log('Toggle event:', e.detail)}
441323
@resize=${e => console.log('Resize event:', e.detail)}
@@ -518,15 +400,6 @@ export const CollapsibleStates: Story = {
518400
description: 'Open state with emphasis and footer.',
519401
bgColor: 'bg-yellow-50',
520402
},
521-
{
522-
title: 'Expanded',
523-
open: true,
524-
emphasize: true,
525-
showFooter: true,
526-
darkMode: 'system',
527-
description: 'Open, emphasized, expanded state with footer.',
528-
bgColor: 'bg-purple-50',
529-
},
530403
{
531404
title: 'Dark Mode',
532405
open: true,

packages/stencil-library/src/components/pid-component/pid-component.stories.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ const meta: Meta = {
109109
hideSubcomponents: false,
110110
emphasizeComponent: true,
111111
showTopLevelCopy: true,
112-
darkMode: 'system',
112+
darkMode: 'light',
113113
},
114114
};
115115

packages/stencil-library/src/components/pid-data-table/pid-data-table.stories.ts

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -146,20 +146,6 @@ const meta: Meta = {
146146
},
147147
},
148148
},
149-
adaptivePagination: {
150-
description: 'Enable adaptive pagination mode',
151-
control: {
152-
type: 'boolean',
153-
},
154-
table: {
155-
defaultValue: {
156-
summary: 'false',
157-
},
158-
type: {
159-
summary: 'boolean',
160-
},
161-
},
162-
},
163149
darkMode: {
164150
description: 'The dark mode setting for the component',
165151
control: 'select',
@@ -180,8 +166,7 @@ const meta: Meta = {
180166
currentLevelOfSubcomponents: 0,
181167
levelOfSubcomponents: 1,
182168
settings: '[]',
183-
adaptivePagination: false,
184-
darkMode: 'system',
169+
darkMode: 'light',
185170
},
186171
parameters: {
187172
actions: {

0 commit comments

Comments
 (0)