| 211 | } |
| 212 | |
| 213 | export 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 | |
| 260 | export function IconSearchSkeleton() { |
| 261 | const mockItems = useMemo(() => Array.from({length: 140}, (_, i) => ({id: `skeleton-${i}`})), []); |