@primer/react-brand
Version:
Primer Brand is a GitHub's design system for creating React-based marketing websites and digital experiences.
39 lines (38 loc) • 1.38 kB
JavaScript
import e from "../../node_modules/clsx/dist/clsx.js";
import { useId as t } from "../../hooks/useId.js";
import { useProvidedRefOrCreate as n } from "../../hooks/useRef.js";
import '../../packages/design-tokens/lib/design-tokens/css/tokens/functional/components/control/colors-with-modes-C05YPRXo.css';/* empty css */
import r from "./Radio.module.js";
import { forwardRef as i, useCallback as a } from "react";
import { jsx as o, jsxs as s } from "react/jsx-runtime";
var c = i(({ checked: i, className: c, disabled: l, id: u, onChange: d, required: f, value: p, ...m }, h) => {
let g = n(h || null), _ = t(u), v = a(() => {
!l && g.current && g.current.click();
}, [l, g]);
return /* @__PURE__ */ s("span", {
className: r["Radio-wrapper"],
children: [/* @__PURE__ */ o("input", {
id: _,
"aria-checked": i ? "true" : "false",
checked: i,
className: e(r["Radio-input"]),
disabled: l,
name: p,
onChange: d,
ref: g,
required: f,
type: "radio",
value: p,
...m
}), /* @__PURE__ */ o("span", {
className: e(r.Radio, c),
onClick: v,
tabIndex: -1,
"aria-hidden": "true",
children: /* @__PURE__ */ o("span", { className: r["Radio-dot"] })
})]
});
});
//#endregion
export { c as Radio };
//# sourceMappingURL=Radio.js.map