@@ -29,18 +29,9 @@ const meta: Meta<typeof CardView> = {
2929export default meta ;
3030
3131const cardViewStyles = style ( {
32- width : {
33- default : 'screen' ,
34- viewMode : {
35- docs : 'full'
36- }
37- } ,
38- height : {
39- default : 'screen' ,
40- viewMode : {
41- docs : 600
42- }
43- }
32+ width : 'screen' ,
33+ maxWidth : 'full' ,
34+ height : 600
4435} ) ;
4536
4637type Item = {
@@ -101,7 +92,7 @@ function PhotoCard({item, layout}: {item: Item, layout: string}) {
10192 ) ;
10293}
10394
104- export const Example = ( args : CardViewProps < any > , { viewMode } ) => {
95+ export const Example = ( args : CardViewProps < any > ) => {
10596 let list = useAsyncList < Item , number | null > ( {
10697 async load ( { signal, cursor, items} ) {
10798 let page = cursor || 1 ;
@@ -126,7 +117,7 @@ export const Example = (args: CardViewProps<any>, {viewMode}) => {
126117 { ...args }
127118 loadingState = { loadingState }
128119 onLoadMore = { args . loadingState === 'idle' ? list . loadMore : undefined }
129- styles = { cardViewStyles ( { viewMode } ) } >
120+ styles = { cardViewStyles } >
130121 < Collection items = { items } dependencies = { [ args . layout ] } >
131122 { item => < PhotoCard item = { item } layout = { args . layout || 'grid' } /> }
132123 </ Collection >
@@ -157,12 +148,12 @@ Example.args = {
157148 selectionMode : 'multiple'
158149} ;
159150
160- export const Empty = ( args : CardViewProps < any > , { viewMode } ) => {
151+ export const Empty = ( args : CardViewProps < any > ) => {
161152 return (
162153 < CardView
163154 aria-label = "Assets"
164155 { ...args }
165- styles = { cardViewStyles ( { viewMode } ) }
156+ styles = { cardViewStyles }
166157 renderEmptyState = { ( ) => (
167158 < IllustratedMessage size = "L" >
168159 < EmptyIcon />
@@ -202,7 +193,7 @@ function TopicCard({topic}: {topic: Topic}) {
202193 ) ;
203194}
204195
205- export const CollectionCards = ( args : CardViewProps < any > , { viewMode } ) => {
196+ export const CollectionCards = ( args : CardViewProps < any > ) => {
206197 let list = useAsyncList < Topic , number | null > ( {
207198 async load ( { signal, cursor} ) {
208199 let page = cursor || 1 ;
@@ -224,7 +215,7 @@ export const CollectionCards = (args: CardViewProps<any>, {viewMode}) => {
224215 { ...args }
225216 loadingState = { loadingState }
226217 onLoadMore = { args . loadingState === 'idle' ? list . loadMore : undefined }
227- styles = { cardViewStyles ( { viewMode } ) } >
218+ styles = { cardViewStyles } >
228219 < Collection items = { items } >
229220 { topic => < TopicCard topic = { topic } /> }
230221 </ Collection >
0 commit comments