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

Function HiddenTabs

packages/@react-spectrum/s2/src/Tabs.tsx:637–677  ·  view source on GitHub ↗
(props: {
  listRef: RefObject<HTMLDivElement | null>;
  items: Array<Node<any>>;
  size?: string;
  density?: 'compact' | 'regular';
})

Source from the content-addressed store, hash-verified

635const HiddenTabsContext = createContext(false);
636
637let HiddenTabs = function (props: {
638 listRef: RefObject<HTMLDivElement | null>;
639 items: Array<Node<any>>;
640 size?: string;
641 density?: 'compact' | 'regular';
642}) {
643 let {listRef, items = [], size, density} = props;
644
645 return (
646 <div
647 // @ts-ignore
648 inert={inertValue(true)}
649 ref={listRef}
650 className={style({
651 display: 'inherit',
652 flexDirection: 'inherit',
653 gap: 'inherit',
654 flexWrap: 'inherit',
655 position: 'absolute',
656 inset: 0,
657 visibility: 'hidden',
658 overflow: 'hidden',
659 opacity: 0
660 })}>
661 <HiddenTabsContext.Provider value>
662 {items.map(item => {
663 // pull off individual props as an allow list, don't want refs or other props getting through
664 return (
665 <div
666 data-hidden-tab
667 style={item.props.UNSAFE_style}
668 key={item.key}
669 className={item.props.className({size, density})}>
670 {item.props.children({size, density})}
671 </div>
672 );
673 })}
674 </HiddenTabsContext.Provider>
675 </div>
676 );
677};
678
679let TabsMenu = (
680 props: {

Callers

nothing calls this directly

Calls 1

inertValueFunction · 0.90

Tested by

no test coverage detected