Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Thaw/v0.2 #100

Merged
merged 27 commits into from
Feb 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
7d60ac1
Update icondata (#82)
wiyota Jan 26, 2024
fc60bea
feat: sync upstream Icon
luoxiaozero Jan 26, 2024
bf98313
feat: update dependencies and update leptos to v0.6.0-rc1
luoxiaozero Jan 26, 2024
e73a409
feat: remove the default feature of csr
luoxiaozero Jan 26, 2024
6f5414d
feat: update leptos to v0.6.3
luoxiaozero Jan 29, 2024
194387c
Feat/model (#92)
luoxiaozero Jan 29, 2024
4946b99
fix: model word
luoxiaozero Jan 29, 2024
eb50458
feat: ButtonVariant Solid is changed to Outlined
luoxiaozero Jan 29, 2024
587e6e7
feat: Checkbox children can be empty
luoxiaozero Jan 29, 2024
dccf085
Feat/option (#93)
luoxiaozero Jan 31, 2024
d6aee74
feat: rewrite code component
luoxiaozero Jan 31, 2024
3a49826
feat: update leptos to v0.6.4
luoxiaozero Jan 31, 2024
153ca84
ci: update ci workflow
luoxiaozero Feb 1, 2024
67b75bf
style: fmt
luoxiaozero Feb 1, 2024
5fe59d0
pref: cargo clippy
luoxiaozero Feb 1, 2024
ca5e2d9
ci: update ci workflow
luoxiaozero Feb 1, 2024
d68e107
feat: update leptos to v0.6.5
luoxiaozero Feb 1, 2024
fa15e40
feat: change icondata to icondata_core
luoxiaozero Feb 1, 2024
4a7044d
Merge branch 'main' into thaw/v0.2
luoxiaozero Feb 1, 2024
f931be7
v0.2.0-alpha
luoxiaozero Feb 1, 2024
453554f
feat: drawer adds z_index prop
luoxiaozero Feb 3, 2024
8fe168b
feat: drawer adds mount prop
luoxiaozero Feb 5, 2024
810726e
Feat/drawer transition (#97)
luoxiaozero Feb 6, 2024
2c25886
feat: rewrite color (#98)
luoxiaozero Feb 7, 2024
d64eaf8
feat: remove re-export of chrono
luoxiaozero Feb 7, 2024
f2cfa5f
v0.2.0-beta
luoxiaozero Feb 7, 2024
46d0d81
docs: update (#99)
luoxiaozero Feb 9, 2024
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
10 changes: 9 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,14 @@
name: CI
on:
workflow_dispatch:
pull_request:
paths: ["demo/**", "demo_markdown/**", "thaw/**"]
branches:
- main
push:
paths: ["demo/**", "demo_markdown/**", "thaw/**"]
branches:
- thaw/v0.2

jobs:
stable:
Expand Down Expand Up @@ -62,8 +67,11 @@ jobs:
uses: jetli/[email protected]
with:
version: "latest"
- name: Install Cargo BInstall
uses: cargo-bins/cargo-binstall@main
- name: Install Cargo Leptos
run: cargo binstall cargo-leptos -y
- name: Build
run: |
cd ./examples/ssr_axum
cargo install --locked cargo-leptos
cargo leptos build --release
27 changes: 27 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,30 @@
## [0.2.0-beta](https://github.com/thaw-ui/thaw/compare/v0.2.0-alpha...v0.2.0-beta) (2024-02-07)

### Breaking Changes

* `ColorPicker` changes the value type to Color.
* Remove re-export of chrono.

### Features

* `Drawer` adds z_index and mount prop.

## [0.2.0-alpha](https://github.com/thaw-ui/thaw/compare/v0.1.10...v0.2.0-alpha) (2024-02-01)

### Breaking Changes

* Remove the default feature of csr.
* `ButtonVariant::Solid` is changed to `ButtonVariant::Outlined`.
* Change icondata to icondata_core.
* Rewrite `Code` component.
* Update leptos to v0.6.5.

### Features

* Change `RwSignal` to `Model`.
* Change `#[prop(optional)] T` to `#[prop(optional)] OptionalProp<T>`.
* `Checkbox` children can be empty.

## [0.1.10](https://github.com/thaw-ui/thaw/compare/v0.1.9...v0.1.10) (2024-01-31)

### Features
Expand Down
23 changes: 9 additions & 14 deletions demo/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,20 +7,15 @@ edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
leptos = { version = "0.5.7" }
leptos_meta = { version = "0.5.7" }
leptos_router = { version = "0.5.7" }
leptos_devtools = { version = "0.0.1", optional = true}
thaw = { path = "../thaw", default-features = false }
icondata = { version = "0.1.0", features = [
"AiCloseOutlined",
"AiCheckOutlined",
"AiGithubOutlined",
"AiUserOutlined",
"AiSearchOutlined",
"AiUnorderedListOutlined"
] }
leptos = { version = "0.6.5" }
leptos_meta = { version = "0.6.5" }
leptos_router = { version = "0.6.5" }
leptos_devtools = { version = "0.0.1", optional = true }
thaw = { path = "../thaw" }
demo_markdown = { path = "../demo_markdown" }
icondata = "0.3.0"
palette = "0.7.4"
chrono = "0.4.33"

[features]
default = ["csr"]
Expand All @@ -41,4 +36,4 @@ nightly = ["leptos/nightly", "leptos_meta/nightly", "leptos_router/nightly"]
opt-level = 1

[profile.dev.package."*"]
opt-level = 3
opt-level = 3
10 changes: 3 additions & 7 deletions demo/src/components/demo.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ pub fn Demo(demo_code: DemoCode, children: Children) -> impl IntoView {
let content_class = create_memo(move |_| {
theme.with(|theme| {
format!(
"thaw-demo__content color-scheme--{}",
"color-scheme--{}",
theme.common.color_scheme
)
})
Expand All @@ -66,21 +66,17 @@ pub fn Demo(demo_code: DemoCode, children: Children) -> impl IntoView {
</Style>
<div style=move || style.get()>{children()}</div>
<div style=move || code_style.get() class=move || content_class.get()>
<Code>
{
if is_highlight {
view! {
<pre style="margin: 0" inner_html=html></pre>
<Code inner_html=html />
}
} else {
view! {
<pre style="margin: 0">
{html}
</pre>
<Code text=html />
}
}
}
</Code>
</div>
}
}
6 changes: 3 additions & 3 deletions demo/src/components/site_header.rs
Original file line number Diff line number Diff line change
Expand Up @@ -141,14 +141,14 @@ pub fn SiteHeader() -> impl IntoView {
comp_ref=auto_complete_ref
>
<AutoCompletePrefix slot>
<Icon icon=icondata::Icon::from(icondata::AiIcon::AiSearchOutlined) style="font-size: 18px; color: var(--thaw-placeholder-color);"/>
<Icon icon=icondata::AiSearchOutlined style="font-size: 18px; color: var(--thaw-placeholder-color);"/>
</AutoCompletePrefix>
</AutoComplete>
<Popover placement=PopoverPlacement::BottomEnd class="demo-header__menu-popover-mobile">
<PopoverTrigger slot class="demo-header__menu-mobile">
<Button
variant=ButtonVariant::Text
icon=icondata::AiIcon::AiUnorderedListOutlined
icon=icondata::AiUnorderedListOutlined
style="font-size: 22px; padding: 0px 6px;"
/>
</PopoverTrigger>
Expand Down Expand Up @@ -192,7 +192,7 @@ pub fn SiteHeader() -> impl IntoView {
</Button>
<Button
variant=ButtonVariant::Text
icon=icondata::AiIcon::AiGithubOutlined
icon=icondata::AiGithubOutlined
round=true
style="font-size: 22px; padding: 0px 6px;"
on_click=move |_| {
Expand Down
5 changes: 0 additions & 5 deletions demo/src/components/syntect-css.css
Original file line number Diff line number Diff line change
@@ -1,8 +1,3 @@
.thaw-demo__content pre {
font-family: ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas,
Liberation Mono, monospace;
}

/** https://github.com/AmjadHD/sublime_one_theme */

/** light */
Expand Down
3 changes: 2 additions & 1 deletion demo/src/pages/nav_bar/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ use leptos::*;
use thaw::mobile::{NavBar, NavBarRight};
use thaw::Icon;


#[component]
pub fn NavBarPage() -> impl IntoView {
view! {
Expand Down Expand Up @@ -32,7 +33,7 @@ pub fn NavBarDemoPage() -> impl IntoView {
on_click_right=on_click_right
>
<NavBarRight slot>
<Icon icon=icondata::Icon::from(icondata::AiIcon::AiCloseOutlined)/>
<Icon icon=icondata::AiCloseOutlined/>
</NavBarRight>
</NavBar>
<div style="padding-top: 50px">{move || click_text.get()}</div>
Expand Down
2 changes: 1 addition & 1 deletion demo/src/pages/tabbar/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ pub fn TabbarDemoPage() -> impl IntoView {
{move || value.get()} <Tabbar value>
<TabbarItem key="a">"and"</TabbarItem>
<TabbarItem key="i">"if"</TabbarItem>
<TabbarItem key="o" icon=icondata::AiIcon::AiCloseOutlined>
<TabbarItem key="o" icon=icondata::AiCloseOutlined>
"or"
</TabbarItem>
</Tabbar>
Expand Down
8 changes: 4 additions & 4 deletions demo_markdown/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ edition = "2021"
proc-macro = true

[dependencies]
quote = "1.0.33"
comrak = "0.20.0"
proc-macro2 = "1.0.71"
syn = "2.0.43"
quote = "1.0.35"
comrak = "0.21.0"
proc-macro2 = "1.0.78"
syn = "2.0.48"
syntect = "5.1.0"
2 changes: 1 addition & 1 deletion demo_markdown/docs/_guide/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@
Installation thaw

```shell
cargo add thaw
cargo add thaw --features=csr
```
4 changes: 2 additions & 2 deletions demo_markdown/docs/_guide/server_sider_rendering.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
To enable the ssr mode, the following configurations are required:

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

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

```toml
thaw = { ..., default-features = false, features = ["hydrate"] }
thaw = { ..., features = ["hydrate"] }
```
14 changes: 7 additions & 7 deletions demo_markdown/docs/_mobile/nav_bar/mod.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ view! {
on_click_right=on_click_right
>
<NavBarRight slot>
<Icon icon=icondata::Icon::from(icondata::AiIcon::AiCloseOutlined)/>
<Icon icon=icondata::AiCloseOutlined/>
</NavBarRight>
</NavBar>
<div style="padding-top: 50px">{move || click_text.get()}</div>
Expand All @@ -29,16 +29,16 @@ view! {

| Name | Type | Default | Description |
| --- | --- | --- | --- |
| class | `MaybeSignal<String>` | `Default::default()` | Addtional classes for the NavBar element. |
| class | `OptionalProp<MaybeSignal<String>>` | `Default::default()` | Addtional classes for the NavBar element. |
| title | `MaybeSignal<String>` | `Default::default()` | NavBar title. |
| left_arrow | `MaybeSignal<bool>` | `false` | Whether to show left arrow. |
| left_text | `MaybeSignal<String>` | `Default::default()` | NavBar left text. |
| left_text | `OptionalProp<MaybeSignal<String>>` | `Default::default()` | NavBar left text. |
| on_click_left | `Option<Callback<ev::MouseEvent>>` | `Default::default()` | NavBar left click. |
| right_text | `MaybeSignal<String>` | `Default::default()` | NavBar right text. |
| right_text | `OptionalProp<MaybeSignal<String>>` | `Default::default()` | NavBar right text. |
| on_click_right | `Option<Callback<ev::MouseEvent>>` | `Default::default()` | NavBar right click. |

### NavBarLeft and NavBarRight Props

| Name | Type | Default | Description |
| --- | --- | --- | --- |
| class | `MaybeSignal<String>` | `Default::default()` | Addtional classes for the element. |
| Name | Type | Default | Description |
| ----- | ----------------------------------- | -------------------- | ---------------------------------- |
| class | `OptionalProp<MaybeSignal<String>>` | `Default::default()` | Addtional classes for the element. |
10 changes: 5 additions & 5 deletions demo_markdown/docs/_mobile/tabbar/mod.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ view! {
<Tabbar value>
<TabbarItem key="a">"and"</TabbarItem>
<TabbarItem key="i">"if"</TabbarItem>
<TabbarItem key="o" icon=icondata::AiIcon::AiCloseOutlined>
<TabbarItem key="o" icon=icondata::AiCloseOutlined>
"or"
</TabbarItem>
</Tabbar>
Expand All @@ -21,10 +21,10 @@ view! {

### Tabbar Props

| Name | Type | Default | Description |
| -------- | ------------------ | -------------------- | ----------------- |
| value | `RwSignal<String>` | `Default::default()` | Tabbar's value. |
| children | `Children` | | Tabbar's content. |
| Name | Type | Default | Description |
| -------- | --------------- | -------------------- | ----------------- |
| value | `Model<String>` | `Default::default()` | Tabbar's value. |
| children | `Children` | | Tabbar's content. |

### TabbarItem Props

Expand Down
12 changes: 6 additions & 6 deletions demo_markdown/docs/alert/mod.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ view! {

### Alert Props

| Name | Type | Default | Description |
| -------- | --------------------------- | -------------------- | ----------------------------------------- |
| class | `MaybeSignal<String>` | `Default::default()` | Additional classes for the alert element. |
| title | `MaybeSignal<String>` | `Default::default()` | Title of the alert. |
| variant | `MaybeSignal<AlertVariant>` | | Alert variant. |
| children | `Children` | | The content of the alert. |
| Name | Type | Default | Description |
| -------- | ----------------------------------- | -------------------- | ----------------------------------------- |
| class | `OptionalProp<MaybeSignal<String>>` | `Default::default()` | Additional classes for the alert element. |
| title | `Option<MaybeSignal<String>>` | `Default::default()` | Title of the alert. |
| variant | `MaybeSignal<AlertVariant>` | | Alert variant. |
| children | `Children` | | The content of the alert. |
10 changes: 5 additions & 5 deletions demo_markdown/docs/auto_complete/mod.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,12 @@ view! {
<Space vertical=true>
<AutoComplete>
<AutoCompletePrefix slot>
<Icon icon=icondata::Icon::from(icondata::AiIcon::AiUserOutlined)/>
<Icon icon=icondata::AiUserOutlined/>
</AutoCompletePrefix>
</AutoComplete>
<AutoComplete>
<AutoCompleteSuffix slot>
<Icon icon=icondata::Icon::from(icondata::AiIcon::AiGithubOutlined)/>
<Icon icon=icondata::AiGithubOutlined/>
</AutoCompleteSuffix>
</AutoComplete>
</Space>
Expand All @@ -60,9 +60,9 @@ view! {

| Name | Type | Default | Description |
| --- | --- | --- | --- |
| class | `MaybeSignal<String>` | `Default::default()` | Additional classes for the autocomplete element. |
| value | `RwSignal<String>` | `Default::default()` | Input of autocomplete. |
| placeholder | `RwSignal<String>` | `Default::default()` | Autocomplete's placeholder. |
| class | `OptionalProp<MaybeSignal<String>>` | `Default::default()` | Additional classes for the autocomplete element. |
| value | `Model<String>` | `Default::default()` | Input of autocomplete. |
| placeholder | `OptionalProp<RwSignal<String>>` | `Default::default()` | Autocomplete's placeholder. |
| options | `MaybeSignal<Vec<AutoCompleteOption>>` | `Default::default()` | Options to autocomplete from. |
| disabled | `MaybeSignal<bool>` | `false` | Whether the input is disabled. |
| invalid | `MaybeSignal<bool>` | `false` | Whether the input is invalid. |
Expand Down
12 changes: 6 additions & 6 deletions demo_markdown/docs/avatar/mod.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ view! {

### Avatar Props

| Name | Type | Default | Description |
| ----- | --------------------- | -------------------- | ----------------------------------------- |
| class | `MaybeSignal<String>` | `Default::default()` | Addtional classes for the avatar element. |
| src | `MaybeSignal<String>` | `Default::default()` | Avatar's image source. |
| round | `MaybeSignal<bool>` | `false` | Whether to display a rounded avatar. |
| size | `MaybeSignal<u16>` | `30` | Avatar's size. |
| Name | Type | Default | Description |
| ----- | ----------------------------------- | -------------------- | ----------------------------------------- |
| class | `OptionalProp<MaybeSignal<String>>` | `Default::default()` | Addtional classes for the avatar element. |
| src | `Option<MaybeSignal<String>>` | `Default::default()` | Avatar's image source. |
| round | `MaybeSignal<bool>` | `false` | Whether to display a rounded avatar. |
| size | `MaybeSignal<u16>` | `30` | Avatar's size. |
2 changes: 1 addition & 1 deletion demo_markdown/docs/badge/mod.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ view! {

| Name | Type | Default | Description |
| --- | --- | --- | --- |
| class | `MaybeSignal<String>` | `Default::default()` | Addtional classes for the badge element. |
| class | `OptionalProp<MaybeSignal<String>>` | `Default::default()` | Addtional classes for the badge element. |
| value | `MaybeSignal<u32>` | `0` | Badge's value. |
| max | `MaybeSignal<u32>` | `u32::MAX` | The maximum number of the badge when its value overflows. |
| variant | `MaybeSignal<BadgeVariant>` | `BadgeVariant::Error` | Badge variant. |
Expand Down
18 changes: 9 additions & 9 deletions demo_markdown/docs/breadcrumb/mod.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,15 @@ view! {

### Breadcrumb Props

| Name | Type | Default | Description |
| --------- | --------------------- | -------------------- | --------------------------------------------- |
| class | `MaybeSignal<String>` | `Default::default()` | Addtional classes for the breadcrumb element. |
| separator | `MaybeSignal<String>` | `/` | Breadcrumb separator. |
| children | `Children` | | Breadcrumb's content. |
| Name | Type | Default | Description |
| --- | --- | --- | --- |
| class | `OptionalProp<MaybeSignal<String>>` | `Default::default()` | Addtional classes for the breadcrumb element. |
| separator | `MaybeSignal<String>` | `/` | Breadcrumb separator. |
| children | `Children` | | Breadcrumb's content. |

### BreadcrumbItem Props

| Name | Type | Default | Description |
| -------- | --------------------- | -------------------- | -------------------------------------------------- |
| class | `MaybeSignal<String>` | `Default::default()` | Addtional classes for the breadcrumb link element. |
| children | `Children` | | BreadcrumbItem's content. |
| Name | Type | Default | Description |
| --- | --- | --- | --- |
| class | `OptionalProp<MaybeSignal<String>>` | `Default::default()` | Addtional classes for the breadcrumb link element. |
| children | `Children` | | BreadcrumbItem's content. |
Loading
Loading