fui-fancyui
Version:
FancyUI Libary
33 lines (32 loc) • 1.16 kB
JavaScript
"use client";
import { jsx as r } from "react/jsx-runtime";
import { useState as p } from "react";
import u from "../../molecules/Fieldset/Fieldset.js";
import x from "../../organisms/FancyListBox/FancyListBox.js";
import h from "../../organisms/FancyRadio/FancyRadio.js";
import F from "../FancyFlexBox/FancyFlexBox.js";
function B(n) {
const { items: o, name: a, handler: i, themeType: l, layer: s, ...c } = n, [d, m] = p("1"), y = (e) => {
const t = o.find((f) => f.itemKey === e);
m(e), i == null || i(t == null ? void 0 : t.itemKey);
};
return (
// Give the list with the Fieldset a label
/* @__PURE__ */ r(u, { ...c, tabIndex: 0, children: /* @__PURE__ */ r(x, { role: "radiogroup", themeType: l, layer: s, sizeC: "sm", children: o.map((e, t) => /* @__PURE__ */ r(F, { justify: "flex-start", children: /* @__PURE__ */ r(
h,
{
name: a,
id: e.itemKey,
value: e.title,
label: e.title,
description: e.description,
checked: d === e.itemKey,
onChange: () => y(e.itemKey),
externalStyle: { width: "100%" }
}
) }, t)) }) })
);
}
export {
B as default
};