UNPKG

@crossed/demo

Version:

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

41 lines (40 loc) 1.11 kB
import { jsx, jsxs } from "react/jsx-runtime"; import { createLabel } from "@crossed/primitive"; import { styled } from "@crossed/styled"; import { YBox } from "@crossed/ui"; import { Text, TextInput, View } from "react-native"; const Input = styled(TextInput, { "className": [ "bg-neutral-800", "border border-neutral-600", "flex flex-1", "rounded", "cursor-text", "w-full", "px-3 py-2" ], ":focus": { className: ["border-blue-600"] }, ":hover": { className: ["border-blue-600"] } }); const TextLabel = styled(Text, { className: [], props: { as: "label" } }); const Label = createLabel({ Root: View, Text: TextLabel }); const CreateLabelSimpleNativeDemo = () => { return /* @__PURE__ */ jsx(YBox, { space: "md", children: /* @__PURE__ */ jsxs(Label, { children: [ /* @__PURE__ */ jsx(Label.Text, { "aria-label": "Input", children: "Input" }), /* @__PURE__ */ jsx(Label.Input, { children: /* @__PURE__ */ jsx(Input, { placeholder: "toto" }) }) ] }) }); }; export { CreateLabelSimpleNativeDemo }; //# sourceMappingURL=simple.native.js.map