Rework Disclosure component

This commit is contained in:
Marshall Bowers 2023-11-29 14:07:48 -05:00
parent e99fa77bda
commit 6f5cc0af94
6 changed files with 76 additions and 27 deletions

View file

@ -0,0 +1,22 @@
use gpui::{Div, Render};
use story::Story;
use crate::prelude::*;
use crate::{Disclosure, Toggle};
pub struct DisclosureStory;
impl Render for DisclosureStory {
type Element = Div;
fn render(&mut self, _cx: &mut ViewContext<Self>) -> Self::Element {
Story::container()
.child(Story::title_for::<Disclosure>())
.child(Story::label("Toggled"))
.child(Disclosure::new(Toggle::Toggled(true)))
.child(Story::label("Not Toggled"))
.child(Disclosure::new(Toggle::Toggled(false)))
.child(Story::label("Not Toggleable"))
.child(Disclosure::new(Toggle::NotToggleable))
}
}