UNPKG

@crossed/demo

Version:

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

116 lines (115 loc) 4.68 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, { CreateInputSimpleDemo: () => CreateInputSimpleDemo }); 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 GroupFrame = (0, import_styled.styled)(import_react_native.Pressable, { "className": [ "bg-neutral-800", "border border-neutral-600", "flex flex-row", "rounded", "cursor-text", "w-full", "items-center", "overflow-hidden" ], "props": { focusable: false }, ":hover": { className: ["border-blue-500"] }, ":active": { className: ["border-blue-500"] }, ":focus": { className: ["border-blue-500"] } }); const InputFrame = (0, import_styled.styled)(import_react_native.TextInput, { className: [ "w-0 flex-1", "appearance-none", "bg-transparent", "outline-0", "!shadow-none", "ring-0", "ring-offset-transparent", "px-3 py-2" ] }); const AddonFrame = (0, import_styled.styled)(import_react_native.View, { className: ["bg-neutral-700", "px-3 py-2"] }); const ElementFrame = (0, import_styled.styled)(import_react_native.View, { className: ["px-3 py-2", "cursor-default"] }); const TextElementFrame = (0, import_styled.styled)(import_react_native.Text, { className: ["cursor-default"] }); const Input = (0, import_primitive.createInput)({ Group: GroupFrame, Addon: AddonFrame, Element: ElementFrame, Input: InputFrame }); const CreateInputSimpleDemo = () => { return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_ui.YBox, { space: "md", className: "w-1/2", children: [ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Input, {}), /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(Input.Group, { children: [ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Input.Element, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(TextElementFrame, { children: "\u{1F44C}" }) }), /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Input, {}) ] }), /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(Input.Group, { children: [ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Input.Addon, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(TextElementFrame, { children: "\u{1F44C}" }) }), /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Input, {}) ] }), /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(Input.Group, { children: [ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Input, {}), /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Input.Element, { className: "p-0 pr-1", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)( import_ui.Button, { "aria-label": "more", size: "xs", variant: "filled", onPress: () => console.log("dans la demo"), children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ui.Button.Text, { children: "More" }) } ) }) ] }), /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(Input.Group, { children: [ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Input.Addon, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(TextElementFrame, { children: "\u{1F44C}" }) }), /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Input, {}), /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Input.Element, { className: "p-0 pr-1", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ui.Button, { "aria-label": "more", size: "xs", variant: "filled", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ui.Button.Text, { children: "More" }) }) }) ] }) ] }); }; // Annotate the CommonJS export names for ESM import in node: 0 && (module.exports = { CreateInputSimpleDemo }); //# sourceMappingURL=simple.js.map