@crossed/demo
Version:
A universal & performant styling library for React Native, Next.js & React
66 lines (65 loc) • 3.86 kB
JavaScript
;
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, {
CreateLabelSimpleDemo: () => CreateLabelSimpleDemo
});
module.exports = __toCommonJS(simple_exports);
var import_jsx_runtime = require("react/jsx-runtime");
var import_styled = require("@crossed/styled");
var import_primitive = require("@crossed/primitive");
var import_ui = require("@crossed/ui");
const Label = (0, import_primitive.createLabel)({
Root: (props) => {
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { ...props, className: (0, import_styled.merge)("flex flex-col", props.className) });
},
Text: (props) => {
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("label", { ...props, className: (0, import_styled.merge)("flex flex-col", props.className) });
}
});
const CreateLabelSimpleDemo = () => {
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_ui.YBox, { space: "md", children: [
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(Label, { children: [
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(Label.Text, { "aria-label": "Input", children: "Input" }),
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(Label.Input, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("input", { type: "text", className: "border border-neutral-800" }) })
] }),
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(Label, { children: [
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(Label.Text, { "aria-label": "Select", children: "Select" }),
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(Label.Input, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("select", { className: "border border-neutral-800", children: [
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("option", { value: "Integer consequat", children: "Integer consequat" }),
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("option", { value: "Maecenas sed sem", children: "Maecenas sed sem" }),
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("option", { value: "Vestibulum lacinia", children: "Vestibulum lacinia" }),
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("option", { value: "Quisque ornare", children: "Quisque ornare" })
] }) })
] }),
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(Label, { className: "flex-row gap-2", children: [
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(Label.Input, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("input", { type: "checkbox" }) }),
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(Label.Text, { "aria-label": "Checkbox", children: "Checkbox" })
] }),
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(Label, { className: "flex-row gap-2", children: [
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(Label.Input, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("input", { type: "radio" }) }),
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(Label.Text, { "aria-label": "Radio", children: "Radio" })
] })
] });
};
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
CreateLabelSimpleDemo
});
//# sourceMappingURL=simple.js.map