Skip to content

Commit faa7667

Browse files
authored
chore(DataTable): update ids for DataTable docs (#3023)
* chore(DataTable): update ids for DataTable docs * docs(DataTable): remove draft from story name * chore(DataTable): update subcomponents for DataTable * chore: remove drafts prefix * Update generated/components.json --------- Co-authored-by: Josh Black <[email protected]>
1 parent 4b552cd commit faa7667

File tree

4 files changed

+35
-28
lines changed

4 files changed

+35
-28
lines changed

generated/components.json

Lines changed: 17 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1857,24 +1857,28 @@
18571857
"code": "() => (\n <Table.Container>\n <Table.Title as=\"h2\" id=\"repositories\">\n Repositories\n </Table.Title>\n <Table.Subtitle as=\"p\" id=\"repositories-subtitle\">\n A subtitle could appear here to give extra context to the data.\n </Table.Subtitle>\n <DataTable\n aria-labelledby=\"repositories\"\n aria-describedby=\"repositories-subtitle\"\n data={data}\n columns={[\n {\n header: 'Repository',\n field: 'name',\n rowHeader: true,\n },\n {\n header: 'Type',\n field: 'type',\n renderCell: (row) => {\n return <Label>{uppercase(row.type)}</Label>\n },\n },\n {\n header: 'Updated',\n field: 'updatedAt',\n renderCell: (row) => {\n return <RelativeTime date={new Date(row.updatedAt)} />\n },\n },\n {\n header: 'Dependabot',\n field: 'securityFeatures.dependabot',\n renderCell: (row) => {\n return row.securityFeatures.dependabot.length > 0 ? (\n <LabelGroup>\n {row.securityFeatures.dependabot.map((feature) => {\n return <Label key={feature}>{uppercase(feature)}</Label>\n })}\n </LabelGroup>\n ) : null\n },\n },\n {\n header: 'Code scanning',\n field: 'securityFeatures.codeScanning',\n renderCell: (row) => {\n return row.securityFeatures.codeScanning.length > 0 ? (\n <LabelGroup>\n {row.securityFeatures.codeScanning.map((feature) => {\n return <Label key={feature}>{uppercase(feature)}</Label>\n })}\n </LabelGroup>\n ) : null\n },\n },\n ]}\n />\n </Table.Container>\n)"
18581858
},
18591859
{
1860-
"id": "drafts-components-datatable--with-title",
1860+
"id": "components-datatable-features--with-title",
18611861
"code": "() => (\n <Table.Container>\n <Table.Title as=\"h2\" id=\"repositories\">\n Repositories\n </Table.Title>\n <DataTable\n aria-labelledby=\"repositories\"\n aria-describedby=\"repositories-subtitle\"\n data={data}\n columns={[\n {\n header: 'Repository',\n field: 'name',\n rowHeader: true,\n },\n {\n header: 'Type',\n field: 'type',\n renderCell: (row) => {\n return <Label>{uppercase(row.type)}</Label>\n },\n },\n {\n header: 'Updated',\n field: 'updatedAt',\n renderCell: (row) => {\n return <RelativeTime date={new Date(row.updatedAt)} />\n },\n },\n {\n header: 'Dependabot',\n field: 'securityFeatures.dependabot',\n renderCell: (row) => {\n return row.securityFeatures.dependabot.length > 0 ? (\n <LabelGroup>\n {row.securityFeatures.dependabot.map((feature) => {\n return <Label key={feature}>{uppercase(feature)}</Label>\n })}\n </LabelGroup>\n ) : null\n },\n },\n {\n header: 'Code scanning',\n field: 'securityFeatures.codeScanning',\n renderCell: (row) => {\n return row.securityFeatures.codeScanning.length > 0 ? (\n <LabelGroup>\n {row.securityFeatures.codeScanning.map((feature) => {\n return <Label key={feature}>{uppercase(feature)}</Label>\n })}\n </LabelGroup>\n ) : null\n },\n },\n ]}\n />\n </Table.Container>\n)"
18621862
},
18631863
{
1864-
"id": "drafts-components-datatable--with-title-and-subtitle",
1864+
"id": "components-datatable-features--with-title-and-subtitle",
18651865
"code": "() => (\n <Table.Container>\n <Table.Title as=\"h2\" id=\"repositories\">\n Repositories\n </Table.Title>\n <Table.Subtitle as=\"p\" id=\"repositories-subtitle\">\n A subtitle could appear here to give extra context to the data.\n </Table.Subtitle>\n <DataTable\n aria-labelledby=\"repositories\"\n aria-describedby=\"repositories-subtitle\"\n data={data}\n columns={[\n {\n header: 'Repository',\n field: 'name',\n rowHeader: true,\n },\n {\n header: 'Type',\n field: 'type',\n renderCell: (row) => {\n return <Label>{uppercase(row.type)}</Label>\n },\n },\n {\n header: 'Updated',\n field: 'updatedAt',\n renderCell: (row) => {\n return <RelativeTime date={new Date(row.updatedAt)} />\n },\n },\n {\n header: 'Dependabot',\n field: 'securityFeatures.dependabot',\n renderCell: (row) => {\n return row.securityFeatures.dependabot.length > 0 ? (\n <LabelGroup>\n {row.securityFeatures.dependabot.map((feature) => {\n return <Label key={feature}>{uppercase(feature)}</Label>\n })}\n </LabelGroup>\n ) : null\n },\n },\n {\n header: 'Code scanning',\n field: 'securityFeatures.codeScanning',\n renderCell: (row) => {\n return row.securityFeatures.codeScanning.length > 0 ? (\n <LabelGroup>\n {row.securityFeatures.codeScanning.map((feature) => {\n return <Label key={feature}>{uppercase(feature)}</Label>\n })}\n </LabelGroup>\n ) : null\n },\n },\n ]}\n />\n </Table.Container>\n)"
18661866
},
18671867
{
1868-
"id": "drafts-components-datatable--with-sorting",
1868+
"id": "components-datatable-features--with-sorting",
18691869
"code": "() => {\n const rows = Array.from(data).sort((a, b) => {\n return b.updatedAt - a.updatedAt\n })\n return (\n <Table.Container>\n <Table.Title as=\"h2\" id=\"repositories\">\n Repositories\n </Table.Title>\n <Table.Subtitle as=\"p\" id=\"repositories-subtitle\">\n A subtitle could appear here to give extra context to the data.\n </Table.Subtitle>\n <DataTable\n aria-labelledby=\"repositories\"\n aria-describedby=\"repositories-subtitle\"\n data={rows}\n columns={[\n {\n header: 'Repository',\n field: 'name',\n rowHeader: true,\n sortBy: true,\n },\n {\n header: 'Type',\n field: 'type',\n renderCell: (row) => {\n return <Label>{uppercase(row.type)}</Label>\n },\n },\n {\n header: 'Updated',\n field: 'updatedAt',\n sortBy: true,\n renderCell: (row) => {\n return <RelativeTime date={new Date(row.updatedAt)} />\n },\n },\n {\n header: 'Dependabot',\n field: 'securityFeatures.dependabot',\n renderCell: (row) => {\n return row.securityFeatures.dependabot.length > 0 ? (\n <LabelGroup>\n {row.securityFeatures.dependabot.map((feature) => {\n return <Label key={feature}>{uppercase(feature)}</Label>\n })}\n </LabelGroup>\n ) : null\n },\n },\n {\n header: 'Code scanning',\n field: 'securityFeatures.codeScanning',\n renderCell: (row) => {\n return row.securityFeatures.codeScanning.length > 0 ? (\n <LabelGroup>\n {row.securityFeatures.codeScanning.map((feature) => {\n return <Label key={feature}>{uppercase(feature)}</Label>\n })}\n </LabelGroup>\n ) : null\n },\n },\n ]}\n initialSortColumn=\"updatedAt\"\n initialSortDirection=\"DESC\"\n />\n </Table.Container>\n )\n}"
18701870
},
18711871
{
1872-
"id": "drafts-components-datatable--with-actions",
1872+
"id": "components-datatable-features--with-actions",
18731873
"code": "() => (\n <Table.Container>\n <Table.Title as=\"h2\" id=\"repositories\">\n Repositories\n </Table.Title>\n <Table.Actions>\n <IconButton\n aria-label=\"Download\"\n icon={DownloadIcon}\n variant=\"invisible\"\n />\n <IconButton aria-label=\"Add row\" icon={PlusIcon} variant=\"invisible\" />\n </Table.Actions>\n <Table.Divider />\n <Table.Subtitle as=\"p\" id=\"repositories-subtitle\">\n A subtitle could appear here to give extra context to the data.\n </Table.Subtitle>\n <DataTable\n aria-labelledby=\"repositories\"\n aria-describedby=\"repositories-subtitle\"\n data={data}\n columns={[\n {\n header: 'Repository',\n field: 'name',\n rowHeader: true,\n },\n {\n header: 'Type',\n field: 'type',\n renderCell: (row) => {\n return <Label>{uppercase(row.type)}</Label>\n },\n },\n {\n header: 'Updated',\n field: 'updatedAt',\n renderCell: (row) => {\n return <RelativeTime date={new Date(row.updatedAt)} />\n },\n },\n {\n header: 'Dependabot',\n field: 'securityFeatures.dependabot',\n renderCell: (row) => {\n return row.securityFeatures.dependabot.length > 0 ? (\n <LabelGroup>\n {row.securityFeatures.dependabot.map((feature) => {\n return <Label key={feature}>{uppercase(feature)}</Label>\n })}\n </LabelGroup>\n ) : null\n },\n },\n {\n header: 'Code scanning',\n field: 'securityFeatures.codeScanning',\n renderCell: (row) => {\n return row.securityFeatures.codeScanning.length > 0 ? (\n <LabelGroup>\n {row.securityFeatures.codeScanning.map((feature) => {\n return <Label key={feature}>{uppercase(feature)}</Label>\n })}\n </LabelGroup>\n ) : null\n },\n },\n ]}\n />\n </Table.Container>\n)"
18741874
},
18751875
{
1876-
"id": "drafts-components-datatable--with-action",
1876+
"id": "components-datatable-features--with-action",
18771877
"code": "() => (\n <Table.Container>\n <Table.Title as=\"h2\" id=\"repositories\">\n Repositories\n </Table.Title>\n <Table.Actions>\n <Button>Action</Button>\n </Table.Actions>\n <Table.Divider />\n <Table.Subtitle as=\"p\" id=\"repositories-subtitle\">\n A subtitle could appear here to give extra context to the data.\n </Table.Subtitle>\n <DataTable\n aria-labelledby=\"repositories\"\n aria-describedby=\"repositories-subtitle\"\n data={data}\n columns={[\n {\n header: 'Repository',\n field: 'name',\n rowHeader: true,\n },\n {\n header: 'Type',\n field: 'type',\n renderCell: (row) => {\n return <Label>{uppercase(row.type)}</Label>\n },\n },\n {\n header: 'Updated',\n field: 'updatedAt',\n renderCell: (row) => {\n return <RelativeTime date={new Date(row.updatedAt)} />\n },\n },\n {\n header: 'Dependabot',\n field: 'securityFeatures.dependabot',\n renderCell: (row) => {\n return row.securityFeatures.dependabot.length > 0 ? (\n <LabelGroup>\n {row.securityFeatures.dependabot.map((feature) => {\n return <Label key={feature}>{uppercase(feature)}</Label>\n })}\n </LabelGroup>\n ) : null\n },\n },\n {\n header: 'Code scanning',\n field: 'securityFeatures.codeScanning',\n renderCell: (row) => {\n return row.securityFeatures.codeScanning.length > 0 ? (\n <LabelGroup>\n {row.securityFeatures.codeScanning.map((feature) => {\n return <Label key={feature}>{uppercase(feature)}</Label>\n })}\n </LabelGroup>\n ) : null\n },\n },\n ]}\n />\n </Table.Container>\n)"
1878+
},
1879+
{
1880+
"id": "components-datatable-features--with-custom-heading",
1881+
"code": "() => (\n <>\n <Heading as=\"h2\" id=\"repositories\">\n Security coverage\n </Heading>\n <p id=\"repositories-subtitle\">\n Organization members can only see data for the most recently-updated\n repositories. To see all repositories, talk to your organization\n administrator about becoming a security manager.\n </p>\n <Table.Container>\n <DataTable\n aria-labelledby=\"repositories\"\n aria-describedby=\"repositories-subtitle\"\n data={data}\n columns={[\n {\n header: 'Repository',\n field: 'name',\n rowHeader: true,\n },\n {\n header: 'Type',\n field: 'type',\n renderCell: (row) => {\n return <Label>{uppercase(row.type)}</Label>\n },\n },\n {\n header: 'Updated',\n field: 'updatedAt',\n renderCell: (row) => {\n return <RelativeTime date={new Date(row.updatedAt)} />\n },\n },\n {\n header: 'Dependabot',\n field: 'securityFeatures.dependabot',\n renderCell: (row) => {\n return row.securityFeatures.dependabot.length > 0 ? (\n <LabelGroup>\n {row.securityFeatures.dependabot.map((feature) => {\n return <Label key={feature}>{uppercase(feature)}</Label>\n })}\n </LabelGroup>\n ) : null\n },\n },\n {\n header: 'Code scanning',\n field: 'securityFeatures.codeScanning',\n renderCell: (row) => {\n return row.securityFeatures.codeScanning.length > 0 ? (\n <LabelGroup>\n {row.securityFeatures.codeScanning.map((feature) => {\n return <Label key={feature}>{uppercase(feature)}</Label>\n })}\n </LabelGroup>\n ) : null\n },\n },\n ]}\n />\n </Table.Container>\n </>\n)"
18781882
}
18791883
],
18801884
"props": [
@@ -1930,7 +1934,7 @@
19301934
]
19311935
},
19321936
{
1933-
"name": "TableHead",
1937+
"name": "Table.Head",
19341938
"props": [
19351939
{
19361940
"name": "children",
@@ -1939,7 +1943,7 @@
19391943
]
19401944
},
19411945
{
1942-
"name": "TableBody",
1946+
"name": "Table.Body",
19431947
"props": [
19441948
{
19451949
"name": "children",
@@ -1948,7 +1952,7 @@
19481952
]
19491953
},
19501954
{
1951-
"name": "TableRow",
1955+
"name": "Table.Row",
19521956
"props": [
19531957
{
19541958
"name": "children",
@@ -1957,7 +1961,7 @@
19571961
]
19581962
},
19591963
{
1960-
"name": "TableHeader",
1964+
"name": "Table.Header",
19611965
"props": [
19621966
{
19631967
"name": "children",
@@ -1966,7 +1970,7 @@
19661970
]
19671971
},
19681972
{
1969-
"name": "TableCell",
1973+
"name": "Table.Cell",
19701974
"props": [
19711975
{
19721976
"name": "children",
@@ -1980,7 +1984,7 @@
19801984
]
19811985
},
19821986
{
1983-
"name": "TableContainer",
1987+
"name": "Table.Container",
19841988
"props": [
19851989
{
19861990
"name": "children",
@@ -1989,7 +1993,7 @@
19891993
]
19901994
},
19911995
{
1992-
"name": "TableTitle",
1996+
"name": "Table.Title",
19931997
"props": [
19941998
{
19951999
"name": "children",
@@ -2003,7 +2007,7 @@
20032007
]
20042008
},
20052009
{
2006-
"name": "TableSubtitle",
2010+
"name": "Table.Subtitle",
20072011
"props": [
20082012
{
20092013
"name": "children",

src/DataTable/DataTable.docs.json

Lines changed: 16 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -5,19 +5,22 @@
55
"a11yReviewed": false,
66
"stories": [
77
{
8-
"id": "drafts-components-datatable--with-title"
8+
"id": "components-datatable-features--with-title"
99
},
1010
{
11-
"id": "drafts-components-datatable--with-title-and-subtitle"
11+
"id": "components-datatable-features--with-title-and-subtitle"
1212
},
1313
{
14-
"id": "drafts-components-datatable--with-sorting"
14+
"id": "components-datatable-features--with-sorting"
1515
},
1616
{
17-
"id": "drafts-components-datatable--with-actions"
17+
"id": "components-datatable-features--with-actions"
1818
},
1919
{
20-
"id": "drafts-components-datatable--with-action"
20+
"id": "components-datatable-features--with-action"
21+
},
22+
{
23+
"id": "components-datatable-features--with-custom-heading"
2124
}
2225
],
2326
"props": [
@@ -73,7 +76,7 @@
7376
]
7477
},
7578
{
76-
"name": "TableHead",
79+
"name": "Table.Head",
7780
"props": [
7881
{
7982
"name": "children",
@@ -82,7 +85,7 @@
8285
]
8386
},
8487
{
85-
"name": "TableBody",
88+
"name": "Table.Body",
8689
"props": [
8790
{
8891
"name": "children",
@@ -91,7 +94,7 @@
9194
]
9295
},
9396
{
94-
"name": "TableRow",
97+
"name": "Table.Row",
9598
"props": [
9699
{
97100
"name": "children",
@@ -100,7 +103,7 @@
100103
]
101104
},
102105
{
103-
"name": "TableHeader",
106+
"name": "Table.Header",
104107
"props": [
105108
{
106109
"name": "children",
@@ -109,7 +112,7 @@
109112
]
110113
},
111114
{
112-
"name": "TableCell",
115+
"name": "Table.Cell",
113116
"props": [
114117
{
115118
"name": "children",
@@ -123,7 +126,7 @@
123126
]
124127
},
125128
{
126-
"name": "TableContainer",
129+
"name": "Table.Container",
127130
"props": [
128131
{
129132
"name": "children",
@@ -132,7 +135,7 @@
132135
]
133136
},
134137
{
135-
"name": "TableTitle",
138+
"name": "Table.Title",
136139
"props": [
137140
{
138141
"name": "children",
@@ -146,7 +149,7 @@
146149
]
147150
},
148151
{
149-
"name": "TableSubtitle",
152+
"name": "Table.Subtitle",
150153
"props": [
151154
{
152155
"name": "children",

src/DataTable/DataTable.features.stories.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import LabelGroup from '../LabelGroup'
99
import RelativeTime from '../RelativeTime'
1010

1111
export default {
12-
title: 'Drafts/Components/DataTable/Features',
12+
title: 'Components/DataTable/Features',
1313
component: DataTable,
1414
} as Meta<typeof DataTable>
1515

src/DataTable/DataTable.stories.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import LabelGroup from '../LabelGroup'
66
import RelativeTime from '../RelativeTime'
77

88
export default {
9-
title: 'Drafts/Components/DataTable',
9+
title: 'Components/DataTable',
1010
component: DataTable,
1111
} as Meta<typeof DataTable>
1212

0 commit comments

Comments
 (0)