@base-framework/ui
Version:
This is a UI package that adds components and atoms that use Tailwind CSS and a theme based on Shadcn.
218 lines (217 loc) • 4.18 kB
JavaScript
import { Div as t, Header as n, H1 as d, P as o } from "@base-framework/atoms";
import { F as l, A as h } from "./aside-template-McEj_Gxc.js";
import { Component as x, Atom as i } from "@base-framework/base";
import { c as u, e as p } from "./mobile-nav-wrapper-BE_hr65B.js";
class c extends x {
/**
* This will declare the props for the compiler.
*
* @returns {void}
*/
declareProps() {
this.class = "";
}
/**
* This will render the page.
*
* @returns {object}
*/
render() {
return t({ class: `${this.class || ""}` }, this.children);
}
}
class a extends c {
/**
* This will be called every time the route
* is activated.
*
* @param {object} params
*/
update(s) {
}
}
class S extends a {
/**
* This will render the page.
*
* @returns {object}
*/
render() {
const s = this.class ? this.class : "pt-[80px] sm:pt-0";
return l([
t({ class: `flex flex-auto flex-col ${s}` }, this.children)
]);
}
}
class k extends a {
/**
* This will render the page.
*
* @returns {object}
*/
render() {
return l([
t({ class: "contained px-4 flex flex-auto flex-col" }, this.children)
]);
}
}
const r = i((e, s) => (e.class = "basic-page pt-[80px] sm:pt-0 flex flex-auto flex-col " + (e.class || ""), {
tag: "section",
...e,
children: s
}));
class w extends a {
/**
* This will render the page.
*
* @returns {object}
*/
render() {
return r([
l([
t({ class: "contained px-4 flex flex-auto flex-col" }, this.children)
])
]);
}
}
const f = i(({ title: e, description: s }) => n({ class: "sm:py-8 px-6 md:px-5 flex flex-col" }, [
d({ class: "scroll-m-20 text-3xl font-bold tracking-tight" }, e),
s && o({ class: "text-base text-muted-foreground py-2 max-w-[700px]" }, s)
]));
class F extends a {
/**
* This will declare the props for the compiler.
*
* @returns {void}
*/
declareProps() {
super.declareProps(), this.title = "", this.description = "";
}
/**
* This will render the page.
*
* @returns {object}
*/
render() {
return r([
f({
title: this.title,
description: this.description
}),
l(this.children)
]);
}
}
class B extends c {
/**
* This will render the page.
*
* @returns {object}
*/
render() {
const s = this.class ?? "";
return t({ class: `flex flex-col flex-auto ${s}` }, this.children);
}
}
class M extends a {
/**
* This will declare the props for the compiler.
*
* @returns {void}
*/
declareProps() {
super.declareProps(), this.routes = [], this.switch = [], this.links = [], this.title = "";
}
/**
* This will render the page.
*
* @returns {object}
*/
render() {
return r(
{
route: this.addRoutes()
},
[
h({
left: this.addSidebar(),
right: this.addBody()
})
]
);
}
/**
* This will add the routes.
*
* @returns {array}
*/
addRoutes() {
return this.routes || [];
}
/**
* This will add the sidebar of the page.
*
* @returns {object}
*/
addSidebar() {
return t({ class: "flex flex-auto flex-col" }, this.addNavigation());
}
/**
* This will add the body of the page.
*
* @returns {object}
*/
addBody() {
return t({ class: "flex flex-auto flex-col" }, [
{
class: "contained",
switch: this.addSwitch()
}
]);
}
/**
* This will add the switch of the page.
*
* @returns {array}
*/
addSwitch() {
return this.switch || [];
}
/**
* This will add the navigation of the page.
*
* @returns {object}
*/
addNavigation() {
const s = this.getLinks();
return [
u(
{
title: this.title,
options: s,
class: "hidden lg:block"
}
),
p({ title: this.title, options: s })
];
}
/**
* This will get the links.
*
* @returns {array}
*/
getLinks() {
return this.links || [];
}
}
export {
a as B,
k as C,
w as F,
r as M,
c as P,
M as S,
S as a,
F as b,
B as c
};