From e123aec56085f9ab79c6cc692747d2a467a9c6ea Mon Sep 17 00:00:00 2001 From: luoxiao Date: Tue, 13 Aug 2024 10:54:29 +0800 Subject: [PATCH] feat(docs): adds component prop --- demo_markdown/docs/progress_bar/mod.md | 56 --------- demo_markdown/docs/radio/mod.md | 48 -------- demo_markdown/docs/skeleton/mod.md | 18 --- demo_markdown/docs/slider/mod.md | 56 --------- demo_markdown/docs/switch/mod.md | 16 --- demo_markdown/docs/tab_list/mod.md | 45 ------- demo_markdown/docs/tag/mod.md | 34 ------ demo_markdown/docs/text/mod.md | 21 ---- demo_markdown/docs/textarea/mod.md | 35 ------ demo_markdown/docs/time_picker/mod.md | 23 ---- demo_markdown/docs/toast/mod.md | 64 ---------- demo_markdown/docs/upload/mod.md | 57 --------- demo_markdown/src/lib.rs | 36 +++--- .../popover => thaw/src/popover/docs}/mod.md | 23 ++-- thaw/src/popover/mod.rs | 12 +- thaw/src/progress_bar/docs/mod.md | 56 +++++++++ thaw/src/progress_bar/progress_bar.rs | 12 +- thaw/src/progress_bar/progress_circle.rs | 12 +- thaw/src/radio/docs/mod.md | 42 +++++++ thaw/src/radio/mod.rs | 7 +- .../src/scrollbar/docs}/mod.md | 23 ++-- thaw/src/scrollbar/mod.rs | 8 +- thaw/src/skeleton/docs/mod.md | 22 ++++ thaw/src/slider/docs/mod.md | 58 +++++++++ thaw/src/slider/mod.rs | 16 ++- thaw/src/slider/slider_label.rs | 4 +- .../docs/space => thaw/src/space/docs}/mod.md | 16 +-- thaw/src/space/mod.rs | 12 +- .../src/spin_button/docs}/mod.md | 33 ++++- thaw/src/spin_button/mod.rs | 33 +++-- .../spinner => thaw/src/spinner/docs}/mod.md | 9 +- thaw/src/switch/docs/mod.md | 17 +++ thaw/src/switch/mod.rs | 4 +- thaw/src/tab_list/docs/mod.md | 38 ++++++ thaw/src/tab_list/tab.rs | 1 + .../docs/table => thaw/src/table/docs}/mod.md | 13 +- thaw/src/tag/docs/mod.md | 33 +++++ thaw/src/tag/mod.rs | 8 +- thaw/src/text/docs/mod.md | 22 ++++ thaw/src/textarea/docs/mod.md | 53 ++++++++ thaw/src/textarea/mod.rs | 28 +++-- thaw/src/time_picker/docs/mod.md | 22 ++++ thaw/src/time_picker/mod.rs | 4 +- thaw/src/toast/docs/mod.md | 113 ++++++++++++++++++ thaw/src/toast/toast.rs | 3 + thaw/src/toast/toaster_provider.rs | 1 + thaw/src/upload/docs/mod.md | 62 ++++++++++ thaw/src/upload/mod.rs | 12 +- 48 files changed, 763 insertions(+), 578 deletions(-) delete mode 100644 demo_markdown/docs/progress_bar/mod.md delete mode 100644 demo_markdown/docs/radio/mod.md delete mode 100644 demo_markdown/docs/skeleton/mod.md delete mode 100644 demo_markdown/docs/slider/mod.md delete mode 100644 demo_markdown/docs/switch/mod.md delete mode 100644 demo_markdown/docs/tab_list/mod.md delete mode 100644 demo_markdown/docs/tag/mod.md delete mode 100644 demo_markdown/docs/text/mod.md delete mode 100644 demo_markdown/docs/textarea/mod.md delete mode 100644 demo_markdown/docs/time_picker/mod.md delete mode 100644 demo_markdown/docs/toast/mod.md delete mode 100644 demo_markdown/docs/upload/mod.md rename {demo_markdown/docs/popover => thaw/src/popover/docs}/mod.md (82%) create mode 100644 thaw/src/progress_bar/docs/mod.md create mode 100644 thaw/src/radio/docs/mod.md rename {demo_markdown/docs/scrollbar => thaw/src/scrollbar/docs}/mod.md (64%) create mode 100644 thaw/src/skeleton/docs/mod.md create mode 100644 thaw/src/slider/docs/mod.md rename {demo_markdown/docs/space => thaw/src/space/docs}/mod.md (68%) rename {demo_markdown/docs/spin_button => thaw/src/spin_button/docs}/mod.md (58%) rename {demo_markdown/docs/spinner => thaw/src/spinner/docs}/mod.md (58%) create mode 100644 thaw/src/switch/docs/mod.md create mode 100644 thaw/src/tab_list/docs/mod.md rename {demo_markdown/docs/table => thaw/src/table/docs}/mod.md (65%) create mode 100644 thaw/src/tag/docs/mod.md create mode 100644 thaw/src/text/docs/mod.md create mode 100644 thaw/src/textarea/docs/mod.md create mode 100644 thaw/src/time_picker/docs/mod.md create mode 100644 thaw/src/toast/docs/mod.md create mode 100644 thaw/src/upload/docs/mod.md diff --git a/demo_markdown/docs/progress_bar/mod.md b/demo_markdown/docs/progress_bar/mod.md deleted file mode 100644 index 13a64a0..0000000 --- a/demo_markdown/docs/progress_bar/mod.md +++ /dev/null @@ -1,56 +0,0 @@ -# ProgressBar - -```rust demo -let value = RwSignal::new(0.0); - -view! { - - - - - - - - - - -} -``` - -### Circle - -```rust demo -let value = RwSignal::new(0.0); - -view! { - - - - - - - - - - -} -``` - -### Progress Props - -| Name | Type | Default | Description | -| --- | --- | --- | --- | -| percentage | `MaybeSignal` | `Default::default()` | Percentage value. | -| color | `MaybeSignal` | `ProgressColor::Primary` | Progress color. | -| show_indicator | `MaybeSignal` | `true` | Whether to display indicators. | -| indicator_placement | `MaybeSignal` | `ProgressIndicatorPlacement::Outside` | Indicator placement. | - -### ProgressCircle Props - -| Name | Type | Default | Description | -| --- | --- | --- | --- | -| class | `OptionalProp>` | `Default::default()` | Addtional classes for the progress element. | -| percentage | `MaybeSignal` | `Default::default()` | Percentage value. | -| color | `MaybeSignal` | `ProgressColor::Primary` | ProgressCircle color. | -| size | `MaybeSignal` | `120px` | ProgressCircle size. | -| children | `Option` | `None` | ProgressCircle's content. | diff --git a/demo_markdown/docs/radio/mod.md b/demo_markdown/docs/radio/mod.md deleted file mode 100644 index 3b0e098..0000000 --- a/demo_markdown/docs/radio/mod.md +++ /dev/null @@ -1,48 +0,0 @@ -# Radio - -```rust demo -let value = RwSignal::new(String::new()); -let option_value = RwSignal::new(None); - -view! { - - - - - - - - - - -
- "value: " {move || format!("{}", value.get())} -
-
- "option_value: " {move || format!("{:?}", option_value.get())} -
-} -``` - -### Radio Props - -| Name | Type | Default | Description | -| -------- | ----------------------------------- | -------------------- | ---------------------------------------- | -| class | `OptionalProp>` | `Default::default()` | Addtional classes for the radio element. | -| value | `Model` | `false` | Checked value. | -| children | `Option` | `None` | Radio's content. | - -### RadioGroup Props - -| Name | Type | Default | Description | -| -------- | ----------------------- | -------------------- | ---------------------------------- | -| value | `Model>` | `Default::default()` | Sets the value of the radio group. | -| children | `Children` | | RadioGroup's content. | - -### RadioItem Props - -| Name | Type | Default | Description | -| --- | --- | --- | --- | -| class | `OptionalProp>` | `Default::default()` | Addtional classes for the radio element. | -| key | `String` | | The key of the radio to be used in a radio group. | -| children | `Option` | `None` | Radio's content. | diff --git a/demo_markdown/docs/skeleton/mod.md b/demo_markdown/docs/skeleton/mod.md deleted file mode 100644 index 0330918..0000000 --- a/demo_markdown/docs/skeleton/mod.md +++ /dev/null @@ -1,18 +0,0 @@ -# Skeleton - -```rust demo -view! { - - - -} -``` - -### Skeleton Props - -| Name | Type | Default | Description | -| ------ | ----------------------------- | ------- | ----------------- | -| repeat | `MaybeSignal` | `1` | Repeat frequency. | -| text | `MaybeSignal` | `false` | Text skeleton. | -| width | `Option>` | `None` | Skeleton width. | -| height | `Option>` | `None` | Skeleton height. | diff --git a/demo_markdown/docs/slider/mod.md b/demo_markdown/docs/slider/mod.md deleted file mode 100644 index d007071..0000000 --- a/demo_markdown/docs/slider/mod.md +++ /dev/null @@ -1,56 +0,0 @@ -# Slider - -```rust demo -let value = RwSignal::new(0.0); - -view! { - -} -``` - -### Step - -```rust demo -let value = RwSignal::new(0.0); - -view! { - -} -``` - -## Slider Label - -```rust demo -let value = RwSignal::new(0.0); - -view! { - - - "0" - - - "5" - - - "10" - - -} -``` - -### Slider Props - -| Name | Type | Default | Description | -| -------- | ----------------------------------- | -------------------- | ----------------------------------------- | -| class | `OptionalProp>` | `Default::default()` | Addtional classes for the slider element. | -| value | `MaybeSignal` | `Default::default()` | Value of the slider. | -| max | `MaybeSignal` | `100` | Max value of the slider. | -| step | `MaybeSignal` | `Default::default()` | The step in which value is incremented. | -| children | `Option` | `None` | Slider's content. | - -### SliderLabel props - -| Name | Type | Default | Description | -| -------- | ------------------ | ------- | ------------------------------------ | -| value | `MaybeSignal` | | Value at which label will be placed. | -| children | `Children` | | Content of the lable. | diff --git a/demo_markdown/docs/switch/mod.md b/demo_markdown/docs/switch/mod.md deleted file mode 100644 index c10cda9..0000000 --- a/demo_markdown/docs/switch/mod.md +++ /dev/null @@ -1,16 +0,0 @@ -# Switch - -```rust demo -let checked = RwSignal::new(false); - -view! { - -} -``` - -### Switch Props - -| Name | Type | Default | Description | -| ----- | ----------------------------------- | -------------------- | ----------------------------------------- | -| class | `OptionalProp>` | `Default::default()` | Addtional classes for the switch element. | -| value | `Model` | `false` | Switch's value. | diff --git a/demo_markdown/docs/tab_list/mod.md b/demo_markdown/docs/tab_list/mod.md deleted file mode 100644 index 27dc788..0000000 --- a/demo_markdown/docs/tab_list/mod.md +++ /dev/null @@ -1,45 +0,0 @@ -# Tabs - -```rust demo -let selected_value = RwSignal::new(String::new()); - -view! { - - - "Apple" - - - "Pear" - - - "Item 1" - - - "Item 2" - - -} -``` - -### Tabs Props - -| Name | Type | Default | Description | -| -------- | ----------------------------------- | -------------------- | --------------------------------------- | -| class | `OptionalProp>` | `Default::default()` | Addtional classes for the tabs element. | -| value | `Model` | `Default::default()` | Tabs value. | -| children | `Children` | | Tabs content. | - -### Tab Props - -| Name | Type | Default | Description | -| -------- | ----------------------------------- | -------------------- | -------------------------------------- | -| class | `OptionalProp>` | `Default::default()` | Addtional classes for the tab element. | -| key | `String` | | The indentifier of the tab. | -| label | `String` | `Default::default()` | The label of the tab. | -| children | `Children` | | Tabs content. | - -### Tab Slots - -| Name | Default | Description | -| -------- | ------- | -------------- | -| TabLabel | `None` | label content. | diff --git a/demo_markdown/docs/tag/mod.md b/demo_markdown/docs/tag/mod.md deleted file mode 100644 index 997122e..0000000 --- a/demo_markdown/docs/tag/mod.md +++ /dev/null @@ -1,34 +0,0 @@ -# Tag - -```rust demo -view! { - "default" -} -``` - -### Closable - -```rust demo -// let message = use_message(); -let success = move |_: ev::MouseEvent| { - // message.create( - // "tag close".into(), - // MessageVariant::Success, - // Default::default(), - // ); -}; - -view! { - "Default" -} -``` - -### Tag Props - -| Name | Type | Default | Description | -| -------- | ----------------------------------- | --------------------- | -------------------------------------- | -| class | `OptionalProp>` | `Default::default()` | Addtional classes for the tag element. | -| variant | `MaybeSignal` | `TagVariant::Default` | Tag's variant. | -| closable | `MaybeSignal` | `false` | Whether the tag shows a close button. | -| on_close | `Option>` | `None` | Close clicked callback. | -| children | `Children` | | Tag's content. | diff --git a/demo_markdown/docs/text/mod.md b/demo_markdown/docs/text/mod.md deleted file mode 100644 index 5317bb3..0000000 --- a/demo_markdown/docs/text/mod.md +++ /dev/null @@ -1,21 +0,0 @@ -# Typography - -```rust demo -view! { - - "text" - "code" - "Caption1" - "Caption1Strong" - "Body1" - -} -``` - -## Text Props - -| Name | Type | Default | Description | -| -------- | ----------------------------------- | -------------------- | --------------------------------------- | -| class | `OptionalProp>` | `Default::default()` | Addtional classes for the text element. | -| code | `bool` | `false` | Use the code tag and style. | -| children | `Children` | | Text's content. | diff --git a/demo_markdown/docs/textarea/mod.md b/demo_markdown/docs/textarea/mod.md deleted file mode 100644 index b2a880f..0000000 --- a/demo_markdown/docs/textarea/mod.md +++ /dev/null @@ -1,35 +0,0 @@ -# Input - -```rust demo -let value = RwSignal::new(String::from("o")); - -view! { -