Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added Storybook documentation on how to add an IconButton in a Table #664

Merged
merged 2 commits into from
May 5, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

## Not released

- Added Storybook documentation on how to add an IconButton in a Table [#664](https://github.com/CartoDB/carto-react/pull/664)
- Changed how widget are calculated when a mask is set: use just the mask, no more intersection between mask and viewport [#661](https://github.com/CartoDB/carto-react/pull/661)
- LegendCategories component migrated from makeStyles to styled-components + cleanup [#634](https://github.com/CartoDB/carto-react/pull/634)
- LegendProportion component migrated from makeStyles to styled-components + cleanup [#635](https://github.com/CartoDB/carto-react/pull/635)
Expand Down
40 changes: 33 additions & 7 deletions packages/react-ui/storybook/stories/molecules/Table.stories.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,36 +2,50 @@ import React from 'react';
import {
Box,
Chip,
FormControl,
MenuItem,
Select,
Tooltip,
Typography,
TableRow,
TableCell,
TableHead,
TableContainer,
TableBody,
Table
Table,
IconButton
} from '@mui/material';
import SelectField from '../../../src/components/atoms/SelectField';
import { MoreVertOutlined } from '@mui/icons-material';

const rows = [
{ name: 'Test Data 1', type: 'string', mode: '', description: 'Test Data 1' },
{
name: 'Test Data 1',
type: 'string',
mode: '',
description: 'Test Data 1'
},
{
name: 'very long text that should trigger the overflow style',
type: 'string',
mode: '',
description: 'Test Data 2'
},
{ name: 'Test Data 3', type: 'string', mode: '', description: 'Test Data 3' },
{
name: 'Test Data 3',
type: 'string',
mode: '',
description: 'Test Data 3'
},
{
name: 'Test Data 4',
type: 'string',
mode: '',
description: 'very long text that should trigger the overflow style'
},
{ name: 'Test Data 5', type: 'string', mode: '', description: 'Test Data 5' }
{
name: 'Test Data 5',
type: 'string',
mode: '',
description: 'Test Data 5'
}
];

const options = {
Expand Down Expand Up @@ -62,6 +76,7 @@ const PlaygroundTemplate = (args) => {
<TableCell>Type</TableCell>
<TableCell>Mode</TableCell>
<TableCell>Description</TableCell>
<TableCell>Actions</TableCell>
</TableRow>
</TableHead>
<TableBody>
Expand Down Expand Up @@ -106,6 +121,11 @@ const PlaygroundTemplate = (args) => {
row.description
)}
</TableCell>
<TableCell>
<IconButton size='small'>
<MoreVertOutlined />
</IconButton>
</TableCell>
</TableRow>
))}
</TableBody>
Expand All @@ -125,6 +145,7 @@ const ScrollTemplate = (args) => (
<TableCell>Type</TableCell>
<TableCell>Mode</TableCell>
<TableCell>Description</TableCell>
<TableCell>Actions</TableCell>
</TableRow>
</TableHead>
<TableBody>
Expand Down Expand Up @@ -169,6 +190,11 @@ const ScrollTemplate = (args) => (
row.description
)}
</TableCell>
<TableCell>
<IconButton size='small'>
<MoreVertOutlined />
</IconButton>
</TableCell>
</TableRow>
))}
</TableBody>
Expand Down