diff --git a/crates/ui2/Cargo.toml b/crates/ui2/Cargo.toml index efbec22bee4f65ad64d3225063ef7793a0bdec6c..0fa277dc89933dc957975838957d887332b702be 100644 --- a/crates/ui2/Cargo.toml +++ b/crates/ui2/Cargo.toml @@ -4,6 +4,10 @@ version = "0.1.0" edition = "2021" publish = false +[lib] +name = "ui2" +path = "src/ui2.rs" + [dependencies] anyhow.workspace = true chrono = "0.4" diff --git a/crates/ui2/src/components.rs b/crates/ui2/src/components.rs index e7b2d9cf0f02929fef29ec5f41fffc401ad7fe2c..2b1df6dacc3cf5a711c5d83054cd1b2dbe2c683c 100644 --- a/crates/ui2/src/components.rs +++ b/crates/ui2/src/components.rs @@ -2,56 +2,32 @@ mod avatar; mod button; mod checkbox; mod context_menu; -mod details; mod divider; -mod elevated_surface; -mod facepile; mod icon; mod icon_button; -mod indicator; mod input; mod keybinding; mod label; mod list; -mod modal; -mod notification_toast; -mod palette; -mod panel; -mod player; -mod player_stack; mod slot; mod stack; -mod tab; -mod toast; +mod stories; mod toggle; -mod tool_divider; mod tooltip; pub use avatar::*; pub use button::*; pub use checkbox::*; pub use context_menu::*; -pub use details::*; pub use divider::*; -pub use elevated_surface::*; -pub use facepile::*; pub use icon::*; pub use icon_button::*; -pub use indicator::*; pub use input::*; pub use keybinding::*; pub use label::*; pub use list::*; -pub use modal::*; -pub use notification_toast::*; -pub use palette::*; -pub use panel::*; -pub use player::*; -pub use player_stack::*; pub use slot::*; pub use stack::*; -pub use tab::*; -pub use toast::*; +pub use stories::*; pub use toggle::*; -pub use tool_divider::*; pub use tooltip::*; diff --git a/crates/ui2/src/components/avatar.rs b/crates/ui2/src/components/avatar.rs index ab79352f86ed13f70650d78d2596519b1f85279a..f4b9006457ce5529e6979ac843ee752bbd527329 100644 --- a/crates/ui2/src/components/avatar.rs +++ b/crates/ui2/src/components/avatar.rs @@ -39,31 +39,3 @@ impl Avatar { self } } - -#[cfg(feature = "stories")] -pub use stories::*; - -#[cfg(feature = "stories")] -mod stories { - use super::*; - use crate::Story; - use gpui::{Div, Render}; - - pub struct AvatarStory; - - impl Render for AvatarStory { - type Element = Div; - - fn render(&mut self, cx: &mut ViewContext) -> Self::Element { - Story::container(cx) - .child(Story::title_for::(cx)) - .child(Story::label(cx, "Default")) - .child(Avatar::new( - "https://avatars.githubusercontent.com/u/1714999?v=4", - )) - .child(Avatar::new( - "https://avatars.githubusercontent.com/u/326587?v=4", - )) - } - } -} diff --git a/crates/ui2/src/components/button.rs b/crates/ui2/src/components/button.rs index 3d92cebec55c8a6ee524299b9fcc5cfb4fdb6b5b..b2b5aebea551b35497065af61b1d0d68e01de5e2 100644 --- a/crates/ui2/src/components/button.rs +++ b/crates/ui2/src/components/button.rs @@ -231,171 +231,3 @@ impl ButtonGroup { Self { buttons } } } - -#[cfg(feature = "stories")] -pub use stories::*; - -#[cfg(feature = "stories")] -mod stories { - use super::*; - use crate::{h_stack, v_stack, Story, TextColor}; - use gpui::{rems, Div, Render}; - use strum::IntoEnumIterator; - - pub struct ButtonStory; - - impl Render for ButtonStory { - type Element = Div; - - fn render(&mut self, cx: &mut ViewContext) -> Self::Element { - let states = InteractionState::iter(); - - Story::container(cx) - .child(Story::title_for::