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

Function ExpandableRowChevron

packages/@react-spectrum/s2/src/TreeView.tsx:786–820  ·  view source on GitHub ↗
(props: ExpandableRowChevronProps)

Source from the content-addressed store, hash-verified

784});
785
786function ExpandableRowChevron(props: ExpandableRowChevronProps) {
787 let expandButtonRef = useRef<HTMLButtonElement>(null);
788 let [fullProps, ref] = useContextProps(
789 {...props, slot: 'chevron'},
790 expandButtonRef,
791 ButtonContext
792 );
793 let {isExpanded, scale, isHidden} = fullProps;
794 let {direction} = useLocale();
795
796 return (
797 <Button
798 {...props}
799 ref={ref}
800 slot="chevron"
801 className={renderProps =>
802 expandButton({...renderProps, isExpanded, isRTL: direction === 'rtl', scale, isHidden})
803 }>
804 <Chevron
805 className={style({
806 scale: {
807 direction: {
808 ltr: '1',
809 rtl: '-1'
810 }
811 },
812 '--iconPrimary': {
813 type: 'fill',
814 value: 'currentColor'
815 }
816 })({direction})}
817 />
818 </Button>
819 );
820}
821
822function isNextSelected(id: Key | undefined, state: TreeState<unknown>) {
823 if (id == null || !state) {

Callers

nothing calls this directly

Calls 2

useLocaleFunction · 0.90
useContextPropsFunction · 0.85

Tested by

no test coverage detected