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

Function ColorSearchSkeleton

packages/dev/s2-docs/src/colorSearchData.tsx:279–330  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

277}
278
279export function ColorSearchSkeleton() {
280 const mockSections = useMemo(
281 () => [
282 {
283 id: 'background',
284 name: 'Background colors',
285 items: Array.from({length: 59}, (_, i) => ({id: `skeleton-background-${i}`}))
286 },
287 {
288 id: 'text',
289 name: 'Text colors',
290 items: Array.from({length: 12}, (_, i) => ({id: `skeleton-text-${i}`}))
291 },
292 {
293 id: 'semantic',
294 name: 'Semantic colors',
295 items: Array.from({length: 80}, (_, i) => ({id: `skeleton-semantic-${i}`}))
296 },
297 {
298 id: 'global',
299 name: 'Global colors',
300 items: Array.from({length: 301}, (_, i) => ({id: `skeleton-global-${i}`}))
301 }
302 ],
303 []
304 );
305
306 return (
307 <div className={style({display: 'flex', flexDirection: 'column', gap: 8})}>
308 <InfoMessage>
309 Press a color to copy its name. See <Link href="styling">styling</Link> for more
310 information.
311 </InfoMessage>
312 <Skeleton isLoading>
313 <ListBox
314 aria-label="Colors loading"
315 layout="grid"
316 className={listBoxStyle}
317 items={mockSections}>
318 {section => (
319 <ListBoxSection id={section.id} className={sectionStyle}>
320 <Header className={headerStyle}>{section.name}</Header>
321 {section.items.map(item => (
322 <SkeletonColorItem key={item.id} item={item} />
323 ))}
324 </ListBoxSection>
325 )}
326 </ListBox>
327 </Skeleton>
328 </div>
329 );
330}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected