Skip to content

Commit

Permalink
zu: Remove some attributes in ButtonBase
Browse files Browse the repository at this point in the history
  • Loading branch information
XuShaohua committed Jul 21, 2023
1 parent 0757c0c commit 4ae8451
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 14 deletions.
12 changes: 6 additions & 6 deletions crates/zu-docs/src/views/inputs/button_page.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,17 +23,17 @@ pub fn button_page() -> Html {
<h2>{"Basic button"}</h2>
<p>{"The Button comes with three variants: text (default), contained, and outlined."}</p>
<DemoBox>
<Button variant={ButtonVariant::Text}>{"Text"}</Button>
<Button variant={ButtonVariant::Contained}>{"Contained"}</Button>
<Button variant={ButtonVariant::Outlined}>{"Outlined"}</Button>
<Button variant={ButtonVariant::Text}>{"Text"}</Button>
<Button variant={ButtonVariant::Contained}>{"Contained"}</Button>
<Button variant={ButtonVariant::Outlined}>{"Outlined"}</Button>
</DemoBox>

<h3>{"Text button"}</h3>
<p>{"Text buttons are typically used for less-pronounced actions, including those located: in dialogs, in cards."}</p>
<DemoBox>
<Button>{"Primary"}</Button>
<Button disabled={true}>{"Disabled"}</Button>
<Button href="#text-buttons">{"Link"}</Button>
<Button>{"Primary"}</Button>
<Button disabled={true}>{"Disabled"}</Button>
<Button href="#text-buttons">{"Link"}</Button>
</DemoBox>

<h3>{"Contained button"}</h3>
Expand Down
5 changes: 2 additions & 3 deletions crates/zu/src/button/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,8 @@ pub struct Props {
#[prop_or_default]
pub style: AttrValue,

#[prop_or(-1)]
// TODO(Shaohua): Remove tab_index from properties.
#[prop_or_default]
pub tab_index: i32,

/// Default value is `Text`.
Expand Down Expand Up @@ -181,8 +182,6 @@ pub fn button(props: &Props) -> Html {
props.classes.clone(),
);

//let label_cls = "ZuButton-label";

html! {
<ButtonBase
classes={root_cls}
Expand Down
2 changes: 0 additions & 2 deletions crates/zu/src/button_base/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -149,8 +149,6 @@ pub fn button_base(props: &Props) -> Html {
String::new()
},
props.classes.clone(),
// TODO(Shaohua): Merge into Typography.
"ZuTypography-button",
);

// TODO(Shaohua): Handle mouse events.
Expand Down
4 changes: 2 additions & 2 deletions crates/zu/src/button_base/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
outline: none;
border: none;
margin: 0;
padding: 0;
border-radius: 0;
//padding: 0;
//border-radius: 0;
cursor: pointer;
user-select: none;
appearance: none;
Expand Down
1 change: 1 addition & 0 deletions crates/zu/src/link/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
}
}

// TODO(Shaohua): Merge into button_base ZuButtonBase-root
// Styles applied to the root element if component="button".
.ZuLink-button {
position: relative;
Expand Down
1 change: 0 additions & 1 deletion crates/zu/src/typography/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@
line-height: $zu-typography-button-lineHeight;
letter-spacing: $zu-typography-button-letterSpacing;
text-transform: $zu-typography-button-textTransform;

}

// Styles applied to the root element if variant="caption".
Expand Down

0 comments on commit 4ae8451

Please sign in to comment.