@tohuhono/puck-blocks
Version:
A collection of puck components for building pages in OberonCMS
91 lines (90 loc) • 2.41 kB
JavaScript
import { jsx } from "react/jsx-runtime";
import { defineOberonComponent } from "@oberoncms/core";
import { Container } from "./blocks/container.js";
import { Dashboard } from "./dynamic/dashboard.js";
import { Welcome } from "./blocks/welcome.js";
import { CardsTeamMembers, CardsStats, CardsShare, CardsReportIssue, CardsPaymentMethod, CardsMetric, CardsDataTable, CardsCreateAccount, CardsCookieSettings, CardsChat, CardsCalendar, CardsActivityGoal } from "./dynamic/cards.js";
const cards = {
"Activity Goal": {
render: () => /* @__PURE__ */ jsx(CardsActivityGoal, {})
},
Calendar: {
render: () => /* @__PURE__ */ jsx(CardsCalendar, {})
},
Chat: {
render: () => /* @__PURE__ */ jsx(CardsChat, {})
},
"Cookie Settings": {
render: () => /* @__PURE__ */ jsx(CardsCookieSettings, {})
},
"Create Account": {
render: () => /* @__PURE__ */ jsx(CardsCreateAccount, {})
},
"Data Table": {
render: () => /* @__PURE__ */ jsx(CardsDataTable, {})
},
Metric: {
render: () => /* @__PURE__ */ jsx(CardsMetric, {})
},
"Payment Method": {
render: () => /* @__PURE__ */ jsx(CardsPaymentMethod, {})
},
"Report Issue": {
render: () => /* @__PURE__ */ jsx(CardsReportIssue, {})
},
Share: {
render: () => /* @__PURE__ */ jsx(CardsShare, {})
},
Stats: {
render: () => /* @__PURE__ */ jsx(CardsStats, {})
},
"Team Members": {
render: () => /* @__PURE__ */ jsx(CardsTeamMembers, {})
}
};
const Text = defineOberonComponent({
fields: {
text: {
type: "textarea",
contentEditable: true
},
className: {
type: "text"
}
},
defaultProps: {
className: "prose dark:prose-invert lg:prose-lg p-2"
},
render: ({ text, className }) => /* @__PURE__ */ jsx("div", { className, children: text })
});
function withExamples(config) {
return {
version: 1,
...config,
categories: {
other: { title: "Examples", defaultExpanded: true },
...config.categories,
cards: {
title: "Cards",
defaultExpanded: false,
components: Object.keys(cards)
}
},
components: {
...config.components,
Welcome,
Container,
Text: {
...Text,
transforms: [(props) => props]
},
Dashboard: {
render: () => /* @__PURE__ */ jsx(Dashboard, {})
},
...cards
}
};
}
export {
withExamples
};