@primer/react
Version:
An implementation of GitHub's Primer Design System using React
40 lines (37 loc) • 999 B
JavaScript
import { c } from 'react-compiler-runtime';
import { useFormControlContext } from './_FormControlContext.js';
import classes from './FormControlLeadingVisual.module.css.js';
import { jsx } from 'react/jsx-runtime';
const FormControlLeadingVisual = t0 => {
const $ = c(5);
const {
children,
style
} = t0;
const {
disabled,
captionId
} = useFormControlContext();
const t1 = disabled ? "" : undefined;
const t2 = captionId ? "" : undefined;
let t3;
if ($[0] !== children || $[1] !== style || $[2] !== t1 || $[3] !== t2) {
t3 = /*#__PURE__*/jsx("div", {
className: classes.LeadingVisual,
"data-control-disabled": t1,
style: style,
"data-has-caption": t2,
children: children
});
$[0] = children;
$[1] = style;
$[2] = t1;
$[3] = t2;
$[4] = t3;
} else {
t3 = $[4];
}
return t3;
};
FormControlLeadingVisual.__SLOT__ = Symbol('FormControl.LeadingVisual');
export { FormControlLeadingVisual as default };