@primer/react
Version:
An implementation of GitHub's Primer Design System using React
102 lines (98 loc) • 2.33 kB
JavaScript
'use strict';
var reactCompilerRuntime = require('react-compiler-runtime');
var clsx = require('clsx');
var React = require('react');
var CounterLabel_module = require('./CounterLabel.module.css.js');
var BoxWithFallback = require('../internal/components/BoxWithFallback.js');
var jsxRuntime = require('react/jsx-runtime');
var VisuallyHidden = require('../VisuallyHidden/VisuallyHidden.js');
const CounterLabel = /*#__PURE__*/React.forwardRef((t0, forwardedRef) => {
const $ = reactCompilerRuntime.c(20);
let children;
let className;
let rest;
let t1;
if ($[0] !== t0) {
({
scheme: t1,
className,
children,
...rest
} = t0);
$[0] = t0;
$[1] = children;
$[2] = className;
$[3] = rest;
$[4] = t1;
} else {
children = $[1];
className = $[2];
rest = $[3];
t1 = $[4];
}
const scheme = t1 === undefined ? "secondary" : t1;
let t2;
if ($[5] !== children) {
t2 = /*#__PURE__*/jsxRuntime.jsxs(VisuallyHidden.VisuallyHidden, {
children: ["\xA0(", children, ")"]
});
$[5] = children;
$[6] = t2;
} else {
t2 = $[6];
}
const label = t2;
let t3;
if ($[7] !== forwardedRef || $[8] !== rest || $[9] !== scheme) {
t3 = {
ref: forwardedRef,
"aria-hidden": "true",
"data-scheme": scheme,
...rest
};
$[7] = forwardedRef;
$[8] = rest;
$[9] = scheme;
$[10] = t3;
} else {
t3 = $[10];
}
const counterProps = t3;
let t4;
if ($[11] !== className) {
t4 = clsx.clsx(className, CounterLabel_module.CounterLabel);
$[11] = className;
$[12] = t4;
} else {
t4 = $[12];
}
let t5;
if ($[13] !== children || $[14] !== counterProps || $[15] !== t4) {
t5 = /*#__PURE__*/jsxRuntime.jsx(BoxWithFallback.BoxWithFallback, {
as: "span",
...counterProps,
className: t4,
children: children
});
$[13] = children;
$[14] = counterProps;
$[15] = t4;
$[16] = t5;
} else {
t5 = $[16];
}
let t6;
if ($[17] !== label || $[18] !== t5) {
t6 = /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
children: [t5, label]
});
$[17] = label;
$[18] = t5;
$[19] = t6;
} else {
t6 = $[19];
}
return t6;
});
CounterLabel.displayName = 'CounterLabel';
module.exports = CounterLabel;