#1 PDF Application on GitHub that lets you edit PDFs on any device anywhere
TypeScript dockerhacktoberfestjavapdfpdf-converterpdf-editorpdf-manipulationpdf-mergerpdf-ocrpdf-toolspdf-web-appspdfmergerself-hosted
Render the viewer and annotation surfaces through <Icon> (#7897)
EthanHealy01394c30adbed0
diff --git a/frontend/editor/src/core/components/annotation/shared/ColorControl.tsx b/frontend/editor/src/core/components/annotation/shared/ColorControl.tsxindex 524314ee62..7cced260cd 100644--- a/frontend/editor/src/core/components/annotation/shared/ColorControl.tsx+++ b/frontend/editor/src/core/components/annotation/shared/ColorControl.tsx@@ -8,7 +8,7 @@ import {} from "@mantine/core";import { useState, useCallback, useEffect } from "react";import { useTranslation } from "react-i18next";-import ColorizeIcon from "@mui/icons-material/Colorize";+import { Icon } from "@app/ui/Icon";import { ActionIcon } from "@app/ui/ActionIcon";// safari and firefox do not support the eye dropper API, only edge, chrome and opera do.@@ -114,7 +114,7 @@ export function ColorControl({size="sm"onClick={handleEyeDropper}>- <ColorizeIcon style={{ fontSize: 16 }} />+ <Icon name="pipette" size={16} /></ActionIcon></Tooltip></Group>diff --git a/frontend/editor/src/core/components/annotation/shared/DrawingControls.tsx b/frontend/editor/src/core/components/annotation/shared/DrawingControls.tsxindex 0844125117..5cfa0e3c61 100644--- a/frontend/editor/src/core/components/annotation/shared/DrawingControls.tsx+++ b/frontend/editor/src/core/components/annotation/shared/DrawingControls.tsx@@ -1,7 +1,7 @@import React from "react";import { Group, Tooltip } from "@mantine/core";import { useTranslation } from "react-i18next";-import { LocalIcon } from "@app/components/shared/LocalIcon";+import { Icon } from "@app/ui/Icon";import { Button } from "@app/ui/Button";import { ActionIcon } from "@app/ui/ActionIcon";@@ -45,12 +45,7 @@ export const DrawingControls: React.FC<DrawingControlsProps> = ({onClick={onUndo}disabled={undoDisabled}>- <LocalIcon- icon="undo"- width={20}- height={20}- style={{ color: "currentColor" }}- />+ <Icon name="undo-2" size={20} style={{ color: "currentColor" }} /></ActionIcon></Tooltip>)}@@ -63,12 +58,7 @@ export const DrawingControls: React.FC<DrawingControlsProps> = ({onClick={onRedo}disabled={redoDisabled}>- <LocalIcon- icon="redo"- width={20}- height={20}- style={{ color: "currentColor" }}- />+ <Icon name="redo-2" size={20} style={{ color: "currentColor" }} /></ActionIcon></Tooltip>)}diff --git a/frontend/editor/src/core/components/annotation/shared/OpacityControl.tsx b/frontend/editor/src/core/components/annotation/shared/OpacityControl.tsxindex 3853fa32c2..dc710751f1 100644--- a/frontend/editor/src/core/components/annotation/shared/OpacityControl.tsx+++ b/frontend/editor/src/core/components/annotation/shared/OpacityControl.tsx@@ -1,7 +1,7 @@import { Tooltip, Popover, Stack, Slider, Text } from "@mantine/core";import { useTranslation } from "react-i18next";import { useState } from "react";-import OpacityIcon from "@mui/icons-material/Opacity";+import { Icon } from "@app/ui/Icon";import { ActionIcon } from "@app/ui/ActionIcon";interface OpacityControlProps {@@ -30,7 +30,7 @@ export function OpacityControl({onClick={() => setOpened(!opened)}disabled={disabled}>- <OpacityIcon style={{ fontSize: 18 }} />+ <Icon name="droplet" size={18} /></ActionIcon></Tooltip></Popover.Target>diff --git a/frontend/editor/src/core/components/annotation/shared/PropertiesPopover.tsx b/frontend/editor/src/core/components/annotation/shared/PropertiesPopover.tsxindex 2f2a42b982..ead203adc1 100644--- a/frontend/editor/src/core/components/annotation/shared/PropertiesPopover.tsx+++ b/frontend/editor/src/core/components/annotation/shared/PropertiesPopover.tsx@@ -6,11 +6,7 @@ import { useState } from "react";import type { TrackedAnnotation } from "@embedpdf/plugin-annotation";import type { PdfAnnotationObject } from "@embedpdf/models";import type { AnnotationPatch } from "@app/components/viewer/viewerTypes";-import TuneIcon from "@mui/icons-material/Tune";-import FormatAlignLeftIcon from "@mui/icons-material/FormatAlignLeft";-import FormatAlignCenterIcon from "@mui/icons-material/FormatAlignCenter";-import FormatAlignRightIcon from "@mui/icons-material/FormatAlignRight";-+import { Icon } from "@app/ui/Icon";export type PropertiesAnnotationType = "text" | "note" | "shape";interface PropertiesPopoverProps {@@ -104,7 +100,7 @@ export function PropertiesPopover({onClick={() => onUpdate({ textAlign: 0 })}size="md">- <FormatAlignLeftIcon style={{ fontSize: 18 }} />+ <Icon name="text-align-start" size={18} /></ActionIcon><ActionIconaria-label={t("annotation.alignCenter", "Align center")}@@ -112,7 +108,7 @@ export function PropertiesPopover({onClick={() => onUpdate({ textAlign: 1 })}size="md">- <FormatAlignCenterIcon style={{ fontSize: 18 }} />+ <Icon name="text-align-center" size={18} /></ActionIcon><ActionIconaria-label={t("annotation.alignRight", "Align right")}@@ -120,7 +116,7 @@ export function PropertiesPopover({onClick={() => onUpdate({ textAlign: 2 })}size="md">- <FormatAlignRightIcon style={{ fontSize: 18 }} />+ <Icon name="text-align-end" size={18} /></ActionIcon></Group></div>@@ -204,7 +200,7 @@ export function PropertiesPopover({onClick={() => setOpened(!opened)}disabled={disabled}>- <TuneIcon style={{ fontSize: 18 }} />+ <Icon name="sliders-horizontal" size={18} /></ActionIcon></Tooltip></Popover.Target>diff --git a/frontend/editor/src/core/components/annotation/shared/WidthControl.tsx b/frontend/editor/src/core/components/annotation/shared/WidthControl.tsxindex b7e9d28531..c860c2fda8 100644--- a/frontend/editor/src/core/components/annotation/shared/WidthControl.tsx+++ b/frontend/editor/src/core/components/annotation/shared/WidthControl.tsx@@ -1,7 +1,7 @@import { Tooltip, Popover, Stack, Slider, Text } from "@mantine/core";import { useTranslation } from "react-i18next";import { useState } from "react";-import LineWeightIcon from "@mui/icons-material/LineWeight";+import { Icon } from "@app/ui/Icon";import { ActionIcon } from "@app/ui/ActionIcon";interface WidthControlProps {@@ -34,7 +34,7 @@ export function WidthControl({onClick={() => setOpened(!opened)}disabled={disabled}>- <LineWeightIcon style={{ fontSize: 18 }} />+ <Icon name="line-weight" size={18} /></ActionIcon></Tooltip></Popover.Target>diff --git a/frontend/editor/src/core/components/viewer/AnnotationMenuButtons.tsx b/frontend/editor/src/core/components/viewer/AnnotationMenuButtons.tsxindex 1ca0652483..cb0a958f6f 100644--- a/frontend/editor/src/core/components/viewer/AnnotationMenuButtons.tsx+++ b/frontend/editor/src/core/components/viewer/AnnotationMenuButtons.tsx@@ -1,12 +1,7 @@import { Tooltip, Popover, TextInput, Stack } from "@mantine/core";import { useState } from "react";import { useTranslation } from "react-i18next";-import DeleteIcon from "@mui/icons-material/Delete";-import EditIcon from "@mui/icons-material/Edit";-import CommentIcon from "@mui/icons-material/ChatBubbleOutlineRounded";-import AddCommentIcon from "@mui/icons-material/AddCommentOutlined";-import OpenInNewIcon from "@mui/icons-material/OpenInNewRounded";-import LocalIcon from "@app/components/shared/LocalIcon";+import { Icon } from "@app/ui/Icon";import { Button } from "@app/ui/Button";import { ActionIcon } from "@app/ui/ActionIcon";import type { FirstLinkTarget } from "@app/components/viewer/useAnnotationMenuHandlers";@@ -22,7 +17,7 @@ export function DeleteButton({ onDelete }: { onDelete: () => void }) {size="md"onClick={onDelete}>- <DeleteIcon style={{ fontSize: 18 }} />+ <Icon name="trash" size={18} /></ActionIcon></Tooltip>);@@ -39,7 +34,7 @@ export function EditTextButton({ onEdit }: { onEdit: () => void }) {size="md"onClick={onEdit}>- <EditIcon style={{ fontSize: 18 }} />+ <Icon name="pencil" size={18} /></ActionIcon></Tooltip>);@@ -69,7 +64,7 @@ export function AttachCommentButton({size="md"onClick={isInSidebar ? onView : onAdd}>- <AddCommentIcon style={{ fontSize: 18 }} />+ <Icon name="message-square-plus" size={18} /></ActionIcon></Tooltip>);@@ -94,7 +89,7 @@ export function CommentButton({ hasContent, onClick }: CommentButtonProps) {size="md"onClick={onClick}>- <CommentIcon style={{ fontSize: 18 }} />+ <Icon name="message-square" size={18} /></ActionIcon></Tooltip>);@@ -125,7 +120,7 @@ export function LinkButton({size="md"onClick={onGoToLink}>- <OpenInNewIcon style={{ fontSize: 18 }} />+ <Icon name="external-link" size={18} /></ActionIcon></Tooltip>);@@ -142,7 +137,7 @@ export function LinkButton({size="md"onClick={() => setOpen((o) => !o)}>- <LocalIcon icon="link" width="1.25rem" height="1.25rem" />+ <Icon name="link" size="1.25rem" /></ActionIcon></Tooltip></Popover.Target>diff --git a/frontend/editor/src/core/components/viewer/AttachmentSidebar.tsx b/frontend/editor/src/core/components/viewer/AttachmentSidebar.tsxindex 90683fe13e..23a72a0b07 100644--- a/frontend/editor/src/core/components/viewer/AttachmentSidebar.tsx+++ b/frontend/editor/src/core/components/viewer/AttachmentSidebar.tsx@@ -7,7 +7,7 @@ import {type ReactElement,} from "react";import { Text, Loader, Stack } from "@mantine/core";-import LocalIcon from "@app/components/shared/LocalIcon";+import { Icon } from "@app/ui/Icon";import { Button } from "@app/ui/Button";import { ActionIcon } from "@app/ui/ActionIcon";import { useViewer } from "@app/contexts/ViewerContext";@@ -15,10 +15,6 @@ import { useAllFiles, useFileManagement } from "@app/contexts/FileContext";import { createQuickKey, isStirlingFile } from "@app/types/fileContext";import { useToolWorkflow } from "@app/contexts/ToolWorkflowContext";import { PdfAttachmentObject } from "@embedpdf/models";-import AttachmentIcon from "@mui/icons-material/AttachmentRounded";-import CollectionsIcon from "@mui/icons-material/CollectionsBookmarkRounded";-import DownloadIcon from "@mui/icons-material/DownloadRounded";-import ImportIcon from "@mui/icons-material/LibraryAddRounded";import { useTranslation } from "react-i18next";import { SidebarBase } from "@app/components/viewer/SidebarBase";import { detectNonPdfFileType, isPdfFile } from "@app/utils/fileUtils";@@ -45,70 +41,20 @@ export interface PortfolioView {activeMemberName: string | null;}-// Literal LocalIcon elements per member type. Kept as JSX literals (not dynamic-// icon strings) so the icon-bundling scanner picks them up. Keyed by the type-// resolved in memberIconKey below.+// Keyed by the type resolved in memberIconKey below. Literal names rather than a+// computed one: that is what lets icon-lint and IconName check them.const MEMBER_ICON_STYLE = {flexShrink: 0,color: "var(--icon-files-color)",} as const;const MEMBER_ICONS: Record<string, ReactElement> = {- pdf: (- <LocalIcon- icon="picture-as-pdf-rounded"- width="1.4rem"- height="1.4rem"- style={MEMBER_ICON_STYLE}- />- ),- image: (- <LocalIcon- icon="image-rounded"- width="1.4rem"- height="1.4rem"- style={MEMBER_ICON_STYLE}- />- ),- sheet: (- <LocalIcon- icon="dataset-rounded"- width="1.4rem"- height="1.4rem"- style={MEMBER_ICON_STYLE}- />- ),- data: (- <LocalIcon- icon="data-object-rounded"- width="1.4rem"- height="1.4rem"- style={MEMBER_ICON_STYLE}- />- ),- text: (- <LocalIcon- icon="description-rounded"- width="1.4rem"- height="1.4rem"- style={MEMBER_ICON_STYLE}- />- ),- archive: (- <LocalIcon- icon="folder-zip-rounded"- width="1.4rem"- height="1.4rem"- style={MEMBER_ICON_STYLE}- />- ),- default: (- <LocalIcon- icon="draft-rounded"- width="1.4rem"- height="1.4rem"- style={MEMBER_ICON_STYLE}- />- ),+ pdf: <Icon name="file-pdf" size="1.4rem" style={MEMBER_ICON_STYLE} />,+ image: <Icon name="image" size="1.4rem" style={MEMBER_ICON_STYLE} />,+ sheet: <Icon name="table" size="1.4rem" style={MEMBER_ICON_STYLE} />,+ data: <Icon name="braces" size="1.4rem" style={MEMBER_ICON_STYLE} />,+ text: <Icon name="file-text" size="1.4rem" style={MEMBER_ICON_STYLE} />,+ archive: <Icon name="package" size="1.4rem" style={MEMBER_ICON_STYLE} />,+ default: <Icon name="file" size="1.4rem" style={MEMBER_ICON_STYLE} />,};const memberExtension = (attachment: PdfAttachmentObject): string => {@@ -727,7 +673,7 @@ export const AttachmentSidebar = ({void importMember(attachment);}}>- <ImportIcon sx={{ fontSize: "1.2rem" }} />+ <Icon name="import" size={"1.2rem"} /></ActionIcon>)}<ActionIcon@@ -741,7 +687,7 @@ export const AttachmentSidebar = ({title={t("viewer.attachments.download", "Download")}onClick={(event) => handleDownload(attachment, event)}>- <DownloadIcon sx={{ fontSize: "1.2rem" }} />+ <Icon name="download" size={"1.2rem"} /></ActionIcon></>)}@@ -794,7 +740,7 @@ export const AttachmentSidebar = ({? t("viewer.portfolio.title", "Portfolio"): t("viewer.attachments.title", "Attachments")}- icon={isPortfolio ? <CollectionsIcon /> : <AttachmentIcon />}+ icon={isPortfolio ? <Icon name="library" /> : <Icon name="paperclip" />}rightOffset={`${(thumbnailVisible ? 15 : 0) + (bookmarkVisible ? 15 : 0)}rem`}visible={visible}onClose={toggleAttachmentSidebar}@@ -853,7 +799,7 @@ export const AttachmentSidebar = ({aria-label={t("viewer.attachments.retry", "Retry")}onClick={requestReload}>- <LocalIcon icon="refresh" />+ <Icon name="refresh-cw" size="1em" /></ActionIcon></Stack>)}@@ -878,10 +824,9 @@ export const AttachmentSidebar = ({{showEmptyState && (<Stack align="center" gap="sm" py="lg">- <LocalIcon- icon="attachment-rounded"- width="2rem"- height="2rem"+ <Icon+ name="paperclip"+ size="2rem"style={{ color: "var(--mantine-color-dimmed)" }}/><Text size="sm" c="dimmed" ta="center">@@ -891,7 +836,7 @@ export const AttachmentSidebar = ({variant="tertiary"size="sm"onClick={handleAddAttachment}- leftSection={<LocalIcon icon="add" width="1rem" height="1rem" />}+ leftSection={<Icon name="plus" size="1rem" />}>{t("viewer.attachments.addAttachment", "Add attachment")}</Button>@@ -915,9 +860,7 @@ export const AttachmentSidebar = ({fullWidthjustify="start"onClick={handleAddAttachment}- leftSection={- <LocalIcon icon="add" width="0.9rem" height="0.9rem" />- }+ leftSection={<Icon name="plus" size="0.9rem" />}style={{ marginBottom: "var(--space-xs)" }}>{isPortfoliodiff --git a/frontend/editor/src/core/components/viewer/BookmarkSidebar.tsx b/frontend/editor/src/core/components/viewer/BookmarkSidebar.tsxindex 5b98926e27..8bce59de4e 100644--- a/frontend/editor/src/core/components/viewer/BookmarkSidebar.tsx+++ b/frontend/editor/src/core/components/viewer/BookmarkSidebar.tsx@@ -8,7 +8,6 @@ import {NumberInput,Group,} from "@mantine/core";-import LocalIcon from "@app/components/shared/LocalIcon";import { Button } from "@app/ui/Button";import { ActionIcon } from "@app/ui/ActionIcon";import { useViewer } from "@app/contexts/ViewerContext";@@ -21,7 +20,7 @@ import { openExternalTab } from "@app/platform/openExternalTab";import { getExternalHref } from "@app/utils/externalUrl";import { PdfBookmarkObject, PdfActionType } from "@embedpdf/models";import { useTranslation } from "react-i18next";-import BookmarksIcon from "@mui/icons-material/BookmarksRounded";+import { Icon } from "@app/ui/Icon";import { SidebarBase } from "@app/components/viewer/SidebarBase";import "@app/components/viewer/BookmarkSidebar.css";@@ -620,12 +619,9 @@ export const BookmarkSidebar = ({toggleNode(node.id);}}>- <LocalIcon- icon={- isNodeExpanded ? "keyboard-arrow-up" : "keyboard-arrow-down"- }- width="1rem"- height="1rem"+ <Icon+ name={isNodeExpanded ? "chevron-up" : "chevron-down"}+ size="1rem"/></ActionIcon>) : (@@ -685,7 +681,7 @@ export const BookmarkSidebar = ({aria-label={t("viewer.bookmarks.expandAll", "Expand all bookmarks")}title={t("viewer.bookmarks.expandAll", "Expand all bookmarks")}>- <LocalIcon icon="unfold-more" width="1.1rem" height="1.1rem" />+ <Icon name="chevrons-up-down" size="1.1rem" /></ActionIcon>) : (<ActionIcon@@ -698,7 +694,7 @@ export const BookmarkSidebar = ({)}title={t("viewer.bookmarks.collapseAll", "Collapse all bookmarks")}>- <LocalIcon icon="unfold-less" width="1.1rem" height="1.1rem" />+ <Icon name="chevrons-down-up" size="1.1rem" /></ActionIcon>)}</>@@ -708,7 +704,7 @@ export const BookmarkSidebar = ({<SidebarBaseclassName="bookmark-sidebar"title={t("viewer.bookmarks.title", "Bookmarks")}- icon={<BookmarksIcon />}+ icon={<Icon name="bookmark" />}rightOffset={`${thumbnailVisible ? 15 : 0}rem`}visible={visible}onClose={toggleBookmarkSidebar}@@ -756,10 +752,9 @@ export const BookmarkSidebar = ({)}{showEmptyState && !isAddingBookmark && (<Stack align="center" gap="sm" py="lg">- <LocalIcon- icon="bookmark-add-rounded"- width="2rem"- height="2rem"+ <Icon+ name="bookmark-plus"+ size="2rem"style={{ color: "var(--mantine-color-dimmed)" }}/><Text size="sm" c="dimmed" ta="center">@@ -769,7 +764,7 @@ export const BookmarkSidebar = ({variant="tertiary"size="sm"onClick={handleOpenAddBookmark}- leftSection={<LocalIcon icon="add" width="1rem" height="1rem" />}+ leftSection={<Icon name="plus" size="1rem" />}>{t("viewer.bookmarks.addBookmark", "Add bookmark")}</Button>@@ -850,9 +845,7 @@ export const BookmarkSidebar = ({fullWidthjustify="start"onClick={handleOpenAddBookmark}- leftSection={- <LocalIcon icon="add" width="0.9rem" height="0.9rem" />- }+ leftSection={<Icon name="plus" size="0.9rem" />}style={{ marginBottom: "var(--space-xs)" }}>{t("viewer.bookmarks.addBookmark", "Add bookmark")}@@ -891,10 +884,9 @@ export const BookmarkSidebar = ({style={{ width: "100%" }}><Group gap="xs" justify="center" wrap="nowrap">- <LocalIcon- icon="bookmark-add-rounded"- width="0.95rem"- height="0.95rem"+ <Icon+ name="bookmark-plus"+ size="0.95rem"style={{ color: "var(--c-accent-text)" }}/><Textdiff --git a/frontend/editor/src/core/components/viewer/CommentsSidebar.tsx b/frontend/editor/src/core/components/viewer/CommentsSidebar.tsxindex 7a9eeb3bcb..9b4b3b2d20 100644--- a/frontend/editor/src/core/components/viewer/CommentsSidebar.tsx+++ b/frontend/editor/src/core/components/viewer/CommentsSidebar.tsx@@ -13,11 +13,7 @@ import {import { useTranslation } from "react-i18next";import { Button } from "@app/ui/Button";import { ActionIcon } from "@app/ui/ActionIcon";-import DeleteIcon from "@mui/icons-material/Delete";-import CheckIcon from "@mui/icons-material/CheckRounded";-import MoreHorizIcon from "@mui/icons-material/MoreHoriz";-import EditIcon from "@mui/icons-material/Edit";-import VisibilityIcon from "@mui/icons-material/Visibility";+import { Icon, type IconName } from "@app/ui/Icon";import { useAnnotation } from "@embedpdf/plugin-annotation/react";import {getSidebarAnnotationsWithRepliesGroupedByPage,@@ -34,7 +30,6 @@ import { useCommentAuthor } from "@app/contexts/CommentAuthorContext";import { useViewer } from "@app/contexts/ViewerContext";import { useToolWorkflow } from "@app/contexts/ToolWorkflowContext";import { useAnnotation as useAnnotationContext } from "@app/contexts/AnnotationContext";-import LocalIcon from "@app/components/shared/LocalIcon";import { compareEntriesByVisualOrder } from "@app/components/viewer/commentsSidebarOrder";import { SidebarBase } from "@app/components/viewer/SidebarBase";@@ -146,44 +141,44 @@ function isReplyAuthoredByCurrentUser(return resolvedStored === resolvedMine;}-// Map toolId → LocalIcon icon name (matches AnnotationPanel icon definitions)-const TOOL_ICON_MAP: Record<string, string> = {- highlight: "highlight",- underline: "format-underlined",- strikeout: "strikethrough-s",- squiggly: "show-chart",- ink: "edit",+// Map toolId → registry icon name (matches AnnotationPanel icon definitions)+const TOOL_ICON_MAP: Record<string, IconName> = {+ highlight: "highlighter",+ underline: "underline",+ strikeout: "strikethrough",+ squiggly: "polyline",+ ink: "pencil",inkHighlighter: "brush",- square: "crop-square-outline",- circle: "radio-button-unchecked",- line: "show-chart",- lineArrow: "show-chart",- polyline: "show-chart",- polygon: "change-history",- text: "text-fields",- note: "sticky-note-2",- stamp: "add-photo-alternate",- textComment: "comment",- insertText: "add-comment",- replaceText: "find-replace",+ square: "square",+ circle: "circle",+ line: "polyline",+ lineArrow: "polyline",+ polyline: "polyline",+ polygon: "triangle",+ text: "type",+ note: "sticky-note",+ stamp: "image-plus",+ textComment: "message-square",+ insertText: "message-square-plus",+ replaceText: "replace",};// Type-based fallback icon when no toolId is present-function getIconByType(type: number | undefined): string {- if (type === 1) return "comment";- if (type === 3) return "sticky-note-2";- if (type === 4 || type === 8) return "show-chart";- if (type === 5) return "crop-square-outline";- if (type === 6) return "radio-button-unchecked";- if (type === 7 || type === 8) return "change-history";- if (type === 9) return "highlight";- if (type === 10) return "format-underlined";- if (type === 11) return "show-chart";- if (type === 12) return "strikethrough-s";- if (type === 13) return "add-photo-alternate";- if (type === 14) return "add-comment";- if (type === 15) return "edit";- return "comment";+function getIconByType(type: number | undefined): IconName {+ if (type === 1) return "message-square";+ if (type === 3) return "sticky-note";+ if (type === 4 || type === 8) return "polyline";+ if (type === 5) return "square";+ if (type === 6) return "circle";+ if (type === 7 || type === 8) return "triangle";+ if (type === 9) return "highlighter";+ if (type === 10) return "underline";+ if (type === 11) return "polyline";+ if (type === 12) return "strikethrough";+ if (type === 13) return "image-plus";+ if (type === 14) return "message-square-plus";+ if (type === 15) return "pencil";+ return "message-square";}function isCommentAnnotation(ann: PdfAnnotationObject): boolean {const customData = getStirlingAnnotationMetadata(ann).customData;@@ -284,10 +279,9 @@ function AnnotationTypeIcon({ ann }: { ann: PdfAnnotationObject }) {const toolId = getAnnotationToolId(ann);const iconName = TOOL_ICON_MAP[toolId] ?? getIconByType(ann?.type);return (- <LocalIcon- icon={iconName}- width="1.25rem"- height="1.25rem"+ <Icon+ name={iconName}+ size="1.25rem"style={{ flexShrink: 0, color: "var(--c-accent-text)" }}/>);@@ -722,7 +716,7 @@ export function CommentsSidebar({aria-label={t("viewer.comments.addComment", "Add comment")}onClick={handleAddComment}>- <LocalIcon icon="add" width="1.25rem" height="1.25rem" />+ <Icon name="plus" size="1.25rem" /></ActionIcon></Tooltip><Menu position="bottom-end" withArrow>@@ -734,13 +728,13 @@ export function CommentsSidebar({size="sm"aria-label={t("viewer.comments.moreActions", "More actions")}>- <MoreHorizIcon style={{ fontSize: 20 }} />+ <Icon name="ellipsis" size={20} /></ActionIcon></Tooltip></Menu.Target><Menu.Dropdown><Menu.Item- leftSection={<DeleteIcon style={{ fontSize: 18 }} />}+ leftSection={<Icon name="trash" size={18} />}color="red"onClick={() => setClearAllModalOpen(true)}>@@ -756,7 +750,7 @@ export function CommentsSidebar({<SidebarBaseclassName="comments-sidebar"title={t("viewer.comments.title", "Comments")}- icon={<LocalIcon icon="comment" width="1.1rem" height="1.1rem" />}+ icon={<Icon name="message-square" size="1.1rem" />}rightOffset={rightOffset}visible={visible}onClose={toggleCommentsSidebar}@@ -772,10 +766,9 @@ export function CommentsSidebar({>{totalCount === 0 ? (<Stack align="center" gap="sm" py="lg">- <LocalIcon- icon="comment"- width="2rem"- height="2rem"+ <Icon+ name="message-square"+ size="2rem"style={{ color: "var(--mantine-color-dimmed)" }}/><Text size="sm" c="dimmed" ta="center">@@ -790,13 +783,7 @@ export function CommentsSidebar({accent="warning"size="sm"onClick={handleCancelPlacingComment}- leftSection={- <LocalIcon- icon="touch-app-rounded"- width="1rem"- height="1rem"- />- }+ leftSection={<Icon name="pointer" size="1rem" />}>{t("viewer.comments.placingHint",@@ -808,9 +795,7 @@ export function CommentsSidebar({variant="tertiary"size="sm"onClick={handleAddComment}- leftSection={- <LocalIcon icon="add" width="1rem" height="1rem" />- }+ leftSection={<Icon name="plus" size="1rem" />}>{t("viewer.comments.addComment", "Add comment")}</Button>@@ -826,13 +811,7 @@ export function CommentsSidebar({fullWidthjustify="start"onClick={handleCancelPlacingComment}- leftSection={- <LocalIcon- icon="touch-app-rounded"- width="0.9rem"- height="0.9rem"- />- }+ leftSection={<Icon name="pointer" size="0.9rem" />}style={{ paddingInline: 6 }}>{t(@@ -847,9 +826,7 @@ export function CommentsSidebar({fullWidthjustify="start"onClick={handleAddComment}- leftSection={- <LocalIcon icon="add" width="0.9rem" height="0.9rem" />- }+ leftSection={<Icon name="plus" size="0.9rem" />}style={{paddingInline: 6,marginBottom: "var(--space-xs)",@@ -970,7 +947,7 @@ export function CommentsSidebar({handleLocateAnnotation(pageIndex, ann)}>- <VisibilityIcon style={{ fontSize: 16 }} />+ <Icon name="eye" size={16} /></ActionIcon></Tooltip><Menu position="bottom-end" withArrow>@@ -990,16 +967,14 @@ export function CommentsSidebar({"More actions",)}>- <MoreHorizIcon- style={{ fontSize: 20 }}- />+ <Icon name="ellipsis" size={20} /></ActionIcon></Tooltip></Menu.Target><Menu.Dropdown><Menu.ItemleftSection={- <EditIcon style={{ fontSize: 18 }} />+ <Icon name="pencil" size={18} />}onClick={() => setEditingMainKey(key)}>@@ -1007,7 +982,7 @@ export function CommentsSidebar({</Menu.Item><Menu.ItemleftSection={- <DeleteIcon style={{ fontSize: 18 }} />+ <Icon name="trash" size={18} />}color="red"onClick={() =>@@ -1070,7 +1045,7 @@ export function CommentsSidebar({}}disabled={!(draft ?? "").trim()}>- <CheckIcon style={{ fontSize: 18 }} />+ <Icon name="check" size={18} /></ActionIcon></Tooltip></Group>@@ -1226,10 +1201,9 @@ export function CommentsSidebar({!replyBody.trim()}>- <CheckIcon- style={{- fontSize: 18,- }}+ <Icon+ name="check"+ size={18}/></ActionIcon></Tooltip>@@ -1299,7 +1273,7 @@ export function CommentsSidebar({}disabled={!replyDraft.trim()}>- <CheckIcon style={{ fontSize: 20 }} />+ <Icon name="check" size={20} /></ActionIcon></Tooltip></Group>diff --git a/frontend/editor/src/core/components/viewer/EmbedPdfViewer.tsx b/frontend/editor/src/core/components/viewer/EmbedPdfViewer.tsxindex cd9985ee9d..f95da82024 100644--- a/frontend/editor/src/core/components/viewer/EmbedPdfViewer.tsx+++ b/frontend/editor/src/core/components/viewer/EmbedPdfViewer.tsx@@ -3,9 +3,7 @@ import { useTranslation } from "react-i18next";import { Box, Center, Text, Stack } from "@mantine/core";import { Button } from "@app/ui/Button";import { ActionIcon } from "@app/ui/ActionIcon";-import CloseIcon from "@mui/icons-material/Close";-import LockIcon from "@mui/icons-material/Lock";-+import { Icon } from "@app/ui/Icon";import {useAllFiles,useFileSelector,@@ -1174,7 +1172,7 @@ const EmbedPdfViewerContent = ({}}onClick={onClose}>- <CloseIcon />+ <Icon name="x" /></ActionIcon>)}@@ -1190,7 +1188,7 @@ const EmbedPdfViewerContent = ({) : isCurrentFileEncrypted ? (<Center style={{ flex: 1 }}><Stack align="center" gap="md">- <LockIcon style={{ fontSize: 48, opacity: 0.5 }} />+ <Icon name="lock" size={48} style={{ opacity: 0.5 }} /><Text fw={500}>{t("encryptedPdfUnlock.viewerLocked",diff --git a/frontend/editor/src/core/components/viewer/LayerSidebar.tsx b/frontend/editor/src/core/components/viewer/LayerSidebar.tsxindex 4f76d0eebc..95e30728a6 100644--- a/frontend/editor/src/core/components/viewer/LayerSidebar.tsx+++ b/frontend/editor/src/core/components/viewer/LayerSidebar.tsx@@ -1,9 +1,7 @@import { useState, useEffect, useCallback, useRef } from "react";import { Text, Checkbox, Stack, Loader, Tooltip } from "@mantine/core";-import LayersIcon from "@mui/icons-material/Layers";+import { Icon } from "@app/ui/Icon";import { ActionIcon } from "@app/ui/ActionIcon";-import VisibilityIcon from "@mui/icons-material/Visibility";-import VisibilityOffIcon from "@mui/icons-material/VisibilityOff";import { useTranslation } from "react-i18next";import { useViewer } from "@app/contexts/ViewerContext";import { SidebarBase } from "@app/components/viewer/SidebarBase";@@ -320,7 +318,7 @@ export function LayerSidebar({aria-label={t("viewer.layers.showAll", "Show all layers")}title={t("viewer.layers.showAll", "Show all layers")}>- <VisibilityIcon sx={{ fontSize: "1rem" }} />+ <Icon name="eye" size={"1rem"} /></ActionIcon><ActionIconvariant="tertiary"@@ -330,7 +328,7 @@ export function LayerSidebar({aria-label={t("viewer.layers.hideAll", "Hide all layers")}title={t("viewer.layers.hideAll", "Hide all layers")}>- <VisibilityOffIcon sx={{ fontSize: "1rem" }} />+ <Icon name="eye-off" size={"1rem"} /></ActionIcon></>)}@@ -341,7 +339,7 @@ export function LayerSidebar({<SidebarBaseclassName="layer-sidebar"title={t("viewer.layers.title", "Layers")}- icon={<LayersIcon fontSize="small" />}+ icon={<Icon name="layers" size={20} />}rightOffset={`${rightOffset}rem`}visible={visible}onClose={toggleLayerSidebar}diff --git a/frontend/editor/src/core/components/viewer/NonPdfViewer.tsx b/frontend/editor/src/core/components/viewer/NonPdfViewer.tsxindex 47d442ef3d..9b584e4e9e 100644--- a/frontend/editor/src/core/components/viewer/NonPdfViewer.tsx+++ b/frontend/editor/src/core/components/viewer/NonPdfViewer.tsx@@ -1,9 +1,7 @@import React, { useCallback, useMemo } from "react";import { Box, Center, Stack, Text } from "@mantine/core";import { Button } from "@app/ui/Button";-import ArticleIcon from "@mui/icons-material/Article";-import PictureAsPdfIcon from "@mui/icons-material/PictureAsPdf";-+import { Icon } from "@app/ui/Icon";import { useAllFiles } from "@app/contexts/FileContext";import { useViewer } from "@app/contexts/ViewerContext";import { useToolWorkflow } from "@app/contexts/ToolWorkflowContext";@@ -71,11 +69,10 @@ export function NonPdfViewer({ file }: NonPdfViewerProps) {return (<Center style={{ flex: 1 }}><Stack align="center" gap="sm">- <ArticleIcon- style={{- fontSize: "3rem",- color: "var(--mantine-color-gray-4)",- }}+ <Icon+ name="file-text"+ size={"3rem"}+ style={{ color: "var(--mantine-color-gray-4)" }}/><Text c="dimmed" size="sm">Preview not available for this file type@@ -84,7 +81,7 @@ export function NonPdfViewer({ file }: NonPdfViewerProps) {<Buttonvariant="secondary"accent="warning"- leftSection={<PictureAsPdfIcon />}+ leftSection={<Icon name="file-pdf" />}onClick={handleConvertToPdf}>Convert to PDFdiff --git a/frontend/editor/src/core/components/viewer/PdfViewerToolbar.tsx b/frontend/editor/src/core/components/viewer/PdfViewerToolbar.tsxindex a7aa1869cd..958c5f4ed6 100644--- a/frontend/editor/src/core/components/viewer/PdfViewerToolbar.tsx+++ b/frontend/editor/src/core/components/viewer/PdfViewerToolbar.tsx@@ -6,19 +6,7 @@ import { useIsPhone } from "@app/hooks/useIsMobile";import { Tooltip } from "@app/components/shared/Tooltip";import { ActionIcon } from "@app/ui/ActionIcon";import "@app/components/viewer/PdfViewerToolbar.css";-import FirstPageIcon from "@mui/icons-material/FirstPage";-import ArrowBackIosIcon from "@mui/icons-material/ArrowBackIos";-import ArrowForwardIosIcon from "@mui/icons-material/ArrowForwardIos";-import LastPageIcon from "@mui/icons-material/LastPage";-import DescriptionIcon from "@mui/icons-material/Description";-import ViewWeekIcon from "@mui/icons-material/ViewWeek";-import DarkModeIcon from "@mui/icons-material/DarkMode";-import WbSunnyIcon from "@mui/icons-material/WbSunny";-import WbTwilightIcon from "@mui/icons-material/WbTwilight";-import ZoomInIcon from "@mui/icons-material/ZoomIn";-import ZoomOutIcon from "@mui/icons-material/ZoomOut";-import MoreVertIcon from "@mui/icons-material/MoreVert";-+import { Icon } from "@app/ui/Icon";// Sizing constants for the page number inputconst MIN_PAGE_DIGITS = 2;const MIN_INPUT_WIDTH_PX = 48;@@ -174,7 +162,7 @@ export function PdfViewerToolbar({title={t("viewer.firstPage", "First Page")}aria-label={t("viewer.firstPage", "First Page")}>- <FirstPageIcon fontSize="small" />+ <Icon name="chevron-first" size={20} /></ActionIcon>)}@@ -188,7 +176,7 @@ export function PdfViewerToolbar({title={t("viewer.previousPage", "Previous Page")}aria-label={t("viewer.previousPage", "Previous Page")}>- <ArrowBackIosIcon fontSize="small" />+ <Icon name="chevron-left" size={20} /></ActionIcon>{/* Page Input */}@@ -231,7 +219,7 @@ export function PdfViewerToolbar({title={t("viewer.nextPage", "Next Page")}aria-label={t("viewer.nextPage", "Next Page")}>- <ArrowForwardIosIcon fontSize="small" />+ <Icon name="chevron-right" size={20} /></ActionIcon>{/* Last Page Button */}@@ -246,7 +234,7 @@ export function PdfViewerToolbar({title={t("viewer.lastPage", "Last Page")}aria-label={t("viewer.lastPage", "Last Page")}>- <LastPageIcon fontSize="small" />+ <Icon name="chevron-last" size={20} /></ActionIcon>)}@@ -275,9 +263,9 @@ export function PdfViewerToolbar({}>{isDualPageActive ? (- <DescriptionIcon fontSize="small" />+ <Icon name="file-text" size={20} />) : (- <ViewWeekIcon fontSize="small" />+ <Icon name="columns-3" size={20} />)}</ActionIcon></Tooltip>@@ -310,9 +298,11 @@ export function PdfViewerToolbar({: t("viewer.disableColorFilter", "Disable Color Filter")}>- {pdfRenderMode === "normal" && <DarkModeIcon fontSize="small" />}- {pdfRenderMode === "dark" && <WbTwilightIcon fontSize="small" />}- {pdfRenderMode === "sepia" && <WbSunnyIcon fontSize="small" />}+ {/* One glyph per state: the three must stay distinct, or the cycle+ button stops telling you which filter is active. */}+ {pdfRenderMode === "normal" && <Icon name="moon" size={20} />}+ {pdfRenderMode === "dark" && <Icon name="sunset" size={20} />}+ {pdfRenderMode === "sepia" && <Icon name="sun" size={20} />}</ActionIcon></Tooltip>)}@@ -330,7 +320,7 @@ export function PdfViewerToolbar({onClick={handleZoomOut}aria-label={t("viewer.zoomOut", "Zoom out")}>- <ZoomOutIcon fontSize="small" />+ <Icon name="zoom-out" size={20} /></ActionIcon><SliderclassName="pdf-viewer-toolbar-zoom-slider"@@ -352,7 +342,7 @@ export function PdfViewerToolbar({onClick={handleZoomIn}aria-label={t("viewer.zoomIn", "Zoom in")}>- <ZoomInIcon fontSize="small" />+ <Icon name="zoom-in" size={20} /></ActionIcon><spanstyle={{@@ -381,7 +371,7 @@ export function PdfViewerToolbar({aria-label={t("viewer.moreOptions", "More")}style={{ marginLeft: 4 }}>- <MoreVertIcon fontSize="small" />+ <Icon name="ellipsis-vertical" size={20} /></ActionIcon></Menu.Target><Menu.Dropdown>@@ -389,14 +379,14 @@ export function PdfViewerToolbar({{t("viewer.pageNavigation", "Page navigation")}</Menu.Label><Menu.Item- leftSection={<FirstPageIcon fontSize="small" />}+ leftSection={<Icon name="chevron-first" size={20} />}disabled={scrollState.currentPage === 1}onClick={handleFirstPage}>{t("viewer.firstPage", "First page")}</Menu.Item><Menu.Item- leftSection={<LastPageIcon fontSize="small" />}+ leftSection={<Icon name="chevron-last" size={20} />}disabled={scrollState.currentPage === scrollState.totalPages}onClick={handleLastPage}>@@ -406,13 +396,13 @@ export function PdfViewerToolbar({<Menu.Divider /><Menu.Label>{t("viewer.zoom", "Zoom")}</Menu.Label><Menu.Item- leftSection={<ZoomOutIcon fontSize="small" />}+ leftSection={<Icon name="zoom-out" size={20} />}onClick={handleZoomOut}>{t("viewer.zoomOut", "Zoom out")}</Menu.Item><Menu.Item- leftSection={<ZoomInIcon fontSize="small" />}+ leftSection={<Icon name="zoom-in" size={20} />}onClick={handleZoomIn}>{t("viewer.zoomIn", "Zoom in")} ({displayZoomPercent}%)@@ -423,9 +413,9 @@ export function PdfViewerToolbar({<Menu.ItemleftSection={isDualPageActive ? (- <DescriptionIcon fontSize="small" />+ <Icon name="file-text" size={20} />) : (- <ViewWeekIcon fontSize="small" />+ <Icon name="columns-3" size={20} />)}disabled={scrollState.totalPages <= 1}@@ -438,11 +428,11 @@ export function PdfViewerToolbar({<Menu.ItemleftSection={pdfRenderMode === "normal" ? (- <DarkModeIcon fontSize="small" />+ <Icon name="moon" size={20} />) : pdfRenderMode === "dark" ? (- <WbTwilightIcon fontSize="small" />+ <Icon name="sunset" size={20} />) : (- <WbSunnyIcon fontSize="small" />+ <Icon name="sun" size={20} />)}onClick={cyclePdfRenderMode}diff --git a/frontend/editor/src/core/components/viewer/RedactionSelectionMenu.tsx b/frontend/editor/src/core/components/viewer/RedactionSelectionMenu.tsxindex f349c2aec7..2c22fc7e1d 100644--- a/frontend/editor/src/core/components/viewer/RedactionSelectionMenu.tsx+++ b/frontend/editor/src/core/components/viewer/RedactionSelectionMenu.tsx@@ -8,8 +8,7 @@ import { ActionIcon } from "@app/ui/ActionIcon";import { useTranslation } from "react-i18next";import { createPortal } from "react-dom";import { useEffect, useState, useRef, useCallback } from "react";-import DeleteIcon from "@mui/icons-material/Delete";-import CheckCircleIcon from "@mui/icons-material/CheckCircle";+import { Icon } from "@app/ui/Icon";import { useRedaction } from "@app/contexts/RedactionContext";import { useActiveDocumentId } from "@app/components/viewer/useActiveDocumentId";@@ -140,7 +139,7 @@ function RedactionSelectionMenuInner({size="md"onClick={handleRemove}>- <DeleteIcon style={{ fontSize: 18 }} />+ <Icon name="trash" size={18} /></ActionIcon></Tooltip>@@ -156,7 +155,7 @@ function RedactionSelectionMenuInner({accent="danger"size="sm"onClick={handleApply}- leftSection={<CheckCircleIcon style={{ fontSize: 16 }} />}+ leftSection={<Icon name="circle-check" size={16} />}style={{ flexShrink: 0, whiteSpace: "nowrap" }}>Apply (permanent)diff --git a/frontend/editor/src/core/components/viewer/RulerScaleSettingsButton.tsx b/frontend/editor/src/core/components/viewer/RulerScaleSettingsButton.tsxindex 88b62d7520..4722fc8a64 100644--- a/frontend/editor/src/core/components/viewer/RulerScaleSettingsButton.tsx+++ b/frontend/editor/src/core/components/viewer/RulerScaleSettingsButton.tsx@@ -1,6 +1,6 @@import { useRef } from "react";import { Popover } from "@mantine/core";-import SettingsIcon from "@mui/icons-material/Settings";+import { Icon } from "@app/ui/Icon";import { Tooltip, type TooltipProps } from "@app/components/shared/Tooltip";import { ScaleSettingsPanel } from "@app/components/viewer/ScaleSettingsPanel";import type { MeasureScale } from "@app/utils/measurementTypes";@@ -55,7 +55,7 @@ export function RulerScaleSettingsButton({disabled={disabled}aria-label={label}>- <SettingsIcon sx={{ fontSize: "1rem" }} />+ <Icon name="settings" size={"1rem"} /></ActionIcon></Tooltip></div>diff --git a/frontend/editor/src/core/components/viewer/SearchInterface.tsx b/frontend/editor/src/core/components/viewer/SearchInterface.tsxindex a32c64c33a..bce3294b8d 100644--- a/frontend/editor/src/core/components/viewer/SearchInterface.tsx+++ b/frontend/editor/src/core/components/viewer/SearchInterface.tsx@@ -1,7 +1,7 @@import React, { useState, useEffect, useRef } from "react";import { Box, TextInput, Text, Group } from "@mantine/core";import { useTranslation } from "react-i18next";-import { LocalIcon } from "@app/components/shared/LocalIcon";+import { Icon } from "@app/ui/Icon";import { ActionIcon } from "@app/ui/ActionIcon";import { ViewerContext } from "@app/contexts/ViewerContext";@@ -213,7 +213,7 @@ export function SearchInterface({ visible, onClose }: SearchInterfaceProps) {onClick={handleCloseClick}aria-label={t("viewer.search.close", "Close search")}>- <LocalIcon icon="close" width="1rem" height="1rem" />+ <Icon name="x" size="1rem" /></ActionIcon></Group>@@ -237,7 +237,7 @@ export function SearchInterface({ visible, onClose }: SearchInterfaceProps) {onClick={handleClearSearch}aria-label={t("viewer.search.clear", "Clear search")}>- <LocalIcon icon="close" width="0.875rem" height="0.875rem" />+ <Icon name="x" size="0.875rem" /></ActionIcon>)}@@ -289,7 +289,7 @@ export function SearchInterface({ visible, onClose }: SearchInterfaceProps) {disabled={!resultInfo || resultInfo.totalResults === 0}aria-label={t("viewer.search.previous", "Previous result")}>- <LocalIcon icon="keyboard-arrow-up" width="1rem" height="1rem" />+ <Icon name="chevron-up" size="1rem" /></ActionIcon><ActionIconvariant="tertiary"@@ -298,7 +298,7 @@ export function SearchInterface({ visible, onClose }: SearchInterfaceProps) {disabled={!resultInfo || resultInfo.totalResults === 0}aria-label={t("viewer.search.next", "Next result")}>- <LocalIcon icon="keyboard-arrow-down" width="1rem" height="1rem" />+ <Icon name="chevron-down" size="1rem" /></ActionIcon></Group></Group>diff --git a/frontend/editor/src/core/components/viewer/SidebarBase.tsx b/frontend/editor/src/core/components/viewer/SidebarBase.tsxindex 7cdcc34d97..264a8581df 100644--- a/frontend/editor/src/core/components/viewer/SidebarBase.tsx+++ b/frontend/editor/src/core/components/viewer/SidebarBase.tsx@@ -1,16 +1,16 @@import type { ReactNode } from "react";import { Box, ScrollArea, Text, TextInput } from "@mantine/core";-import LocalIcon from "@app/components/shared/LocalIcon";import { ActionIcon } from "@app/ui/ActionIcon";import "@app/components/viewer/SidebarBase.css";+import { Icon, isIconName, type IconName } from "@app/ui/Icon";export const SIDEBAR_WIDTH = "15rem";export interface SidebarBaseProps {/** Sidebar title string or React element. */title: ReactNode;- /** Header icon (ReactNode or string icon name for LocalIcon). */- icon: ReactNode;+ /** Header icon: a registry icon name, or your own node. */+ icon: IconName | ReactNode;/** Right offset position string (e.g. "15rem" or "0rem"). */rightOffset?: string;/** Sidebar visibility flag. */@@ -54,12 +54,11 @@ export function SidebarBase({return null;}- const renderIcon =- typeof icon === "string" ? (- <LocalIcon icon={icon} width="1.1rem" height="1.1rem" />- ) : (- icon- );+ const renderIcon = isIconName(icon) ? (+ <Icon name={icon} size="1.1rem" />+ ) : (+ icon+ );return (<Box@@ -91,7 +90,7 @@ export function SidebarBase({aria-label={closeLabel}title={closeLabel}>- <LocalIcon icon="close-rounded" width="1.1rem" height="1.1rem" />+ <Icon name="x" size="1.1rem" /></ActionIcon>)}</Box>@@ -103,9 +102,7 @@ export function SidebarBase({value={searchTerm ?? ""}placeholder={searchPlaceholder ?? "Search..."}onChange={(e) => onSearchChange(e.currentTarget.value)}- leftSection={- <LocalIcon icon="search" width="1.1rem" height="1.1rem" />- }+ leftSection={<Icon name="search" size="1.1rem" />}size="xs"/></Box>diff --git a/frontend/editor/src/core/components/viewer/SignaturePreviewLayer.tsx b/frontend/editor/src/core/components/viewer/SignaturePreviewLayer.tsxindex 930790a59e..36e5325123 100644--- a/frontend/editor/src/core/components/viewer/SignaturePreviewLayer.tsx+++ b/frontend/editor/src/core/components/viewer/SignaturePreviewLayer.tsx@@ -2,7 +2,7 @@ import { memo, useRef, useState } from "react";import { useTranslation } from "react-i18next";import { Tooltip } from "@mantine/core";import { ActionIcon } from "@app/ui/ActionIcon";-import CloseIcon from "@mui/icons-material/Close";+import { Icon } from "@app/ui/Icon";import { useInteractionManagerCapability } from "@embedpdf/plugin-interaction-manager/react";import {Z_INDEX_SIGNATURE_OVERLAY,@@ -182,7 +182,7 @@ export const SignaturePreviewLayer = memo(function SignaturePreviewLayer({}}aria-label={t("viewer.signature.delete", "Delete signature")}>- <CloseIcon style={{ fontSize: "0.8rem" }} />+ <Icon name="x" size={"0.8rem"} /></ActionIcon>)}diff --git a/frontend/editor/src/core/components/viewer/TextSelectionMenu.tsx b/frontend/editor/src/core/components/viewer/TextSelectionMenu.tsxindex 322dd4806f..383e7c6a54 100644--- a/frontend/editor/src/core/components/viewer/TextSelectionMenu.tsx+++ b/frontend/editor/src/core/components/viewer/TextSelectionMenu.tsx@@ -1,6 +1,6 @@import { Tooltip } from "@mantine/core";import { ActionIcon } from "@app/ui/ActionIcon";-import ContentCopyIcon from "@mui/icons-material/ContentCopy";+import { Icon } from "@app/ui/Icon";import { useCallback, useEffect, useRef, useState } from "react";import { createPortal } from "react-dom";import { useTranslation } from "react-i18next";@@ -82,7 +82,7 @@ export function TextSelectionMenu({boxShadow: "0 2px 12px rgba(0, 0, 0, 0.25)",}}>- <ContentCopyIcon style={{ fontSize: 18 }} />+ <Icon name="copy" size={18} /></ActionIcon></Tooltip></div>,diff --git a/frontend/editor/src/core/components/viewer/ThumbnailSidebar.tsx b/frontend/editor/src/core/components/viewer/ThumbnailSidebar.tsxindex c44271258a..079d2ed920 100644--- a/frontend/editor/src/core/components/viewer/ThumbnailSidebar.tsx+++ b/frontend/editor/src/core/components/viewer/ThumbnailSidebar.tsx@@ -4,8 +4,7 @@ import { ActionIcon } from "@app/ui/ActionIcon";import { useTranslation } from "react-i18next";import { useViewer } from "@app/contexts/ViewerContext";import { PrivateContent } from "@app/components/shared/PrivateContent";-import LocalIcon from "@app/components/shared/LocalIcon";-import ViewListIcon from "@mui/icons-material/ViewList";+import { Icon } from "@app/ui/Icon";import "@app/components/viewer/SidebarBase.css";interface ThumbnailSidebarProps {@@ -172,7 +171,7 @@ export function ThumbnailSidebar({<div className="sidebar-base__header"><div className="sidebar-base__header-title"><span className="sidebar-base__header-icon">- <ViewListIcon fontSize="small" />+ <Icon name="list" size={20} /></span><Textfw={600}@@ -198,7 +197,7 @@ export function ThumbnailSidebar({"Close thumbnails sidebar",)}>- <LocalIcon icon="close-rounded" width="1.1rem" height="1.1rem" />+ <Icon name="x" size="1.1rem" /></ActionIcon></div>{/* Thumbnails Container */}diff --git a/frontend/editor/src/core/components/viewer/ViewerAnnotationControls.tsx b/frontend/editor/src/core/components/viewer/ViewerAnnotationControls.tsxindex fda6c2d2a5..ce9fba7177 100644--- a/frontend/editor/src/core/components/viewer/ViewerAnnotationControls.tsx+++ b/frontend/editor/src/core/components/viewer/ViewerAnnotationControls.tsx@@ -1,6 +1,5 @@import React, { useCallback } from "react";import { useTranslation } from "react-i18next";-import LocalIcon from "@app/components/shared/LocalIcon";import { ActionIcon } from "@app/ui/ActionIcon";import { Tooltip } from "@app/components/shared/Tooltip";import { ViewerContext } from "@app/contexts/ViewerContext";@@ -24,6 +23,7 @@ import {} from "@app/hooks/tools/redact/useRedactParameters";import { RedactionMode } from "@embedpdf/plugin-redaction";+import { Icon } from "@app/ui/Icon";interface ViewerAnnotationControlsProps {currentView: string;disabled?: boolean;@@ -196,11 +196,7 @@ export default function ViewerAnnotationControls({: t("workbenchBar.redact", "Redact")}>- <LocalIcon- icon="scan-delete-rounded"- width="1.25rem"- height="1.25rem"- />+ <Icon name="file-x" size="1.25rem" /></ActionIcon></Tooltip>@@ -231,14 +227,9 @@ export default function ViewerAnnotationControls({"Toggle Annotations Visibility",)}>- <LocalIcon- icon={- viewerContext?.isAnnotationsVisible- ? "visibility"- : "preview-off-rounded"- }- width="1.25rem"- height="1.25rem"+ <Icon+ name={viewerContext?.isAnnotationsVisible ? "eye" : "eye-off"}+ size="1.25rem"/></ActionIcon></Tooltip>diff --git a/frontend/editor/src/core/components/viewer/ViewerShareButton.tsx b/frontend/editor/src/core/components/viewer/ViewerShareButton.tsxindex 4ef4b30cda..ba08f0b495 100644--- a/frontend/editor/src/core/components/viewer/ViewerShareButton.tsx+++ b/frontend/editor/src/core/components/viewer/ViewerShareButton.tsx@@ -3,9 +3,7 @@ import { Group, Loader, Modal, Progress, Stack, Text } from "@mantine/core";import { ActionIcon } from "@app/ui/ActionIcon";import { Button } from "@app/ui/Button";import { useTranslation } from "react-i18next";-import ShareIcon from "@mui/icons-material/Share";-import ShieldOutlinedIcon from "@mui/icons-material/ShieldOutlined";-import CloudUploadIcon from "@mui/icons-material/CloudUpload";+import { Icon } from "@app/ui/Icon";import { Tooltip } from "@app/components/shared/Tooltip";import ShareManagementModal from "@app/components/shared/ShareManagementModal";import { useViewer } from "@app/contexts/ViewerContext";@@ -77,7 +75,7 @@ export default function ViewerShareButton({const tooltipContent = enforcing ? (<Stack gap={6} py={2} w={200}><Group gap={6} wrap="nowrap">- <ShieldOutlinedIcon style={{ fontSize: 13 }} />+ <Icon name="shield" size={13} /><Text size="xs" fw={600}>{t("policy.blockingAction",@@ -191,7 +189,7 @@ export default function ViewerShareButton({disabled={isDisabled}aria-label={label}>- <ShareIcon sx={{ fontSize: "1rem" }} />+ <Icon name="share-2" size={"1rem"} /></ActionIcon></div></Tooltip>@@ -236,7 +234,7 @@ export default function ViewerShareButton({<Buttonvariant="primary"style={{ width: BUTTON_WIDTH }}- leftSection={<CloudUploadIcon fontSize="small" />}+ leftSection={<Icon name="cloud-upload" size={20} />}onClick={handleSaveAndShare}loading={saving}>diff --git a/frontend/editor/src/core/components/viewer/nonpdf/CsvViewer.tsx b/frontend/editor/src/core/components/viewer/nonpdf/CsvViewer.tsxindex ac01d40d60..ebb1985180 100644--- a/frontend/editor/src/core/components/viewer/nonpdf/CsvViewer.tsx+++ b/frontend/editor/src/core/components/viewer/nonpdf/CsvViewer.tsx@@ -9,7 +9,7 @@ import {Table,Text,} from "@mantine/core";-import SortIcon from "@mui/icons-material/Sort";+import { Icon } from "@app/ui/Icon";import { useTranslation } from "react-i18next";import { formatFileSize } from "@app/utils/fileUtils";@@ -210,9 +210,10 @@ export function CsvViewer({ file, isTsv }: CsvViewerProps) {<Text size="xs" fw={600} truncate style={{ maxWidth: 200 }}>{h || t("viewer.nonPdf.columnDefault", { index: i + 1 })}</Text>- <SortIcon+ <Icon+ name="list-sort-descending"+ size={"0.85rem"}style={{- fontSize: "0.85rem",opacity: sortCol === i ? 1 : 0.3,color:sortCol === idiff --git a/frontend/editor/src/core/components/viewer/nonpdf/NonPdfBanner.tsx b/frontend/editor/src/core/components/viewer/nonpdf/NonPdfBanner.tsxindex 2d73a0f558..080df87607 100644--- a/frontend/editor/src/core/components/viewer/nonpdf/NonPdfBanner.tsx+++ b/frontend/editor/src/core/components/viewer/nonpdf/NonPdfBanner.tsx@@ -1,5 +1,5 @@import { Button } from "@app/ui/Button";-import PictureAsPdfIcon from "@mui/icons-material/PictureAsPdf";+import { Icon } from "@app/ui/Icon";import { useTranslation } from "react-i18next";interface NonPdfBannerProps {@@ -16,7 +16,7 @@ export function NonPdfBanner({ onConvertToPdf }: NonPdfBannerProps) {size="sm"variant="secondary"accent="warning"- leftSection={<PictureAsPdfIcon style={{ fontSize: "0.9rem" }} />}+ leftSection={<Icon name="file-pdf" size={"0.9rem"} />}onClick={onConvertToPdf}style={{position: "absolute",diff --git a/frontend/editor/src/core/components/viewer/nonpdf/types.ts b/frontend/editor/src/core/components/viewer/nonpdf/types.tsindex 6d06d0ffb0..d1f32ec0d4 100644--- a/frontend/editor/src/core/components/viewer/nonpdf/types.ts+++ b/frontend/editor/src/core/components/viewer/nonpdf/types.ts@@ -1,10 +1,5 @@import React from "react";-import ImageIcon from "@mui/icons-material/Image";-import TableChartIcon from "@mui/icons-material/TableChart";-import ArticleIcon from "@mui/icons-material/Article";-import CodeIcon from "@mui/icons-material/Code";-import DataObjectIcon from "@mui/icons-material/DataObject";-import HtmlIcon from "@mui/icons-material/Html";+import { Icon } from "@app/ui/Icon";import type { NonPdfFileType } from "@app/utils/fileUtils";@@ -35,37 +30,37 @@ export function getFileTypeMeta(case "image":return {label: "Image",- icon: React.createElement(ImageIcon, { fontSize: "small" }),+ icon: React.createElement(Icon, { name: "image", size: 20 }),...BADGE_COLORS,};case "csv":return {label: "Spreadsheet",- icon: React.createElement(TableChartIcon, { fontSize: "small" }),+ icon: React.createElement(Icon, { name: "table", size: 20 }),...BADGE_COLORS,};case "json":return {label: "JSON",- icon: React.createElement(DataObjectIcon, { fontSize: "small" }),+ icon: React.createElement(Icon, { name: "braces", size: 20 }),...BADGE_COLORS,};case "markdown":return {label: "Markdown",- icon: React.createElement(CodeIcon, { fontSize: "small" }),+ icon: React.createElement(Icon, { name: "code", size: 20 }),...BADGE_COLORS,};case "html":return {label: "HTML",- icon: React.createElement(HtmlIcon, { fontSize: "small" }),+ icon: React.createElement(Icon, { name: "file-html", size: 20 }),...BADGE_COLORS,};case "text":return {label: "Text",- icon: React.createElement(ArticleIcon, { fontSize: "small" }),+ icon: React.createElement(Icon, { name: "file-text", size: 20 }),...BADGE_COLORS,};default: {@@ -74,7 +69,7 @@ export function getFileTypeMeta(const label = ext || "File";return {label,- icon: React.createElement(ArticleIcon, { fontSize: "small" }),+ icon: React.createElement(Icon, { name: "file-text", size: 20 }),...BADGE_COLORS,};}diff --git a/frontend/editor/src/core/components/viewer/useViewerWorkbenchBarButtons.tsx b/frontend/editor/src/core/components/viewer/useViewerWorkbenchBarButtons.tsxindex 1a2af13317..17029062cf 100644--- a/frontend/editor/src/core/components/viewer/useViewerWorkbenchBarButtons.tsx+++ b/frontend/editor/src/core/components/viewer/useViewerWorkbenchBarButtons.tsx@@ -8,7 +8,7 @@ import {useWorkbenchBarButtons,WorkbenchBarButtonWithAction,} from "@app/hooks/useWorkbenchBarButtons";-import LocalIcon from "@app/components/shared/LocalIcon";+import { Icon } from "@app/ui/Icon";import { Tooltip } from "@app/components/shared/Tooltip";import { SearchInterface } from "@app/components/viewer/SearchInterface";import ViewerAnnotationControls from "@app/components/viewer/ViewerAnnotationControls";@@ -21,12 +21,6 @@ import {} from "@app/contexts/NavigationContext";import { stripBasePath, withBasePath } from "@app/constants/app";import { useRedaction, useRedactionMode } from "@app/contexts/RedactionContext";-import TextFieldsIcon from "@mui/icons-material/TextFields";-import StraightenIcon from "@mui/icons-material/Straighten";-import LayersIcon from "@mui/icons-material/Layers";-import VolumeUpIcon from "@mui/icons-material/VolumeUp";-import StopIcon from "@mui/icons-material/Stop";-import SettingsIcon from "@mui/icons-material/Settings";import { useViewerReadAloud } from "@app/components/viewer/useViewerReadAloud";import { RulerScaleSettingsButton } from "@app/components/viewer/RulerScaleSettingsButton";import type { MeasureScale } from "@app/utils/measurementTypes";@@ -209,11 +203,7 @@ export function useViewerWorkbenchBarButtons(aria-label={searchLabel}onClick={viewer.searchInterfaceActions.toggle}>- <LocalIcon- icon="find-in-page-rounded"- width="1.25rem"- height="1.25rem"- />+ <Icon name="file-search" size="1.25rem" /></ActionIcon></Tooltip></div>@@ -231,7 +221,7 @@ export function useViewerWorkbenchBarButtons(},{id: "viewer-pan-mode",- icon: <LocalIcon icon="pan-tool-rounded" width="1rem" height="1rem" />,+ icon: <Icon name="hand" size="1rem" />,tooltip:!isPanning && pendingCount > 0 && redactionActiveType !== null? applyRedactionsLabel@@ -252,7 +242,7 @@ export function useViewerWorkbenchBarButtons(},{id: "viewer-ruler",- icon: <StraightenIcon sx={{ fontSize: "1rem" }} />,+ icon: <Icon name="ruler" size={"1rem"} />,tooltip: rulerLabel,ariaLabel: rulerLabel,section: "top" as const,@@ -271,7 +261,7 @@ export function useViewerWorkbenchBarButtons(? [{id: "viewer-ruler-settings",- icon: <SettingsIcon sx={{ fontSize: "1.5rem" }} />,+ icon: <Icon name="settings" size={"1.5rem"} />,tooltip: rulerSettingsLabel,ariaLabel: rulerSettingsLabel,section: "top" as const,@@ -294,7 +284,7 @@ export function useViewerWorkbenchBarButtons(: []),{id: "viewer-rotate-left",- icon: <LocalIcon icon="rotate-left" width="1rem" height="1rem" />,+ icon: <Icon name="rotate-ccw" size="1rem" />,tooltip: rotateLeftLabel,ariaLabel: rotateLeftLabel,section: "top" as const,@@ -305,7 +295,7 @@ export function useViewerWorkbenchBarButtons(},{id: "viewer-rotate-right",- icon: <LocalIcon icon="rotate-right" width="1rem" height="1rem" />,+ icon: <Icon name="rotate-cw" size="1rem" />,tooltip: rotateRightLabel,ariaLabel: rotateRightLabel,section: "top" as const,@@ -316,7 +306,7 @@ export function useViewerWorkbenchBarButtons(},{id: "viewer-toggle-sidebar",- icon: <LocalIcon icon="view-list" width="1rem" height="1rem" />,+ icon: <Icon name="list" size="1rem" />,tooltip: sidebarLabel,ariaLabel: sidebarLabel,section: "top" as const,@@ -328,13 +318,7 @@ export function useViewerWorkbenchBarButtons(},{id: "viewer-toggle-bookmarks",- icon: (- <LocalIcon- icon="bookmark-add-rounded"- width="1.25rem"- height="1.25rem"- />- ),+ icon: <Icon name="bookmark-plus" size="1.25rem" />,tooltip: bookmarkLabel,ariaLabel: bookmarkLabel,section: "top" as const,@@ -346,13 +330,7 @@ export function useViewerWorkbenchBarButtons(},{id: "viewer-toggle-attachments",- icon: (- <LocalIcon- icon="attachment-rounded"- width="1.25rem"- height="1.25rem"- />- ),+ icon: <Icon name="paperclip" size="1.25rem" />,tooltip: attachmentLabel,ariaLabel: attachmentLabel,section: "top" as const,@@ -366,7 +344,7 @@ export function useViewerWorkbenchBarButtons(? [{id: "viewer-toggle-layers",- icon: <LayersIcon sx={{ fontSize: "1rem" }} />,+ icon: <Icon name="layers" size={"1rem"} />,tooltip: layersLabel,ariaLabel: layersLabel,section: "top" as const,@@ -380,7 +358,7 @@ export function useViewerWorkbenchBarButtons(: []),{id: "viewer-toggle-comments",- icon: <LocalIcon icon="comment" width="1rem" height="1rem" />,+ icon: <Icon name="message-square" size="1rem" />,tooltip: commentsLabel,ariaLabel: commentsLabel,section: "top" as const,@@ -428,9 +406,9 @@ export function useViewerWorkbenchBarButtons(onClick={handleReadAloud}>{isReadingAloud ? (- <StopIcon sx={{ fontSize: "1rem" }} />+ <Icon name="square" size={"1rem"} />) : (- <VolumeUpIcon sx={{ fontSize: "1rem" }} />+ <Icon name="volume-2" size={"1rem"} />)}</ActionIcon></Tooltip>@@ -532,7 +510,7 @@ export function useViewerWorkbenchBarButtons(aria-pressed={isAnnotationsActive}aria-label={annotationsLabel}>- <LocalIcon icon="edit" width="1rem" height="1rem" />+ <Icon name="pencil" size="1rem" /></ActionIcon></Tooltip>),@@ -574,7 +552,7 @@ export function useViewerWorkbenchBarButtons(aria-pressed={isFormFillActive}aria-label={formFillLabel}>- <TextFieldsIcon sx={{ fontSize: "1rem" }} />+ <Icon name="type" size={"1rem"} /></ActionIcon></Tooltip>),diff --git a/frontend/editor/src/core/icons/LICENSE-lucide.txt b/frontend/editor/src/core/icons/LICENSE-lucide.txtindex 91b171e4e3..6456b68013 100644--- a/frontend/editor/src/core/icons/LICENSE-lucide.txt+++ b/frontend/editor/src/core/icons/LICENSE-lucide.txt@@ -7,7 +7,7 @@ Lucide icon geometry used in this project. Two places rely on this notice:the lucide-static package at build time and is not checked in; it disappearsif that package is removed.-2. Two icons in src/core/icons/svg/stirling/ that reuse lucide geometry so they+2. The icons in src/core/icons/svg/stirling/ that reuse lucide geometry so theysit in the same visual family. These are checked in and do NOT disappearwith the package:@@ -29,8 +29,12 @@ Lucide icon geometry used in this project. Two places rely on this notice:the corner fold M14 2v5a1 1 0 0 0 1 1h5(from lucide "file"; the PDF letterforms are ours)-Neither source icon appears in the Feather-derived list below, so only the ISC-terms apply to them. Keep this file for as long as either of those svgs, or the+ polyline.svg the zigzag m19 9-5 5-4-4-3 3+ (from lucide "chart-line" with its axis dropped and the+ zigzag scaled about its centre to fill the box)++None of the source icons appears in the Feather-derived list below, so only+the ISC terms apply to them. Keep this file for as long as either of those svgs, or theicons.ts maps, remains. task frontend:lint:icons fails if it goes missing.The verbatim upstream notice follows.diff --git a/frontend/editor/src/core/icons/icon-map.json b/frontend/editor/src/core/icons/icon-map.jsonindex c0becdde90..419b830663 100644--- a/frontend/editor/src/core/icons/icon-map.json+++ b/frontend/editor/src/core/icons/icon-map.json@@ -430,7 +430,7 @@"highlight": "highlighter","format-underlined": "underline","strikethrough-s": "strikethrough",- "show-chart": "pen-line",+ "show-chart": "polyline","radio-button-unchecked": "circle","change-history": "triangle","text-fields": "type",diff --git a/frontend/editor/src/core/icons/icons.ts b/frontend/editor/src/core/icons/icons.tsindex 98de889f18..1bcce2fceb 100644--- a/frontend/editor/src/core/icons/icons.ts+++ b/frontend/editor/src/core/icons/icons.ts@@ -205,7 +205,6 @@ import Palette from "lucide-static/icons/palette.svg?react";import Paperclip from "lucide-static/icons/paperclip.svg?react";import PartyPopper from "lucide-static/icons/party-popper.svg?react";import Pause from "lucide-static/icons/pause.svg?react";-import PenLine from "lucide-static/icons/pen-line.svg?react";import PenTool from "lucide-static/icons/pen-tool.svg?react";import Pencil from "lucide-static/icons/pencil.svg?react";import PencilRuler from "lucide-static/icons/pencil-ruler.svg?react";@@ -345,6 +344,7 @@ import FilePdf from "@app/icons/svg/stirling/file-pdf.svg?react";import Ftp from "@app/icons/svg/stirling/ftp.svg?react";import LineWeight from "@app/icons/svg/stirling/line-weight.svg?react";import MoveItemDown from "@app/icons/svg/stirling/move-item-down.svg?react";+import Polyline from "@app/icons/svg/stirling/polyline.svg?react";import RadioChecked from "@app/icons/svg/stirling/radio-checked.svg?react";import RemoveSelection from "@app/icons/svg/stirling/remove-selection.svg?react";import SelectAll from "@app/icons/svg/stirling/select-all.svg?react";@@ -596,7 +596,6 @@ export const ICONS = {paperclip: { Component: Paperclip, kind: "lucide" },"party-popper": { Component: PartyPopper, kind: "lucide" },pause: { Component: Pause, kind: "lucide" },- "pen-line": { Component: PenLine, kind: "lucide" },"pen-tool": { Component: PenTool, kind: "lucide" },pencil: { Component: Pencil, kind: "lucide" },"pencil-ruler": { Component: PencilRuler, kind: "lucide" },@@ -735,6 +734,7 @@ export const ICONS = {ftp: { Component: Ftp, kind: "stirling" },"line-weight": { Component: LineWeight, kind: "stirling" },"move-item-down": { Component: MoveItemDown, kind: "stirling" },+ polyline: { Component: Polyline, kind: "stirling" },"radio-checked": { Component: RadioChecked, kind: "stirling" },"remove-selection": { Component: RemoveSelection, kind: "stirling" },"select-all": { Component: SelectAll, kind: "stirling" },diff --git a/frontend/editor/src/core/icons/svg/stirling/polyline.svg b/frontend/editor/src/core/icons/svg/stirling/polyline.svgnew file mode 100644index 0000000000..64fff57ed0--- /dev/null+++ b/frontend/editor/src/core/icons/svg/stirling/polyline.svg@@ -0,0 +1,5 @@+<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="24" height="24" fill="none" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round">+ <!-- The zigzag is Lucide geometry (ISC). Full notice and the exact paths:+ src/core/icons/LICENSE-lucide.txt, which must stay with this file. -->+ <path d="M4.5 14.1 8.75 9.9l4.65 5.7L20.5 8.4" />+</svg>diff --git a/frontend/editor/src/core/tools/annotate/AnnotationPanel.tsx b/frontend/editor/src/core/tools/annotate/AnnotationPanel.tsxindex 0535af1519..2712fafbd0 100644--- a/frontend/editor/src/core/tools/annotate/AnnotationPanel.tsx+++ b/frontend/editor/src/core/tools/annotate/AnnotationPanel.tsx@@ -15,7 +15,6 @@ import {} from "@mantine/core";import { Button } from "@app/ui/Button";import { ActionIcon } from "@app/ui/ActionIcon";-import LocalIcon from "@app/components/shared/LocalIcon";import {ColorPicker,ColorSwatchButton,@@ -33,6 +32,7 @@ import type { ViewerContextType } from "@app/contexts/ViewerContext";import type { SignParameters } from "@app/hooks/tools/sign/useSignParameters";import type { BuildToolOptionsExtras } from "@app/tools/annotate/useAnnotationStyleState";+import { Icon, type IconName } from "@app/ui/Icon";interface StyleState {inkColor: string;inkWidth: number;@@ -230,92 +230,100 @@ export function AnnotationPanel(props: AnnotationPanelProps) {const textMarkupTools: {id: AnnotationToolId;label: string;- icon: string;+ icon: IconName;}[] = [{id: "highlight",label: t("annotation.highlight", "Highlight"),- icon: "highlight",+ icon: "highlighter",},{id: "underline",label: t("annotation.underline", "Underline"),- icon: "format-underlined",+ icon: "underline",},{id: "strikeout",label: t("annotation.strikeout", "Strikeout"),- icon: "strikethrough-s",+ icon: "strikethrough",},{id: "squiggly",label: t("annotation.squiggly", "Squiggly"),- icon: "show-chart",+ icon: "polyline",},];- const drawingTools: { id: AnnotationToolId; label: string; icon: string }[] =+ const drawingTools: {+ id: AnnotationToolId;+ label: string;+ icon: IconName;+ }[] = [+ { id: "ink", label: t("annotation.pen", "Pen"), icon: "pencil" },+ {+ id: "inkHighlighter",+ label: t("annotation.freehandHighlighter", "Freehand Highlighter"),+ icon: "brush",+ },+ ];++ const shapeTools: { id: AnnotationToolId; label: string; icon: IconName }[] =[- { id: "ink", label: t("annotation.pen", "Pen"), icon: "edit" },{- id: "inkHighlighter",- label: t("annotation.freehandHighlighter", "Freehand Highlighter"),- icon: "brush",+ id: "square",+ label: t("annotation.square", "Square"),+ icon: "square",+ },+ {+ id: "circle",+ label: t("annotation.circle", "Circle"),+ icon: "circle",+ },+ { id: "line", label: t("annotation.line", "Line"), icon: "polyline" },+ {+ id: "polygon",+ label: t("annotation.polygon", "Polygon"),+ icon: "triangle",},];- const shapeTools: { id: AnnotationToolId; label: string; icon: string }[] = [+ const commentTools: {+ id: AnnotationToolId;+ label: string;+ icon: IconName;+ }[] = [{- id: "square",- label: t("annotation.square", "Square"),- icon: "crop-square-outline",+ id: "textComment",+ label: t("annotation.comment", "Comment"),+ icon: "message-square",},{- id: "circle",- label: t("annotation.circle", "Circle"),- icon: "radio-button-unchecked",+ id: "insertText",+ label: t("annotation.insertText", "Insert Text"),+ icon: "message-square-plus",},- { id: "line", label: t("annotation.line", "Line"), icon: "show-chart" },{- id: "polygon",- label: t("annotation.polygon", "Polygon"),- icon: "change-history",+ id: "replaceText",+ label: t("annotation.replaceText", "Replace Text"),+ icon: "replace",},];- const commentTools: { id: AnnotationToolId; label: string; icon: string }[] =+ const otherTools: { id: AnnotationToolId; label: string; icon: IconName }[] =[{- id: "textComment",- label: t("annotation.comment", "Comment"),- icon: "comment",+ id: "text",+ label: t("annotation.text", "Text box"),+ icon: "type",},+ { id: "note", label: t("annotation.note", "Note"), icon: "sticky-note" },{- id: "insertText",- label: t("annotation.insertText", "Insert Text"),- icon: "add-comment",- },- {- id: "replaceText",- label: t("annotation.replaceText", "Replace Text"),- icon: "find-replace",+ id: "stamp",+ label: t("annotation.stamp", "Add Image"),+ icon: "image-plus",},];- const otherTools: { id: AnnotationToolId; label: string; icon: string }[] = [- {- id: "text",- label: t("annotation.text", "Text box"),- icon: "text-fields",- },- { id: "note", label: t("annotation.note", "Note"), icon: "sticky-note-2" },- {- id: "stamp",- label: t("annotation.stamp", "Add Image"),- icon: "add-photo-alternate",- },- ];-const activeColor = useMemo(() =>colorPickerTarget@@ -358,7 +366,7 @@ export function AnnotationPanel(props: AnnotationPanelProps) {};const renderToolButtons = (- tools: { id: AnnotationToolId; label: string; icon: string }[],+ tools: { id: AnnotationToolId; label: string; icon: IconName }[],) => (<Group gap="xs">{tools.map((tool) => (@@ -373,7 +381,7 @@ export function AnnotationPanel(props: AnnotationPanelProps) {disabled={!annotationsVisible}aria-label={tool.label}>- <LocalIcon icon={tool.icon} width="1.25rem" height="1.25rem" />+ <Icon name={tool.icon} size="1.25rem" /></ActionIcon></MantineTooltip>))}@@ -646,11 +654,7 @@ export function AnnotationPanel(props: AnnotationPanelProps) {size="md"aria-label={t("annotation.alignLeft", "Align left")}>- <LocalIcon- icon="format-align-left"- width={18}- height={18}- />+ <Icon name="text-align-start" size={18} /></ActionIcon><ActionIconvariant={@@ -660,11 +664,7 @@ export function AnnotationPanel(props: AnnotationPanelProps) {size="md"aria-label={t("annotation.alignCenter", "Align center")}>- <LocalIcon- icon="format-align-center"- width={18}- height={18}- />+ <Icon name="text-align-center" size={18} /></ActionIcon><ActionIconvariant={@@ -674,11 +674,7 @@ export function AnnotationPanel(props: AnnotationPanelProps) {size="md"aria-label={t("annotation.alignRight", "Align right")}>- <LocalIcon- icon="format-align-right"- width={18}- height={18}- />+ <Icon name="text-align-end" size={18} /></ActionIcon></Group></Box>@@ -1194,9 +1190,7 @@ export function AnnotationPanel(props: AnnotationPanelProps) {onClick={() => {activateAnnotationTool("select");}}- leftSection={- <LocalIcon icon="touch-app-rounded" width={20} height={20} />- }+ leftSection={<Icon name="pointer" size={20} />}>{t("annotation.selectAndMove", "Select and Edit")}</Button>@@ -1218,7 +1212,7 @@ export function AnnotationPanel(props: AnnotationPanelProps) {disabled={isApplyingChanges}aria-label={t("annotation.moreActions", "More actions")}>- <LocalIcon icon="more-horiz" width={20} height={20} />+ <Icon name="ellipsis" size={20} /></ActionIcon></Tooltip></Menu.Target>@@ -1226,9 +1220,7 @@ export function AnnotationPanel(props: AnnotationPanelProps) {<Menu.Itemcolor="red"disabled={isClearingDocumentAnnotations || isApplyingChanges}- leftSection={- <LocalIcon icon="delete-rounded" width={18} height={18} />- }+ leftSection={<Icon name="trash" size={18} />}onClick={() => setIsClearDocumentModalOpen(true)}>{t(@@ -1327,9 +1319,7 @@ export function AnnotationPanel(props: AnnotationPanelProps) {accent="danger"loading={isClearingDocumentAnnotations}disabled={isApplyingChanges}- leftSection={- <LocalIcon icon="delete-rounded" width={18} height={18} />- }+ leftSection={<Icon name="trash" size={18} />}onClick={() => void handleConfirmClearDocumentAnnotations()}>{t("annotation.clearDocumentAnnotationsConfirm", "Clear all")}