UNPKG

@crossed/demo

Version:

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

58 lines (57 loc) 2.34 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_exports = {}; __export(simple_exports, { CreateButtonDemo: () => CreateButtonDemo }); module.exports = __toCommonJS(simple_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: (0, import_styled.styled)(import_react_native.Pressable, {}), Root: (props) => { return /* @__PURE__ */ (0, import_jsx_runtime.jsx)( "button", { className: "flex flex-row items-center bg-blue-500 px-3 py-2 hover:bg-blue-400 gap-2 rounded", ...props } ); }, Text: (props) => { return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "text-white", ...props }); }, Element: (props) => { return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { ...props }); } }); const CreateButtonDemo = () => { 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 = { CreateButtonDemo }); //# sourceMappingURL=simple.js.map