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

Function Wrapper

packages/dev/s2-docs/src/VisualExampleClient.tsx:849–891  ·  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

847}
848
849function Wrapper({
850 control,
851 children,
852 styles,
853 ref
854}: {
855 control: PropControl;
856 children: ReactNode;
857 styles?: StyleString;
858 ref?: Ref<HTMLDivElement>;
859}) {
860 return (
861 <div
862 ref={ref}
863 className={mergeStyles(
864 style({display: 'flex', flexDirection: 'column', justifyContent: 'space-between'}),
865 styles
866 )}>
867 <span
868 className={style({
869 font: 'ui',
870 color: 'neutral-subdued',
871 display: 'flex',
872 paddingBottom: `calc((${size(32)} - 1lh) / 2)`
873 })}>
874 <span className={style({truncate: true})}>{control.name}</span>
875 <span className={style({whiteSpace: 'nowrap'})}>
876 &nbsp;
877 {control.description ? (
878 <CenterBaseline
879 styles={style({
880 display: 'inline-flex',
881 height: 0
882 })}>
883 <PropContextualHelp control={control} />
884 </CenterBaseline>
885 ) : null}
886 </span>
887 </span>
888 {children}
889 </div>
890 );
891}
892
893function PropContextualHelp({control}) {
894 if (!control.description) {

Callers

nothing calls this directly

Calls 2

mergeStylesFunction · 0.90
sizeFunction · 0.90

Tested by

no test coverage detected