refactor(ui,mobile): extract shell icons into ui-tokens and align mobile views

Extract 15 official BlockSuite shell icons into ui-tokens and regenerate icons.rs.

Replace the 13 inline SVG constants in packages/frontend/mobile with the generated icons.
Use FolderIcon for explorer folder rows and SidebarIcon for the workspace drawer button.
Keep RTL mirroring and light or dark tinting across mobile views.
This commit is contained in:
DarkSky committed 2026-12-03 15:59:37 +09:00
1 parent 4317d3c645
commit c368500dfd
11 files changed
+175 -63

No files matched your search

+8 -9
View File
@@ -8,6 +8,7 @@ use ui::{
StatefulInteractiveElement, Styled, div, px, svg,
};
use ui_kit::LogicalStyled;
use ui_tokens::icons;
use crate::{
state::{MobileAppState, MobileSheet},
@@ -15,9 +16,7 @@ use crate::{
};
use super::{
A11yBoundsMap, CHEVRON_LEFT_SVG, CHEVRON_RIGHT_SVG, CLOSE_ICON_SVG, MobileFlexExt,
MobilePalette, MobileShellView, PLUS_ICON_SVG, SEARCH_ICON_SVG, STAR_ICON_SVG,
a11y_bounds_probe, row_dir,
A11yBoundsMap, MobileFlexExt, MobilePalette, MobileShellView, a11y_bounds_probe, row_dir,
};
/// Format the localized sync status badge label and indicator color.
@@ -117,11 +116,11 @@ pub(super) fn render_workspace_drawer(
.child(
svg()
.data(if is_tablet {
CLOSE_ICON_SVG
icons::CLOSE.svg.as_bytes()
} else if dir.is_rtl() {
CHEVRON_RIGHT_SVG
icons::ARROW_RIGHT_SMALL.svg.as_bytes()
} else {
CHEVRON_LEFT_SVG
icons::ARROW_LEFT_SMALL.svg.as_bytes()
})
.w(px(16.0))
.h(px(16.0))
@@ -254,7 +253,7 @@ pub(super) fn render_workspace_drawer(
.overflow_hidden()
.child(
svg()
.data(SEARCH_ICON_SVG)
.data(icons::SEARCH.svg.as_bytes())
.w(px(15.0))
.h(px(15.0))
.text_color(palette.text_muted),
@@ -287,7 +286,7 @@ pub(super) fn render_workspace_drawer(
))
.child(
svg()
.data(PLUS_ICON_SVG)
.data(icons::PLUS.svg.as_bytes())
.w(px(16.0))
.h(px(16.0))
.text_color(ui::white()),
@@ -349,7 +348,7 @@ pub(super) fn render_workspace_drawer(
if show_star {
row = row.child(
svg()
.data(STAR_ICON_SVG)
.data(icons::FAVORITED.svg.as_bytes())
.w(px(13.0))
.h(px(13.0))
.text_color(palette.accent),
@@ -10,6 +10,7 @@ use ui::{
Styled, div, px, svg,
};
use ui_kit::{LogicalStyled, VirtualWindow};
use ui_tokens::icons;
use crate::{
explorer_model::{
@@ -21,8 +22,7 @@ use crate::{
};
use super::{
A11yBoundsMap, EXPLORER_ICON_SVG, MobileFlexExt, MobilePalette, MobileShellView,
a11y_bounds_probe,
A11yBoundsMap, MobileFlexExt, MobilePalette, MobileShellView, a11y_bounds_probe,
explorer_rows::{
ExplorerEnv, drilldown_header, explorer_compact_meta_cell, explorer_doc_row,
explorer_meta_row, explorer_scroll_viewport, new_doc_button,
@@ -197,7 +197,7 @@ fn folder_row(
}))
.child(
svg()
.data(EXPLORER_ICON_SVG)
.data(icons::FOLDER.svg.as_bytes())
.mirror_in_rtl(true)
.w(px(16.0))
.h(px(16.0))
@@ -6,12 +6,12 @@ use ui::{
Styled, div, px, svg,
};
use ui_kit::LogicalStyled;
use ui_tokens::icons;
use crate::{a11y::derive_explorer_doc_origin, strings::MobileStrings};
use super::{
A11yBoundsMap, CHEVRON_LEFT_SVG, MobileFlexExt, MobilePalette, MobileShellView, PLUS_ICON_SVG,
a11y_bounds_probe, row_dir,
A11yBoundsMap, MobileFlexExt, MobilePalette, MobileShellView, a11y_bounds_probe, row_dir,
};
#[derive(Clone, Copy)]
@@ -51,7 +51,7 @@ pub(super) fn new_doc_button(
))
.child(
svg()
.data(PLUS_ICON_SVG)
.data(icons::PLUS.svg.as_bytes())
.w(px(18.0))
.h(px(18.0))
.text_color(palette.accent),
@@ -172,7 +172,7 @@ pub(super) fn drilldown_header(
))
.child(
svg()
.data(CHEVRON_LEFT_SVG)
.data(icons::ARROW_LEFT_SMALL.svg.as_bytes())
.mirror_in_rtl(true)
.w(px(15.0))
.h(px(15.0))
@@ -6,12 +6,13 @@ use ui::{
Styled, div, px, svg,
};
use ui_kit::LogicalStyled;
use ui_tokens::icons;
use crate::{state::MobileAppState, strings::MobileStrings};
use super::{
A11yBoundsMap, CHEVRON_LEFT_SVG, CHEVRON_RIGHT_SVG, MobileFlexExt, MobilePalette,
MobileShellView, a11y_bounds_probe, a11y_bounds_probe_border, row_dir,
A11yBoundsMap, MobileFlexExt, MobilePalette, MobileShellView, a11y_bounds_probe,
a11y_bounds_probe_border, row_dir,
};
#[allow(clippy::too_many_arguments)]
@@ -82,7 +83,7 @@ pub(super) fn render_journals(
))
.child(
svg()
.data(CHEVRON_LEFT_SVG)
.data(icons::ARROW_LEFT_SMALL.svg.as_bytes())
.mirror_in_rtl(true)
.w(px(15.0))
.h(px(15.0))
@@ -120,7 +121,7 @@ pub(super) fn render_journals(
))
.child(
svg()
.data(CHEVRON_RIGHT_SVG)
.data(icons::ARROW_RIGHT_SMALL.svg.as_bytes())
.mirror_in_rtl(true)
.w(px(15.0))
.h(px(15.0))
-14
View File
@@ -44,20 +44,6 @@ use crate::{
state::{MobileAppState, MobileRoute, MobileSheet},
};
pub(super) const HOME_ICON_SVG: &[u8] = br#"<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none"><path d="M3 10.5L12 3.5L21 10.5M5.5 9.5V19.5H18.5V9.5" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"/></svg>"#;
pub(super) const EXPLORER_ICON_SVG: &[u8] = br#"<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none"><path d="M3 6.5H9.5L11.5 9H21V19H3V6.5Z" stroke="currentColor" stroke-width="1.8" stroke-linejoin="round"/></svg>"#;
pub(super) const JOURNALS_ICON_SVG: &[u8] = br#"<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none"><rect x="4" y="5" width="16" height="15" rx="2" stroke="currentColor" stroke-width="1.8"/><path d="M4 10H20M8 3V6M16 3V6" stroke="currentColor" stroke-width="1.8" stroke-linecap="round"/></svg>"#;
pub(super) const SEARCH_ICON_SVG: &[u8] = br#"<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none"><circle cx="10.5" cy="10.5" r="6" stroke="currentColor" stroke-width="1.8"/><path d="M15.2 15.2L20 20" stroke="currentColor" stroke-width="1.8" stroke-linecap="round"/></svg>"#;
pub(super) const SETTINGS_ICON_SVG: &[u8] = br#"<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none"><path d="M10.6 2.8H13.4L13.9 5.2L17.0 7.1L19.2 6.2L20.6 8.6L18.8 10.1V13.9L20.6 15.4L19.2 17.8L17.0 16.9L13.9 18.8L13.4 21.2H10.6L10.1 18.8L7.0 16.9L4.8 17.8L3.4 15.4L5.2 13.9V10.1L3.4 8.6L4.8 6.2L7.0 7.1L10.1 5.2L10.6 2.8Z" stroke="currentColor" stroke-width="1.8" stroke-linejoin="round"/><circle cx="12" cy="12" r="3" stroke="currentColor" stroke-width="1.8"/></svg>"#;
pub(super) const PLUS_ICON_SVG: &[u8] = br#"<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none"><path d="M12 5V19M5 12H19" stroke="currentColor" stroke-width="2" stroke-linecap="round"/></svg>"#;
pub(super) const CHEVRON_LEFT_SVG: &[u8] = br#"<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" fill="none"><path d="M10 3.5L5.5 8L10 12.5" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round"/></svg>"#;
pub(super) const CHEVRON_RIGHT_SVG: &[u8] = br#"<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" fill="none"><path d="M6 3.5L10.5 8L6 12.5" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round"/></svg>"#;
pub(super) const CHEVRON_DOWN_SVG: &[u8] = br#"<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" fill="none"><path d="M4 6L8 10L12 6" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round"/></svg>"#;
pub(super) const CLOSE_ICON_SVG: &[u8] = br#"<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" fill="none"><path d="M4.5 4.5L11.5 11.5M11.5 4.5L4.5 11.5" stroke="currentColor" stroke-width="1.6" stroke-linecap="round"/></svg>"#;
pub(super) const MORE_ICON_SVG: &[u8] = br#"<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><circle cx="6" cy="12" r="1.7"/><circle cx="12" cy="12" r="1.7"/><circle cx="18" cy="12" r="1.7"/></svg>"#;
pub(super) const STAR_ICON_SVG: &[u8] = br#"<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor"><path d="M10 2.5L12.3 7.2L17.5 7.9L13.7 11.6L14.6 16.8L10 14.3L5.4 16.8L6.3 11.6L2.5 7.9L7.7 7.2L10 2.5Z"/></svg>"#;
pub(super) const MENU_ICON_SVG: &[u8] = br#"<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none"><path d="M4 7H20M4 12H20M4 17H14" stroke="currentColor" stroke-width="1.8" stroke-linecap="round"/></svg>"#;
pub(super) trait MobileFlexExt: Styled {
fn justify_between(mut self) -> Self {
self.style().justify_content = Some(ui::JustifyContent::SpaceBetween);
+9 -9
View File
@@ -10,7 +10,7 @@ use ui_kit::{
BreadcrumbBarConfig, BreadcrumbBarLayout, BreadcrumbItem, BreadcrumbItemKind,
BreadcrumbSlotKind, LogicalStyled, MIN_TOUCH_WIDTH, layout_breadcrumb_bar_with_measurer,
};
use ui_tokens::FONT_SANS;
use ui_tokens::{FONT_SANS, icons};
use crate::{
state::{MobileAppState, MobileBackCoordinator, MobileSheet},
@@ -18,8 +18,7 @@ use crate::{
};
use super::{
A11yBoundsMap, CHEVRON_DOWN_SVG, CHEVRON_LEFT_SVG, CHEVRON_RIGHT_SVG, MENU_ICON_SVG,
MORE_ICON_SVG, MobileFlexExt, MobilePalette, MobileShellView, a11y_bounds_probe,
A11yBoundsMap, MobileFlexExt, MobilePalette, MobileShellView, a11y_bounds_probe,
a11y_bounds_probe_border, drawer::sync_status_badge, row_dir,
};
@@ -78,7 +77,7 @@ pub(super) fn render_page(
))
.child(
svg()
.data(CHEVRON_LEFT_SVG)
.data(icons::ARROW_LEFT_SMALL.svg.as_bytes())
.mirror_in_rtl(true)
.w(px(15.0))
.h(px(15.0))
@@ -136,7 +135,8 @@ pub(super) fn render_page(
))
.child(
svg()
.data(MENU_ICON_SVG)
.data(icons::SIDEBAR.svg.as_bytes())
.mirror_in_rtl(true)
.w(px(18.0))
.h(px(18.0))
.text_color(palette.text_secondary),
@@ -168,7 +168,7 @@ pub(super) fn render_page(
))
.child(
svg()
.data(MORE_ICON_SVG)
.data(icons::MORE_HORIZONTAL.svg.as_bytes())
.w(px(18.0))
.h(px(18.0))
.text_color(palette.text_secondary),
@@ -278,7 +278,7 @@ pub(super) fn render_page(
.justify_center()
.child(
svg()
.data(CHEVRON_RIGHT_SVG)
.data(icons::ARROW_RIGHT_SMALL.svg.as_bytes())
.mirror_in_rtl(true)
.w(px(12.0))
.h(px(12.0))
@@ -351,7 +351,7 @@ pub(super) fn render_page(
if slot.kind == BreadcrumbSlotKind::Switcher {
pill = pill.child(
svg()
.data(CHEVRON_DOWN_SVG)
.data(icons::ARROW_DOWN_SMALL.svg.as_bytes())
.w(px(12.0))
.h(px(12.0))
.text_color(text_color),
@@ -589,7 +589,7 @@ pub(super) fn render_page(
if !is_ready || !backlinks.items.is_empty() {
bl_pill = bl_pill.child(
svg()
.data(CHEVRON_RIGHT_SVG)
.data(icons::ARROW_RIGHT_SMALL.svg.as_bytes())
.mirror_in_rtl(true)
.w(px(14.0))
.h(px(14.0))
+6 -5
View File
@@ -7,12 +7,13 @@ use ui::{
ParentElement, StatefulInteractiveElement, Styled, canvas, div, px, svg,
};
use ui_kit::LogicalStyled;
use ui_tokens::icons;
use crate::{state::MobileAppState, strings::MobileStrings};
use super::{
A11yBoundsMap, CLOSE_ICON_SVG, MobileFlexExt, MobilePalette, MobileShellView, SEARCH_ICON_SVG,
a11y_bounds_probe, row_dir, utf16_to_byte,
A11yBoundsMap, MobileFlexExt, MobilePalette, MobileShellView, a11y_bounds_probe, row_dir,
utf16_to_byte,
};
#[allow(clippy::too_many_arguments)]
@@ -157,7 +158,7 @@ pub(super) fn render_search(
.gap(px(8.0))
.child(
svg()
.data(SEARCH_ICON_SVG)
.data(icons::SEARCH.svg.as_bytes())
.mirror_in_rtl(true)
.w(px(16.0))
.h(px(16.0))
@@ -191,7 +192,7 @@ pub(super) fn render_search(
))
.child(
svg()
.data(CLOSE_ICON_SVG)
.data(icons::CLOSE.svg.as_bytes())
.w(px(14.0))
.h(px(14.0))
.text_color(palette.text_secondary),
@@ -336,7 +337,7 @@ pub(super) fn render_search(
.gap(px(10.0))
.child(
svg()
.data(SEARCH_ICON_SVG)
.data(icons::SEARCH.svg.as_bytes())
.mirror_in_rtl(true)
.w(px(28.0))
.h(px(28.0))
@@ -6,6 +6,7 @@ use ui::{
Styled, div, px, svg,
};
use ui_kit::{LogicalStyled, bidi_isolate};
use ui_tokens::icons;
use crate::{
state::{
@@ -16,8 +17,7 @@ use crate::{
};
use super::{
A11yBoundsMap, CHEVRON_LEFT_SVG, MobileFlexExt, MobilePalette, MobileShellView,
a11y_bounds_probe, row_dir,
A11yBoundsMap, MobileFlexExt, MobilePalette, MobileShellView, a11y_bounds_probe, row_dir,
};
pub(super) fn render_settings(
@@ -52,7 +52,7 @@ pub(super) fn render_settings(
))
.child(
svg()
.data(CHEVRON_LEFT_SVG)
.data(icons::ARROW_LEFT_SMALL.svg.as_bytes())
.mirror_in_rtl(true)
.w(px(15.0))
.h(px(15.0))
+11 -12
View File
@@ -7,6 +7,7 @@ use ui::{
StatefulInteractiveElement, Styled, div, px, svg,
};
use ui_kit::{LogicalStyled, MicroIconKind, evaluate_micro_icon};
use ui_tokens::icons;
use crate::{
explorer_model::{fully_visible, row_window_overscan},
@@ -16,9 +17,7 @@ use crate::{
};
use super::{
A11yBoundsMap, CHEVRON_DOWN_SVG, EXPLORER_ICON_SVG, HOME_ICON_SVG, JOURNALS_ICON_SVG,
MobileFlexExt, MobilePalette, MobileShellView, PLUS_ICON_SVG, SEARCH_ICON_SVG,
SETTINGS_ICON_SVG, STAR_ICON_SVG, a11y_bounds_probe, row_dir,
A11yBoundsMap, MobileFlexExt, MobilePalette, MobileShellView, a11y_bounds_probe, row_dir,
};
pub(super) fn render_home(
@@ -98,7 +97,7 @@ pub(super) fn render_home(
)
.child(
svg()
.data(CHEVRON_DOWN_SVG)
.data(icons::ARROW_DOWN_SMALL.svg.as_bytes())
.w(px(14.0))
.h(px(14.0))
.flex_shrink(0.0)
@@ -132,7 +131,7 @@ pub(super) fn render_home(
))
.child(
svg()
.data(PLUS_ICON_SVG)
.data(icons::PLUS.svg.as_bytes())
.w(px(18.0))
.h(px(18.0))
.text_color(palette.accent),
@@ -160,7 +159,7 @@ pub(super) fn render_home(
))
.child(
svg()
.data(SETTINGS_ICON_SVG)
.data(icons::SETTINGS.svg.as_bytes())
.w(px(18.0))
.h(px(18.0))
.text_color(palette.text_secondary),
@@ -201,7 +200,7 @@ pub(super) fn render_home(
.child(a11y_bounds_probe(node_id, a11y_bounds.clone()))
.child(
svg()
.data(STAR_ICON_SVG)
.data(icons::FAVORITED.svg.as_bytes())
.w(px(14.0))
.h(px(14.0))
.flex_shrink(0.0)
@@ -446,11 +445,11 @@ pub(super) fn render_bottom_tabbar(
MobileTab::Search => strings.tab_search,
};
let icon_bytes = match tab.micro_icon() {
MicroIconKind::Home => HOME_ICON_SVG,
MicroIconKind::Explorer => EXPLORER_ICON_SVG,
MicroIconKind::Journals => JOURNALS_ICON_SVG,
MicroIconKind::Search => SEARCH_ICON_SVG,
MicroIconKind::SyncSpinner => SETTINGS_ICON_SVG,
MicroIconKind::Home => icons::HOME.svg.as_bytes(),
MicroIconKind::Explorer => icons::ALL_DOCS.svg.as_bytes(),
MicroIconKind::Journals => icons::TODAY.svg.as_bytes(),
MicroIconKind::Search => icons::SEARCH.svg.as_bytes(),
MicroIconKind::SyncSpinner => icons::SETTINGS.svg.as_bytes(),
};
let icon_color = if active {
Hsla {
+26
View File
@@ -95,6 +95,22 @@ const CORE_ICONS = [
['DONE', 'DoneIcon'],
['SEARCH', 'SearchIcon'],
['COMMENT', 'CommentIcon'],
// Shell navigation & workspace icons
['ARROW_LEFT_SMALL', 'ArrowLeftSmallIcon'],
['ARROW_RIGHT_SMALL', 'ArrowRightSmallIcon'],
['CLOSE', 'CloseIcon'],
['FAVORITED', 'FavoritedIcon'],
['FAVORITE', 'FavoriteIcon'],
['SIDEBAR', 'SidebarIcon'],
['TODAY', 'TodayIcon'],
['FOLDER', 'FolderIcon'],
['VIEW_LAYERS', 'ViewLayersIcon'],
['TAG', 'TagIcon'],
['SETTINGS', 'SettingsIcon'],
['SPLIT_VIEW', 'SplitViewIcon'],
['EXPAND_FULL', 'ExpandFullIcon'],
['HOME', 'HomeIcon'],
['ALL_DOCS', 'AllDocsIcon'],
];
/**
@@ -1081,6 +1097,16 @@ mod tests {
assert_eq!(icon_by_name("MoveLeftIcon"), Some(&MOVE_LEFT));
assert_eq!(icon_by_name("MoveRightIcon"), Some(&MOVE_RIGHT));
assert_eq!(icon_by_name("InvisibleIcon"), Some(&INVISIBLE));
assert_eq!(icon_by_name("ArrowLeftSmallIcon"), Some(&ARROW_LEFT_SMALL));
assert_eq!(icon_by_name("ArrowRightSmallIcon"), Some(&ARROW_RIGHT_SMALL));
assert_eq!(icon_by_name("AllDocsIcon"), Some(&ALL_DOCS));
assert_eq!(icon_by_name("FavoriteIcon"), Some(&FAVORITE));
assert_eq!(icon_by_name("FavoritedIcon"), Some(&FAVORITED));
assert_eq!(icon_by_name("FolderIcon"), Some(&FOLDER));
assert_eq!(icon_by_name("HomeIcon"), Some(&HOME));
assert_eq!(icon_by_name("SettingsIcon"), Some(&SETTINGS));
assert_eq!(icon_by_name("SidebarIcon"), Some(&SIDEBAR));
assert_eq!(icon_by_name("TodayIcon"), Some(&TODAY));
}
#[test]
+100
View File
@@ -408,11 +408,89 @@ pub const COMMENT: IconDef = IconDef {
svg: "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"none\"><path d=\"M12.5 3.75a7.75 7.75 0 0 0-7.022 11.033.85.85 0 0 1 .068.5l-.634 3.805 3.804-.634a.85.85 0 0 1 .5.068A7.75 7.75 0 1 0 12.5 3.75M3.25 11.5a9.25 9.25 0 1 1 5.517 8.466l-4.506.75a.85.85 0 0 1-.978-.977l.751-4.506A9.2 9.2 0 0 1 3.25 11.5\" fill=\"#000\" fill-rule=\"evenodd\" clip-rule=\"evenodd\"/></svg>",
};
pub const ARROW_LEFT_SMALL: IconDef = IconDef {
name: "ArrowLeftSmallIcon",
svg: "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"none\"><path d=\"M14.53 6.47a.75.75 0 0 1 0 1.06L10.06 12l4.47 4.47a.75.75 0 1 1-1.06 1.06l-5-5a.75.75 0 0 1 0-1.06l5-5a.75.75 0 0 1 1.06 0\" fill=\"#000\" fill-rule=\"evenodd\" clip-rule=\"evenodd\"/></svg>",
};
pub const ARROW_RIGHT_SMALL: IconDef = IconDef {
name: "ArrowRightSmallIcon",
svg: "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"none\"><path d=\"M8.47 6.47a.75.75 0 0 0 0 1.06L12.94 12l-4.47 4.47a.75.75 0 1 0 1.06 1.06l5-5a.75.75 0 0 0 0-1.06l-5-5a.75.75 0 0 0-1.06 0\" fill=\"#000\" fill-rule=\"evenodd\" clip-rule=\"evenodd\"/></svg>",
};
pub const CLOSE: IconDef = IconDef {
name: "CloseIcon",
svg: "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"none\"><path d=\"M5.47 5.47a.75.75 0 0 1 1.06 0L12 10.94l5.47-5.47a.75.75 0 1 1 1.06 1.06L13.06 12l5.47 5.47a.75.75 0 1 1-1.06 1.06L12 13.06l-5.47 5.47a.75.75 0 0 1-1.06-1.06L10.94 12 5.47 6.53a.75.75 0 0 1 0-1.06\" fill=\"#000\" fill-rule=\"evenodd\" clip-rule=\"evenodd\"/></svg>",
};
pub const FAVORITED: IconDef = IconDef {
name: "FavoritedIcon",
svg: "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"none\"><path d=\"M13.638 3.22c-.57-1.51-2.707-1.51-3.276 0l-1.56 4.144a.25.25 0 0 1-.223.162l-4.423.203c-1.613.075-2.273 2.107-1.012 3.116l3.459 2.764a.25.25 0 0 1 .085.262l-1.173 4.27c-.428 1.556 1.3 2.812 2.65 1.925l3.698-2.435a.25.25 0 0 1 .274 0l3.699 2.435c1.348.887 3.077-.369 2.65-1.926l-1.174-4.27a.25.25 0 0 1 .085-.26l3.459-2.765c1.261-1.009.6-3.041-1.012-3.116l-4.423-.203a.25.25 0 0 1-.223-.162z\" fill=\"#000\" fill-rule=\"evenodd\" clip-rule=\"evenodd\"/></svg>",
};
pub const FAVORITE: IconDef = IconDef {
name: "FavoriteIcon",
svg: "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"none\"><path d=\"M10.362 3.22c.57-1.51 2.707-1.51 3.276 0l1.56 4.144a.25.25 0 0 0 .223.162l4.423.203c1.613.075 2.273 2.107 1.012 3.116l-3.459 2.764a.25.25 0 0 0-.085.262l1.173 4.27c.428 1.556-1.3 2.812-2.65 1.925l-3.698-2.435a.25.25 0 0 0-.274 0l-3.699 2.435c-1.348.887-3.077-.369-2.65-1.926l1.174-4.27a.25.25 0 0 0-.085-.26l-3.459-2.765c-1.261-1.009-.6-3.041 1.012-3.116l4.423-.203a.25.25 0 0 0 .223-.162zm1.872.53a.25.25 0 0 0-.468 0l-1.56 4.143a1.75 1.75 0 0 1-1.558 1.131l-4.423.204a.25.25 0 0 0-.144.445l3.458 2.765a1.75 1.75 0 0 1 .595 1.83l-1.173 4.27a.25.25 0 0 0 .378.275l3.699-2.435a1.75 1.75 0 0 1 1.924 0l3.698 2.435a.25.25 0 0 0 .379-.275l-1.173-4.27a1.75 1.75 0 0 1 .595-1.83l3.458-2.765a.25.25 0 0 0-.144-.445l-4.423-.204a1.75 1.75 0 0 1-1.558-1.131z\" fill=\"#000\" fill-rule=\"evenodd\" clip-rule=\"evenodd\"/></svg>",
};
pub const SIDEBAR: IconDef = IconDef {
name: "SidebarIcon",
svg: "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"none\"><path d=\"M3.5 6.5a2 2 0 0 1 2-2h13a2 2 0 0 1 2 2v11a2 2 0 0 1-2 2h-13a2 2 0 0 1-2-2zm6.75-.5h8.25a.5.5 0 0 1 .5.5v11a.5.5 0 0 1-.5.5h-8.25zm-1.5 0H5.5a.5.5 0 0 0-.5.5v11a.5.5 0 0 0 .5.5h3.25z\" fill=\"#000\" fill-rule=\"evenodd\" clip-rule=\"evenodd\"/></svg>",
};
pub const TODAY: IconDef = IconDef {
name: "TodayIcon",
svg: "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"none\"><path d=\"M8.205 2.787c.393 0 .712.319.712.712v.711h6.166V3.5a.712.712 0 0 1 1.423 0v.711h2.135a2.61 2.61 0 0 1 2.609 2.61v11.384a2.61 2.61 0 0 1-2.609 2.609H5.359a2.61 2.61 0 0 1-2.609-2.61V6.82A2.61 2.61 0 0 1 5.359 4.21h2.135V3.5c0-.393.318-.712.711-.712m6.878 2.846v.712a.712.712 0 0 0 1.423 0v-.712h2.135c.655 0 1.186.531 1.186 1.186v1.66H4.173V6.82c0-.655.531-1.186 1.186-1.186h2.135v.712a.712.712 0 1 0 1.423 0v-.712zm4.744 4.27H4.173v8.3c0 .656.531 1.187 1.186 1.187h13.282c.655 0 1.186-.531 1.186-1.186zm-12.57 1.47a.474.474 0 0 0-.475.475v1.423c0 .262.212.474.474.474H8.68a.474.474 0 0 0 .475-.474v-1.424a.474.474 0 0 0-.475-.474zm-.475 4.174c0-.261.212-.474.474-.474H8.68c.262 0 .475.213.475.474v1.424a.474.474 0 0 1-.475.474H7.256a.474.474 0 0 1-.474-.474zm4.459-4.174a.474.474 0 0 0-.474.475v1.423c0 .262.212.474.474.474h1.423a.474.474 0 0 0 .475-.474v-1.424a.474.474 0 0 0-.475-.474zm-.474 4.174c0-.261.212-.474.474-.474h1.423c.262 0 .475.213.475.474v1.424a.474.474 0 0 1-.475.474h-1.423a.474.474 0 0 1-.474-.474zm4.554-4.174a.474.474 0 0 0-.475.475v1.423c0 .262.213.474.474.474h1.424a.474.474 0 0 0 .474-.474v-1.424a.474.474 0 0 0-.474-.474z\" fill=\"#000\" fill-rule=\"evenodd\" clip-rule=\"evenodd\"/></svg>",
};
pub const FOLDER: IconDef = IconDef {
name: "FolderIcon",
svg: "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"none\"><path d=\"M5 5.25c-.69 0-1.25.56-1.25 1.25V17c0 .69.56 1.25 1.25 1.25h14c.69 0 1.25-.56 1.25-1.25V8.5c0-.69-.56-1.25-1.25-1.25h-6.5a.75.75 0 0 1-.53-.22l-1.415-1.414a1.25 1.25 0 0 0-.883-.366zM2.25 6.5A2.75 2.75 0 0 1 5 3.75h4.672c.729 0 1.428.29 1.944.805l1.195 1.195H19a2.75 2.75 0 0 1 2.75 2.75V17A2.75 2.75 0 0 1 19 19.75H5A2.75 2.75 0 0 1 2.25 17z\" fill=\"#000\" fill-rule=\"evenodd\" clip-rule=\"evenodd\"/></svg>",
};
pub const VIEW_LAYERS: IconDef = IconDef {
name: "ViewLayersIcon",
svg: "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"none\"><path d=\"M9 4.25a.75.75 0 0 0 0 1.5h6a.75.75 0 0 0 0-1.5zM6.25 8A.75.75 0 0 1 7 7.25h10a.75.75 0 0 1 0 1.5H7A.75.75 0 0 1 6.25 8m-2 5A2.75 2.75 0 0 1 7 10.25h10A2.75 2.75 0 0 1 19.75 13v5A2.75 2.75 0 0 1 17 20.75H7A2.75 2.75 0 0 1 4.25 18zM7 11.75c-.69 0-1.25.56-1.25 1.25v5c0 .69.56 1.25 1.25 1.25h10c.69 0 1.25-.56 1.25-1.25v-5c0-.69-.56-1.25-1.25-1.25z\" fill=\"#000\" fill-rule=\"evenodd\" clip-rule=\"evenodd\"/></svg>",
};
pub const TAG: IconDef = IconDef {
name: "TagIcon",
svg: "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"none\"><path d=\"M4.564 7.467a3.017 3.017 0 0 1 2.903-2.903l4.606-.17c.323-.013.636.11.864.338l6.647 6.648a1.16 1.16 0 0 1 0 1.64l-6.563 6.564a1.16 1.16 0 0 1-1.641 0l-6.648-6.647a1.16 1.16 0 0 1-.339-.864zm2.851-4.295a4.41 4.41 0 0 0-4.243 4.243l-.17 4.607c-.027.71.244 1.397.746 1.9l6.647 6.647a2.553 2.553 0 0 0 3.61 0l6.564-6.564a2.553 2.553 0 0 0 0-3.61L13.92 3.748a2.55 2.55 0 0 0-1.9-.746zm.847 5.09A.928.928 0 1 0 6.95 6.95a.928.928 0 0 0 1.313 1.313\" fill=\"#000\" fill-rule=\"evenodd\" clip-rule=\"evenodd\"/></svg>",
};
pub const SETTINGS: IconDef = IconDef {
name: "SettingsIcon",
svg: "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"none\"><path d=\"M9.596 4.14c.612-2.52 4.196-2.52 4.808 0a.974.974 0 0 0 1.454.602c2.215-1.35 4.75 1.186 3.4 3.4a.974.974 0 0 0 .602 1.454c2.52.612 2.52 4.196 0 4.808a.974.974 0 0 0-.602 1.454c1.35 2.215-1.185 4.75-3.4 3.4a.974.974 0 0 0-1.454.602c-.612 2.52-4.196 2.52-4.808 0a.974.974 0 0 0-1.454-.602c-2.214 1.35-4.75-1.185-3.4-3.4a.974.974 0 0 0-.602-1.454c-2.52-.612-2.52-4.196 0-4.808a.974.974 0 0 0 .602-1.454c-1.35-2.214 1.186-4.75 3.4-3.4a.974.974 0 0 0 1.454-.602m3.35.354c-.24-.992-1.652-.992-1.892 0a2.474 2.474 0 0 1-3.692 1.53c-.872-.532-1.87.466-1.339 1.338.872 1.43.1 3.296-1.529 3.691-.992.241-.992 1.653 0 1.893a2.474 2.474 0 0 1 1.53 3.692c-.532.872.466 1.87 1.338 1.339a2.474 2.474 0 0 1 3.691 1.529c.241.992 1.653.992 1.893 0a2.474 2.474 0 0 1 3.692-1.53c.872.532 1.87-.466 1.339-1.338a2.474 2.474 0 0 1 1.529-3.692c.992-.24.992-1.652 0-1.892a2.474 2.474 0 0 1-1.53-3.692c.532-.872-.466-1.87-1.338-1.339-1.43.872-3.296.1-3.692-1.529M12 9.75a2.25 2.25 0 1 0 0 4.5 2.25 2.25 0 0 0 0-4.5M8.25 12a3.75 3.75 0 1 1 7.5 0 3.75 3.75 0 0 1-7.5 0\" fill=\"#000\" fill-rule=\"evenodd\" clip-rule=\"evenodd\"/></svg>",
};
pub const SPLIT_VIEW: IconDef = IconDef {
name: "SplitViewIcon",
svg: "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"none\"><path d=\"M19.25 6c0-.69-.56-1.25-1.25-1.25h-5.25v14.5H18c.69 0 1.25-.56 1.25-1.25zM4.75 18c0 .69.56 1.25 1.25 1.25h5.25V4.75H6c-.69 0-1.25.56-1.25 1.25zm16 0A2.75 2.75 0 0 1 18 20.75H6A2.75 2.75 0 0 1 3.25 18V6A2.75 2.75 0 0 1 6 3.25h12A2.75 2.75 0 0 1 20.75 6z\" fill=\"#000\" fill-rule=\"nonzero\" clip-rule=\"nonzero\"/></svg>",
};
pub const EXPAND_FULL: IconDef = IconDef {
name: "ExpandFullIcon",
svg: "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"none\"><path d=\"M15.25 4a.75.75 0 0 1 .75-.75h4a.75.75 0 0 1 .75.75v4a.75.75 0 0 1-1.5 0V5.81l-4.22 4.22a.75.75 0 1 1-1.06-1.06l4.22-4.22H16a.75.75 0 0 1-.75-.75m-5.22 9.97a.75.75 0 0 1 0 1.06l-4.22 4.22H8a.75.75 0 0 1 0 1.5H4a.75.75 0 0 1-.75-.75v-4a.75.75 0 0 1 1.5 0v2.19l4.22-4.22a.75.75 0 0 1 1.06 0\" fill=\"#000\" fill-rule=\"evenodd\" clip-rule=\"evenodd\"/></svg>",
};
pub const HOME: IconDef = IconDef {
name: "HomeIcon",
svg: "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"none\"><path d=\"M19.5 19.5v-9.022a.5.5 0 0 0-.193-.394l-7-5.445a.5.5 0 0 0-.614 0l-7 5.445a.5.5 0 0 0-.193.394V19.5a.5.5 0 0 0 .5.5h14a.5.5 0 0 0 .5-.5M3.772 8.9A2 2 0 0 0 3 10.477V19.5a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-9.022a2 2 0 0 0-.772-1.579l-7-5.444a2 2 0 0 0-2.456 0z\" fill=\"#000\" fill-rule=\"evenodd\" clip-rule=\"evenodd\"/></svg>",
};
pub const ALL_DOCS: IconDef = IconDef {
name: "AllDocsIcon",
svg: "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"none\"><path d=\"M10.167 3.25c-.783 0-1.417.634-1.417 1.417V15.5c0 .782.634 1.417 1.417 1.417h8.666c.783 0 1.417-.635 1.417-1.417V8.125h-2.5a1.833 1.833 0 0 1-1.833-1.833V3.25zm7.25 1.223 1.913 2.152h-1.58a.333.333 0 0 1-.333-.333zM7.25 4.667a2.917 2.917 0 0 1 2.917-2.917h6.5a.75.75 0 0 1 .56.252l4.334 4.875a.75.75 0 0 1 .189.498V15.5a2.917 2.917 0 0 1-2.917 2.917H16.75v.916a2.917 2.917 0 0 1-2.917 2.917H5.708a3.46 3.46 0 0 1-3.458-3.458V8.5a2.917 2.917 0 0 1 2.917-2.917H7.25zm0 2.416H5.167c-.783 0-1.417.635-1.417 1.417v10.292c0 1.081.877 1.958 1.958 1.958h8.125c.783 0 1.417-.634 1.417-1.417v-.916h-5.083A2.917 2.917 0 0 1 7.25 15.5zm4.333-.25a.75.75 0 0 1 .75-.75h1.409a.75.75 0 0 1 0 1.5h-1.409a.75.75 0 0 1-.75-.75m0 3.25a.75.75 0 0 1 .75-.75h4.334a.75.75 0 0 1 0 1.5h-4.334a.75.75 0 0 1-.75-.75m0 3.25a.75.75 0 0 1 .75-.75h3.25a.75.75 0 0 1 0 1.5h-3.25a.75.75 0 0 1-.75-.75\" fill=\"#000\" fill-rule=\"evenodd\" clip-rule=\"evenodd\"/></svg>",
};
pub const ALL_ICONS: &[IconDef] = &[
ADD_TEXT,
ALL_DOCS,
ARROW_DOWN_BIG_BOTTOM,
ARROW_DOWN_BIG,
ARROW_DOWN_SMALL,
ARROW_LEFT_SMALL,
ARROW_RIGHT_SMALL,
ARROW_UP_BIG,
ARROW_UP_BIG_TOP,
ATTACHMENT,
@@ -425,6 +503,7 @@ pub const ALL_ICONS: &[IconDef] = &[
CHECKBOX_CHECKED_LINEAR,
CHECKBOX_CHECKED_SOLID,
CHECKBOX_UNCHECKED,
CLOSE,
CODE_BLOCK,
INLINE_CODE,
COLLAPSE,
@@ -441,7 +520,11 @@ pub const ALL_ICONS: &[IconDef] = &[
DRAG_HANDLE,
DUPLICATE,
EDGELESS,
EXPAND_FULL,
EXPAND,
FAVORITE,
FAVORITED,
FOLDER,
FRAME,
HAND,
HEADING_1,
@@ -450,6 +533,7 @@ pub const ALL_ICONS: &[IconDef] = &[
HEADING_4,
HEADING_5,
HEADING_6,
HOME,
IMAGE,
INFORMATION,
INVISIBLE,
@@ -474,17 +558,23 @@ pub const ALL_ICONS: &[IconDef] = &[
ROUNDED_RECTANGLE,
SEARCH,
SELECT,
SETTINGS,
SHAPE,
SIDEBAR,
SPLIT_VIEW,
SQUARE,
STRIKETHROUGH,
TAG,
TEX,
TEXT,
TODAY,
TOGGLE_DOWN,
TOGGLE_RIGHT,
TRIANGLE,
UNDERLINE,
UNDO,
UNLOCK,
VIEW_LAYERS,
WARNING,
WRAP,
ZOOM_OUT,
@@ -524,6 +614,16 @@ mod tests {
assert_eq!(icon_by_name("MoveLeftIcon"), Some(&MOVE_LEFT));
assert_eq!(icon_by_name("MoveRightIcon"), Some(&MOVE_RIGHT));
assert_eq!(icon_by_name("InvisibleIcon"), Some(&INVISIBLE));
assert_eq!(icon_by_name("ArrowLeftSmallIcon"), Some(&ARROW_LEFT_SMALL));
assert_eq!(icon_by_name("ArrowRightSmallIcon"), Some(&ARROW_RIGHT_SMALL));
assert_eq!(icon_by_name("AllDocsIcon"), Some(&ALL_DOCS));
assert_eq!(icon_by_name("FavoriteIcon"), Some(&FAVORITE));
assert_eq!(icon_by_name("FavoritedIcon"), Some(&FAVORITED));
assert_eq!(icon_by_name("FolderIcon"), Some(&FOLDER));
assert_eq!(icon_by_name("HomeIcon"), Some(&HOME));
assert_eq!(icon_by_name("SettingsIcon"), Some(&SETTINGS));
assert_eq!(icon_by_name("SidebarIcon"), Some(&SIDEBAR));
assert_eq!(icon_by_name("TodayIcon"), Some(&TODAY));
}
#[test]