MCPcopy Index your code
hub / github.com/adobe/react-spectrum / Wrapper

Function Wrapper

packages/dev/s2-docs/src/VisualExampleClient.tsx:832–874  ·  view source on GitHub ↗
({
  control,
  children,
  styles,
  ref
}: {
  control: PropControl;
  children: ReactNode;
  styles?: StyleString;
  ref?: Ref<HTMLDivElement>;
})

Source from the content-addressed store, hash-verified

830}
831
832function Wrapper({
833 control,
834 children,
835 styles,
836 ref
837}: {
838 control: PropControl;
839 children: ReactNode;
840 styles?: StyleString;
841 ref?: Ref<HTMLDivElement>;
842}) {
843 return (
844 <div
845 ref={ref}
846 className={mergeStyles(
847 style({display: 'flex', flexDirection: 'column', justifyContent: 'space-between'}),
848 styles
849 )}>
850 <span
851 className={style({
852 font: 'ui',
853 color: 'neutral-subdued',
854 display: 'flex',
855 paddingBottom: `calc((${size(32)} - 1lh) / 2)`
856 })}>
857 <span className={style({truncate: true})}>{control.name}</span>
858 <span className={style({whiteSpace: 'nowrap'})}>
859 &nbsp;
860 {control.description ? (
861 <CenterBaseline
862 styles={style({
863 display: 'inline-flex',
864 height: 0
865 })}>
866 <PropContextualHelp control={control} />
867 </CenterBaseline>
868 ) : null}
869 </span>
870 </span>
871 {children}
872 </div>
873 );
874}
875
876function PropContextualHelp({control}) {
877 if (!control.description) {

Callers

nothing calls this directly

Calls 2

mergeStylesFunction · 0.90
sizeFunction · 0.90

Tested by

no test coverage detected