Skip to content

chore(table): remove card that wraps table content #11959

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
75 changes: 36 additions & 39 deletions packages/react-table/src/demos/examples/TableCompact.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { Fragment, useState } from 'react';
import {
Button,
Card,
MenuToggle,
MenuToggleElement,
Pagination,
Expand Down Expand Up @@ -130,45 +129,43 @@ export const TableCompact: React.FunctionComponent = () => {
<Fragment>
<DashboardWrapper hasPageTemplateTitle>
<PageSection isFilled aria-label="Compact table data">
<Card>
{tableToolbar}
<Table variant="compact" aria-label="Compact Table">
<Thead>
<Tr>
<Th key={0}>{columns[0]}</Th>
<Th key={1}>{columns[1]}</Th>
<Th key={2}>{columns[2]}</Th>
<Th key={3}>{columns[3]}</Th>
<Th key={4}>{columns[4]}</Th>
<Th key={5}>{columns[5]}</Th>
<Th key={6}>{columns[6]}</Th>
<Th key={7} width={10}>
{columns[7]}
</Th>
{tableToolbar}
<Table variant="compact" aria-label="Compact Table">
<Thead>
<Tr>
<Th key={0}>{columns[0]}</Th>
<Th key={1}>{columns[1]}</Th>
<Th key={2}>{columns[2]}</Th>
<Th key={3}>{columns[3]}</Th>
<Th key={4}>{columns[4]}</Th>
<Th key={5}>{columns[5]}</Th>
<Th key={6}>{columns[6]}</Th>
<Th key={7} width={10}>
{columns[7]}
</Th>
</Tr>
</Thead>
<Tbody>
{paginatedRows.map((row, rowIndex) => (
<Tr key={rowIndex}>
<>
<Td dataLabel={columns[0]}>{row.name}</Td>
<Td dataLabel={columns[1]}>{row.threads}</Td>
<Td dataLabel={columns[2]}>{row.applications}</Td>
<Td dataLabel={columns[3]}>{row.workspaces}</Td>
<Td dataLabel={columns[4]}>{renderLabel(row.status)}</Td>
<Td dataLabel={columns[5]}>{row.location}</Td>
<Td dataLabel={columns[6]}>{row.lastModified}</Td>
<Td dataLabel={columns[7]} modifier="truncate">
<TableText>
<a href="#">{row.url}</a>
</TableText>
</Td>
</>
</Tr>
</Thead>
<Tbody>
{paginatedRows.map((row, rowIndex) => (
<Tr key={rowIndex}>
<>
<Td dataLabel={columns[0]}>{row.name}</Td>
<Td dataLabel={columns[1]}>{row.threads}</Td>
<Td dataLabel={columns[2]}>{row.applications}</Td>
<Td dataLabel={columns[3]}>{row.workspaces}</Td>
<Td dataLabel={columns[4]}>{renderLabel(row.status)}</Td>
<Td dataLabel={columns[5]}>{row.location}</Td>
<Td dataLabel={columns[6]}>{row.lastModified}</Td>
<Td dataLabel={columns[7]} modifier="truncate">
<TableText>
<a href="#">{row.url}</a>
</TableText>
</Td>
</>
</Tr>
))}
</Tbody>
</Table>
</Card>
))}
</Tbody>
</Table>
</PageSection>
</DashboardWrapper>
</Fragment>
Expand Down
71 changes: 34 additions & 37 deletions packages/react-table/src/demos/examples/TableEmptyStateDefault.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import { Table, Thead, Tr, Th, Tbody, Td } from '@patternfly/react-table';
import {
Bullseye,
Button,
Card,
EmptyState,
EmptyStateVariant,
EmptyStateBody,
Expand All @@ -16,42 +15,40 @@ import { DashboardWrapper } from '@patternfly/react-table/dist/esm/demos/Dashboa
export const TableEmptyStateDefault: React.FunctionComponent = () => (
<DashboardWrapper hasPageTemplateTitle>
<PageSection padding={{ default: 'noPadding', xl: 'padding' }} aria-label="Empty state table data">
<Card component="div">
<Table aria-label="Empty state table">
<Thead>
<Tr>
<Th>Repositories</Th>
<Th>Branches</Th>
<Th>Pull requests</Th>
<Th>Workspaces</Th>
<Th>Last commit</Th>
</Tr>
</Thead>
<Tbody>
<Tr>
<Td colSpan={8}>
<Bullseye>
<EmptyState
titleText="No results found"
icon={SearchIcon}
headingLevel="h2"
variant={EmptyStateVariant.sm}
>
<EmptyStateBody>
No results match this filter criteria. Clear all filters and try again.
</EmptyStateBody>
<EmptyStateFooter>
<EmptyStateActions>
<Button variant="link">Clear all filters</Button>
</EmptyStateActions>
</EmptyStateFooter>
</EmptyState>
</Bullseye>
</Td>
</Tr>
</Tbody>
</Table>
</Card>
<Table aria-label="Empty state table">
<Thead>
<Tr>
<Th>Repositories</Th>
<Th>Branches</Th>
<Th>Pull requests</Th>
<Th>Workspaces</Th>
<Th>Last commit</Th>
</Tr>
</Thead>
<Tbody>
<Tr>
<Td colSpan={8}>
<Bullseye>
<EmptyState
titleText="No results found"
icon={SearchIcon}
headingLevel="h2"
variant={EmptyStateVariant.sm}
>
<EmptyStateBody>
No results match this filter criteria. Clear all filters and try again.
</EmptyStateBody>
<EmptyStateFooter>
<EmptyStateActions>
<Button variant="link">Clear all filters</Button>
</EmptyStateActions>
</EmptyStateFooter>
</EmptyState>
</Bullseye>
</Td>
</Tr>
</Tbody>
</Table>
</PageSection>
</DashboardWrapper>
);
62 changes: 30 additions & 32 deletions packages/react-table/src/demos/examples/TableEmptyStateError.tsx
Original file line number Diff line number Diff line change
@@ -1,42 +1,40 @@
import { Table, Thead, Tr, Th, Tbody, Td } from '@patternfly/react-table';
import { Bullseye, Card, EmptyState, EmptyStateVariant, EmptyStateBody, PageSection } from '@patternfly/react-core';
import { Bullseye, EmptyState, EmptyStateVariant, EmptyStateBody, PageSection } from '@patternfly/react-core';
import ExclamationCircleIcon from '@patternfly/react-icons/dist/esm/icons/exclamation-circle-icon';
import { DashboardWrapper } from '@patternfly/react-table/dist/esm/demos/DashboardWrapper';

export const TableEmptyStateError: React.FunctionComponent = () => (
<DashboardWrapper hasPageTemplateTitle>
<PageSection padding={{ default: 'noPadding', xl: 'padding' }} aria-label="Empty state table with error">
<Card component="div">
<Table aria-label="Loading table demo">
<Thead>
<Tr>
<Th>Repositories</Th>
<Th>Branches</Th>
<Th>Pull requests</Th>
<Th>Workspaces</Th>
<Th>Last commit</Th>
</Tr>
</Thead>
<Tbody>
<Tr>
<Td colSpan={8}>
<Bullseye>
<EmptyState
icon={ExclamationCircleIcon}
titleText="Unable to connect"
headingLevel="h2"
variant={EmptyStateVariant.sm}
>
<EmptyStateBody>
There was an error retrieving data. Check your connection and reload the page.
</EmptyStateBody>
</EmptyState>
</Bullseye>
</Td>
</Tr>
</Tbody>
</Table>
</Card>
<Table aria-label="Loading table demo">
<Thead>
<Tr>
<Th>Repositories</Th>
<Th>Branches</Th>
<Th>Pull requests</Th>
<Th>Workspaces</Th>
<Th>Last commit</Th>
</Tr>
</Thead>
<Tbody>
<Tr>
<Td colSpan={8}>
<Bullseye>
<EmptyState
icon={ExclamationCircleIcon}
titleText="Unable to connect"
headingLevel="h2"
variant={EmptyStateVariant.sm}
>
<EmptyStateBody>
There was an error retrieving data. Check your connection and reload the page.
</EmptyStateBody>
</EmptyState>
</Bullseye>
</Td>
</Tr>
</Tbody>
</Table>
</PageSection>
</DashboardWrapper>
);
44 changes: 21 additions & 23 deletions packages/react-table/src/demos/examples/TableEmptyStateLoading.tsx
Original file line number Diff line number Diff line change
@@ -1,32 +1,30 @@
import { Table, Thead, Tr, Th, Tbody, Td } from '@patternfly/react-table';
import { Bullseye, Card, EmptyState, PageSection, Spinner } from '@patternfly/react-core';
import { Bullseye, EmptyState, PageSection, Spinner } from '@patternfly/react-core';
import { DashboardWrapper } from '@patternfly/react-table/dist/esm/demos/DashboardWrapper';

export const TableEmptyStateLoading: React.FunctionComponent = () => (
<DashboardWrapper hasPageTemplateTitle>
<PageSection padding={{ default: 'noPadding', xl: 'padding' }} aria-label="Empty state table loading">
<Card component="div">
<Table aria-label="Loading table demo">
<Thead>
<Tr>
<Th>Repositories</Th>
<Th>Branches</Th>
<Th>Pull requests</Th>
<Th>Workspaces</Th>
<Th>Last commit</Th>
</Tr>
</Thead>
<Tbody>
<Tr>
<Td colSpan={8}>
<Bullseye>
<EmptyState titleText="Loading" icon={Spinner} headingLevel="h2" />
</Bullseye>
</Td>
</Tr>
</Tbody>
</Table>
</Card>
<Table aria-label="Loading table demo">
<Thead>
<Tr>
<Th>Repositories</Th>
<Th>Branches</Th>
<Th>Pull requests</Th>
<Th>Workspaces</Th>
<Th>Last commit</Th>
</Tr>
</Thead>
<Tbody>
<Tr>
<Td colSpan={8}>
<Bullseye>
<EmptyState titleText="Loading" icon={Spinner} headingLevel="h2" />
</Bullseye>
</Td>
</Tr>
</Tbody>
</Table>
</PageSection>
</DashboardWrapper>
);
Loading
Loading