Skip to content

feat(DataTable): add row hover styles #2849

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

Closed
wants to merge 13 commits into from
Closed
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
3 changes: 3 additions & 0 deletions .storybook/preview.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@ export const parameters = {
root: '#html-addon-root',
removeEmptyComments: true,
},
controls: {
hideNoControlsWarning: true,
},
options: {
storySort: (a, b) => {
const defaultOrder = [
Expand Down
92 changes: 92 additions & 0 deletions docs/content/drafts/DataTable.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
---
title: DataTable
componentId: data-table
status: Draft
---

import data from '../../../src/DataTable/DataTable.docs.json'

## Examples

```jsx
<DataTable
title="Repositories"
data={[
{
id: 1,
name: 'codeql-dca-worker',
type: 'internal',
securityFeatures: {
dependabot: ['alerts', 'security updates'],
},
},
{
id: 2,
name: 'aegir',
type: 'public',
securityFeatures: {
dependabot: ['alerts'],
},
},
{
id: 3,
name: 'strapi',
type: 'public',
securityFeatures: {
dependabot: [],
},
},
]}
columns={[
{
header: 'Repository',
field: 'name',
rowHeader: true,
},
{
header: 'Type',
field: 'type',
renderCell: row => {
return <Label>{uppercase(row.type)}</Label>
},
},
{
header: 'Dependabot',
renderCell: row => {
return row.securityFeatures.dependabot.length > 0 ? (
<LabelGroup>
{row.securityFeatures.dependabot.map(feature => {
return <Label key={feature}>{uppercase(feature)}</Label>
})}
</LabelGroup>
) : null
},
},
]}
/>
```

## Props

<ComponentProps data={data} />

## Status

<ComponentChecklist
items={{
propsDocumented: false,
noUnnecessaryDeps: false,
adaptsToThemes: false,
adaptsToScreenSizes: false,
fullTestCoverage: false,
usedInProduction: false,
usageExamplesDocumented: false,
hasStorybookStories: false,
designReviewed: false,
a11yReviewed: false,
stableApi: false,
addressedApiFeedback: false,
hasDesignGuidelines: false,
hasFigmaComponent: false,
}}
/>
147 changes: 147 additions & 0 deletions generated/components.json
Original file line number Diff line number Diff line change
Expand Up @@ -2608,6 +2608,153 @@
],
"subcomponents": []
},
"data-table": {
"id": "data-table",
"name": "DataTable",
"status": "draft",
"a11yReviewed": false,
"stories": [],
"props": [
{
"name": "aria-describedby",
"type": "string",
"description": "Provide an id to an element which uniquely describes this table"
},
{
"name": "aria-labelledby",
"type": "string",
"description": "Provide an id to an element which uniquely labels this table"
},
{
"name": "data",
"type": "Array<Data>",
"description": "Provide a collection of the rows which will be rendered inside of the table"
},
{
"name": "columns",
"type": "Array<Column<Data>>",
"description": "Provide the columns for the table and the fields in `data` to which they correspond"
},
{
"name": "cellPadding",
"type": "'condensed' | 'normal' | 'spacious'",
"description": "Specify the amount of space that should be available around the contents of a cell"
}
],
"subcomponents": [
{
"name": "Table",
"props": [
{
"name": "aria-describedby",
"type": "string",
"description": "Provide an id to an element which uniquely describes this table"
},
{
"name": "aria-labelledby",
"type": "string",
"description": "Provide an id to an element which uniquely labels this table"
},
{
"name": "children",
"type": "React.ReactNode"
},
{
"name": "cellPadding",
"type": "'condensed' | 'normal' | 'spacious'",
"description": "Specify the amount of space that should be available around the contents of a cell"
}
]
},
{
"name": "TableHead",
"props": [
{
"name": "children",
"type": "React.ReactNode"
}
]
},
{
"name": "TableBody",
"props": [
{
"name": "children",
"type": "React.ReactNode"
}
]
},
{
"name": "TableRow",
"props": [
{
"name": "children",
"type": "React.ReactNode"
}
]
},
{
"name": "TableHeader",
"props": [
{
"name": "children",
"type": "React.ReactNode"
}
]
},
{
"name": "TableCell",
"props": [
{
"name": "children",
"type": "React.ReactNode"
},
{
"name": "scope",
"type": "string",
"description": "Provide the scope for a table cell, useful for defining a row header using `scope=\"row\"`"
}
]
},
{
"name": "TableContainer",
"props": [
{
"name": "children",
"type": "React.ReactNode"
}
]
},
{
"name": "TableTitle",
"props": [
{
"name": "children",
"type": "React.ReactNode"
},
{
"name": "id",
"type": "string",
"required": true
}
]
},
{
"name": "TableSubtitle",
"props": [
{
"name": "children",
"type": "React.ReactNode"
},
{
"name": "id",
"type": "string",
"required": true
}
]
}
]
},
"drafts_dialog": {
"id": "drafts_dialog",
"name": "Dialog",
Expand Down
Loading