Skip to content

Commit

Permalink
update ui/components
Browse files Browse the repository at this point in the history
  • Loading branch information
iamnbutler committed Feb 21, 2025
1 parent 1ccbdbb commit 58dd0f0
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 18 deletions.
4 changes: 2 additions & 2 deletions crates/collab_ui/src/collab_panel.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2458,8 +2458,8 @@ impl CollabPanel {
Avatar::new(contact.user.avatar_uri.clone())
.indicator::<AvatarAvailabilityIndicator>(if online {
Some(AvatarAvailabilityIndicator::new(match busy {
true => ui::Availability::Busy,
false => ui::Availability::Free,
true => ui::CollaboratorAvailability::Busy,
false => ui::CollaboratorAvailability::Free,
}))
} else {
None
Expand Down
7 changes: 4 additions & 3 deletions crates/component/src/component.rs
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ impl RenderOnce for ComponentExample {
ExampleLabelSide::Top => base.flex_col_reverse(),
};

base.gap_1()
base.gap_2()
.p_2()
.text_size(px(10.))
.text_color(cx.theme().colors().text_muted)
Expand Down Expand Up @@ -245,11 +245,12 @@ impl RenderOnce for ComponentExampleGroup {
.text_color(cx.theme().colors().text_muted)
.when(self.grow, |this| this.w_full().flex_1())
.when_some(self.title, |this, title| {
this.gap_4().pb_5().child(
this.gap_4().child(
div()
.flex()
.items_center()
.gap_3()
.pb_1()
.child(div().h_px().w_4().bg(cx.theme().colors().border))
.child(
div()
Expand All @@ -271,7 +272,7 @@ impl RenderOnce for ComponentExampleGroup {
.flex()
.items_start()
.w_full()
.gap_8()
.gap_6()
.children(self.examples)
.into_any_element(),
)
Expand Down
29 changes: 19 additions & 10 deletions crates/component_preview/src/component_preview.rs
Original file line number Diff line number Diff line change
Expand Up @@ -105,19 +105,23 @@ impl ComponentPreview {
v_flex()
.py_2()
.child(
v_group()
v_flex()
.bg(cx.theme().colors().text.opacity(0.05))
.border_1()
.border_color(cx.theme().colors().border)
.rounded_md()
.w_full()
.gap_3()
.py_6()
.px_8()
.gap_4()
.py_4()
.px_6()
.flex_none()
.child(
v_flex()
.gap_1()
.child(
h_flex()
.gap_1()
.text_2xl()
.text_xl()
.child(div().child(name))
.when_some(scope, |this, scope| {
this.child(div().opacity(0.5).child(format!("({})", scope)))
Expand Down Expand Up @@ -170,11 +174,16 @@ impl Render for ComponentPreview {
.flex_grow(),
)
.child(
v_flex().id("component-list").px_8().size_full().child(
list(self.component_list.clone())
.flex_grow()
.with_sizing_behavior(gpui::ListSizingBehavior::Auto),
),
v_flex()
.id("component-list")
.px_8()
.pt_4()
.size_full()
.child(
list(self.component_list.clone())
.flex_grow()
.with_sizing_behavior(gpui::ListSizingBehavior::Auto),
),
)
}
}
Expand Down
2 changes: 0 additions & 2 deletions crates/ui/src/ui.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#![deny(missing_docs)]

//! # UI – Zed UI Primitives & Components
//!
//! This crate provides a set of UI primitives and components that are used to build all of the elements in Zed's UI.
Expand Down
2 changes: 1 addition & 1 deletion crates/workspace/src/theme_preview.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use strum::IntoEnumIterator;
use theme::all_theme_colors;
use ui::{
element_cell, prelude::*, string_cell, utils::calculate_contrast_ratio, AudioStatus,
Availability, Avatar, AvatarAudioStatusIndicator, AvatarAvailabilityIndicator, ButtonLike,
CollaboratorAvailability, Avatar, AvatarAudioStatusIndicator, AvatarAvailabilityIndicator, ButtonLike,
Checkbox, CheckboxWithLabel, ContentGroup, DecoratedIcon, ElevationIndex, Facepile,
IconDecoration, Indicator, KeybindingHint, Switch, Table, TintColor, Tooltip,
};
Expand Down

0 comments on commit 58dd0f0

Please sign in to comment.