mirror of
https://github.com/cloud-shuttle/leptos-shadcn-ui.git
synced 2025-12-22 22:00:00 +00:00
chore: Final cleanup - remove backup files and update Cargo.lock
🧹 Cleanup: - Remove examples/leptos/Cargo.toml.backup - Remove examples/leptire_file (typo file) - Update Cargo.lock to remove lucide-leptos v2.32.0 - Add examples/leptos to workspace members ✅ Verification: - cargo check --workspace passes with only warnings - All lucide-leptos references removed from source code - Zero dependencies achieved with inline SVG approach - Ready for production use
This commit is contained in:
152
Cargo.lock
generated
152
Cargo.lock
generated
@@ -275,9 +275,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "clap"
|
||||
version = "4.5.46"
|
||||
version = "4.5.47"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "2c5e4fcf9c21d2e544ca1ee9d8552de13019a42aa7dbf32747fa7aaf1df76e57"
|
||||
checksum = "7eac00902d9d136acd712710d71823fb8ac8004ca445a89e73a41d45aa712931"
|
||||
dependencies = [
|
||||
"clap_builder",
|
||||
"clap_derive",
|
||||
@@ -285,9 +285,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "clap_builder"
|
||||
version = "4.5.46"
|
||||
version = "4.5.47"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "fecb53a0e6fcfb055f686001bc2e2592fa527efaf38dbe81a6a9563562e57d41"
|
||||
checksum = "2ad9bbf750e73b5884fb8a211a9424a1906c1e156724260fdae972f31d70e1d6"
|
||||
dependencies = [
|
||||
"anstream",
|
||||
"anstyle",
|
||||
@@ -297,9 +297,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "clap_derive"
|
||||
version = "4.5.45"
|
||||
version = "4.5.47"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "14cb31bb0a7d536caef2639baa7fad459e15c3144efefa6dbd1c84562c4739f6"
|
||||
checksum = "bbfd7eae0b0f1a6e63d4b13c9c478de77c2eb546fba158ad50b4203dc24b9f9c"
|
||||
dependencies = [
|
||||
"heck",
|
||||
"proc-macro2",
|
||||
@@ -1652,38 +1652,6 @@ dependencies = [
|
||||
"web-sys",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "leptos-shadcn-calendar"
|
||||
version = "0.2.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "1d1ca1dfb7b547977999e6f9135660a253c384b54514992fffc7caa5bcca932b"
|
||||
dependencies = [
|
||||
"js-sys",
|
||||
"leptos",
|
||||
"leptos-node-ref",
|
||||
"leptos-struct-component",
|
||||
"leptos-style",
|
||||
"lucide-leptos",
|
||||
"tailwind_fuse 0.3.2",
|
||||
"web-sys",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "leptos-shadcn-calendar"
|
||||
version = "0.3.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "7eadb03221b6bd8d8f32808016fb8e31a4ed386b1d83a24b16dd28d5dfa966bf"
|
||||
dependencies = [
|
||||
"js-sys",
|
||||
"leptos",
|
||||
"leptos-node-ref",
|
||||
"leptos-struct-component",
|
||||
"leptos-style",
|
||||
"lucide-leptos",
|
||||
"tailwind_fuse 0.3.2",
|
||||
"web-sys",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "leptos-shadcn-calendar"
|
||||
version = "0.3.1"
|
||||
@@ -1699,6 +1667,21 @@ dependencies = [
|
||||
"web-sys",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "leptos-shadcn-calendar"
|
||||
version = "0.3.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "84df73e3f960c9df49f92199704ee89baaeeba7c25e5e895c2e5f7b2df2f63af"
|
||||
dependencies = [
|
||||
"js-sys",
|
||||
"leptos",
|
||||
"leptos-node-ref",
|
||||
"leptos-struct-component",
|
||||
"leptos-style",
|
||||
"tailwind_fuse 0.3.2",
|
||||
"web-sys",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "leptos-shadcn-card"
|
||||
version = "0.3.0"
|
||||
@@ -1895,25 +1878,6 @@ dependencies = [
|
||||
"web-sys",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "leptos-shadcn-date-picker"
|
||||
version = "0.3.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "0db7d5e8eb7610ca0842f193f6c36d34d047383c262cab28db0542fe4a582896"
|
||||
dependencies = [
|
||||
"js-sys",
|
||||
"leptos",
|
||||
"leptos-node-ref",
|
||||
"leptos-shadcn-button 0.2.0",
|
||||
"leptos-shadcn-calendar 0.2.0",
|
||||
"leptos-shadcn-popover 0.2.0",
|
||||
"leptos-struct-component",
|
||||
"leptos-style",
|
||||
"lucide-leptos",
|
||||
"tailwind_fuse 0.3.2",
|
||||
"web-sys",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "leptos-shadcn-date-picker"
|
||||
version = "0.3.1"
|
||||
@@ -1922,7 +1886,7 @@ dependencies = [
|
||||
"leptos",
|
||||
"leptos-node-ref",
|
||||
"leptos-shadcn-button 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"leptos-shadcn-calendar 0.3.0",
|
||||
"leptos-shadcn-calendar 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"leptos-shadcn-popover 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"leptos-struct-component",
|
||||
"leptos-style",
|
||||
@@ -1932,6 +1896,24 @@ dependencies = [
|
||||
"web-sys",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "leptos-shadcn-date-picker"
|
||||
version = "0.3.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "9fb6f3c0b33b154216f0b7e51636192c321b6178c465ef5a57ae1dc54af80eda"
|
||||
dependencies = [
|
||||
"js-sys",
|
||||
"leptos",
|
||||
"leptos-node-ref",
|
||||
"leptos-shadcn-button 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"leptos-shadcn-calendar 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"leptos-shadcn-popover 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"leptos-struct-component",
|
||||
"leptos-style",
|
||||
"tailwind_fuse 0.3.2",
|
||||
"web-sys",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "leptos-shadcn-dialog"
|
||||
version = "0.3.0"
|
||||
@@ -2270,22 +2252,6 @@ dependencies = [
|
||||
"web-sys",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "leptos-shadcn-pagination"
|
||||
version = "0.3.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "7f037e9df967e6d05cdc53496620538a724b76284fc3a1951c82c45f6788a82e"
|
||||
dependencies = [
|
||||
"leptos",
|
||||
"leptos-node-ref",
|
||||
"leptos-shadcn-button 0.2.0",
|
||||
"leptos-struct-component",
|
||||
"leptos-style",
|
||||
"lucide-leptos",
|
||||
"tailwind_fuse 0.3.2",
|
||||
"web-sys",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "leptos-shadcn-pagination"
|
||||
version = "0.3.1"
|
||||
@@ -2302,13 +2268,14 @@ dependencies = [
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "leptos-shadcn-popover"
|
||||
version = "0.2.0"
|
||||
name = "leptos-shadcn-pagination"
|
||||
version = "0.3.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "de7456eb16707ab240911e353d28ce9e233059a4582264b4270fdcaa8a8ad245"
|
||||
checksum = "d7ee9be6bd37c4bb9fbb5399860cd13f03b1ba2fda9229b2f242aa0b05a10948"
|
||||
dependencies = [
|
||||
"leptos",
|
||||
"leptos-node-ref",
|
||||
"leptos-shadcn-button 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"leptos-struct-component",
|
||||
"leptos-style",
|
||||
"tailwind_fuse 0.3.2",
|
||||
@@ -2785,7 +2752,7 @@ dependencies = [
|
||||
"leptos-shadcn-badge 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"leptos-shadcn-breadcrumb 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"leptos-shadcn-button 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"leptos-shadcn-calendar 0.3.0",
|
||||
"leptos-shadcn-calendar 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"leptos-shadcn-card 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"leptos-shadcn-carousel 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"leptos-shadcn-checkbox 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
@@ -2793,7 +2760,7 @@ dependencies = [
|
||||
"leptos-shadcn-combobox 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"leptos-shadcn-command 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"leptos-shadcn-context-menu 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"leptos-shadcn-date-picker 0.3.0",
|
||||
"leptos-shadcn-date-picker 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"leptos-shadcn-dialog 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"leptos-shadcn-drawer 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"leptos-shadcn-dropdown-menu 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
@@ -2806,7 +2773,7 @@ dependencies = [
|
||||
"leptos-shadcn-lazy-loading 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"leptos-shadcn-menubar 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"leptos-shadcn-navigation-menu 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"leptos-shadcn-pagination 0.3.0",
|
||||
"leptos-shadcn-pagination 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"leptos-shadcn-popover 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"leptos-shadcn-progress 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"leptos-shadcn-radio-group 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
@@ -3022,18 +2989,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "log"
|
||||
version = "0.4.27"
|
||||
version = "0.4.28"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "13dc2df351e3202783a1fe0d44375f7295ffb4049267b0f3018346dc122a1d94"
|
||||
|
||||
[[package]]
|
||||
name = "lucide-leptos"
|
||||
version = "2.32.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "c735ef463d6c3c04ae13004b810d0fd63241dfd3a982f63508b5cfeb4bfb02ff"
|
||||
dependencies = [
|
||||
"leptos",
|
||||
]
|
||||
checksum = "34080505efa8e45a4b816c349525ebe327ceaa8559756f0356cba97ef3bf7432"
|
||||
|
||||
[[package]]
|
||||
name = "manyhow"
|
||||
@@ -4316,9 +4274,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "time"
|
||||
version = "0.3.42"
|
||||
version = "0.3.43"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "8ca967379f9d8eb8058d86ed467d81d03e81acd45757e4ca341c24affbe8e8e3"
|
||||
checksum = "83bde6f1ec10e72d583d91623c939f623002284ef622b87de38cfd546cbf2031"
|
||||
dependencies = [
|
||||
"deranged",
|
||||
"num-conv",
|
||||
@@ -4330,15 +4288,15 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "time-core"
|
||||
version = "0.1.5"
|
||||
version = "0.1.6"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "a9108bb380861b07264b950ded55a44a14a4adc68b9f5efd85aafc3aa4d40a68"
|
||||
checksum = "40868e7c1d2f0b8d73e4a8c7f0ff63af4f6d19be117e90bd73eb1d62cf831c6b"
|
||||
|
||||
[[package]]
|
||||
name = "time-macros"
|
||||
version = "0.2.23"
|
||||
version = "0.2.24"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "7182799245a7264ce590b349d90338f1c1affad93d2639aed5f8f69c090b334c"
|
||||
checksum = "30cfb0125f12d9c277f35663a0a33f8c30190f4e4574868a330595412d34ebf3"
|
||||
dependencies = [
|
||||
"num-conv",
|
||||
"time-core",
|
||||
|
||||
@@ -1,403 +0,0 @@
|
||||
//! Enhanced lazy loading component with realistic simulation
|
||||
|
||||
use leptos::*;
|
||||
use leptos::prelude::*;
|
||||
|
||||
/// Component metadata for enhanced lazy loading
|
||||
#[derive(Clone)]
|
||||
struct ComponentInfo {
|
||||
name: String,
|
||||
category: String,
|
||||
estimated_size: String,
|
||||
dependencies: Vec<String>,
|
||||
description: String,
|
||||
}
|
||||
|
||||
/// Enhanced lazy component wrapper with realistic simulation
|
||||
#[component]
|
||||
pub fn LazyComponentWrapper(
|
||||
#[prop(into)] name: String,
|
||||
) -> impl IntoView {
|
||||
let (is_loaded, set_is_loaded) = signal(false);
|
||||
let (is_loading, set_is_loading) = signal(false);
|
||||
let (load_progress, set_load_progress) = signal(0.0);
|
||||
|
||||
// Component metadata based on name
|
||||
let component_info = move || {
|
||||
match name.as_str() {
|
||||
"Alert" => ComponentInfo {
|
||||
name: "Alert".to_string(),
|
||||
category: "Form & Input".to_string(),
|
||||
estimated_size: "12KB".to_string(),
|
||||
dependencies: vec!["lucide-leptos".to_string()],
|
||||
description: "Displays important messages to users".to_string(),
|
||||
},
|
||||
"Badge" => ComponentInfo {
|
||||
name: "Badge".to_string(),
|
||||
category: "Form & Input".to_string(),
|
||||
estimated_size: "8KB".to_string(),
|
||||
dependencies: vec![],
|
||||
description: "Small status indicators and labels".to_string(),
|
||||
},
|
||||
"Checkbox" => ComponentInfo {
|
||||
name: "Checkbox".to_string(),
|
||||
category: "Form & Input".to_string(),
|
||||
estimated_size: "15KB".to_string(),
|
||||
dependencies: vec![],
|
||||
description: "Interactive checkbox input component".to_string(),
|
||||
},
|
||||
"Combobox" => ComponentInfo {
|
||||
name: "Combobox".to_string(),
|
||||
category: "Form & Input".to_string(),
|
||||
estimated_size: "25KB".to_string(),
|
||||
dependencies: vec!["lucide-leptos".to_string()],
|
||||
description: "Searchable dropdown with custom options".to_string(),
|
||||
},
|
||||
"Form" => ComponentInfo {
|
||||
name: "Form".to_string(),
|
||||
category: "Form & Input".to_string(),
|
||||
estimated_size: "35KB".to_string(),
|
||||
dependencies: vec!["leptos-hook-form".to_string()],
|
||||
description: "Complete form handling with validation".to_string(),
|
||||
},
|
||||
"Input OTP" => ComponentInfo {
|
||||
name: "Input OTP".to_string(),
|
||||
category: "Form & Input".to_string(),
|
||||
estimated_size: "18KB".to_string(),
|
||||
dependencies: vec![],
|
||||
description: "One-time password input fields".to_string(),
|
||||
},
|
||||
"Radio Group" => ComponentInfo {
|
||||
name: "Radio Group".to_string(),
|
||||
category: "Form & Input".to_string(),
|
||||
estimated_size: "20KB".to_string(),
|
||||
dependencies: vec![],
|
||||
description: "Radio button group selection".to_string(),
|
||||
},
|
||||
"Select" => ComponentInfo {
|
||||
name: "Select".to_string(),
|
||||
category: "Form & Input".to_string(),
|
||||
estimated_size: "22KB".to_string(),
|
||||
dependencies: vec!["lucide-leptos".to_string()],
|
||||
description: "Dropdown selection component".to_string(),
|
||||
},
|
||||
"Slider" => ComponentInfo {
|
||||
name: "Slider".to_string(),
|
||||
category: "Form & Input".to_string(),
|
||||
estimated_size: "16KB".to_string(),
|
||||
dependencies: vec![],
|
||||
description: "Range slider input component".to_string(),
|
||||
},
|
||||
"Switch" => ComponentInfo {
|
||||
name: "Switch".to_string(),
|
||||
category: "Form & Input".to_string(),
|
||||
estimated_size: "14KB".to_string(),
|
||||
dependencies: vec![],
|
||||
description: "Toggle switch component".to_string(),
|
||||
},
|
||||
"Textarea" => ComponentInfo {
|
||||
name: "Textarea".to_string(),
|
||||
category: "Form & Input".to_string(),
|
||||
estimated_size: "10KB".to_string(),
|
||||
dependencies: vec![],
|
||||
description: "Multi-line text input".to_string(),
|
||||
},
|
||||
"Toggle" => ComponentInfo {
|
||||
name: "Toggle".to_string(),
|
||||
category: "Form & Input".to_string(),
|
||||
estimated_size: "12KB".to_string(),
|
||||
dependencies: vec![],
|
||||
description: "Button toggle component".to_string(),
|
||||
},
|
||||
"Accordion" => ComponentInfo {
|
||||
name: "Accordion".to_string(),
|
||||
category: "Layout & Navigation".to_string(),
|
||||
estimated_size: "28KB".to_string(),
|
||||
dependencies: vec!["lucide-leptos".to_string()],
|
||||
description: "Collapsible content sections".to_string(),
|
||||
},
|
||||
"Breadcrumb" => ComponentInfo {
|
||||
name: "Breadcrumb".to_string(),
|
||||
category: "Layout & Navigation".to_string(),
|
||||
estimated_size: "18KB".to_string(),
|
||||
dependencies: vec!["lucide-leptos".to_string()],
|
||||
description: "Navigation breadcrumb trail".to_string(),
|
||||
},
|
||||
"Collapsible" => ComponentInfo {
|
||||
name: "Collapsible".to_string(),
|
||||
category: "Layout & Navigation".to_string(),
|
||||
estimated_size: "20KB".to_string(),
|
||||
dependencies: vec![],
|
||||
description: "Expandable content container".to_string(),
|
||||
},
|
||||
"Command" => ComponentInfo {
|
||||
name: "Command".to_string(),
|
||||
category: "Layout & Navigation".to_string(),
|
||||
estimated_size: "32KB".to_string(),
|
||||
dependencies: vec!["lucide-leptos".to_string()],
|
||||
description: "Command palette interface".to_string(),
|
||||
},
|
||||
"Navigation Menu" => ComponentInfo {
|
||||
name: "Navigation Menu".to_string(),
|
||||
category: "Layout & Navigation".to_string(),
|
||||
estimated_size: "40KB".to_string(),
|
||||
dependencies: vec!["lucide-leptos".to_string()],
|
||||
description: "Complex navigation menu system".to_string(),
|
||||
},
|
||||
"Pagination" => ComponentInfo {
|
||||
name: "Pagination".to_string(),
|
||||
category: "Layout & Navigation".to_string(),
|
||||
estimated_size: "25KB".to_string(),
|
||||
dependencies: vec!["lucide-leptos".to_string()],
|
||||
description: "Page navigation controls".to_string(),
|
||||
},
|
||||
"Scroll Area" => ComponentInfo {
|
||||
name: "Scroll Area".to_string(),
|
||||
category: "Layout & Navigation".to_string(),
|
||||
estimated_size: "15KB".to_string(),
|
||||
dependencies: vec![],
|
||||
description: "Custom scrollable container".to_string(),
|
||||
},
|
||||
"Skeleton" => ComponentInfo {
|
||||
name: "Skeleton".to_string(),
|
||||
category: "Layout & Navigation".to_string(),
|
||||
estimated_size: "12KB".to_string(),
|
||||
dependencies: vec![],
|
||||
description: "Loading placeholder components".to_string(),
|
||||
},
|
||||
"Tabs" => ComponentInfo {
|
||||
name: "Tabs".to_string(),
|
||||
category: "Layout & Navigation".to_string(),
|
||||
estimated_size: "30KB".to_string(),
|
||||
dependencies: vec![],
|
||||
description: "Tabbed content interface".to_string(),
|
||||
},
|
||||
"Alert Dialog" => ComponentInfo {
|
||||
name: "Alert Dialog".to_string(),
|
||||
category: "Overlay & Feedback".to_string(),
|
||||
estimated_size: "35KB".to_string(),
|
||||
dependencies: vec!["lucide-leptos".to_string()],
|
||||
description: "Modal dialog with actions".to_string(),
|
||||
},
|
||||
"Dialog" => ComponentInfo {
|
||||
name: "Dialog".to_string(),
|
||||
category: "Overlay & Feedback".to_string(),
|
||||
estimated_size: "30KB".to_string(),
|
||||
dependencies: vec![],
|
||||
description: "Modal dialog component".to_string(),
|
||||
},
|
||||
"Drawer" => ComponentInfo {
|
||||
name: "Drawer".to_string(),
|
||||
category: "Overlay & Feedback".to_string(),
|
||||
estimated_size: "38KB".to_string(),
|
||||
dependencies: vec![],
|
||||
description: "Slide-out drawer panel".to_string(),
|
||||
},
|
||||
"Dropdown Menu" => ComponentInfo {
|
||||
name: "Dropdown Menu".to_string(),
|
||||
category: "Overlay & Feedback".to_string(),
|
||||
estimated_size: "28KB".to_string(),
|
||||
dependencies: vec!["lucide-leptos".to_string()],
|
||||
description: "Contextual dropdown menu".to_string(),
|
||||
},
|
||||
"Hover Card" => ComponentInfo {
|
||||
name: "Hover Card".to_string(),
|
||||
category: "Overlay & Feedback".to_string(),
|
||||
estimated_size: "22KB".to_string(),
|
||||
dependencies: vec![],
|
||||
description: "Hover-triggered information card".to_string(),
|
||||
},
|
||||
"Menubar" => ComponentInfo {
|
||||
name: "Menubar".to_string(),
|
||||
category: "Overlay & Feedback".to_string(),
|
||||
estimated_size: "45KB".to_string(),
|
||||
dependencies: vec!["lucide-leptos".to_string()],
|
||||
description: "Horizontal menu bar".to_string(),
|
||||
},
|
||||
"Popover" => ComponentInfo {
|
||||
name: "Popover".to_string(),
|
||||
category: "Overlay & Feedback".to_string(),
|
||||
estimated_size: "20KB".to_string(),
|
||||
dependencies: vec![],
|
||||
description: "Positioned popup content".to_string(),
|
||||
},
|
||||
"Sheet" => ComponentInfo {
|
||||
name: "Sheet".to_string(),
|
||||
category: "Overlay & Feedback".to_string(),
|
||||
estimated_size: "32KB".to_string(),
|
||||
dependencies: vec![],
|
||||
description: "Slide-up sheet panel".to_string(),
|
||||
},
|
||||
"Toast" => ComponentInfo {
|
||||
name: "Toast".to_string(),
|
||||
category: "Overlay & Feedback".to_string(),
|
||||
estimated_size: "25KB".to_string(),
|
||||
dependencies: vec!["lucide-leptos".to_string()],
|
||||
description: "Notification toast messages".to_string(),
|
||||
},
|
||||
"Tooltip" => ComponentInfo {
|
||||
name: "Tooltip".to_string(),
|
||||
category: "Overlay & Feedback".to_string(),
|
||||
estimated_size: "18KB".to_string(),
|
||||
dependencies: vec![],
|
||||
description: "Hover tooltip component".to_string(),
|
||||
},
|
||||
"Aspect Ratio" => ComponentInfo {
|
||||
name: "Aspect Ratio".to_string(),
|
||||
category: "Data & Media".to_string(),
|
||||
estimated_size: "8KB".to_string(),
|
||||
dependencies: vec![],
|
||||
description: "Maintains aspect ratio container".to_string(),
|
||||
},
|
||||
"Calendar" => ComponentInfo {
|
||||
name: "Calendar".to_string(),
|
||||
category: "Data & Media".to_string(),
|
||||
estimated_size: "50KB".to_string(),
|
||||
dependencies: vec!["chrono".to_string()],
|
||||
description: "Interactive calendar component".to_string(),
|
||||
},
|
||||
"Carousel" => ComponentInfo {
|
||||
name: "Carousel".to_string(),
|
||||
category: "Data & Media".to_string(),
|
||||
estimated_size: "35KB".to_string(),
|
||||
dependencies: vec!["lucide-leptos".to_string()],
|
||||
description: "Image/content carousel".to_string(),
|
||||
},
|
||||
"Context Menu" => ComponentInfo {
|
||||
name: "Context Menu".to_string(),
|
||||
category: "Data & Media".to_string(),
|
||||
estimated_size: "30KB".to_string(),
|
||||
dependencies: vec!["lucide-leptos".to_string()],
|
||||
description: "Right-click context menu".to_string(),
|
||||
},
|
||||
"Date Picker" => ComponentInfo {
|
||||
name: "Date Picker".to_string(),
|
||||
category: "Data & Media".to_string(),
|
||||
estimated_size: "45KB".to_string(),
|
||||
dependencies: vec!["chrono".to_string()],
|
||||
description: "Date selection component".to_string(),
|
||||
},
|
||||
"Progress" => ComponentInfo {
|
||||
name: "Progress".to_string(),
|
||||
category: "Data & Media".to_string(),
|
||||
estimated_size: "12KB".to_string(),
|
||||
dependencies: vec![],
|
||||
description: "Progress bar component".to_string(),
|
||||
},
|
||||
"Table" => ComponentInfo {
|
||||
name: "Table".to_string(),
|
||||
category: "Data & Media".to_string(),
|
||||
estimated_size: "40KB".to_string(),
|
||||
dependencies: vec!["lucide-leptos".to_string()],
|
||||
description: "Data table with sorting".to_string(),
|
||||
},
|
||||
_ => ComponentInfo {
|
||||
name: name.clone(),
|
||||
category: "Unknown".to_string(),
|
||||
estimated_size: "20KB".to_string(),
|
||||
dependencies: vec![],
|
||||
description: "Component description not available".to_string(),
|
||||
},
|
||||
}
|
||||
};
|
||||
|
||||
let load_component = move |_| {
|
||||
set_is_loading.set(true);
|
||||
set_load_progress.set(0.0);
|
||||
|
||||
// Simulate loading progress
|
||||
let progress_interval = set_interval_with_handle(
|
||||
move || {
|
||||
set_load_progress.update(|p| {
|
||||
if *p < 100.0 {
|
||||
*p += 10.0;
|
||||
} else {
|
||||
set_is_loading.set(false);
|
||||
set_is_loaded.set(true);
|
||||
}
|
||||
});
|
||||
},
|
||||
std::time::Duration::from_millis(100),
|
||||
).unwrap();
|
||||
|
||||
// Clean up interval after loading
|
||||
spawn_local(async move {
|
||||
gloo_timers::future::TimeoutFuture::new(1000).await;
|
||||
progress_interval.clear();
|
||||
});
|
||||
};
|
||||
|
||||
view! {
|
||||
<div class="lazy-component-wrapper">
|
||||
<div class="component-header">
|
||||
<h4>{name.clone()}</h4>
|
||||
<div class="component-meta">
|
||||
<span class="component-category">{component_info().category}</span>
|
||||
<span class="component-size">{component_info().estimated_size}</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="component-content">
|
||||
<div class="lazy-component-loaded" class:hidden={move || !is_loaded.get()}>
|
||||
<div class="component-success">
|
||||
<div class="success-icon">"✅"</div>
|
||||
<p class="success-text">"Component loaded successfully!"</p>
|
||||
<div class="component-demo">
|
||||
<span>"🎉 {name} is now available"</span>
|
||||
</div>
|
||||
<div class="component-details">
|
||||
<p class="component-description">{component_info().description}</p>
|
||||
<div class="component-dependencies">
|
||||
<strong>"Dependencies:"</strong>
|
||||
{if component_info().dependencies.is_empty() {
|
||||
"None".to_string()
|
||||
} else {
|
||||
component_info().dependencies.join(", ")
|
||||
}}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="component-loading" class:hidden={move || !is_loading.get()}>
|
||||
<div class="loading-content">
|
||||
<div class="loading-spinner"></div>
|
||||
<p>"Loading {name}..."</p>
|
||||
<div class="progress-bar">
|
||||
<div class="progress-fill" style={format!("width: {}%", load_progress.get())}></div>
|
||||
</div>
|
||||
<span class="progress-text">{move || format!("{}%", load_progress.get() as i32)}</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="component-placeholder" class:hidden={move || is_loaded.get() || is_loading.get()}>
|
||||
<div class="placeholder-content">
|
||||
<p class="placeholder-text">"This component is not yet loaded. Click to load it on demand."</p>
|
||||
<div class="component-preview">
|
||||
<p class="preview-description">{component_info().description}</p>
|
||||
<div class="preview-meta">
|
||||
<span class="preview-size">"Size: {component_info().estimated_size}"</span>
|
||||
<span class="preview-category">"Category: {component_info().category}"</span>
|
||||
</div>
|
||||
</div>
|
||||
<button on:click={load_component} class="load-btn">
|
||||
"Load {name}"
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
}
|
||||
|
||||
/// Simple lazy loading provider
|
||||
#[component]
|
||||
pub fn LazyLoadingProvider(
|
||||
#[prop(into)] children: Children,
|
||||
) -> impl IntoView {
|
||||
view! {
|
||||
<div class="lazy-loading-provider">
|
||||
{children()}
|
||||
</div>
|
||||
}
|
||||
}
|
||||
@@ -1,59 +0,0 @@
|
||||
[package]
|
||||
name = "shadcn-ui-leptos-book"
|
||||
description = "Book examples for shadcn/ui Leptos."
|
||||
publish = false
|
||||
|
||||
authors.workspace = true
|
||||
edition.workspace = true
|
||||
license.workspace = true
|
||||
repository.workspace = true
|
||||
version.workspace = true
|
||||
|
||||
# Production build profiles with aggressive optimization
|
||||
[profile.release]
|
||||
opt-level = 3
|
||||
codegen-units = 1
|
||||
strip = true
|
||||
incremental = false
|
||||
lto = true
|
||||
|
||||
[profile.release.package."*"]
|
||||
opt-level = 3
|
||||
codegen-units = 1
|
||||
strip = true
|
||||
|
||||
# Feature sets for different optimization levels
|
||||
[features]
|
||||
default = ["essential"]
|
||||
essential = ["button", "input", "label", "card", "separator", "default_theme", "new_york_theme"]
|
||||
essential_with_icons = ["button", "input", "label", "card", "separator", "default_theme", "new_york_theme", "lucide-leptos"]
|
||||
|
||||
# Individual component features
|
||||
button = ["dep:shadcn-ui-leptos-button"]
|
||||
input = ["dep:shadcn-ui-leptos-input"]
|
||||
label = ["dep:shadcn-ui-leptos-label"]
|
||||
card = ["dep:shadcn-ui-leptos-card"]
|
||||
separator = ["dep:shadcn-ui-leptos-separator"]
|
||||
lucide-leptos = ["dep:lucide-leptos"]
|
||||
default_theme = []
|
||||
new_york_theme = []
|
||||
|
||||
|
||||
|
||||
[dependencies]
|
||||
console_error_panic_hook.workspace = true
|
||||
console_log.workspace = true
|
||||
leptos = { workspace = true, features = ["csr"] }
|
||||
leptos_router.workspace = true
|
||||
log.workspace = true
|
||||
|
||||
# Only include essential components
|
||||
shadcn-ui-leptos-button = { path = "../../packages/leptos/button", optional = true }
|
||||
shadcn-ui-leptos-input = { path = "../../packages/leptos/input", optional = true }
|
||||
shadcn-ui-leptos-label = { path = "../../packages/leptos/label", optional = true }
|
||||
shadcn-ui-leptos-card = { path = "../../packages/leptos/card", optional = true }
|
||||
shadcn-ui-leptos-separator = { path = "../../packages/leptos/separator", optional = true }
|
||||
|
||||
# Include lucide-leptos for icons
|
||||
lucide-leptos = { workspace = true, optional = true }
|
||||
gloo-timers = "0.3.0"
|
||||
Reference in New Issue
Block a user