MCPcopy Create free account
hub / github.com/adobe/react-spectrum / IllustrationList

Function IllustrationList

packages/dev/s2-docs/src/IllustrationCards.tsx:189–227  ·  view source on GitHub ↗
({variant, gradientStyle})

Source from the content-addressed store, hash-verified

187}
188
189function IllustrationList({variant, gradientStyle}) {
190 let items = use(loadIllustrations(variant, gradientStyle));
191 let {copiedId, handleCopyImport} = useCopyImport(variant, gradientStyle);
192 return (
193 <Virtualizer
194 layout={GridLayout}
195 layoutOptions={{
196 minItemSize: new Size(164, 164),
197 maxItemSize: new Size(164, 164),
198 minSpace: new Size(20, 20),
199 preserveAspectRatio: true
200 }}>
201 <ListBox
202 aria-label="Illustrations"
203 items={items}
204 layout="grid"
205 onAction={item => handleCopyImport(item.toString())}
206 dependencies={[copiedId]}
207 className={style({
208 height: 560,
209 width: '100%',
210 maxHeight: '100%',
211 overflow: 'auto',
212 scrollPaddingY: 4
213 })}
214 renderEmptyState={() => (
215 <IllustratedMessage styles={style({marginX: 'auto', marginY: 32})}>
216 <NoSearchResults />
217 <Heading>No results</Heading>
218 <Content>Try a different search term.</Content>
219 </IllustratedMessage>
220 )}>
221 {(item: IllustrationItemType) => (
222 <IllustrationItem item={item} isCopied={copiedId === item.id} />
223 )}
224 </ListBox>
225 </Virtualizer>
226 );
227}
228
229function IllustrationItem({
230 item,

Callers

nothing calls this directly

Calls 3

loadIllustrationsFunction · 0.85
useCopyImportFunction · 0.70
toStringMethod · 0.65

Tested by

no test coverage detected