Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
d6b33de
feat: update leptos to v0.8.0-alpha
lizidev Mar 5, 2025
e4900b5
feat: Theme is changed to use getset
lizidev Mar 5, 2025
bb19e28
feat: RatingColor adds Marigold attribute
lizidev Mar 5, 2025
de2c839
feat: update ci.yml
lizidev Mar 6, 2025
603bbb4
feat: adds Swatinem/rust-cache@v2
lizidev Mar 6, 2025
98f06b6
feat: Update ssr_axum dependency
lizidev Mar 6, 2025
e48da46
feat: Position of style elements
lizidev Mar 8, 2025
3ec66a5
feat: generify menu and menu item (#390)
geovie Mar 12, 2025
1da1adc
feat: Update leptos to v0.8.0-beta
lizidev Mar 24, 2025
c6c0cc4
fix: Update leptos to v0.8.0-beta
lizidev Mar 24, 2025
a90ebb8
feat: InputType adds Number prop
lizidev Mar 24, 2025
cfa4992
feat: The icon prop of Icon is changed to icondata_core::Icon type
lizidev Mar 24, 2025
c8a6c65
Feat/tree compnent (#392)
lizidev Mar 29, 2025
b153faa
Merge branch 'main' into thaw/v0.5
lizidev Mar 30, 2025
5d4e8a6
feat: remove NextFrame
lizidev Mar 30, 2025
a4d58b9
v0.5.0-alpha
lizidev Mar 30, 2025
636ccfe
feat: Update leptos to v0.8.0-rc2
lizidev Apr 19, 2025
8c5f1d4
refactor: get_placement_style
lizidev Apr 19, 2025
acdb4f5
fix: The arrow position of the InfoLabel component
lizidev Apr 19, 2025
fb67f7a
feat: Update leptos to v0.8.0
lizidev May 3, 2025
a7c2f3e
Merge branch 'main' into thaw/v0.5
lizidev May 3, 2025
d576add
v0.5.0-beta
lizidev May 3, 2025
4137e96
feat: Add disabled for checkbox (#412)
marcfir Jun 4, 2025
96e76ad
feat: Update leptos to v0.8.5
lizidev Jul 23, 2025
11beba7
docs: Removed misleading part of server-side rendering article
lizidev Jul 23, 2025
1ab0f2b
feat: localize calendar/date picker (#425)
dzamlo Jul 30, 2025
d16ac3a
add input_size property to spin_button (#426)
kandrelczyk Aug 1, 2025
67b775d
feat: add hydrate_async implementation. closes #427 (#428)
lukexor Aug 6, 2025
19c18fb
Fix Follower Positioning bug in scrollable windows (#429)
Jazzpirate Aug 9, 2025
cd24ab4
feat: update README
lizidev Aug 12, 2025
ddc14f0
Merge branch 'main' into thaw/v0.5
lizidev Aug 12, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 7 additions & 10 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ jobs:
toolchain: stable
target: wasm32-unknown-unknown
override: true
- uses: Swatinem/rust-cache@v2
- name: Install Trunk
uses: jetli/trunk-action@v0.4.0
with:
Expand All @@ -47,6 +48,7 @@ jobs:
toolchain: nightly
target: wasm32-unknown-unknown
override: true
- uses: Swatinem/rust-cache@v2
- name: Install Trunk
uses: jetli/trunk-action@v0.4.0
with:
Expand All @@ -67,14 +69,11 @@ jobs:
toolchain: stable
target: wasm32-unknown-unknown
override: true
- name: Install Trunk
uses: jetli/trunk-action@v0.4.0
with:
version: "latest"
- uses: Swatinem/rust-cache@v2
- name: Install Cargo BInstall
uses: cargo-bins/cargo-binstall@main
- name: Install Cargo Leptos
run: cargo binstall cargo-leptos -y
run: cargo binstall cargo-leptos --locked --no-confirm
- name: Build
run: |
cd ./examples/ssr_axum
Expand All @@ -91,14 +90,11 @@ jobs:
toolchain: nightly
target: wasm32-unknown-unknown
override: true
- name: Install Trunk
uses: jetli/trunk-action@v0.4.0
with:
version: "latest"
- uses: Swatinem/rust-cache@v2
- name: Install Cargo BInstall
uses: cargo-bins/cargo-binstall@main
- name: Install Cargo Leptos
run: cargo binstall cargo-leptos -y
run: cargo binstall cargo-leptos --locked --no-confirm
- name: Build
run: |
cd ./examples/ssr_axum
Expand All @@ -116,6 +112,7 @@ jobs:
toolchain: stable
target: wasm32-unknown-unknown
override: true
- uses: Swatinem/rust-cache@v2
- name: cargo test
run: |
cd thaw_utils
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/demo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ jobs:
toolchain: stable
target: wasm32-unknown-unknown
override: true
- uses: Swatinem/rust-cache@v2
- name: Install Trunk
uses: jetli/trunk-action@v0.4.0
with:
Expand Down
28 changes: 27 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,29 @@
## [0.5.0-beta](https://github.com/thaw-ui/thaw/compare/v0.5.0-alpha...v0.5.0-beta) (2025-05-04)

### Bug Fixs

* The arrow position of the InfoLabel component.

### Breaking Changes

* Update leptos to v0.8.0.

## [0.5.0-alpha](https://github.com/thaw-ui/thaw/compare/v0.4.5...v0.5.0-alpha) (2025-03-30)

### Features

* Adds `Tree` component, closes [#392](https://github.com/thaw-ui/thaw/pull/392).
* `Menu` is changed to a generic component, closes [#390](https://github.com/thaw-ui/thaw/pull/390).

### Breaking Changes

* Update leptos to v0.8.0-beta.
* Theme is changed to use getset.
* RatingColor adds Marigold prop.
* InputType adds Number prop.
* The icon prop of `Icon` is changed to icondata_core::Icon type.
* The value prop of `MenuItem` is changed to generic type.

## [0.4.8](https://github.com/thaw-ui/thaw/compare/v0.4.7...v0.4.8) (2025-08-03)

### Features
Expand Down Expand Up @@ -94,4 +120,4 @@

### 0.1.0-beta2 - 0.4.0-rc (2023-11-14 - 2024-12-09)

See [0.1 - 0.4 changelog](./changelog/CHANGELOG-0.1-0.4.md)
See [0.1 - 0.4 changelog](./changelogs/CHANGELOG-0.1-0.4.md)
18 changes: 11 additions & 7 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,16 @@ exclude = ["examples"]
rust-version = "1.79"

[workspace.dependencies]
thaw = { version = "0.4.8", path = "./thaw" }
thaw_components = { version = "0.3.2", path = "./thaw_components" }
thaw = { version = "0.5.0-beta", path = "./thaw" }
thaw_components = { version = "0.4.0-beta", path = "./thaw_components" }
thaw_macro = { version = "0.1.0", path = "./thaw_macro" }
thaw_utils = { version = "0.1.2", path = "./thaw_utils" }
thaw_utils = { version = "0.2.0-beta", path = "./thaw_utils" }

leptos = { version = "0.7.7" }
leptos_meta = { version = "0.7.7" }
leptos_router = { version = "0.7.7" }
reactive_stores = { version = "0.1.7" }
# leptos
leptos = { version = "0.8.5" }
leptos_meta = { version = "0.8.5" }
leptos_router = { version = "0.8.5" }
reactive_stores = { version = "0.2.5" }

# web
wasm-bindgen = { version = "0.2.100" }
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2023 luoxiaozero
Copyright (c) 2023 lizidev

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ You can refer to the [thaw-template](https://github.com/thaw-ui/thaw-template) r
| Crate version | Compatible Leptos version |
| ------------------------------------------------------------------------ | ------------------------- |
| 0.3 / [thaw-v0.3 branch](https://github.com/thaw-ui/thaw/tree/thaw-v0.3) | 0.6 |
| 0.4 / main branch | 0.7 |
| 0.4 / [thaw-v0.4 branch](https://github.com/thaw-ui/thaw/tree/thaw-v0.4) | 0.7 |
| 0.5-beta / main branch | 0.8 |

## Resources

Expand Down
2 changes: 1 addition & 1 deletion demo/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ uuid = { version = "1.10.0", features = ["v4", "js"] }
console_error_panic_hook = "0.1.7"
console_log = "1"
log = "0.4"
js-sys = "0.3.70"
js-sys = "0.3.74"
gloo-net = { version = "0.6.0" }

[features]
Expand Down
1 change: 1 addition & 0 deletions demo/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
href="/favicon.ico"
type="image/x-icon"
/>
<meta name="thaw-ui-style"/>
<link data-trunk rel="copy-file" href="./src/assets/svg/grid_dot.svg" />
<link data-trunk rel="copy-file" href="./src/assets/favicon.ico" />
<link
Expand Down
3 changes: 3 additions & 0 deletions demo/src/app.rs
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@ fn TheRouter() -> impl IntoView {
<Route path=path!("/server-sider-rendering") view=ServerSiderRenderingMdPage />
<Route path=path!("/development/components") view=DevelopmentComponentsMdPage />
<Route path=path!("/customize-theme") view=CustomizeThemeMdPage />
<Route path=path!("/style-element-position") view=StyleElementPositionMdPage />
<Route path=path!("/internationalization") view=InternationalizationMdPage />
<Route path=path!("/FAQs") view=FAQsMdPage />
</ParentRoute>
<ParentRoute path=path!("/components") view=ComponentsPage>
Expand Down Expand Up @@ -120,6 +122,7 @@ fn TheRouter() -> impl IntoView {
<Route path=path!("/time-picker") view=TimePickerMdPage />
<Route path=path!("/toast") view=ToastMdPage />
<Route path=path!("/tooltip") view=TooltipMdPage />
<Route path=path!("/tree") view=TreeMdPage />
<Route path=path!("/upload") view=UploadMdPage />
</ParentRoute>
</Routes>
Expand Down
9 changes: 7 additions & 2 deletions demo/src/components/demo.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ pub fn Demo(
let css_vars = Memo::new(move |_| {
let mut css_vars = String::new();
theme.with(|theme| {
if theme.color.color_scheme == "dark" {
if theme.color.color_scheme() == "dark" {
css_vars.push_str("--demo-border-color: #383f52;");
css_vars.push_str("--demo-background-color: #242832;");
} else {
Expand All @@ -32,7 +32,12 @@ pub fn Demo(
});

let code_class = Memo::new(move |_| {
theme.with(|theme| format!("demo-demo__code color-scheme--{}", theme.color.color_scheme))
theme.with(|theme| {
format!(
"demo-demo__code color-scheme--{}",
theme.color.color_scheme()
)
})
});
let is_show_code = RwSignal::new(children.is_none());

Expand Down
27 changes: 17 additions & 10 deletions demo/src/components/site_header.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,14 @@ use leptos_router::hooks::use_navigate;
// use leptos_use::{storage::use_local_storage, utils::FromToStringCodec};
use thaw::*;

#[derive(Clone)]
enum HeaderAction {
ChangeTheme,
Github,
Discord,
Navigate(&'static str),
}

#[component]
pub fn SiteHeader() -> impl IntoView {
let navigate = use_navigate();
Expand Down Expand Up @@ -172,19 +180,18 @@ pub fn SiteHeader() -> impl IntoView {
</AutoComplete>
<Menu
position=MenuPosition::BottomEnd
on_select=move |value: String| match value.as_str() {
"Dark" => change_theme(MouseEvent::new("click").unwrap()),
"Light" => change_theme(MouseEvent::new("click").unwrap()),
"github" => {
on_select=move |value: HeaderAction| match value {
HeaderAction::ChangeTheme => change_theme(MouseEvent::new("click").unwrap()),
HeaderAction::Github => {
_ = window().open_with_url("http://github.com/thaw-ui/thaw");
}
"discord" => {
HeaderAction::Discord => {
_ = window()
.open_with_url(
"https://discord.gg/uMGvWBDV",
);
}
_ => navigate_signal.get()(&value, Default::default()),
HeaderAction::Navigate(value) => navigate_signal.get()(&value, Default::default()),
}
>
<MenuTrigger slot>
Expand All @@ -195,11 +202,11 @@ pub fn SiteHeader() -> impl IntoView {
attr:style="font-size: 22px; padding: 0px 6px;"
/>
</MenuTrigger>
<MenuItem value=theme_name>{theme_name}</MenuItem>
<MenuItem icon=icondata::AiGithubOutlined value="github">
<MenuItem value=HeaderAction::ChangeTheme>{theme_name}</MenuItem>
<MenuItem value=HeaderAction::Github icon=icondata::AiGithubOutlined>
"Github"
</MenuItem>
<MenuItem icon=icondata::BiDiscordAlt value="discord">
<MenuItem value=HeaderAction::Discord icon=icondata::BiDiscordAlt>
"Discord"
</MenuItem>
{
Expand All @@ -216,7 +223,7 @@ pub fn SiteHeader() -> impl IntoView {
.into_iter()
.map(|item| {
let NavItemOption { label, value, .. } = item;
view! { <MenuItem value=value>{label}</MenuItem> }
view! { <MenuItem value=HeaderAction::Navigate(value)>{label}</MenuItem> }
})
.collect_view()}
}
Expand Down
15 changes: 15 additions & 0 deletions demo/src/pages/components.rs
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,16 @@ pub(crate) fn gen_nav_data() -> Vec<NavGroupOption> {
value: "/guide/customize-theme",
label: "Customize Theme",
},
NavItemOption {
group: Some("Theme"),
value: "/guide/style-element-position",
label: "Style Element Position",
},
NavItemOption {
group: None,
value: "/guide/internationalization",
label: "Internationalization",
},
NavItemOption {
group: None,
value: "/guide/FAQs",
Expand Down Expand Up @@ -469,6 +479,11 @@ pub(crate) fn gen_nav_data() -> Vec<NavGroupOption> {
value: "/components/tooltip",
label: "Tooltip",
},
NavItemOption {
group: None,
value: "/components/tree",
label: "Tree",
},
NavItemOption {
group: None,
value: "/components/upload",
Expand Down
5 changes: 4 additions & 1 deletion demo_markdown/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,7 @@ quote = "1.0.36"
comrak = "0.26.0"
proc-macro2 = "1.0.86"
syn = "2.0.74"
syntect = "5.2.0"
syntect = "5.2.0"

# fix: https://github.com/jhpratt/deranged/issues/17
deranged = "=0.4.0"
52 changes: 52 additions & 0 deletions demo_markdown/docs/_guide/internationalization.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
# Internationalization

Some component, `Calendar` and `DatePicker`, can use another locale that the default.

You can use one of the provided locales:
```rust
use thaw::locales;
let locale = RwSignal::new(LocaleConfig::from(locales::EnUS));
```

Or you can create your own struct that implement the `LocaleExt` trait:
```rust
use thaw::locales::LocaleExt;
pub struct MyStruct;
impl LocaleExt for MyStruct {
fn locale(&self) -> &Locale {todo!()}
fn today(&self) -> &'static str {todo!()}
}
let locale = RwSignal::new(LocaleConfig::from(MyStruct));
```

When you have your `RwSignal<LocaleConfig>`, you can pass it to the `ConfigProvider` via the
`locale` props:
```rust
view! {
<ConfigProvider locale>
...
</ConfigProvider>
}
```

If you need to change the locale, but don't have access to the `RwSignal` you passed to the `ConfigProvider`, you can call the `LocaleConfig::use_rw_locale()` function to get a `RwSignal` of the locale.

Here is a demo of it working:
```rust demo
use chrono::prelude::*;
use Locale;
let value = RwSignal::new(Local::now().date_naive());

let locale = LocaleConfig::use_rw_locale();

view! {
<Space vertical=true>
<Space>
<Button on_click=move |_| locale.set(locales::EnUS.into())>"set locale to en_US"</Button>
<Button on_click=move |_| locale.set(locales::FrFR.into())>"set locale to fr_FR"</Button>
</Space>
<DatePicker value/>
<Calendar value />
</Space>
}
```
14 changes: 0 additions & 14 deletions demo_markdown/docs/_guide/server_sider_rendering.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,20 +30,6 @@ For [start-axum](https://github.com/leptos-rs/start-axum), it is in the [src/app

For [start-actix](https://github.com/leptos-rs/start-actix), it is in the [src/main.rs](https://github.com/leptos-rs/start-actix/blob/943b1ad428072267f32217de4c62896f2bf70459/src/main.rs#L33) file.

## Features

To enable the ssr mode, the following configurations are required:

```toml
thaw = { ..., features = ["ssr"] }
```

To enable the hydrate mode, the following configurations are required:

```toml
thaw = { ..., features = ["hydrate"] }
```

## cargo-leptos

If you use [cargo-leptos](https://github.com/leptos-rs/cargo-leptos), Remember to add thaw to your `Cargo.toml` file in the corresponding feature, e.g.
Expand Down
6 changes: 3 additions & 3 deletions demo_markdown/docs/_guide/theme/customize_theme.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
let theme = RwSignal::new(Theme::light());
let on_customize_theme = move |_| {
theme.update(|theme| {
theme.color.color_brand_background = "#f5222d".to_string();
theme.color.color_brand_background_hover = "#ff4d4f".to_string();
theme.color.color_brand_background_pressed = "#cf1322".to_string();
theme.color.set_color_brand_background("#f5222d".to_string());
theme.color.set_color_brand_background_hover("#ff4d4f".to_string());
theme.color.set_color_brand_background_pressed("#cf1322".to_string());
});
};

Expand Down
Loading
Loading