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

Function SkeletonIconItem

packages/dev/s2-docs/src/IconSearchView.tsx:213–258  ·  view source on GitHub ↗
({item}: {item: {id: string}})

Source from the content-addressed store, hash-verified

211}
212
213export function SkeletonIconItem({item}: {item: {id: string}}) {
214 const PlaceholderIcon = Close;
215 const ref = useRef(null);
216
217 const itemStyle = style({
218 ...focusRing(),
219 size: 'full',
220 backgroundColor: {
221 default: 'gray-50',
222 isHovered: 'gray-100',
223 isFocused: 'gray-100',
224 isSelected: 'neutral'
225 },
226 '--iconPrimary': {
227 type: 'color',
228 value: {
229 default: 'neutral',
230 isSelected: 'gray-25'
231 }
232 },
233 font: 'ui-sm',
234 borderRadius: 'default',
235 transition: 'default',
236 display: 'flex',
237 flexDirection: 'column',
238 gap: 4,
239 alignItems: 'center',
240 justifyContent: 'center',
241 paddingX: 4
242 });
243
244 return (
245 <ListBoxItem id={item.id} value={item} textValue="skeleton" className={itemStyle} ref={ref}>
246 <PlaceholderIcon styles={iconStyle({size: 'XL'})} />
247 <div
248 className={style({
249 maxWidth: '100%',
250 textOverflow: 'ellipsis',
251 overflow: 'hidden',
252 whiteSpace: 'nowrap'
253 })}>
254 <Text styles={style({font: 'ui-sm'})}>Name</Text>
255 </div>
256 </ListBoxItem>
257 );
258}
259
260export function IconSearchSkeleton() {
261 const mockItems = useMemo(() => Array.from({length: 140}, (_, i) => ({id: `skeleton-${i}`})), []);

Callers

nothing calls this directly

Calls 2

focusRingFunction · 0.90
iconStyleFunction · 0.90

Tested by

no test coverage detected