Skip to content

Commit 7dcea6d

Browse files
feat: add controls to dynamic story (#20467)
Co-authored-by: Heloise Lui <71858203+heloiselui@users.noreply.github.com>
1 parent c5ecb0d commit 7dcea6d

File tree

1 file changed

+31
-25
lines changed

1 file changed

+31
-25
lines changed

packages/react/src/components/DataTable/stories/dynamic-content/DataTable-dynamic-content.stories.js

Lines changed: 31 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,11 @@ export const Default = (args) => {
239239
<TableHead>
240240
<TableRow>
241241
<TableExpandHeader aria-label="expand row" />
242-
<TableSelectAll {...getSelectionProps()} />
242+
{args.radio ? (
243+
<th scope="col" />
244+
) : (
245+
<TableSelectAll {...getSelectionProps()} />
246+
)}
243247
{headers.map((header, i) => (
244248
<TableHeader key={i} {...getHeaderProps({ header })}>
245249
{header.header}
@@ -279,35 +283,37 @@ export const Default = (args) => {
279283
return <DynamicRows />;
280284
};
281285

286+
Default.args = {
287+
size: 'lg',
288+
useStaticWidth: false,
289+
useZebraStyles: false,
290+
isSortable: false,
291+
locale: 'en',
292+
radio: false,
293+
};
294+
282295
Default.argTypes = {
283-
filterRows: {
284-
table: {
285-
disable: true,
286-
},
296+
size: {
297+
control: 'select',
298+
options: ['xs', 'sm', 'md', 'lg', 'xl'],
299+
description: 'Change the row height of table',
287300
},
288-
headers: {
289-
table: {
290-
disable: true,
291-
},
301+
useStaticWidth: {
302+
control: 'boolean',
303+
description: 'If true, will use a width of "auto" instead of 100%',
292304
},
293-
overflowMenuOnHover: {
294-
table: {
295-
disable: true,
296-
},
305+
useZebraStyles: {
306+
control: 'boolean',
307+
description: 'Add zebra striping to rows',
297308
},
298-
rows: {
299-
table: {
300-
disable: true,
301-
},
309+
isSortable: {
310+
control: 'boolean',
311+
description: 'Specify if the rows are sortable',
302312
},
303-
translateWithId: {
304-
table: {
305-
disable: true,
306-
},
313+
locale: {
314+
description: 'Provide a string for the current locale',
307315
},
308-
sortRow: {
309-
table: {
310-
disable: true,
311-
},
316+
radio: {
317+
description: 'Use radio-selection instead of multi-selection',
312318
},
313319
};

0 commit comments

Comments
 (0)