T00 foundation: theme, motion, assets, icon, buttons, gallery

Theme tokens in light and dark with high contrast, a palette cross-fade,
motion curves and a damped spring, embedded Lucide icons with Inter and
JetBrains Mono, Icon, Button, IconButton, and a gallery that captures
its own window. Reviewed by codex gpt-6-astra (max): PASS in round 3.
This commit is contained in:
ZacharyZhang-NY committed 2026-09-24 23:59:55 -04:00
commit abf4cbcfc6
258 files changed
+16908

No files matched your search

+53
View File
@@ -0,0 +1,53 @@
use ely_gpui_component::theme::{ActiveTheme, TextSize};
use gpui::{App, Div, FontWeight, IntoElement, ParentElement, SharedString, Styled, div};
/// Titled block of demos.
pub fn section(title: impl Into<SharedString>, note: impl Into<SharedString>, cx: &App) -> Div {
let theme = cx.theme();
div().flex().flex_col().gap_4().pt_10().child(
div()
.flex()
.flex_col()
.gap_1()
.child(
div()
.text_size(theme.text_size(TextSize::Md))
.font_weight(FontWeight::SEMIBOLD)
.text_color(theme.colors.fg)
.child(title.into()),
)
.child(
div()
.text_size(theme.text_size(TextSize::Sm))
.text_color(theme.colors.fg_muted)
.child(note.into()),
),
)
}
pub fn row() -> Div {
div().flex().flex_wrap().items_center().gap_3()
}
/// Row whose captions share one line.
pub fn specimens() -> Div {
div().flex().flex_wrap().items_end().gap_6()
}
pub fn label(text: impl Into<SharedString>, cx: &App) -> impl IntoElement {
let theme = cx.theme();
div()
.text_size(theme.text_size(TextSize::Xs))
.text_color(theme.colors.fg_subtle)
.child(text.into())
}
/// Demo with a caption beneath.
pub fn specimen(caption: impl Into<SharedString>, body: impl IntoElement, cx: &App) -> Div {
div()
.flex()
.flex_col()
.gap_2()
.child(body)
.child(label(caption, cx))
}