diff --git a/native/src/avatars.rs b/native/src/avatars.rs index 5ca7ad6..1b89a0e 100644 --- a/native/src/avatars.rs +++ b/native/src/avatars.rs @@ -1,159 +1,60 @@ -//! The icons a bot can have, by the name kept as its avatar (`icons.ts`): drawn on the bot's wash of -//! colour by `view::avatar` (`.avatar svg.lucide`), and as the choices of the icon picker -//! (`.icon-picker`). The drawings are the page's own set. +//! The Solar Linear icons (stroke 1.8) a bot can have, by the name kept as its avatar +//! (`icons.ts` / `solar_icons_data.rs`): drawn on the bot's wash of colour by `view::avatar` +//! (`.avatar svg.solar`), and as the choices of the icon picker (`.icon-picker`). use std::sync::LazyLock; use weft::{Color, El, Icon, icon}; -/// `.avatar svg.lucide`: the line of an icon on a bot's face. -const STROKE_AVATAR: f32 = 1.5; -/// `svg.lucide`: the line of every other icon. -const STROKE: f32 = 1.75; - -/// The name kept as the avatar, and the drawing's body (a 24 by 24 box). -const ICONS: &[(&str, &str)] = &[ - ( - "bot", - r##""##, - ), - ( - "search", - r##""##, - ), - ( - "pen", - r##""##, - ), - ( - "code", - r##""##, - ), - ( - "terminal", - r##""##, - ), - ( - "folder", - r##""##, - ), - ( - "compass", - r##""##, - ), - ( - "brain", - r##""##, - ), - ( - "book", - r##""##, - ), - ( - "bug", - r##""##, - ), - ( - "chart", - r##""##, - ), - ( - "data", - r##""##, - ), - ( - "globe", - r##""##, - ), - ( - "shield", - r##""##, - ), - ( - "wrench", - r##""##, - ), - ( - "rocket", - r##""##, - ), - ( - "flask", - r##""##, - ), - ( - "mail", - r##""##, - ), - ( - "calendar", - r##""##, - ), - ( - "camera", - r##""##, - ), - ( - "music", - r##""##, - ), - ( - "sprout", - r##""##, - ), - ( - "leaf", - r##""##, - ), - ( - "zap", - r##""##, - ), - ( - "key", - r##""##, - ), -]; +use crate::solar_icons_data::{SOLAR_AVATARS, SOLAR_STROKE}; /// The names of the icons, in the order of the picker. pub fn names() -> impl Iterator { - ICONS.iter().map(|(name, _)| *name) + SOLAR_AVATARS.iter().map(|(name, _)| *name) } /// Whether `name` is the name of one of the icons. pub fn has(name: &str) -> bool { - ICONS.iter().any(|(n, _)| *n == name) + SOLAR_AVATARS.iter().any(|(n, _)| *n == name) } -fn svg(body: &str, stroke: f32) -> String { +fn svg(body: &str) -> String { format!( "{body}" ) } -/// Each icon drawn with the line of a face and with the usual one. -fn drawn() -> &'static [(Icon, Icon)] { - static SET: LazyLock> = LazyLock::new(|| { - ICONS +/// Each Solar Linear bot icon parsed once and shared. +fn drawn() -> &'static [Icon] { + static SET: LazyLock> = LazyLock::new(|| { + SOLAR_AVATARS .iter() .map(|(name, body)| { - let make = |stroke| { - Icon::from_svg(&format!("bot-icon-{name}"), &svg(body, stroke)) - .expect("a drawing is valid SVG") - }; - (make(STROKE_AVATAR), make(STROKE)) + Icon::from_svg(&format!("bot-icon-{name}"), &svg(body)) + .expect("a Solar avatar drawing is valid SVG") }) .collect() }); &SET } -/// The icon `name` as an element of `size` px in `color`, with the line a bot's face has -/// (`on_face`) or the usual one; none when `name` is not one of the icons. -pub fn sign(name: &str, size: f32, on_face: bool, color: Color) -> Option> { - let at = ICONS.iter().position(|(n, _)| *n == name)?; - let (face, usual) = &drawn()[at]; - let chosen = if on_face { face } else { usual }; - Some(icon(chosen.clone()).size(size).color(color).el()) +/// The icon `name` as an element of `size` px in `color`; none when `name` is not one of the +/// icons. (`_on_face` is retained for signature compatibility — Solar Linear uses stroke 1.8 +/// consistently on both faces and the icon picker.) +pub fn sign(name: &str, size: f32, _on_face: bool, color: Color) -> Option> { + let at = SOLAR_AVATARS.iter().position(|(n, _)| *n == name)?; + Some(icon(drawn()[at].clone()).size(size).color(color).el()) +} + +#[cfg(test)] +mod tests { + use super::*; + + #[test] + fn every_solar_linear_avatar_parses() { + assert_eq!(drawn().len(), 25); + assert!(has("bot")); + assert!(!has("constructor")); + } } diff --git a/native/src/icons.rs b/native/src/icons.rs index 723ea3a..bb1eadf 100644 --- a/native/src/icons.rs +++ b/native/src/icons.rs @@ -1,9 +1,11 @@ -//! The signs the window draws: 16 px, a 1.75 px line, in the colour of the words beside them. +//! The Solar Linear signs the window draws: 16 px, a 1.8 px line, in the colour of the words +//! beside them (`solar_icons_data`, generated from `@iconify-json/solar`). use std::sync::LazyLock; use weft::{Color, El, Icon, icon}; -use crate::tokens::{ICON, Tokens}; +use crate::solar_icons_data::{SOLAR_GLYPHS, SOLAR_STROKE}; +use crate::tokens::ICON; #[derive(Debug, Clone, Copy, PartialEq, Eq)] pub enum Glyph { @@ -124,95 +126,17 @@ impl Glyph { } fn body(self) -> &'static str { - match self { - Glyph::ArrowUp => r#""#, - Glyph::Stop => r##""##, - Glyph::Folder => { - r#""# - } - Glyph::NewConversation => { - r##""## - } - Glyph::ChevronRight => r#""#, - Glyph::ChevronDown => r#""#, - Glyph::Circle => r#""#, - Glyph::CircleDot => { - r##""## - } - Glyph::CircleCheck => { - r#""# - } - Glyph::CircleAlert => { - r#""# - } - Glyph::Copy => { - r#""# - } - Glyph::Inbox => { - r#""# - } - Glyph::Clock => r#""#, - Glyph::X => r#""#, - Glyph::Retry => { - r#""# - } - Glyph::Pencil => { - r#""# - } - Glyph::Fork => { - r#""# - } - Glyph::Speaker => { - r#""# - } - Glyph::Plus => r#""#, - Glyph::Check => r#""#, - Glyph::Pin => { - r#""# - } - Glyph::Ellipsis => { - r#""# - } - Glyph::Eye => { - r#""# - } - Glyph::EyeOff => { - r#""# - } - Glyph::Paperclip => { - r#""# - } - Glyph::Gear => { - r#""# - } - Glyph::Blocks => { - r#""# - } - Glyph::CalendarClock => { - r#""# - } - Glyph::ArrowDown => r#""#, - Glyph::ChevronUp => r#""#, - Glyph::FileText => { - r#""# - } - Glyph::ListChecks => { - r#""# - } - Glyph::Search => r#""#, - Glyph::PenLine => { - r#""# - } - Glyph::Mic => { - r#""# - } - } + let name = self.name(); + SOLAR_GLYPHS + .iter() + .find_map(|(k, v)| (*k == name).then_some(*v)) + .expect("every Glyph is generated in solar_icons_data") } fn svg(self) -> String { format!( "{}", self.body() ) @@ -221,7 +145,7 @@ impl Glyph { fn drawn(self) -> Icon { static SET: LazyLock> = LazyLock::new(|| { ALL.iter() - .map(|g| Icon::from_svg(g.name(), &g.svg()).expect("a drawing is valid SVG")) + .map(|g| Icon::from_svg(g.name(), &g.svg()).expect("a Solar drawing is valid SVG")) .collect() }); let at = ALL.iter().position(|g| *g == self).expect("in ALL"); @@ -239,180 +163,16 @@ pub fn sign_icon(glyph: Glyph, color: Color) -> El { sign(glyph, ICON, color) } -// ---- Two-tone sidebar shelf marks (`ShelfIcons.ts`, matching `d41sys/ours`) ---- - -#[derive(Debug, Clone, Copy, PartialEq, Eq)] -pub enum Shelf { - Activity, - Project, - Addons, - Settings, -} - -const SHELVES: &[Shelf] = &[ - Shelf::Activity, - Shelf::Project, - Shelf::Addons, - Shelf::Settings, -]; - -impl Shelf { - fn name(self) -> &'static str { - match self { - Shelf::Activity => "shelf-activity", - Shelf::Project => "shelf-project", - Shelf::Addons => "shelf-addons", - Shelf::Settings => "shelf-settings", - } - } - - fn body(self, active: bool) -> String { - let wash = if active { - r##" fill="#000" fill-opacity="0.16""## - } else { - "" - }; - match self { - Shelf::Activity => format!( - r#""# - ), - Shelf::Project => format!( - r#""# - ), - Shelf::Addons => format!( - r#""# - ), - Shelf::Settings => format!( - r#""# - ), - } - } - - fn svg(self, active: bool) -> String { - format!( - "{}", - self.body(active) - ) - } - - fn drawn(self, active: bool) -> Icon { - static SET: LazyLock> = LazyLock::new(|| { - SHELVES - .iter() - .map(|s| { - let idle = Icon::from_svg(s.name(), &s.svg(false)) - .expect("a shelf drawing is valid SVG"); - let filled = Icon::from_svg(&format!("{}-active", s.name()), &s.svg(true)) - .expect("an active shelf drawing is valid SVG"); - (idle, filled) - }) - .collect() - }); - let at = SHELVES.iter().position(|s| *s == self).expect("in SHELVES"); - if active { - SET[at].1.clone() - } else { - SET[at].0.clone() - } - } -} - -/// Sidebar navigation mark: tints `k.fg` with a 16% inner wash when active, else `k.fg_muted`. -pub fn sign_shelf(shelf: Shelf, active: bool, k: &Tokens) -> El { - let color = if active { k.fg } else { k.fg_muted }; - icon(shelf.drawn(active)).size(ICON).color(color).el() -} - -// ---- 16x16 pixel-snapped starter marks (`StarterIcons.ts`, matching `d41sys/ours`) ---- - -#[derive(Debug, Clone, Copy, PartialEq, Eq)] -pub enum StarterMark { - PlanTask, - ExplainFile, - ReviewChanges, - WriteDraft, -} - -const STARTERS: &[StarterMark] = &[ - StarterMark::PlanTask, - StarterMark::ExplainFile, - StarterMark::ReviewChanges, - StarterMark::WriteDraft, -]; - -impl StarterMark { - fn name(self) -> &'static str { - match self { - StarterMark::PlanTask => "starter-plan-task", - StarterMark::ExplainFile => "starter-explain-file", - StarterMark::ReviewChanges => "starter-review-changes", - StarterMark::WriteDraft => "starter-write-draft", - } - } - - fn body(self) -> &'static str { - match self { - StarterMark::PlanTask => { - r##""## - } - StarterMark::ExplainFile => { - r##""## - } - StarterMark::ReviewChanges => { - r##""## - } - StarterMark::WriteDraft => { - r##""## - } - } - } - - fn svg(self) -> String { - format!( - "{}", - self.body() - ) - } - - fn drawn(self) -> Icon { - static SET: LazyLock> = LazyLock::new(|| { - STARTERS - .iter() - .map(|m| Icon::from_svg(m.name(), &m.svg()).expect("a starter mark is valid SVG")) - .collect() - }); - let at = STARTERS - .iter() - .position(|m| *m == self) - .expect("in STARTERS"); - SET[at].clone() - } -} - -/// 16x16 pixel-snapped starter mark tinted `color`. -pub fn sign_starter(mark: StarterMark, color: Color) -> El { - icon(mark.drawn()).size(ICON).color(color).el() -} - #[cfg(test)] mod tests { use super::*; #[test] - fn every_glyph_shelf_and_starter_svg_parses() { + fn every_solar_linear_glyph_parses_at_stroke_1_8() { + assert!((SOLAR_STROKE - 1.8).abs() < f32::EPSILON); + assert_eq!(ALL.len(), SOLAR_GLYPHS.len()); for &g in ALL { let _ = g.drawn(); } - for &s in SHELVES { - let _ = s.drawn(false); - let _ = s.drawn(true); - } - for &m in STARTERS { - let _ = m.drawn(); - } } } diff --git a/native/src/lib.rs b/native/src/lib.rs index 8a9d3c6..9b6b942 100644 --- a/native/src/lib.rs +++ b/native/src/lib.rs @@ -74,6 +74,8 @@ pub mod sheet; #[cfg(feature = "gui")] pub mod skills; #[cfg(feature = "gui")] +mod solar_icons_data; +#[cfg(feature = "gui")] pub mod starters; #[cfg(feature = "gui")] pub mod talk; diff --git a/native/src/solar_icons_data.rs b/native/src/solar_icons_data.rs new file mode 100644 index 0000000..e0b73db --- /dev/null +++ b/native/src/solar_icons_data.rs @@ -0,0 +1,236 @@ +//! GENERATED by `window/ui/scripts/build-solar-icons.mjs` — do not edit. +//! +//! Run `cd window/ui && npm run build:solar-icons` after changing `window/ui/src/solarSlugs.ts`. +//! +//! Solar Icons (linear style, stroke-width 1.8) via `@iconify-json/solar` +//! (CC-BY-4.0, 480 Design). + +/// Stroke width for all Solar Linear icons across Bate. +pub const SOLAR_STROKE: f32 = 1.8; + +/// UI glyph SVG bodies by kebab-case name. +pub const SOLAR_GLYPHS: &[(&str, &str)] = &[ + ("arrow-up", ""), + ("arrow-down", ""), + ( + "stop", + "", + ), + ( + "folder", + "", + ), + ( + "new-conversation", + "", + ), + ("chevron-right", ""), + ("chevron-down", ""), + ("chevron-up", ""), + ("circle", ""), + ( + "circle-dot", + "", + ), + ( + "circle-check", + "", + ), + ( + "circle-alert", + "", + ), + ( + "copy", + "", + ), + ( + "inbox", + "", + ), + ( + "clock", + "", + ), + ( + "x", + "", + ), + ( + "rotate-ccw", + "", + ), + ( + "pencil", + "", + ), + ( + "git-fork", + "", + ), + ( + "volume-2", + "", + ), + ( + "plus", + "", + ), + ("check", ""), + ( + "pin", + "", + ), + ( + "ellipsis", + "", + ), + ( + "eye", + "", + ), + ( + "eye-off", + "", + ), + ( + "paperclip", + "", + ), + ( + "settings", + "", + ), + ( + "blocks", + "", + ), + ( + "calendar-clock", + "", + ), + ( + "file-text", + "", + ), + ( + "list-checks", + "", + ), + ( + "search", + "", + ), + ( + "pen-line", + "", + ), + ( + "mic", + "", + ), +]; + +/// Bot avatar SVG bodies in picker order. +pub const SOLAR_AVATARS: &[(&str, &str)] = &[ + ( + "bot", + "", + ), + ( + "search", + "", + ), + ( + "pen", + "", + ), + ( + "code", + "", + ), + ( + "terminal", + "", + ), + ( + "folder", + "", + ), + ( + "compass", + "", + ), + ( + "brain", + "", + ), + ( + "book", + "", + ), + ( + "bug", + "", + ), + ( + "chart", + "", + ), + ( + "data", + "", + ), + ( + "globe", + "", + ), + ( + "shield", + "", + ), + ( + "wrench", + "", + ), + ( + "rocket", + "", + ), + ( + "flask", + "", + ), + ( + "mail", + "", + ), + ( + "calendar", + "", + ), + ( + "camera", + "", + ), + ( + "music", + "", + ), + ( + "sprout", + "", + ), + ( + "leaf", + "", + ), + ( + "zap", + "", + ), + ( + "key", + "", + ), +]; diff --git a/native/src/starters.rs b/native/src/starters.rs index 0c0e767..d49d994 100644 --- a/native/src/starters.rs +++ b/native/src/starters.rs @@ -5,7 +5,7 @@ use crate::app::{App, COMPOSER, LOG}; use crate::controls::words; -use crate::icons::{StarterMark, sign_starter}; +use crate::icons::{Glyph, sign_icon}; use crate::state::Bot; use crate::times::{self, Calendar}; use crate::tokens::*; @@ -16,26 +16,22 @@ type V = El; /// What an empty conversation offers under the box: the label, the words a press puts in the /// box, and the sign. -pub const STARTERS: [(&str, &str, StarterMark); 4] = [ - ( - "Plan a task", - "Help me plan this task: ", - StarterMark::PlanTask, - ), +pub const STARTERS: [(&str, &str, Glyph); 4] = [ + ("Plan a task", "Help me plan this task: ", Glyph::ListChecks), ( "Explain a file", "Explain what this file does: ", - StarterMark::ExplainFile, + Glyph::FileText, ), ( "Review my changes", "Review the changes in this folder and list what could break.", - StarterMark::ReviewChanges, + Glyph::Eye, ), ( "Write a first draft", "Write a first draft of ", - StarterMark::WriteDraft, + Glyph::PenLine, ), ]; @@ -118,7 +114,7 @@ fn prompts(k: &Tokens) -> V { bottom: 0.0, left: 0.0, }) - .children(STARTERS.iter().map(|(label, said, mark)| { + .children(STARTERS.iter().map(|(label, said, glyph)| { row() .key(key(label)) .role(Role::Button) @@ -140,7 +136,7 @@ fn prompts(k: &Tokens) -> V { // The box takes the words as typed: the caret is after them. act.set_caret(COMPOSER, said.len()); }) - .child(sign_starter(*mark, k.fg_muted)) + .child(sign_icon(*glyph, k.fg_muted)) .child(words(*label, SIZE_TITLE, LEADING, k.fg_muted).weight(500)) })) } diff --git a/native/src/view.rs b/native/src/view.rs index 7868280..5f298bc 100644 --- a/native/src/view.rs +++ b/native/src/view.rs @@ -15,7 +15,7 @@ use crate::chat::{self, Call, Item, Part, Said, Shown, Status}; use crate::controls::{self, Tip, mono}; use crate::conversations; use crate::forms; -use crate::icons::{Glyph, Shelf, sign, sign_icon, sign_shelf}; +use crate::icons::{Glyph, sign, sign_icon}; use crate::later; use crate::lists; use crate::nav::{self, RowState}; @@ -376,7 +376,10 @@ fn activity_row(app: &App, k: &Tokens) -> V { let active = app.screen == Screen::Activity; let mut r = side_row(k, "activity".to_owned(), "Activity", active) .on_press(|app: &mut App| app.activity()) - .child(sign_shelf(Shelf::Activity, active, k)) + .child(sign_icon( + Glyph::Inbox, + if active { k.fg } else { k.fg_muted }, + )) .child(name_text("Activity", k)); if needs > 0 { let verb = if needs == 1 { "needs" } else { "need" }; @@ -451,7 +454,10 @@ fn sidebar(app: &App, cx: &Cx, k: &Tokens) -> V { && app.project.as_deref() == Some(project.id.as_str()); side_row(k, format!("project-{}", project.id), &project.name, current) .on_press(move |app: &mut App| app.open_project(&id)) - .child(sign_shelf(Shelf::Project, current, k)) + .child(sign_icon( + Glyph::Folder, + if current { k.fg } else { k.fg_muted }, + )) .child(name_text(&project.name, k)) }) .child(col().gap(SPACE_0).pad_xy(0.0, 0.0).children( @@ -527,7 +533,7 @@ fn sidebar(app: &App, cx: &Cx, k: &Tokens) -> V { k, "addons", "Add-ons", - Shelf::Addons, + Glyph::Blocks, Screen::Addons, )) .child(foot_row( @@ -535,7 +541,7 @@ fn sidebar(app: &App, cx: &Cx, k: &Tokens) -> V { k, "settings", "Settings", - Shelf::Settings, + Glyph::Gear, Screen::Settings, )), ); @@ -742,11 +748,11 @@ fn sheet(app: &App, cx: &Cx, k: &Tokens) -> V { } /// `.sidebar .foot` rows of pages: Add-ons and Settings. -fn foot_row(app: &App, k: &Tokens, key: &str, name: &str, shelf: Shelf, screen: Screen) -> V { +fn foot_row(app: &App, k: &Tokens, key: &str, name: &str, glyph: Glyph, screen: Screen) -> V { let active = app.screen == screen; side_row(k, key.to_owned(), name, active) .on_press(move |app: &mut App| app.go(screen)) - .child(sign_shelf(shelf, active, k)) + .child(sign_icon(glyph, if active { k.fg } else { k.fg_muted })) .child(name_text(name, k)) } diff --git a/native/tests/later_starters_metrics.rs b/native/tests/later_starters_metrics.rs index ab37233..09752f5 100644 --- a/native/tests/later_starters_metrics.rs +++ b/native/tests/later_starters_metrics.rs @@ -128,7 +128,7 @@ fn a_later_turns_chip_has_the_padding_the_gap_and_the_height_of_the_stylesheet() // The sign: the small size, after the left padding. let sign = icon_in(&mut w, "later-1"); let small = px(&rule( - ".title .chevron, .chip > svg.lucide, .attached li > svg.lucide, .queue li > svg.lucide", + ".title .chevron, .chip > svg.solar, .attached li > svg.solar, .queue li > svg.solar", "width", )); close(sign.w, small, ".queue li > svg width"); @@ -165,7 +165,7 @@ fn a_later_turns_chip_has_the_padding_the_gap_and_the_height_of_the_stylesheet() ); close( cross.w, - px(&rule("svg.lucide", "width")), + px(&rule("svg.solar", "width")), "the cross is an icon", ); } @@ -366,7 +366,7 @@ fn the_starters_have_the_margin_the_gap_and_the_buttons_of_the_stylesheet() { close(sign.x - first.x, pad_x, ".prompts button padding-inline"); close( sign.w, - px(&rule("svg.lucide", "width")), + px(&rule("svg.solar", "width")), "a starter's sign is an icon", ); let said = by_text_under(&mut w.rt, &keys[0], "Plan a task"); diff --git a/native/tests/snapshots/native-bot-settings-look-dark.png b/native/tests/snapshots/native-bot-settings-look-dark.png index 7d4cc47..06de090 100644 Binary files a/native/tests/snapshots/native-bot-settings-look-dark.png and b/native/tests/snapshots/native-bot-settings-look-dark.png differ diff --git a/native/tests/snapshots/native-bot-settings-look-light.png b/native/tests/snapshots/native-bot-settings-look-light.png index 8a64b8d..e763c28 100644 Binary files a/native/tests/snapshots/native-bot-settings-look-light.png and b/native/tests/snapshots/native-bot-settings-look-light.png differ diff --git a/native/tests/snapshots/native-bot-settings-paused-dark.png b/native/tests/snapshots/native-bot-settings-paused-dark.png index 7da8243..47ce1e3 100644 Binary files a/native/tests/snapshots/native-bot-settings-paused-dark.png and b/native/tests/snapshots/native-bot-settings-paused-dark.png differ diff --git a/native/tests/snapshots/native-bot-settings-paused-light.png b/native/tests/snapshots/native-bot-settings-paused-light.png index 7052bdf..b2a92be 100644 Binary files a/native/tests/snapshots/native-bot-settings-paused-light.png and b/native/tests/snapshots/native-bot-settings-paused-light.png differ diff --git a/native/tests/snapshots/native-bot-settings-select-dark.png b/native/tests/snapshots/native-bot-settings-select-dark.png index bcb35c9..beb5163 100644 Binary files a/native/tests/snapshots/native-bot-settings-select-dark.png and b/native/tests/snapshots/native-bot-settings-select-dark.png differ diff --git a/native/tests/snapshots/native-bot-settings-select-light.png b/native/tests/snapshots/native-bot-settings-select-light.png index f4be10f..310f24d 100644 Binary files a/native/tests/snapshots/native-bot-settings-select-light.png and b/native/tests/snapshots/native-bot-settings-select-light.png differ diff --git a/native/tests/snapshots/native-newbot-card-dark.png b/native/tests/snapshots/native-newbot-card-dark.png index 73dc5d9..5fafc2e 100644 Binary files a/native/tests/snapshots/native-newbot-card-dark.png and b/native/tests/snapshots/native-newbot-card-dark.png differ diff --git a/native/tests/snapshots/native-newbot-card-light.png b/native/tests/snapshots/native-newbot-card-light.png index a98f0e0..027b413 100644 Binary files a/native/tests/snapshots/native-newbot-card-light.png and b/native/tests/snapshots/native-newbot-card-light.png differ diff --git a/native/tests/snapshots/native-newbot-dark.png b/native/tests/snapshots/native-newbot-dark.png index 36ebc8c..289935e 100644 Binary files a/native/tests/snapshots/native-newbot-dark.png and b/native/tests/snapshots/native-newbot-dark.png differ diff --git a/native/tests/snapshots/native-newbot-light.png b/native/tests/snapshots/native-newbot-light.png index 44a3f36..8c6d35b 100644 Binary files a/native/tests/snapshots/native-newbot-light.png and b/native/tests/snapshots/native-newbot-light.png differ diff --git a/window/ui/package-lock.json b/window/ui/package-lock.json index d46f033..f887a71 100644 --- a/window/ui/package-lock.json +++ b/window/ui/package-lock.json @@ -7,7 +7,6 @@ "name": "bate-window", "dependencies": { "@tanstack/react-virtual": "3.14.26", - "lucide-react": "1.82.0", "react": "19.3.1", "react-dom": "19.3.1", "react-markdown": "10.1.0", @@ -15,6 +14,7 @@ "remark-gfm": "4.0.1" }, "devDependencies": { + "@iconify-json/solar": "1.2.18", "@types/react": "19.3.0", "@types/react-dom": "19.3.0", "@vitejs/plugin-react": "6.3.0", @@ -57,6 +57,23 @@ "tslib": "^2.4.0" } }, + "node_modules/@iconify-json/solar": { + "version": "1.2.18", + "resolved": "https://registry.npmjs.org/@iconify-json/solar/-/solar-1.2.18.tgz", + "integrity": "sha512-eF1s/laFsO8l/5a//vrfaCUfiDsuKPpZ1/rWhO0th2EOu9UvxOlRyMw4Ivik6EJgguz6+/NJuepSbPVOm666rg==", + "dev": true, + "license": "CC-BY-4.0", + "dependencies": { + "@iconify/types": "*" + } + }, + "node_modules/@iconify/types": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/@iconify/types/-/types-2.0.0.tgz", + "integrity": "sha512-+wluvCrRhXrhyOmRDJ3q8mux9JkKy5SJ/v8ol2tu4FVjyYvtEzkc/3pK15ET6RKg4b4w4BmTk1+gsCUhf21Ykg==", + "dev": true, + "license": "MIT" + }, "node_modules/@napi-rs/wasm-runtime": { "version": "1.2.6", "resolved": "https://registry.npmjs.org/@napi-rs/wasm-runtime/-/wasm-runtime-1.2.6.tgz", @@ -1506,21 +1523,6 @@ "url": "https://github.com/sponsors/wooorm" } }, - "node_modules/lucide-react": { - "version": "1.82.0", - "resolved": "https://registry.npmjs.org/lucide-react/-/lucide-react-1.82.0.tgz", - "integrity": "sha512-6jSApJxVZnyOGO5q7ygxiaVmzt87OtkfzpU5aD14ph32W78hBtmwEkVj2ehGyhfEynSM6TEEnFhPq24QhSOz6g==", - "license": "ISC", - "peerDependencies": { - "@types/react": "*", - "react": "^16.5.1 || ^17.0.0 || ^18.0.0 || ^19.0.0" - }, - "peerDependenciesMeta": { - "@types/react": { - "optional": true - } - } - }, "node_modules/markdown-table": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/markdown-table/-/markdown-table-3.1.0.tgz", diff --git a/window/ui/package.json b/window/ui/package.json index 4620191..35a6042 100644 --- a/window/ui/package.json +++ b/window/ui/package.json @@ -5,13 +5,13 @@ "scripts": { "build": "tsc --noEmit && vite build", "build:brand-icons": "node ./scripts/build-brand-icons.mjs", + "build:solar-icons": "node ./scripts/build-solar-icons.mjs", "test": "node --test 'src/**/*.test.ts' 'standin/*.test.mjs'", "standin": "node standin/serve.mjs", "shots": "node standin/shots.mjs" }, "dependencies": { "@tanstack/react-virtual": "3.14.26", - "lucide-react": "1.82.0", "react": "19.3.1", "react-dom": "19.3.1", "react-markdown": "10.1.0", @@ -19,6 +19,7 @@ "remark-gfm": "4.0.1" }, "devDependencies": { + "@iconify-json/solar": "1.2.18", "@types/react": "19.3.0", "@types/react-dom": "19.3.0", "@vitejs/plugin-react": "6.3.0", diff --git a/window/ui/scripts/build-solar-icons.mjs b/window/ui/scripts/build-solar-icons.mjs new file mode 100644 index 0000000..cc51a36 --- /dev/null +++ b/window/ui/scripts/build-solar-icons.mjs @@ -0,0 +1,166 @@ +/** + * Generate `window/ui/src/solarIcons.generated.ts` and + * `native/src/solar_icons_data.rs` from `@iconify-json/solar` (`*-linear` set). + * + * npm run build:solar-icons + * + * Every icon is normalized to Solar Linear geometry on a 24x24 viewBox with + * `stroke-width="1.8"`, round caps, and round joins. `@iconify-json/solar` + * stays a devDependency only; runtime code imports only the generated output. + */ + +import { readFileSync, writeFileSync } from "node:fs"; +import path from "node:path"; +import { fileURLToPath } from "node:url"; + +import { SOLAR_AVATAR_SLUGS, SOLAR_UI_SLUGS } from "../src/solarSlugs.ts"; + +const STROKE_WIDTH = 1.8; +const GEOM_ATTRS = new Set(["d", "cx", "cy", "r", "rx", "ry", "x", "y", "width", "height", "x1", "y1", "x2", "y2", "points"]); +const ALLOWED_TAGS = new Set(["path", "circle", "ellipse", "rect", "line", "polyline", "polygon"]); + +const uiDir = path.join(path.dirname(fileURLToPath(import.meta.url)), ".."); +const repoDir = path.join(uiDir, "..", ".."); +const solarPath = path.join(uiDir, "node_modules", "@iconify-json", "solar", "icons.json"); +const solarData = JSON.parse(readFileSync(solarPath, "utf8")); + +/** Parse leaf SVG shape elements from a Solar linear icon body. */ +function extractShapes(slug) { + if (!slug.endsWith("-linear")) { + throw new Error(`solar icon "${slug}" must use the -linear style`); + } + const entry = solarData.icons?.[slug]; + if (!entry?.body) { + throw new Error(`solar icon "${slug}" not found in @iconify-json/solar`); + } + const shapes = []; + for (const match of entry.body.matchAll(/<([a-zA-Z0-9]+)([^>]*?)\/?>/g)) { + const tag = match[1]; + if (tag === "g") continue; + if (!ALLOWED_TAGS.has(tag)) { + throw new Error(`solar icon "${slug}" has unexpected SVG tag <${tag}>`); + } + const attrs = {}; + for (const a of match[2].matchAll(/([a-zA-Z0-9:-]+)="([^"]*)"/g)) { + if (GEOM_ATTRS.has(a[1])) { + attrs[a[1]] = a[2]; + } + } + shapes.push([tag, attrs]); + } + if (shapes.length === 0) { + throw new Error(`solar icon "${slug}" produced no SVG shapes`); + } + return shapes; +} + +/** Serialize shapes back to compact SVG inner markup for Rust (`native`). */ +function toSvgBody(shapes) { + return shapes + .map(([tag, attrs]) => { + const serialized = Object.entries(attrs) + .map(([k, v]) => `${k}="${v}"`) + .join(" "); + return `<${tag} ${serialized}/>`; + }) + .join(""); +} + +const uiEntries = Object.entries(SOLAR_UI_SLUGS).map(([exportName, { rustName, slug }]) => ({ + exportName, + rustName, + slug, + shapes: extractShapes(slug), +})); + +const avatarEntries = SOLAR_AVATAR_SLUGS.map(([name, slug]) => ({ + name, + slug, + shapes: extractShapes(slug), +})); + +const tsOutput = `/** + * GENERATED by scripts/build-solar-icons.mjs — do not edit. + * + * Run \`npm run build:solar-icons\` after changing src/solarSlugs.ts. + * + * Solar Icons (linear style, stroke-width ${STROKE_WIDTH}) via \`@iconify-json/solar\` + * (CC-BY-4.0, 480 Design). Bundled inline with zero runtime icon dependency. + */ + +import { createElement, type ComponentType, type SVGProps } from "react"; + +export type SolarIcon = ComponentType>; + +type Shape = readonly [tag: string, attrs: Readonly>]; + +function solar(name: string, shapes: readonly Shape[]): SolarIcon { + const Icon: SolarIcon = ({ className, ...props }) => + createElement( + "svg", + { + width: 24, + height: 24, + viewBox: "0 0 24 24", + fill: "none", + stroke: "currentColor", + strokeWidth: ${STROKE_WIDTH}, + strokeLinecap: "round", + strokeLinejoin: "round", + "aria-hidden": true, + ...props, + className: className ? \`solar \${className}\` : "solar", + }, + shapes.map(([tag, attrs], index) => createElement(tag, { key: index, ...attrs })), + ); + Icon.displayName = name; + return Icon; +} + +${uiEntries + .map((e) => `export const ${e.exportName} = solar(${JSON.stringify(e.exportName)}, ${JSON.stringify(e.shapes)});`) + .join("\n")} + +/** Bot avatar icons in picker order (keys are saved in bot files, max 8 chars). */ +export const SOLAR_AVATARS: ReadonlyArray = [ +${avatarEntries + .map((e) => ` [${JSON.stringify(e.name)}, solar(${JSON.stringify(`Avatar_${e.name}`)}, ${JSON.stringify(e.shapes)})],`) + .join("\n")} +]; +`; + +const rsOutput = `//! GENERATED by \`window/ui/scripts/build-solar-icons.mjs\` — do not edit. +//! +//! Run \`cd window/ui && npm run build:solar-icons\` after changing \`window/ui/src/solarSlugs.ts\`. +//! +//! Solar Icons (linear style, stroke-width ${STROKE_WIDTH}) via \`@iconify-json/solar\` +//! (CC-BY-4.0, 480 Design). + +/// Stroke width for all Solar Linear icons across Bate. +pub const SOLAR_STROKE: f32 = ${STROKE_WIDTH}; + +/// UI glyph SVG bodies by kebab-case name. +pub const SOLAR_GLYPHS: &[(&str, &str)] = &[ +${uiEntries + .map((e) => ` (${JSON.stringify(e.rustName)}, ${JSON.stringify(toSvgBody(e.shapes))}),`) + .join("\n")} +]; + +/// Bot avatar SVG bodies in picker order. +pub const SOLAR_AVATARS: &[(&str, &str)] = &[ +${avatarEntries + .map((e) => ` (${JSON.stringify(e.name)}, ${JSON.stringify(toSvgBody(e.shapes))}),`) + .join("\n")} +]; +`; + +const tsTarget = path.join(uiDir, "src", "solarIcons.generated.ts"); +const rsTarget = path.join(repoDir, "native", "src", "solar_icons_data.rs"); + +writeFileSync(tsTarget, tsOutput, "utf8"); +writeFileSync(rsTarget, rsOutput, "utf8"); +console.log( + `build-solar-icons: ${uiEntries.length} UI glyphs + ${avatarEntries.length} avatars -> ` + + `${path.relative(repoDir, tsTarget)} (${(tsOutput.length / 1024).toFixed(1)} KB), ` + + `${path.relative(repoDir, rsTarget)} (${(rsOutput.length / 1024).toFixed(1)} KB)`, +); diff --git a/window/ui/src/Chat.tsx b/window/ui/src/Chat.tsx index 3245160..865523d 100644 --- a/window/ui/src/Chat.tsx +++ b/window/ui/src/Chat.tsx @@ -10,8 +10,7 @@ import { answerCommand } from "./secret.ts"; import { canRead, hush, readable, speak } from "./speech.ts"; import { clock, day, dayTime, greeting, took } from "./times.ts"; import type { Bot, QueuedPrompt } from "./types.ts"; -import { ArrowDown, ArrowUp, CalendarClock, Circle, CircleAlert, CircleCheck, CircleDot, Clock, GitFork, Mic, Paperclip, Pencil, Plus, RotateCcw, Square, Volume2, X } from "lucide-react"; -import { ExplainFileMark, PlanTaskMark, ReviewChangesMark, type StarterIcon, WriteDraftMark } from "./StarterIcons.ts"; +import { ArrowDown, ArrowUp, CalendarClock, Circle, CircleAlert, CircleCheck, CircleDot, Clock, Eye, FileText, GitFork, ListChecks, Mic, Paperclip, PenLine, Pencil, Plus, RotateCcw, type SolarIcon, Square, Volume2, X } from "./icons.ts"; import { upload } from "./upload.ts"; import { useLater } from "./useLater.ts"; @@ -23,11 +22,11 @@ const PAGE = 2000; /** How long (ms) a row that just came in counts as arriving: a little longer than its fade (`--slow`). */ const ARRIVING = 400; /** What an empty conversation offers under the box: a click puts the words in the box and sends nothing. */ -const STARTERS: [label: string, words: string, Icon: StarterIcon][] = [ - ["Plan a task", "Help me plan this task: ", PlanTaskMark], - ["Explain a file", "Explain what this file does: ", ExplainFileMark], - ["Review my changes", "Review the changes in this folder and list what could break.", ReviewChangesMark], - ["Write a first draft", "Write a first draft of ", WriteDraftMark], +const STARTERS: [label: string, words: string, Icon: SolarIcon][] = [ + ["Plan a task", "Help me plan this task: ", ListChecks], + ["Explain a file", "Explain what this file does: ", FileText], + ["Review my changes", "Review the changes in this folder and list what could break.", Eye], + ["Write a first draft", "Write a first draft of ", PenLine], ]; type Hit = { seq: number }; diff --git a/window/ui/src/Conversations.tsx b/window/ui/src/Conversations.tsx index 2606ae8..d3e5fba 100644 --- a/window/ui/src/Conversations.tsx +++ b/window/ui/src/Conversations.tsx @@ -4,7 +4,7 @@ import { listen, request } from "./service.ts"; import { ago } from "./attention.ts"; import { label, listed, recent, when } from "./conversations.ts"; import type { Conversation } from "./types.ts"; -import { ChevronDown, Ellipsis, Pin } from "lucide-react"; +import { ChevronDown, Ellipsis, Pin } from "./icons.ts"; /** * A bot's conversations: the one shown, a list to switch, rename, pin and archive them, a new one, diff --git a/window/ui/src/Markdown.ts b/window/ui/src/Markdown.ts index 3cdbd06..4944c91 100644 --- a/window/ui/src/Markdown.ts +++ b/window/ui/src/Markdown.ts @@ -1,7 +1,7 @@ // A reply's Markdown, with raw HTML left out: what a model writes is shown, never run. // Plain `createElement` rather than JSX, so the test can load this file in Node as it is. import { createElement as h, Fragment, isValidElement, useRef, useState, type ReactNode } from "react"; -import { Copy } from "lucide-react"; +import { Copy } from "./icons.ts"; import ReactMarkdown, { type Components } from "react-markdown"; import remarkGfm from "remark-gfm"; import rehypeHighlight from "rehype-highlight"; diff --git a/window/ui/src/Model.tsx b/window/ui/src/Model.tsx index 3cdfc68..d939898 100644 --- a/window/ui/src/Model.tsx +++ b/window/ui/src/Model.tsx @@ -2,7 +2,7 @@ import { useEffect, useRef, useState } from "react"; import { inShell, listen, request } from "./service.ts"; import { modelChoices } from "./models.ts"; import type { Bot } from "./types.ts"; -import { Check, ChevronDown } from "lucide-react"; +import { Check, ChevronDown } from "./icons.ts"; const EFFORTS = ["minimal", "low", "medium", "high"]; diff --git a/window/ui/src/Pane.tsx b/window/ui/src/Pane.tsx index 0eaa592..cb445ca 100644 --- a/window/ui/src/Pane.tsx +++ b/window/ui/src/Pane.tsx @@ -1,7 +1,7 @@ import { type ReactNode, useEffect, useRef, useState } from "react"; import { SANDBOX, fileUrl } from "./frame.ts"; import { cutMiddle, placePane } from "./pane.ts"; -import { X } from "lucide-react"; +import { X } from "./icons.ts"; /** A bot's file, in the pane. */ export function FilePane({ bot, path, close }: { bot: string; path: string; close: () => void }) { diff --git a/window/ui/src/QuickAsk.tsx b/window/ui/src/QuickAsk.tsx index 9227ed3..411f7a7 100644 --- a/window/ui/src/QuickAsk.tsx +++ b/window/ui/src/QuickAsk.tsx @@ -7,7 +7,7 @@ import { answerCommand } from "./secret.ts"; import { answerOf, loadUsed, message, type QuickContext, saveUsed, used, usedFirst } from "./quick.ts"; import { hideQuick, listen, openInBate, request } from "./service.ts"; import type { Bot } from "./types.ts"; -import { X } from "lucide-react"; +import { X } from "./icons.ts"; /** The conversation the question started: the frames of no other one are the panel's. */ type Asked = { bot: string; conversation: string }; diff --git a/window/ui/src/Room.tsx b/window/ui/src/Room.tsx index 2d87da4..9d9c443 100644 --- a/window/ui/src/Room.tsx +++ b/window/ui/src/Room.tsx @@ -4,7 +4,7 @@ import { Avatar } from "./Avatar.tsx"; import { Markdown } from "./Markdown.ts"; import { leadOf, mentionAt, withoutMention } from "./room.ts"; import type { Bot, Project } from "./types.ts"; -import { ArrowUp, X } from "lucide-react"; +import { ArrowUp, X } from "./icons.ts"; type Line = { seq: number; from: string; to: string; text: string; atMs: number }; diff --git a/window/ui/src/RowMenu.tsx b/window/ui/src/RowMenu.tsx index 4899560..e187418 100644 --- a/window/ui/src/RowMenu.tsx +++ b/window/ui/src/RowMenu.tsx @@ -1,5 +1,5 @@ import { type ReactNode, useEffect, useRef, useState } from "react"; -import { ChevronDown, Ellipsis } from "lucide-react"; +import { ChevronDown, Ellipsis } from "./icons.ts"; /** `current`: the item stands for what is shown now (a menu of pages); it is then a radio item, checked or not. */ export type MenuItem = { label: string; run: () => void; danger?: boolean; current?: boolean }; diff --git a/window/ui/src/ShelfIcons.ts b/window/ui/src/ShelfIcons.ts deleted file mode 100644 index 837b5f3..0000000 --- a/window/ui/src/ShelfIcons.ts +++ /dev/null @@ -1,96 +0,0 @@ -import { createLucideIcon } from "lucide-react"; - -/** - * The sidebar's own marks, drawn as one family on the 24px grid with rounded - * joins and matched optical weight (mirroring `d41sys/ours`'s `ShelfIcons.ts` - * and `ComposerIcons.ts`). - * - * Each shelf icon has a body (`bate-shelf-fill`) that picks up a 16% wash of - * `currentColor` when its row is active, so selection shows in the glyph itself - * as well as the row behind it. Action marks use `bate-duo` for a permanent - * two-tone wash so they read as a shape at 16px. - */ -const fill = "bate-shelf-fill"; -const duo = "bate-duo"; - -/** Activity: an inbox tray whose lower well fills when selected. */ -export const ActivityShelfIcon = createLucideIcon("activity-shelf", [ - [ - "path", - { - d: "M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z", - className: fill, - key: "tray", - }, - ], - ["path", { d: "M22 12h-6l-2 3h-4l-2-3H2", key: "slot" }], -]); - -/** Project: a folder with a front lip (same mark as `ours` ResourcesShelfIcon). */ -export const ProjectShelfIcon = createLucideIcon("project-shelf", [ - [ - "path", - { - d: "M3.75 7.25a2 2 0 0 1 2-2h3.2a2 2 0 0 1 1.52.7l1.06 1.25a2 2 0 0 0 1.52.7h5.2a2 2 0 0 1 2 2v7.85a2 2 0 0 1-2 2H5.75a2 2 0 0 1-2-2z", - className: fill, - key: "folder", - }, - ], - ["path", { d: "M3.75 10.4h16.5", key: "lip" }], -]); - -/** Add-ons: modular blocks whose upper block and base tint when selected. */ -export const AddonsShelfIcon = createLucideIcon("addons-shelf", [ - [ - "path", - { - d: "M10 22V7a1 1 0 0 0-1-1H4a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-5a1 1 0 0 0-1-1H2", - className: fill, - key: "base", - }, - ], - [ - "rect", - { - x: "14", - y: "2", - width: "8", - height: "8", - rx: "1.5", - className: fill, - key: "piece", - }, - ], -]); - -/** Settings: a gear whose outer ring fills when selected. */ -export const SettingsShelfIcon = createLucideIcon("settings-shelf", [ - [ - "path", - { - d: "M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915", - className: fill, - key: "ring", - }, - ], - ["circle", { cx: "12", cy: "12", r: "3", key: "hub" }], -]); - -/** New conversation: a washed compose sheet and pen stroke (two-tone `bate-duo`). */ -export const NewTalkIcon = createLucideIcon("new-talk", [ - [ - "path", - { - d: "M12 4H6a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-6", - className: duo, - key: "sheet", - }, - ], - [ - "path", - { - d: "M18.375 2.625a1 1 0 0 1 3 3l-9.013 9.014a2 2 0 0 1-.853.505l-2.873.84a.5.5 0 0 1-.62-.62l.84-2.873a2 2 0 0 1 .506-.852z", - key: "pen", - }, - ], -]); diff --git a/window/ui/src/StarterIcons.ts b/window/ui/src/StarterIcons.ts deleted file mode 100644 index e87f313..0000000 --- a/window/ui/src/StarterIcons.ts +++ /dev/null @@ -1,70 +0,0 @@ -import { createElement, type ComponentType, type SVGProps } from "react"; - -/** - * The empty-conversation starter marks, drawn at 1:1 on a 16px grid (mirroring - * `d41sys/ours`'s `StarterIcons.ts`). - * - * Scaling a 24px icon down to 16px puts straight strokes between pixels so the - * row turns soft. Drawing on a 16x16 grid with half-pixel coordinates and a - * 1.2px stroke keeps every mark crisp at 16px across any pixel ratio. - */ -export type StarterIcon = ComponentType>; - -type Shape = readonly [tag: "path" | "circle" | "rect", attrs: Record]; - -function mark(name: string, shapes: readonly Shape[]): StarterIcon { - const Mark = (props: SVGProps) => - createElement( - "svg", - { - width: 16, - height: 16, - viewBox: "0 0 16 16", - fill: "none", - stroke: "currentColor", - strokeWidth: 1.2, - strokeLinecap: "round", - strokeLinejoin: "round", - className: "starter-mark", - "aria-hidden": true, - ...props, - }, - shapes.map(([tag, attrs], index) => createElement(tag, { key: index, ...attrs })), - ); - Mark.displayName = name; - return Mark; -} - -/** Plan a task: a checklist with one step ticked and one open (matches `ours` PracticeMark). */ -export const PlanTaskMark = mark("PlanTaskMark", [ - ["path", { d: "M2.25 4.25l1.5 1.5 2.75-3" }], - ["rect", { x: "2.5", y: "9.5", width: "4", height: "4", rx: "1.25", className: "bate-duo" }], - ["path", { d: "M9.5 4.5h4.5M9.5 11.5h4.5" }], -]); - -/** Explain a file: a crisp page with a folded corner and lines of text. */ -export const ExplainFileMark = mark("ExplainFileMark", [ - ["path", { d: "M4.5 1.5h5l3 3v9a1 1 0 0 1-1 1h-7a1 1 0 0 1-1-1v-11a1 1 0 0 1 1-1z", className: "bate-duo" }], - ["path", { d: "M9.5 1.5v3h3" }], - ["path", { d: "M5.5 7.5h5M5.5 10.5h3.5" }], -]); - -/** Review my changes: a page inspected under a lens (matches `ours` ResearchMark). */ -export const ReviewChangesMark = mark("ReviewChangesMark", [ - ["path", { d: "M6.5 14.5h-3a1 1 0 0 1-1-1v-11a1 1 0 0 1 1-1h7a1 1 0 0 1 1 1v4.5" }], - ["path", { d: "M5 4.5h4M5 7.5h2.5" }], - ["circle", { cx: "11", cy: "11", r: "2.5", className: "bate-duo" }], - ["path", { d: "M12.85 12.85 14.5 14.5" }], -]); - -/** Write a first draft: a nib writing onto a baseline. */ -export const WriteDraftMark = mark("WriteDraftMark", [ - ["path", { d: "M8.5 13.5h5" }], - [ - "path", - { - d: "M11.6 2.4a1.35 1.35 0 0 1 1.9 1.9l-7.2 7.2-2.8.8.8-2.8z", - className: "bate-duo", - }, - ], -]); diff --git a/window/ui/src/Surfaces.tsx b/window/ui/src/Surfaces.tsx index 8102f02..7319570 100644 --- a/window/ui/src/Surfaces.tsx +++ b/window/ui/src/Surfaces.tsx @@ -2,7 +2,7 @@ import { type CSSProperties, useEffect, useRef, useState } from "react"; import { listen, request } from "./service.ts"; import { PART, clampOffset, nextOffset, prevOffset, range, visibleNodes } from "./surface.ts"; import type { Surface, SurfacePart } from "./types.ts"; -import { ChevronDown, ChevronRight } from "lucide-react"; +import { ChevronDown, ChevronRight } from "./icons.ts"; const KINDS = { table: "Table", tree: "Tree", code: "Code" } as const; /** A cell of more characters than this wraps; a shorter one stays on its line. About what `--control-w` holds. */ diff --git a/window/ui/src/icons.ts b/window/ui/src/icons.ts index 2112327..ae5f2bb 100644 --- a/window/ui/src/icons.ts +++ b/window/ui/src/icons.ts @@ -1,11 +1,6 @@ -import { - BookOpen, Bot, Brain, Bug, Calendar, Camera, ChartLine, CodeXml, Compass, Database, FlaskConical, Folder, - Globe, KeyRound, Leaf, Mail, Music, PenLine, Rocket, Search, Shield, Sprout, SquareTerminal, Wrench, Zap, -} from "lucide-react"; +import { SOLAR_AVATARS } from "./solarIcons.generated.ts"; -/** The icons a bot can have, by the name kept as its avatar (the service allows 8 characters). A Map: an avatar is data from a bot file, and must not find `constructor`. */ -export const BOT_ICONS = new Map(Object.entries({ - bot: Bot, search: Search, pen: PenLine, code: CodeXml, terminal: SquareTerminal, folder: Folder, compass: Compass, brain: Brain, - book: BookOpen, bug: Bug, chart: ChartLine, data: Database, globe: Globe, shield: Shield, wrench: Wrench, rocket: Rocket, - flask: FlaskConical, mail: Mail, calendar: Calendar, camera: Camera, music: Music, sprout: Sprout, leaf: Leaf, zap: Zap, key: KeyRound, -})); +export * from "./solarIcons.generated.ts"; + +/** The Solar Linear icons (stroke 1.8) a bot can have, by the name kept as its avatar (the service allows 8 characters). A Map: an avatar is data from a bot file, and must not find `constructor`. */ +export const BOT_ICONS = new Map(SOLAR_AVATARS); diff --git a/window/ui/src/main.tsx b/window/ui/src/main.tsx index 6d2bde2..3dc1298 100644 --- a/window/ui/src/main.tsx +++ b/window/ui/src/main.tsx @@ -34,8 +34,7 @@ import { LATER } from "./firstRun.ts"; import { Palette, type Choice } from "./Palette.tsx"; import { RowMenu } from "./RowMenu.tsx"; import "./highlight.css"; -import { type LucideIcon, Plus } from "lucide-react"; -import { ActivityShelfIcon, AddonsShelfIcon, NewTalkIcon, ProjectShelfIcon, SettingsShelfIcon } from "./ShelfIcons.ts"; +import { Blocks, Folder, Inbox, Plus, Settings as Gear, type SolarIcon, SquarePen } from "./icons.ts"; import "./style.css"; // Only in the build `window/check-frames.sh` makes. @@ -339,7 +338,7 @@ function App() { ); }; /** A row with an icon and no avatar: a project, or a page of the app. */ - const plain = (text: string, Icon: LucideIcon, current: boolean, go: () => void, badge?: ReactNode) => ( + const plain = (text: string, Icon: SolarIcon, current: boolean, go: () => void, badge?: ReactNode) => ( } -
  • {plain("Add-ons", AddonsShelfIcon, view?.page === "addons", () => setView({ page: "addons", tab: view?.page === "addons" ? view.tab : "connectors" }))}
  • -
  • {plain("Settings", SettingsShelfIcon, view?.page === "settings", () => setView({ page: "settings" }))}
  • + {bot && view?.page === "bot" &&
  • } +
  • {plain("Add-ons", Blocks, view?.page === "addons", () => setView({ page: "addons", tab: view?.page === "addons" ? view.tab : "connectors" }))}
  • +
  • {plain("Settings", Gear, view?.page === "settings", () => setView({ page: "settings" }))}
  • diff --git a/window/ui/src/solarIcons.generated.ts b/window/ui/src/solarIcons.generated.ts new file mode 100644 index 0000000..4ff0ac2 --- /dev/null +++ b/window/ui/src/solarIcons.generated.ts @@ -0,0 +1,102 @@ +/** + * GENERATED by scripts/build-solar-icons.mjs — do not edit. + * + * Run `npm run build:solar-icons` after changing src/solarSlugs.ts. + * + * Solar Icons (linear style, stroke-width 1.8) via `@iconify-json/solar` + * (CC-BY-4.0, 480 Design). Bundled inline with zero runtime icon dependency. + */ + +import { createElement, type ComponentType, type SVGProps } from "react"; + +export type SolarIcon = ComponentType>; + +type Shape = readonly [tag: string, attrs: Readonly>]; + +function solar(name: string, shapes: readonly Shape[]): SolarIcon { + const Icon: SolarIcon = ({ className, ...props }) => + createElement( + "svg", + { + width: 24, + height: 24, + viewBox: "0 0 24 24", + fill: "none", + stroke: "currentColor", + strokeWidth: 1.8, + strokeLinecap: "round", + strokeLinejoin: "round", + "aria-hidden": true, + ...props, + className: className ? `solar ${className}` : "solar", + }, + shapes.map(([tag, attrs], index) => createElement(tag, { key: index, ...attrs })), + ); + Icon.displayName = name; + return Icon; +} + +export const ArrowUp = solar("ArrowUp", [["path",{"d":"M12 20L12 4M6 10L12 4L18 10"}]]); +export const ArrowDown = solar("ArrowDown", [["path",{"d":"M12 4L12 20M6 14L12 20L18 14"}]]); +export const Square = solar("Square", [["path",{"d":"M12 22C7.28595 22 4.92893 22 3.46447 20.5355C2 19.0711 2 16.714 2 12C2 7.28595 2 4.92893 3.46447 3.46447C4.92893 2 7.28595 2 12 2C16.714 2 19.0711 2 20.5355 3.46447C22 4.92893 22 7.28595 22 12C22 16.714 22 19.0711 20.5355 20.5355C19.0711 22 16.714 22 12 22Z"}]]); +export const Folder = solar("Folder", [["path",{"d":"M18 10L13 10"}],["path",{"d":"M11 4L10.4497 3.44975C10.1763 3.17633 10.0396 3.03961 9.89594 2.92051C9.27652 2.40704 8.51665 2.09229 7.71557 2.01738C7.52976 2 7.33642 2 6.94975 2C6.06722 2 5.62595 2 5.25839 2.06935C3.64031 2.37464 2.37464 3.64031 2.06935 5.25839C2 5.62595 2 6.06722 2 6.94975V14C2 17.7712 2 19.6569 3.17157 20.8284C4.34315 22 6.22876 22 10 22H14C17.7712 22 19.6569 22 20.8284 20.8284C22 19.6569 22 17.7712 22 14V11.7979C22 9.16554 22 7.84935 21.2305 6.99383C21.1598 6.91514 21.0849 6.84024 21.0062 6.76946C20.1506 6 18.8345 6 16.2021 6H15.8284C14.6747 6 14.0979 6 13.5604 5.84678C13.2651 5.7626 12.9804 5.64471 12.7121 5.49543C12.2237 5.22367 11.8158 4.81578 11 4Z"}]]); +export const SquarePen = solar("SquarePen", [["path",{"d":"M22 10.5V12C22 16.714 22 19.0711 20.5355 20.5355C19.0711 22 16.714 22 12 22C7.28595 22 4.92893 22 3.46447 20.5355C2 19.0711 2 16.714 2 12C2 7.28595 2 4.92893 3.46447 3.46447C4.92893 2 7.28595 2 12 2H13.5"}],["path",{"d":"M16.652 3.45506L17.3009 2.80624C18.3759 1.73125 20.1188 1.73125 21.1938 2.80624C22.2687 3.88124 22.2687 5.62415 21.1938 6.69914L20.5449 7.34795M16.652 3.45506C16.652 3.45506 16.7331 4.83379 17.9497 6.05032C19.1662 7.26685 20.5449 7.34795 20.5449 7.34795M16.652 3.45506L10.6872 9.41993C10.2832 9.82394 10.0812 10.0259 9.90743 10.2487C9.70249 10.5114 9.52679 10.7957 9.38344 11.0965C9.26191 11.3515 9.17157 11.6225 8.99089 12.1646L8.41242 13.9M8.41242 13.9L8.03811 15.0229C7.9492 15.2897 8.01862 15.5837 8.21744 15.7826C8.41626 15.9814 8.71035 16.0508 8.97709 15.9619L10.1 15.5876L11.8354 15.0091C12.3775 14.8284 12.6485 14.7381 12.9035 14.6166C13.2043 14.4732 13.4886 14.2975 13.7513 14.0926C13.9741 13.9188 14.1761 13.7168 14.5801 13.3128L20.5449 7.34795M10.1 15.5876L8.41242 13.9"}]]); +export const ChevronRight = solar("ChevronRight", [["path",{"d":"M9 5L15 12L9 19"}]]); +export const ChevronDown = solar("ChevronDown", [["path",{"d":"M19 9L12 15L5 9"}]]); +export const ChevronUp = solar("ChevronUp", [["path",{"d":"M19 15L12 9L5 15"}]]); +export const Circle = solar("Circle", [["circle",{"cx":"12","cy":"12","r":"10"}]]); +export const CircleDot = solar("CircleDot", [["circle",{"cx":"12","cy":"12","r":"10"}],["path",{"d":"M12 12H12.0001"}]]); +export const CircleCheck = solar("CircleCheck", [["circle",{"cx":"12","cy":"12","r":"10"}],["path",{"d":"M8.5 12.5L10.5 14.5L15.5 9.5"}]]); +export const CircleAlert = solar("CircleAlert", [["circle",{"cx":"12","cy":"12","r":"10"}],["path",{"d":"M12 7V13"}],["path",{"d":"M12 16H12.0001"}]]); +export const Copy = solar("Copy", [["path",{"d":"M12 22H15C17.8284 22 19.2426 22 20.1213 21.1213C21 20.2426 21 18.8284 21 16V11C21 8.17157 21 6.75736 20.1213 5.87868C19.2426 5 17.8284 5 15 5H12C9.17157 5 7.75736 5 6.87868 5.87868C6 6.75736 6 8.17157 6 11V16C6 18.8284 6 20.2426 6.87868 21.1213C7.75736 22 9.17157 22 12 22Z"}],["path",{"d":"M6 19C4.34315 19 3 17.6569 3 16V10C3 6.22876 3 4.34315 4.17157 3.17157C5.34315 2 7.22876 2 11 2H15C16.6569 2 18 3.34315 18 5"}]]); +export const Inbox = solar("Inbox", [["path",{"d":"M12 22C7.28595 22 4.92893 22 3.46447 20.5355C2 19.0711 2 16.714 2 12C2 7.28595 2 4.92893 3.46447 3.46447C4.92893 2 7.28595 2 12 2C16.714 2 19.0711 2 20.5355 3.46447C22 4.92893 22 7.28595 22 12C22 16.714 22 19.0711 20.5355 20.5355C19.0711 22 16.714 22 12 22Z"}],["path",{"d":"M2 13H5.16026C6.06543 13 6.51802 13 6.91584 13.183C7.31367 13.3659 7.60821 13.7096 8.19729 14.3968L8.80271 15.1032C9.39179 15.7904 9.68633 16.1341 10.0842 16.317C10.482 16.5 10.9346 16.5 11.8397 16.5H12.1603C13.0654 16.5 13.518 16.5 13.9158 16.317C14.3137 16.1341 14.6082 15.7904 15.1973 15.1032L15.8027 14.3968C16.3918 13.7096 16.6863 13.3659 17.0842 13.183C17.482 13 17.9346 13 18.8397 13H22"}]]); +export const Clock = solar("Clock", [["circle",{"cx":"12","cy":"12","r":"10"}],["path",{"d":"M12 8V12L14.5 14.5"}]]); +export const X = solar("X", [["path",{"d":"M19.0068 5L5.00684 19"}],["path",{"d":"M19 19L5 5"}]]); +export const RotateCcw = solar("RotateCcw", [["path",{"d":"M18.364 8.05026L17.6569 7.34315C14.5327 4.21896 9.46734 4.21896 6.34315 7.34315C3.21895 10.4673 3.21895 15.5327 6.34315 18.6569C9.46734 21.7811 14.5327 21.7811 17.6569 18.6569C19.4737 16.84 20.234 14.3668 19.9377 12.0005M18.364 3.80762V8.05026H14.1213"}]]); +export const Pencil = solar("Pencil", [["path",{"d":"M14.3601 4.07866L15.2869 3.15178C16.8226 1.61607 19.3125 1.61607 20.8482 3.15178C22.3839 4.68748 22.3839 7.17735 20.8482 8.71306L19.9213 9.63993M14.3601 4.07866C14.3601 4.07866 14.4759 6.04828 16.2138 7.78618C17.9517 9.52407 19.9213 9.63993 19.9213 9.63993M19.9213 9.63993L11.4001 18.1612C10.8229 18.7383 10.5344 19.0269 10.2162 19.2751C9.84082 19.5679 9.43469 19.8189 9.00498 20.0237C8.6407 20.1973 8.25352 20.3263 7.47918 20.5844L4.19792 21.6782L3.39584 21.9456C3.01478 22.0726 2.59466 21.9734 2.31063 21.6894C2.0266 21.4053 1.92743 20.9852 2.05445 20.6042L2.32181 19.8021L3.41556 16.5208C3.67368 15.7465 3.80273 15.3593 3.97634 14.995C4.18114 14.5653 4.43213 14.1592 4.7249 13.7838C4.97308 13.4656 5.26166 13.1771 5.83882 12.5999L14.3601 4.07866M4.19792 21.6782L2.32181 19.8021"}]]); +export const GitFork = solar("GitFork", [["path",{"d":"M8 5C8 6.65685 6.65685 8 5 8C3.34315 8 2 6.65685 2 5C2 3.34315 3.34315 2 5 2C6.65685 2 8 3.34315 8 5Z"}],["path",{"d":"M22 5C22 6.65686 20.6569 8 19 8C17.3431 8 16 6.65686 16 5C16 3.34315 17.3431 2 19 2C20.6569 2 22 3.34315 22 5Z"}],["path",{"d":"M15 19.0039C15 20.6608 13.6569 22.0039 12 22.0039C10.3431 22.0039 9 20.6608 9 19.0039C9 17.3471 10.3431 16.0039 12 16.0039C13.6569 16.0039 15 17.3471 15 19.0039Z"}],["path",{"d":"M12 15.999L12 12"}],["path",{"d":"M5 8C5 9.88562 5 10.8284 6.02513 11.4142C7.05025 12 8.70017 12 12 12C15.2998 12 16.9497 12 17.9749 11.4142C19 10.8284 19 9.88562 19 8"}]]); +export const Volume2 = solar("Volume2", [["path",{"d":"M1.5 11.9998C1.5 12.3222 1.51299 12.6706 1.53479 13.0282C1.60847 14.237 1.64531 14.8414 1.95854 15.4228C2.24473 15.9539 2.7923 16.4692 3.33988 16.7225C3.93921 16.9998 4.62617 16.9998 6.00008 16.9998C6.51215 16.9998 6.76819 16.9998 7.0162 17.0417C7.26138 17.0831 7.50046 17.1548 7.72795 17.2552C7.95806 17.3567 8.17181 17.4977 8.59932 17.7796L8.81825 17.9239C11.3612 19.6006 12.6327 20.4389 13.7001 20.0747C13.9047 20.0049 14.1028 19.9041 14.2797 19.7797C15.2024 19.1313 15.2725 17.6226 15.4127 14.6052C15.4646 13.4879 15.5 12.5317 15.5 11.9998C15.5 11.4679 15.4646 10.5117 15.4127 9.3944C15.2725 6.37699 15.2024 4.86829 14.2797 4.21984C14.1028 4.09551 13.9047 3.9947 13.7001 3.92487C12.6327 3.56063 11.3612 4.39898 8.81825 6.07566L8.59932 6.22002C8.17181 6.50189 7.95806 6.64283 7.72795 6.74438C7.50046 6.84478 7.26138 6.9165 7.0162 6.95791C6.76819 6.99979 6.51215 6.99979 6.00008 6.99979C4.62617 6.99979 3.93921 6.99979 3.33988 7.27707C2.7923 7.53042 2.24473 8.04563 1.95854 8.57679C1.64531 9.15814 1.60847 9.76255 1.53479 10.9714C1.51299 11.329 1.5 11.6774 1.5 11.9998Z"}],["path",{"d":"M20 6C20 6 21.5 7.8 21.5 12C21.5 16.2 20 18 20 18"}],["path",{"d":"M18 9C18 9 18.5 9.9 18.5 12C18.5 14.1 18 15 18 15"}]]); +export const Plus = solar("Plus", [["path",{"d":"M4 12L20 12"}],["path",{"d":"M12.0204 4L12.0205 20.0003"}]]); +export const Check = solar("Check", [["path",{"d":"M7 12.9L10.1429 16.5L18 7.5"}]]); +export const Pin = solar("Pin", [["path",{"d":"M2 22L6.65323 17.342M19.0716 8.03562L15.9894 4.9502C13.8823 2.84101 12.8288 1.78641 11.6973 2.03606C10.5657 2.28571 10.0527 3.68593 9.02665 6.48636L8.3322 8.38177C8.05866 9.12835 7.92189 9.50164 7.67582 9.79038C7.56541 9.91994 7.43978 10.0357 7.30167 10.1351C6.99386 10.3567 6.61092 10.4623 5.84504 10.6735C4.11881 11.1494 3.2557 11.3873 2.93045 11.9521C2.78985 12.1962 2.71668 12.4734 2.71846 12.7552C2.72258 13.4071 3.35561 14.0408 4.62169 15.3081L8.73837 19.429C10.0125 20.7044 10.6496 21.3421 11.3052 21.3431C11.5816 21.3435 11.8532 21.2717 12.0933 21.1347C12.6629 20.8096 12.9021 19.9401 13.3806 18.2012C13.5909 17.4366 13.6961 17.0543 13.9169 16.7466C14.0136 16.6119 14.1257 16.489 14.251 16.3805C14.5372 16.1326 14.9081 15.9933 15.6498 15.7146L17.5669 14.9943C20.3364 13.9537 21.7211 13.4335 21.9652 12.3049C22.2092 11.1764 21.1633 10.1295 19.0716 8.03562Z"}]]); +export const Ellipsis = solar("Ellipsis", [["circle",{"cx":"5","cy":"12","r":"2"}],["circle",{"cx":"12","cy":"12","r":"2"}],["circle",{"cx":"19","cy":"12","r":"2"}]]); +export const Eye = solar("Eye", [["path",{"d":"M12 4C7.81811 4 4.97196 6.49956 3.27489 8.70433C2.42496 9.80853 2 10.3606 2 12C2 13.6394 2.42496 14.1915 3.27489 15.2957C4.97196 17.5004 7.81811 20 12 20C16.1819 20 19.028 17.5004 20.7251 15.2957C21.575 14.1915 22 13.6394 22 12C22 10.3606 21.575 9.80853 20.7251 8.70433C19.028 6.49956 16.1819 4 12 4Z"}],["path",{"d":"M15 12C15 13.6569 13.6569 15 12 15C10.3431 15 9 13.6569 9 12C9 10.3431 10.3431 9 12 9C13.6569 9 15 10.3431 15 12Z"}]]); +export const EyeOff = solar("EyeOff", [["path",{"d":"M2 7C2 7 2.94141 9.19661 5 11.1288C6.61629 12.6459 8.92126 14 12 14M22 7C22 7 21.0586 9.19661 19 11.1288C18.0872 11.9856 16.9547 12.7904 15.5872 13.3287C14.5334 13.7435 13.34 14 12 14M12 14V16.5M5 11.1288L3.5 12.6288M15.5872 13.3287L17 15.5M19 11.1288L20.5 12.6288M8.41281 13.3287L7 15.5"}]]); +export const Paperclip = solar("Paperclip", [["path",{"d":"M7.9175 17.8068L15.8084 10.2535C16.7558 9.34668 16.7558 7.87637 15.8084 6.96951C14.861 6.06265 13.325 6.06265 12.3776 6.96951L4.54387 14.4681C2.74382 16.1911 2.74382 18.9847 4.54387 20.7077C6.34391 22.4308 9.26237 22.4308 11.0624 20.7077L19.0105 13.0997C21.6632 10.5605 21.6632 6.44362 19.0105 3.90441C16.3578 1.3652 12.0569 1.3652 9.40419 3.90441L3 10.0346"}]]); +export const Settings = solar("Settings", [["circle",{"cx":"12","cy":"12","r":"3"}],["path",{"d":"M12.0005 2C12.9324 2 13.3983 2 13.7658 2.15224C14.2559 2.35523 14.6452 2.74458 14.8482 3.23463C14.9409 3.45833 14.9772 3.71848 14.9914 4.09794C15.0122 4.65566 15.2982 5.17191 15.7816 5.45096C16.2649 5.73002 16.855 5.71959 17.3484 5.4588C17.6841 5.28136 17.9276 5.18269 18.1676 5.15109C18.6935 5.08185 19.2254 5.22436 19.6462 5.54727C19.9618 5.78945 20.1948 6.19297 20.6607 7C21.1267 7.80703 21.3596 8.21055 21.4116 8.60497C21.4808 9.13087 21.3383 9.66273 21.0154 10.0835C20.868 10.2757 20.6608 10.4371 20.3392 10.6392C19.8667 10.9361 19.5626 11.4418 19.5626 11.9999C19.5626 12.558 19.8666 13.0639 20.3392 13.3608C20.6607 13.5628 20.8679 13.7243 21.0153 13.9164C21.3382 14.3372 21.4807 14.8691 21.4115 15.395C21.3595 15.7894 21.1266 16.1929 20.6606 16.9999C20.1947 17.807 19.9617 18.2105 19.6461 18.4527C19.2253 18.7756 18.6934 18.9181 18.1675 18.8488C17.9275 18.8172 17.6841 18.7186 17.3484 18.5412C16.8549 18.2804 16.2648 18.2699 15.7815 18.549C15.2982 18.8281 15.0122 19.3443 14.9914 19.902C14.9772 20.2815 14.9409 20.5417 14.8482 20.7654C14.6452 21.2554 14.2559 21.6448 13.7658 21.8478C13.3983 22 12.9324 22 12.0005 22C11.0686 22 10.6027 22 10.2351 21.8478C9.74505 21.6448 9.35571 21.2554 9.15272 20.7654C9.06006 20.5417 9.0238 20.2815 9.0096 19.9021C8.98874 19.3443 8.70273 18.8281 8.21939 18.549C7.73605 18.27 7.14596 18.2804 6.65253 18.5412C6.31681 18.7186 6.07338 18.8173 5.83333 18.8489C5.30743 18.9181 4.77557 18.7756 4.35475 18.4527C4.03913 18.2106 3.80616 17.807 3.34022 17C2.87428 16.193 2.64131 15.7894 2.58938 15.395C2.52015 14.8691 2.66266 14.3373 2.98557 13.9165C3.13297 13.7244 3.34013 13.5629 3.66167 13.3608C4.13424 13.0639 4.43832 12.5581 4.43835 12C4.43838 11.4419 4.13429 10.936 3.66167 10.639C3.34019 10.437 3.13305 10.2756 2.98566 10.0835C2.66276 9.66266 2.52025 9.1308 2.58948 8.60491C2.64141 8.21048 2.87438 7.80697 3.34032 6.99993C3.80626 6.1929 4.03923 5.78938 4.35485 5.5472C4.77567 5.22429 5.30753 5.08178 5.83342 5.15102C6.07349 5.18262 6.31693 5.2813 6.65268 5.45876C7.14608 5.71954 7.73612 5.72996 8.21943 5.45093C8.70274 5.17189 8.98875 4.65568 9.0096 4.09799C9.02379 3.7185 9.06005 3.45834 9.15272 3.23463C9.35571 2.74458 9.74505 2.35523 10.2351 2.15224C10.6027 2 11.0686 2 12.0005 2Z"}]]); +export const Blocks = solar("Blocks", [["path",{"d":"M6.5 10.5C4.29086 10.5 2.5 8.70914 2.5 6.5C2.5 4.29086 4.29086 2.5 6.5 2.5C8.70914 2.5 10.5 4.29086 10.5 6.5C10.5 8.70914 8.70914 10.5 6.5 10.5Z"}],["path",{"d":"M17.5 21.5C15.2909 21.5 13.5 19.7091 13.5 17.5C13.5 15.2909 15.2909 13.5 17.5 13.5C19.7091 13.5 21.5 15.2909 21.5 17.5C21.5 19.7091 19.7091 21.5 17.5 21.5Z"}],["path",{"d":"M6.5 21.5C8.38562 21.5 9.32843 21.5 9.91421 20.9142C10.5 20.3284 10.5 19.3856 10.5 17.5C10.5 15.6144 10.5 14.6716 9.91421 14.0858C9.32843 13.5 8.38562 13.5 6.5 13.5C4.61438 13.5 3.67157 13.5 3.08579 14.0858C2.5 14.6716 2.5 15.6144 2.5 17.5C2.5 19.3856 2.5 20.3284 3.08579 20.9142C3.67157 21.5 4.61438 21.5 6.5 21.5ZM17.5 10.5C19.3856 10.5 20.3284 10.5 20.9142 9.91421C21.5 9.32843 21.5 8.38562 21.5 6.5C21.5 4.61438 21.5 3.67157 20.9142 3.08579C20.3284 2.5 19.3856 2.5 17.5 2.5C15.6144 2.5 14.6716 2.5 14.0858 3.08579C13.5 3.67157 13.5 4.61438 13.5 6.5C13.5 8.38562 13.5 9.32843 14.0858 9.91421C14.6716 10.5 15.6144 10.5 17.5 10.5Z"}]]); +export const CalendarClock = solar("CalendarClock", [["circle",{"cx":"12","cy":"13","r":"9"}],["path",{"d":"M12 9V13L14.5 15.5"}],["path",{"d":"M3.5 4.5L7.50002 2"}],["path",{"d":"M20.5 4.5L16.5 2"}]]); +export const FileText = solar("FileText", [["path",{"d":"M11 22H13C16.7712 22 18.6569 22 19.8284 20.8284C21 19.6569 21 17.7712 21 14V10C21 6.22876 21 4.34315 19.8284 3.17157C18.6569 2 16.7712 2 13 2H11C7.22876 2 5.34315 2 4.17157 3.17157C3 4.34315 3 6.22876 3 10V14C3 17.7712 3 19.6569 4.17157 20.8284C5.34315 22 7.22876 22 11 22Z"}],["path",{"d":"M8 12H16"}],["path",{"d":"M8 8H16"}],["path",{"d":"M8 16H13"}]]); +export const ListChecks = solar("ListChecks", [["path",{"d":"M12 22C7.28595 22 4.92893 22 3.46447 20.5355C2 19.0711 2 16.714 2 12C2 7.28595 2 4.92893 3.46447 3.46447C4.92893 2 7.28595 2 12 2C16.714 2 19.0711 2 20.5355 3.46447C22 4.92893 22 7.28595 22 12C22 16.714 22 19.0711 20.5355 20.5355C19.0711 22 16.714 22 12 22Z"}],["path",{"d":"M6 15.8L7.14286 17L10 14"}],["path",{"d":"M6 8.8L7.14286 10L10 7"}],["path",{"d":"M13 9L18 9"}],["path",{"d":"M13 16L18 16"}]]); +export const Search = solar("Search", [["circle",{"cx":"11.5","cy":"11.5","r":"9.5"}],["path",{"d":"M18.2168 18.2178L21.9994 22.0004"}]]); +export const PenLine = solar("PenLine", [["path",{"d":"M4 22H20"}],["path",{"d":"M13.8881 3.66293L14.6296 2.92142C15.8581 1.69286 17.85 1.69286 19.0786 2.92142C20.3071 4.14999 20.3071 6.14188 19.0786 7.37044L18.3371 8.11195M13.8881 3.66293C13.8881 3.66293 13.9807 5.23862 15.3711 6.62894C16.7614 8.01926 18.3371 8.11195 18.3371 8.11195M13.8881 3.66293L7.07106 10.4799C6.60933 10.9416 6.37846 11.1725 6.17992 11.4271C5.94571 11.7273 5.74491 12.0522 5.58107 12.396C5.44219 12.6874 5.33894 12.9972 5.13245 13.6167L4.25745 16.2417M4.25745 16.2417L4.04356 16.8833C3.94194 17.1882 4.02128 17.5243 4.2485 17.7515C4.47573 17.9787 4.81182 18.0581 5.11667 17.9564L5.75834 17.7426L8.38334 16.8675C9.00282 16.6611 9.31256 16.5578 9.60398 16.4189C9.94775 16.2551 10.2727 16.0543 10.5729 15.8201C10.8275 15.6215 11.0584 15.3907 11.5201 14.9289L18.3371 8.11195M5.75834 17.7426L4.25745 16.2417"}]]); +export const Mic = solar("Mic", [["path",{"d":"M12 16C9.23858 16 7 13.7614 7 11V8C7 5.23858 9.23858 3 12 3C14.7614 3 17 5.23858 17 8V11C17 13.7614 14.7614 16 12 16Z"}],["path",{"d":"M11 8H13"}],["path",{"d":"M10 11L14 11"}],["path",{"d":"M20 10V11C20 15.4183 16.4183 19 12 19C7.58172 19 4 15.4183 4 11V10"}],["path",{"d":"M12 19V22"}]]); + +/** Bot avatar icons in picker order (keys are saved in bot files, max 8 chars). */ +export const SOLAR_AVATARS: ReadonlyArray = [ + ["bot", solar("Avatar_bot", [["path",{"d":"M19.9458 12.5732C20.5207 12.6331 20.9393 12.7418 21.268 12.9391C22.0003 13.3784 22.0003 14.0855 22.0003 15.4997C22.0003 16.9139 22.0003 17.621 21.268 18.0604C20.9393 18.2576 20.5207 18.3663 19.9458 18.4262"}],["path",{"d":"M4.05448 18.4262C3.47962 18.3663 3.06096 18.2576 2.73223 18.0604C2 17.621 2 16.9139 2 15.4997C2 14.0855 2 13.3784 2.73223 12.9391C3.06096 12.7418 3.47962 12.6331 4.05448 12.5732"}],["path",{"d":"M10.4 22H13.6C16.617 22 18.1255 22 19.0627 21.0481C19.6369 20.4649 19.8594 19.664 19.9455 18.4265C20 17.644 20 16.6869 20 15.5C20 14.3131 20 13.356 19.9455 12.5735C19.8594 11.336 19.6369 10.5351 19.0627 9.9519C18.1255 9 16.617 9 13.6 9H10.4C7.38301 9 5.87452 9 4.93726 9.9519C4.36306 10.5351 4.14064 11.336 4.05448 12.5735C4 13.356 4 14.3131 4 15.5C4 16.6869 4 17.644 4.05448 18.4265C4.14064 19.664 4.36306 20.4649 4.93726 21.0481C5.87452 22 7.38301 22 10.4 22Z"}],["circle",{"cx":"12","cy":"3.5","r":"1.5"}],["path",{"d":"M12 5V9"}],["path",{"d":"M9 18C9.85038 18.6303 10.8846 19 12 19C13.1154 19 14.1496 18.6303 15 18"}],["path",{"d":"M15.5 13.5C15.5 14.0523 15.2761 14.5 15 14.5C14.7239 14.5 14.5 14.0523 14.5 13.5C14.5 12.9477 14.7239 12.5 15 12.5C15.2761 12.5 15.5 12.9477 15.5 13.5Z"}],["ellipse",{"cx":"9","cy":"13.5","rx":".5","ry":"1"}]])], + ["search", solar("Avatar_search", [["circle",{"cx":"11.5","cy":"11.5","r":"9.5"}],["path",{"d":"M18.2168 18.2178L21.9994 22.0004"}]])], + ["pen", solar("Avatar_pen", [["path",{"d":"M4 22H20"}],["path",{"d":"M13.8881 3.66293L14.6296 2.92142C15.8581 1.69286 17.85 1.69286 19.0786 2.92142C20.3071 4.14999 20.3071 6.14188 19.0786 7.37044L18.3371 8.11195M13.8881 3.66293C13.8881 3.66293 13.9807 5.23862 15.3711 6.62894C16.7614 8.01926 18.3371 8.11195 18.3371 8.11195M13.8881 3.66293L7.07106 10.4799C6.60933 10.9416 6.37846 11.1725 6.17992 11.4271C5.94571 11.7273 5.74491 12.0522 5.58107 12.396C5.44219 12.6874 5.33894 12.9972 5.13245 13.6167L4.25745 16.2417M4.25745 16.2417L4.04356 16.8833C3.94194 17.1882 4.02128 17.5243 4.2485 17.7515C4.47573 17.9787 4.81182 18.0581 5.11667 17.9564L5.75834 17.7426L8.38334 16.8675C9.00282 16.6611 9.31256 16.5578 9.60398 16.4189C9.94775 16.2551 10.2727 16.0543 10.5729 15.8201C10.8275 15.6215 11.0584 15.3907 11.5201 14.9289L18.3371 8.11195M5.75834 17.7426L4.25745 16.2417"}]])], + ["code", solar("Avatar_code", [["path",{"d":"M16 11L17.6965 12.5268C19.239 13.9151 20.0103 14.6093 20.0103 15.5C20.0103 16.3907 19.239 17.0849 17.6965 18.4732L16 20"}],["path",{"d":"M13.9863 5L11.9929 12.5L9.99951 20"}],["path",{"d":"M7.99956 4.82959L6.30309 6.35641C4.76054 7.74471 3.98926 8.43886 3.98926 9.32959C3.98926 10.2203 4.76054 10.9145 6.30309 12.3028L7.99956 13.8296"}]])], + ["terminal", solar("Avatar_terminal", [["path",{"d":"M12 22C7.28595 22 4.92893 22 3.46447 20.5355C2 19.0711 2 16.714 2 12C2 7.28595 2 4.92893 3.46447 3.46447C4.92893 2 7.28595 2 12 2C16.714 2 19.0711 2 20.5355 3.46447C22 4.92893 22 7.28595 22 12C22 16.714 22 19.0711 20.5355 20.5355C19.0711 22 16.714 22 12 22Z"}],["path",{"d":"M17 15H14.5H12"}],["path",{"d":"M7 10L7.2344 10.1953C8.51608 11.2634 9.15693 11.7974 9.15693 12.5C9.15693 13.2026 8.51608 13.7366 7.2344 14.8047L7 15"}]])], + ["folder", solar("Avatar_folder", [["path",{"d":"M18 10L13 10"}],["path",{"d":"M11 4L10.4497 3.44975C10.1763 3.17633 10.0396 3.03961 9.89594 2.92051C9.27652 2.40704 8.51665 2.09229 7.71557 2.01738C7.52976 2 7.33642 2 6.94975 2C6.06722 2 5.62595 2 5.25839 2.06935C3.64031 2.37464 2.37464 3.64031 2.06935 5.25839C2 5.62595 2 6.06722 2 6.94975V14C2 17.7712 2 19.6569 3.17157 20.8284C4.34315 22 6.22876 22 10 22H14C17.7712 22 19.6569 22 20.8284 20.8284C22 19.6569 22 17.7712 22 14V11.7979C22 9.16554 22 7.84935 21.2305 6.99383C21.1598 6.91514 21.0849 6.84024 21.0062 6.76946C20.1506 6 18.8345 6 16.2021 6H15.8284C14.6747 6 14.0979 6 13.5604 5.84678C13.2651 5.7626 12.9804 5.64471 12.7121 5.49543C12.2237 5.22367 11.8158 4.81578 11 4Z"}]])], + ["compass", solar("Avatar_compass", [["circle",{"cx":"12","cy":"12","r":"10"}],["path",{"d":"M13.024 14.5601C13.5166 14.363 13.763 14.2645 13.9562 14.095C14.0055 14.0518 14.0518 14.0055 14.095 13.9562C14.2645 13.763 14.363 13.5166 14.5601 13.024C15.484 10.7142 15.946 9.5593 15.4977 8.89964C15.3914 8.74324 15.2565 8.60834 15.1001 8.50206C14.4405 8.0538 13.2856 8.51575 10.9758 9.43966C10.4831 9.63673 10.2368 9.73527 10.0435 9.90474C9.99429 9.94792 9.94792 9.99429 9.90474 10.0435C9.73527 10.2368 9.63673 10.4831 9.43967 10.9758C8.51575 13.2856 8.0538 14.4405 8.50206 15.1001C8.60834 15.2565 8.74324 15.3914 8.89964 15.4977C9.5593 15.946 10.7142 15.484 13.024 14.5601Z"}]])], + ["brain", solar("Avatar_brain", [["path",{"d":"M11.7509 18.741C11.7509 19.1375 11.5995 22.0306 7.99889 21.9998C3.49813 21.9614 0.122706 16.1828 2.5739 12.1378C1.82374 10.7123 1.1512 7.46073 4.46233 5.85814C4.42387 3.65296 6.71718 2.04115 8.74963 2.00088C10.1826 1.97248 11.7509 3.2091 11.7509 4.60204V18.741Z"}],["path",{"d":"M11.7511 18.741C11.7511 19.1375 11.9025 22.0306 15.5031 21.9998C20.0038 21.9614 23.3792 16.1828 20.928 12.1378C21.6782 10.7123 22.3507 7.46073 19.0396 5.85814C19.0781 3.65296 16.7848 2.04115 14.7523 2.00088C13.3194 1.97248 11.7511 3.2091 11.7511 4.60204V18.741Z"}],["path",{"d":"M9.34699 10.1999C7.98371 10.7054 6.53659 10.0275 6.11475 8.68582M8.45587 17.2585C7.0926 17.764 5.64547 17.0861 5.22363 15.7444M14.1554 10.1999C15.5186 10.7054 16.9658 10.0275 17.3876 8.68582M15.0465 17.2585C16.4097 17.764 17.8569 17.0861 18.2787 15.7444"}]])], + ["book", solar("Avatar_book", [["path",{"d":"M10 22H14C16.8284 22 18.2426 22 19.1213 21.1213C20 20.2426 20 18.8284 20 16V8C20 5.17157 20 3.75736 19.1213 2.87868C18.2426 2 16.8284 2 14 2H10C7.17157 2 5.75736 2 4.87868 2.87868C4 3.75736 4 5.17157 4 8V16C4 18.8284 4 20.2426 4.87868 21.1213C5.75736 22 7.17157 22 10 22Z"}],["path",{"d":"M19.9997 16H7.89749C6.96751 16 6.50253 16 6.12103 16.1022C5.08575 16.3796 4.29986 17.1212 4.02246 18.1564"}],["path",{"d":"M8 7H16"}],["path",{"d":"M8 10.5H13"}],["path",{"d":"M19.9239 19H8"}]])], + ["bug", solar("Avatar_bug", [["path",{"d":"M19 11.9375V15C19 18.866 15.866 22 12 22C8.13401 22 5 18.866 5 15V11.9375C5 9.76288 6.76288 8 8.9375 8H15.0625C17.2371 8 19 9.76288 19 11.9375Z"}],["path",{"d":"M16.5 8.27065V7.5C16.5 5.01472 14.4853 3 12 3C9.51472 3 7.5 5.01472 7.5 7.5V8.27065"}],["path",{"d":"M19 14H22"}],["path",{"d":"M5 14H2"}],["path",{"d":"M14.29 3.62571L16.9996 2"}],["path",{"d":"M9.70996 3.62569L7.00047 2"}],["path",{"d":"M17.7998 18.9202L20.4997 20.0002"}],["path",{"d":"M17.7803 9.08786L20.5004 7.99981"}],["path",{"d":"M6.2002 18.9203L3.50036 20.0002"}],["path",{"d":"M12 22V15"}],["path",{"d":"M6.2207 9.08781L3.50067 7.9998"}]])], + ["chart", solar("Avatar_chart", [["path",{"d":"M12 22C7.28595 22 4.92893 22 3.46447 20.5355C2 19.0711 2 16.714 2 12C2 7.28595 2 4.92893 3.46447 3.46447C4.92893 2 7.28595 2 12 2C16.714 2 19.0711 2 20.5355 3.46447C22 4.92893 22 7.28595 22 12C22 16.714 22 19.0711 20.5355 20.5355C19.0711 22 16.714 22 12 22Z"}],["path",{"d":"M7 14L9.29289 11.7071C9.68342 11.3166 10.3166 11.3166 10.7071 11.7071L12.2929 13.2929C12.6834 13.6834 13.3166 13.6834 13.7071 13.2929L17 10M14.5 10H17V12.5"}]])], + ["data", solar("Avatar_data", [["path",{"d":"M4 18V6"}],["path",{"d":"M20 6V18"}],["path",{"d":"M4 6C4 8.20914 7.58172 10 12 10C16.4183 10 20 8.20914 20 6C20 3.79086 16.4183 2 12 2C7.58172 2 4 3.79086 4 6Z"}],["path",{"d":"M20 12C20 14.2091 16.4183 16 12 16C7.58172 16 4 14.2091 4 12"}],["path",{"d":"M20 18C20 20.2091 16.4183 22 12 22C7.58172 22 4 20.2091 4 18"}]])], + ["globe", solar("Avatar_globe", [["path",{"d":"M22 12C22 13.3132 21.7413 14.6136 21.2388 15.8268C20.7362 17.0401 19.9997 18.1425 19.0711 19.0711C18.1425 19.9997 17.0401 20.7362 15.8268 21.2388C14.6136 21.7413 13.3132 22 12 22C10.6868 22 9.38642 21.7413 8.17317 21.2388C6.95991 20.7362 5.85752 19.9997 4.92893 19.0711C4.00035 18.1425 3.26375 17.0401 2.7612 15.8268C2.25866 14.6136 2 13.3132 2 12C2 10.6868 2.25866 9.38642 2.76121 8.17316C3.26375 6.95991 4.00035 5.85752 4.92893 4.92893C5.85752 4.00035 6.95991 3.26375 8.17317 2.7612C9.38642 2.25866 10.6868 2 12 2C13.3132 2 14.6136 2.25866 15.8268 2.76121C17.0401 3.26375 18.1425 4.00035 19.0711 4.92893C19.9997 5.85752 20.7362 6.95991 21.2388 8.17317C21.7413 9.38642 22 10.6868 22 12L22 12Z"}],["path",{"d":"M16 12C16 13.3132 15.8965 14.6136 15.6955 15.8268C15.4945 17.0401 15.1999 18.1425 14.8284 19.0711C14.457 19.9997 14.016 20.7362 13.5307 21.2388C13.0454 21.7413 12.5253 22 12 22C11.4747 22 10.9546 21.7413 10.4693 21.2388C9.98396 20.7362 9.54301 19.9997 9.17157 19.0711C8.80014 18.1425 8.5055 17.0401 8.30448 15.8268C8.10346 14.6136 8 13.3132 8 12C8 10.6868 8.10346 9.38642 8.30448 8.17316C8.5055 6.95991 8.80014 5.85752 9.17157 4.92893C9.54301 4.00035 9.98396 3.26375 10.4693 2.7612C10.9546 2.25866 11.4747 2 12 2C12.5253 2 13.0454 2.25866 13.5307 2.76121C14.016 3.26375 14.457 4.00035 14.8284 4.92893C15.1999 5.85752 15.4945 6.95991 15.6955 8.17317C15.8965 9.38642 16 10.6868 16 12L16 12Z"}],["path",{"d":"M2 12H22"}]])], + ["shield", solar("Avatar_shield", [["path",{"d":"M21 11.9914C21 11.4234 21 10.8996 21 10.4167C21 7.21907 21 5.62028 20.6225 5.08241C20.245 4.54454 18.7417 4.02996 15.7351 3.00079L15.1623 2.80472C13.595 2.26824 12.8114 2 12 2C11.1886 2 10.405 2.26824 8.83772 2.80472L8.26491 3.00079C5.25832 4.02996 3.75503 4.54454 3.37752 5.08241C3 5.62028 3 7.21907 3 10.4167C3 10.8996 3 11.4234 3 11.9914C3 17.6294 7.23896 20.3655 9.89856 21.5273C10.62 21.8424 10.9807 22 12 22C13.0193 22 13.38 21.8424 14.1014 21.5273C16.761 20.3655 21 17.6294 21 11.9914Z"}],["path",{"d":"M3 11L12 8L21 11"}],["path",{"d":"M12 2V21.5"}]])], + ["wrench", solar("Avatar_wrench", [["path",{"d":"M17.7418 9.01595L19.5304 7.22725C19.805 6.95275 20.2136 6.86185 20.5786 6.99435C20.9436 7.12675 21.1989 7.45855 21.2335 7.84525C21.3995 9.70145 20.6313 11.5185 19.1842 12.6927C17.7371 13.8669 15.8007 14.2443 14.0185 13.6994C13.6052 13.506 12.6506 13.6828 11.5192 14.8141C10.5293 15.8041 11.3424 16.6172 10.3525 17.6072L7.52407 20.4356C6.43057 21.5291 4.65767 21.5291 3.56427 20.4356C2.47077 19.3422 2.47077 17.5693 3.56427 16.4758L6.39267 13.6474C7.38267 12.6575 8.19577 13.4706 9.18577 12.4807C10.3171 11.3493 10.4939 10.3947 10.3005 9.98145C9.75557 8.19925 10.133 6.26285 11.3072 4.81575C12.4814 3.36865 14.2985 2.60045 16.1547 2.76645C16.5414 2.80105 16.8732 3.05635 17.0056 3.42135C17.1381 3.78635 17.0472 4.19495 16.7727 4.46955L14.984 6.25815C14.2225 7.01975 14.2225 8.25435 14.984 9.01595C15.7456 9.77745 16.9802 9.77745 17.7418 9.01595Z"}],["path",{"d":"M5.54395 18.4558H5.54405"}]])], + ["rocket", solar("Avatar_rocket", [["path",{"d":"M5.74956 11.7075C5.67492 11.8931 5.63759 12.0767 5.63759 12.2692C5.63759 13.0713 6.285 13.7168 7.5798 15.0077L8.95316 16.3769C10.248 17.6679 10.8954 18.3133 11.6999 18.3133C11.8776 18.3133 12.0477 18.2818 12.2188 18.2188C12.822 17.9966 13.4378 17.3826 14.4466 16.3769L20.2934 10.5476C21.1355 9.70811 21.5565 9.28836 21.7782 8.75458C22 8.2208 22 7.62718 22 6.43993V5.87277C22 4.04713 22 3.13431 21.4311 2.56715C20.8623 2 19.9467 2 18.1156 2H17.5467C16.3559 2 15.7605 2 15.2251 2.2211C14.6897 2.4422 14.2687 2.86195 13.4267 3.70146L7.57981 9.53078C6.59589 10.5117 5.9858 11.12 5.74956 11.7075ZM12.2188 18.2188L12.5 18.5L13.0229 18.9584C13.4463 19.3806 13.658 19.5917 13.8408 19.8249C14.0032 20.0321 14.1483 20.2521 14.2748 20.4828C14.4173 20.7425 14.5279 21.0199 14.749 21.5747C14.9291 22.0263 15.5272 22.1457 15.8746 21.7993L15.9586 21.7155C17.0789 20.5987 18.4237 19.2578 18.6939 18.6106C18.9321 18.0399 19.0114 17.4234 18.923 16.8287C18.8227 16.1545 18.4153 15.5253 17.6005 14.2668L17.1943 13.6395M5.74956 11.7075L5.57332 11.5312L4.61259 10.5734C4.56554 10.5265 4.54201 10.503 4.51839 10.4801C4.07636 10.0512 3.55641 9.7102 2.98636 9.47534C2.95589 9.46279 2.92498 9.45054 2.86314 9.42603L2.48449 9.276C1.97153 9.07274 1.83482 8.41238 2.22514 8.02324C3.34539 6.90638 4.69028 5.56554 5.33941 5.29621C5.91185 5.05869 6.53023 4.97966 7.12664 5.0678C7.80295 5.16775 8.43405 5.57394 9.69627 6.38632L10.3255 6.79129M8.26648 15.6923L10.3265 13.6385M17.1933 9.53078C16.4348 10.287 15.205 10.287 14.4466 9.53078C13.6881 8.77457 13.6881 7.54852 14.4466 6.79231C15.205 6.03611 16.4348 6.03611 17.1933 6.79231C17.9517 7.54852 17.9517 8.77457 17.1933 9.53078Z"}]])], + ["flask", solar("Avatar_flask", [["path",{"d":"M8.2002 3.4C8.2002 2.74 8.2002 2.4101 8.4052 2.205C8.6103 2 8.9402 2 9.6002 2H14.4002C15.0602 2 15.3901 2 15.5952 2.205C15.8002 2.4101 15.8002 2.74 15.8002 3.4C15.8002 4.06 15.8002 4.3899 15.5952 4.595C15.3901 4.8 15.0602 4.8 14.4002 4.8H9.6002C8.9402 4.8 8.6103 4.8 8.4052 4.595C8.2002 4.3899 8.2002 4.06 8.2002 3.4Z"}],["path",{"d":"M9.79986 4.80005V7.20005C9.79986 9.00005 8.39986 10.4 6.79986 12.8L4.39986 16.4C2.79986 18.8 4.19986 22 7.19986 22H16.7999C19.7999 22 21.1999 18.8 19.5999 16.4L17.1999 12.8C15.5999 10.4 14.1999 9.00005 14.1999 7.20005V4.80005"}],["path",{"d":"M5.33301 15C7.79971 14.1 10.1997 14.1 11.9997 15C13.7997 15.9 16.1997 15.9 18.6664 15"}],["path",{"d":"M10.2002 18.5H10.2003"}]])], + ["mail", solar("Avatar_mail", [["path",{"d":"M10 20H14C17.7712 20 19.6569 20 20.8284 18.8284C22 17.6569 22 15.7712 22 12C22 8.22876 22 6.34315 20.8284 5.17157C19.6569 4 17.7712 4 14 4H10C6.22876 4 4.34315 4 3.17157 5.17157C2 6.34315 2 8.22876 2 12C2 15.7712 2 17.6569 3.17157 18.8284C4.34315 20 6.22876 20 10 20Z"}],["path",{"d":"M6 8L8.1589 9.79908C9.99553 11.3296 10.9139 12.0949 12 12.0949C13.0861 12.0949 14.0045 11.3296 15.8411 9.79908L18 8"}]])], + ["calendar", solar("Avatar_calendar", [["path",{"d":"M10 21.75H14C17.7712 21.75 19.6569 21.75 20.8284 20.5784C22 19.4069 22 17.5212 22 13.75V11.75C22 7.97876 22 6.09315 20.8284 4.92157C19.6569 3.75 17.7712 3.75 14 3.75H10C6.22876 3.75 4.34315 3.75 3.17157 4.92157C2 6.09315 2 7.97876 2 11.75V13.75C2 17.5212 2 19.4069 3.17157 20.5784C4.34315 21.75 6.22876 21.75 10 21.75Z"}],["path",{"d":"M2.03516 8.75H21.965"}],["path",{"d":"M17 12.75H17.0001"}],["path",{"d":"M12 12.75H12.0001"}],["path",{"d":"M7 12.75H7.0001"}],["path",{"d":"M17 16.7734H17.0001"}],["path",{"d":"M12 16.7734H12.0001"}],["path",{"d":"M7 16.7734H7.0001"}],["path",{"d":"M7 3.78496V2.25"}],["path",{"d":"M17 3.78496V2.25"}]])], + ["camera", solar("Avatar_camera", [["circle",{"cx":"12","cy":"13","r":"3"}],["path",{"d":"M14.2222 21H9.77778C6.65675 21 5.09624 21 3.97524 20.2646C3.48995 19.9462 3.07328 19.5371 2.74902 19.0607C2 17.9601 2 16.4279 2 13.3636C2 10.2994 2 8.76721 2.74902 7.6666C3.07328 7.19014 3.48995 6.78104 3.97524 6.46268C4.69555 5.99013 5.59733 5.82123 6.978 5.76086C7.63685 5.76086 8.20412 5.27068 8.33333 4.63636C8.52715 3.68489 9.37805 3 10.3663 3H13.6337C14.6219 3 15.4728 3.68489 15.6667 4.63636C15.7959 5.27068 16.3631 5.76086 17.022 5.76086C18.4027 5.82123 19.3044 5.99013 20.0248 6.46268C20.51 6.78104 20.9267 7.19014 21.251 7.6666C22 8.76721 22 10.2994 22 13.3636C22 16.4279 22 17.9601 21.251 19.0607C20.9267 19.5371 20.51 19.9462 20.0248 20.2646C18.9038 21 17.3433 21 14.2222 21Z"}],["path",{"d":"M19 10H18"}]])], + ["music", solar("Avatar_music", [["path",{"d":"M13 18V10V2"}],["circle",{"cx":"9","cy":"18","r":"4"}],["path",{"d":"M19 8C15.6863 8 13 5.31371 13 2"}]])], + ["sprout", solar("Avatar_sprout", [["path",{"d":"M11.9678 20.669V10.869"}],["path",{"d":"M11.9678 15.269C8.16782 15.269 4.16782 12.669 3.56782 9.46898C3.16782 7.26898 5.16782 6.26898 7.56782 6.96898C10.3678 7.76898 11.9678 10.869 11.9678 15.269Z"}],["path",{"d":"M11.9678 10.869C11.9678 6.46903 13.7678 3.26902 16.7678 2.46902C19.1678 1.86902 20.9678 3.26902 20.3678 5.66902C19.5678 8.86902 15.7678 10.869 11.9678 10.869Z"}],["path",{"d":"M6.46777 21.669C9.46777 20.269 14.4678 20.269 17.4678 21.669"}]])], + ["leaf", solar("Avatar_leaf", [["path",{"d":"M12 9.00005L16.4317 4.56839M12 14.5L18.6143 7.88579M12 19.5L19.811 11.689"}],["path",{"d":"M12 22C16.4183 22 20 18.3541 20 13.8567C20 9.39453 17.4467 4.18759 13.4629 2.32555C12.9986 2.10852 12.4993 2 12 2M12 22C7.58172 22 4 18.3541 4 13.8567C4 9.39453 6.55332 4.18759 10.5371 2.32555C11.0014 2.10852 11.5007 2 12 2M12 22V2"}]])], + ["zap", solar("Avatar_zap", [["path",{"d":"M8.73167 5.77133L5.66953 9.91436C4.3848 11.6526 3.74244 12.5217 4.09639 13.205C4.10225 13.2164 4.10829 13.2276 4.1145 13.2387C4.48945 13.9117 5.59888 13.9117 7.81775 13.9117C9.05079 13.9117 9.6673 13.9117 10.054 14.2754L10.074 14.2946C10.4526 14.6662 10.4526 15.2585 10.4526 16.4433L10.4525 16.7528C10.4525 20.0375 10.4525 21.6798 11.3758 21.9628C12.2992 22.2458 13.2889 20.9067 15.2683 18.2287L18.3304 14.0857C19.6152 12.3475 20.2576 11.4784 19.9036 10.795C19.8977 10.7837 19.8917 10.7724 19.8855 10.7613C19.5106 10.0884 18.4011 10.0884 16.1822 10.0884C14.9492 10.0884 14.3327 10.0884 13.946 9.72466L13.926 9.70541C13.5474 9.33386 13.5474 8.74151 13.5474 7.55682V7.24712C13.5474 3.96249 13.5474 2.32018 12.6241 2.03721C11.7007 1.75425 10.711 3.09327 8.73167 5.77133Z"}]])], + ["key", solar("Avatar_key", [["path",{"d":"M22 8.29344C22 11.7692 19.1708 14.5869 15.6807 14.5869C15.0439 14.5869 13.5939 14.4405 12.8885 13.8551L12.0067 14.7333C11.272 15.465 11.8598 15.465 12.1537 16.0505C12.1537 16.0505 12.8885 17.075 12.1537 18.0995C11.7128 18.6849 10.4783 19.5045 9.06754 18.0995L8.77362 18.3922C8.77362 18.3922 9.65538 19.4167 8.92058 20.4412C8.4797 21.0267 7.30403 21.6121 6.27531 20.5876L5.2466 21.6121C4.54119 22.3146 3.67905 21.9048 3.33616 21.6121L2.45441 20.7339C1.63143 19.9143 2.1115 19.0264 2.45441 18.6849L10.0963 11.0743C10.0963 11.0743 9.3615 9.90338 9.3615 8.29344C9.3615 4.81767 12.1907 2 15.6807 2C19.1708 2 22 4.81767 22 8.29344Z"}],["path",{"d":"M17.8853 8.29353C17.8853 9.50601 16.8984 10.4889 15.681 10.4889C14.4635 10.4889 13.4766 9.50601 13.4766 8.29353C13.4766 7.08105 14.4635 6.09814 15.681 6.09814C16.8984 6.09814 17.8853 7.08105 17.8853 8.29353Z"}]])], +]; diff --git a/window/ui/src/solarIcons.test.ts b/window/ui/src/solarIcons.test.ts new file mode 100644 index 0000000..5a870f7 --- /dev/null +++ b/window/ui/src/solarIcons.test.ts @@ -0,0 +1,23 @@ +import { test } from "node:test"; +import assert from "node:assert/strict"; +import { ArrowUp, BOT_ICONS, ChevronDown, Inbox, Settings } from "./icons.ts"; +import { SOLAR_AVATAR_SLUGS, SOLAR_UI_SLUGS } from "./solarSlugs.ts"; + +test("all configured Solar icons use linear style and stroke width 1.8", () => { + for (const [name, entry] of Object.entries(SOLAR_UI_SLUGS)) { + assert.ok(entry.slug.endsWith("-linear"), `${name} must use -linear slug, got ${entry.slug}`); + } + for (const [name, slug] of SOLAR_AVATAR_SLUGS) { + assert.ok(slug.endsWith("-linear"), `avatar ${name} must use -linear slug, got ${slug}`); + assert.ok(BOT_ICONS.has(name), `BOT_ICONS missing ${name}`); + } + assert.equal(BOT_ICONS.size, 25); + assert.equal(BOT_ICONS.get("constructor"), undefined); + + for (const Icon of [ArrowUp, ChevronDown, Inbox, Settings]) { + const el = Icon({ className: "extra" }) as unknown as { props: Record }; + assert.equal(el.props.strokeWidth, 1.8); + assert.equal(el.props.className, "solar extra"); + assert.equal(el.props.fill, "none"); + } +}); diff --git a/window/ui/src/solarSlugs.ts b/window/ui/src/solarSlugs.ts new file mode 100644 index 0000000..1d382e4 --- /dev/null +++ b/window/ui/src/solarSlugs.ts @@ -0,0 +1,75 @@ +/** + * Bate icon name -> `@iconify-json/solar` `*-linear` slug. + * + * Single source of truth for both `window/ui/src/solarIcons.generated.ts` and + * `native/src/solar_icons_data.rs`, generated at build time by + * `scripts/build-solar-icons.mjs` with `stroke-width="1.8"`. + */ + +/** UI control, navigation, status, and starter icons (`Glyph` in `native/src/icons.rs`). */ +export const SOLAR_UI_SLUGS: Readonly> = { + ArrowUp: { rustName: "arrow-up", slug: "arrow-up-linear" }, + ArrowDown: { rustName: "arrow-down", slug: "arrow-down-linear" }, + Square: { rustName: "stop", slug: "stop-linear" }, + Folder: { rustName: "folder", slug: "folder-linear" }, + SquarePen: { rustName: "new-conversation", slug: "pen-new-square-linear" }, + ChevronRight: { rustName: "chevron-right", slug: "alt-arrow-right-linear" }, + ChevronDown: { rustName: "chevron-down", slug: "alt-arrow-down-linear" }, + ChevronUp: { rustName: "chevron-up", slug: "alt-arrow-up-linear" }, + Circle: { rustName: "circle", slug: "record-linear" }, + CircleDot: { rustName: "circle-dot", slug: "circle-dot-linear" }, + CircleCheck: { rustName: "circle-check", slug: "check-circle-linear" }, + CircleAlert: { rustName: "circle-alert", slug: "danger-circle-linear" }, + Copy: { rustName: "copy", slug: "copy-linear" }, + Inbox: { rustName: "inbox", slug: "inbox-linear" }, + Clock: { rustName: "clock", slug: "clock-circle-linear" }, + X: { rustName: "x", slug: "close-linear" }, + RotateCcw: { rustName: "rotate-ccw", slug: "restart-linear" }, + Pencil: { rustName: "pencil", slug: "pen-linear" }, + GitFork: { rustName: "git-fork", slug: "git-fork-linear" }, + Volume2: { rustName: "volume-2", slug: "volume-loud-linear" }, + Plus: { rustName: "plus", slug: "add-linear" }, + Check: { rustName: "check", slug: "unread-linear" }, + Pin: { rustName: "pin", slug: "pin-linear" }, + Ellipsis: { rustName: "ellipsis", slug: "menu-dots-linear" }, + Eye: { rustName: "eye", slug: "eye-linear" }, + EyeOff: { rustName: "eye-off", slug: "eye-closed-linear" }, + Paperclip: { rustName: "paperclip", slug: "paperclip-linear" }, + Settings: { rustName: "settings", slug: "settings-linear" }, + Blocks: { rustName: "blocks", slug: "widget-2-linear" }, + CalendarClock: { rustName: "calendar-clock", slug: "alarm-linear" }, + FileText: { rustName: "file-text", slug: "document-text-linear" }, + ListChecks: { rustName: "list-checks", slug: "checklist-minimalistic-linear" }, + Search: { rustName: "search", slug: "magnifier-linear" }, + PenLine: { rustName: "pen-line", slug: "pen-2-linear" }, + Mic: { rustName: "mic", slug: "microphone-3-linear" }, +}; + +/** Bot avatar icons in picker order (`BOT_ICONS` in `icons.ts` & `native/src/avatars.rs`). */ +export const SOLAR_AVATAR_SLUGS: ReadonlyArray = [ + ["bot", "bot-linear"], + ["search", "magnifier-linear"], + ["pen", "pen-2-linear"], + ["code", "code-2-linear"], + ["terminal", "programming-linear"], + ["folder", "folder-linear"], + ["compass", "compass-linear"], + ["brain", "brain-linear"], + ["book", "book-2-linear"], + ["bug", "bug-linear"], + ["chart", "graph-up-linear"], + ["data", "database-linear"], + ["globe", "global-linear"], + ["shield", "shield-linear"], + ["wrench", "wrench-linear"], + ["rocket", "rocket-linear"], + ["flask", "flask-linear"], + ["mail", "letter-linear"], + ["calendar", "calendar-linear"], + ["camera", "camera-linear"], + ["music", "music-note-2-linear"], + ["sprout", "sprout-linear"], + ["leaf", "leaf-linear"], + ["zap", "bolt-linear"], + ["key", "key-linear"], +]; diff --git a/window/ui/src/style.css b/window/ui/src/style.css index cd06f01..cb31858 100644 --- a/window/ui/src/style.css +++ b/window/ui/src/style.css @@ -58,14 +58,8 @@ button.ghost:hover:not(:disabled) { background: var(--bg-hover); color: var(--fg button.small, .setting .control:not(:has(> input:not([type=color], [type=checkbox]), > select)) > button { min-height: var(--control-h-small); padding: 0 var(--space-2); font-size: var(--size-small); } /* A button that is one sign: it needs an aria-label. */ button.round { width: var(--control-h); padding: 0; flex: none; border-radius: 50%; } -/* A drawn icon (the icon package marks each with this class): it takes the colour of the words beside it. */ -svg.lucide { width: var(--icon); height: var(--icon); flex: none; stroke-width: 1.75; } -/* Two-tone navigation & starter marks (matching `ours`): selected shelf fills 16% of currentColor. */ -.bate-shelf-fill { fill: transparent; transition: fill var(--slow) var(--ease); } -.row.current .bate-shelf-fill { fill: color-mix(in srgb, currentColor 16%, transparent); } -.bate-duo { fill: currentColor; fill-opacity: 0.16; } -.bate-duo-solid { fill: currentColor; } -svg.starter-mark { width: var(--icon); height: var(--icon); flex: none; } +/* A drawn Solar Linear icon (stroke 1.8): it takes the colour of the words beside it. */ +svg.solar { width: var(--icon); height: var(--icon); flex: none; stroke-width: 1.8; } /* Bundled monochrome brand marks (connectors, channels, installed agents): zero network requests. */ .brand-mark { display: inline-grid; place-items: center; width: var(--avatar-chat); height: var(--avatar-chat); flex: none; border-radius: var(--radius-m); background: var(--fill); color: var(--fg-muted); font-size: var(--size-small); font-weight: var(--weight-strong); } .brand-svg { width: calc(var(--icon) - var(--space-0)); height: calc(var(--icon) - var(--space-0)); flex: none; } @@ -74,7 +68,6 @@ svg.starter-mark { width: var(--icon); height: var(--icon); flex: none; } .what-lines { display: grid; flex: 1; min-width: 0; } .field-title, .setting-title { display: inline-flex; align-items: center; gap: var(--space-2); } .trademark { font-size: var(--size-small); line-height: var(--leading-small); margin-top: var(--space-2); } -@media (prefers-reduced-motion: reduce) { .bate-shelf-fill { transition: none; } } button.file { display: inline; min-height: 0; padding: 0; border: 0; border-radius: 0; background: none; font-weight: inherit; text-decoration: underline; white-space: normal; } /* On a tinted or raised surface a control's fill steps up with it, so a button never has the fill it sits on. */ .rows li, .banner, .card, .question, .first-run, .sheet > form, .popover, .composer, .quick, .surface .body, .changes summary { --fill: var(--bg-soft-2); --fill-hover: var(--bg-soft-3); } @@ -126,7 +119,7 @@ button.title:focus-visible, button.crumb:focus-visible { outline-offset: -2px; } .title .name { min-width: 0; overflow: hidden; text-overflow: ellipsis; } .title .page { flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; color: var(--fg-muted); font-weight: 400; } /* The small arrow of a title or a chip that opens a list. */ -.title .chevron, .chip > svg.lucide, .attached li > svg.lucide, .queue li > svg.lucide { width: var(--size-small); height: var(--size-small); flex: none; color: var(--fg-muted); } +.title .chevron, .chip > svg.solar, .attached li > svg.solar, .queue li > svg.solar { width: var(--size-small); height: var(--size-small); flex: none; color: var(--fg-muted); } /* ---- Lines that tell: a note, an error, nothing here yet ---- */ .note { color: var(--fg-muted); } @@ -311,7 +304,7 @@ main > .first-run { margin: auto; max-width: calc(var(--thread-w) / 2); padding: /* ---- Avatar: the bot's sign (an icon, or its first letter) on a wash of its colour. The wash is see-through, so it is a step off whatever is under it: the window's sidebar is. ---- */ .avatar { display: inline-grid; place-items: center; width: var(--avatar); height: var(--avatar); border-radius: var(--radius-m); flex: none; font-size: var(--size-small); font-weight: var(--weight-strong); color: color-mix(in oklab, var(--tint, var(--fg-muted)) 50%, var(--fg)); background: color-mix(in oklab, var(--tint, var(--fg-muted)) 24%, transparent); } -.avatar svg.lucide { width: 80%; height: 80%; stroke-width: 1.5; } +.avatar svg.solar { width: 80%; height: 80%; stroke-width: 1.8; } /* ---- The window: sidebar, main area, side pane ---- */ .app { display: grid; grid-template-columns: var(--side-w) minmax(0, 1fr) auto; grid-template-rows: minmax(0, 1fr); height: 100vh; padding: var(--space-2) var(--space-2) var(--space-2) 0; background: var(--bg-side); } @@ -345,8 +338,8 @@ body:has(> #root > .app.shell) { background: transparent; } .row small { font-weight: 400; } /* A row with an icon and no avatar: a project, or a page of the app. */ .row.plain { min-height: var(--control-h); } -.row.plain > svg.lucide { color: var(--fg-muted); } -.row.plain.current > svg.lucide { color: var(--fg); } +.row.plain > svg.solar { color: var(--fg-muted); } +.row.plain.current > svg.solar { color: var(--fg); } /* In the sidebar every row is one line of one height: the name, cut when it is long, and the state at the row's end. Chosen, a row keeps its weight so that its words do not move. */ .sidebar .row { min-height: var(--control-h); } .sidebar .row .label { flex: 1; display: flex; align-items: center; gap: var(--space-2); } @@ -485,7 +478,7 @@ main:has(> .chat) > header { max-width: none; } .dot.bad { background: var(--danger); opacity: 1; } .run > summary:hover { color: var(--fg); } .mark { display: inline-grid; place-items: center; width: 14px; height: 14px; flex: none; } -.mark svg.lucide { width: 100%; height: 100%; } +.mark svg.solar { width: 100%; height: 100%; } .mark.spin { border: 2px solid var(--border-strong); border-top-color: var(--fg-muted); border-radius: 50%; animation: spin var(--spin) linear infinite; } .run > ul { list-style: none; margin: 0 0 var(--space-1); padding: 0; } .run li { display: flex; flex-wrap: wrap; align-items: flex-start; column-gap: var(--space-2); padding: var(--space-0) 0; }