@cerberus-design/react
Version:
The Cerberus Design React component library.
36 lines (34 loc) • 1.06 kB
JavaScript
import {
RatingParts
} from "./chunk-YWPXLHUO.js";
import {
Show
} from "./chunk-NUXMADXV.js";
import {
splitProps
} from "./chunk-BL7G3577.js";
// src/components/rating/rating.tsx
import { jsx, jsxs } from "react/jsx-runtime";
function Rating(props) {
const [{ label }, styleProps, rootProps] = splitProps(
props,
["label"],
["orientation", "palette", "size"]
);
return /* @__PURE__ */ jsxs(RatingParts.Root, { ...styleProps, ...rootProps, children: [
/* @__PURE__ */ jsx(Show, { when: label, children: /* @__PURE__ */ jsx(RatingParts.Label, { children: label }) }),
/* @__PURE__ */ jsx(RatingParts.Control, { children: /* @__PURE__ */ jsx(RatingParts.Context, { children: (context) => context.items.map((item) => /* @__PURE__ */ jsx(
RatingParts.Item,
{
index: item,
palette: styleProps.palette,
children: /* @__PURE__ */ jsx(RatingParts.ItemContext, { children: rootProps.children })
},
item
)) }) })
] });
}
export {
Rating
};
//# sourceMappingURL=chunk-OX3NA6DQ.js.map