UNPKG

@primer/react

Version:

An implementation of GitHub's Primer Design System using React

68 lines (65 loc) 1.38 kB
import { c } from 'react-compiler-runtime'; import classes from './_VisuallyHidden.module.css.js'; import { clsx } from 'clsx'; import { BoxWithFallback } from './internal/components/BoxWithFallback.js'; import { jsx } from 'react/jsx-runtime'; function VisuallyHidden(t0) { const $ = c(14); let children; let className; let isVisible; let rest; let t1; if ($[0] !== t0) { ({ isVisible, children, as: t1, className, ...rest } = t0); $[0] = t0; $[1] = children; $[2] = className; $[3] = isVisible; $[4] = rest; $[5] = t1; } else { children = $[1]; className = $[2]; isVisible = $[3]; rest = $[4]; t1 = $[5]; } const as = t1 === undefined ? "span" : t1; const t2 = !isVisible; let t3; if ($[6] !== className || $[7] !== t2) { t3 = clsx(className, { [classes.InternalVisuallyHidden]: t2 }); $[6] = className; $[7] = t2; $[8] = t3; } else { t3 = $[8]; } let t4; if ($[9] !== as || $[10] !== children || $[11] !== rest || $[12] !== t3) { t4 = /*#__PURE__*/jsx(BoxWithFallback, { as: as, className: t3, ...rest, children: children }); $[9] = as; $[10] = children; $[11] = rest; $[12] = t3; $[13] = t4; } else { t4 = $[13]; } return t4; } export { VisuallyHidden as default };