Skip to content

Commit

Permalink
Add VRT storybook for a few static permutations
Browse files Browse the repository at this point in the history
  • Loading branch information
cee-chen committed Sep 6, 2024
1 parent 30109c7 commit 405e81e
Show file tree
Hide file tree
Showing 9 changed files with 60 additions and 8 deletions.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
68 changes: 60 additions & 8 deletions packages/eui/src/components/datagrid/data_grid_styles.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,13 @@ const meta: Meta = {
export default meta;
type Story = StoryObj<EuiDataGridStyle>;

const storyArgs = {
...defaultStorybookArgs,
renderFooterCellValue: ({ columnId }: { columnId: string }) =>
columnId === 'account' ? '5 accounts' : null,
height: 400, // to more easily test sticky footers
};

export const Playground: Story = {
parameters: {
codeSnippet: {
Expand All @@ -50,14 +57,59 @@ export const Playground: Story = {
},
},
render: (gridStyle: EuiDataGridStyle) => (
<StatefulDataGrid
{...defaultStorybookArgs}
gridStyle={gridStyle}
renderFooterCellValue={({ columnId }) =>
columnId === 'account' ? '5 accounts' : null
}
height={400}
/>
<StatefulDataGrid {...storyArgs} gridStyle={gridStyle} />
),
};
enableFunctionToggleControls(Playground, ['onChange']);

/**
* VRT only
*/

export const HorizontalLines: Story = {
tags: ['vrt-only'],
args: {
border: 'horizontal',
header: 'shade',
footer: 'shade',
},
render: (gridStyle) => (
<StatefulDataGrid {...storyArgs} gridStyle={gridStyle} />
),
};

export const Minimal: Story = {
tags: ['vrt-only'],
args: {
border: 'none',
header: 'underline',
footer: 'overline',
rowHover: 'none',
stickyFooter: false,
},
render: (gridStyle) => (
<StatefulDataGrid {...storyArgs} gridStyle={gridStyle} height="auto" />
),
};

export const Compact: Story = {
tags: ['vrt-only'],
args: {
fontSize: 's',
cellPadding: 's',
},
render: (gridStyle) => (
<StatefulDataGrid {...storyArgs} gridStyle={gridStyle} />
),
};

export const Expanded: Story = {
tags: ['vrt-only'],
args: {
fontSize: 'l',
cellPadding: 'l',
},
render: (gridStyle) => (
<StatefulDataGrid {...storyArgs} gridStyle={gridStyle} />
),
};

0 comments on commit 405e81e

Please sign in to comment.