Skip to content

Commit

Permalink
Merge pull request #61 from spielrs/fixes-0.7.2
Browse files Browse the repository at this point in the history
Fixes 0.7.2
  • Loading branch information
dancespiele authored Jul 27, 2020
2 parents 4f054b4 + a7a2547 commit 2f044ac
Show file tree
Hide file tree
Showing 14 changed files with 167 additions and 27 deletions.
12 changes: 12 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,18 @@ its logic works, in the same file where it is implemented (test events is not ne
## Code of Conduct
Please check our [code of conduct](CODE_OF_CONDUCT.md)

## Code Contributors

<a href="https://github.com/dancespiele">
<img src="https://github.com/dancespiele.png?size=50">
</a>
<a href="https://github.com/zoechi">
<img src="https://github.com/zoechi.png?size=50">
</a>
<a href="https://github.com/ajstrand">
<img src="https://github.com/ajstrand.png?size=50">
</a>

## Roadmap

- [x] Button
Expand Down
9 changes: 8 additions & 1 deletion app/yew-styles/_navbar.sass
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@

&.navbar-container-mobile
flex-direction: row !important
width: 100%

@include get-branch(50px)

Expand Down Expand Up @@ -65,4 +66,10 @@
width: 100%

&:focus
outline: none
outline: none

.navbar-container
width: 100%

&.navbar-container-mobile
width: auto
8 changes: 8 additions & 0 deletions app/yew-styles/main.css

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

2 changes: 1 addition & 1 deletion app/yew-styles/main.css.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion app/yew-styles/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "yew-styles",
"version": "0.7.1",
"version": "0.7.2",
"description": "css for yew_styles",
"repository": {
"url": "https://github.com/spielrs/yew-styles-page/tree/master/app/yew-styles"
Expand Down
4 changes: 2 additions & 2 deletions crate/Cargo.lock

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

2 changes: 1 addition & 1 deletion crate/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ license = "MIT/Apache-2.0"
name = "yew_style_page"
readme = "./README.md"
repository = "https://github.com/spielrs/yew-styles-page.git"
version = "0.7.1"
version = "0.7.2"

[lib]
crate-type = ["cdylib"]
Expand Down
1 change: 1 addition & 0 deletions crate/src/page/form_pages.rs
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,7 @@ impl Component for FormPage {
{". Default "}<code>{"Standard"}</code>{"."}</li>
<li><b>{"size: "}</b>{"the size of the submit. Options included in "}<code>{"Size"}</code>
{". Default "}<code>{"Medium"}</code>{"."}</li>
<li><b>{"disabled: "}</b>{"whether the form control is disabled."}</li>
<li><b>{"key: "}</b>{"general property to add keys."}</li>
<li><b>{"code_ref: "}</b>{"general property to get the ref of the component."}</li>
<li><b>{"id: "}</b>{"general property to add custom id"}</li>
Expand Down
14 changes: 11 additions & 3 deletions crate/src/page/highlighters.rs
Original file line number Diff line number Diff line change
Expand Up @@ -304,6 +304,14 @@ pub fn get_modal_code() -> String {
.to_string()
}

pub fn get_title_text() -> String {
"<Text
text_type=TextType::Title(Header::H1)
text=\"Header h1\"
/>"
.to_string()
}

pub fn get_plain_text() -> String {
"<Text
text_type=TextType::Plain
Expand All @@ -315,9 +323,9 @@ pub fn get_plain_text() -> String {

pub fn get_paragraph_text() -> String {
"<Text
text_type=TextType::Paragraph
text_size=Size::Small
text=\"paragraph text\"
text_type=TextType::Paragraph
text_size=Size::Small
text=\"paragraph text\"
/>"
.to_string()
}
Expand Down
42 changes: 38 additions & 4 deletions crate/src/page/text_page.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
use super::highlighters::{get_alert_text, get_paragraph_text, get_plain_text, get_tag_text};
use super::highlighters::{
get_alert_text, get_paragraph_text, get_plain_text, get_tag_text, get_title_text,
};
use lipsum::lipsum;
use wasm_bindgen::JsCast;
use web_sys::Element;
Expand All @@ -10,7 +12,7 @@ use yew_styles::layouts::{
item::{Item, ItemLayout},
};
use yew_styles::styles::{Palette, Size, Style};
use yew_styles::text::{Text, TextType};
use yew_styles::text::{Header, Text, TextType};

pub struct TextPage {
link: ComponentLink<Self>,
Expand Down Expand Up @@ -90,6 +92,11 @@ impl Component for TextPage {
<span><code>{"text"}</code></span>

<h2>{"Code example"}</h2>
<h3>{"Title text"}</h3>
<Prism
code=get_title_text()
language="rust"
/>
<h3>{"Plain text"}</h3>
<Prism
code=get_plain_text()
Expand All @@ -114,9 +121,9 @@ impl Component for TextPage {
<h2>{"Properties"}</h2>
<ul>
<li><b>{"text: "}</b>{"text to show. Required."}</li>
<li><b>{"input_type: "}</b>{"the text type. Options included in "}<code>{"TextType"}</code>{". Required."}</li>
<li><b>{"text_type: "}</b>{"the text type. Options included in "}<code>{"TextType"}</code>{". Required."}</li>
<li><b>{"text_palette: "}</b>{"type text purpose style. Options included in "}<code>{"Pallete"}</code>{". Default "}<code>{"Standard"}</code>{". Only alert and tag types"}</li>
<li><b>{"text_size: "}</b>{"three diffent text standard sizes. Options included in "}<code>{"Size"}</code>{". Default "}<code>{"Medium"}</code>{". Only alert and tag types"}</li>
<li><b>{"text_size: "}</b>{"three diffent text standard sizes. Options included in "}<code>{"Size"}</code>{". Default "}<code>{"Medium"}</code>{". Not for title type"}</li>
<li><b>{"text_style: "}</b>{"text styles. Options included in "}<code>{"Style"}</code>{". Default "}<code>{"Regular"}</code>{". Only alert and tag types"}</li>
<li><b>{"removable: "}</b>{"if the tag can be deleted. Default "}<code>{"false"}</code>{". Only for tag text type."}</li>
<li><b>{"onclick_signal: "}</b>{"click event for text. Only for tag type."}</li>
Expand All @@ -138,6 +145,9 @@ impl Component for TextPage {

<h2>{"Visual examples"}</h2>

<h3>{"Title text"}</h3>
{get_headers()}

<h3>{"Plain text"}</h3>
<Text
text_type=TextType::Plain
Expand Down Expand Up @@ -191,6 +201,30 @@ impl Component for TextPage {
}
}

fn get_headers() -> Html {
let headers = vec![
Header::H1,
Header::H2,
Header::H3,
Header::H4,
Header::H5,
Header::H6,
];
headers
.into_iter()
.enumerate()
.map(|(index, header)| {
html! {
<Text
text_type=TextType::Title(header)
text=format!("Header {}", index + 1)
key=format!("h{}", index + 1)
/>
}
})
.collect::<Html>()
}

fn get_text(text_type: TextType, words: usize, layout_size: i8) -> Html {
let styles = vec![Style::Regular, Style::Outline, Style::Light];
let palette = vec![Palette::Success, Palette::Warning, Palette::Danger];
Expand Down
2 changes: 1 addition & 1 deletion crate/yew_styles/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "yew_styles"
version = "0.7.1"
version = "0.7.2"
description = "Framework styles for yew"
documentation = "https://docs.rs/crate/yew_styles"
authors = ["Francisco Jesus Navarro Cortes <[email protected]>"]
Expand Down
12 changes: 12 additions & 0 deletions crate/yew_styles/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,18 @@ its logic works, in the same file where it is implemented (test events is not ne
## Do you like Yew Styles?
* If you like Yew Styles, help us supporting the project with [Github Sponsors](https://github.com/sponsors/dancespiele)!

## Code Contributors

<a href="https://github.com/dancespiele">
<img src="https://github.com/dancespiele.png?size=50">
</a>
<a href="https://github.com/zoechi">
<img src="https://github.com/zoechi.png?size=50">
</a>
<a href="https://github.com/ajstrand">
<img src="https://github.com/ajstrand.png?size=50">
</a>

## Roadmap

- [x] Button
Expand Down
5 changes: 5 additions & 0 deletions crate/yew_styles/src/components/forms/form_submit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@ pub struct Props {
/// the size of the submit
#[prop_or(Size::Medium)]
pub size: Size,
/// Whether the form control is disabled
#[prop_or(false)]
pub disabled: bool,
/// General property to get the ref of the component
#[prop_or_default]
pub code_ref: NodeRef,
Expand Down Expand Up @@ -72,6 +75,7 @@ impl Component for FormSubmit {
get_size(self.props.size.clone()),
self.props.class_name,
),
disabled=self.props.disabled
id=self.props.id
value=self.props.value
/>
Expand All @@ -83,6 +87,7 @@ impl Component for FormSubmit {
fn should_create_form_submit() {
let props = Props {
value: "submit".to_string(),
disabled: false,
key: "".to_string(),
code_ref: NodeRef::default(),
id: "result".to_string(),
Expand Down
Loading

0 comments on commit 2f044ac

Please sign in to comment.