Rename back to div

This commit is contained in:
Nathan Sobo 2023-11-14 01:41:55 -07:00
parent be18c47912
commit c6e8a097a3
62 changed files with 154 additions and 156 deletions

View file

@ -44,12 +44,12 @@ pub use stories::*;
mod stories {
use super::*;
use crate::Story;
use gpui::{Node, Render};
use gpui::{Div, Render};
pub struct AvatarStory;
impl Render for AvatarStory {
type Element = Node<Self>;
type Element = Div<Self>;
fn render(&mut self, cx: &mut ViewContext<Self>) -> Self::Element {
Story::container(cx)

View file

@ -236,13 +236,13 @@ pub use stories::*;
mod stories {
use super::*;
use crate::{h_stack, v_stack, LabelColor, Story};
use gpui::{rems, Node, Render};
use gpui::{rems, Div, Render};
use strum::IntoEnumIterator;
pub struct ButtonStory;
impl Render for ButtonStory {
type Element = Node<Self>;
type Element = Div<Self>;
fn render(&mut self, cx: &mut ViewContext<Self>) -> Self::Element {
let states = InteractionState::iter();

View file

@ -171,12 +171,12 @@ pub use stories::*;
mod stories {
use super::*;
use crate::{h_stack, Story};
use gpui::{Node, Render};
use gpui::{Div, Render};
pub struct CheckboxStory;
impl Render for CheckboxStory {
type Element = Node<Self>;
type Element = Div<Self>;
fn render(&mut self, cx: &mut ViewContext<Self>) -> Self::Element {
Story::container(cx)

View file

@ -65,12 +65,12 @@ pub use stories::*;
mod stories {
use super::*;
use crate::story::Story;
use gpui::{Node, Render};
use gpui::{Div, Render};
pub struct ContextMenuStory;
impl Render for ContextMenuStory {
type Element = Node<Self>;
type Element = Div<Self>;
fn render(&mut self, cx: &mut ViewContext<Self>) -> Self::Element {
Story::container(cx)

View file

@ -47,12 +47,12 @@ pub use stories::*;
mod stories {
use super::*;
use crate::{Button, Story};
use gpui::{Node, Render};
use gpui::{Div, Render};
pub struct DetailsStory;
impl Render for DetailsStory {
type Element = Node<Self>;
type Element = Div<Self>;
fn render(&mut self, cx: &mut ViewContext<Self>) -> Self::Element {
Story::container(cx)

View file

@ -1,11 +1,11 @@
use gpui::Node;
use gpui::Div;
use crate::{prelude::*, v_stack};
/// Create an elevated surface.
///
/// Must be used inside of a relative parent element
pub fn elevated_surface<V: 'static>(level: ElevationIndex, cx: &mut ViewContext<V>) -> Node<V> {
pub fn elevated_surface<V: 'static>(level: ElevationIndex, cx: &mut ViewContext<V>) -> Div<V> {
let colors = cx.theme().colors();
// let shadow = BoxShadow {
@ -23,6 +23,6 @@ pub fn elevated_surface<V: 'static>(level: ElevationIndex, cx: &mut ViewContext<
.shadow(level.shadow())
}
pub fn modal<V: 'static>(cx: &mut ViewContext<V>) -> Node<V> {
pub fn modal<V: 'static>(cx: &mut ViewContext<V>) -> Div<V> {
elevated_surface(ElevationIndex::ModalSurface, cx)
}

View file

@ -33,12 +33,12 @@ pub use stories::*;
mod stories {
use super::*;
use crate::{static_players, Story};
use gpui::{Node, Render};
use gpui::{Div, Render};
pub struct FacepileStory;
impl Render for FacepileStory {
type Element = Node<Self>;
type Element = Div<Self>;
fn render(&mut self, cx: &mut ViewContext<Self>) -> Self::Element {
let players = static_players();

View file

@ -204,7 +204,7 @@ pub use stories::*;
#[cfg(feature = "stories")]
mod stories {
use gpui::{Node, Render};
use gpui::{Div, Render};
use strum::IntoEnumIterator;
use crate::Story;
@ -214,7 +214,7 @@ mod stories {
pub struct IconStory;
impl Render for IconStory {
type Element = Node<Self>;
type Element = Div<Self>;
fn render(&mut self, cx: &mut ViewContext<Self>) -> Self::Element {
let icons = Icon::iter();

View file

@ -110,12 +110,12 @@ pub use stories::*;
mod stories {
use super::*;
use crate::Story;
use gpui::{Node, Render};
use gpui::{Div, Render};
pub struct InputStory;
impl Render for InputStory {
type Element = Node<Self>;
type Element = Div<Self>;
fn render(&mut self, cx: &mut ViewContext<Self>) -> Self::Element {
Story::container(cx)

View file

@ -158,13 +158,13 @@ pub use stories::*;
mod stories {
use super::*;
use crate::Story;
use gpui::{Node, Render};
use gpui::{Div, Render};
use itertools::Itertools;
pub struct KeybindingStory;
impl Render for KeybindingStory {
type Element = Node<Self>;
type Element = Div<Self>;
fn render(&mut self, cx: &mut ViewContext<Self>) -> Self::Element {
let all_modifier_permutations = ModifierKey::iter().permutations(2);

View file

@ -196,12 +196,12 @@ pub use stories::*;
mod stories {
use super::*;
use crate::Story;
use gpui::{Node, Render};
use gpui::{Div, Render};
pub struct LabelStory;
impl Render for LabelStory {
type Element = Node<Self>;
type Element = Div<Self>;
fn render(&mut self, cx: &mut ViewContext<Self>) -> Self::Element {
Story::container(cx)

View file

@ -159,7 +159,7 @@ pub use stories::*;
#[cfg(feature = "stories")]
mod stories {
use gpui::{Node, Render};
use gpui::{Div, Render};
use crate::{ModifierKeys, Story};
@ -168,7 +168,7 @@ mod stories {
pub struct PaletteStory;
impl Render for PaletteStory {
type Element = Node<Self>;
type Element = Div<Self>;
fn render(&mut self, cx: &mut ViewContext<Self>) -> Self::Element {
{

View file

@ -126,12 +126,12 @@ pub use stories::*;
mod stories {
use super::*;
use crate::{Label, Story};
use gpui::{InteractiveComponent, Node, Render};
use gpui::{InteractiveComponent, Div, Render};
pub struct PanelStory;
impl Render for PanelStory {
type Element = Node<Self>;
type Element = Div<Self>;
fn render(&mut self, cx: &mut ViewContext<Self>) -> Self::Element {
Story::container(cx)

View file

@ -1,17 +1,17 @@
use gpui::{div, Node};
use gpui::{div, Div};
use crate::StyledExt;
/// Horizontally stacks elements.
///
/// Sets `flex()`, `flex_row()`, `items_center()`
pub fn h_stack<V: 'static>() -> Node<V> {
pub fn h_stack<V: 'static>() -> Div<V> {
div().h_flex()
}
/// Vertically stacks elements.
///
/// Sets `flex()`, `flex_col()`
pub fn v_stack<V: 'static>() -> Node<V> {
pub fn v_stack<V: 'static>() -> Div<V> {
div().v_flex()
}

View file

@ -1,6 +1,6 @@
use crate::prelude::*;
use crate::{Icon, IconColor, IconElement, Label, LabelColor};
use gpui::{prelude::*, red, ElementId, Node, Render, View};
use gpui::{prelude::*, red, Div, ElementId, Render, View};
#[derive(Component, Clone)]
pub struct Tab {
@ -21,7 +21,7 @@ struct TabDragState {
}
impl Render for TabDragState {
type Element = Node<Self>;
type Element = Div<Self>;
fn render(&mut self, cx: &mut ViewContext<Self>) -> Self::Element {
div().w_8().h_4().bg(red())
@ -178,7 +178,7 @@ mod stories {
pub struct TabStory;
impl Render for TabStory {
type Element = Node<Self>;
type Element = Div<Self>;
fn render(&mut self, cx: &mut ViewContext<Self>) -> Self::Element {
let git_statuses = GitStatus::iter();

View file

@ -69,7 +69,7 @@ pub use stories::*;
#[cfg(feature = "stories")]
mod stories {
use gpui::{Node, Render};
use gpui::{Div, Render};
use crate::{Label, Story};
@ -78,7 +78,7 @@ mod stories {
pub struct ToastStory;
impl Render for ToastStory {
type Element = Node<Self>;
type Element = Div<Self>;
fn render(&mut self, cx: &mut ViewContext<Self>) -> Self::Element {
Story::container(cx)

View file

@ -1,4 +1,4 @@
use gpui::{div, Node, ParentComponent, Render, SharedString, Styled, ViewContext};
use gpui::{div, Div, ParentComponent, Render, SharedString, Styled, ViewContext};
use theme2::ActiveTheme;
#[derive(Clone, Debug)]
@ -13,7 +13,7 @@ impl TextTooltip {
}
impl Render for TextTooltip {
type Element = Node<Self>;
type Element = Div<Self>;
fn render(&mut self, cx: &mut ViewContext<Self>) -> Self::Element {
let theme = cx.theme();