@crossed/demo
Version:
A universal & performant styling library for React Native, Next.js & React
78 lines (77 loc) • 3.23 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, {
CreateListSimpleDemo: () => CreateListSimpleDemo
});
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 List = (0, import_primitive.createList)({
Root: (props) => {
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
"ul",
{
...props,
className: (0, import_styled.merge)(
"flex flex-col border border-neutral-800 rounded-md",
props.className
)
}
);
},
Item: (props) => {
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("li", { ...props, className: (0, import_styled.merge)("px-3 py-2", props.className) });
},
SubTitle: (props) => {
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
"div",
{
...props,
className: (0, import_styled.merge)("text-sm text-neutral-500", props.className)
}
);
},
Title: (props) => {
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { ...props, className: (0, import_styled.merge)("font-bold", props.className) });
}
});
const CreateListSimpleDemo = () => {
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ui.YBox, { space: "md", children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(List, { children: [
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(List.Item, { children: [
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(List.Title, { children: "Number 1" }),
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(List.SubTitle, { children: "Description Number 1" })
] }),
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(List.Item, { children: [
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(List.Title, { children: "Number 2" }),
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(List.SubTitle, { children: "Description 2" })
] }),
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(List.Item, { children: [
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(List.Title, { children: "Number 3" }),
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(List.SubTitle, { children: "Number 3 have description" })
] })
] }) });
};
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
CreateListSimpleDemo
});
//# sourceMappingURL=simple.js.map