Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bs5 Components #5312

Merged
merged 16 commits into from
Sep 14, 2023
32 changes: 27 additions & 5 deletions src/html/components/_scripts.astro
Original file line number Diff line number Diff line change
Expand Up @@ -9,29 +9,32 @@ const adminlteJsUrl = path + "/js/adminlte.js";
integrity="sha256-NRZchBuHZWSXldqrtAOeCZpucH/1n1ToJ3C8mSK95NU="
crossorigin="anonymous"
></script>
<!--end::Third Party Plugin(OverlayScrollbars)--><!--begin::Required Plugin(popperjs for Bootstrap 5)-->
<!--end::Third Party Plugin(OverlayScrollbars)-->
<!--begin::Required Plugin(popperjs for Bootstrap 5)-->
<script
src="https://cdn.jsdelivr.net/npm/@popperjs/[email protected]/dist/umd/popper.min.js"
integrity="sha384-zYPOMqeu1DAVkHiLqWBUTcbYfZ8osu1Nd6Z89ify25QV9guujx43ITvfi12/QExE"
crossorigin="anonymous"
></script>
<!--end::Required Plugin(popperjs for Bootstrap 5)--><!--begin::Required Plugin(Bootstrap 5)-->
<!--end::Required Plugin(popperjs for Bootstrap 5)-->
<!--begin::Required Plugin(Bootstrap 5)-->
<script
src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.min.js"
integrity="sha384-Y4oOpwW3duJdCWv5ly8SCFYWqFDsfob/3GkgExXKV4idmbt98QcxXYs9UoXAB7BZ"
crossorigin="anonymous"
></script>
<!--end::Required Plugin(Bootstrap 5)--><!--begin::Required Plugin(AdminLTE)-->
<!--end::Required Plugin(Bootstrap 5)-->
<!--begin::Required Plugin(AdminLTE)-->
<script src={adminlteJsUrl} is:inline></script>
<!--end::Required Plugin(AdminLTE)--><!--begin::OverlayScrollbars Configure-->
<!--end::Required Plugin(AdminLTE)-->
<!--begin::OverlayScrollbars Configure-->
<script is:inline>
const SELECTOR_SIDEBAR_WRAPPER = ".sidebar-wrapper";
const Default = {
scrollbarTheme: "os-theme-light",
scrollbarAutoHide: "leave",
scrollbarClickScroll: true,
};

document.addEventListener("DOMContentLoaded", function () {
const sidebarWrapper = document.querySelector(SELECTOR_SIDEBAR_WRAPPER);
if (
Expand All @@ -49,3 +52,22 @@ const adminlteJsUrl = path + "/js/adminlte.js";
});
</script>
<!--end::OverlayScrollbars Configure-->
<!--begin::Bootstrap Tooltips-->
danny007in marked this conversation as resolved.
Show resolved Hide resolved
<script is:inline>
const tooltipTriggerList = document.querySelectorAll('[data-bs-toggle="tooltip"]')
const tooltipList = [...tooltipTriggerList].map(tooltipTriggerEl => new bootstrap.Tooltip(tooltipTriggerEl));
</script>
<!--end::Bootstrap Tooltips-->
<!--begin::Bootstrap Toasts-->
<script is:inline>
const toastTriggerList = document.querySelectorAll('[data-bs-toggle="toast"]')
toastTriggerList.forEach(btn => {
btn.addEventListener('click', event => {
event.preventDefault();
const toastEle = document.getElementById(btn.getAttribute('data-bs-target'));
const toastBootstrap = bootstrap.Toast.getOrCreateInstance(toastEle);
toastBootstrap.show();
})
})
</script>
<!--end::Bootstrap Toasts-->
21 changes: 18 additions & 3 deletions src/html/components/dashboard/_sidenav.astro
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
import { convertPathToHtml } from "../../../utils/index.js";
const { path, mainPage, page } = Astro.props;
import {convertPathToHtml} from "../../../utils/index.js";
const {path, mainPage, page} = Astro.props;
const htmlPath = convertPathToHtml(path);
---

Expand Down Expand Up @@ -125,7 +125,7 @@ const htmlPath = convertPathToHtml(path);
<p>
Layout Options
<span class="nav-badge badge text-bg-secondary me-3"
>6</span
>6</span
>
<i class="nav-arrow bi bi-chevron-right"></i>
</p>
Expand Down Expand Up @@ -250,6 +250,21 @@ const htmlPath = convertPathToHtml(path);
</li>
</ul>
</li>
<li class:list={["nav-item", mainPage === "bscomponents" && "menu-open"]}>
<a href="#" class:list={["nav-link", mainPage === "bscomponents" && "active"]}>
<i class="nav-icon bi bi-ui-checks-grid"></i>
<p>Components<i class="nav-arrow bi bi-chevron-right"></i>
</p>
</a>
<ul class="nav nav-treeview">
<li class="nav-item">
<a href={htmlPath + "/components/general.html"} class:list={["nav-link", page === "bsgeneral" && "active"]}>
<i class="nav-icon bi bi-circle"></i>
<p>General Components</p>
</a>
</li>
</ul>
</li>
<li class:list={["nav-item", mainPage === "tables" && "menu-open"]}>
<a
href="#"
Expand Down
798 changes: 798 additions & 0 deletions src/html/pages/components/general.astro
danny007in marked this conversation as resolved.
Show resolved Hide resolved

Large diffs are not rendered by default.

14 changes: 7 additions & 7 deletions src/html/pages/forms/general.astro
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ const page = "general";
<!--begin::Col-->
<div class="col-12">
<div class="callout callout-info">
For detailed documentaion of Form visit <a
For detailed documentation of Form visit <a
href="https://getbootstrap.com/docs/5.3/forms/overview/"
target="_blank"
rel="noopener noreferrer"
Expand All @@ -72,7 +72,7 @@ const page = "general";
<!--begin::Col-->
<div class="col-md-6">
<!--begin::Quick Example-->
<div class="card card-primary card-outline">
<div class="card card-primary card-outline mb-4">
<!--begin::Header-->
<div class="card-header">
<div class="card-title">Quick Example</div>
Expand Down Expand Up @@ -140,7 +140,7 @@ const page = "general";
</div>
<!--end::Quick Example-->
<!--begin::Input Group-->
<div class="card card-success card-outline">
<div class="card card-success card-outline mb-4">
<!--begin::Header-->
<div class="card-header">
<div class="card-title">Input Group</div>
Expand Down Expand Up @@ -234,7 +234,7 @@ const page = "general";
</div>
<!--end::Input Group-->
<!--begin::Horizontal Form-->
<div class="card card-warning card-outline">
<div class="card card-warning card-outline mb-4">
<!--begin::Header-->
<div class="card-header">
<div class="card-title">Horizontal Form</div>
Expand Down Expand Up @@ -348,7 +348,7 @@ const page = "general";
<!--begin::Col-->
<div class="col-md-6">
<!--begin::Different Height-->
<div class="card card-secondary card-outline">
<div class="card card-secondary card-outline mb-4">
<!--begin::Header-->
<div class="card-header">
<div class="card-title">Different Height</div>
Expand Down Expand Up @@ -381,7 +381,7 @@ const page = "general";
</div>
<!--end::Different Height-->
<!--begin::Different Width-->
<div class="card card-danger card-outline">
<div class="card card-danger card-outline mb-4">
<!--begin::Header-->
<div class="card-header">
<div class="card-title">Different Width</div>
Expand Down Expand Up @@ -425,7 +425,7 @@ const page = "general";
</div>
<!--end::Different Width-->
<!--begin::Form Validation-->
<div class="card card-info card-outline">
<div class="card card-info card-outline mb-4">
<!--begin::Header-->
<div class="card-header">
<div class="card-title">Form Validation</div>
Expand Down
82 changes: 82 additions & 0 deletions src/scss/_toasts.scss
danny007in marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
/**
* Custom toast styles to reflect Bootstrap colors
*/
.toast {
min-width: 300px;
margin: 8px;
}

.toast .toast-body {
--#{$prefix}toast-color: #{$black};
danny007in marked this conversation as resolved.
Show resolved Hide resolved
--#{$prefix}toast-bg: #{$gray-100};
--#{$prefix}toast-border-radius: 0 0 .25rem .25rem;
glewe marked this conversation as resolved.
Show resolved Hide resolved
}

.toast-danger {
--#{$prefix}toast-header-color: #{$white};
--#{$prefix}toast-header-bg: #{$danger};
--#{$prefix}toast-header-border-color: #{$danger};
--#{$prefix}toast-border-color: #{$danger};
--#{$prefix}toast-color: #{$white};
--#{$prefix}toast-bg: #{$red-300};
}

.toast-dark {
--#{$prefix}toast-header-color: #{$white};
--#{$prefix}toast-header-bg: #{$dark};
--#{$prefix}toast-header-border-color: #{$dark};
--#{$prefix}toast-border-color: #{$dark};
--#{$prefix}toast-color: #{$white};
--#{$prefix}toast-bg: #{$gray-600};
}

.toast-info {
--#{$prefix}toast-header-color: #{$white};
--#{$prefix}toast-header-bg: #{$info};
--#{$prefix}toast-header-border-color: #{$info};
--#{$prefix}toast-border-color: #{$info};
--#{$prefix}toast-bg: #{$cyan-300};
}

.toast-light {
--#{$prefix}toast-header-color: #{$gray-900};
--#{$prefix}toast-header-bg: #{$light};
--#{$prefix}toast-header-border-color: #{$light};
--#{$prefix}toast-border-color: #{$light};
--#{$prefix}toast-color: #{$gray-900};
--#{$prefix}toast-bg: #{$white};
}

.toast-primary {
--#{$prefix}toast-header-color: #{$white};
--#{$prefix}toast-header-bg: #{$primary};
--#{$prefix}toast-header-border-color: #{$primary};
--#{$prefix}toast-border-color: #{$primary};
--#{$prefix}toast-color: #{$white};
--#{$prefix}toast-bg: #{$blue-300};
}

.toast-secondary {
--#{$prefix}toast-header-color: #{$white};
--#{$prefix}toast-header-bg: #{$secondary};
--#{$prefix}toast-header-border-color: #{$secondary};
--#{$prefix}toast-border-color: #{$secondary};
--#{$prefix}toast-bg: #{$gray-400};
}

.toast-success {
--#{$prefix}toast-header-color: #{$white};
--#{$prefix}toast-header-bg: #{$success};
--#{$prefix}toast-header-border-color: #{$success};
--#{$prefix}toast-border-color: #{$success};
--#{$prefix}toast-color: #{$white};
--#{$prefix}toast-bg: #{$green-300};
}

.toast-warning {
--#{$prefix}toast-header-color: #{$white};
--#{$prefix}toast-header-bg: #{$warning};
--#{$prefix}toast-header-border-color: #{$warning};
--#{$prefix}toast-border-color: #{$warning};
--#{$prefix}toast-bg: #{$yellow-300};
}
12 changes: 7 additions & 5 deletions src/scss/_variables.scss
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
//
// Custom AdminLTE Variables
//

// Prefix for :root CSS variables and others.
$lte-prefix: lte- !default;

// TRANSITIONS SETTINGS
// --------------------------------------------------------

// Transition global options
$lte-transition-speed: .3s !default;
$lte-transition-fn: ease-in-out !default;

// Sidebar
// SIDEBAR
// --------------------------------------------------------
$lte-sidebar-width: 250px !default;
$lte-sidebar-breakpoint: lg !default;
Expand Down Expand Up @@ -58,11 +59,13 @@ $lte-app-header-link-padding-y: $navbar-padding-y !default;
$lte-app-header-height: ($nav-link-height + ($lte-app-header-link-padding-y * 2)) !default;
$lte-app-header-height-compact: ($nav-link-height-compact + ($lte-app-header-link-padding-y * 2)) !default;

// Content padding
// CONTENT PADDING
// --------------------------------------------------------
$lte-content-padding-y: 0 !default;
$lte-content-padding-x: .5rem !default;

// MAIN CONTENT
// --------------------------------------------------------
$lte-app-content-bottom-area-height-sm: 3.5rem !default;
$lte-app-content-bottom-area-height-md: 6rem !default;
$lte-app-content-bottom-area-height-lg: 9rem !default;
Expand All @@ -88,8 +91,7 @@ $lte-brand-link-padding-x: $lte-sidebar-padding-x !default;
$lte-brand-link-padding-x-compact: $lte-sidebar-padding-x-compact !default;
$lte-brand-link-border-buttom: 1px !default;


// Cards
// CARDS
// --------------------------------------------------------
$lte-card-shadow: 0 0 1px rgba(var(--#{$prefix}body-color-rgb), .125), 0 1px 3px rgba(var(--#{$prefix}body-color-rgb), .2) !default;
$lte-card-title-font-size: 1.1rem !default;
Expand Down
1 change: 0 additions & 1 deletion src/scss/adminlte.scss
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@
// Bootstrap Utilities
@import "bootstrap/scss/utilities/api";


// AdminLTE Configuration
// ---------------------------------------------------
@import "variables";
Expand Down
1 change: 1 addition & 0 deletions src/scss/parts/_extra-components.scss
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@
@import "../info-box";
@import "../timeline";
@import "../direct-chat";
@import "../toasts";