Merge branch 'main' into feat/date-component

# Conflicts:
#	src/common/mod.rs
#	src/components/mod.rs
This commit is contained in:
meraghon committed 2025-12-12 13:16:49 -05:00
commit ae320f9763
40 files changed
+2599 -140

No files matched your search

+48
View File
@@ -0,0 +1,48 @@
use leptos::prelude::*;
use leptos_router::hooks::use_navigate;
/// # Banner Component
///
/// This component displays a red banner at the top of the page with a title and a logo.
/// Clicking the logo will redirect a user to specified page, preferably a home page.
///
/// Example usage:
/// ```
/// <Banner
/// title="Test Page"
/// logo="medal.png"
/// path="/"
/// />
/// ```
#[component]
pub fn Banner(
/// The title of the banner.
#[prop(into)]
title: String,
/// The file path or URL of a logo displayed at the top left of the banner.
#[prop(into)]
logo: String,
/// The route that the navigates user to a page (home page).
#[prop(into, default = String::from("/"))]
path: String,
) -> impl IntoView {
let navigate = use_navigate();
let on_click = move |_| navigate(&path, Default::default());
view! {
<div class="mx-auto">
<div class="bg-red-900 shadow-lg shadow-[inset_0_2px_4px_0_rgba(0,0,0,0.3),0_4px_6px_-1px_rgba(127,29,29,0.3),0_2px_4px_-1px_rgba(127,29,29,0.2)]">
<div class="flex items-center gap-4 p-6">
<div class="flex-shrink-0">
<img src={logo.clone()} class="h-10 w-10 cursor-pointer" alt="icon" on:click=on_click/>
</div>
<div class="flex-1">
<h2 class="text-white text-lg font-bold">{title.clone()}</h2>
</div>
</div>
</div>
</div>
}
}
+1 -1
View File
@@ -40,7 +40,7 @@ pub fn DashboardButton(
view! {
<button
type="button"
class="dashboard-button flex items-start gap-3 rounded-lg border-grey-300 p-6
class="dashboard-button flex items-start gap-3 rounded-lg bg-white border-grey-300 p-6
hover:bg-gray-100 transition cursor-pointer w-full text-left
shadow-[inset_0_0_6px_rgba(0,0,0,0.12)]"
on:click=on_click>
+2 -1
View File
@@ -1,4 +1,5 @@
mod action_button;
mod banner;
mod checkbox;
mod chips;
mod dashboard_button;
@@ -13,6 +14,6 @@ mod text_field;
mod utils;
pub use self::{
action_button::*, checkbox::*, chips::*, dashboard_button::*, date::*, loading::*,
action_button::*, banner::*, checkbox::*, chips::*, dashboard_button::*, date::*, loading::*,
multi_entry::*, panel::*, radio::*, row::*, select::*, text_field::*,
};
+3 -1
View File
@@ -73,7 +73,9 @@ pub fn MultiEntry(
/// component's `data_member` input.
#[prop()]
data_map: RwSignal<HashMap<String, ValueType>>,
#[prop(into)] name_member: String,
/// Currently unused.
#[prop(optional, into)]
name_member: String,
/// The type and order of the inputs for each `Entry` component within this `MultiEntry` component.
#[prop(optional)]
schema: Vec<InputType>,
+1 -1
View File
@@ -29,7 +29,7 @@ pub fn Panel(
) -> impl IntoView {
view! {
<div
class="flex flex-col gap-2 p-2 m-4 flex-1
class="flex flex-col gap-2 p-2 m-4 flex-2
border-1 border-gray-600/10
rounded-md shadow-[0_0_6px_rgba(0,0,0,0.50)]"
class=(["hidden"], hidden) >