diff --git a/Cargo.lock b/Cargo.lock index 337d40f9..ad77b9f5 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1151,8 +1151,6 @@ dependencies = [ "criterion", "eframe", "eggshell-ui", - "eggshell-ui-extras", - "eggshell-ui-shadcn", "egui", "egui-wgpu", "egui_extras", @@ -1162,33 +1160,16 @@ dependencies = [ "nohash-hasher", "pollster", "proptest", + "pulldown-cmark", "taffy", "trybuild", + "unicode-normalization", "wasm-bindgen", "wasm-bindgen-futures", "web-sys", "web-time", ] -[[package]] -name = "eggshell-ui-extras" -version = "0.1.0" -dependencies = [ - "eggshell-ui", - "egui", - "pulldown-cmark", - "unicode-normalization", -] - -[[package]] -name = "eggshell-ui-shadcn" -version = "0.1.0" -dependencies = [ - "eggshell-ui", - "eggshell-ui-extras", - "egui", -] - [[package]] name = "egui" version = "0.37.0" diff --git a/Cargo.toml b/Cargo.toml index 763dd987..faec5cb0 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -16,9 +16,22 @@ nohash-hasher = "0.2" web-time = "1.1" log = "0.4" egui_kittest = { version = "0.37", optional = true } +pulldown-cmark = { version = "0.13.6", default-features = false, optional = true } +unicode-normalization = { version = "0.1.25", optional = true } [features] -default = ["clipboard"] +default = [ + "clipboard", + "fonts", + # keep sorted + "accordion", + "badge", + "dialog", + "disclosure", + "skeleton", + "spinner", + "tabs", +] # The system clipboard, read on demand through `Shell::read_clipboard`. # Without it, or on wasm, a read answers `ClipboardError::Unavailable`. clipboard = ["dep:arboard"] @@ -33,6 +46,20 @@ screenshots = ["dep:egui_kittest", "egui_kittest/wgpu", "dep:egui-wgpu", "dep:po # Golden-image tests: kittest renders them on the screenshot path, so they need # Mesa lavapipe. `cargo xtask snapshots` selects it. snapshots = ["screenshots", "egui_kittest/snapshot"] +# The widgets beyond core's controls, each its own feature. +# keep sorted +accordion = ["disclosure"] +badge = [] +command = ["dep:unicode-normalization"] +dialog = [] +disclosure = [] +form = [] +hover-card = [] +markdown = ["dep:pulldown-cmark"] +notify = [] +skeleton = [] +spinner = [] +tabs = [] # The version egui-winit asks for, so the tree has the one arboard. [target.'cfg(not(any(target_arch = "wasm32", target_os = "android", target_os = "ios")))'.dependencies] @@ -57,9 +84,8 @@ eframe = "0.37" egui_kittest = "0.37" trybuild = "1" # eggshell's own tests drive views through `testing::Driver`. -eggshell-ui = { path = ".", features = ["driver"] } -eggshell-ui-shadcn = { path = "crates/eggshell-ui-shadcn", features = ["extras"] } -eggshell-ui-extras = { path = "crates/eggshell-ui-extras", features = [ +eggshell-ui = { path = ".", features = [ + "driver", # keep sorted "accordion", "badge", @@ -89,7 +115,7 @@ harness = false wasm-bindgen-futures = "0.4" [workspace] -members = ["crates/eggshell-ui-shadcn", "crates/eggshell-ui-extras", "xtask"] +members = ["xtask"] # clippy.toml's disallowed macros and methods are denied in library code by # each library's crate attributes; tests, examples and benches may use them. @@ -114,3 +140,7 @@ debug = "line-tables-only" inherits = "dev" debug-assertions = false overflow-checks = false + +[[example]] +name = "preset_dump" +required-features = ["badge", "command", "dialog", "disclosure", "form", "hover-card", "markdown", "notify", "skeleton"] diff --git a/README.md b/README.md index 0b45499e..c11d4e2b 100644 --- a/README.md +++ b/README.md @@ -114,6 +114,27 @@ so lavapipe is needed there too. - `--filter NAME` runs only the goldens whose test name starts with `NAME` (they live in the `snapshots` module of the `it` test binary, so `NAME` is matched after `snapshots::`). - `--clean` deletes the stray `.new.png` and `.diff.png` files. +## Fonts + +With the default `fonts` feature the preset bundles **Geist**, shadcn's +default sans-serif, as one variable font, `src/fonts/Geist-Variable.ttf` +(`Geist[wght].ttf` from [vercel/geist-font](https://github.com/vercel/geist-font) +v1.9.2, 165 KiB). `Shadcn::apply` registers it at 400, 500, 600 and 700, so +`font_medium()`, `font_semibold()` and `font_bold()` draw real faces, and the +preset's buttons, labels and menu headings take shadcn's weights. + +Geist is licensed under the SIL Open Font License 1.1; the licence is shipped +beside the font in [`src/fonts/OFL.txt`](src/fonts/OFL.txt) and applies to the font +file only. The crate's code is MIT. + +- Swap the font with `Shadcn::with_fonts(Some(FontSet::variable(..)))` or + `FontSet::faces(..)` for static files, or keep egui's fonts with + `with_fonts(None)`. +- Leave it out with `default-features = false`: nothing is embedded, and + weights are drawn in the regular face with a debug warning. +- egui's own `default_fonts` feature embeds Ubuntu-Light, which Geist makes a + fallback only. Depend on egui with `default-features = false` to drop it. + ## License MIT diff --git a/crates/eggshell-ui-extras/Cargo.toml b/crates/eggshell-ui-extras/Cargo.toml deleted file mode 100644 index 3a4e09f9..00000000 --- a/crates/eggshell-ui-extras/Cargo.toml +++ /dev/null @@ -1,36 +0,0 @@ -[package] -name = "eggshell-ui-extras" -version = "0.1.0" -edition = "2024" -rust-version = "1.96" -license = "MIT" -description = "Reusable composites and third-party adapters for eggshell" -repository = "https://github.com/samitbasu/eggshell" - -[features] -# Each widget is opt-in. -# keep sorted -accordion = ["disclosure"] -badge = [] -command = ["dep:unicode-normalization"] -dialog = [] -disclosure = [] -form = [] -hover-card = [] -markdown = ["dep:pulldown-cmark"] -notify = [] -skeleton = [] -spinner = [] -tabs = [] - -[dependencies] -eggshell-ui = { path = "../..", version = "0.1.0" } -egui = "0.37" -pulldown-cmark = { version = "0.13.6", default-features = false, optional = true } -unicode-normalization = { version = "0.1.25", optional = true } - -[package.metadata.docs.rs] -all-features = true - -[lints] -workspace = true diff --git a/crates/eggshell-ui-extras/src/lib.rs b/crates/eggshell-ui-extras/src/lib.rs deleted file mode 100644 index 99a806e3..00000000 --- a/crates/eggshell-ui-extras/src/lib.rs +++ /dev/null @@ -1,60 +0,0 @@ -#![cfg_attr( - not(test), - deny( - clippy::panic, - clippy::unwrap_used, - clippy::expect_used, - clippy::unreachable, - clippy::todo, - clippy::unimplemented, - clippy::panic_in_result_fn, - clippy::unwrap_in_result, - clippy::get_unwrap, - clippy::string_slice, - clippy::indexing_slicing, - clippy::unchecked_time_subtraction, - clippy::disallowed_macros, - clippy::disallowed_methods, - clippy::fn_params_excessive_bools - ) -)] -//! TODO(prose) - -// keep sorted -#[cfg(feature = "accordion")] -pub mod accordion; -#[cfg(feature = "badge")] -pub mod badge; -#[cfg(feature = "command")] -pub mod command; -#[cfg(feature = "dialog")] -pub mod dialog; -#[cfg(feature = "disclosure")] -pub mod disclosure; -#[cfg(feature = "form")] -pub mod form; -#[cfg(feature = "hover-card")] -pub mod hover_card; -#[cfg(feature = "markdown")] -pub mod markdown; -#[cfg(feature = "notify")] -pub mod notify; -#[cfg(feature = "skeleton")] -pub mod skeleton; -#[cfg(feature = "spinner")] -pub mod spinner; -// keep sorted -#[cfg(any( - feature = "badge", - feature = "command", - feature = "disclosure", - feature = "form", - feature = "markdown", - feature = "notify", - feature = "skeleton", - feature = "spinner", - feature = "tabs" -))] -mod styles; -#[cfg(feature = "tabs")] -pub mod tabs; diff --git a/crates/eggshell-ui-shadcn/Cargo.toml b/crates/eggshell-ui-shadcn/Cargo.toml deleted file mode 100644 index 7f9c18a7..00000000 --- a/crates/eggshell-ui-shadcn/Cargo.toml +++ /dev/null @@ -1,40 +0,0 @@ -[package] -name = "eggshell-ui-shadcn" -version = "0.1.0" -edition = "2024" -rust-version = "1.96" -license = "MIT" -description = "The shadcn/ui design system as a eggshell style" -repository = "https://github.com/samitbasu/eggshell" - -[features] -default = ["fonts"] -# Bundles Geist (SIL OFL 1.1, fonts/OFL.txt), 165 KiB, as the preset's font. -fonts = ["eggshell-ui/fonts"] -# Fills the looks of eggshell-ui-extras' widgets from the preset's tokens. -extras = [ - "dep:eggshell-ui-extras", - # keep sorted - "eggshell-ui-extras/accordion", - "eggshell-ui-extras/badge", - "eggshell-ui-extras/command", - "eggshell-ui-extras/dialog", - "eggshell-ui-extras/disclosure", - "eggshell-ui-extras/form", - "eggshell-ui-extras/hover-card", - "eggshell-ui-extras/markdown", - "eggshell-ui-extras/notify", - "eggshell-ui-extras/skeleton", -] - -[dependencies] -eggshell-ui = { path = "../..", version = "0.1.0" } -egui = "0.37" -eggshell-ui-extras = { path = "../eggshell-ui-extras", version = "0.1.0", optional = true } - -[lints] -workspace = true - -[[example]] -name = "preset_dump" -required-features = ["extras"] diff --git a/crates/eggshell-ui-shadcn/README.md b/crates/eggshell-ui-shadcn/README.md deleted file mode 100644 index e3268505..00000000 --- a/crates/eggshell-ui-shadcn/README.md +++ /dev/null @@ -1,25 +0,0 @@ -# eggshell-ui-shadcn - -The shadcn/ui design system as an eggshell style. Nothing here runs until the -application calls `Shadcn::apply` (or `Shadcn::apply_both`). - -## Fonts - -With the default `fonts` feature the preset bundles **Geist**, shadcn's -default sans-serif, as one variable font, `src/fonts/Geist-Variable.ttf` -(`Geist[wght].ttf` from [vercel/geist-font](https://github.com/vercel/geist-font) -v1.9.2, 165 KiB). `Shadcn::apply` registers it at 400, 500, 600 and 700, so -`font_medium()`, `font_semibold()` and `font_bold()` draw real faces, and the -preset's buttons, labels and menu headings take shadcn's weights. - -Geist is licensed under the SIL Open Font License 1.1; the licence is shipped -beside the font in [`src/fonts/OFL.txt`](../../src/fonts/OFL.txt) and applies to the font -file only. The crate's code is MIT. - -- Swap the font with `Shadcn::with_fonts(Some(FontSet::variable(..)))` or - `FontSet::faces(..)` for static files, or keep egui's fonts with - `with_fonts(None)`. -- Leave it out with `default-features = false`: nothing is embedded, and - weights are drawn in the regular face with a debug warning. -- egui's own `default_fonts` feature embeds Ubuntu-Light, which Geist makes a - fallback only. Depend on egui with `default-features = false` to drop it. diff --git a/crates/eggshell-ui-shadcn/src/lib.rs b/crates/eggshell-ui-shadcn/src/lib.rs deleted file mode 100644 index 9f95ec33..00000000 --- a/crates/eggshell-ui-shadcn/src/lib.rs +++ /dev/null @@ -1,136 +0,0 @@ -#![deny(missing_docs)] -#![cfg_attr( - not(test), - deny( - clippy::panic, - clippy::unwrap_used, - clippy::expect_used, - clippy::unreachable, - clippy::todo, - clippy::unimplemented, - clippy::panic_in_result_fn, - clippy::unwrap_in_result, - clippy::get_unwrap, - clippy::string_slice, - clippy::indexing_slicing, - clippy::unchecked_time_subtraction, - clippy::disallowed_macros, - clippy::disallowed_methods, - clippy::fn_params_excessive_bools - ) -)] -//! The shadcn/ui design system as a [`eggshell_ui::Style`]. -//! -//! [`Shadcn`] is a preset: a [`ShadcnStyle`] (which of shadcn's styles, such as -//! [`Vega`](ShadcnStyle::Vega) or [`Lyra`](ShadcnStyle::Lyra)), a -//! [`Palette`] (shadcn's base and theme colours) and an egui theme (light or dark), -//! chosen independently. Nothing here runs unless the application calls -//! [`Shadcn::apply`]: the library never changes egui's style on its own. -//! -//! The crate only fills the contract. `eggshell` defines what its widgets -//! need and has no shadcn names or values; a style is data, so changing -//! [`ShadcnStyle`] at run time changes sizes, radii, text size and ring width -//! with no code change in the application. -//! -//! Applying a preset does three things. It fills the [`eggshell_ui::Style`] -//! contract with the tokens ([`Shadcn::style`]) and installs it for the -//! preset's theme, which the owned widgets and the text edit of `eggshell` -//! draw from. It maps the [`Tokens`] onto the egui [`Style`](egui::Style) of -//! the preset's theme (widget fills, strokes, radii, selection, spacing) for -//! the egui widgets an application draws outside eggshell. It also remembers -//! the tokens in the context, for [`tokens`] and [`Shadcn::of`]. -//! -//! ``` -//! use eggshell_ui_shadcn::{Palette, Shadcn, ShadcnStyle, ThemeColor}; -//! -//! let ctx = egui::Context::default(); -//! // Once at startup: shadcn's default preset, light and dark. -//! Shadcn::apply_both(&ctx); -//! // Or every frame, to switch style or colour at run time; a no-op while -//! // nothing changes. -//! Shadcn::apply_both_with(&ctx, ShadcnStyle::Lyra, Palette::new().theme(ThemeColor::Blue)); -//! // The tokens, for the application's own colours. -//! let background = Shadcn::of(&ctx).tokens.background; -//! # let _ = background; -//! ``` -//! -//! What eggshell cannot draw exactly and the preset therefore approximates is -//! documented on [`eggshell_ui::contract::InputStyle`] for the wrapped text edit; -//! the owned widgets are exact except for the negative spread of `shadow-md`. -//! -//! # Fonts -//! -//! With the default `fonts` feature the preset bundles Geist, shadcn's -//! `--font-sans`, as one variable font (165 KiB, SIL Open Font License 1.1, -//! `fonts/OFL.txt`) and [`Shadcn::apply`] registers it at every [`Weight`]: -//! Normal as the first font of [`FontFamily::Proportional`], the others as -//! named families its [`Faces`] declare. [`Shadcn::with_fonts`] swaps in -//! another [`FontSet`], or `None` for egui's fonts as the application set -//! them. Without the feature nothing is embedded and the preset starts with -//! no font, so its medium controls are drawn in the regular face, with a -//! debug warning. -//! -//! The application's own text picks a weight with eggshell's classes -//! (`tw().font_medium()`, `font_semibold`, `font_bold`). A [`FontSet`] of -//! static faces that leaves a weight out draws it in the nearest lighter -//! face it has. eggshell's symbol face (⌘, ⇧, ⌥) sits last in every weight's -//! family, behind Geist, so key chips and menu shortcuts draw in any weight. -//! -//! egui's `default_fonts` feature embeds its own Ubuntu-Light, which Geist -//! makes a fallback only. An application that does not need it can depend on -//! egui with `default-features = false` (and the features it does use) to -//! drop it from the binary. -//! -//! [`Weight`]: eggshell_ui::Weight -//! [`Faces`]: eggshell_ui::Faces -//! [`FontFamily::Proportional`]: egui::FontFamily::Proportional -//! -//! # Hovered and selected -//! -//! shadcn's components pair the two as follows, and the helpers on -//! [`Tokens`] name the pairs: -//! -//! | Component | Hovered | Selected | -//! |---|---|---| -//! | List or menu row on the page | `accent/50` ([`Tokens::accent_50`]) | `accent` with `accent-foreground` | -//! | Table row | `muted/50` ([`Tokens::muted_50`]) | `muted` | -//! | Ghost and outline button | `accent` with `accent-foreground` (dark: `accent/50`, `input/50`) | | -//! | Secondary, primary, destructive button | `secondary/80`, `primary/90`, `destructive/90` | | -//! -//! In the neutral palette `muted`, `accent` and `secondary` are one colour, -//! so a hover on a `muted` surface needs the half-strength variant of the -//! selected colour, not a different token. - -mod drag_chip; -mod preset; -#[rustfmt::skip] -mod sheets; - -pub use drag_chip::{DragChip, drag_chip}; -pub use eggshell_ui::theme::size; -pub use eggshell_ui::theme::{ - BaseColor, ContrastPair, ContrastRatio, Elevation, FontSet, HoverSurface, Palette, - REGISTRY_MISSES, RegistryMiss, ShadcnStyle, ThemeColor, Tokens, -}; -pub use preset::{Shadcn, tokens}; - -/// The names of shadcn's button variants, as the preset's sheet names them -/// for [`ButtonPart`](eggshell_ui::owned::ButtonPart). shadcn's `default` is -/// [`PRIMARY`](variant::PRIMARY); a button that names no variant is -/// [`SECONDARY`](variant::SECONDARY). -pub mod variant { - use eggshell_ui::contract::Variant; - - /// `default`. - pub const PRIMARY: Variant = Variant("primary"); - /// `secondary`: the variant of a button that names none. - pub const SECONDARY: Variant = Variant("secondary"); - /// `destructive`. - pub const DESTRUCTIVE: Variant = Variant("destructive"); - /// `outline`. - pub const OUTLINE: Variant = Variant("outline"); - /// `ghost`. - pub const GHOST: Variant = Variant("ghost"); - /// TODO(prose): `link`: primary-coloured text, underlined under the pointer. - pub const LINK: Variant = Variant("link"); -} diff --git a/crates/eggshell-ui-shadcn/src/sheets/mod.rs b/crates/eggshell-ui-shadcn/src/sheets/mod.rs deleted file mode 100644 index 5b4bfc56..00000000 --- a/crates/eggshell-ui-shadcn/src/sheets/mod.rs +++ /dev/null @@ -1,83 +0,0 @@ -//! The widgets' rules in each shadcn style, generated from the pinned shadcn -//! source by `cargo xtask shadcn-import --write`; CI fails if they drift -//! (`--check`). Each rule's classes carry the shadcn class they came from. -//! -//! This file is generated too. Do not edit. - -use eggshell_ui::sheet::Sheet; -use egui::Theme; - -use crate::ShadcnStyle; - -/// One half of a widget's rules: its light or its dark theme. -type Half = fn(&mut Sheet); - -#[cfg(feature = "extras")] mod vega_combobox; -#[cfg(feature = "extras")] mod vega_command; -#[cfg(feature = "extras")] mod vega_hover_card; -#[cfg(feature = "extras")] mod vega_dialog; -#[cfg(feature = "extras")] mod vega_alert_dialog; -#[cfg(feature = "extras")] mod vega_sheet; -#[cfg(feature = "extras")] mod vega_popover; -#[cfg(feature = "extras")] mod vega_badge; -#[cfg(feature = "extras")] mod vega_card; -#[cfg(feature = "extras")] mod vega_accordion; -#[cfg(feature = "extras")] mod vega_sonner; -#[cfg(feature = "extras")] mod vega_skeleton; -#[cfg(feature = "extras")] mod vega_spinner; -#[cfg(feature = "extras")] mod lyra_combobox; -#[cfg(feature = "extras")] mod lyra_command; -#[cfg(feature = "extras")] mod lyra_hover_card; -#[cfg(feature = "extras")] mod lyra_dialog; -#[cfg(feature = "extras")] mod lyra_alert_dialog; -#[cfg(feature = "extras")] mod lyra_sheet; -#[cfg(feature = "extras")] mod lyra_popover; -#[cfg(feature = "extras")] mod lyra_badge; -#[cfg(feature = "extras")] mod lyra_card; -#[cfg(feature = "extras")] mod lyra_accordion; -#[cfg(feature = "extras")] mod lyra_sonner; -#[cfg(feature = "extras")] mod lyra_skeleton; -#[cfg(feature = "extras")] mod lyra_spinner; - -/// Writes the rules of `style` for `theme` into `sheet`. Their colours are -/// the style's core tokens, which the sheet is resolved with. -pub(crate) fn write(sheet: &mut Sheet, style: ShadcnStyle, theme: Theme) { - let halves: &[(Half, Half)] = match style { - ShadcnStyle::Vega => &[ - #[cfg(feature = "extras")] (vega_combobox::light, vega_combobox::dark), - #[cfg(feature = "extras")] (vega_command::light, vega_command::dark), - #[cfg(feature = "extras")] (vega_hover_card::light, vega_hover_card::dark), - #[cfg(feature = "extras")] (vega_dialog::light, vega_dialog::dark), - #[cfg(feature = "extras")] (vega_alert_dialog::light, vega_alert_dialog::dark), - #[cfg(feature = "extras")] (vega_sheet::light, vega_sheet::dark), - #[cfg(feature = "extras")] (vega_popover::light, vega_popover::dark), - #[cfg(feature = "extras")] (vega_badge::light, vega_badge::dark), - #[cfg(feature = "extras")] (vega_card::light, vega_card::dark), - #[cfg(feature = "extras")] (vega_accordion::light, vega_accordion::dark), - #[cfg(feature = "extras")] (vega_sonner::light, vega_sonner::dark), - #[cfg(feature = "extras")] (vega_skeleton::light, vega_skeleton::dark), - #[cfg(feature = "extras")] (vega_spinner::light, vega_spinner::dark), - ], - ShadcnStyle::Lyra => &[ - #[cfg(feature = "extras")] (lyra_combobox::light, lyra_combobox::dark), - #[cfg(feature = "extras")] (lyra_command::light, lyra_command::dark), - #[cfg(feature = "extras")] (lyra_hover_card::light, lyra_hover_card::dark), - #[cfg(feature = "extras")] (lyra_dialog::light, lyra_dialog::dark), - #[cfg(feature = "extras")] (lyra_alert_dialog::light, lyra_alert_dialog::dark), - #[cfg(feature = "extras")] (lyra_sheet::light, lyra_sheet::dark), - #[cfg(feature = "extras")] (lyra_popover::light, lyra_popover::dark), - #[cfg(feature = "extras")] (lyra_badge::light, lyra_badge::dark), - #[cfg(feature = "extras")] (lyra_card::light, lyra_card::dark), - #[cfg(feature = "extras")] (lyra_accordion::light, lyra_accordion::dark), - #[cfg(feature = "extras")] (lyra_sonner::light, lyra_sonner::dark), - #[cfg(feature = "extras")] (lyra_skeleton::light, lyra_skeleton::dark), - #[cfg(feature = "extras")] (lyra_spinner::light, lyra_spinner::dark), - ], - }; - for (light, dark) in halves { - match theme { - Theme::Light => light(sheet), - Theme::Dark => dark(sheet), - } - } -} diff --git a/examples/accordion.rs b/examples/accordion.rs index 9cbe3479..c5a5f2d5 100644 --- a/examples/accordion.rs +++ b/examples/accordion.rs @@ -12,8 +12,8 @@ #[path = "common/mod.rs"] mod common; +use eggshell_ui::owned::accordion::{AccordionExt, Single}; use eggshell_ui::{Builder, tw}; -use eggshell_ui_extras::accordion::{AccordionExt, Single}; #[derive(Clone, Copy, Debug, Hash)] pub enum Part { diff --git a/examples/button.rs b/examples/button.rs index ce0f40be..a4a57cf7 100644 --- a/examples/button.rs +++ b/examples/button.rs @@ -10,8 +10,8 @@ #[path = "common/mod.rs"] mod common; +use eggshell_ui::theme::Tokens; use eggshell_ui::{Builder, Tw, tw}; -use eggshell_ui_shadcn::Tokens; use egui::Color32; type B<'b, 'f, A> = Builder<'b, 'f, A>; diff --git a/examples/button_children.rs b/examples/button_children.rs index e83a6a45..832a2bc9 100644 --- a/examples/button_children.rs +++ b/examples/button_children.rs @@ -5,8 +5,8 @@ mod common; use common::glyphs::{self, Glyph}; +use eggshell_ui::theme::size; use eggshell_ui::{Builder, tw}; -use eggshell_ui_shadcn::size; #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)] pub enum Tool { diff --git a/examples/chat.rs b/examples/chat.rs index 22f92d8d..014f41e6 100644 --- a/examples/chat.rs +++ b/examples/chat.rs @@ -116,7 +116,7 @@ impl Default for State { /// My bubbles are on the right and the others' on the left, with the corner /// nearest the speaker square. -fn bubble(t: &eggshell_ui_shadcn::Tokens, mine: bool) -> Tw { +fn bubble(t: &eggshell_ui::theme::Tokens, mine: bool) -> Tw { let bubble = tw() .flex() .flex_col() diff --git a/examples/chat_shell/details.rs b/examples/chat_shell/details.rs index 88d81f73..44f7e7c1 100644 --- a/examples/chat_shell/details.rs +++ b/examples/chat_shell/details.rs @@ -1,8 +1,8 @@ //! The right pane: environment, context, changes and background tasks. use eggshell_ui::overlay::Shown; +use eggshell_ui::owned::disclosure::SectionExt; use eggshell_ui::{Builder, Scope, Tw, tw}; -use eggshell_ui_extras::disclosure::SectionExt; use egui::Color32; use super::state::{App, MODELS, Pane}; diff --git a/examples/chat_shell/state.rs b/examples/chat_shell/state.rs index 5628b872..588635fb 100644 --- a/examples/chat_shell/state.rs +++ b/examples/chat_shell/state.rs @@ -4,7 +4,7 @@ use std::ops::RangeInclusive; use eggshell_ui::Progress; use eggshell_ui::owned::PaneSize; -use eggshell_ui_shadcn::ThemeColor; +use eggshell_ui::theme::ThemeColor; use egui::Vec2; /// A pane whose width the user drags. diff --git a/examples/chat_shell/theme.rs b/examples/chat_shell/theme.rs index 2f8f4b68..ced87a0b 100644 --- a/examples/chat_shell/theme.rs +++ b/examples/chat_shell/theme.rs @@ -5,8 +5,8 @@ use core::ops::Index; +use eggshell_ui::theme::Shadcn; use eggshell_ui::{TextSpec, TextStyle, Weight}; -use eggshell_ui_shadcn::Shadcn; use egui::{Color32, Context, FontFamily}; /// A colour by what it is for. diff --git a/examples/clipboard.rs b/examples/clipboard.rs index e29e92bc..18c80fe5 100644 --- a/examples/clipboard.rs +++ b/examples/clipboard.rs @@ -106,10 +106,10 @@ pub fn layout<'f>(b: &mut Builder<'_, 'f, State>, state: &'f State) { b.div_id(Part::Page, tw().flex().flex_col().gap(3.0).p(4.0), |s| { s.div(tw().flex().gap(2.0).items_center(), |s| { s.dropdown_menu(Part::Menu, "Edit") - .variant(eggshell_ui_shadcn::variant::OUTLINE) + .variant(eggshell_ui::theme::variant::OUTLINE) .items(|m| m.command(Cmd::Paste).add()); s.button(Part::Button, "Paste") - .variant(eggshell_ui_shadcn::variant::OUTLINE) + .variant(eggshell_ui::theme::variant::OUTLINE) .command(Cmd::Paste); }); match &state.arrived { diff --git a/examples/command_palette.rs b/examples/command_palette.rs index 460a084b..5c90e550 100644 --- a/examples/command_palette.rs +++ b/examples/command_palette.rs @@ -6,8 +6,8 @@ mod common; use eggshell_ui::owned::Mark; +use eggshell_ui::owned::command::{CommandExt, Open}; use eggshell_ui::{Builder, Chord, Command, Commands, tw}; -use eggshell_ui_extras::command::{CommandExt, Open}; use egui::{Key, Modifiers}; #[derive(Clone, Copy, Debug, Hash, PartialEq, Eq)] diff --git a/examples/common/mod.rs b/examples/common/mod.rs index 7e3728c0..21da12b8 100644 --- a/examples/common/mod.rs +++ b/examples/common/mod.rs @@ -19,8 +19,8 @@ use eggshell_ui::contract::{Themed, Variant}; use eggshell_ui::owned::{Cell, MenuPart}; use eggshell_ui::prim::text_field::Field; use eggshell_ui::sheet::Key as SheetKey; +use eggshell_ui::theme::{Palette, Shadcn, ShadcnStyle, ThemeColor, Tokens}; use eggshell_ui::{Aria, Builder, LayoutState, Match, TextSpec, TextStyle, Tw, Weight, tw}; -use eggshell_ui_shadcn::{Palette, Shadcn, ShadcnStyle, ThemeColor, Tokens}; use egui::{Color32, Context, FontFamily, Key, Role, Theme, ThemePreference, WidgetInfo}; pub mod dnd; diff --git a/examples/control_sizes.rs b/examples/control_sizes.rs index 338954e1..04b83c2f 100644 --- a/examples/control_sizes.rs +++ b/examples/control_sizes.rs @@ -4,8 +4,8 @@ #[path = "common/mod.rs"] mod common; +use eggshell_ui::theme::size; use eggshell_ui::{Builder, tw}; -use eggshell_ui_shadcn::size; /// ```html ///