UNPKG

@kopexa/sight

Version:

Kopexa Sight Design System — React component library for GRC applications

45 lines (42 loc) 1.4 kB
"use client"; import { RadioCardItemBase, RadioCardItemContent, RadioCardItemControl, RadioCardItemDescription, RadioCardItemHiddenInput, RadioCardItemIndicator, RadioCardItemText } from "./chunk-42DSX4RZ.mjs"; // src/components/radio-card/radio-card-item.tsx import { Fragment } from "react"; import { jsx, jsxs } from "react/jsx-runtime"; var RadioCardItem = (props) => { const { inputProps, label, description, icon, indicator = /* @__PURE__ */ jsx(RadioCardItemIndicator, {}), indicatorPlacement = "start", ...restProps } = props; const hasContent = label || description || icon; const ContentWrapper = indicator ? RadioCardItemContent : Fragment; return /* @__PURE__ */ jsxs(RadioCardItemBase, { ...restProps, children: [ /* @__PURE__ */ jsx(RadioCardItemHiddenInput, { ...inputProps }), /* @__PURE__ */ jsxs(RadioCardItemControl, { children: [ indicatorPlacement === "start" && indicator, hasContent ? /* @__PURE__ */ jsxs(ContentWrapper, { children: [ icon, label ? /* @__PURE__ */ jsx(RadioCardItemText, { children: label }) : null, description ? /* @__PURE__ */ jsx(RadioCardItemDescription, { children: description }) : null, indicatorPlacement === "inside" && indicator ] }) : null, indicatorPlacement === "end" && indicator ] }) ] }); }; export { RadioCardItem };