@tohuhono/puck-blocks
Version:
A collection of puck components for building pages in OberonCMS
76 lines (75 loc) • 2.19 kB
JavaScript
import { jsx } from "react/jsx-runtime";
import { PuckRichText } from "@tohuhono/puck-rich-text";
import { Container } from "./blocks/container.js";
import { Dashboard } from "./dynamic/dashboard.js";
import { Welcome } from "./blocks/welcome.js";
import { CardsActivityGoal, CardsCalendar, CardsChat, CardsCookieSettings, CardsCreateAccount, CardsDataTable, CardsMetric, CardsPaymentMethod, CardsReportIssue, CardsShare, CardsStats, CardsTeamMembers } 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, {})
}
};
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: {
...PuckRichText,
render: (...props) => /* @__PURE__ */ jsx("div", { className: "prose p-1 dark:prose-invert lg:prose-lg", children: PuckRichText.render(...props) })
},
Dashboard: {
render: () => /* @__PURE__ */ jsx(Dashboard, {})
},
...cards
}
};
}
export {
withExamples
};