Skip to content

Commit

Permalink
Merge branch 'RustForWeb:main' into update/leptos-0.7-compose-refs
Browse files Browse the repository at this point in the history
  • Loading branch information
geoffreygarrett authored Jan 6, 2025
2 parents 79dea86 + 771d820 commit 9f1cd6d
Show file tree
Hide file tree
Showing 999 changed files with 23,630 additions and 8,699 deletions.
167 changes: 167 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,7 @@
members = [
"book-examples/*/*",
"packages/colors",
"packages/icons/dioxus",
"packages/icons/yew",
"packages/icons/*",
"packages/primitives/leptos/accessible-icon",
"packages/primitives/leptos/arrow",
"packages/primitives/leptos/aspect-ratio",
Expand Down
5 changes: 1 addition & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,10 @@ Rust port of [Radix](https://www.radix-ui.com).

Rust Radix is available for these Rust frameworks:

- [Dioxus](https://dioxuslabs.com/)
- [Leptos](./packages/primitives/leptos)
- [Yew](https://yew.rs/)

The following frameworks are under consideration:

- [Dioxus](https://dioxuslabs.com/)

See [the Rust Radix book](https://radix.rustforweb.org/introduction.html#frameworks) for more information.

## Documentation
Expand Down
21 changes: 21 additions & 0 deletions book-examples/dioxus/icons/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
[package]
name = "radix-dioxus-book-icons"
description = "Book examples for Radix Icons Dioxus."
publish = false

authors.workspace = true
edition.workspace = true
license.workspace = true
repository.workspace = true
version.workspace = true

[dependencies]
console_error_panic_hook.workspace = true
console_log.workspace = true
log.workspace = true
radix-dioxus-icons = { path = "../../../packages/icons/dioxus", optional = true }
dioxus = { workspace = true, features = ["web"] }

[features]
default = []
icons = ["dep:radix-dioxus-icons"]
7 changes: 7 additions & 0 deletions book-examples/dioxus/icons/Trunk.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
[[hooks]]
stage = "pre_build"
command = "sh"
command_arguments = [
"-c",
"npx tailwindcss -i style/tailwind.css -o style/tailwind.output.css",
]
14 changes: 14 additions & 0 deletions book-examples/dioxus/icons/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<!doctype html>
<html>
<head>
<title>Radix Icons Dioxus</title>

<link data-trunk rel="css" href="/style/tailwind.output.css" />

<script data-trunk type="application/javascript" src="/main.js"></script>
</head>
<body
id="main"
class="from-purple9 to-indigo9 h-full bg-[linear-gradient(330deg,var(--tw-gradient-stops))] py-[100px]"
></body>
</html>
13 changes: 13 additions & 0 deletions book-examples/dioxus/icons/main.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
document.addEventListener('DOMContentLoaded', () => {
const resizeObserver = new ResizeObserver(() => {
if (window.top) {
window.top.postMessage({
mdbookTrunk: {
width: document.body.scrollWidth,
height: document.body.scrollHeight
}
});
}
});
resizeObserver.observe(document.body);
});
20 changes: 20 additions & 0 deletions book-examples/dioxus/icons/src/app.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
use dioxus::prelude::*;

#[component]
pub fn App() -> Element {
#[allow(unused_mut)]
let mut children: Vec<Result<VNode, RenderError>> = vec![];

#[cfg(feature = "icons")]
{
use crate::icons::Icons;

children.push(rsx! {
Icons {}
});
}

rsx! {
div { class: "w-full h-full flex justify-center items-center", {children.iter()} }
}
}
Loading

0 comments on commit 9f1cd6d

Please sign in to comment.