From fd832ce7a3660bd81b5476477ecdc2bc822df5c2 Mon Sep 17 00:00:00 2001 From: Benedikt Peetz Date: Fri, 26 Sep 2025 20:15:48 +0200 Subject: chore: Second version --- Cargo.lock | 472 ++++-------------- Cargo.toml | 2 +- index.html | 7 +- public/logo.svg | 949 +++++++++++++++++++++++++++++++++++++ public/styles.scss | 129 ++--- src/components/container.rs | 34 ++ src/components/mod.rs | 5 + src/components/product_overview.rs | 47 ++ src/components/side_header.rs | 22 + src/lib.rs | 10 +- src/pages/home.rs | 78 +-- stalwart/Trunk.toml | 4 + stalwart/index.html | 32 ++ stalwart/input.css | 3 + stalwart/package.json | 18 + stalwart/tailwind.config.js | 36 ++ 16 files changed, 1318 insertions(+), 530 deletions(-) create mode 100644 public/logo.svg create mode 100644 src/components/container.rs create mode 100644 src/components/product_overview.rs create mode 100644 src/components/side_header.rs create mode 100644 stalwart/Trunk.toml create mode 100644 stalwart/index.html create mode 100644 stalwart/input.css create mode 100644 stalwart/package.json create mode 100644 stalwart/tailwind.config.js diff --git a/Cargo.lock b/Cargo.lock index 25d3913..1e9e619 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -35,17 +35,6 @@ dependencies = [ "libc", ] -[[package]] -name = "any_spawner" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "41058deaa38c9d9dd933d6d238d825227cffa668e2839b52879f6619c63eee3b" -dependencies = [ - "futures", - "thiserror 2.0.16", - "wasm-bindgen-futures", -] - [[package]] name = "any_spawner" version = "0.3.0" @@ -338,15 +327,6 @@ dependencies = [ "unicode-segmentation", ] -[[package]] -name = "convert_case" -version = "0.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bb402b8d4c85569410425650ce3eddc7d698ed96d39a73f941b08fb63082f1e7" -dependencies = [ - "unicode-segmentation", -] - [[package]] name = "convert_case" version = "0.8.0" @@ -680,6 +660,18 @@ dependencies = [ "wasm-bindgen", ] +[[package]] +name = "getset" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9cf0fc11e47561d47397154977bc219f4cf809b2974facc3ccb3b89e2436f912" +dependencies = [ + "proc-macro-error2", + "proc-macro2", + "quote", + "syn", +] + [[package]] name = "gimli" version = "0.31.1" @@ -805,20 +797,6 @@ version = "1.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6dbf3de79e51f3d586ab4cb9d5c3e2c14aa28ed23d180cf89b4df0454a69cc87" -[[package]] -name = "hydration_context" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d35485b3dcbf7e044b8f28c73f04f13e7b509c2466fd10cb2a8a447e38f8a93a" -dependencies = [ - "futures", - "once_cell", - "or_poisoned", - "pin-project-lite", - "serde", - "throw_error 0.2.0", -] - [[package]] name = "hydration_context" version = "0.3.0" @@ -830,7 +808,7 @@ dependencies = [ "or_poisoned", "pin-project-lite", "serde", - "throw_error 0.3.0", + "throw_error", ] [[package]] @@ -1111,94 +1089,46 @@ dependencies = [ "wasm-bindgen", ] -[[package]] -name = "leptos" -version = "0.7.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26b8731cb00f3f0894058155410b95c8955b17273181d2bc72600ab84edd24f1" -dependencies = [ - "any_spawner 0.2.0", - "cfg-if", - "either_of", - "futures", - "hydration_context 0.2.1", - "leptos_config 0.7.8", - "leptos_dom 0.7.8", - "leptos_hot_reload 0.7.8", - "leptos_macro 0.7.9", - "leptos_server 0.7.8", - "oco_ref", - "or_poisoned", - "paste", - "reactive_graph 0.1.8", - "rustc-hash", - "send_wrapper", - "serde", - "serde_qs 0.13.0", - "server_fn 0.7.8", - "slotmap", - "tachys 0.1.9", - "thiserror 2.0.16", - "throw_error 0.2.0", - "typed-builder 0.20.1", - "typed-builder-macro 0.20.1", - "wasm-bindgen", - "web-sys", -] - [[package]] name = "leptos" version = "0.8.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "52efe8eff3278b12f7897a15bdf067bbbb02212773e379d6fc121592752eb718" dependencies = [ - "any_spawner 0.3.0", + "any_spawner", "cfg-if", "either_of", "futures", "getrandom", - "hydration_context 0.3.0", - "leptos_config 0.8.7", - "leptos_dom 0.8.6", - "leptos_hot_reload 0.8.5", - "leptos_macro 0.8.8", - "leptos_server 0.8.5", + "hydration_context", + "leptos_config", + "leptos_dom", + "leptos_hot_reload", + "leptos_macro", + "leptos_server", "oco_ref", "or_poisoned", "paste", - "reactive_graph 0.2.7", + "reactive_graph", "rustc-hash", "rustc_version", "send_wrapper", "serde", "serde_json", - "serde_qs 0.15.0", - "server_fn 0.8.7", + "serde_qs", + "server_fn", "slotmap", - "tachys 0.2.8", + "tachys", "thiserror 2.0.16", - "throw_error 0.3.0", - "typed-builder 0.21.2", - "typed-builder-macro 0.21.2", + "throw_error", + "typed-builder", + "typed-builder-macro", "wasm-bindgen", "wasm-bindgen-futures", "wasm_split_helpers", "web-sys", ] -[[package]] -name = "leptos_config" -version = "0.7.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5bae3e0ead5a7a814c8340eef7cb8b6cba364125bd8174b15dc9fe1b3cab7e03" -dependencies = [ - "config", - "regex", - "serde", - "thiserror 2.0.16", - "typed-builder 0.20.1", -] - [[package]] name = "leptos_config" version = "0.8.7" @@ -1209,22 +1139,7 @@ dependencies = [ "regex", "serde", "thiserror 2.0.16", - "typed-builder 0.21.2", -] - -[[package]] -name = "leptos_dom" -version = "0.7.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f89d4eb263bd5a9e7c49f780f17063f15aca56fd638c90b9dfd5f4739152e87d" -dependencies = [ - "js-sys", - "or_poisoned", - "reactive_graph 0.1.8", - "send_wrapper", - "tachys 0.1.9", - "wasm-bindgen", - "web-sys", + "typed-builder", ] [[package]] @@ -1235,31 +1150,13 @@ checksum = "4e920c8b2fd202b25786b0c72a00c745a6962fa923e600df6f3ec352d844be91" dependencies = [ "js-sys", "or_poisoned", - "reactive_graph 0.2.7", + "reactive_graph", "send_wrapper", - "tachys 0.2.8", + "tachys", "wasm-bindgen", "web-sys", ] -[[package]] -name = "leptos_hot_reload" -version = "0.7.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e80219388501d99b246f43b6e7d08a28f327cdd34ba630a35654d917f3e1788e" -dependencies = [ - "anyhow", - "camino", - "indexmap 2.11.4", - "parking_lot", - "proc-macro2", - "quote", - "rstml", - "serde", - "syn", - "walkdir", -] - [[package]] name = "leptos_hot_reload" version = "0.8.5" @@ -1278,28 +1175,6 @@ dependencies = [ "walkdir", ] -[[package]] -name = "leptos_macro" -version = "0.7.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e621f8f5342b9bdc93bb263b839cee7405027a74560425a2dabea9de7952b1fd" -dependencies = [ - "attribute-derive", - "cfg-if", - "convert_case 0.7.1", - "html-escape", - "itertools", - "leptos_hot_reload 0.7.8", - "prettyplease", - "proc-macro-error2", - "proc-macro2", - "quote", - "rstml", - "server_fn_macro 0.7.8", - "syn", - "uuid", -] - [[package]] name = "leptos_macro" version = "0.8.8" @@ -1311,14 +1186,14 @@ dependencies = [ "convert_case 0.8.0", "html-escape", "itertools", - "leptos_hot_reload 0.8.5", + "leptos_hot_reload", "prettyplease", "proc-macro-error2", "proc-macro2", "quote", "rstml", "rustc_version", - "server_fn_macro 0.8.7", + "server_fn_macro", "syn", "uuid", ] @@ -1331,7 +1206,7 @@ checksum = "2d489e38d3f541e9e43ecc2e3a815527840345a2afca629b3e23fcc1dd254578" dependencies = [ "futures", "indexmap 2.11.4", - "leptos 0.8.9", + "leptos", "or_poisoned", "send_wrapper", "wasm-bindgen", @@ -1344,18 +1219,18 @@ version = "0.8.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6a35447cd0ffcd6fcee0c4e424186c3e967507f36d9d4aaff4ab9976e5faab68" dependencies = [ - "any_spawner 0.3.0", + "any_spawner", "either_of", "futures", "gloo-net", "js-sys", - "leptos 0.8.9", + "leptos", "leptos_router_macro", "or_poisoned", - "reactive_graph 0.2.7", + "reactive_graph", "rustc_version", "send_wrapper", - "tachys 0.2.8", + "tachys", "thiserror 2.0.16", "url", "wasm-bindgen", @@ -1376,42 +1251,33 @@ dependencies = [ [[package]] name = "leptos_server" -version = "0.7.8" +version = "0.8.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "66985242812ec95e224fb48effe651ba02728beca92c461a9464c811a71aab11" +checksum = "38acbf32649a4b127c8d4ccaed8fb388e19a746430a0ea8f8160e51e28c36e2d" dependencies = [ - "any_spawner 0.2.0", + "any_spawner", "base64", "codee", "futures", - "hydration_context 0.2.1", + "hydration_context", "or_poisoned", - "reactive_graph 0.1.8", + "reactive_graph", "send_wrapper", "serde", "serde_json", - "server_fn 0.7.8", - "tachys 0.1.9", + "server_fn", + "tachys", ] [[package]] -name = "leptos_server" -version = "0.8.5" +name = "leptos_transition_group" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38acbf32649a4b127c8d4ccaed8fb388e19a746430a0ea8f8160e51e28c36e2d" +checksum = "eeb1c87b92e7df414c6d2d5dc033a0b413797ffad5c379b996b68cf5695a9bce" dependencies = [ - "any_spawner 0.3.0", - "base64", - "codee", - "futures", - "hydration_context 0.3.0", - "or_poisoned", - "reactive_graph 0.2.7", + "leptos", "send_wrapper", - "serde", - "serde_json", - "server_fn 0.8.7", - "tachys 0.2.8", + "web-sys", ] [[package]] @@ -1810,6 +1676,12 @@ dependencies = [ "yansi", ] +[[package]] +name = "pure-rust-locales" +version = "0.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1190fd18ae6ce9e137184f207593877e70f39b015040156b1e05081cdfe3733a" + [[package]] name = "quote" version = "1.0.40" @@ -1862,38 +1734,17 @@ version = "0.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" -[[package]] -name = "reactive_graph" -version = "0.1.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "76a0ccddbc11a648bd09761801dac9e3f246ef7641130987d6120fced22515e6" -dependencies = [ - "any_spawner 0.2.0", - "async-lock", - "futures", - "guardian", - "hydration_context 0.2.1", - "or_poisoned", - "pin-project-lite", - "rustc-hash", - "send_wrapper", - "serde", - "slotmap", - "thiserror 2.0.16", - "web-sys", -] - [[package]] name = "reactive_graph" version = "0.2.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "37b9e227617c8e257900ea3c9aa536319b138bf961e950a258214edea3c2d591" dependencies = [ - "any_spawner 0.3.0", + "any_spawner", "async-lock", "futures", "guardian", - "hydration_context 0.3.0", + "hydration_context", "indexmap 2.11.4", "or_poisoned", "pin-project-lite", @@ -1906,21 +1757,6 @@ dependencies = [ "web-sys", ] -[[package]] -name = "reactive_stores" -version = "0.1.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aadc7c19e3a360bf19cd595d2dc8b58ce67b9240b95a103fbc1317a8ff194237" -dependencies = [ - "guardian", - "itertools", - "or_poisoned", - "paste", - "reactive_graph 0.1.8", - "reactive_stores_macro 0.1.8", - "rustc-hash", -] - [[package]] name = "reactive_stores" version = "0.2.5" @@ -1932,25 +1768,12 @@ dependencies = [ "itertools", "or_poisoned", "paste", - "reactive_graph 0.2.7", - "reactive_stores_macro 0.2.6", + "reactive_graph", + "reactive_stores_macro", "rustc-hash", "send_wrapper", ] -[[package]] -name = "reactive_stores_macro" -version = "0.1.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "221095cb028dc51fbc2833743ea8b1a585da1a2af19b440b3528027495bf1f2d" -dependencies = [ - "convert_case 0.7.1", - "proc-macro-error2", - "proc-macro2", - "quote", - "syn", -] - [[package]] name = "reactive_stores_macro" version = "0.2.6" @@ -2075,7 +1898,7 @@ version = "0.1.0" dependencies = [ "console_error_panic_hook", "console_log", - "leptos 0.8.9", + "leptos", "leptos_meta", "leptos_router", "log", @@ -2232,17 +2055,6 @@ dependencies = [ "serde_core", ] -[[package]] -name = "serde_qs" -version = "0.13.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cd34f36fe4c5ba9654417139a9b3a20d2e1de6012ee678ad14d240c22c78d8d6" -dependencies = [ - "percent-encoding", - "serde", - "thiserror 1.0.69", -] - [[package]] name = "serde_qs" version = "0.15.0" @@ -2318,36 +2130,6 @@ dependencies = [ "syn", ] -[[package]] -name = "server_fn" -version = "0.7.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8d05a9e3fd8d7404985418db38c6617cc793a1a27f398d4fbc9dfe8e41b804e6" -dependencies = [ - "bytes", - "const_format", - "dashmap", - "futures", - "gloo-net", - "http", - "js-sys", - "once_cell", - "pin-project-lite", - "send_wrapper", - "serde", - "serde_json", - "serde_qs 0.13.0", - "server_fn_macro_default 0.7.8", - "thiserror 2.0.16", - "throw_error 0.2.0", - "url", - "wasm-bindgen", - "wasm-bindgen-futures", - "wasm-streams", - "web-sys", - "xxhash-rust", -] - [[package]] name = "server_fn" version = "0.8.7" @@ -2369,10 +2151,10 @@ dependencies = [ "send_wrapper", "serde", "serde_json", - "serde_qs 0.15.0", - "server_fn_macro_default 0.8.5", + "serde_qs", + "server_fn_macro_default", "thiserror 2.0.16", - "throw_error 0.3.0", + "throw_error", "url", "wasm-bindgen", "wasm-bindgen-futures", @@ -2381,20 +2163,6 @@ dependencies = [ "xxhash-rust", ] -[[package]] -name = "server_fn_macro" -version = "0.7.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "504b35e883267b3206317b46d02952ed7b8bf0e11b2e209e2eb453b609a5e052" -dependencies = [ - "const_format", - "convert_case 0.6.0", - "proc-macro2", - "quote", - "syn", - "xxhash-rust", -] - [[package]] name = "server_fn_macro" version = "0.8.7" @@ -2410,23 +2178,13 @@ dependencies = [ "xxhash-rust", ] -[[package]] -name = "server_fn_macro_default" -version = "0.7.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eb8b274f568c94226a8045668554aace8142a59b8bca5414ac5a79627c825568" -dependencies = [ - "server_fn_macro 0.7.8", - "syn", -] - [[package]] name = "server_fn_macro_default" version = "0.8.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "63eb08f80db903d3c42f64e60ebb3875e0305be502bdc064ec0a0eab42207f00" dependencies = [ - "server_fn_macro 0.8.7", + "server_fn_macro", "syn", ] @@ -2539,47 +2297,13 @@ dependencies = [ "syn", ] -[[package]] -name = "tachys" -version = "0.1.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f66c3b70c32844a6f1e2943c72a33ebb777ad6acbeb20d1329d62e3a7806d6ec" -dependencies = [ - "any_spawner 0.2.0", - "async-trait", - "const_str_slice_concat", - "drain_filter_polyfill", - "dyn-clone", - "either_of", - "futures", - "html-escape", - "indexmap 2.11.4", - "itertools", - "js-sys", - "linear-map", - "next_tuple", - "oco_ref", - "once_cell", - "or_poisoned", - "parking_lot", - "paste", - "reactive_graph 0.1.8", - "reactive_stores 0.1.8", - "rustc-hash", - "send_wrapper", - "slotmap", - "throw_error 0.2.0", - "wasm-bindgen", - "web-sys", -] - [[package]] name = "tachys" version = "0.2.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5db6367a7dfbdb427d421ada82425d804bee78ed5297a7c467c10cc993037923" dependencies = [ - "any_spawner 0.3.0", + "any_spawner", "async-trait", "const_str_slice_concat", "drain_filter_polyfill", @@ -2596,30 +2320,32 @@ dependencies = [ "or_poisoned", "parking_lot", "paste", - "reactive_graph 0.2.7", - "reactive_stores 0.2.5", + "reactive_graph", + "reactive_stores", "rustc-hash", "rustc_version", "send_wrapper", "slotmap", - "throw_error 0.3.0", + "throw_error", "wasm-bindgen", "web-sys", ] [[package]] name = "thaw" -version = "0.4.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "654cf56fe252b8b6f61af4ba47732f6f943ec5aa2df8f18dd07518d577c1d547" +version = "0.5.0-beta" +source = "git+https://github.com/thaw-ui/thaw?branch=main#0492a030cf45582bc7eb729869a2d8578002d318" dependencies = [ "cfg-if", "chrono", + "getset", "icondata_ai", "icondata_core", - "leptos 0.7.8", + "leptos", + "leptos_transition_group", "num-traits", "palette", + "pure-rust-locales", "send_wrapper", "slotmap", "thaw_components", @@ -2632,12 +2358,11 @@ dependencies = [ [[package]] name = "thaw_components" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8963ad3a3d5bf47a64abe12d1deaa4760774751f5953335fe0806fe35645fe3a" +version = "0.4.0-beta" +source = "git+https://github.com/thaw-ui/thaw?branch=main#0492a030cf45582bc7eb729869a2d8578002d318" dependencies = [ "cfg-if", - "leptos 0.7.8", + "leptos", "send_wrapper", "thaw_utils", "uuid", @@ -2647,8 +2372,7 @@ dependencies = [ [[package]] name = "thaw_macro" version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5af50a5123e480e7ee8961e6456f63530816875d0a19cb73060b8e61dd2a95fb" +source = "git+https://github.com/thaw-ui/thaw?branch=main#0492a030cf45582bc7eb729869a2d8578002d318" dependencies = [ "proc-macro2", "quote", @@ -2657,14 +2381,13 @@ dependencies = [ [[package]] name = "thaw_utils" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3a80028493030263acd93d3e21e57a2dd8dd6772c7439de02c4636c63bb1b6b" +version = "0.2.0-beta" +source = "git+https://github.com/thaw-ui/thaw?branch=main#0492a030cf45582bc7eb729869a2d8578002d318" dependencies = [ "cfg-if", "chrono", - "leptos 0.7.8", - "reactive_stores 0.1.8", + "leptos", + "reactive_stores", "send_wrapper", "wasm-bindgen", "web-sys", @@ -2710,15 +2433,6 @@ dependencies = [ "syn", ] -[[package]] -name = "throw_error" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e4ef8bf264c6ae02a065a4a16553283f0656bd6266fc1fcb09fd2e6b5e91427b" -dependencies = [ - "pin-project-lite", -] - [[package]] name = "throw_error" version = "0.3.0" @@ -2886,33 +2600,13 @@ version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e421abadd41a4225275504ea4d6566923418b7f05506fbc9c0fe86ba7396114b" -[[package]] -name = "typed-builder" -version = "0.20.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cd9d30e3a08026c78f246b173243cf07b3696d274debd26680773b6773c2afc7" -dependencies = [ - "typed-builder-macro 0.20.1", -] - [[package]] name = "typed-builder" version = "0.21.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fef81aec2ca29576f9f6ae8755108640d0a86dd3161b2e8bca6cfa554e98f77d" dependencies = [ - "typed-builder-macro 0.21.2", -] - -[[package]] -name = "typed-builder-macro" -version = "0.20.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c36781cc0e46a83726d9879608e4cf6c2505237e263a8eb8c24502989cfdb28" -dependencies = [ - "proc-macro2", - "quote", - "syn", + "typed-builder-macro", ] [[package]] diff --git a/Cargo.toml b/Cargo.toml index 108a636..e0e0265 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -19,7 +19,7 @@ web-sys = { version = "0.3", features = ["Document", "Window"] } [dependencies] rocie-client = { path = "../rocie-server/crates/rocie-client" } leptos = { version = "0.8", features = ["csr"] } -thaw = { version = "0.4", features = ["csr"] } +thaw = { git = "https://github.com/thaw-ui/thaw", branch = "main" } leptos_meta = { version = "0.8" } leptos_router = { version = "0.8" } console_log = "1" diff --git a/index.html b/index.html index 5066b90..77d81f4 100644 --- a/index.html +++ b/index.html @@ -9,7 +9,12 @@ href="public/styles.scss" /> - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/public/styles.scss b/public/styles.scss index 8fe64a1..0b30a70 100644 --- a/public/styles.scss +++ b/public/styles.scss @@ -1,77 +1,52 @@ -/* /* --------------------- Open Props --------------------------- */ */ -/**/ -/* /* the props */ */ -/* @import "https://unpkg.com/open-props"; */ -/**/ -/* /* optional imports that use the props */ */ -/* @import "https://unpkg.com/open-props/normalize.min.css"; */ -/* @import "https://unpkg.com/open-props/buttons.min.css"; */ -/**/ -/* /* ------------------------------------------------------------ */ */ -/**/ -/* body { */ -/* font-family: sans-serif; */ -/* text-align: center; */ -/* } */ -/**/ -/* .container { */ -/* display: flex; */ -/* flex-direction: column; */ -/* justify-content: space-around; */ -/* align-items: center; */ -/* } */ -/**/ -/* .container > .container { */ -/* border-width: 2px; */ -/* border-style: solid; */ -/* border-color: gray; */ -/* border-radius: 30px; */ -/* margin: 0 20px 20px 0; */ -/* } */ -/**/ -/* .box { */ -/* background-color: #ffdddddd; */ -/* } */ -/**/ -/* .nav { */ -/* display: flex; */ -/* flex-direction: row; */ -/* justify-content: space-around; */ -/* align-items: start; */ -/* } */ -/**/ -/* nav > h1 { */ -/* text-align: start; */ -/* margin: 0 auto; */ -/* padding: 0rem; */ -/* } */ -/**/ -/* .buttons { */ -/* display: flex; */ -/* justify-content: space-evenly; */ -/* } */ -/**/ -/* h1, */ -/* h2, */ -/* h3, */ -/* h4, */ -/* h5, */ -/* h6 { */ -/* text-align: center; */ -/* margin: 0 auto; */ -/* padding: 2rem; */ -/* } */ -/**/ -/* p, */ -/* button { */ -/* margin: var(--size-6); */ -/* } */ -/**/ -/* body > picture, */ -/* button { */ -/* display: block; */ -/* margin-left: auto; */ -/* margin-right: auto; */ -/* text-align: center; */ -/* margin: 2rem; */ -/* } */ +/* --------------------- Open Props --------------------------- */ + +/* the props */ +@import "https://unpkg.com/open-props"; + +/* optional imports that use the props */ +@import "https://unpkg.com/open-props/normalize.min.css"; +@import "https://unpkg.com/open-props/buttons.min.css"; + +/* ------------------------------------------------------------ */ + +body { + font-family: sans-serif; + text-align: center; +} + +.container { + display: flex; + flex-direction: column; + justify-content: space-around; + align-items: center; +} + +.buttons { + display: flex; + justify-content: space-evenly; +} + +h1, +h2, +h3, +h4, +h5, +h6 { + text-align: center; + margin: 0 auto; + padding: 2rem; +} + +p, +button { + margin: var(--size-6); +} + +body > picture, +button { + display: block; + margin-left: auto; + margin-right: auto; + text-align: center; + margin: 2rem; +} diff --git a/src/components/container.rs b/src/components/container.rs new file mode 100644 index 0000000..cf7aa5a --- /dev/null +++ b/src/components/container.rs @@ -0,0 +1,34 @@ +use leptos::{ + IntoView, component, + prelude::{Children, ClassAttribute, ElementChild}, + view, +}; +use leptos_meta::Style; + +#[component] +pub fn Container(header: impl IntoView, children: Children) -> impl IntoView { + view! { + + +
+

{header}

+ {children()} +
+ } +} diff --git a/src/components/mod.rs b/src/components/mod.rs index 8b13789..85f9671 100644 --- a/src/components/mod.rs +++ b/src/components/mod.rs @@ -1 +1,6 @@ +// Generic +pub mod container; +// Specific +pub mod product_overview; +pub mod side_header; diff --git a/src/components/product_overview.rs b/src/components/product_overview.rs new file mode 100644 index 0000000..4e95335 --- /dev/null +++ b/src/components/product_overview.rs @@ -0,0 +1,47 @@ +use std::sync::Arc; + +use leptos::{ + IntoView, component, + prelude::{ElementChild, Set, signal}, + task::spawn_local, + view, +}; +use rocie_client::apis::{api_get_product_api::products, configuration::Configuration}; + +use crate::components::container::Container; + +#[component] +pub fn ProductOverview(config: Arc) -> impl IntoView { + let (read_status, write_status) = signal("Loading..".to_owned()); + + { + let local_config = Arc::clone(&config); + + spawn_local(async move { + let products = products(&local_config).await; + + write_status.set( + products + .as_ref() + .map(move |products| { + let products_num = products.len(); + let plural_s = if products_num == 1 { "" } else { "s" }; + let products_value = 2; + let products_currency = "EUR"; + format!( + "You have {products_num} product{plural_s} \ + in stock with a value \ + of {products_value} {products_currency}.", + ) + }) + .unwrap(), + ); + }); + } + + view! { + +

{read_status}

+
+ } +} diff --git a/src/components/side_header.rs b/src/components/side_header.rs new file mode 100644 index 0000000..9cd6777 --- /dev/null +++ b/src/components/side_header.rs @@ -0,0 +1,22 @@ +use leptos::prelude::{AddAnyAttr, ElementChild, IntoView, StyleAttribute, component, view}; +use leptos_router::{NavigateOptions, hooks::use_navigate}; +use thaw::{Flex, FlexJustify, LayoutHeader}; + +#[component] +pub fn SiteHeader() -> impl IntoView { + let navigate = use_navigate(); + + view! { + + + +

"Rocie"

+
+
+ } +} diff --git a/src/lib.rs b/src/lib.rs index 7d58735..357ce93 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -6,6 +6,10 @@ clippy::must_use_candidate, reason = "Can't add it to leptos' components" )] +#![expect( + clippy::needless_pass_by_value, + reason = "Can't add it to leptos' components" +)] mod components; mod pages; @@ -20,7 +24,7 @@ use leptos_router::{ }; use rocie_client::apis::configuration::Configuration; -use crate::pages::home::Home; +use crate::pages::{home::Home, not_found::NotFound}; #[component] pub fn App() -> impl IntoView { @@ -31,7 +35,7 @@ pub fn App() -> impl IntoView { let mut config = Configuration::new(); config.user_agent = Some("rocie-mobile".to_owned()); - config.base_path = "http://127.0.0.1:8080".to_owned(); + "http://127.0.0.1:8080".clone_into(&mut config.base_path); Arc::new(config) }; @@ -45,7 +49,7 @@ pub fn App() -> impl IntoView { - + }> ) -> impl IntoView { - let (read_status, write_status) = signal("Loading..".to_owned()); - - { - let local_config = Arc::clone(&config); + let query_map = use_query_map().get_untracked(); + let navigate = use_navigate(); - spawn_local(async move { - let products = products(&local_config).await; - - write_status.set( - products - .as_ref() - .map(move |products| { - let products_num = products.len(); - let plural_s = if products_num == 1 { "" } else { "s" }; - let products_value = 2; - let products_currency = "EUR"; - format!( - "You have {products_num} product{plural_s} \ - in stock with a value \ - of {products_value} {products_currency}.", - ) - }) - .unwrap(), - ); - }); + // mobile page + if let Some(path) = query_map.get("path") { + navigate(&path, NavigateOptions::default()); } view! { @@ -63,33 +44,12 @@ pub fn Home(config: Arc) -> impl IntoView { } }> - - -
-
-

"Inventory"

- -

{read_status}

-
- -
-

"Recipies"

-
- -
-

"Shopping list"

-
-
+ + + + + + } } diff --git a/stalwart/Trunk.toml b/stalwart/Trunk.toml new file mode 100644 index 0000000..579d138 --- /dev/null +++ b/stalwart/Trunk.toml @@ -0,0 +1,4 @@ +[[hooks]] +stage = "pre_build" +command = "sh" +command_arguments = ["-c", "npx tailwindcss -i input.css -o style/output.css"] diff --git a/stalwart/index.html b/stalwart/index.html new file mode 100644 index 0000000..e7f5dae --- /dev/null +++ b/stalwart/index.html @@ -0,0 +1,32 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + Stalwart Management + + + + + + \ No newline at end of file diff --git a/stalwart/input.css b/stalwart/input.css new file mode 100644 index 0000000..b5c61c9 --- /dev/null +++ b/stalwart/input.css @@ -0,0 +1,3 @@ +@tailwind base; +@tailwind components; +@tailwind utilities; diff --git a/stalwart/package.json b/stalwart/package.json new file mode 100644 index 0000000..32a2cb5 --- /dev/null +++ b/stalwart/package.json @@ -0,0 +1,18 @@ +{ + "name": "stalwart-admin", + "version": "0.1.0", + "description": "", + "main": "index.js", + "scripts": { + "build": "npx tailwindcss -i ./style/input.css -o ./style/output/output.css", + "watch": "npx tailwindcss -i ./style/input.css -o ./style/output/output.css --watch" + }, + "author": "", + "license": "ISC", + "devDependencies": { + "@tailwindcss/forms": "^0.5.7", + "@tailwindcss/typography": "^0.5.10", + "preline": "^1.9.0", + "tailwindcss": "^3.3.5" + } +} diff --git a/stalwart/tailwind.config.js b/stalwart/tailwind.config.js new file mode 100644 index 0000000..f8dfe93 --- /dev/null +++ b/stalwart/tailwind.config.js @@ -0,0 +1,36 @@ +/** @type {import('tailwindcss').Config} */ +module.exports = { + content: ["*.html", "./src/**/*.rs", "./node_modules/preline/dist/*.js"], + theme: { + screens: { + sm: '480px', + md: '768px', + lg: '1020px', + xl: '1440px', + }, + fontFamily: { + sans: ['Inter', 'sans-serif'], + + }, + extend: { + //https://play.tailwindcss.com/VCZwwz1e3R + animation: { + text: 'text 5s ease infinite', + }, + keyframes: { + text: { + '0%, 100%': { + 'background-size': '200% 200%', + 'background-position': 'left center', + }, + '50%': { + 'background-size': '200% 200%', + 'background-position': 'right center', + }, + }, + }, + }, + }, + darkMode: 'class', + plugins: [require('@tailwindcss/forms'), require("@tailwindcss/typography"), require("preline/plugin")], +} -- cgit 1.4.1