UNPKG

@crossed/demo

Version:

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

40 lines (39 loc) 1.27 kB
import { jsx, jsxs } from "react/jsx-runtime"; import { styled } from "@crossed/styled"; import { memo } from "react"; import { Pressable } from "react-native"; const Button = styled(Pressable, { "className": ["px-3 py-2", "border border-neutral-700", "bg-neutral-800"], "props": { role: "button" }, ":hover": { className: ["bg-neutral-700"] }, ":focus": { className: ["!outline-1", "!outline-blue-500"] }, ":active": { className: ["bg-neutral-900"] }, ":disabled": { className: ["opacity-50"] } }); const Other = memo((props) => { return /* @__PURE__ */ jsx("button", { ...props }); }); Other.displayName = "Pressable"; const ButtonStateDemo = () => { return /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-5 justify-center p-5", children: [ /* @__PURE__ */ jsx(Button, { children: "Hover or Press" }), /* @__PURE__ */ jsx(Button, { disabled: true, children: "Disabled" }), /* @__PURE__ */ jsx(Button, { states: { isHover: true }, children: "hover" }), /* @__PURE__ */ jsx(Button, { states: { isFocus: true }, children: "focus" }), /* @__PURE__ */ jsx(Button, { states: { isActive: true }, children: "active" }) ] }); }; export { ButtonStateDemo }; //# sourceMappingURL=State.js.map