welcome-ui
Version:
Customizable design system with react, typescript, tailwindcss and ariakit.
64 lines (63 loc) • 1.77 kB
JavaScript
"use client";
import { jsxs as d, jsx as t } from "react/jsx-runtime";
import { R as f } from "./SQZLCNLX-cijaITUa.js";
import { forwardRef as u } from "react";
import { Hint as y } from "./Hint.js";
import { Label as w } from "./Label.js";
import { c as b } from "./index-PAaZGbyz.js";
const v = "_root_1xy64_2", N = "_input_1xy64_8", R = "_disabled_1xy64_34", g = "_hint_1xy64_69", $ = {
root: v,
"input-wrapper": "_input-wrapper_1xy64_8",
input: N,
disabled: R,
"variant-danger": "_variant-danger_1xy64_38",
"variant-warning": "_variant-warning_1xy64_41",
"label-with-hint": "_label-with-hint_1xy64_65",
hint: g
}, a = b($), j = u(
({
className: _,
dataTestId: i,
disabled: n,
hint: o,
label: s,
onChange: l,
onClick: e,
value: c,
variant: p = "default",
...m
}, h) => {
const x = (r) => {
r.stopPropagation(), e && e(r), l && l(r);
};
return /* @__PURE__ */ d(w, { className: a("root", _), onClick: x, children: [
/* @__PURE__ */ t("div", { className: a("input-wrapper"), children: /* @__PURE__ */ t(
f,
{
"aria-label": s,
className: a("input", `variant-${p}`, n && "disabled"),
"data-testid": i,
disabled: n,
ref: h,
value: c,
...m
}
) }),
/* @__PURE__ */ d("div", { className: a("label-with-hint"), children: [
/* @__PURE__ */ t("div", { "data-testid": i ? `${i}-label` : void 0, children: s }),
o ? /* @__PURE__ */ t(
y,
{
className: a("hint"),
"data-testid": i ? `${i}-hint` : void 0,
children: o
}
) : null
] })
] });
}
);
j.displayName = "Radio";
export {
j as Radio
};