@roochnetwork/rooch-sdk-kit
Version:
Rooch SDK Kit
94 lines (86 loc) • 3.82 kB
JavaScript
// src/components/ui/Card.css.ts
var card = "Card_card__1bu3cob0";
var cardBody = "Card_cardBody__1bu3cob4";
var cardFooter = "Card_cardFooter__1bu3cob5";
var cardHeader = "Card_cardHeader__1bu3cob1";
// src/components/ui/Text.tsx
import { Slot } from "@radix-ui/react-slot";
import clsx from "clsx";
import { forwardRef } from "react";
// src/components/ui/Text.css.ts
import { createRuntimeFn as _7a468 } from "@vanilla-extract/recipes/createRuntimeFn";
var textVariants = _7a468({ defaultClassName: "Text__1utg4wj0", variantClassNames: { size: { sm: "Text_textVariants_size_sm__1utg4wj1" }, weight: { normal: "Text_textVariants_weight_normal__1utg4wj2", medium: "Text_textVariants_weight_medium__1utg4wj3", bold: "Text_textVariants_weight_bold__1utg4wj4" }, color: { muted: "Text_textVariants_color_muted__1utg4wj5", danger: "Text_textVariants_color_danger__1utg4wj6", warning: "Text_textVariants_color_warning__1utg4wj7" }, mono: { true: "Text_textVariants_mono_true__1utg4wj8" } }, defaultVariants: { size: "sm", weight: "normal" }, compoundVariants: [] });
// src/components/ui/Text.tsx
import { jsx } from "react/jsx-runtime";
var Text = forwardRef(
({
children,
className,
asChild = false,
as: Tag = "div",
size,
weight,
color,
mono,
...textProps
}, forwardedRef) => {
return /* @__PURE__ */ jsx(
Slot,
{
...textProps,
ref: forwardedRef,
className: clsx(textVariants({ size, weight, color, mono }), className),
children: asChild ? children : /* @__PURE__ */ jsx(Tag, { children })
}
);
}
);
Text.displayName = "Text";
// src/components/ui/Heading.tsx
import { Slot as Slot2 } from "@radix-ui/react-slot";
import clsx2 from "clsx";
import { forwardRef as forwardRef2 } from "react";
// src/components/ui/Heading.css.ts
import { createRuntimeFn as _7a4682 } from "@vanilla-extract/recipes/createRuntimeFn";
var headingVariants = _7a4682({ defaultClassName: "Heading__1v58k1t0", variantClassNames: { size: { sm: "Heading_headingVariants_size_sm__1v58k1t1", md: "Heading_headingVariants_size_md__1v58k1t2", lg: "Heading_headingVariants_size_lg__1v58k1t3", xl: "Heading_headingVariants_size_xl__1v58k1t4" }, weight: { normal: "Heading_headingVariants_weight_normal__1v58k1t5", bold: "Heading_headingVariants_weight_bold__1v58k1t6" }, truncate: { true: "Heading_headingVariants_truncate_true__1v58k1t7" } }, defaultVariants: { size: "lg", weight: "bold" }, compoundVariants: [] });
// src/components/ui/Heading.tsx
import { jsx as jsx2 } from "react/jsx-runtime";
var Heading = forwardRef2(
({
children,
className,
asChild = false,
as: Tag = "h1",
size,
weight,
truncate,
...headingProps
}, forwardedRef) => {
return /* @__PURE__ */ jsx2(
Slot2,
{
...headingProps,
ref: forwardedRef,
className: clsx2(headingVariants({ size, weight, truncate }), className),
children: asChild ? children : /* @__PURE__ */ jsx2(Tag, { children })
}
);
}
);
Heading.displayName = "Heading";
// src/components/ui/Card.tsx
import { jsx as jsx3, jsxs } from "react/jsx-runtime";
function Card({ header, headerRight, children, footer }) {
return /* @__PURE__ */ jsxs("div", { className: card, children: [
(header || headerRight) && /* @__PURE__ */ jsxs("div", { className: cardHeader, children: [
/* @__PURE__ */ jsx3(Heading, { as: "h3", size: "sm", weight: "normal", children: header }),
headerRight && /* @__PURE__ */ jsx3(Text, { weight: "medium", color: "muted", children: headerRight })
] }),
/* @__PURE__ */ jsx3("div", { className: cardBody, children }),
footer && /* @__PURE__ */ jsx3("div", { className: cardFooter, children: footer })
] });
}
export {
Card
};
//# sourceMappingURL=Card.js.map