1111 */
1212
1313import { action } from '@storybook/addon-actions' ;
14- import { Cell , Column , Content , Heading , IllustratedMessage , Link , Row , Table , TableBody , TableHeader } from '../src' ;
14+ import { Cell , Column , Content , Heading , IllustratedMessage , Link , Row , TableBody , TableHeader , TableView } from '../src' ;
1515import FolderOpen from '../spectrum-illustrations/linear/FolderOpen' ;
1616import type { Meta } from '@storybook/react' ;
1717import { SortDescriptor } from 'react-aria-components' ;
1818import { style } from '../style/spectrum-theme' with { type : 'macro' } ;
1919import { useAsyncList } from '@react-stately/data' ;
2020import { useState } from 'react' ;
2121
22- const meta : Meta < typeof Table > = {
23- component : Table ,
22+ const meta : Meta < typeof TableView > = {
23+ component : TableView ,
2424 parameters : {
2525 chromaticProvider : { disableAnimations : true }
2626 } ,
@@ -30,7 +30,7 @@ const meta: Meta<typeof Table> = {
3030export default meta ;
3131
3232const StaticTable = ( args : any ) => (
33- < Table aria-label = "Files" { ...args } styles = { style ( { width : 320 , height : 320 } ) } >
33+ < TableView aria-label = "Files" { ...args } styles = { style ( { width : 320 , height : 320 } ) } >
3434 < TableHeader >
3535 < Column isRowHeader > Name</ Column >
3636 < Column > Type</ Column >
@@ -61,7 +61,7 @@ const StaticTable = (args: any) => (
6161 < Cell > Long long long long long long long cell</ Cell >
6262 </ Row >
6363 </ TableBody >
64- </ Table >
64+ </ TableView >
6565) ;
6666
6767export const Example = {
@@ -104,7 +104,7 @@ let items = [
104104] ;
105105
106106const DynamicTable = ( args : any ) => (
107- < Table aria-label = "Dynamic table" { ...args } styles = { style ( { width : 320 , height : 208 } ) } >
107+ < TableView aria-label = "Dynamic table" { ...args } styles = { style ( { width : 320 , height : 208 } ) } >
108108 < TableHeader columns = { columns } >
109109 { ( column ) => (
110110 < Column width = { 150 } minWidth = { 150 } isRowHeader = { column . isRowHeader } > { column . name } </ Column >
@@ -119,7 +119,7 @@ const DynamicTable = (args: any) => (
119119 </ Row >
120120 ) }
121121 </ TableBody >
122- </ Table >
122+ </ TableView >
123123) ;
124124
125125export const Dynamic = {
@@ -145,7 +145,7 @@ function renderEmptyState() {
145145}
146146
147147const EmptyStateTable = ( args : any ) => (
148- < Table aria-label = "Empty state" { ...args } styles = { style ( { height : 320 , width : 320 } ) } >
148+ < TableView aria-label = "Empty state" { ...args } styles = { style ( { height : 320 , width : 320 } ) } >
149149 < TableHeader columns = { columns } >
150150 { ( column ) => (
151151 < Column minWidth = { 200 } width = { 200 } isRowHeader = { column . isRowHeader } > { column . name } </ Column >
@@ -154,7 +154,7 @@ const EmptyStateTable = (args: any) => (
154154 < TableBody items = { [ ] } renderEmptyState = { renderEmptyState } >
155155 { [ ] }
156156 </ TableBody >
157- </ Table >
157+ </ TableView >
158158) ;
159159
160160export const EmptyState = {
@@ -173,7 +173,7 @@ let dividerColumns = [
173173
174174const ShowDividers = ( args : any ) => {
175175 return (
176- < Table aria-label = "Show Dividers table" { ...args } styles = { style ( { width : 320 , height : 208 } ) } >
176+ < TableView aria-label = "Show Dividers table" { ...args } styles = { style ( { width : 320 , height : 208 } ) } >
177177 < TableHeader columns = { dividerColumns } >
178178 { ( column ) => (
179179 < Column width = { 150 } minWidth = { 150 } isRowHeader = { column . isRowHeader } > { column . name } </ Column >
@@ -188,7 +188,7 @@ const ShowDividers = (args: any) => {
188188 </ Row >
189189 ) }
190190 </ TableBody >
191- </ Table >
191+ </ TableView >
192192 ) ;
193193} ;
194194
@@ -209,7 +209,7 @@ let alignColumns = [
209209
210210const TextAlign = ( args : any ) => {
211211 return (
212- < Table aria-label = "Show Dividers table" { ...args } styles = { style ( { width : 320 , height : 208 } ) } >
212+ < TableView aria-label = "Show Dividers table" { ...args } styles = { style ( { width : 320 , height : 208 } ) } >
213213 < TableHeader columns = { alignColumns } >
214214 { ( column ) => (
215215 < Column width = { 150 } minWidth = { 150 } isRowHeader = { column . isRowHeader } align = { column ?. align as 'start' | 'center' | 'end' } > { column . name } </ Column >
@@ -224,7 +224,7 @@ const TextAlign = (args: any) => {
224224 </ Row >
225225 ) }
226226 </ TableBody >
227- </ Table >
227+ </ TableView >
228228 ) ;
229229} ;
230230
@@ -262,7 +262,7 @@ const OnLoadMoreTable = (args: any) => {
262262 } ) ;
263263
264264 return (
265- < Table { ...args } aria-label = "Load more table" loadingState = { list . loadingState } onLoadMore = { list . loadMore } styles = { style ( { width : 320 , height : 320 } ) } >
265+ < TableView { ...args } aria-label = "Load more table" loadingState = { list . loadingState } onLoadMore = { list . loadMore } styles = { style ( { width : 320 , height : 320 } ) } >
266266 < TableHeader >
267267 < Column id = "name" isRowHeader > Name</ Column >
268268 < Column id = "height" > Height</ Column >
@@ -280,7 +280,7 @@ const OnLoadMoreTable = (args: any) => {
280280 </ Row >
281281 ) }
282282 </ TableBody >
283- </ Table >
283+ </ TableView >
284284 ) ;
285285} ;
286286
@@ -340,7 +340,7 @@ const SortableTable = (args: any) => {
340340 } ;
341341
342342 return (
343- < Table aria-label = "sortable table" { ...args } sortDescriptor = { sortDescriptor } onSortChange = { onSortChange } styles = { style ( { height : 320 } ) } >
343+ < TableView aria-label = "sortable table" { ...args } sortDescriptor = { sortDescriptor } onSortChange = { onSortChange } styles = { style ( { height : 320 } ) } >
344344 < TableHeader columns = { sortcolumns } >
345345 { ( column ) => (
346346 < Column isRowHeader = { column . isRowHeader } allowsSorting > { column . name } </ Column >
@@ -355,7 +355,7 @@ const SortableTable = (args: any) => {
355355 </ Row >
356356 ) }
357357 </ TableBody >
358- </ Table >
358+ </ TableView >
359359 ) ;
360360} ;
361361
@@ -391,7 +391,7 @@ const SortableResizableTable = (args: any) => {
391391 } ;
392392
393393 return (
394- < Table aria-label = "sortable table" { ...args } sortDescriptor = { isSortable ? sortDescriptor : null } onSortChange = { isSortable ? onSortChange : null } styles = { style ( { width : 384 , height : 320 } ) } >
394+ < TableView aria-label = "sortable table" { ...args } sortDescriptor = { isSortable ? sortDescriptor : null } onSortChange = { isSortable ? onSortChange : null } styles = { style ( { width : 384 , height : 320 } ) } >
395395 < TableHeader columns = { args . columns } >
396396 { ( column : any ) => (
397397 < Column isRowHeader = { column . isRowHeader } allowsSorting = { column . isSortable } allowsResizing = { column . allowsResizing } align = { column . align } > { column . name } </ Column >
@@ -406,7 +406,7 @@ const SortableResizableTable = (args: any) => {
406406 </ Row >
407407 ) }
408408 </ TableBody >
409- </ Table >
409+ </ TableView >
410410 ) ;
411411} ;
412412
0 commit comments