UNPKG

@crossed/demo

Version:

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

57 lines (56 loc) 2.4 kB
"use strict"; var __defProp = Object.defineProperty; var __getOwnPropDesc = Object.getOwnPropertyDescriptor; var __getOwnPropNames = Object.getOwnPropertyNames; var __hasOwnProp = Object.prototype.hasOwnProperty; var __export = (target, all) => { for (var name in all) __defProp(target, name, { get: all[name], enumerable: true }); }; var __copyProps = (to, from, except, desc) => { if (from && typeof from === "object" || typeof from === "function") { for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); } return to; }; var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); var simple_native_exports = {}; __export(simple_native_exports, { CreateButtonNativeDemo: () => CreateButtonNativeDemo }); module.exports = __toCommonJS(simple_native_exports); var import_jsx_runtime = require("react/jsx-runtime"); var import_primitive = require("@crossed/primitive"); var import_styled = require("@crossed/styled"); var import_ui = require("@crossed/ui"); var import_react_native = require("react-native"); const Button = (0, import_primitive.createButton)({ Group: import_react_native.View, Root: (0, import_styled.styled)(import_react_native.Pressable, { "className": [ "flex flex-row items-center", "bg-blue-500", "rounded", "px-3 py-2", "gap-2" ], ":hover": { className: ["bg-blue-400"] } }), Text: (0, import_styled.styled)(import_react_native.Text, { className: ["text-base text-white"] }), Element: (props) => { return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react_native.Text, { ...props, style: [{ color: "white" }, props.style] }); } }); const CreateButtonNativeDemo = () => { return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ui.Box, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(Button, { "aria-label": "Button text", children: [ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Button.Element, { children: "\u20AC" }), /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Button.Text, { children: "text button" }) ] }) }); }; // Annotate the CommonJS export names for ESM import in node: 0 && (module.exports = { CreateButtonNativeDemo }); //# sourceMappingURL=simple.native.js.map