waibu-blu 1.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 Ardhi Lukianto
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1 @@
1
+ # waibu-blu
@@ -0,0 +1,9 @@
1
+ async function waibuMpaAfterBuildLocals ({ menu, _meta }) {
2
+ const { findIndex } = this.lib._
3
+ if (menu && menu.pages && !['/component/render'].includes(_meta.url)) {
4
+ const idx = findIndex(menu.pages, { title: 'account' })
5
+ if (idx > -1) menu.pages.splice(idx, 1)
6
+ }
7
+ }
8
+
9
+ export default waibuMpaAfterBuildLocals
@@ -0,0 +1 @@
1
+ <c:breadcrumb auto-detect margin="bottom-3"/>
@@ -0,0 +1,14 @@
1
+ <c:container class="footer">
2
+ <c:grid-row margin="y-5">
3
+ <c:grid-col col="6-md">
4
+ &copy; 2025 <a href="/"><%= _meta.site.orgName %></a>
5
+ </c:grid-col>
6
+ <c:grid-col col="6-md">
7
+ <c:div flex="justify-content:end">
8
+ <a href="https://maritime.rapp.id">
9
+ <c:img src="waibuMpa:/logo/main?type=full<%= _meta.darkMode ? '-light' : '' %>" height="20" />
10
+ </a>
11
+ </c:div>
12
+ </c:grid-col>
13
+ </c:grid-row>
14
+ </c:container>
@@ -0,0 +1,21 @@
1
+ <c:div class="header" position="type:sticky-top" margin="bottom-4">
2
+ <c:container>
3
+ <c:navbar expandable>
4
+ <a href="/" class="navbar-brand" >
5
+ <c:img src="waibuMpa:/logo/main?type=med-light" height="40" display="type:none type:block-md"/>
6
+ <c:img src="waibuMpa:/logo/main?type=light" height="50" display="type:none-md"/>
7
+ </a>
8
+ <c:nav tag="ul">
9
+ </c:nav>
10
+ <c:nav tag="ul" dim="width:100" flex="justify-content:end">
11
+ <% if (_meta.isAdmin) { %>
12
+ <c:btn color="danger" href="waibuAdmin:/" t:content="adminArea" margin="end-3"/>
13
+ <% } %>
14
+ <c:nav-toggle-fullscreen text="color:light" />
15
+ <c:nav-dropdown-darkmode dropdown-menudir="end" text="color:light" />
16
+ <c:nav-dropdown-language dropdown-menudir="end" text="color:light"/>
17
+ </c:nav>
18
+ </c:navbar>
19
+ <!-- include main.partial:/main-navbar.html -->
20
+ </c:container>
21
+ </c:div>
@@ -0,0 +1,24 @@
1
+ <c:navbar class="main-navbar" rounded border shadow="sm" style="top:20px" margin="bottom-5">
2
+ <c:nav tag="ul">
3
+ <% for (const cat of menu.pages) { %>
4
+ <% if (cat.children) { %>
5
+ <c:nav-item t:content="<%= cat.title %>" dropdown>
6
+ <% for (const child of cat.children) { %>
7
+ <% if (child.visible === 'anon' && _meta.user) continue %>
8
+ <% if (child.visible === 'auth' && !_meta.user) continue %>
9
+ <% if (child.title === '-') { %>
10
+ <c:dropdown-item divider />
11
+ <% } else { %>
12
+ <c:dropdown-item href="<%= child.href %>" t:content="<%= child.title %>" />
13
+ <% } %>
14
+ <% } %>
15
+ </c:nav-item>
16
+ <% } else { %>
17
+ <c:nav-item t:content="<%= cat.title %>" href="<%= cat.href %>" <%= cat.icon ? 'icon="' + cat.icon + '"' : '' %> />
18
+ <% } %>
19
+ <% } %>
20
+ </c:nav>
21
+ <c:nav tag="ul">
22
+ <c:nav-dropdown-user title dropdown-menudir="end"/>
23
+ </c:nav>
24
+ </c:navbar>
@@ -0,0 +1,25 @@
1
+ <c:page-start body-class="bg-alt" />
2
+ <c:main>
3
+ <c:container>
4
+ <c:div flex="align-items:center justify-content:center" dim="height:viewport">
5
+ <c:grid-row dim="width:100">
6
+ <c:grid-col col="3-lg 2-md"></c:grid-col>
7
+ <c:grid-col col="6-lg 8-md">
8
+ <c:div flex="justify-content:center">
9
+ <a href="https://maritime.rapp.id">
10
+ <c:img src="waibuMpa:/logo/main?type=full<%= _meta.darkMode ? '-light' : '' %>" height="30" />
11
+ </a>
12
+ </c:div>
13
+ <c:card shadow margin="top-5">
14
+ <c:card-body>
15
+ <c:heading margin="bottom-4" text="align:center color:primary" type="5-display" content="<%= page.title %>" />
16
+ <!-- body -->
17
+ </c:card-body>
18
+ </c:card>
19
+ <!-- include sumba.partial:/layout/footer.html -->
20
+ </c:grid-col>
21
+ <c:grid-col col="3-lg 2-md"></c:grid-col>
22
+ </c:grid-row>
23
+ </c:container>
24
+ </c:main>
25
+ <c:page-end />
@@ -0,0 +1,14 @@
1
+ <c:page-start />
2
+ <c:main>
3
+ <!-- include main.partial:/header.html -->
4
+ <c:container>
5
+ <c:heading type="4-display" content="<%= page.title %>" />
6
+ <c:card shadow="sm" border="none">
7
+ <c:card-body>
8
+ <!-- body -->
9
+ </c:card-body>
10
+ </c:card>
11
+ </c:container>
12
+ <!-- include main.partial:/footer.html -->
13
+ </c:main>
14
+ <c:page-end back-to-top/>
@@ -0,0 +1,14 @@
1
+ <c:page-start />
2
+ <c:main>
3
+ <!-- include main.partial:/header.html -->
4
+ <c:container>
5
+ <c:heading type="4-display" content="<%= page.title %>" margin="bottom-4" />
6
+ <c:card shadow="sm" border="none">
7
+ <c:card-body>
8
+ <!-- body -->
9
+ </c:card-body>
10
+ </c:card>
11
+ </c:container>
12
+ <!-- include main.partial:/footer.html -->
13
+ </c:main>
14
+ <c:page-end back-to-top/>
@@ -0,0 +1,14 @@
1
+ <c:page-start />
2
+ <c:main>
3
+ <!-- include main.partial:/header.html -->
4
+ <c:container>
5
+ <c:heading type="4-display" content="<%= page.title %>" />
6
+ <c:card shadow="sm" border="none">
7
+ <c:card-body>
8
+ <!-- body -->
9
+ </c:card-body>
10
+ </c:card>
11
+ </c:container>
12
+ <!-- include main.partial:/footer.html -->
13
+ </c:main>
14
+ <c:page-end back-to-top/>
@@ -0,0 +1,13 @@
1
+ <c:page-start body-class="bg-alt" />
2
+ <c:main flex>
3
+ <!-- include waibuAdmin.partial:/layout/sidebar.html -->
4
+ <c:div flex="fill column">
5
+ <!-- include waibuAdmin.partial:/layout/navbar.html -->
6
+ <c:container margin="start-0 top-3 bottom-5" style="max-width: 992px;">
7
+ <!-- include waibuAdmin.partial:/layout/crud/before-list.html -->
8
+ <!-- body -->
9
+ <!-- include waibuAdmin.partial:/layout/crud/after-list.html -->
10
+ </c:container>
11
+ </c:div>
12
+ </c:main>
13
+ <c:page-end back-to-top/>
@@ -0,0 +1,13 @@
1
+ <c:page-start body-class="bg-alt" />
2
+ <c:main flex>
3
+ <!-- include waibuAdmin.partial:/layout/sidebar.html -->
4
+ <c:div flex="fill column">
5
+ <!-- include waibuAdmin.partial:/layout/navbar.html -->
6
+ <c:container margin="start-0 top-3 bottom-5" style="max-width: 1200px;">
7
+ <!-- include waibuAdmin.partial:/layout/crud/before-list.html -->
8
+ <!-- body -->
9
+ <!-- include waibuAdmin.partial:/layout/crud/after-list.html -->
10
+ </c:container>
11
+ </c:div>
12
+ </c:main>
13
+ <c:page-end back-to-top/>
@@ -0,0 +1,11 @@
1
+ <c:page-start body-class="bg-alt" />
2
+ <c:main flex>
3
+ <!-- include waibuAdmin.partial:/layout/sidebar.html -->
4
+ <c:div flex="fill column">
5
+ <!-- include waibuAdmin.partial:/layout/navbar.html -->
6
+ <c:container margin="start-0 top-3 bottom-5" style="max-width: 992px;">
7
+ <!-- body -->
8
+ </c:container>
9
+ </c:div>
10
+ </c:main>
11
+ <c:page-end back-to-top/>
@@ -0,0 +1,11 @@
1
+ <c:page-start body-class="bg-alt" />
2
+ <c:main flex>
3
+ <!-- include waibuAdmin.partial:/layout/sidebar.html -->
4
+ <c:div flex="fill column">
5
+ <!-- include waibuAdmin.partial:/layout/navbar.html -->
6
+ <c:container margin="start-0 top-3 bottom-5" style="max-width: 1200px;">
7
+ <!-- body -->
8
+ </c:container>
9
+ </c:div>
10
+ </c:main>
11
+ <c:page-end back-to-top/>
@@ -0,0 +1,9 @@
1
+ </c:card-body>
2
+ </c:card>
3
+ <% if (arguments[0].addOns && arguments[0].addOns.length > 0) { %>
4
+ </c:grid-col>
5
+ <c:grid-col col="4-md 3-lg">
6
+ <c:div id="sb-addons"></c:div>
7
+ </c:grid-col>
8
+ </c:grid-row>
9
+ <% } %>
@@ -0,0 +1,6 @@
1
+ <% if (arguments[0].addOns && arguments[0].addOns.length > 0) { %>
2
+ <c:grid-row gutter="3">
3
+ <c:grid-col col="8-md 9-lg">
4
+ <% } %>
5
+ <c:card>
6
+ <c:card-body>
@@ -0,0 +1,12 @@
1
+ <c:navbar background="color:secondary-subtle" position="type:sticky-top" padding="x-3" shadow="sm" style="min-height:57px" <%= _meta.darkMode ? 'border="side:bottom"' : '' %>>
2
+ <c:grid-row gutter="0" dim="width:100">
3
+ <c:grid-col col="6-lg" flex="align-items:center">
4
+ <div id="fullTitle">
5
+ <c:heading type="5" t:content="<%= page.fullTitle %>" />
6
+ </div>
7
+ </c:grid-col>
8
+ <c:grid-col col="6-lg" flex="justify-content:end-lg align-items:center">
9
+ <c:breadcrumb auto-detect href-rebuild margin="all-0"/>
10
+ </c:grid-col>
11
+ </c:grid-row>
12
+ </c:navbar>
@@ -0,0 +1,3 @@
1
+ <c:sidebar shadow class="header" text="color:light" align="start" mini expanded auto-fill style="width:4.1rem" fancy-profile <%= _meta.darkMode ? 'border="side:end"' : '' %>>
2
+ <c:app-launcher-trigger img-src="waibuMpa:/logo/main?type=light" img-dim-height="56" x-data @click="wbs.appLauncher('darkmode language')" />
3
+ </c:sidebar>
package/package.json ADDED
@@ -0,0 +1,29 @@
1
+ {
2
+ "name": "waibu-blu",
3
+ "version": "1.1.0",
4
+ "description": "Blu theme for Waibu Framework",
5
+ "main": "index.js",
6
+ "scripts": {
7
+ "test": "echo \"Error: no test specified\" && exit 1"
8
+ },
9
+ "type": "module",
10
+ "repository": {
11
+ "type": "git",
12
+ "url": "git+https://github.com/ardhi/waibu-blu.git"
13
+ },
14
+ "keywords": [
15
+ "blu",
16
+ "waibu",
17
+ "theme",
18
+ "bajo",
19
+ "framework",
20
+ "fastify",
21
+ "modular"
22
+ ],
23
+ "author": "Ardhi Lukianto <ardhi@lukianto.com>",
24
+ "license": "MIT",
25
+ "bugs": {
26
+ "url": "https://github.com/ardhi/waibu-blu/issues"
27
+ },
28
+ "homepage": "https://github.com/ardhi/waibu-blu#readme"
29
+ }
@@ -0,0 +1,18 @@
1
+ async function factory (pkgName) {
2
+ const me = this
3
+
4
+ return class WaibuBlu extends this.lib.BajoPlugin {
5
+ constructor () {
6
+ super(pkgName, me.app)
7
+ this.alias = 'wblu'
8
+ this.dependencies = ['waibu-mpa', 'waibu-bootstrap']
9
+ this.config = {
10
+ waibu: {
11
+ prefix: 'blu'
12
+ }
13
+ }
14
+ }
15
+ }
16
+ }
17
+
18
+ export default factory
@@ -0,0 +1,9 @@
1
+ async function theme (ctx) {
2
+ return {
3
+ name: 'blu',
4
+ css: ['$waibuBlu.asset:/css/blu.css'],
5
+ framework: 'bootstrap'
6
+ }
7
+ }
8
+
9
+ export default theme
@@ -0,0 +1,33 @@
1
+ :root {
2
+ --blu-color-body: #f5f6f8;
3
+ --blu-color-header: #5b73e8;
4
+ --blu-color-body-alt: rgba(91, 140, 232, .25);
5
+ }
6
+
7
+ body:not([data-bs-theme="dark"]).bg-alt {
8
+ background-color: var(--blu-color-body-alt);
9
+ }
10
+
11
+ body:not([data-bs-theme="dark"]) {
12
+ background-color: var(--blu-color-body);
13
+ }
14
+
15
+ .header {
16
+ background-color: var(--blu-color-header);
17
+ }
18
+
19
+ [data-bs-theme="dark"] .header {
20
+ background-color: var(--bs-black);
21
+ }
22
+
23
+ [data-bs-theme="dark"] .header .main-navbar {
24
+ background-color: var(--bs-dark-bg-subtle);
25
+ }
26
+
27
+ [data-bs-theme="dark"] .card {
28
+ background-color: var(--bs-dark-bg-subtle);
29
+ }
30
+
31
+ body:not([data-bs-theme="dark"]) .header .main-navbar {
32
+ background-color: var(--bs-light);
33
+ }