UNPKG

@crossed/demo

Version:

A universal & performant styling library for React Native, Next.js & React

55 lines (54 loc) 1.38 kB
import { jsx, jsxs } from "react/jsx-runtime"; import { styled } from "@crossed/styled"; import { Pressable } from "react-native"; const Button = styled(Pressable, { className: ["px-3 py-2", "border border-neutral-700", "bg-neutral-800"], props: { role: "button" }, variants: { rounded: { true: { className: ["rounded"] }, sm: { className: ["rounded-sm"] }, md: { className: ["rounded-md"] }, lg: { className: ["rounded-lg"] } }, variant: { filled: { className: ["bg-neutral-700"] } }, transparent: { true: { className: ["bg-transparent"] } } }, compoundVariants: [ { variant: "filled", // or variant: ["filled", ...] transparent: true, className: ["bg-neutral-700/50"] } ] }); const ButtonCompoundVariantsDemo = () => { return /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-5 justify-center bg-blue-500 p-5", children: [ /* @__PURE__ */ jsx(Button, { variant: "filled", children: "filled" }), /* @__PURE__ */ jsx(Button, { transparent: true, children: "transparent" }), /* @__PURE__ */ jsx(Button, { variant: "filled", transparent: true, children: "compound" }) ] }); }; export { ButtonCompoundVariantsDemo }; //# sourceMappingURL=CompoundVariants.js.map