Skip to content

Commit

Permalink
docs: hide non-functional children controls in stories (#1587)
Browse files Browse the repository at this point in the history
  • Loading branch information
booc0mtaco authored Apr 7, 2023
1 parent c7fae07 commit fcef92f
Show file tree
Hide file tree
Showing 26 changed files with 190 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,13 @@ export default {
</div>
),
],
argTypes: {
children: {
control: {
type: null,
},
},
},
} as Meta<Args>;

type Args = React.ComponentProps<typeof CardWithNotification>;
Expand Down
7 changes: 7 additions & 0 deletions src/components/Accordion/Accordion.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,13 @@ export default {
</Accordion.Row>
),
},
argTypes: {
children: {
control: {
type: null,
},
},
},
decorators: [
(Story) => (
<div style={{ margin: '0.5rem' }}>
Expand Down
7 changes: 7 additions & 0 deletions src/components/Badge/Badge.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,13 @@ export default {
layout: 'centered',
badges: ['1.2', BADGE.BETA],
},
argTypes: {
children: {
control: {
type: null,
},
},
},
} as Meta<Args>;

type Args = React.ComponentProps<typeof Badge>;
Expand Down
7 changes: 7 additions & 0 deletions src/components/Breadcrumbs/Breadcrumbs.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,13 @@ export default {
</>
),
},
argTypes: {
children: {
control: {
type: null,
},
},
},
parameters: {
badges: ['1.0'],
},
Expand Down
12 changes: 12 additions & 0 deletions src/components/ButtonDropdown/ButtonDropdown.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,18 @@ export default {
<Button data-testid="trigger-button">Open Dropdown</Button>
),
},
argTypes: {
children: {
control: {
type: null,
},
},
dropdownMenuTrigger: {
control: {
type: null,
},
},
},
} as Meta<Args>;

type Args = React.ComponentProps<typeof ButtonDropdown>;
Expand Down
7 changes: 7 additions & 0 deletions src/components/ButtonGroup/ButtonGroup.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,13 @@ export default {
</>
),
},
argTypes: {
children: {
control: {
type: null,
},
},
},
parameters: {
badges: ['1.0'],
},
Expand Down
7 changes: 7 additions & 0 deletions src/components/DragDrop/DragDrop.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,13 @@ export default {
parameters: {
badges: ['1.0'],
},
argTypes: {
children: {
control: {
type: null,
},
},
},
decorators: [
(Story) => (
<div
Expand Down
5 changes: 5 additions & 0 deletions src/components/Drawer/Drawer.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,11 @@ export default {
),
},
argTypes: {
children: {
control: {
type: null,
},
},
onClose: {
action: 'on close',
},
Expand Down
7 changes: 7 additions & 0 deletions src/components/DropdownMenu/DropdownMenu.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,13 @@ export default {
parameters: {
badges: ['1.0', BADGE.DEPRECATED],
},
argTypes: {
children: {
control: {
type: null,
},
},
},
} as Meta<Args>;

type Args = React.ComponentProps<typeof DropdownMenu>;
Expand Down
7 changes: 7 additions & 0 deletions src/components/Fieldset/Fieldset.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,13 @@ export default {
badges: ['1.0'],
},
subcomponents: { FieldsetLegend, FieldsetItems },
argTypes: {
children: {
control: {
type: null,
},
},
},
} as Meta<Args>;

type Args = React.ComponentProps<typeof Fieldset>;
Expand Down
7 changes: 7 additions & 0 deletions src/components/FiltersDrawer/FiltersDrawer.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,13 @@ export default {
</FiltersCheckboxField>
),
},
argTypes: {
children: {
control: {
type: null,
},
},
},
decorators: [
(Story) => (
<div style={{ margin: '0.25rem', height: '100vh' }}>
Expand Down
7 changes: 7 additions & 0 deletions src/components/FiltersPopover/FiltersPopover.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,13 @@ export default {
),
placement: 'bottom-start',
},
argTypes: {
children: {
control: {
type: null,
},
},
},
decorators: [
(Story) => (
<div style={{ margin: '0.25rem', height: '100vh' }}>
Expand Down
7 changes: 7 additions & 0 deletions src/components/Grid/Grid.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,13 @@ export default {
</>
),
},
argTypes: {
children: {
control: {
type: null,
},
},
},
parameters: {
badges: ['1.0'],
},
Expand Down
7 changes: 7 additions & 0 deletions src/components/Layout/Layout.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,13 @@ export default {
</>
),
},
argTypes: {
children: {
control: {
type: null,
},
},
},
} as Meta<Args>;

type Args = React.ComponentProps<typeof Layout>;
Expand Down
7 changes: 7 additions & 0 deletions src/components/LayoutContainer/LayoutContainer.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,13 @@ export default {
args: {
children: <div className="fpo">Layout container</div>,
},
argTypes: {
children: {
control: {
type: null,
},
},
},
} as Meta<Args>;

type Args = React.ComponentProps<typeof LayoutContainer>;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,13 @@ export default {
</>
),
},
argTypes: {
children: {
control: {
type: null,
},
},
},
} as Meta<Args>;

type Args = React.ComponentProps<typeof LayoutLinelengthContainer>;
Expand Down
7 changes: 7 additions & 0 deletions src/components/Menu/Menu.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,13 @@ export default {
badges: ['1.2'],
layout: 'centered',
},
argTypes: {
children: {
control: {
type: null,
},
},
},
} as Meta<MenuProps>;

export const Default: StoryObj<MenuProps> = {
Expand Down
7 changes: 7 additions & 0 deletions src/components/Modal/Modal.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,13 @@ export default {
chromatic: { disableSnapshot: true },
badges: ['1.0'],
},
argTypes: {
children: {
control: {
type: null,
},
},
},
} as Meta<Args>;

type Args = React.ComponentProps<typeof Modal>;
Expand Down
7 changes: 7 additions & 0 deletions src/components/PageLevelBanner/PageLevelBanner.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,13 @@ export default {
</>
),
},
argTypes: {
description: {
control: {
type: 'text',
},
},
},
} as Meta<Args>;

type Args = React.ComponentProps<typeof PageLevelBanner>;
Expand Down
7 changes: 7 additions & 0 deletions src/components/Popover/Popover.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,13 @@ export default {
</>
),
},
argTypes: {
children: {
control: {
type: null,
},
},
},
} as Meta<PopoverProps>;

export const Default: StoryObj<PopoverProps> = {
Expand Down
7 changes: 7 additions & 0 deletions src/components/SearchBar/SearchBar.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,13 @@ export default {
</div>
),
],
argTypes: {
children: {
control: {
type: null,
},
},
},
} as Meta<Args>;

type Args = React.ComponentProps<typeof SearchBar>;
Expand Down
7 changes: 7 additions & 0 deletions src/components/Table/Table.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,13 @@ export default {
parameters: {
badges: ['1.1'],
},
argTypes: {
children: {
control: {
type: null,
},
},
},
decorators: [
(Story) => (
<div
Expand Down
7 changes: 7 additions & 0 deletions src/components/Tabs/Tabs.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,13 @@ export default {
</>
),
},
argTypes: {
children: {
control: {
type: null,
},
},
},
} as Meta<Args>;

type Args = React.ComponentProps<typeof Tabs>;
Expand Down
7 changes: 7 additions & 0 deletions src/components/TimelineNav/TimelineNav.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,13 @@ export default {
</>
),
},
argTypes: {
children: {
control: {
type: null,
},
},
},
} as Meta;

type Args = React.ComponentProps<typeof TimelineNavPanel>;
Expand Down
7 changes: 7 additions & 0 deletions src/components/Toolbar/Toolbar.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,13 @@ export default {
</>
),
},
argTypes: {
children: {
control: {
type: null,
},
},
},
} as Meta<Args>;

type Args = React.ComponentProps<typeof Toolbar>;
Expand Down
12 changes: 12 additions & 0 deletions src/components/Tooltip/Tooltip.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,18 @@ export default {
title: 'Components/Tooltip',
component: Tooltip,
args: defaultArgs,
argTypes: {
text: {
control: {
type: 'text',
},
},
children: {
control: {
type: null,
},
},
},
parameters: {
badges: ['1.0'],
chromatic: {
Expand Down

0 comments on commit fcef92f

Please sign in to comment.