UNPKG

welcome-ui

Version:

Customizable design system with react, typescript, tailwindcss and ariakit.

64 lines (63 loc) 1.72 kB
"use client"; import './Radio.css'; import { jsxs as l, jsx as a } from "react/jsx-runtime"; import { R as f } from "./5TKKKQCL-rs260p95.js"; import { forwardRef as w } from "react"; import { Hint as N } from "./Hint.js"; import { Label as v } from "./Label.js"; import { c as R } from "./index-B6iGEm-i.js"; const b = "_root_19ehe_2", x = "_input_19ehe_8", $ = "_hint_19ehe_81", g = { root: b, "input-wrapper": "_input-wrapper_19ehe_8", input: x, "variant-danger": "_variant-danger_19ehe_47", "label-with-hint": "_label-with-hint_19ehe_77", hint: $ }, t = R(g), j = w( ({ className: p, dataTestId: i, disabled: c, hint: e, label: r, onChange: n, onClick: s, value: h, variant: d = "default", ...m }, _) => { const u = (o) => { o.stopPropagation(), s && s(o), n && n(o); }; return /* @__PURE__ */ l(v, { className: t("root", p), onClick: u, children: [ /* @__PURE__ */ a("div", { className: t("input-wrapper"), children: /* @__PURE__ */ a( f, { "aria-label": r, className: t("input", `variant-${d}`), "data-testid": i, disabled: c, ref: _, value: h, ...m } ) }), r ? /* @__PURE__ */ l("div", { className: t("label-with-hint"), children: [ /* @__PURE__ */ a("div", { "data-testid": i ? `${i}-label` : void 0, children: r }), e ? /* @__PURE__ */ a( N, { className: t("hint"), "data-testid": i ? `${i}-hint` : void 0, children: e } ) : null ] }) : null ] }); } ); j.displayName = "Radio"; export { j as Radio, g as radioClasses };