Skip to content

Privacy-first password manager with built-in email aliasing. Fully encrypted and self-hostable.

Replace app literal SVG with core/models icon references (#2464)

Leendert de Borst69cb65a564f4
diff --git a/apps/browser-extension/src/entrypoints/contentScript/Popup.ts b/apps/browser-extension/src/entrypoints/contentScript/Popup.ts
index 32d4d19a5..215e5c08e 100644
--- a/apps/browser-extension/src/entrypoints/contentScript/Popup.ts
+++ b/apps/browser-extension/src/entrypoints/contentScript/Popup.ts
@@ -1,7 +1,7 @@
import { isSameItem, scopedKey } from '@aliasvault/client/database/ItemRef';
import { SqliteClient } from '@aliasvault/client/database/SqliteClient';
import { generateTotpCode, getTotpRemainingSeconds } from '@aliasvault/client/items/TotpUtility';
-import { ItemTypeIconSvgs } from '@aliasvault/models/icons';
+import { createUiIconElement, ItemTypeIconSvgs, uiIconSvg } from '@aliasvault/models/icons';
import { FieldKey, getFieldValue, normalizeTotpPeriod } from '@aliasvault/models/vault';
import { fillItem, fillTotpCode } from '@/entrypoints/contentScript/Form';
@@ -353,9 +353,7 @@ async function createTotpPopup(input: HTMLInputElement, items: Item[] | undefine
const closeButton = document.createElement('button');
closeButton.className = 'av-button av-button-close';
closeButton.innerHTML = `
- <svg class="av-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
- <path d="M6 18L18 6M6 6l12 12" stroke-linecap="round" stroke-linejoin="round"/>
- </svg>
+ ${uiIconSvg('x', { class: 'av-icon' })}
`;
/**
@@ -371,15 +369,11 @@ async function createTotpPopup(input: HTMLInputElement, items: Item[] | undefine
contextMenu.style.top = `${rect.bottom + 4}px`;
contextMenu.innerHTML = `
<button class="av-context-menu-item" data-action="temporary">
- <svg class="av-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
- <path d="M12 8v4l3 3m6-3a9 9 0 11-18 0 9 9 0 0118 0z" stroke-linecap="round" stroke-linejoin="round"/>
- </svg>
+ ${uiIconSvg('clock', { class: 'av-icon' })}
${hideFor1HourText}
</button>
<button class="av-context-menu-item" data-action="permanent">
- <svg class="av-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
- <path d="M6 18L18 6M6 6l12 12" stroke-linecap="round" stroke-linejoin="round"/>
- </svg>
+ ${uiIconSvg('x', { class: 'av-icon' })}
${hidePermanentlyText}
</button>
`;
@@ -796,30 +790,11 @@ export async function updatePopupContent(items: Item[], itemList: HTMLElement |
* autofilled on this site, so the user can quickly spot it among multiple matches.
*/
function createRecentlySelectedIcon(): SVGSVGElement {
- const svgNS = 'http://www.w3.org/2000/svg';
- const svg = document.createElementNS(svgNS, 'svg');
- svg.setAttribute('viewBox', '0 0 24 24');
- svg.setAttribute('fill', 'none');
- svg.setAttribute('stroke', '#6b7280');
- svg.setAttribute('stroke-width', '2');
- svg.setAttribute('stroke-linecap', 'round');
- svg.setAttribute('stroke-linejoin', 'round');
+ const svg = createUiIconElement<SVGSVGElement>(document, 'clock', { stroke: '#6b7280' });
svg.style.width = '12px';
svg.style.height = '12px';
svg.style.flexShrink = '0';
- const arc = document.createElementNS(svgNS, 'path');
- arc.setAttribute('d', 'M3 12a9 9 0 1 0 9-9 9.74 9.74 0 0 0-6.74 2.74L3 8');
- svg.appendChild(arc);
-
- const corner = document.createElementNS(svgNS, 'polyline');
- corner.setAttribute('points', '3 3 3 8 8 8');
- svg.appendChild(corner);
-
- const innerHands = document.createElementNS(svgNS, 'path');
- innerHands.setAttribute('d', 'M12 7v5l4 2');
- svg.appendChild(innerHands);
-
return svg;
}
@@ -913,10 +888,7 @@ export async function createAutofillPopup(input: HTMLInputElement, items: Item[]
const createButton = document.createElement('button');
createButton.className = 'av-button av-button-primary';
createButton.innerHTML = `
- <svg class="av-icon" viewBox="0 0 24 24">
- <line x1="12" y1="5" x2="12" y2="19"></line>
- <line x1="5" y1="12" x2="19" y2="12"></line>
- </svg>
+ ${uiIconSvg('plus', { class: 'av-icon' })}
${newText}
`;
@@ -975,9 +947,7 @@ export async function createAutofillPopup(input: HTMLInputElement, items: Item[]
const closeButton = document.createElement('button');
closeButton.className = 'av-button av-button-close';
closeButton.innerHTML = `
- <svg class="av-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
- <path d="M6 18L18 6M6 6l12 12" stroke-linecap="round" stroke-linejoin="round"/>
- </svg>
+ ${uiIconSvg('x', { class: 'av-icon' })}
`;
/**
@@ -993,15 +963,11 @@ export async function createAutofillPopup(input: HTMLInputElement, items: Item[]
contextMenu.style.top = `${rect.bottom + 4}px`;
contextMenu.innerHTML = `
<button class="av-context-menu-item" data-action="temporary">
- <svg class="av-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
- <path d="M12 8v4l3 3m6-3a9 9 0 11-18 0 9 9 0 0118 0z" stroke-linecap="round" stroke-linejoin="round"/>
- </svg>
+ ${uiIconSvg('clock', { class: 'av-icon' })}
${hideFor1HourText}
</button>
<button class="av-context-menu-item" data-action="permanent">
- <svg class="av-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
- <path d="M6 18L18 6M6 6l12 12" stroke-linecap="round" stroke-linejoin="round"/>
- </svg>
+ ${uiIconSvg('x', { class: 'av-icon' })}
${hidePermanentlyText}
</button>
`;
@@ -1184,10 +1150,7 @@ export async function createVaultLockedPopup(input: HTMLInputElement, rootContai
button.title = 'Unlock AliasVault';
button.className = 'av-vault-locked-button';
button.innerHTML = `
- <svg class="av-icon-lock" viewBox="0 0 24 24">
- <rect x="3" y="11" width="18" height="11" rx="2" ry="2"></rect>
- <path d="M7 11V7a5 5 0 0 1 10 0v4"></path>
- </svg>
+ ${uiIconSvg('lock-closed', { class: 'av-icon-lock' })}
`;
container.appendChild(button);
@@ -1199,10 +1162,7 @@ export async function createVaultLockedPopup(input: HTMLInputElement, rootContai
closeButton.className = 'av-button av-button-close av-vault-locked-close';
closeButton.title = 'Dismiss popup';
closeButton.innerHTML = `
- <svg class="av-icon" viewBox="0 0 24 24">
- <line x1="18" y1="6" x2="6" y2="18"></line>
- <line x1="6" y1="6" x2="18" y2="18"></line>
- </svg>
+ ${uiIconSvg('x', { class: 'av-icon' })}
`;
// Position the close button to the right of the container
@@ -1282,25 +1242,12 @@ async function handleSearchInput(searchInput: HTMLInputElement, initialItems: It
* Build small passkey badge icon shown next to a service name to mark that the entry is (or has) a passkey.
*/
function createPasskeyBadgeIcon(): SVGSVGElement {
- const svgNS = 'http://www.w3.org/2000/svg';
- const svg = document.createElementNS(svgNS, 'svg');
- svg.setAttribute('class', 'av-passkey-icon');
- svg.setAttribute('viewBox', '0 0 24 24');
- svg.setAttribute('fill', 'none');
- svg.setAttribute('stroke', 'currentColor');
- svg.setAttribute('stroke-width', '2');
- svg.setAttribute('stroke-linecap', 'round');
- svg.setAttribute('stroke-linejoin', 'round');
- svg.setAttribute('aria-label', 'Has passkey');
+ const svg = createUiIconElement<SVGSVGElement>(document, 'key', { 'class': 'av-passkey-icon', 'aria-label': 'Has passkey' });
svg.style.width = '14px';
svg.style.height = '14px';
svg.style.flexShrink = '0';
svg.style.opacity = '0.7';
- const path = document.createElementNS(svgNS, 'path');
- path.setAttribute('d', 'M21 2l-2 2m-7.61 7.61a5.5 5.5 0 1 1-7.778 7.778 5.5 5.5 0 0 1 7.777-7.777zm0 0L15.5 7.5m0 0l3 3L22 7l-3-3m-3.5 3.5L19 4');
- svg.appendChild(path);
-
return svg;
}
@@ -1315,7 +1262,7 @@ function createLogoContainer(logo: Uint8Array | number[] | undefined): HTMLEleme
if (logoSrc) {
logoContainer.innerHTML = `<img src="${logoSrc}" alt="" style="width:100%;height:100%;">`;
} else {
- logoContainer.innerHTML = ItemTypeIconSvgs.Placeholder;
+ logoContainer.innerHTML = ItemTypeIconSvgs.placeholder;
}
return logoContainer;
@@ -1328,11 +1275,7 @@ function createPopoutIcon(item: ItemRef, rootContainer: HTMLElement): HTMLElemen
const popoutIcon = document.createElement('div');
popoutIcon.className = 'av-popout-icon';
popoutIcon.innerHTML = `
- <svg class="av-icon" viewBox="0 0 24 24">
- <path d="M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6"></path>
- <polyline points="15 3 21 3 21 9"></polyline>
- <line x1="10" y1="14" x2="21" y2="3"></line>
- </svg>
+ ${uiIconSvg('external-link', { class: 'av-icon' })}
`;
addReliableClickHandler(popoutIcon, (e) => {
@@ -1669,9 +1612,7 @@ export async function createUpgradeRequiredPopup(input: HTMLInputElement, rootCo
button.title = await t('content.openAliasVaultToUpgrade');
button.className = 'av-upgrade-required-button';
button.innerHTML = `
- <svg class="av-icon-upgrade" viewBox="0 0 24 24">
- <path d="M12 2L2 7l10 5 10-5-10-5zM2 17l10 5 10-5M2 12l10 5 10-5"></path>
- </svg>
+ ${uiIconSvg('collection', { class: 'av-icon-upgrade' })}
`;
container.appendChild(button);
@@ -1683,10 +1624,7 @@ export async function createUpgradeRequiredPopup(input: HTMLInputElement, rootCo
closeButton.className = 'av-button av-button-close av-upgrade-required-close';
closeButton.title = await t('content.dismissPopup');
closeButton.innerHTML = `
- <svg class="av-icon" viewBox="0 0 24 24">
- <line x1="18" y1="6" x2="6" y2="18"></line>
- <line x1="6" y1="6" x2="18" y2="18"></line>
- </svg>
+ ${uiIconSvg('x', { class: 'av-icon' })}
`;
// Position the close button to the right of the container
diff --git a/apps/browser-extension/src/entrypoints/contentScript/SavePrompt.ts b/apps/browser-extension/src/entrypoints/contentScript/SavePrompt.ts
index 7cfdc2246..f06549aa0 100644
--- a/apps/browser-extension/src/entrypoints/contentScript/SavePrompt.ts
+++ b/apps/browser-extension/src/entrypoints/contentScript/SavePrompt.ts
@@ -3,6 +3,8 @@
* Displays a non-intrusive banner at the top of the page when credentials are detected.
*/
+import { uiIconSvg } from '@aliasvault/models/icons';
+
import { getLogoMarkSvg } from '@/utils/constants/logo';
import { logExpected, logFailure } from '@/utils/Diagnostics';
import type { CapturedLogin, SavePromptOptions, SavePromptPersistedState, AddUrlPromptOptions, LastAutofilledCredential } from '@/utils/loginDetector';
@@ -562,9 +564,7 @@ async function createPromptFromTemplate(config: IPromptTemplateConfig): Promise<
const dismissText = await t('common.dismiss');
const dismissButton = `
<button class="av-save-prompt__btn av-save-prompt__btn--dismiss" aria-label="${dismissText}">
- <svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
- <path d="M18 6L6 18M6 6l12 12"/>
- </svg>
+ ${uiIconSvg('x', { width: '16', height: '16' })}
</button>
`;
@@ -881,9 +881,7 @@ async function createAddUrlPromptHTML(login: CapturedLogin, existingCredential:
const content = `
<div class="av-save-prompt__add-url-info">
<span class="av-save-prompt__url-pill">
- <svg class="av-save-prompt__plus-icon" width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5">
- <path d="M12 5v14M5 12h14"/>
- </svg>
+ ${uiIconSvg('plus', { class: 'av-save-prompt__plus-icon', width: '12', height: '12', 'stroke-width': '2.5' })}
${escapedUrl}
</span>
<span class="av-save-prompt__url-arrow">→</span>
diff --git a/apps/browser-extension/src/entrypoints/popup/components/Dialogs/HelpModal.tsx b/apps/browser-extension/src/entrypoints/popup/components/Dialogs/HelpModal.tsx
index c2eb80c38..ff6adaf3a 100644
--- a/apps/browser-extension/src/entrypoints/popup/components/Dialogs/HelpModal.tsx
+++ b/apps/browser-extension/src/entrypoints/popup/components/Dialogs/HelpModal.tsx
@@ -2,6 +2,7 @@ import React, { useState } from 'react';
import { useTranslation } from 'react-i18next';
import ModalWrapper from '@/entrypoints/popup/components/Dialogs/ModalWrapper';
+import Icon from '@/entrypoints/popup/components/Icons/Icon';
type HelpModalProps = {
title: string;
@@ -25,19 +26,7 @@ const HelpModal: React.FC<HelpModalProps> = ({ title, content, className = '' })
type="button"
aria-label={t('common.help')}
>
- <svg
- className="w-4 h-4 text-gray-400 hover:text-gray-600 dark:hover:text-gray-300 cursor-help"
- fill="none"
- stroke="currentColor"
- strokeWidth={2}
- viewBox="0 0 24 24"
- >
- <path
- strokeLinecap="round"
- strokeLinejoin="round"
- d="M8.228 9c.549-1.165 2.03-2 3.772-2 2.21 0 4 1.343 4 3 0 1.4-1.278 2.575-3.006 2.907-.542.104-.994.54-.994 1.093m0 3h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"
- />
- </svg>
+ <Icon name="question-mark-circle" className="w-4 h-4 text-gray-400 hover:text-gray-600 dark:hover:text-gray-300 cursor-help" />
</button>
<ModalWrapper
diff --git a/apps/browser-extension/src/entrypoints/popup/components/Dialogs/LogoutConfirmModal.tsx b/apps/browser-extension/src/entrypoints/popup/components/Dialogs/LogoutConfirmModal.tsx
index a1467a969..580ea78bf 100644
--- a/apps/browser-extension/src/entrypoints/popup/components/Dialogs/LogoutConfirmModal.tsx
+++ b/apps/browser-extension/src/entrypoints/popup/components/Dialogs/LogoutConfirmModal.tsx
@@ -3,6 +3,7 @@ import React, { useState, useEffect } from 'react';
import { useTranslation } from 'react-i18next';
import ModalWrapper from '@/entrypoints/popup/components/Dialogs/ModalWrapper';
+import Icon from '@/entrypoints/popup/components/Icons/Icon';
import { logFailure } from '@/utils/Diagnostics';
@@ -80,9 +81,7 @@ const LogoutConfirmModal: React.FC<ILogoutConfirmModalProps> = ({
>
<div className="flex items-start mb-4">
<div className="flex-shrink-0">
- <svg className="h-6 w-6 text-amber-500" fill="none" viewBox="0 0 24 24" strokeWidth="1.5" stroke="currentColor">
- <path strokeLinecap="round" strokeLinejoin="round" d="M12 9v3.75m-9.303 3.376c-.866 1.5.217 3.374 1.948 3.374h14.71c1.73 0 2.813-1.874 1.948-3.374L13.949 3.378c-.866-1.5-3.032-1.5-3.898 0L2.697 16.126zM12 15.75h.007v.008H12v-.008z" />
- </svg>
+ <Icon name="exclamation" className="h-6 w-6 text-amber-500" />
</div>
<div className="ml-3">
<h3 className="text-lg font-semibold text-gray-900 dark:text-white">
diff --git a/apps/browser-extension/src/entrypoints/popup/components/Dialogs/Modal.tsx b/apps/browser-extension/src/entrypoints/popup/components/Dialogs/Modal.tsx
index 85caca2b5..3162c786e 100644
--- a/apps/browser-extension/src/entrypoints/popup/components/Dialogs/Modal.tsx
+++ b/apps/browser-extension/src/entrypoints/popup/components/Dialogs/Modal.tsx
@@ -1,6 +1,7 @@
import React from 'react';
import ModalWrapper from '@/entrypoints/popup/components/Dialogs/ModalWrapper';
+import Icon from '@/entrypoints/popup/components/Icons/Icon';
interface IModalProps {
isOpen: boolean;
@@ -43,9 +44,7 @@ const Modal: React.FC<IModalProps> = ({
<div className="sm:flex sm:items-start">
{variant === 'danger' && (
<div className="mx-auto flex h-12 w-12 flex-shrink-0 items-center justify-center rounded-full bg-red-100 dark:bg-red-900 sm:mx-0 sm:h-10 sm:w-10">
- <svg className="h-6 w-6 text-red-600 dark:text-red-200" fill="none" viewBox="0 0 24 24" strokeWidth="1.5" stroke="currentColor">
- <path strokeLinecap="round" strokeLinejoin="round" d="M12 9v3.75m-9.303 3.376c-.866 1.5.217 3.374 1.948 3.374h14.71c1.73 0 2.813-1.874 1.948-3.374L13.949 3.378c-.866-1.5-3.032-1.5-3.898 0L2.697 16.126zM12 15.75h.007v.008H12v-.008z" />
- </svg>
+ <Icon name="exclamation" className="h-6 w-6 text-red-600 dark:text-red-200" />
</div>
)}
<div className="mt-3 text-center sm:ml-4 sm:mt-0 sm:text-left">
diff --git a/apps/browser-extension/src/entrypoints/popup/components/Dialogs/ModalWrapper.tsx b/apps/browser-extension/src/entrypoints/popup/components/Dialogs/ModalWrapper.tsx
index 52b9cbefc..700dc72a3 100644
--- a/apps/browser-extension/src/entrypoints/popup/components/Dialogs/ModalWrapper.tsx
+++ b/apps/browser-extension/src/entrypoints/popup/components/Dialogs/ModalWrapper.tsx
@@ -1,6 +1,8 @@
import React, { useEffect, useCallback } from 'react';
import { useTranslation } from 'react-i18next';
+import Icon from '@/entrypoints/popup/components/Icons/Icon';
+
type ModalWrapperProps = {
isOpen: boolean;
onClose: () => void;
@@ -92,9 +94,7 @@ const ModalWrapper: React.FC<ModalWrapperProps> = ({
onClick={onClose}
>
<span className="sr-only">{t('common.close')}</span>
- <svg className="h-6 w-6" fill="none" viewBox="0 0 24 24" strokeWidth="1.5" stroke="currentColor">
- <path strokeLinecap="round" strokeLinejoin="round" d="M6 18L18 6M6 6l12 12" />
- </svg>
+ <Icon name="x" className="h-6 w-6" strokeWidth={1.5} />
</button>
)}
</div>
@@ -108,9 +108,7 @@ const ModalWrapper: React.FC<ModalWrapperProps> = ({
onClick={onClose}
>
<span className="sr-only">{t('common.close')}</span>
- <svg className="h-6 w-6" fill="none" viewBox="0 0 24 24" strokeWidth="1.5" stroke="currentColor">
- <path strokeLinecap="round" strokeLinejoin="round" d="M6 18L18 6M6 6l12 12" />
- </svg>
+ <Icon name="x" className="h-6 w-6" strokeWidth={1.5} />
</button>
)}
diff --git a/apps/browser-extension/src/entrypoints/popup/components/Dialogs/PasswordConfigDialog.tsx b/apps/browser-extension/src/entrypoints/popup/components/Dialogs/PasswordConfigDialog.tsx
index 3c665b7fd..84b280a3d 100644
--- a/apps/browser-extension/src/entrypoints/popup/components/Dialogs/PasswordConfigDialog.tsx
+++ b/apps/browser-extension/src/entrypoints/popup/components/Dialogs/PasswordConfigDialog.tsx
@@ -3,6 +3,7 @@ import { useTranslation } from 'react-i18next';
import ModalWrapper from '@/entrypoints/popup/components/Dialogs/ModalWrapper';
import PasswordConfigForm from '@/entrypoints/popup/components/Forms/PasswordConfigForm';
+import Icon from '@/entrypoints/popup/components/Icons/Icon';
import { usePasswordConfig } from '@/entrypoints/popup/hooks/usePasswordConfig';
import type { PasswordSettings } from '@aliasvault/models/vault';
@@ -67,9 +68,7 @@ const PasswordConfigDialog: React.FC<IPasswordConfigDialogProps> = ({
className="inline-flex w-full items-center justify-center gap-1 rounded-md bg-gray-600 px-3 py-2 text-sm font-semibold text-white shadow-sm hover:bg-gray-500"
onClick={handleSave}
>
- <svg className="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24">
- <path strokeLinecap="round" strokeLinejoin="round" strokeWidth="2" d="M15 13l-3 3m0 0l-3-3m3 3V8m0 13a9 9 0 110-18 9 9 0 010 18z" />
- </svg>
+ <Icon name="arrow-circle-down" className="w-4 h-4" />
{t('common.use')}
</button>
</div>
diff --git a/apps/browser-extension/src/entrypoints/popup/components/EmailPreview.tsx b/apps/browser-extension/src/entrypoints/popup/components/EmailPreview.tsx
index e177603c1..87f77d9be 100644
--- a/apps/browser-extension/src/entrypoints/popup/components/EmailPreview.tsx
+++ b/apps/browser-extension/src/entrypoints/popup/components/EmailPreview.tsx
@@ -7,6 +7,7 @@ import { useTranslation } from 'react-i18next';
import { Link, useLocation } from 'react-router-dom';
import { AttachmentIcon } from '@/entrypoints/popup/components/Icons/AttachmentIcon';
+import Icon from '@/entrypoints/popup/components/Icons/Icon';
import { useDb } from '@/entrypoints/popup/context/DbContext';
import { useWebApi } from '@/entrypoints/popup/context/WebApiContext';
@@ -351,9 +352,7 @@ export const EmailPreview: React.FC<EmailPreviewProps> = ({ email }) => {
className="w-full mt-2 py-1 px-3 bg-gray-50 dark:bg-gray-800 hover:bg-gray-100 dark:hover:bg-gray-700 border border-gray-200 dark:border-gray-600 rounded-md transition-colors duration-200 text-sm text-gray-600 dark:text-gray-300 hover:text-gray-800 dark:hover:text-gray-100 flex items-center justify-center gap-1"
>
<span>{t('common.loadMore')}</span>
- <svg className="w-3 h-3" fill="none" stroke="currentColor" viewBox="0 0 24 24">
- <path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M19 9l-7 7-7-7" />
- </svg>
+ <Icon name="chevron-down" className="w-3 h-3" />
</button>
)}
</div>
diff --git a/apps/browser-extension/src/entrypoints/popup/components/Folders/DeleteFolderModal.tsx b/apps/browser-extension/src/entrypoints/popup/components/Folders/DeleteFolderModal.tsx
index 07367f307..a264e6205 100644
--- a/apps/browser-extension/src/entrypoints/popup/components/Folders/DeleteFolderModal.tsx
+++ b/apps/browser-extension/src/entrypoints/popup/components/Folders/DeleteFolderModal.tsx
@@ -2,6 +2,7 @@ import React, { useState } from 'react';
import { useTranslation } from 'react-i18next';
import ModalWrapper from '@/entrypoints/popup/components/Dialogs/ModalWrapper';
+import Icon from '@/entrypoints/popup/components/Icons/Icon';
import { logFailure } from '@/utils/Diagnostics';
@@ -95,10 +96,7 @@ const DeleteFolderModal: React.FC<DeleteFolderModalProps> = ({
>
<div className="flex items-start gap-3">
<div className="mt-0.5 text-orange-500">
- <svg className="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24">
- <path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M3 7v10a2 2 0 002 2h14a2 2 0 002-2V9a2 2 0 00-2-2h-6l-2-2H5a2 2 0 00-2 2z" />
- <path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M9 14l2 2 4-4" />
- </svg>
+ <Icon name="folder-check" className="w-5 h-5" />
</div>
<div>
<p className="font-medium text-gray-900 dark:text-white">
@@ -121,10 +119,7 @@ const DeleteFolderModal: React.FC<DeleteFolderModalProps> = ({
>
<div className="flex items-start gap-3">
<div className="mt-0.5 text-red-500">
- <svg className="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24">
- <polyline points="3 6 5 6 21 6" />
- <path d="M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2" />
- </svg>
+ <Icon name="trash" className="w-5 h-5" strokeWidth={1} />
</div>
<div>
<p className="font-medium text-red-600 dark:text-red-400">
diff --git a/apps/browser-extension/src/entrypoints/popup/components/Folders/FolderBreadcrumb.tsx b/apps/browser-extension/src/entrypoints/popup/components/Folders/FolderBreadcrumb.tsx
index 9fc8a62b5..d1f9fdb24 100644
--- a/apps/browser-extension/src/entrypoints/popup/components/Folders/FolderBreadcrumb.tsx
+++ b/apps/browser-extension/src/entrypoints/popup/components/Folders/FolderBreadcrumb.tsx
@@ -3,6 +3,7 @@ import React, { useMemo, useCallback } from 'react';
import { useTranslation } from 'react-i18next';
import { useNavigate, useLocation } from 'react-router-dom';
+import Icon from '@/entrypoints/popup/components/Icons/Icon';
import { useDb } from '@/entrypoints/popup/context/DbContext';
import { useNavigationHistory } from '@/entrypoints/popup/hooks/useNavigationHistory';
@@ -115,9 +116,7 @@ const FolderBreadcrumb: React.FC<FolderBreadcrumbProps> = ({
<div className="mb-3 flex items-center gap-1 text-sm text-gray-600 dark:text-gray-400 overflow-x-auto">
{isOnRootPage ? (
<span className="text-gray-900 dark:text-white font-medium flex-shrink-0 flex items-center gap-1">
- <svg className="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24">
- <path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M3 12l2-2m0 0l7-7 7 7M5 10v10a1 1 0 001 1h3m10-11l2 2m-2-2v10a1 1 0 01-1 1h-3m-6 0a1 1 0 001-1v-4a1 1 0 011-1h2a1 1 0 011 1v4a1 1 0 001 1m-6 0h6" />
- </svg>
+ <Icon name="home" className="w-4 h-4" />
{rootLabelText}
</span>
) : (
@@ -125,9 +124,7 @@ const FolderBreadcrumb: React.FC<FolderBreadcrumbProps> = ({
onClick={() => handleBreadcrumbClick(rootPath)}
className="hover:text-orange-600 dark:hover:text-orange-400 transition-colors flex-shrink-0 flex items-center gap-1"
>
- <svg className="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24">
- <path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M3 12l2-2m0 0l7-7 7 7M5 10v10a1 1 0 001 1h3m10-11l2 2m-2-2v10a1 1 0 01-1 1h-3m-6 0a1 1 0 001-1v-4a1 1 0 011-1h2a1 1 0 011 1v4a1 1 0 001 1m-6 0h6" />
- </svg>
+ <Icon name="home" className="w-4 h-4" />
{rootLabelText}
</button>
)}
@@ -136,9 +133,7 @@ const FolderBreadcrumb: React.FC<FolderBreadcrumbProps> = ({
return (
<React.Fragment key={crumb.id}>
- <svg className="w-4 h-4 flex-shrink-0" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2">
- <polyline points="9 6 15 12 9 18" />
- </svg>
+ <Icon name="chevron-right" className="w-4 h-4 flex-shrink-0" />
<button
onClick={() => handleBreadcrumbClick(crumbPath)}
className="hover:text-orange-600 dark:hover:text-orange-400 transition-colors truncate"
diff --git a/apps/browser-extension/src/entrypoints/popup/components/Folders/FolderIcon.tsx b/apps/browser-extension/src/entrypoints/popup/components/Folders/FolderIcon.tsx
index 392b57759..c89191a5c 100644
--- a/apps/browser-extension/src/entrypoints/popup/components/Folders/FolderIcon.tsx
+++ b/apps/browser-extension/src/entrypoints/popup/components/Folders/FolderIcon.tsx
@@ -1,6 +1,8 @@
import { familySharingText } from '@aliasvault/client/sharing/FamilySharingView';
import React from 'react';
+import Icon from '@/entrypoints/popup/components/Icons/Icon';
+
type FolderIconProps = {
isShared?: boolean;
variant?: 'filled' | 'outline';
@@ -20,22 +22,16 @@ const FolderIcon: React.FC<FolderIconProps> = ({
return (
<span className="relative flex-shrink-0">
{variant === 'filled' ? (
- <svg className={className} viewBox="0 0 24 24" fill="currentColor">
- <path d="M10 4H4a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-8l-2-2z" />
- </svg>
+ <Icon name="folder-filled" className={className} />
) : (
- <svg className={className} viewBox="0 0 24 24" fill="none" stroke="currentColor">
- <path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M3 7v10a2 2 0 002 2h14a2 2 0 002-2V9a2 2 0 00-2-2h-6l-2-2H5a2 2 0 00-2 2z" />
- </svg>
+ <Icon name="folder" className={className} />
)}
{isShared && (
<span
title={familySharingText.sharedVault}
className={`absolute -bottom-1 -right-1 flex items-center justify-center w-2.5 h-2.5 rounded-full ring-1 ${badgeClassName}`}
>
- <svg className="w-2 h-2 text-primary-500 dark:text-primary-400" viewBox="0 0 24 24" fill="currentColor">
- <path d="M4.5 6.375a4.125 4.125 0 118.25 0 4.125 4.125 0 01-8.25 0zM14.25 8.625a3.375 3.375 0 116.75 0 3.375 3.375 0 01-6.75 0zM1.5 19.125a7.125 7.125 0 0114.25 0v.003l-.001.119a.75.75 0 01-.363.63 13.067 13.067 0 01-6.761 1.873c-2.472 0-4.786-.684-6.76-1.873a.75.75 0 01-.364-.63l-.001-.122zM17.25 19.128l-.001.144a2.25 2.25 0 01-.233.96 10.088 10.088 0 005.06-1.01.75.75 0 00.42-.643 4.875 4.875 0 00-6.957-4.611 8.586 8.586 0 011.71 5.157v.003z" />
- </svg>
+ <Icon name="users" className="w-2 h-2 text-primary-500 dark:text-primary-400" />
</span>
)}
</span>
diff --git a/apps/browser-extension/src/entrypoints/popup/components/Forms/AddFieldMenu.tsx b/apps/browser-extension/src/entrypoints/popup/components/Forms/AddFieldMenu.tsx
index 0489dbc15..4d322a597 100644
--- a/apps/browser-extension/src/entrypoints/popup/components/Forms/AddFieldMenu.tsx
+++ b/apps/browser-extension/src/entrypoints/popup/components/Forms/AddFieldMenu.tsx
@@ -2,6 +2,8 @@ import { FieldCategories } from '@aliasvault/models/vault';
import React, { useState, useCallback, useMemo } from 'react';
import { useTranslation } from 'react-i18next';
+import Icon from '@/entrypoints/popup/components/Icons/Icon';
+
import CustomFieldModal from './CustomFieldModal';
import type { FieldType, SystemFieldDefinition } from '@aliasvault/models/vault';
@@ -62,36 +64,28 @@ type MenuOption = {
* Notes icon for menu option.
*/
const NotesIcon: React.FC = () => (
- <svg className="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24">
- <path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" />
- </svg>
+ <Icon name="document-text" className="w-5 h-5" />
);
/**
* Lock icon for 2FA menu option.
*/
const LockIcon: React.FC = () => (
- <svg className="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24">
- <path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M12 15v2m-6 4h12a2 2 0 002-2v-6a2 2 0 00-2-2H6a2 2 0 00-2 2v6a2 2 0 002 2zm10-10V7a4 4 0 00-8 0v4h8z" />
- </svg>
+ <Icon name="lock-closed" className="w-5 h-5" />
);
/**
* Attachment icon for menu option.
*/
const AttachmentIcon: React.FC = () => (
- <svg className="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24">
- <path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M15.172 7l-6.586 6.586a2 2 0 102.828 2.828l6.414-6.586a4 4 0 00-5.656-5.656l-6.415 6.585a6 6 0 108.486 8.486L20.5 13" />
- </svg>
+ <Icon name="paper-clip" className="w-5 h-5" />
);
/**
* Plus icon for add button and custom field option.
*/
const PlusIcon: React.FC = () => (
- <svg className="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24">
- <path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M12 6v6m0 0v6m0-6h6m-6 0H6" />
- </svg>
+ <Icon name="plus-sm" className="w-5 h-5" />
);
/**
diff --git a/apps/browser-extension/src/entrypoints/popup/components/Forms/CustomFieldLabel.tsx b/apps/browser-extension/src/entrypoints/popup/components/Forms/CustomFieldLabel.tsx
index e0ac75072..c743bef1a 100644
--- a/apps/browser-extension/src/entrypoints/popup/components/Forms/CustomFieldLabel.tsx
+++ b/apps/browser-extension/src/entrypoints/popup/components/Forms/CustomFieldLabel.tsx
@@ -1,6 +1,8 @@
import React from 'react';
import { useTranslation } from 'react-i18next';
+import Icon from '@/entrypoints/popup/components/Icons/Icon';
+
type CustomFieldLabelProps = {
htmlFor: string;
label: string;
@@ -31,9 +33,7 @@ const CustomFieldLabel: React.FC<CustomFieldLabelProps> = ({
className="text-gray-400 hover:text-gray-600 dark:hover:text-gray-300 text-xs"
title={t('itemTypes.editCustomField')}
>
- <svg className="w-3 h-3" fill="none" stroke="currentColor" viewBox="0 0 24 24">
- <path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M15.232 5.232l3.536 3.536m-2.036-5.036a2.5 2.5 0 113.536 3.536L6.5 21.036H3v-3.572L16.732 3.732z" />
- </svg>
+ <Icon name="pencil" className="w-3 h-3" />
</button>
{onDelete && (
<button
@@ -42,9 +42,7 @@ const CustomFieldLabel: React.FC<CustomFieldLabelProps> = ({
className="text-red-600 dark:text-red-400 hover:text-red-700 dark:hover:text-red-300 text-xs"
title={t('itemTypes.deleteCustomField')}
>
- <svg className="w-3 h-3" fill="none" stroke="currentColor" viewBox="0 0 24 24">
- <path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16" />
- </svg>
+ <Icon name="trash" className="w-3 h-3" />
</button>
)}
</div>
diff --git a/apps/browser-extension/src/entrypoints/popup/components/Forms/EmailDomainField.tsx b/apps/browser-extension/src/entrypoints/popup/components/Forms/EmailDomainField.tsx
index bf7e6a6bb..83601142c 100644
--- a/apps/browser-extension/src/entrypoints/popup/components/Forms/EmailDomainField.tsx
+++ b/apps/browser-extension/src/entrypoints/popup/components/Forms/EmailDomainField.tsx
@@ -1,6 +1,7 @@
import React, { useState, useEffect, useRef, useCallback, useMemo } from 'react';
import { useTranslation } from 'react-i18next';
+import Icon from '@/entrypoints/popup/components/Icons/Icon';
import { useDb } from '@/entrypoints/popup/context/DbContext';
type EmailDomainFieldProps = {
@@ -395,10 +396,7 @@ const EmailDomainField: React.FC<EmailDomainFieldProps> = ({
className="w-5 h-5 flex items-center justify-center text-gray-300 hover:text-red-400 dark:text-gray-500 dark:hover:text-red-400 transition-colors"
title={t('common.delete')}
>
- <svg className="w-4 h-4" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round">
- <line x1="18" y1="6" x2="6" y2="18"/>
- <line x1="6" y1="6" x2="18" y2="18"/>
- </svg>
+ <Icon name="x" className="w-4 h-4" />
</button>
)}
</div>
@@ -436,9 +434,7 @@ const EmailDomainField: React.FC<EmailDomainFieldProps> = ({
className="px-3 text-gray-500 dark:text-white bg-gray-200 hover:bg-gray-300 focus:ring-4 focus:outline-none focus:ring-gray-300 font-medium rounded-r-lg text-sm border-l border-gray-300 dark:border-gray-700 dark:bg-gray-600 dark:hover:bg-gray-700 dark:focus:ring-gray-800"
title={t('common.generate')}
>
- <svg className="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24">
- <path strokeLinecap="round" strokeLinejoin="round" strokeWidth="2" d="M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15" />
- </svg>
+ <Icon name="refresh" className="w-5 h-5" />
</button>
)}
</div>
diff --git a/apps/browser-extension/src/entrypoints/popup/components/Forms/FormInput.tsx b/apps/browser-extension/src/entrypoints/popup/components/Forms/FormInput.tsx
index ed14873fd..e3a0818a1 100644
--- a/apps/browser-extension/src/entrypoints/popup/components/Forms/FormInput.tsx
+++ b/apps/browser-extension/src/entrypoints/popup/components/Forms/FormInput.tsx
@@ -1,54 +1,19 @@
import React, { forwardRef } from 'react';
import { useTranslation } from 'react-i18next';
+import Icon from '@/entrypoints/popup/components/Icons/Icon';
+
+import type { UiIconName } from '@aliasvault/models/icons';
+
/**
* Button configuration for form input.
*/
type FormInputButton = {
- icon: string;
+ icon: UiIconName;
onClick: () => void;
title?: string;
}
-/**
- * Icon component for form input buttons.
- */
-const Icon: React.FC<{ name: string }> = ({ name }) => {
- switch (name) {
- case 'visibility':
- return (
- <>
- <path d="M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z" />
- <circle cx="12" cy="12" r="3" />
- </>
- );
- case 'visibility-off':
- return (
- <>
- <path d="M17.94 17.94A10.07 10.07 0 0 1 12 20c-7 0-11-8-11-8a18.45 18.45 0 0 1 5.06-5.94M9.9 4.24A9.12 9.12 0 0 1 12 4c7 0 11 8 11 8a18.5 18.5 0 0 1-2.16 3.19m-6.72-1.07a3 3 0 1 1-4.24-4.24" />
- <line x1="1" y1="1" x2="23" y2="23" />
- </>
- );
- case 'refresh':
- return (
- <>
- <path d="M23 4v6h-6" />
- <path d="M1 20v-6h6" />
- <path d="M3.51 9a9 9 0 0 1 14.85-3.36L23 10M1 14l4.64 4.36A9 9 0 0 0 20.49 15" />
- </>
- );
- case 'settings':
- return (
- <>
- <path d="M10.325 4.317c.426-1.756 2.924-1.756 3.35 0a1.724 1.724 0 002.573 1.066c1.543-.94 3.31.826 2.37 2.37a1.724 1.724 0 001.065 2.572c1.756.426 1.756 2.924 0 3.35a1.724 1.724 0 00-1.066 2.573c.94 1.543-.826 3.31-2.37 2.37a1.724 1.724 0 00-2.572 1.065c-.426 1.756-2.924 1.756-3.35 0a1.724 1.724 0 00-2.573-1.066c-1.543.94-3.31-.826-2.37-2.37a1.724 1.724 0 00-1.065-2.572c-1.756-.426-1.756-2.924 0-3.35a1.724 1.724 0 001.066-2.573c-.94-1.543.826-3.31 2.37-2.37.996.608 2.296.07 2.572-1.065z" />
- <path d="M15 12a3 3 0 11-6 0 3 3 0 016 0z" />
- </>
- );
- default:
- return null;
- }
-};
-
/**
* Form input props.
*/
@@ -116,9 +81,9 @@ export const FormInput = forwardRef<HTMLInputElement, FormInputProps>(({
} text-gray-900 sm:text-sm rounded-lg shadow-sm border focus:ring-primary-500 focus:border-primary-500 dark:bg-gray-700 dark:border-gray-600 dark:text-white dark:placeholder-gray-400 py-2 px-3`;
// Add password visibility button if type is password
- const allButtons = type === 'password'
+ const allButtons: FormInputButton[] = type === 'password'
? [...buttons, {
- icon: showPassword ? 'visibility-off' : 'visibility',
+ icon: showPassword ? 'eye-off' : 'eye',
/**
* Toggle password visibility.
*/
@@ -165,9 +130,7 @@ export const FormInput = forwardRef<HTMLInputElement, FormInputProps>(({
title={button.title}
className="p-1 text-gray-600 hover:text-gray-900 dark:text-gray-400 dark:hover:text-white transition-colors duration-200"
>
- <svg className="w-4 h-4" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round">
- <Icon name={button.icon} />
- </svg>
+ <Icon name={button.icon} className="w-4 h-4" />
</button>
))}
</div>
diff --git a/apps/browser-extension/src/entrypoints/popup/components/Forms/FormInputCopyToClipboard.tsx b/apps/browser-extension/src/entrypoints/popup/components/Forms/FormInputCopyToClipboard.tsx
index 0ff54c17f..99ee4f642 100644
--- a/apps/browser-extension/src/entrypoints/popup/components/Forms/FormInputCopyToClipboard.tsx
+++ b/apps/browser-extension/src/entrypoints/popup/components/Forms/FormInputCopyToClipboard.tsx
@@ -1,6 +1,7 @@
import React, { useState, useEffect } from 'react';
import { useTranslation } from 'react-i18next';
+import Icon from '@/entrypoints/popup/components/Icons/Icon';
import { ClipboardCopyService } from '@/entrypoints/popup/utils/ClipboardCopyService';
import { logExpected } from '@/utils/Diagnostics';
@@ -22,43 +23,6 @@ type FormInputCopyToClipboardProps = {
const clipboardService = new ClipboardCopyService();
-/**
- * Icon component for form input buttons.
- */
-const Icon: React.FC<{ name: string }> = ({ name }) => {
- switch (name) {
- case 'visibility':
- return (
- <>
- <path d="M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z" />
- <circle cx="12" cy="12" r="3" />
- </>
- );
- case 'visibility-off':
- return (
- <>
- <path d="M17.94 17.94A10.07 10.07 0 0 1 12 20c-7 0-11-8-11-8a18.45 18.45 0 0 1 5.06-5.94M9.9 4.24A9.12 9.12 0 0 1 12 4c7 0 11 8 11 8a18.5 18.5 0 0 1-2.16 3.19m-6.72-1.07a3 3 0 1 1-4.24-4.24" />
- <line x1="1" y1="1" x2="23" y2="23" />
- </>
- );
- case 'copy':
- return (
- <>
- <rect x="9" y="9" width="13" height="13" rx="2" ry="2" />
- <path d="M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1" />
- </>
- );
- case 'check':
- return (
- <>
- <polyline points="20 6 9 17 4 12" />
- </>
- );
- default:
- return null;
- }
-};
-
/**
* Form input copy to clipboard component.
*/
@@ -154,9 +118,7 @@ export const FormInputCopyToClipboard: React.FC<FormInputCopyToClipboardProps> =
className="p-1 text-green-500 dark:text-green-400 transition-colors duration-200"
title={t('common.copiedShort')}
>
- <svg className="w-4 h-4" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round">
- <Icon name="check" />
- </svg>
+ <Icon name="check" className="w-4 h-4" />
</button>
) : (
<button
@@ -165,9 +127,7 @@ export const FormInputCopyToClipboard: React.FC<FormInputCopyToClipboardProps> =
className="p-1 text-gray-600 hover:text-gray-900 dark:text-gray-400 dark:hover:text-white transition-colors duration-200"
title={t('common.copyToClipboard')}
>
- <svg className="w-4 h-4" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round">
- <Icon name="copy" />
- </svg>
+ <Icon name="duplicate" className="w-4 h-4" />
</button>
)}
{type === 'password' && (
@@ -177,9 +137,7 @@ export const FormInputCopyToClipboard: React.FC<FormInputCopyToClipboardProps> =
className="p-1 text-gray-600 hover:text-gray-900 dark:text-gray-400 dark:hover:text-white transition-colors duration-200"
title={showPassword ? t('common.hidePassword') : t('common.showPassword')}
>
- <svg className="w-4 h-4" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round">
- <Icon name={showPassword ? 'visibility-off' : 'visibility'} />
- </svg>
+ <Icon name={showPassword ? 'eye-off' : 'eye'} className="w-4 h-4" />
</button>
)}
</div>
diff --git a/apps/browser-extension/src/entrypoints/popup/components/Forms/HiddenField.tsx b/apps/browser-extension/src/entrypoints/popup/components/Forms/HiddenField.tsx
index 1948a3a3d..9954aa515 100644
--- a/apps/browser-extension/src/entrypoints/popup/components/Forms/HiddenField.tsx
+++ b/apps/browser-extension/src/entrypoints/popup/components/Forms/HiddenField.tsx
@@ -1,6 +1,8 @@
import React, { useState, useCallback } from 'react';
import { useTranslation } from 'react-i18next';
+import Icon from '@/entrypoints/popup/components/Icons/Icon';
+
interface IHiddenFieldProps {
id: string;
label: string;
@@ -74,16 +76,7 @@ const HiddenField: React.FC<IHiddenFieldProps> = ({
className="px-3 text-gray-500 dark:text-white bg-gray-200 hover:bg-gray-300 focus:ring-4 focus:outline-none focus:ring-gray-300 font-medium rounded-r-lg text-sm dark:bg-gray-600 dark:hover:bg-gray-700 dark:focus:ring-gray-800"
title={showValue ? t('common.hidePassword') : t('common.showPassword')}
>
- <svg className="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24">
- {showValue ? (
- <path strokeLinecap="round" strokeLinejoin="round" strokeWidth="2" d="M13.875 18.825A10.05 10.05 0 0112 19c-4.478 0-8.268-2.943-9.543-7a9.97 9.97 0 011.563-3.029m5.858.908a3 3 0 114.243 4.243M9.878 9.878l4.242 4.242M9.88 9.88l-3.29-3.29m7.532 7.532l3.29 3.29M3 3l3.59 3.59m0 0A9.953 9.953 0 0112 5c4.478 0 8.268 2.943 9.543 7a10.025 10.025 0 01-4.132 5.411m0 0L21 21" />
- ) : (
- <>
- <path strokeLinecap="round" strokeLinejoin="round" strokeWidth="2" d="M15 12a3 3 0 11-6 0 3 3 0 016 0z" />
- <path strokeLinecap="round" strokeLinejoin="round" strokeWidth="2" d="M2.458 12C3.732 7.943 7.523 5 12 5c4.478 0 8.268 2.943 9.542 7-1.274 4.057-5.064 7-9.542 7-4.477 0-8.268-2.943-9.542-7z" />
- </>
- )}
- </svg>
+ <Icon name={showValue ? 'eye-off' : 'eye'} className="w-5 h-5" />
</button>
</div>
</div>
diff --git a/apps/browser-extension/src/entrypoints/popup/components/Forms/PasswordConfigForm.tsx b/apps/browser-extension/src/entrypoints/popup/components/Forms/PasswordConfigForm.tsx
index 72f88731a..d2f8d6743 100644
--- a/apps/browser-extension/src/entrypoints/popup/components/Forms/PasswordConfigForm.tsx
+++ b/apps/browser-extension/src/entrypoints/popup/components/Forms/PasswordConfigForm.tsx
@@ -4,6 +4,8 @@ import { MIN_WORD_COUNT, MAX_WORD_COUNT, DEFAULT_WORD_COUNT } from '@aliasvault/
import React from 'react';
import { useTranslation } from 'react-i18next';
+import Icon from '@/entrypoints/popup/components/Icons/Icon';
+
import type {
PasswordSettings,
PasswordGeneratorType,
@@ -154,9 +156,7 @@ const PasswordConfigForm: React.FC<IPasswordConfigFormProps> = ({
className="px-3 py-2 text-sm text-gray-500 dark:text-white bg-gray-200 hover:bg-gray-300 focus:ring-4 focus:outline-none focus:ring-gray-300 font-medium rounded-lg dark:bg-gray-600 dark:hover:bg-gray-700 dark:focus:ring-gray-800"
title={t('common.generate')}
>
- <svg className="w-4 h-6" fill="none" stroke="currentColor" viewBox="0 0 24 24">
- <path strokeLinecap="round" strokeLinejoin="round" strokeWidth="2" d="M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15"></path>
- </svg>
+ <Icon name="refresh" className="w-4 h-6" />
</button>
</div>
</div>
diff --git a/apps/browser-extension/src/entrypoints/popup/components/Forms/PasswordField.tsx b/apps/browser-extension/src/entrypoints/popup/components/Forms/PasswordField.tsx
index bbe9743e3..406f68018 100644
--- a/apps/browser-extension/src/entrypoints/popup/components/Forms/PasswordField.tsx
+++ b/apps/browser-extension/src/entrypoints/popup/components/Forms/PasswordField.tsx
@@ -5,6 +5,7 @@ import React, { useState, useEffect, useCallback } from 'react';
import { useTranslation } from 'react-i18next';
import PasswordConfigDialog from '@/entrypoints/popup/components/Dialogs/PasswordConfigDialog';
+import Icon from '@/entrypoints/popup/components/Icons/Icon';
import { useDb } from '@/entrypoints/popup/context/DbContext';
import { logFailure } from '@/utils/Diagnostics';
@@ -195,16 +196,7 @@ const PasswordField: React.FC<IPasswordFieldProps> = ({
className="px-3 text-gray-500 dark:text-white bg-gray-200 hover:bg-gray-300 focus:ring-4 focus:outline-none focus:ring-gray-300 font-medium text-sm dark:bg-gray-600 dark:hover:bg-gray-700 dark:focus:ring-gray-800"
title={showPassword ? t('common.hidePassword') : t('common.showPassword')}
>
- <svg className="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24">
- {showPassword ? (
- <path strokeLinecap="round" strokeLinejoin="round" strokeWidth="2" d="M13.875 18.825A10.05 10.05 0 0112 19c-4.478 0-8.268-2.943-9.543-7a9.97 9.97 0 011.563-3.029m5.858.908a3 3 0 114.243 4.243M9.878 9.878l4.242 4.242M9.88 9.88l-3.29-3.29m7.532 7.532l3.29 3.29M3 3l3.59 3.59m0 0A9.953 9.953 0 0112 5c4.478 0 8.268 2.943 9.543 7a10.025 10.025 0 01-4.132 5.411m0 0L21 21" />
- ) : (
- <>
- <path strokeLinecap="round" strokeLinejoin="round" strokeWidth="2" d="M15 12a3 3 0 11-6 0 3 3 0 016 0z" />
- <path strokeLinecap="round" strokeLinejoin="round" strokeWidth="2" d="M2.458 12C3.732 7.943 7.523 5 12 5c4.478 0 8.268 2.943 9.542 7-1.274 4.057-5.064 7-9.542 7-4.477 0-8.268-2.943-9.542-7z" />
- </>
- )}
- </svg>
+ <Icon name={showPassword ? 'eye-off' : 'eye'} className="w-5 h-5" />
</button>
{/* Generate Password Button */}
@@ -214,9 +206,7 @@ const PasswordField: React.FC<IPasswordFieldProps> = ({
className="px-3 text-gray-500 dark:text-white bg-gray-200 hover:bg-gray-300 focus:ring-4 focus:outline-none focus:ring-gray-300 font-medium rounded-r-lg text-sm border-l border-gray-300 dark:border-gray-700 dark:bg-gray-600 dark:hover:bg-gray-700 dark:focus:ring-gray-800"
title={t('common.generate')}
>
- <svg className="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24">
- <path strokeLinecap="round" strokeLinejoin="round" strokeWidth="2" d="M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15" />
- </svg>
+ <Icon name="refresh" className="w-5 h-5" />
</button>
</div>
</div>
@@ -237,10 +227,7 @@ const PasswordField: React.FC<IPasswordFieldProps> = ({
className="text-gray-500 hover:text-gray-700 dark:text-gray-400 dark:hover:text-gray-300"
title={t('items.changePasswordComplexity')}
>
- <svg className="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24">
- <path strokeLinecap="round" strokeLinejoin="round" strokeWidth="2" d="M10.325 4.317c.426-1.756 2.924-1.756 3.35 0a1.724 1.724 0 002.573 1.066c1.543-.94 3.31.826 2.37 2.37a1.724 1.724 0 001.065 2.572c1.756.426 1.756 2.924 0 3.35a1.724 1.724 0 00-1.066 2.573c.94 1.543-.826 3.31-2.37 2.37a1.724 1.724 0 00-2.572 1.065c-.426 1.756-2.924 1.756-3.35 0a1.724 1.724 0 00-2.573-1.066c-1.543.94-3.31-.826-2.37-2.37a1.724 1.724 0 00-1.065-2.572c-1.756-.426-1.756-2.924 0-3.35a1.724 1.724 0 001.066-2.573c-.94-1.543.826-3.31 2.37-2.37.996.608 2.296.07 2.572-1.065z" />
- <path strokeLinecap="round" strokeLinejoin="round" strokeWidth="2" d="M15 12a3 3 0 11-6 0 3 3 0 016 0z" />
- </svg>
+ <Icon name="cog" className="w-5 h-5" />
</button>
</div>
</div>
diff --git a/apps/browser-extension/src/entrypoints/popup/components/Forms/UsernameField.tsx b/apps/browser-extension/src/entrypoints/popup/components/Forms/UsernameField.tsx
index db33d5257..9e3078f68 100644
--- a/apps/browser-extension/src/entrypoints/popup/components/Forms/UsernameField.tsx
+++ b/apps/browser-extension/src/entrypoints/popup/components/Forms/UsernameField.tsx
@@ -1,6 +1,8 @@
import React, { useCallback } from 'react';
import { useTranslation } from 'react-i18next';
+import Icon from '@/entrypoints/popup/components/Icons/Icon';
+
interface IUsernameFieldProps {
id: string;
label: string;
@@ -60,9 +62,7 @@ const UsernameField: React.FC<IUsernameFieldProps> = ({
className="px-3 text-gray-500 dark:text-white bg-gray-200 hover:bg-gray-300 focus:ring-4 focus:outline-none focus:ring-gray-300 font-medium rounded-r-lg text-sm dark:bg-gray-600 dark:hover:bg-gray-700 dark:focus:ring-gray-800"
title={t('common.generate')}
>
- <svg className="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24">
- <path strokeLinecap="round" strokeLinejoin="round" strokeWidth="2" d="M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15" />
- </svg>
+ <Icon name="refresh" className="w-5 h-5" />
</button>
</div>
</div>
diff --git a/apps/browser-extension/src/entrypoints/popup/components/HeaderButton.tsx b/apps/browser-extension/src/entrypoints/popup/components/HeaderButton.tsx
index 15285bf60..f5e2b6f2f 100644
--- a/apps/browser-extension/src/entrypoints/popup/components/HeaderButton.tsx
+++ b/apps/browser-extension/src/entrypoints/popup/components/HeaderButton.tsx
@@ -1,6 +1,7 @@
import React from 'react';
import { HeaderIcon, HeaderIconType } from '@/entrypoints/popup/components/Icons/HeaderIcons';
+import Icon from '@/entrypoints/popup/components/Icons/Icon';
type HeaderButtonProps = {
onClick: () => void;
@@ -54,10 +55,7 @@ const HeaderButton: React.FC<HeaderButtonProps> = ({
title={title}
>
{isLoading ? (
- <svg className="animate-spin h-5 w-5" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24">
- <circle className="opacity-25" cx="12" cy="12" r="10" stroke="currentColor" strokeWidth="4"></circle>
- <path className="opacity-75" fill="currentColor" d="M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"></path>
- </svg>
+ <Icon name="spinner" className="animate-spin h-5 w-5" />
) : (
<HeaderIcon type={iconType} />
)}
diff --git a/apps/browser-extension/src/entrypoints/popup/components/Icons/AttachmentIcon.tsx b/apps/browser-extension/src/entrypoints/popup/components/Icons/AttachmentIcon.tsx
index af99c0d05..ce05456f5 100644
--- a/apps/browser-extension/src/entrypoints/popup/components/Icons/AttachmentIcon.tsx
+++ b/apps/browser-extension/src/entrypoints/popup/components/Icons/AttachmentIcon.tsx
@@ -1,5 +1,7 @@
import React from 'react';
+import Icon from '@/entrypoints/popup/components/Icons/Icon';
+
type AttachmentIconProps = {
className?: string;
};
@@ -8,19 +10,5 @@ type AttachmentIconProps = {
* Paperclip icon used to indicate that an email carries attachments.
*/
export const AttachmentIcon: React.FC<AttachmentIconProps> = ({ className = 'w-4 h-4' }) => (
- <svg
- className={className}
- fill="none"
- stroke="currentColor"
- viewBox="0 0 24 24"
- xmlns="http://www.w3.org/2000/svg"
- aria-hidden="true"
- >
- <path
- strokeLinecap="round"
- strokeLinejoin="round"
- strokeWidth={2}
- d="M15.172 7l-6.586 6.586a2 2 0 102.828 2.828l6.414-6.586a4 4 0 00-5.656-5.656l-6.415 6.585a6 6 0 108.486 8.486L20.5 13"
- />
- </svg>
+ <Icon name="paper-clip" className={className} />
);
diff --git a/apps/browser-extension/src/entrypoints/popup/components/Icons/HeaderIcons.tsx b/apps/browser-extension/src/entrypoints/popup/components/Icons/HeaderIcons.tsx
index 7ab877be1..de39f8451 100644
--- a/apps/browser-extension/src/entrypoints/popup/components/Icons/HeaderIcons.tsx
+++ b/apps/browser-extension/src/entrypoints/popup/components/Icons/HeaderIcons.tsx
@@ -1,5 +1,9 @@
import React from 'react';
+import Icon from '@/entrypoints/popup/components/Icons/Icon';
+
+import type { UiIconName } from '@aliasvault/models/icons';
+
export enum HeaderIconType {
EXPAND = 'expand',
EDIT = 'edit',
@@ -9,11 +13,23 @@ export enum HeaderIconType {
EXTERNAL_LINK = 'external_link',
SAVE = 'save',
PLUS = 'plus',
- TAB = 'tab',
EYE = 'eye',
EYE_OFF = 'eye_off'
}
+const HEADER_ICONS: Record<HeaderIconType, UiIconName> = {
+ [HeaderIconType.EXPAND]: 'arrows-expand',
+ [HeaderIconType.EDIT]: 'pencil-alt',
+ [HeaderIconType.DELETE]: 'trash',
+ [HeaderIconType.SETTINGS]: 'cog',
+ [HeaderIconType.RELOAD]: 'refresh',
+ [HeaderIconType.EXTERNAL_LINK]: 'external-link',
+ [HeaderIconType.SAVE]: 'check',
+ [HeaderIconType.PLUS]: 'plus',
+ [HeaderIconType.EYE]: 'eye',
+ [HeaderIconType.EYE_OFF]: 'eye-off',
+};
+
type HeaderIconProps = {
type: HeaderIconType;
className?: string;
@@ -22,193 +38,6 @@ type HeaderIconProps = {
/**
* Component to render header icons
*/
-export const HeaderIcon: React.FC<HeaderIconProps> = ({ type, className = 'w-5 h-5' }) => {
- const icons = {
- [HeaderIconType.EXPAND]: (
- <svg
- className={className}
- fill="none"
- stroke="currentColor"
- viewBox="0 0 24 24"
- xmlns="http://www.w3.org/2000/svg"
- >
- <path
- strokeLinecap="round"
- strokeLinejoin="round"
- strokeWidth={2}
- d="M4 8V4m0 0h4M4 4l5 5m11-1V4m0 0h-4m4 0l-5 5M4 16v4m0 0h4m-4 0l5-5m11 5l-5-5m5 5v-4m0 4h-4"
- />
- </svg>
- ),
- [HeaderIconType.EDIT]: (
- <svg
- className={className}
- fill="none"
- stroke="currentColor"
- viewBox="0 0 24 24"
- xmlns="http://www.w3.org/2000/svg"
- >
- <path
- strokeLinecap="round"
- strokeLinejoin="round"
- strokeWidth={2}
- d="M11 5H6a2 2 0 00-2 2v11a2 2 0 002 2h11a2 2 0 002-2v-5m-1.414-9.414a2 2 0 112.828 2.828L11.828 15H9v-2.828l8.586-8.586z"
- />
- </svg>
- ),
- [HeaderIconType.DELETE]: (
- <svg
- className={className}
- fill="none"
- stroke="currentColor"
- viewBox="0 0 24 24"
- xmlns="http://www.w3.org/2000/svg"
- >
- <path
- strokeLinecap="round"
- strokeLinejoin="round"
- strokeWidth={2}
- d="M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16"
- />
- </svg>
- ),
- [HeaderIconType.SETTINGS]: (
- <svg
- className={className}
- fill="none"
- stroke="currentColor"
- viewBox="0 0 24 24"
- xmlns="http://www.w3.org/2000/svg"
- >
- <path
- strokeLinecap="round"
- strokeLinejoin="round"
- strokeWidth={2}
- d="M10.325 4.317c.426-1.756 2.924-1.756 3.35 0a1.724 1.724 0 002.573 1.066c1.543-.94 3.31.826 2.37 2.37a1.724 1.724 0 001.065 2.572c1.756.426 1.756 2.924 0 3.35a1.724 1.724 0 00-1.066 2.573c.94 1.543-.826 3.31-2.37 2.37a1.724 1.724 0 00-2.572 1.065c-.426 1.756-2.924 1.756-3.35 0a1.724 1.724 0 00-2.573-1.066c-1.543.94-3.31-.826-2.37-2.37a1.724 1.724 0 00-1.065-2.572c-1.756-.426-1.756-2.924 0-3.35a1.724 1.724 0 001.066-2.573c-.94-1.543.826-3.31 2.37-2.37.996.608 2.296.07 2.572-1.065z"
- />
- <path
- strokeLinecap="round"
- strokeLinejoin="round"
- strokeWidth={2}
- d="M15 12a3 3 0 11-6 0 3 3 0 016 0z"
- />
- </svg>
- ),
- [HeaderIconType.RELOAD]: (
- <svg
- className={className}
- fill="none"
- stroke="currentColor"
- viewBox="0 0 24 24"
- xmlns="http://www.w3.org/2000/svg"
- >
- <path
- strokeLinecap="round"
- strokeLinejoin="round"
- strokeWidth={2}
- d="M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15"
- />
- </svg>
- ),
- [HeaderIconType.EXTERNAL_LINK]: (
- <svg
- className={className}
- fill="currentColor"
- viewBox="0 0 20 20"
- xmlns="http://www.w3.org/2000/svg"
- >
- <path d="M11 3a1 1 0 100 2h2.586l-6.293 6.293a1 1 0 101.414 1.414L15 6.414V9a1 1 0 102 0V4a1 1 0 00-1-1h-5z" />
- <path d="M5 5a2 2 0 00-2 2v8a2 2 0 002 2h8a2 2 0 002-2v-3a1 1 0 10-2 0v3H5V7h3a1 1 0 000-2H5z" />
- </svg>
- ),
- [HeaderIconType.SAVE]: (
- <svg
- className={className}
- fill="none"
- stroke="currentColor"
- viewBox="0 0 24 24"
- xmlns="http://www.w3.org/2000/svg"
- >
- <path
- strokeLinecap="round"
- strokeLinejoin="round"
- strokeWidth={2}
- d="M5 13l4 4L19 7"
- />
- </svg>
- ),
- [HeaderIconType.PLUS]: (
- <svg
- className={className}
- fill="none"
- stroke="currentColor"
- viewBox="0 0 24 24"
- xmlns="http://www.w3.org/2000/svg"
- >
- <path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M12 4v16m8-8H4" />
- </svg>
- ),
- [HeaderIconType.TAB]: (
- <svg
- className={className}
- fill="none"
- stroke="currentColor"
- viewBox="0 0 24 24"
- xmlns="http://www.w3.org/2000/svg"
- >
- <path
- strokeLinecap="round"
- strokeLinejoin="round"
- strokeWidth={2}
- d="M3 7v10a2 2 0 002 2h14a2 2 0 002-2V9a2 2 0 00-2-2H5a2 2 0 00-2-2z"
- />
- <path
- strokeLinecap="round"
- strokeLinejoin="round"
- strokeWidth={2}
- d="M8 5a2 2 0 012-2h4a2 2 0 012 2v2H8V5z"
- />
- </svg>
- ),
- [HeaderIconType.EYE]: (
- <svg
- className={className}
- fill="none"
- stroke="currentColor"
- viewBox="0 0 24 24"
- xmlns="http://www.w3.org/2000/svg"
- >
- <path
- strokeLinecap="round"
- strokeLinejoin="round"
- strokeWidth={2}
- d="M15 12a3 3 0 11-6 0 3 3 0 016 0z"
- />
- <path
- strokeLinecap="round"
- strokeLinejoin="round"
- strokeWidth={2}
- d="M2.458 12C3.732 7.943 7.523 5 12 5c4.478 0 8.268 2.943 9.542 7-1.274 4.057-5.064 7-9.542 7-4.477 0-8.268-2.943-9.542-7z"
- />
- </svg>
- ),
- [HeaderIconType.EYE_OFF]: (
- <svg
- className={className}
- fill="none"
- stroke="currentColor"
- viewBox="0 0 24 24"
- xmlns="http://www.w3.org/2000/svg"
- >
- <path
- strokeLinecap="round"
- strokeLinejoin="round"
- strokeWidth={2}
- d="M13.875 18.825A10.05 10.05 0 0112 19c-4.478 0-8.268-2.943-9.543-7a9.97 9.97 0 011.563-3.029m5.858.908a3 3 0 114.243 4.243M9.878 9.878l4.242 4.242M9.88 9.88l-3.29-3.29m7.532 7.532l3.29 3.29M3 3l3.59 3.59m0 0A9.953 9.953 0 0112 5c4.478 0 8.268 2.943 9.543 7a10.025 10.025 0 01-4.132 5.411m0 0L21 21"
- />
- </svg>
- )
- };
-
- return icons[type] || null;
-};
\ No newline at end of file
+export const HeaderIcon: React.FC<HeaderIconProps> = ({ type, className = 'w-5 h-5' }) => (
+ <Icon name={HEADER_ICONS[type]} className={className} />
+);
diff --git a/apps/browser-extension/src/entrypoints/popup/components/Icons/Icon.tsx b/apps/browser-extension/src/entrypoints/popup/components/Icons/Icon.tsx
new file mode 100644
index 000000000..b65ddf17c
--- /dev/null
+++ b/apps/browser-extension/src/entrypoints/popup/components/Icons/Icon.tsx
@@ -0,0 +1,23 @@
+import { UiIcons, type UiIconName } from '@aliasvault/models/icons';
+import React from 'react';
+
+/**
+ * Icon props: the icon name plus any svg prop, which overrides the icon's own attributes.
+ */
+export type IconProps = Omit<React.SVGProps<SVGSVGElement>, 'name'> & {
+ name: UiIconName;
+};
+
+/**
+ * A UI icon from the shared catalog in core/models/src/icons.
+ */
+const Icon: React.FC<IconProps> = ({ name, ...props }) => {
+ const icon = UiIcons[name];
+ return (
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox={icon.viewBox} aria-hidden={props['aria-label'] ? undefined : true} {...icon.attrs} {...props}>
+ {icon.nodes.map(([tag, attrs], index) => React.createElement(tag, { key: index, ...attrs }))}
+ </svg>
+ );
+};
+
+export default Icon;
diff --git a/apps/browser-extension/src/entrypoints/popup/components/Items/CurrentSiteSuggestion.tsx b/apps/browser-extension/src/entrypoints/popup/components/Items/CurrentSiteSuggestion.tsx
index 85051c99a..baf9825a6 100644
--- a/apps/browser-extension/src/entrypoints/popup/components/Items/CurrentSiteSuggestion.tsx
+++ b/apps/browser-extension/src/entrypoints/popup/components/Items/CurrentSiteSuggestion.tsx
@@ -3,6 +3,7 @@ import React, { useEffect, useMemo, useState } from 'react';
import { useTranslation } from 'react-i18next';
import { useNavigate } from 'react-router-dom';
+import Icon from '@/entrypoints/popup/components/Icons/Icon';
import useCurrentTabInfo from '@/entrypoints/popup/hooks/useCurrentTabInfo';
import { itemRoute } from '@/utils/ItemRoute';
@@ -70,9 +71,7 @@ const CurrentSiteSuggestion: React.FC<CurrentSiteSuggestionProps> = ({ items, on
{item.Name || t('items.untitled')}
</p>
</div>
- <svg className="w-5 h-5 flex-shrink-0 text-orange-500 dark:text-orange-400" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round">
- <polyline points="9 18 15 12 9 6" />
- </svg>
+ <Icon name="chevron-right" className="w-5 h-5 flex-shrink-0 text-orange-500 dark:text-orange-400" />
</button>
);
}
@@ -84,16 +83,11 @@ const CurrentSiteSuggestion: React.FC<CurrentSiteSuggestionProps> = ({ items, on
onClick={() => onSearch(domain)}
className="w-full mb-4 p-2 flex items-center gap-2 rounded-lg border border-orange-300 dark:border-orange-500/40 bg-orange-50 dark:bg-orange-900/20 hover:bg-orange-100 dark:hover:bg-orange-900/30 transition-colors focus:outline-none focus:ring-2 focus:ring-orange-500 text-left"
>
- <svg className="w-5 h-5 flex-shrink-0 text-orange-500 dark:text-orange-400" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round">
- <circle cx="11" cy="11" r="8" />
- <line x1="21" y1="21" x2="16.65" y2="16.65" />
- </svg>
+ <Icon name="search" className="w-5 h-5 flex-shrink-0 text-orange-500 dark:text-orange-400" />
<span className="min-w-0 text-sm flex-1 font-medium text-orange-700 dark:text-orange-300 truncate">
{domain} ({t('items.numberOfItemMatchesFound', { count: matches.length })})
</span>
- <svg className="w-5 h-5 flex-shrink-0 text-orange-500 dark:text-orange-400" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round">
- <polyline points="9 18 15 12 9 6" />
- </svg>
+ <Icon name="chevron-right" className="w-5 h-5 flex-shrink-0 text-orange-500 dark:text-orange-400" />
</button>
);
}
diff --git a/apps/browser-extension/src/entrypoints/popup/components/Items/Details/AttachmentBlock.tsx b/apps/browser-extension/src/entrypoints/popup/components/Items/Details/AttachmentBlock.tsx
index 8f6c0d753..a35ea0e78 100644
--- a/apps/browser-extension/src/entrypoints/popup/components/Items/Details/AttachmentBlock.tsx
+++ b/apps/browser-extension/src/entrypoints/popup/components/Items/Details/AttachmentBlock.tsx
@@ -2,6 +2,7 @@ import { downloadBytes } from '@aliasvault/client/utilities/FileDownload';
import React, { useState, useEffect } from 'react';
import { useTranslation } from 'react-i18next';
+import Icon from '@/entrypoints/popup/components/Icons/Icon';
import { useDb } from '@/entrypoints/popup/context/DbContext';
import { logFailure } from '@/utils/Diagnostics';
@@ -90,9 +91,7 @@ const AttachmentBlock: React.FC<AttachmentBlockProps> = ({ itemId, manifestId })
</div>
</div>
<div className="flex items-center">
- <svg className="w-4 h-4 text-gray-500 dark:text-gray-400" fill="none" stroke="currentColor" viewBox="0 0 24 24">
- <path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M4 16v2a2 2 0 002 2h12a2 2 0 002-2v-2M7 10l5 5m0 0l5-5m-5 5V4" />
- </svg>
+ <Icon name="download" className="w-4 h-4 text-gray-500 dark:text-gray-400" />
</div>
</div>
</button>
diff --git a/apps/browser-extension/src/entrypoints/popup/components/Items/Details/AttachmentUploader.tsx b/apps/browser-extension/src/entrypoints/popup/components/Items/Details/AttachmentUploader.tsx
index 411f0747b..89a80420d 100644
--- a/apps/browser-extension/src/entrypoints/popup/components/Items/Details/AttachmentUploader.tsx
+++ b/apps/browser-extension/src/entrypoints/popup/components/Items/Details/AttachmentUploader.tsx
@@ -1,6 +1,7 @@
import React, { useState } from 'react';
import { useTranslation } from 'react-i18next';
+import Icon from '@/entrypoints/popup/components/Icons/Icon';
import { PopoutUtility } from '@/entrypoints/popup/utils/PopoutUtility';
import { logFailure } from '@/utils/Diagnostics';
@@ -164,9 +165,7 @@ const AttachmentUploader: React.FC<AttachmentUploaderProps> = ({
className="text-red-500 hover:text-red-700 focus:outline-none"
aria-label={`Delete ${attachment.Filename}`}
>
- <svg className="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24">
- <path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16" />
- </svg>
+ <Icon name="trash" className="w-4 h-4" />
</button>
</div>
))}
diff --git a/apps/browser-extension/src/entrypoints/popup/components/Items/Details/FieldBlock.tsx b/apps/browser-extension/src/entrypoints/popup/components/Items/Details/FieldBlock.tsx
index b74501506..40e1dd3d8 100644
--- a/apps/browser-extension/src/entrypoints/popup/components/Items/Details/FieldBlock.tsx
+++ b/apps/browser-extension/src/entrypoints/popup/components/Items/Details/FieldBlock.tsx
@@ -3,6 +3,7 @@ import React, { useState, useEffect } from 'react';
import { useTranslation } from 'react-i18next';
import { FormInputCopyToClipboard } from '@/entrypoints/popup/components/Forms/FormInputCopyToClipboard';
+import Icon from '@/entrypoints/popup/components/Icons/Icon';
import { useDb } from '@/entrypoints/popup/context/DbContext';
import { logFailure } from '@/utils/Diagnostics';
@@ -172,9 +173,7 @@ const FieldBlock: React.FC<FieldBlockProps> = ({ field, itemId, manifestId, hide
className="ml-2 inline-flex items-center text-gray-500 hover:text-gray-700 dark:text-gray-400 dark:hover:text-gray-200 focus:outline-none"
title={t('items.viewHistory')}
>
- <svg className="h-4 w-4" fill="none" viewBox="0 0 24 24" strokeWidth="1.5" stroke="currentColor">
- <path strokeLinecap="round" strokeLinejoin="round" d="M12 6v6h4.5m4.5 0a9 9 0 1 1-18 0 9 9 0 0 1 18 0Z" />
- </svg>
+ <Icon name="clock" className="h-4 w-4" />
</button>
) : null;
diff --git a/apps/browser-extension/src/entrypoints/popup/components/Items/Details/FieldHistoryModal.tsx b/apps/browser-extension/src/entrypoints/popup/components/Items/Details/FieldHistoryModal.tsx
index e5084c169..46c0065aa 100644
--- a/apps/browser-extension/src/entrypoints/popup/components/Items/Details/FieldHistoryModal.tsx
+++ b/apps/browser-extension/src/entrypoints/popup/components/Items/Details/FieldHistoryModal.tsx
@@ -4,6 +4,7 @@ import { useTranslation } from 'react-i18next';
import ModalWrapper from '@/entrypoints/popup/components/Dialogs/ModalWrapper';
import { FormInputCopyToClipboard } from '@/entrypoints/popup/components/Forms/FormInputCopyToClipboard';
+import Icon from '@/entrypoints/popup/components/Icons/Icon';
import { useDb } from '@/entrypoints/popup/context/DbContext';
import { useVaultMutate } from '@/entrypoints/popup/hooks/useVaultMutate';
@@ -179,9 +180,7 @@ const FieldHistoryModal: React.FC<FieldHistoryModalProps> = ({
className="text-xs px-2 py-1 text-gray-500 hover:text-red-600 dark:text-gray-400 dark:hover:text-red-400 transition-colors"
title={t('common.delete')}
>
- <svg className="h-4 w-4" fill="none" viewBox="0 0 24 24" strokeWidth="1.5" stroke="currentColor">
- <path strokeLinecap="round" strokeLinejoin="round" d="m14.74 9-.346 9m-4.788 0L9.26 9m9.968-3.21c.342.052.682.107 1.022.166m-1.022-.165L18.16 19.673a2.25 2.25 0 0 1-2.244 2.077H8.084a2.25 2.25 0 0 1-2.244-2.077L4.772 5.79m14.456 0a48.108 48.108 0 0 0-3.478-.397m-12 .562c.34-.059.68-.114 1.022-.165m0 0a48.11 48.11 0 0 1 3.478-.397m7.5 0v-.916c0-1.18-.91-2.164-2.09-2.201a51.964 51.964 0 0 0-3.32 0c-1.18.037-2.09 1.022-2.09 2.201v.916m7.5 0a48.667 48.667 0 0 0-7.5 0" />
- </svg>
+ <Icon name="trash" className="h-4 w-4" />
</button>
)}
</div>
diff --git a/apps/browser-extension/src/entrypoints/popup/components/Items/Details/PasskeyBlock.tsx b/apps/browser-extension/src/entrypoints/popup/components/Items/Details/PasskeyBlock.tsx
index d91dd9bfd..db815494f 100644
--- a/apps/browser-extension/src/entrypoints/popup/components/Items/Details/PasskeyBlock.tsx
+++ b/apps/browser-extension/src/entrypoints/popup/components/Items/Details/PasskeyBlock.tsx
@@ -1,6 +1,7 @@
import React, { useState, useEffect } from 'react';
import { useTranslation } from 'react-i18next';
+import Icon from '@/entrypoints/popup/components/Icons/Icon';
import LoadingSpinner from '@/entrypoints/popup/components/LoadingSpinner';
import { useDb } from '@/entrypoints/popup/context/DbContext';
@@ -17,17 +18,7 @@ type PasskeyBlockProps = {
* Passkey icon component.
*/
const PasskeyIcon: React.FC<{ className?: string }> = ({ className = "w-5 h-5" }) => (
- <svg
- className={className}
- viewBox="0 0 24 24"
- fill="none"
- stroke="currentColor"
- strokeWidth="2"
- strokeLinecap="round"
- strokeLinejoin="round"
- >
- <path d="M21 2l-2 2m-7.61 7.61a5.5 5.5 0 1 1-7.778 7.778 5.5 5.5 0 0 1 7.777-7.777zm0 0L15.5 7.5m0 0l3 3L22 7l-3-3m-3.5 3.5L19 4" />
- </svg>
+ <Icon name="key" className={className} />
);
/**
diff --git a/apps/browser-extension/src/entrypoints/popup/components/Items/Details/PasskeyEditor.tsx b/apps/browser-extension/src/entrypoints/popup/components/Items/Details/PasskeyEditor.tsx
index 00a36fd0c..2f1d62a14 100644
--- a/apps/browser-extension/src/entrypoints/popup/components/Items/Details/PasskeyEditor.tsx
+++ b/apps/browser-extension/src/entrypoints/popup/components/Items/Details/PasskeyEditor.tsx
@@ -1,6 +1,7 @@
import React, { useState, useEffect } from 'react';
import { useTranslation } from 'react-i18next';
+import Icon from '@/entrypoints/popup/components/Icons/Icon';
import LoadingSpinner from '@/entrypoints/popup/components/LoadingSpinner';
import { useDb } from '@/entrypoints/popup/context/DbContext';
@@ -104,18 +105,7 @@ const PasskeyEditor: React.FC<PasskeyEditorProps> = ({
className="text-gray-600 dark:text-gray-400 hover:text-gray-700 dark:hover:text-gray-300"
title={t('common.undo')}
>
- <svg
- className="w-4 h-4"
- viewBox="0 0 24 24"
- fill="none"
- stroke="currentColor"
- strokeWidth="2"
- strokeLinecap="round"
- strokeLinejoin="round"
- >
- <path d="M3 7v6h6" />
- <path d="M21 17a9 9 0 00-9-9 9 9 0 00-6 2.3L3 13" />
- </svg>
+ <Icon name="reply" className="w-4 h-4" />
</button>
</div>
<p className="text-xs text-red-800 dark:text-red-200">
@@ -145,20 +135,7 @@ const PasskeyEditor: React.FC<PasskeyEditorProps> = ({
className="text-red-600 dark:text-red-400 hover:text-red-700 dark:hover:text-red-300"
title={t('common.delete')}
>
- <svg
- className="w-4 h-4"
- viewBox="0 0 24 24"
- fill="none"
- stroke="currentColor"
- strokeWidth="2"
- strokeLinecap="round"
- strokeLinejoin="round"
- >
- <polyline points="3 6 5 6 21 6" />
- <path d="M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2" />
- <line x1="10" y1="11" x2="10" y2="17" />
- <line x1="14" y1="11" x2="14" y2="17" />
- </svg>
+ <Icon name="trash" className="w-4 h-4" />
</button>
</div>
<div className="space-y-1 mb-2">
diff --git a/apps/browser-extension/src/entrypoints/popup/components/Items/Details/TotpEditor.tsx b/apps/browser-extension/src/entrypoints/popup/components/Items/Details/TotpEditor.tsx
index 052731925..9aaa24774 100644
--- a/apps/browser-extension/src/entrypoints/popup/components/Items/Details/TotpEditor.tsx
+++ b/apps/browser-extension/src/entrypoints/popup/components/Items/Details/TotpEditor.tsx
@@ -6,6 +6,7 @@ import { useTranslation } from 'react-i18next';
import ConfirmDeleteModal from '@/entrypoints/popup/components/Dialogs/ConfirmDeleteModal';
import ModalWrapper from '@/entrypoints/popup/components/Dialogs/ModalWrapper';
+import Icon from '@/entrypoints/popup/components/Icons/Icon';
import { logFailure } from '@/utils/Diagnostics';
@@ -328,10 +329,7 @@ const TotpEditor: React.FC<TotpEditorProps> = ({
className="w-8 h-8 flex items-center justify-center text-primary-700 hover:text-white border border-primary-700 hover:bg-primary-800 focus:ring-4 focus:outline-none focus:ring-primary-300 font-medium rounded-lg dark:border-primary-500 dark:text-primary-500 dark:hover:text-white dark:hover:bg-primary-600 dark:focus:ring-primary-800"
title={t('totp.addCode')}
>
- <svg className="w-5 h-5" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round">
- <line x1="12" y1="5" x2="12" y2="19"></line>
- <line x1="5" y1="12" x2="19" y2="12"></line>
- </svg>
+ <Icon name="plus" className="w-5 h-5" />
</button>
)}
</div>
@@ -342,10 +340,7 @@ const TotpEditor: React.FC<TotpEditorProps> = ({
onClick={showAddForm}
className="w-full py-1.5 px-4 flex items-center justify-center gap-2 text-primary-700 hover:text-white border border-primary-700 hover:bg-primary-800 focus:ring-4 focus:outline-none focus:ring-primary-300 font-medium rounded-lg dark:border-primary-500 dark:text-primary-500 dark:hover:text-white dark:hover:bg-primary-600 dark:focus:ring-primary-800"
>
- <svg className="w-5 h-5" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round">
- <line x1="12" y1="5" x2="12" y2="19"></line>
- <line x1="5" y1="12" x2="19" y2="12"></line>
- </svg>
+ <Icon name="plus" className="w-5 h-5" />
<span>{t('totp.addCode')}</span>
</button>
)}
@@ -363,9 +358,7 @@ const TotpEditor: React.FC<TotpEditorProps> = ({
onClick={hideAddForm}
className="text-gray-400 bg-transparent hover:bg-gray-200 hover:text-gray-900 rounded-lg text-sm w-8 h-8 inline-flex justify-center items-center dark:hover:bg-gray-600 dark:hover:text-white"
>
- <svg className="w-3 h-3" fill="none" viewBox="0 0 14 14">
- <path stroke="currentColor" strokeLinecap="round" strokeLinejoin="round" strokeWidth="2" d="m1 1 6 6m0 0 6 6M7 7l6-6M7 7l-6 6"/>
- </svg>
+ <Icon name="x" className="w-3 h-3" />
</button>
)}
</div>
@@ -414,10 +407,7 @@ const TotpEditor: React.FC<TotpEditorProps> = ({
className="w-5 h-5 flex items-center justify-center text-gray-300 hover:text-red-400 dark:text-gray-500 dark:hover:text-red-400 transition-colors"
title={t('common.remove')}
>
- <svg className="w-4 h-4" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round">
- <line x1="18" y1="6" x2="6" y2="18"/>
- <line x1="6" y1="6" x2="18" y2="18"/>
- </svg>
+ <Icon name="x" className="w-4 h-4" />
</button>
</div>
<input
@@ -477,9 +467,7 @@ const TotpEditor: React.FC<TotpEditorProps> = ({
className="text-gray-400 hover:text-gray-600 dark:hover:text-gray-300"
title={t('common.edit')}
>
- <svg className="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24">
- <path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M11 5H6a2 2 0 00-2 2v11a2 2 0 002 2h11a2 2 0 002-2v-5m-1.414-9.414a2 2 0 112.828 2.828L11.828 15H9v-2.828l8.586-8.586z"></path>
- </svg>
+ <Icon name="pencil-alt" className="w-5 h-5" />
</button>
<button
type="button"
@@ -487,9 +475,7 @@ const TotpEditor: React.FC<TotpEditorProps> = ({
className="text-red-600 hover:text-red-800 dark:text-red-500 dark:hover:text-red-400"
title={t('common.delete')}
>
- <svg className="w-5 h-5" fill="currentColor" viewBox="0 0 20 20">
- <path fillRule="evenodd" d="M9 2a1 1 0 00-.894.553L7.382 4H4a1 1 0 000 2v10a2 2 0 002 2h8a2 2 0 002-2V6a1 1 0 100-2h-3.382l-.724-1.447A1 1 0 0011 2H9zM7 8a1 1 0 012 0v6a1 1 0 11-2 0V8zm5-1a1 1 0 00-1 1v6a1 1 0 102 0V8a1 1 0 00-1-1z" clipRule="evenodd"></path>
- </svg>
+ <Icon name="trash" className="w-5 h-5" />
</button>
</div>
</div>
@@ -519,9 +505,7 @@ const TotpEditor: React.FC<TotpEditorProps> = ({
className="text-gray-400 hover:text-gray-600 dark:hover:text-gray-300 p-1"
title={showQrCode ? t('common.hide') + ' QR Code' : t('common.show') + ' QR Code'}
>
- <svg className="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24">
- <path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M12 4v1m6 11h2m-6 0h-2v4m0-11v3m0 0h.01M12 12h4.01M16 20h4M4 12h4m12 0h.01M5 8h2a1 1 0 001-1V5a1 1 0 00-1-1H5a1 1 0 00-1 1v2a1 1 0 001 1zm12 0h2a1 1 0 001-1V5a1 1 0 00-1-1h-2a1 1 0 00-1 1v2a1 1 0 001 1zM5 20h2a1 1 0 001-1v-2a1 1 0 00-1-1H5a1 1 0 00-1 1v2a1 1 0 001 1z" />
- </svg>
+ <Icon name="qrcode" className="w-5 h-5" />
</button>
</div>
<input
@@ -553,10 +537,7 @@ const TotpEditor: React.FC<TotpEditorProps> = ({
className="w-5 h-5 flex items-center justify-center text-gray-300 hover:text-red-400 dark:text-gray-500 dark:hover:text-red-400 transition-colors"
title={t('common.remove')}
>
- <svg className="w-4 h-4" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round">
- <line x1="18" y1="6" x2="6" y2="18"/>
- <line x1="6" y1="6" x2="18" y2="18"/>
- </svg>
+ <Icon name="x" className="w-4 h-4" />
</button>
</div>
<input
diff --git a/apps/browser-extension/src/entrypoints/popup/components/Items/ItemCard.tsx b/apps/browser-extension/src/entrypoints/popup/components/Items/ItemCard.tsx
index a3fb8096c..f4761a44c 100644
--- a/apps/browser-extension/src/entrypoints/popup/components/Items/ItemCard.tsx
+++ b/apps/browser-extension/src/entrypoints/popup/components/Items/ItemCard.tsx
@@ -5,6 +5,8 @@ import React, { useState } from 'react';
import { useTranslation } from 'react-i18next';
import { useNavigate } from 'react-router-dom';
+import Icon from '@/entrypoints/popup/components/Icons/Icon';
+
import { itemRoute } from '@/utils/ItemRoute';
import ItemContextMenu from './ItemContextMenu';
@@ -170,42 +172,13 @@ const ItemCard: React.FC<ItemCardProps> = ({ item, showFolderPath = false, searc
)}
</p>
{item.HasPasskey && (
- <svg
- className="w-3.5 h-3.5 text-gray-500 dark:text-gray-400"
- viewBox="0 0 24 24"
- fill="none"
- stroke="currentColor"
- strokeWidth="2"
- strokeLinecap="round"
- strokeLinejoin="round"
- aria-label={t('items.hasPasskey')}
- >
- <path d="M21 2l-2 2m-7.61 7.61a5.5 5.5 0 1 1-7.778 7.778 5.5 5.5 0 0 1 7.777-7.777zm0 0L15.5 7.5m0 0l3 3L22 7l-3-3m-3.5 3.5L19 4" />
- </svg>
+ <Icon name="key" className="w-3.5 h-3.5 text-gray-500 dark:text-gray-400" aria-label={t('items.hasPasskey')} />
)}
{item.HasAttachment && (
- <svg
- className="w-3.5 h-3.5 text-gray-500 dark:text-gray-400"
- viewBox="0 0 24 24"
- fill="none"
- stroke="currentColor"
- strokeWidth="2"
- strokeLinecap="round"
- strokeLinejoin="round"
- aria-label={t('items.hasAttachments')}
- >
- <path d="M21.44 11.05l-9.19 9.19a6 6 0 0 1-8.49-8.49l9.19-9.19a4 4 0 0 1 5.66 5.66l-9.2 9.19a2 2 0 0 1-2.83-2.83l8.49-8.48" />
- </svg>
+ <Icon name="paper-clip" className="w-3.5 h-3.5 text-gray-500 dark:text-gray-400" aria-label={t('items.hasAttachments')} />
)}
{item.HasTotp && (
- <svg
- className="w-3.5 h-3.5 text-gray-500 dark:text-gray-400"
- viewBox="0 -960 960 960"
- fill="currentColor"
- aria-label={t('items.hasTotp')}
- >
- <path d="M160-160q-33 0-56.5-23.5T80-240v-480q0-33 23.5-56.5T160-800h640q33 0 56.5 23.5T880-720v480q0 33-23.5 56.5T800-160H160Zm100-200h46v-240h-36l-70 50 24 36 36-26v180Zm124 0h156v-40h-94l-2-2q21-20 34.5-34t21.5-22q18-18 27-36t9-38q0-29-22-48.5T458-600q-26 0-47 15t-29 39l40 16q5-13 14.5-20.5T458-558q15 0 24.5 8t9.5 20q0 11-4 20.5T470-486l-32 32-54 54v40Zm296 0q36 0 58-20t22-52q0-18-10-32t-28-22v-2q14-8 22-20.5t8-29.5q0-27-21-44.5T678-600q-25 0-46.5 14.5T604-550l40 16q4-12 13-19t21-7q13 0 21.5 7.5T708-534q0 14-10 22t-26 8h-18v40h20q20 0 31 8t11 22q0 13-11 22.5t-25 9.5q-17 0-26-7.5T638-436l-40 16q7 29 28.5 44.5T680-360ZM160-240h640v-480H160v480Zm0 0v-480 480Z"/>
- </svg>
+ <Icon name="pin-material" className="w-3.5 h-3.5 text-gray-500 dark:text-gray-400" aria-label={t('items.hasTotp')} />
)}
</div>
<p className="text-sm text-gray-600 dark:text-gray-400">{getDisplayText(item)}</p>
@@ -220,11 +193,7 @@ const ItemCard: React.FC<ItemCardProps> = ({ item, showFolderPath = false, searc
isActive || menuPosition ? 'opacity-100' : 'opacity-0'
} group-hover:opacity-100 group-focus-within:opacity-100 focus:opacity-100 hover:text-gray-600 dark:hover:text-gray-300 hover:bg-gray-100 dark:hover:bg-gray-700 focus:outline-none focus:ring-2 focus:ring-primary-500`}
>
- <svg className="w-2 h-4" viewBox="0 0 12 24" fill="currentColor" aria-hidden="true">
- <circle cx="6" cy="5" r="2" />
- <circle cx="6" cy="12" r="2" />
- <circle cx="6" cy="19" r="2" />
- </svg>
+ <Icon name="dots-vertical-narrow" className="w-2 h-4" />
</button>
)}
{menuPosition && (
diff --git a/apps/browser-extension/src/entrypoints/popup/components/Items/ItemFilterDropdown.tsx b/apps/browser-extension/src/entrypoints/popup/components/Items/ItemFilterDropdown.tsx
index 8270a9113..d7c42a8b1 100644
--- a/apps/browser-extension/src/entrypoints/popup/components/Items/ItemFilterDropdown.tsx
+++ b/apps/browser-extension/src/entrypoints/popup/components/Items/ItemFilterDropdown.tsx
@@ -3,6 +3,7 @@ import React, { useState } from 'react';
import { useTranslation } from 'react-i18next';
import FolderIcon from '@/entrypoints/popup/components/Folders/FolderIcon';
+import Icon from '@/entrypoints/popup/components/Icons/Icon';
import { ITEM_TYPE_OPTIONS } from '@/entrypoints/popup/components/Items/ItemTypeSelector';
/**
@@ -88,17 +89,7 @@ const ItemFilterDropdown: React.FC<ItemFilterDropdownProps> = ({
</span>
)}
</h2>
- <svg
- className="w-4 h-4 mt-1 shrink-0"
- viewBox="0 0 24 24"
- fill="none"
- stroke="currentColor"
- strokeWidth="2"
- strokeLinecap="round"
- strokeLinejoin="round"
- >
- <polyline points="6 9 12 15 18 9" />
- </svg>
+ <Icon name="chevron-down" className="w-4 h-4 mt-1 shrink-0" />
</button>
{isOpen && (
@@ -127,18 +118,7 @@ const ItemFilterDropdown: React.FC<ItemFilterDropdownProps> = ({
className="absolute right-2 top-1/2 -translate-y-1/2 flex items-center gap-1.5 px-2 py-1 text-xs text-gray-500 dark:text-gray-400 hover:text-gray-700 dark:hover:text-gray-300 rounded hover:bg-gray-200 dark:hover:bg-gray-600"
>
<span>{t('items.filters.showFolders')}</span>
- <svg
- className={`w-5 h-5 ${showFolders ? 'text-orange-500 dark:text-orange-400' : 'text-gray-400 dark:text-gray-500'}`}
- viewBox="0 0 24 24"
- fill="none"
- stroke="currentColor"
- strokeWidth="2"
- >
- <rect x="3" y="3" width="18" height="18" rx="2" />
- {showFolders && (
- <polyline points="7 12 10 15 17 8" />
- )}
- </svg>
+ <Icon name={showFolders ? 'square-check' : 'square-feather'} className={`w-5 h-5 ${showFolders ? 'text-orange-500 dark:text-orange-400' : 'text-gray-400 dark:text-gray-500'}`} />
</button>
)}
</div>
diff --git a/apps/browser-extension/src/entrypoints/popup/components/Items/ItemIcon.tsx b/apps/browser-extension/src/entrypoints/popup/components/Items/ItemIcon.tsx
index 283c9d34f..4d3fc84ce 100644
--- a/apps/browser-extension/src/entrypoints/popup/components/Items/ItemIcon.tsx
+++ b/apps/browser-extension/src/entrypoints/popup/components/Items/ItemIcon.tsx
@@ -1,5 +1,5 @@
import SqliteClient from '@aliasvault/client/database/SqliteClient';
-import { getAppIconSvg, ItemTypeIconSvgs } from '@aliasvault/models/icons';
+import { getBuiltinLogoSvg, ItemTypeIconSvgs } from '@aliasvault/models/icons';
import {
FieldKey,
LogoKinds,
@@ -36,28 +36,28 @@ const SvgIcon: React.FC<{ svg: string; className?: string }> = ({ svg, className
*/
const detectCardBrand = (cardNumber: string | undefined): ItemTypeIconKey => {
if (!cardNumber) {
- return 'CreditCard';
+ return 'credit-card';
}
const cleaned = cardNumber.replace(/[\s-]/g, '');
if (!/^\d{4,}/.test(cleaned)) {
- return 'CreditCard';
+ return 'credit-card';
}
if (/^4/.test(cleaned)) {
- return 'Visa';
+ return 'visa';
}
if (/^5[1-5]/.test(cleaned) || /^2[2-7]/.test(cleaned)) {
- return 'Mastercard';
+ return 'mastercard';
}
if (/^3[47]/.test(cleaned)) {
- return 'Amex';
+ return 'amex';
}
if (/^6(?:011|22|4[4-9]|5)/.test(cleaned)) {
- return 'Discover';
+ return 'discover';
}
- return 'CreditCard';
+ return 'credit-card';
};
/**
@@ -83,7 +83,7 @@ const ItemIcon: React.FC<ItemIconProps> = ({ item, className = 'w-8 h-8' }) => {
*/
const chosen = item.LogoInfo && item.LogoInfo.Kind !== LogoKinds.Favicon ? item.LogoInfo : null;
if (chosen?.Kind === LogoKinds.Builtin) {
- const builtinSvg = getAppIconSvg(chosen.Source);
+ const builtinSvg = getBuiltinLogoSvg(chosen.Source);
if (builtinSvg) {
return <SvgIcon svg={builtinSvg} className={className} />;
}
@@ -97,7 +97,7 @@ const ItemIcon: React.FC<ItemIconProps> = ({ item, className = 'w-8 h-8' }) => {
// For Note type, always show note icon
if (item.ItemType === ItemTypes.Note) {
- return <SvgIcon svg={ItemTypeIconSvgs.Note} className={className} />;
+ return <SvgIcon svg={ItemTypeIconSvgs.note} className={className} />;
}
// For CreditCard type, detect card brand and show appropriate icon
@@ -129,7 +129,7 @@ const ItemIcon: React.FC<ItemIconProps> = ({ item, className = 'w-8 h-8' }) => {
if (parent) {
const placeholder = document.createElement('div');
placeholder.className = className;
- placeholder.innerHTML = ItemTypeIconSvgs.Placeholder;
+ placeholder.innerHTML = ItemTypeIconSvgs.placeholder;
parent.insertBefore(placeholder, target);
}
}}
@@ -138,7 +138,7 @@ const ItemIcon: React.FC<ItemIconProps> = ({ item, className = 'w-8 h-8' }) => {
}
// Default placeholder for Login/Alias without logo
- return <SvgIcon svg={ItemTypeIconSvgs.Placeholder} className={className} />;
+ return <SvgIcon svg={ItemTypeIconSvgs.placeholder} className={className} />;
};
export default ItemIcon;
diff --git a/apps/browser-extension/src/entrypoints/popup/components/Items/ItemLogoPicker.tsx b/apps/browser-extension/src/entrypoints/popup/components/Items/ItemLogoPicker.tsx
index aeee2232b..7bd3ae0b7 100644
--- a/apps/browser-extension/src/entrypoints/popup/components/Items/ItemLogoPicker.tsx
+++ b/apps/browser-extension/src/entrypoints/popup/components/Items/ItemLogoPicker.tsx
@@ -2,6 +2,7 @@ import { effectiveItemLogo, logoSourceTranslationKey } from '@aliasvault/client/
import React, { useState } from 'react';
import { useTranslation } from 'react-i18next';
+import Icon from '@/entrypoints/popup/components/Icons/Icon';
import LogoPickerModal from '@/entrypoints/popup/components/Items/LogoPickerModal';
import ItemIconComponent from './ItemIcon';
@@ -42,10 +43,7 @@ const ItemLogoPicker: React.FC<ItemLogoPickerProps> = ({ item, pendingSelection,
className="flex items-center justify-center w-[calc(2.5rem+2px)] h-[calc(2.5rem+2px)] flex-shrink-0 cursor-pointer rounded-md bg-gray-100 dark:bg-gray-700 border border-gray-300 dark:border-gray-600 hover:bg-primary-50 dark:hover:bg-primary-900/30 hover:border-primary-500 dark:hover:border-primary-500 focus:outline-none focus:ring-2 focus:ring-primary-500 transition-colors"
>
{isFetching ? (
- <svg className="animate-spin w-5 h-5 text-gray-500 dark:text-gray-300" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24">
- <circle className="opacity-25" cx="12" cy="12" r="10" stroke="currentColor" strokeWidth="4"></circle>
- <path className="opacity-75" fill="currentColor" d="M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"></path>
- </svg>
+ <Icon name="spinner" className="animate-spin w-5 h-5 text-gray-500 dark:text-gray-300" />
) : (
<ItemIconComponent item={{ ...item, LogoInfo: effectiveLogo }} className="w-6 h-6" />
)}
diff --git a/apps/browser-extension/src/entrypoints/popup/components/Items/ItemNameInput.tsx b/apps/browser-extension/src/entrypoints/popup/components/Items/ItemNameInput.tsx
index fe5dfd296..61fd5bdb3 100644
--- a/apps/browser-extension/src/entrypoints/popup/components/Items/ItemNameInput.tsx
+++ b/apps/browser-extension/src/entrypoints/popup/components/Items/ItemNameInput.tsx
@@ -5,6 +5,7 @@ import { useTranslation } from 'react-i18next';
import ModalWrapper from '@/entrypoints/popup/components/Dialogs/ModalWrapper';
import FolderIcon from '@/entrypoints/popup/components/Folders/FolderIcon';
+import Icon from '@/entrypoints/popup/components/Icons/Icon';
import { useDb } from '@/entrypoints/popup/context/DbContext';
import type { Folder, FolderRef } from '@aliasvault/client/database/repositories/FolderRepository';
@@ -189,14 +190,10 @@ const ItemNameInput: React.FC<ItemNameInputProps> = ({
: 'text-gray-700 dark:text-gray-300 hover:bg-gray-50 dark:hover:bg-gray-700'
}`}
>
- <svg className={`w-5 h-5 ${!selectedFolderId ? 'text-primary-500' : 'text-gray-400'}`} fill="none" stroke="currentColor" viewBox="0 0 24 24">
- <path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M5 8h14M5 8a2 2 0 110-4h14a2 2 0 110 4M5 8v10a2 2 0 002 2h10a2 2 0 002-2V8m-9 4h4" />
- </svg>
+ <Icon name="archive" className={`w-5 h-5 ${!selectedFolderId ? 'text-primary-500' : 'text-gray-400'}`} />
<span className="font-medium">&mdash;</span>
{!selectedFolderId && (
- <svg className="w-5 h-5 ml-auto text-primary-600 dark:text-primary-400" fill="currentColor" viewBox="0 0 20 20">
- <path fillRule="evenodd" d="M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z" clipRule="evenodd" />
- </svg>
+ <Icon name="check" className="w-5 h-5 ml-auto text-primary-600 dark:text-primary-400" />
)}
</button>
@@ -219,9 +216,7 @@ const ItemNameInput: React.FC<ItemNameInputProps> = ({
aria-expanded={isExpanded}
className="flex-shrink-0 w-6 h-6 flex items-center justify-center rounded text-gray-500 dark:text-gray-400 hover:bg-gray-200 dark:hover:bg-gray-600 transition-colors"
>
- <svg className={`w-3 h-3 transition-transform ${isExpanded ? 'rotate-90' : ''}`} fill="currentColor" viewBox="0 0 20 20">
- <path fillRule="evenodd" d="M7.293 14.707a1 1 0 010-1.414L10.586 10 7.293 6.707a1 1 0 011.414-1.414l4 4a1 1 0 010 1.414l-4 4a1 1 0 01-1.414 0z" clipRule="evenodd" />
- </svg>
+ <Icon name="chevron-right" className={`w-3 h-3 transition-transform ${isExpanded ? 'rotate-90' : ''}`} />
</button>
) : (
<span className="flex-shrink-0 w-6" />
@@ -239,9 +234,7 @@ const ItemNameInput: React.FC<ItemNameInputProps> = ({
/>
<span className="font-medium flex-1 truncate">{node.Name}</span>
{isSelected && (
- <svg className="w-5 h-5 flex-shrink-0 text-primary-600 dark:text-primary-400" fill="currentColor" viewBox="0 0 20 20">
- <path fillRule="evenodd" d="M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z" clipRule="evenodd" />
- </svg>
+ <Icon name="check" className="w-5 h-5 flex-shrink-0 text-primary-600 dark:text-primary-400" />
)}
</button>
</div>
diff --git a/apps/browser-extension/src/entrypoints/popup/components/Items/ItemTypeSelector.tsx b/apps/browser-extension/src/entrypoints/popup/components/Items/ItemTypeSelector.tsx
index 886d411a6..07d88bbee 100644
--- a/apps/browser-extension/src/entrypoints/popup/components/Items/ItemTypeSelector.tsx
+++ b/apps/browser-extension/src/entrypoints/popup/components/Items/ItemTypeSelector.tsx
@@ -2,6 +2,8 @@ import { ItemTypes } from '@aliasvault/models/vault';
import React from 'react';
import { useTranslation } from 'react-i18next';
+import Icon from '@/entrypoints/popup/components/Icons/Icon';
+
import type { ItemType } from '@aliasvault/models/vault';
/**
@@ -21,36 +23,28 @@ const ITEM_TYPE_OPTIONS: ItemTypeOption[] = [
type: ItemTypes.Login,
titleKey: 'itemTypes.login.title',
iconSvg: (
- <svg className="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24">
- <path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M15 7a2 2 0 012 2m4 0a6 6 0 01-7.743 5.743L11 17H9v2H7v2H4a1 1 0 01-1-1v-2.586a1 1 0 01.293-.707l5.964-5.964A6 6 0 1121 9z" />
- </svg>
+ <Icon name="key" className="w-5 h-5" />
)
},
{
type: ItemTypes.Alias,
titleKey: 'itemTypes.alias.title',
iconSvg: (
- <svg className="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24">
- <path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M16 7a4 4 0 11-8 0 4 4 0 018 0zM12 14a7 7 0 00-7 7h14a7 7 0 00-7-7z" />
- </svg>
+ <Icon name="user" className="w-5 h-5" />
)
},
{
type: ItemTypes.CreditCard,
titleKey: 'itemTypes.creditCard.title',
iconSvg: (
- <svg className="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24">
- <path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M3 10h18M7 15h1m4 0h1m-7 4h12a3 3 0 003-3V8a3 3 0 00-3-3H6a3 3 0 00-3 3v8a3 3 0 003 3z" />
- </svg>
+ <Icon name="credit-card" className="w-5 h-5" />
)
},
{
type: ItemTypes.Note,
titleKey: 'itemTypes.secureNote',
iconSvg: (
- <svg className="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24">
- <path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" />
- </svg>
+ <Icon name="document-text" className="w-5 h-5" />
)
}
];
@@ -98,14 +92,7 @@ const ItemTypeSelector: React.FC<ItemTypeSelectorProps> = ({
<span className="text-xs text-primary-600/80 dark:text-primary-400/80 truncate">
{t('itemTypes.typeLabel')}
</span>
- <svg
- className={`w-4 h-4 shrink-0 text-primary-500 transition-transform ${showDropdown ? 'rotate-180' : ''}`}
- fill="none"
- stroke="currentColor"
- viewBox="0 0 24 24"
- >
- <path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M19 9l-7 7-7-7" />
- </svg>
+ <Icon name="chevron-down" className={`w-4 h-4 shrink-0 text-primary-500 transition-transform ${showDropdown ? 'rotate-180' : ''}`} />
</span>
</div>
@@ -136,9 +123,7 @@ const ItemTypeSelector: React.FC<ItemTypeSelectorProps> = ({
{t(option.titleKey)}
</span>
{selectedType === option.type && (
- <svg className="w-5 h-5 ml-auto text-primary-600 dark:text-primary-400" fill="currentColor" viewBox="0 0 20 20">
- <path fillRule="evenodd" d="M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z" clipRule="evenodd" />
- </svg>
+ <Icon name="check" className="w-5 h-5 ml-auto text-primary-600 dark:text-primary-400" />
)}
</button>
))}
diff --git a/apps/browser-extension/src/entrypoints/popup/components/Items/LogoPickerModal.tsx b/apps/browser-extension/src/entrypoints/popup/components/Items/LogoPickerModal.tsx
index 361a55931..3f48d84b7 100644
--- a/apps/browser-extension/src/entrypoints/popup/components/Items/LogoPickerModal.tsx
+++ b/apps/browser-extension/src/entrypoints/popup/components/Items/LogoPickerModal.tsx
@@ -1,10 +1,11 @@
import { logoSourceTranslationKey } from '@aliasvault/client/items/ItemLogoView';
-import { AppIconSvgs, getAllAppIconKeys } from '@aliasvault/models/icons';
+import { BuiltinLogoSvgs, getAllBuiltinLogoKeys } from '@aliasvault/models/icons';
import { LogoKinds } from '@aliasvault/models/vault';
import React, { useCallback } from 'react';
import { useTranslation } from 'react-i18next';
import ModalWrapper from '@/entrypoints/popup/components/Dialogs/ModalWrapper';
+import Icon from '@/entrypoints/popup/components/Icons/Icon';
import ItemIconComponent from './ItemIcon';
@@ -62,7 +63,7 @@ const LogoPickerModal: React.FC<LogoPickerModalProps> = ({ isOpen, onClose, item
<div>
<h3 className="text-sm font-medium text-gray-700 dark:text-gray-300 mb-2">{t('items.logo.builtinLogos')}</h3>
<div className="grid grid-cols-5 gap-2">
- {getAllAppIconKeys().map(key => (
+ {getAllBuiltinLogoKeys().map(key => (
<button
key={key}
type="button"
@@ -70,7 +71,7 @@ const LogoPickerModal: React.FC<LogoPickerModalProps> = ({ isOpen, onClose, item
onClick={() => choose({ Kind: LogoKinds.Builtin, Source: key })}
className="flex items-center justify-center p-2 rounded-lg border border-gray-200 dark:border-gray-600 transition-colors hover:bg-primary-50 dark:hover:bg-primary-900/30 hover:border-primary-500 dark:hover:border-primary-500"
>
- <div className="w-7 h-7" dangerouslySetInnerHTML={{ __html: AppIconSvgs[key] }} />
+ <div className="w-7 h-7" dangerouslySetInnerHTML={{ __html: BuiltinLogoSvgs[key] }} />
</button>
))}
</div>
@@ -83,7 +84,7 @@ const LogoPickerModal: React.FC<LogoPickerModalProps> = ({ isOpen, onClose, item
onClick={() => choose({ Kind: LogoKinds.Favicon })}
className="w-full flex items-center gap-3 px-3 py-2 text-left rounded-lg border border-gray-200 dark:border-gray-600 transition-colors hover:bg-primary-50 dark:hover:bg-primary-900/30 hover:border-primary-500 dark:hover:border-primary-500"
>
- <svg className="w-5 h-5 flex-shrink-0 text-primary-600 dark:text-primary-400" fill="none" viewBox="0 0 24 24" strokeWidth="1.5" stroke="currentColor"><path strokeLinecap="round" strokeLinejoin="round" d="M12 21a9 9 0 100-18 9 9 0 000 18zm0 0a8.95 8.95 0 003.2-9 8.95 8.95 0 00-3.2-9m0 18a8.95 8.95 0 01-3.2-9A8.95 8.95 0 0112 3m-8.7 6h17.4M3.3 15h17.4" /></svg>
+ <Icon name="globe-alt" className="w-5 h-5 flex-shrink-0 text-primary-600 dark:text-primary-400" />
<span className="min-w-0">
<span className="block text-sm text-gray-900 dark:text-white">
{currentLogo?.Kind === LogoKinds.Favicon ? t('items.logo.refetchFromWebsite') : t('items.logo.fetchFromWebsite')}
diff --git a/apps/browser-extension/src/entrypoints/popup/components/LanguageSwitcher.tsx b/apps/browser-extension/src/entrypoints/popup/components/LanguageSwitcher.tsx
index 36c9cf02c..c3264550c 100644
--- a/apps/browser-extension/src/entrypoints/popup/components/LanguageSwitcher.tsx
+++ b/apps/browser-extension/src/entrypoints/popup/components/LanguageSwitcher.tsx
@@ -1,6 +1,8 @@
import React, { useState, useEffect, useRef } from 'react';
import { useTranslation } from 'react-i18next';
+import Icon from '@/entrypoints/popup/components/Icons/Icon';
+
import { StorageKeys } from '@/utils/constants/storageKeys';
import { AVAILABLE_LANGUAGES, getLanguageConfig, type ILanguageConfig } from '../../../i18n/config';
@@ -93,14 +95,7 @@ const LanguageSwitcher: React.FC<LanguageSwitcherProps> = ({
<span className="text-lg">{currentLanguage.flag}</span>
<span>{currentLanguage.nativeName}</span>
</div>
- <svg
- className={`w-4 h-4 transition-transform duration-200 ${isOpen ? 'rotate-180' : ''}`}
- fill="none"
- stroke="currentColor"
- viewBox="0 0 24 24"
- >
- <path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M19 9l-7 7-7-7" />
- </svg>
+ <Icon name="chevron-down" className={`w-4 h-4 transition-transform duration-200 ${isOpen ? 'rotate-180' : ''}`} />
</button>
{isOpen && (
@@ -118,9 +113,7 @@ const LanguageSwitcher: React.FC<LanguageSwitcherProps> = ({
<span className="text-gray-700 dark:text-gray-200">{lang.nativeName}</span>
</div>
{i18n.language === lang.code && (
- <svg className="w-4 h-4 text-primary-500" fill="currentColor" viewBox="0 0 20 20">
- <path fillRule="evenodd" d="M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z" clipRule="evenodd" />
- </svg>
+ <Icon name="check" className="w-4 h-4 text-primary-500" />
)}
</button>
))}
diff --git a/apps/browser-extension/src/entrypoints/popup/components/Layout/BottomNav.tsx b/apps/browser-extension/src/entrypoints/popup/components/Layout/BottomNav.tsx
index dadc110ff..bd79cdf06 100644
--- a/apps/browser-extension/src/entrypoints/popup/components/Layout/BottomNav.tsx
+++ b/apps/browser-extension/src/entrypoints/popup/components/Layout/BottomNav.tsx
@@ -2,6 +2,8 @@ import React, { useState, useEffect } from 'react';
import { useTranslation } from 'react-i18next';
import { useNavigate, useLocation } from 'react-router-dom';
+import Icon from '@/entrypoints/popup/components/Icons/Icon';
+
type TabName = 'items' | 'emails' | 'settings';
/**
@@ -66,9 +68,7 @@ const BottomNav: React.FC = () => {
currentTab === 'items' ? 'text-primary-600 dark:text-primary-500' : 'text-gray-500 dark:text-gray-400'
}`}
>
- <svg className="w-6 h-6" fill="none" stroke="currentColor" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
- <path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M15 7a2 2 0 012 2m4 0a6 6 0 01-7.743 5.743L11 17H9v2H7v2H4a1 1 0 01-1-1v-2.586a1 1 0 01.293-.707l5.964-5.964A6 6 0 1121 9z" />
- </svg>
+ <Icon name="key" className="w-6 h-6" />
<span className="text-sm mt-1">{t('navigation.vault')}</span>
</button>
<button
@@ -78,9 +78,7 @@ const BottomNav: React.FC = () => {
currentTab === 'emails' ? 'text-primary-600 dark:text-primary-500' : 'text-gray-500 dark:text-gray-400'
}`}
>
- <svg className="w-6 h-6" fill="none" stroke="currentColor" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
- <path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M3 8l7.89 5.26a2 2 0 002.22 0L21 8M5 19h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v10a2 2 0 002 2z" />
- </svg>
+ <Icon name="mail" className="w-6 h-6" />
<span className="text-sm mt-1">{t('emails.title')}</span>
</button>
<button
@@ -90,10 +88,7 @@ const BottomNav: React.FC = () => {
currentTab === 'settings' ? 'text-primary-600 dark:text-primary-500' : 'text-gray-500 dark:text-gray-400'
}`}
>
- <svg className="w-6 h-6" fill="none" stroke="currentColor" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
- <path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M10.325 4.317c.426-1.756 2.924-1.756 3.35 0a1.724 1.724 0 002.573 1.066c1.543-.94 3.31.826 2.37 2.37a1.724 1.724 0 001.065 2.572c1.756.426 1.756 2.924 0 3.35a1.724 1.724 0 00-1.066 2.573c.94 1.543-.826 3.31-2.37 2.37a1.724 1.724 0 00-2.572 1.065c-.426 1.756-2.924 1.756-3.35 0a1.724 1.724 0 00-2.573-1.066c-1.543.94-3.31-.826-2.37-2.37a1.724 1.724 0 00-1.065-2.572c-1.756-.426-1.756-2.924 0-3.35a1.724 1.724 0 001.066-2.573c-.94-1.543.826-3.31 2.37-2.37.996.608 2.296.07 2.572-1.065z" />
- <path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M15 12a3 3 0 11-6 0 3 3 0 016 0z" />
- </svg>
+ <Icon name="cog" className="w-6 h-6" />
<span className="text-sm mt-1">{t('common.settings')}</span>
</button>
</div>
diff --git a/apps/browser-extension/src/entrypoints/popup/components/Layout/Header.tsx b/apps/browser-extension/src/entrypoints/popup/components/Layout/Header.tsx
index d373375df..c4dd59ee5 100644
--- a/apps/browser-extension/src/entrypoints/popup/components/Layout/Header.tsx
+++ b/apps/browser-extension/src/entrypoints/popup/components/Layout/Header.tsx
@@ -2,6 +2,9 @@ import React, { useCallback, useEffect, useMemo } from 'react';
import { useTranslation } from 'react-i18next';
import { useNavigate, useLocation, useSearchParams } from 'react-router-dom';
+import HeaderButton from '@/entrypoints/popup/components/HeaderButton';
+import { HeaderIconType } from '@/entrypoints/popup/components/Icons/HeaderIcons';
+import Icon from '@/entrypoints/popup/components/Icons/Icon';
import Logo from '@/entrypoints/popup/components/Logo';
import { useApp } from '@/entrypoints/popup/context/AppContext';
import { useHeaderButtons } from '@/entrypoints/popup/context/HeaderButtonsContext';
@@ -157,9 +160,7 @@ const Header: React.FC<HeaderProps> = ({
className="flex items-center gap-2 hover:bg-gray-100 dark:hover:bg-gray-700 pr-2 pt-1.5 pb-1.5 rounded-lg group"
>
<div className="flex items-center">
- <svg className="w-5 h-5 text-gray-500 group-hover:text-gray-900 dark:text-gray-400 dark:group-hover:text-white" fill="none" stroke="currentColor" viewBox="0 0 24 24">
- <path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M15 19l-7-7 7-7" />
- </svg>
+ <Icon name="chevron-left" className="w-5 h-5 text-gray-500 group-hover:text-gray-900 dark:text-gray-400 dark:group-hover:text-white" />
{backButtonTitle && (
<h1 className="text-lg font-medium text-gray-900 dark:text-white ml-2">
{backButtonTitle}
@@ -196,16 +197,9 @@ const Header: React.FC<HeaderProps> = ({
{!app.isLoggedIn ? (
<>
{rightButtons}
- <button
- id="settings"
- onClick={(handleSettings)}
- className="p-1 text-gray-500 hover:text-gray-700 dark:text-gray-400 dark:hover:text-gray-200 rounded-lg hover:bg-gray-100 dark:hover:bg-gray-700"
- >
- <span className="sr-only">{t('common.settings')}</span>
- <svg className="w-5 h-5" aria-hidden="true" fill="currentColor" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg">
- <path fillRule="evenodd" d="M11.49 3.17c-.38-1.56-2.6-1.56-2.98 0a1.532 1.532 0 01-2.286.948c-1.372-.836-2.942.734-2.106 2.106.54.886.061 2.042-.947 2.287-1.561.379-1.561 2.6 0 2.978a1.532 1.532 0 01.947 2.287c-.836 1.372.734 2.942 2.106 2.106a1.532 1.532 0 012.287.947c.379 1.561 2.6 1.561 2.978 0a1.533 1.533 0 012.287-.947c1.372.836 2.942-.734 2.106-2.106a1.533 1.533 0 01.947-2.287c1.561-.379 1.561-2.6 0-2.978a1.532 1.532 0 01-.947-2.287c.836-1.372-.734-2.942-2.106-2.106a1.532 1.532 0 01-2.287-.947zM10 13a3 3 0 100-6 3 3 0 000 6z" clipRule="evenodd" />
- </svg>
- </button>
+ {location.pathname !== '/auth-settings' && (
+ <HeaderButton id="settings" onClick={handleSettings} title={t('common.settings')} iconType={HeaderIconType.SETTINGS} />
+ )}
</>
) : (
rightButtons
diff --git a/apps/browser-extension/src/entrypoints/popup/components/Layout/ServerSyncIndicator.tsx b/apps/browser-extension/src/entrypoints/popup/components/Layout/ServerSyncIndicator.tsx
index 6f39644af..2ff64991f 100644
--- a/apps/browser-extension/src/entrypoints/popup/components/Layout/ServerSyncIndicator.tsx
+++ b/apps/browser-extension/src/entrypoints/popup/components/Layout/ServerSyncIndicator.tsx
@@ -2,6 +2,7 @@ import { syncErrorMessage } from '@aliasvault/client/sync/SyncErrorMessage';
import React, { useState, useEffect, useRef, useCallback } from 'react';
import { useTranslation } from 'react-i18next';
+import Icon from '@/entrypoints/popup/components/Icons/Icon';
import { useApp } from '@/entrypoints/popup/context/AppContext';
import { useDb } from '@/entrypoints/popup/context/DbContext';
@@ -162,24 +163,10 @@ const ServerSyncIndicator: React.FC = () => {
>
<div className="relative">
{isRetrying ? (
- <svg className="w-3.5 h-3.5 animate-spin" fill="none" stroke="currentColor" viewBox="0 0 24 24">
- <path
- strokeLinecap="round"
- strokeLinejoin="round"
- strokeWidth={2}
- d="M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15"
- />
- </svg>
+ <Icon name="refresh" className="w-3.5 h-3.5 animate-spin" />
) : (
<>
- <svg className="w-3.5 h-3.5" fill="none" stroke="currentColor" viewBox="0 0 24 24">
- <path
- strokeLinecap="round"
- strokeLinejoin="round"
- strokeWidth={2}
- d="M18.364 5.636a9 9 0 010 12.728m0 0l-2.829-2.829m2.829 2.829L21 21M15.536 8.464a5 5 0 010 7.072m0 0l-2.829-2.829m-4.243 2.829a4.978 4.978 0 01-1.414-2.83m-1.414 5.658a9 9 0 01-2.167-9.238m7.824 2.167a1 1 0 111.414 1.414m-1.414-1.414L3 3m8.293 8.293l1.414 1.414"
- />
- </svg>
+ <Icon name="status-offline" className="w-3.5 h-3.5" />
{dbContext.hasUnsyncedUserChanges && (
<span className="absolute -top-0.5 -right-0.5 w-2 h-2 bg-red-500 rounded-full" />
)}
@@ -201,14 +188,7 @@ const ServerSyncIndicator: React.FC = () => {
className="flex items-center gap-1.5 mx-2 px-2 py-1 bg-green-100 dark:bg-green-900/30 text-green-700 dark:text-green-400 rounded-md text-xs font-medium"
title={t('vault.syncingVault')}
>
- <svg className="w-3.5 h-3.5 animate-spin" fill="none" stroke="currentColor" viewBox="0 0 24 24">
- <path
- strokeLinecap="round"
- strokeLinejoin="round"
- strokeWidth={2}
- d="M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15"
- />
- </svg>
+ <Icon name="refresh" className="w-3.5 h-3.5 animate-spin" />
</div>
);
}
@@ -219,14 +199,7 @@ const ServerSyncIndicator: React.FC = () => {
<div
className="flex items-center gap-1.5 mx-2 px-2 py-1 bg-blue-100 dark:bg-blue-900/30 text-blue-700 dark:text-blue-400 rounded-md text-xs font-medium"
>
- <svg className="w-3.5 h-3.5 animate-spin" fill="none" stroke="currentColor" viewBox="0 0 24 24">
- <path
- strokeLinecap="round"
- strokeLinejoin="round"
- strokeWidth={2}
- d="M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15"
- />
- </svg>
+ <Icon name="refresh" className="w-3.5 h-3.5 animate-spin" />
</div>
);
}
@@ -241,24 +214,10 @@ const ServerSyncIndicator: React.FC = () => {
title={t('sync.tapToRetry')}
>
{isRetrying ? (
- <svg className="w-3.5 h-3.5 animate-spin" fill="none" stroke="currentColor" viewBox="0 0 24 24">
- <path
- strokeLinecap="round"
- strokeLinejoin="round"
- strokeWidth={2}
- d="M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15"
- />
- </svg>
+ <Icon name="refresh" className="w-3.5 h-3.5 animate-spin" />
) : (
<div className="relative">
- <svg className="w-3.5 h-3.5" fill="none" stroke="currentColor" viewBox="0 0 24 24">
- <path
- strokeLinecap="round"
- strokeLinejoin="round"
- strokeWidth={2}
- d="M7 16a4 4 0 01-.88-7.903A5 5 0 1115.9 6L16 6a5 5 0 011 9.9M15 13l-3-3m0 0l-3 3m3-3v12"
- />
- </svg>
+ <Icon name="cloud-upload" className="w-3.5 h-3.5" />
<span className="absolute -top-0.5 -right-0.5 w-2 h-2 bg-blue-500 dark:bg-blue-400 rounded-full animate-pulse" />
</div>
)}
diff --git a/apps/browser-extension/src/entrypoints/popup/components/ReloadButton.tsx b/apps/browser-extension/src/entrypoints/popup/components/ReloadButton.tsx
index 80756cfed..3588b5cb2 100644
--- a/apps/browser-extension/src/entrypoints/popup/components/ReloadButton.tsx
+++ b/apps/browser-extension/src/entrypoints/popup/components/ReloadButton.tsx
@@ -1,6 +1,8 @@
import React from 'react';
import { useTranslation } from 'react-i18next';
+import Icon from '@/entrypoints/popup/components/Icons/Icon';
+
/**
* Reload button props.
*/
@@ -19,14 +21,9 @@ const ReloadButton: React.FC<ReloadButtonProps> = ({ onClick }) => {
>
<div className="relative inline-flex items-center">
<button id="reload-vault" onClick={onClick} className="absolute p-2 hover:bg-gray-200 rounded-2xl">
- <svg xmlns="http://www.w3.org/2000/svg" className="h-4 w-4 text-gray-400" viewBox="0 0 20 20" fill="currentColor">
- <path fillRule="evenodd" d="M4 2a1 1 0 011 1v2.101a7.002 7.002 0 0111.601 2.566 1 1 0 11-1.885.666A5.002 5.002 0 005.999 7H9a1 1 0 010 2H4a1 1 0 01-1-1V3a1 1 0 011-1zm.008 9.057a1 1 0 011.276.61A5.002 5.002 0 0014.001 13H11a1 1 0 110-2h5a1 1 0 011 1v5a1 1 0 11-2 0v-2.101a7.002 7.002 0 01-11.601-2.566 1 1 0 01.61-1.276z" clipRule="evenodd" />
- </svg>
+ <Icon name="refresh" className="h-4 w-4 text-gray-400" />
</button>
- <svg aria-hidden="true" className="inline w-8 h-8 text-gray-200 dark:text-gray-600" viewBox="0 0 100 101" fill="none" xmlns="http://www.w3.org/2000/svg">
- <path d="M100 50.5908C100 78.2051 77.6142 100.591 50 100.591C22.3858 100.591 0 78.2051 0 50.5908C0 22.9766 22.3858 0.59082 50 0.59082C77.6142 0.59082 100 22.9766 100 50.5908ZM9.08144 50.5908C9.08144 73.1895 27.4013 91.5094 50 91.5094C72.5987 91.5094 90.9186 73.1895 90.9186 50.5908C90.9186 27.9921 72.5987 9.67226 50 9.67226C27.4013 9.67226 9.08144 27.9921 9.08144 50.5908Z" fill="currentColor" />
- <path d="M93.9676 39.0409C96.393 38.4038 97.8624 35.9116 97.0079 33.5539C95.2932 28.8227 92.871 24.3692 89.8167 20.348C85.8452 15.1192 80.8826 10.7238 75.2124 7.41289C69.5422 4.10194 63.2754 1.94025 56.7698 1.05124C51.7666 0.367541 46.6976 0.446843 41.7345 1.27873C39.2613 1.69328 37.813 4.19778 38.4501 6.62326C39.0873 9.04874 41.5694 10.4717 44.0505 10.1071C47.8511 9.54855 51.7191 9.52689 55.5402 10.0491C60.8642 10.7766 65.9928 12.5457 70.6331 15.2552C75.2735 17.9648 79.3347 21.5619 82.5849 25.841C84.9175 28.9121 86.7997 32.2913 88.1811 35.8758C89.083 38.2158 91.5421 39.6781 93.9676 39.0409Z" fill="currentFill" />
- </svg>
+ <Icon name="spinner-flowbite" className="inline w-8 h-8 text-gray-200 dark:text-gray-600" />
</div>
<span className="sr-only">{t('common.loading')}</span>
</div>
diff --git a/apps/browser-extension/src/entrypoints/popup/components/Settings/SettingsMenu.tsx b/apps/browser-extension/src/entrypoints/popup/components/Settings/SettingsMenu.tsx
index f547fd5fe..394acf0f0 100644
--- a/apps/browser-extension/src/entrypoints/popup/components/Settings/SettingsMenu.tsx
+++ b/apps/browser-extension/src/entrypoints/popup/components/Settings/SettingsMenu.tsx
@@ -1,5 +1,9 @@
import React from 'react';
+import Icon from '@/entrypoints/popup/components/Icons/Icon';
+
+import type { UiIconName } from '@aliasvault/models/icons';
+
type SettingsGroupProps = {
title?: string;
children: React.ReactNode;
@@ -24,7 +28,7 @@ export const SettingsGroup: React.FC<SettingsGroupProps> = ({ title, children })
type SettingsRowProps = {
id?: string;
label: string;
- icon: React.ReactNode;
+ icon: UiIconName;
onClick: () => void;
badge?: string;
external?: boolean;
@@ -45,9 +49,7 @@ export const SettingsRow: React.FC<SettingsRowProps> = ({ id, label, icon, onCli
className="w-full px-4 py-3 flex items-center justify-between hover:bg-gray-50 dark:hover:bg-gray-700 transition-colors disabled:opacity-50 disabled:cursor-not-allowed"
>
<div className="flex items-center">
- <svg className={`w-5 h-5 mr-3 ${danger ? 'text-red-600 dark:text-red-400' : 'text-gray-600 dark:text-gray-400'}`} fill="none" stroke="currentColor" strokeWidth={2} viewBox="0 0 24 24">
- {icon}
- </svg>
+ <Icon name={icon} className={`w-5 h-5 mr-3 ${danger ? 'text-red-600 dark:text-red-400' : 'text-gray-600 dark:text-gray-400'}`} />
<span className={`text-left ${danger ? 'text-red-600 dark:text-red-400' : 'text-gray-900 dark:text-white'}`}>{label}</span>
{badge && (
<span className="ml-2 px-1.5 py-0.5 text-[10px] font-semibold rounded-full bg-primary-100 dark:bg-primary-900 text-primary-700 dark:text-primary-300 uppercase tracking-wide">
@@ -55,12 +57,6 @@ export const SettingsRow: React.FC<SettingsRowProps> = ({ id, label, icon, onCli
</span>
)}
</div>
- <svg className="w-4 h-4 text-gray-400" fill="none" stroke="currentColor" strokeWidth={2} viewBox="0 0 24 24">
- {external ? (
- <path strokeLinecap="round" strokeLinejoin="round" d="M10 6H6a2 2 0 00-2 2v10a2 2 0 002 2h10a2 2 0 002-2v-4M14 4h6m0 0v6m0-6L10 14" />
- ) : (
- <path strokeLinecap="round" strokeLinejoin="round" d="M9 5l7 7-7 7" />
- )}
- </svg>
+ <Icon name={external ? 'external-link' : 'chevron-right'} className="w-4 h-4 text-gray-400" />
</button>
);
diff --git a/apps/browser-extension/src/entrypoints/popup/components/VaultErrorReport.tsx b/apps/browser-extension/src/entrypoints/popup/components/VaultErrorReport.tsx
index 0d150428d..c43c944ed 100644
--- a/apps/browser-extension/src/entrypoints/popup/components/VaultErrorReport.tsx
+++ b/apps/browser-extension/src/entrypoints/popup/components/VaultErrorReport.tsx
@@ -3,6 +3,8 @@ import { AppInfo } from '@aliasvault/client/platform/AppInfo';
import React, { useState } from 'react';
import { useTranslation } from 'react-i18next';
+import Icon from '@/entrypoints/popup/components/Icons/Icon';
+
import { logFailure } from '@/utils/Diagnostics';
/**
@@ -84,16 +86,7 @@ const VaultErrorReport: React.FC<VaultErrorReportProps> = ({ error }) => {
: 'bg-red-600 hover:bg-red-700 focus:ring-red-500'
}`}
>
- <svg className="w-3.5 h-3.5" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round">
- {copied ? (
- <polyline points="20 6 9 17 4 12" />
- ) : (
- <>
- <rect x="9" y="9" width="13" height="13" rx="2" ry="2" />
- <path d="M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1" />
- </>
- )}
- </svg>
+ <Icon name={copied ? 'check' : 'duplicate'} className="w-3.5 h-3.5" />
{copied ? t('common.copiedShort') : t('common.copyToClipboard')}
</button>
</>
diff --git a/apps/browser-extension/src/entrypoints/popup/pages/auth/Login.tsx b/apps/browser-extension/src/entrypoints/popup/pages/auth/Login.tsx
index 89127074d..4715709bb 100644
--- a/apps/browser-extension/src/entrypoints/popup/pages/auth/Login.tsx
+++ b/apps/browser-extension/src/entrypoints/popup/pages/auth/Login.tsx
@@ -13,6 +13,7 @@ import Button from '@/entrypoints/popup/components/Button';
import MobileUnlockModal from '@/entrypoints/popup/components/Dialogs/MobileUnlockModal';
import HeaderButton from '@/entrypoints/popup/components/HeaderButton';
import { HeaderIcon, HeaderIconType } from '@/entrypoints/popup/components/Icons/HeaderIcons';
+import Icon from '@/entrypoints/popup/components/Icons/Icon';
import LoginServerInfo from '@/entrypoints/popup/components/LoginServerInfo';
import VaultErrorReport from '@/entrypoints/popup/components/VaultErrorReport';
import { useApp } from '@/entrypoints/popup/context/AppContext';
@@ -520,9 +521,7 @@ const Login: React.FC = () => {
onClick={() => setShowMobileLoginModal(true)}
className="w-full max-w-md mt-4 px-4 py-2 text-sm font-medium text-center text-gray-700 bg-white border border-gray-300 rounded-lg hover:bg-gray-100 focus:ring-4 focus:ring-gray-200 dark:bg-gray-600 dark:text-white dark:border-gray-500 dark:hover:bg-gray-500 dark:focus:ring-gray-700 flex items-center justify-center gap-2"
>
- <svg className="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
- <path strokeLinecap="round" strokeLinejoin="round" strokeWidth="2" d="M12 18h.01M8 21h8a2 2 0 002-2V5a2 2 0 00-2-2H8a2 2 0 00-2 2v14a2 2 0 002 2z"></path>
- </svg>
+ <Icon name="device-mobile" className="w-5 h-5" />
{t('auth.loginWithMobile')}
</button>
diff --git a/apps/browser-extension/src/entrypoints/popup/pages/auth/Unlock.tsx b/apps/browser-extension/src/entrypoints/popup/pages/auth/Unlock.tsx
index bbafbb7ef..640c9517f 100644
--- a/apps/browser-extension/src/entrypoints/popup/pages/auth/Unlock.tsx
+++ b/apps/browser-extension/src/entrypoints/popup/pages/auth/Unlock.tsx
@@ -13,6 +13,7 @@ import LogoutConfirmModal from '@/entrypoints/popup/components/Dialogs/LogoutCon
import MobileUnlockModal from '@/entrypoints/popup/components/Dialogs/MobileUnlockModal';
import HeaderButton from '@/entrypoints/popup/components/HeaderButton';
import { HeaderIcon, HeaderIconType } from '@/entrypoints/popup/components/Icons/HeaderIcons';
+import Icon from '@/entrypoints/popup/components/Icons/Icon';
import LoadingSpinner from '@/entrypoints/popup/components/LoadingSpinner';
import UsernameAvatar from '@/entrypoints/popup/components/Unlock/UsernameAvatar';
import { useApp } from '@/entrypoints/popup/context/AppContext';
@@ -636,9 +637,7 @@ const Unlock: React.FC = () => {
className="h-12 flex items-center justify-center bg-gray-100 hover:bg-gray-200 dark:bg-gray-700 dark:hover:bg-gray-600 text-gray-900 dark:text-white rounded-lg transition-colors active:scale-95"
aria-label={t('common.backspace')}
>
- <svg className="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24">
- <path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M12 14l2-2m0 0l2-2m-2 2l-2-2m2 2l2 2M3 12l6.414 6.414a2 2 0 001.414.586H19a2 2 0 002-2V7a2 2 0 00-2-2h-8.172a2 2 0 00-1.414.586L3 12z" />
- </svg>
+ <Icon name="backspace" className="w-5 h-5" />
</button>
</div>
</div>
@@ -723,9 +722,7 @@ const Unlock: React.FC = () => {
onClick={() => setShowMobileUnlockModal(true)}
className="w-full max-w-md mt-4 px-4 py-2 text-sm font-medium text-center text-gray-700 bg-white border border-gray-300 rounded-lg hover:bg-gray-100 focus:ring-4 focus:ring-gray-200 dark:bg-gray-600 dark:text-white dark:border-gray-500 dark:hover:bg-gray-500 dark:focus:ring-gray-700 flex items-center justify-center gap-2"
>
- <svg className="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
- <path strokeLinecap="round" strokeLinejoin="round" strokeWidth="2" d="M12 18h.01M8 21h8a2 2 0 002-2V5a2 2 0 00-2-2H8a2 2 0 00-2 2v14a2 2 0 002 2z"></path>
- </svg>
+ <Icon name="device-mobile" className="w-5 h-5" />
{t('auth.unlockWithMobile')}
</button>
)}
diff --git a/apps/browser-extension/src/entrypoints/popup/pages/auth/Upgrade.tsx b/apps/browser-extension/src/entrypoints/popup/pages/auth/Upgrade.tsx
index b8f140759..b6346cc58 100644
--- a/apps/browser-extension/src/entrypoints/popup/pages/auth/Upgrade.tsx
+++ b/apps/browser-extension/src/entrypoints/popup/pages/auth/Upgrade.tsx
@@ -12,6 +12,7 @@ import LogoutConfirmModal from '@/entrypoints/popup/components/Dialogs/LogoutCon
import Modal from '@/entrypoints/popup/components/Dialogs/Modal';
import HeaderButton from '@/entrypoints/popup/components/HeaderButton';
import { HeaderIconType } from '@/entrypoints/popup/components/Icons/HeaderIcons';
+import Icon from '@/entrypoints/popup/components/Icons/Icon';
import LoadingSpinner from '@/entrypoints/popup/components/LoadingSpinner';
import { useApp } from '@/entrypoints/popup/context/AppContext';
import { useAuth } from '@/entrypoints/popup/context/AuthContext';
@@ -373,9 +374,7 @@ const Upgrade: React.FC = () => {
<CountdownBar ref={countdownBarRef} isVisible={true} colorClass="bg-primary-500" />
<div className="mb-4 text-green-600 dark:text-green-400">
- <svg className="w-12 h-12 mx-auto" fill="none" stroke="currentColor" viewBox="0 0 24 24">
- <path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z" />
- </svg>
+ <Icon name="check-circle" className="w-12 h-12 mx-auto" />
</div>
<h2 className="text-xl font-semibold mb-4 text-gray-900 dark:text-white">{t('upgrade.successTitle')}</h2>
<p className="mb-6 text-gray-600 dark:text-gray-400">{t('upgrade.successOtherDevices')}</p>
diff --git a/apps/browser-extension/src/entrypoints/popup/pages/emails/EmailDetails.tsx b/apps/browser-extension/src/entrypoints/popup/pages/emails/EmailDetails.tsx
index d37815430..1538ac3f3 100644
--- a/apps/browser-extension/src/entrypoints/popup/pages/emails/EmailDetails.tsx
+++ b/apps/browser-extension/src/entrypoints/popup/pages/emails/EmailDetails.tsx
@@ -9,6 +9,7 @@ import { Link, useParams, useNavigate, useSearchParams } from 'react-router-dom'
import Modal from '@/entrypoints/popup/components/Dialogs/Modal';
import { AttachmentIcon } from '@/entrypoints/popup/components/Icons/AttachmentIcon';
+import Icon from '@/entrypoints/popup/components/Icons/Icon';
import LoadingSpinner from '@/entrypoints/popup/components/LoadingSpinner';
import { useDb } from '@/entrypoints/popup/context/DbContext';
import { useHeaderButtons } from '@/entrypoints/popup/context/HeaderButtonsContext';
@@ -310,19 +311,7 @@ const EmailDetails: React.FC = (): React.ReactElement => {
title={showMetadata ? t('common.hideDetails') : t('common.showDetails')}
aria-expanded={showMetadata}
>
- <svg
- className="w-4 h-4"
- fill="none"
- stroke="currentColor"
- viewBox="0 0 24 24"
- >
- <path
- strokeLinecap="round"
- strokeLinejoin="round"
- strokeWidth={2}
- d="M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"
- />
- </svg>
+ <Icon name="information-circle" className="w-4 h-4" />
</button>
</div>
{parsedAttachments.length > 0 && (
@@ -393,19 +382,7 @@ const EmailDetails: React.FC = (): React.ReactElement => {
onClick={() => handleDownloadParsedAttachment(attachment, index)}
className="flex items-center space-x-2 text-sm text-gray-600 dark:text-gray-400 hover:text-primary-600 dark:hover:text-primary-400 text-left"
>
- <svg
- className="w-4 h-4"
- fill="none"
- stroke="currentColor"
- viewBox="0 0 24 24"
- >
- <path
- strokeLinecap="round"
- strokeLinejoin="round"
- strokeWidth={2}
- d="M15.172 7l-6.586 6.586a2 2 0 102.828 2.828l6.414-6.586a4 4 0 00-5.656-5.656l-6.415 6.585a6 6 0 108.486 8.486L20.5 13"
- />
- </svg>
+ <Icon name="paper-clip" className="w-4 h-4" />
<span>
{attachment.filename} ({Math.ceil(attachment.size / 1024)} KB)
</span>
diff --git a/apps/browser-extension/src/entrypoints/popup/pages/emails/EmailsList.tsx b/apps/browser-extension/src/entrypoints/popup/pages/emails/EmailsList.tsx
index c7a54ce8d..a312be8b8 100644
--- a/apps/browser-extension/src/entrypoints/popup/pages/emails/EmailsList.tsx
+++ b/apps/browser-extension/src/entrypoints/popup/pages/emails/EmailsList.tsx
@@ -6,6 +6,7 @@ import { Link } from 'react-router-dom';
import HeaderButton from '@/entrypoints/popup/components/HeaderButton';
import { AttachmentIcon } from '@/entrypoints/popup/components/Icons/AttachmentIcon';
import { HeaderIconType } from '@/entrypoints/popup/components/Icons/HeaderIcons';
+import Icon from '@/entrypoints/popup/components/Icons/Icon';
import LoadingSpinner from '@/entrypoints/popup/components/LoadingSpinner';
import PageTitle from '@/entrypoints/popup/components/PageTitle';
import ReloadButton from '@/entrypoints/popup/components/ReloadButton';
@@ -293,10 +294,7 @@ const EmailsList: React.FC = () => {
>
{isLoadingMore ? (
<span className="flex items-center justify-center">
- <svg className="animate-spin -ml-1 mr-2 h-4 w-4" fill="none" viewBox="0 0 24 24">
- <circle className="opacity-25" cx="12" cy="12" r="10" stroke="currentColor" strokeWidth="4"></circle>
- <path className="opacity-75" fill="currentColor" d="M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"></path>
- </svg>
+ <Icon name="spinner" className="animate-spin -ml-1 mr-2 h-4 w-4" />
{t('common.loading')}
</span>
) : (
diff --git a/apps/browser-extension/src/entrypoints/popup/pages/items/ItemAddEdit.tsx b/apps/browser-extension/src/entrypoints/popup/pages/items/ItemAddEdit.tsx
index cedeaccf0..0c531e18f 100644
--- a/apps/browser-extension/src/entrypoints/popup/pages/items/ItemAddEdit.tsx
+++ b/apps/browser-extension/src/entrypoints/popup/pages/items/ItemAddEdit.tsx
@@ -21,6 +21,7 @@ import PasswordField from '@/entrypoints/popup/components/Forms/PasswordField';
import UsernameField from '@/entrypoints/popup/components/Forms/UsernameField';
import HeaderButton from '@/entrypoints/popup/components/HeaderButton';
import { HeaderIconType } from '@/entrypoints/popup/components/Icons/HeaderIcons';
+import Icon from '@/entrypoints/popup/components/Icons/Icon';
import AttachmentUploader from '@/entrypoints/popup/components/Items/Details/AttachmentUploader';
import PasskeyEditor from '@/entrypoints/popup/components/Items/Details/PasskeyEditor';
import TotpEditor from '@/entrypoints/popup/components/Items/Details/TotpEditor';
@@ -1191,9 +1192,7 @@ const ItemAddEdit: React.FC = () => {
onClick={() => handleFieldChange(fieldKey, [...values, ''])}
className="absolute right-2 top-1/2 -translate-y-1/2 w-6 h-6 flex items-center justify-center text-gray-400 hover:text-primary-500 dark:hover:text-primary-400 transition-colors"
>
- <svg className="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24">
- <path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M12 6v6m0 0v6m0-6h6m-6 0H6" />
- </svg>
+ <Icon name="plus-sm" className="w-5 h-5" />
</button>
)}
</div>
@@ -1224,10 +1223,7 @@ const ItemAddEdit: React.FC = () => {
className={`absolute right-2 ${hasLabel ? 'top-[38px]' : 'top-1/2'} -translate-y-1/2 w-6 h-6 flex items-center justify-center text-gray-300 hover:text-red-400 dark:text-gray-500 dark:hover:text-red-400 transition-colors`}
title={t('common.delete')}
>
- <svg className="w-4 h-4" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round">
- <line x1="18" y1="6" x2="6" y2="18"/>
- <line x1="6" y1="6" x2="18" y2="18"/>
- </svg>
+ <Icon name="x" className="w-4 h-4" />
</button>
</div>
);
@@ -1363,10 +1359,7 @@ const ItemAddEdit: React.FC = () => {
className="p-1.5 text-gray-400 hover:text-primary-500 focus:outline-none"
title={t('common.generate')}
>
- <svg className='w-4 h-4' viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round">
- <path d="M23 4v6h-6"/>
- <path d="M20.49 15a9 9 0 1 1-2.12-9.36L23 10"/>
- </svg>
+ <Icon name="refresh" className='w-4 h-4' />
</button>
</>
);
@@ -1479,10 +1472,7 @@ const ItemAddEdit: React.FC = () => {
onClick={() => handleAddOptionalField('login.email')}
className="inline-flex items-center gap-1 px-2 py-0.5 text-xs rounded-full transition-colors focus:outline-none text-gray-500 dark:text-gray-400 hover:text-primary-600 dark:hover:text-primary-400 border border-dashed border-gray-300 dark:border-gray-600 hover:border-primary-400 dark:hover:border-primary-500"
>
- <svg className="w-2.5 h-2.5 -ml-0.5" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2.5">
- <line x1="12" y1="5" x2="12" y2="19" />
- <line x1="5" y1="12" x2="19" y2="12" />
- </svg>
+ <Icon name="plus" className="w-2.5 h-2.5 -ml-0.5" strokeWidth={2.5} />
<span>{t('common.email')}</span>
</button>
)}
@@ -1523,10 +1513,7 @@ const ItemAddEdit: React.FC = () => {
className="p-1.5 text-gray-400 hover:text-red-500 focus:outline-none"
title={t('common.delete')}
>
- <svg className='w-4 h-4' viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round">
- <line x1="18" y1="6" x2="6" y2="18"/>
- <line x1="6" y1="6" x2="18" y2="18"/>
- </svg>
+ <Icon name="x" className='w-4 h-4' />
</button>
) : undefined
}
diff --git a/apps/browser-extension/src/entrypoints/popup/pages/items/ItemTypeSelector.tsx b/apps/browser-extension/src/entrypoints/popup/pages/items/ItemTypeSelector.tsx
index 0fd8059f5..2b98b75a6 100644
--- a/apps/browser-extension/src/entrypoints/popup/pages/items/ItemTypeSelector.tsx
+++ b/apps/browser-extension/src/entrypoints/popup/pages/items/ItemTypeSelector.tsx
@@ -3,6 +3,7 @@ import { useTranslation } from 'react-i18next';
import { useNavigate } from 'react-router-dom';
import { FormInput } from '@/entrypoints/popup/components/Forms/FormInput';
+import Icon from '@/entrypoints/popup/components/Icons/Icon';
import { useLoading } from '@/entrypoints/popup/context/LoadingContext';
import type { ItemType } from '@aliasvault/models/vault';
@@ -24,36 +25,28 @@ const ITEM_TYPE_OPTIONS: ItemTypeOption[] = [
type: 'Login',
titleKey: 'itemTypes.login.title',
iconSvg: (
- <svg className="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24">
- <path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M15 7a2 2 0 012 2m4 0a6 6 0 01-7.743 5.743L11 17H9v2H7v2H4a1 1 0 01-1-1v-2.586a1 1 0 01.293-.707l5.964-5.964A6 6 0 1121 9z" />
- </svg>
+ <Icon name="key" className="w-5 h-5" />
)
},
{
type: 'Alias',
titleKey: 'itemTypes.alias.title',
iconSvg: (
- <svg className="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24">
- <path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M16 7a4 4 0 11-8 0 4 4 0 018 0zM12 14a7 7 0 00-7 7h14a7 7 0 00-7-7z" />
- </svg>
+ <Icon name="user" className="w-5 h-5" />
)
},
{
type: 'CreditCard',
titleKey: 'itemTypes.creditCard.title',
iconSvg: (
- <svg className="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24">
- <path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M3 10h18M7 15h1m4 0h1m-7 4h12a3 3 0 003-3V8a3 3 0 00-3-3H6a3 3 0 00-3 3v8a3 3 0 003 3z" />
- </svg>
+ <Icon name="credit-card" className="w-5 h-5" />
)
},
{
type: 'Note',
titleKey: 'itemTypes.secureNote',
iconSvg: (
- <svg className="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24">
- <path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" />
- </svg>
+ <Icon name="document-text" className="w-5 h-5" />
)
}
];
@@ -132,14 +125,7 @@ const ItemTypeSelector: React.FC = () => {
{selectedOption ? t(selectedOption.titleKey) : ''}
</span>
</div>
- <svg
- className={`w-5 h-5 text-gray-400 transition-transform ${showDropdown ? 'rotate-180' : ''}`}
- fill="none"
- stroke="currentColor"
- viewBox="0 0 24 24"
- >
- <path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M19 9l-7 7-7-7" />
- </svg>
+ <Icon name="chevron-down" className={`w-5 h-5 text-gray-400 transition-transform ${showDropdown ? 'rotate-180' : ''}`} />
</button>
{/* Dropdown Menu */}
@@ -168,9 +154,7 @@ const ItemTypeSelector: React.FC = () => {
{t(option.titleKey)}
</span>
{selectedType === option.type && (
- <svg className="w-5 h-5 ml-auto text-primary-600 dark:text-primary-400" fill="currentColor" viewBox="0 0 20 20">
- <path fillRule="evenodd" d="M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z" clipRule="evenodd" />
- </svg>
+ <Icon name="check" className="w-5 h-5 ml-auto text-primary-600 dark:text-primary-400" />
)}
</button>
))}
diff --git a/apps/browser-extension/src/entrypoints/popup/pages/items/ItemsList.tsx b/apps/browser-extension/src/entrypoints/popup/pages/items/ItemsList.tsx
index 2788910e7..e153ce401 100644
--- a/apps/browser-extension/src/entrypoints/popup/pages/items/ItemsList.tsx
+++ b/apps/browser-extension/src/entrypoints/popup/pages/items/ItemsList.tsx
@@ -13,6 +13,7 @@ import FolderBreadcrumb from '@/entrypoints/popup/components/Folders/FolderBread
import FolderModal from '@/entrypoints/popup/components/Folders/FolderModal';
import HeaderButton from '@/entrypoints/popup/components/HeaderButton';
import { HeaderIconType } from '@/entrypoints/popup/components/Icons/HeaderIcons';
+import Icon from '@/entrypoints/popup/components/Icons/Icon';
import AddItemDropdown from '@/entrypoints/popup/components/Items/AddItemDropdown';
import CurrentSiteSuggestion from '@/entrypoints/popup/components/Items/CurrentSiteSuggestion';
import FolderPill from '@/entrypoints/popup/components/Items/FolderPill';
@@ -902,19 +903,14 @@ const ItemsList: React.FC = () => {
title={t('items.folders.editFolder')}
className="p-1.5 text-gray-400 hover:text-orange-500 dark:text-gray-500 dark:hover:text-orange-400 hover:bg-gray-100 dark:hover:bg-gray-700 rounded-lg transition-colors"
>
- <svg className="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24">
- <path strokeLinecap="round" strokeLinejoin="round" strokeWidth="2" d="M11 5H6a2 2 0 00-2 2v11a2 2 0 002 2h11a2 2 0 002-2v-5m-1.414-9.414a2 2 0 112.828 2.828L11.828 15H9v-2.828l8.586-8.586z" />
- </svg>
+ <Icon name="pencil-alt" className="w-4 h-4" />
</button>
<button
onClick={() => setShowDeleteFolderModal(true)}
title={t('items.folders.deleteFolder')}
className="p-1.5 text-gray-400 hover:text-red-500 dark:text-gray-500 dark:hover:text-red-400 hover:bg-gray-100 dark:hover:bg-gray-700 rounded-lg transition-colors"
>
- <svg className="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24">
- <polyline points="3 6 5 6 21 6" />
- <path d="M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2" />
- </svg>
+ <Icon name="trash" className="w-4 h-4" strokeWidth={1} />
</button>
</div>
)}
@@ -927,13 +923,7 @@ const ItemsList: React.FC = () => {
className="p-1.5 text-gray-400 hover:text-gray-600 dark:text-gray-500 dark:hover:text-gray-300 hover:bg-gray-100 dark:hover:bg-gray-700 rounded-lg transition-colors"
title={t('items.sort.title')}
>
- <svg className="w-5 h-5" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round">
- <line x1="4" y1="6" x2="16" y2="6" />
- <line x1="4" y1="12" x2="12" y2="12" />
- <line x1="4" y1="18" x2="8" y2="18" />
- <polyline points="15 15 18 18 21 15" />
- <line x1="18" y1="12" x2="18" y2="18" />
- </svg>
+ <Icon name="sort-descending" className="w-5 h-5" />
</button>
{showSortMenu && (
<>
@@ -959,9 +949,7 @@ const ItemsList: React.FC = () => {
}`}
>
{sortOrder === option.value ? (
- <svg className="w-4 h-4" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2">
- <polyline points="20 6 9 17 4 12" />
- </svg>
+ <Icon name="check" className="w-4 h-4" />
) : (
<span className="w-4" />
)}
@@ -1040,10 +1028,7 @@ const ItemsList: React.FC = () => {
onClick={() => setSearchTerm('')}
className="inline-flex items-center gap-1 px-3 py-1.5 text-sm bg-gray-100 dark:bg-gray-700 hover:bg-gray-200 dark:hover:bg-gray-600 text-gray-700 dark:text-gray-300 rounded-lg transition-colors"
>
- <svg className="w-4 h-4" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2">
- <line x1="18" y1="6" x2="6" y2="18" />
- <line x1="6" y1="6" x2="18" y2="18" />
- </svg>
+ <Icon name="x" className="w-4 h-4" />
{t('items.clearSearch')}
</button>
)}
@@ -1055,10 +1040,7 @@ const ItemsList: React.FC = () => {
}}
className="inline-flex items-center gap-1 px-3 py-1.5 text-sm bg-orange-100 dark:bg-orange-900/30 hover:bg-orange-200 dark:hover:bg-orange-900/50 text-orange-700 dark:text-orange-300 rounded-lg transition-colors"
>
- <svg className="w-4 h-4" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2">
- <line x1="18" y1="6" x2="6" y2="18" />
- <line x1="6" y1="6" x2="18" y2="18" />
- </svg>
+ <Icon name="x" className="w-4 h-4" />
{t('items.clearFilter')}
</button>
)}
@@ -1087,13 +1069,8 @@ const ItemsList: React.FC = () => {
onClick={handleAddFolder}
className="inline-flex items-center gap-1 px-2.5 py-1.5 text-xs rounded-full transition-colors focus:outline-none text-gray-500 dark:text-gray-400 hover:text-orange-600 dark:hover:text-orange-400 hover:bg-gray-100 dark:hover:bg-gray-700/50"
>
- <svg className="w-3.5 h-3.5" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2">
- <path strokeLinecap="round" strokeLinejoin="round" d="M3 7v10a2 2 0 002 2h14a2 2 0 002-2V9a2 2 0 00-2-2h-6l-2-2H5a2 2 0 00-2 2z" />
- </svg>
- <svg className="w-3 h-3 -ml-0.5" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2.5">
- <line x1="12" y1="5" x2="12" y2="19" />
- <line x1="5" y1="12" x2="19" y2="12" />
- </svg>
+ <Icon name="folder" className="w-3.5 h-3.5" />
+ <Icon name="plus" className="w-3 h-3 -ml-0.5" strokeWidth={2.5} />
</button>
)}
</div>
@@ -1129,13 +1106,8 @@ const ItemsList: React.FC = () => {
: 'text-gray-400 dark:text-gray-500 border border-dashed border-gray-300 dark:border-gray-600 hover:border-orange-400 dark:hover:border-orange-500 hover:text-orange-600 dark:hover:text-orange-400'
}`}
>
- <svg className="w-3.5 h-3.5" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2">
- <path strokeLinecap="round" strokeLinejoin="round" d="M3 7v10a2 2 0 002 2h14a2 2 0 002-2V9a2 2 0 00-2-2h-6l-2-2H5a2 2 0 00-2 2z" />
- </svg>
- <svg className="w-3 h-3 -ml-0.5" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2.5">
- <line x1="12" y1="5" x2="12" y2="19" />
- <line x1="5" y1="12" x2="19" y2="12" />
- </svg>
+ <Icon name="folder" className="w-3.5 h-3.5" />
+ <Icon name="plus" className="w-3 h-3 -ml-0.5" strokeWidth={2.5} />
{folders.length === 0 && (
/**
* Only show text when there are no folders yet
@@ -1185,10 +1157,7 @@ const ItemsList: React.FC = () => {
onClick={() => setSearchTerm('')}
className="inline-flex items-center gap-1 px-3 py-1.5 text-sm bg-gray-100 dark:bg-gray-700 hover:bg-gray-200 dark:hover:bg-gray-600 text-gray-700 dark:text-gray-300 rounded-lg transition-colors"
>
- <svg className="w-4 h-4" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2">
- <line x1="18" y1="6" x2="6" y2="18" />
- <line x1="6" y1="6" x2="18" y2="18" />
- </svg>
+ <Icon name="x" className="w-4 h-4" />
{t('items.clearSearch')}
</button>
)}
@@ -1200,10 +1169,7 @@ const ItemsList: React.FC = () => {
}}
className="inline-flex items-center gap-1 px-3 py-1.5 text-sm bg-orange-100 dark:bg-orange-900/30 hover:bg-orange-200 dark:hover:bg-orange-900/50 text-orange-700 dark:text-orange-300 rounded-lg transition-colors"
>
- <svg className="w-4 h-4" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2">
- <line x1="18" y1="6" x2="6" y2="18" />
- <line x1="6" y1="6" x2="18" y2="18" />
- </svg>
+ <Icon name="x" className="w-4 h-4" />
{t('items.clearFilter')}
</button>
)}
diff --git a/apps/browser-extension/src/entrypoints/popup/pages/passkeys/PasskeyCreate.tsx b/apps/browser-extension/src/entrypoints/popup/pages/passkeys/PasskeyCreate.tsx
index 2735ff69e..6be2cbaa4 100644
--- a/apps/browser-extension/src/entrypoints/popup/pages/passkeys/PasskeyCreate.tsx
+++ b/apps/browser-extension/src/entrypoints/popup/pages/passkeys/PasskeyCreate.tsx
@@ -10,6 +10,7 @@ import Alert from '@/entrypoints/popup/components/Alert';
import Button from '@/entrypoints/popup/components/Button';
import PasskeyBypassDialog from '@/entrypoints/popup/components/Dialogs/PasskeyBypassDialog';
import { FormInput } from '@/entrypoints/popup/components/Forms/FormInput';
+import Icon from '@/entrypoints/popup/components/Icons/Icon';
import LoadingSpinner from '@/entrypoints/popup/components/LoadingSpinner';
import { useDb } from '@/entrypoints/popup/context/DbContext';
import { useLoading } from '@/entrypoints/popup/context/LoadingContext';
@@ -649,9 +650,7 @@ const PasskeyCreate: React.FC = () => {
<span className="truncate">{passkey.Username || passkey.Email || passkey.DisplayName}</span>
</div>
</div>
- <svg className="w-5 h-5 text-gray-400" fill="none" viewBox="0 0 24 24" stroke="currentColor">
- <path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M9 5l7 7-7 7" />
- </svg>
+ <Icon name="chevron-right" className="w-5 h-5 text-gray-400" />
</div>
</button>
))}
@@ -723,9 +722,7 @@ const PasskeyCreate: React.FC = () => {
)}
</div>
</div>
- <svg className="w-5 h-5 text-gray-400 flex-shrink-0 ml-2" fill="none" viewBox="0 0 24 24" stroke="currentColor">
- <path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M9 5l7 7-7 7" />
- </svg>
+ <Icon name="chevron-right" className="w-5 h-5 text-gray-400 flex-shrink-0 ml-2" />
</div>
</button>
))}
diff --git a/apps/browser-extension/src/entrypoints/popup/pages/settings/AutofillSettings.tsx b/apps/browser-extension/src/entrypoints/popup/pages/settings/AutofillSettings.tsx
index 7a107ada1..b3d6a6b6c 100644
--- a/apps/browser-extension/src/entrypoints/popup/pages/settings/AutofillSettings.tsx
+++ b/apps/browser-extension/src/entrypoints/popup/pages/settings/AutofillSettings.tsx
@@ -2,6 +2,7 @@ import { AutofillMatchingMode } from '@aliasvault/client/rust/RustCore';
import React, { useEffect, useState, useCallback } from 'react';
import { useTranslation } from 'react-i18next';
+import Icon from '@/entrypoints/popup/components/Icons/Icon';
import PageTitle from '@/entrypoints/popup/components/PageTitle';
import { useLoading } from '@/entrypoints/popup/context/LoadingContext';
@@ -308,14 +309,7 @@ const AutofillSettings: React.FC = () => {
<span className="font-medium text-gray-900 dark:text-white">
{t('settings.disabledSites')} ({getDisabledSitesCount()})
</span>
- <svg
- className={`w-5 h-5 text-gray-500 transition-transform ${showDisabledSites ? 'rotate-180' : ''}`}
- fill="none"
- stroke="currentColor"
- viewBox="0 0 24 24"
- >
- <path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M19 9l-7 7-7-7" />
- </svg>
+ <Icon name="chevron-down" className={`w-5 h-5 text-gray-500 transition-transform ${showDisabledSites ? 'rotate-180' : ''}`} />
</button>
<p className="text-sm text-gray-600 dark:text-gray-400 mt-1">{t('settings.disabledSitesDescription')}</p>
@@ -396,14 +390,7 @@ const AutofillSettings: React.FC = () => {
<span className="font-medium text-gray-900 dark:text-white">
{t('settings.loginSave.blockedSites')} ({loginSaveSettings.blockedDomains.length})
</span>
- <svg
- className={`w-5 h-5 text-gray-500 transition-transform ${showBlockedDomains ? 'rotate-180' : ''}`}
- fill="none"
- stroke="currentColor"
- viewBox="0 0 24 24"
- >
- <path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M19 9l-7 7-7-7" />
- </svg>
+ <Icon name="chevron-down" className={`w-5 h-5 text-gray-500 transition-transform ${showBlockedDomains ? 'rotate-180' : ''}`} />
</button>
<p className="text-sm text-gray-600 dark:text-gray-400 mt-1">{t('settings.loginSave.blockedSitesDescription')}</p>
diff --git a/apps/browser-extension/src/entrypoints/popup/pages/settings/FamilySharingSettings.tsx b/apps/browser-extension/src/entrypoints/popup/pages/settings/FamilySharingSettings.tsx
index c5fec581b..e8a0646c8 100644
--- a/apps/browser-extension/src/entrypoints/popup/pages/settings/FamilySharingSettings.tsx
+++ b/apps/browser-extension/src/entrypoints/popup/pages/settings/FamilySharingSettings.tsx
@@ -12,6 +12,7 @@ import ConfirmDeleteModal from '@/entrypoints/popup/components/Dialogs/ConfirmDe
import ConfirmPasswordModal from '@/entrypoints/popup/components/Dialogs/ConfirmPasswordModal';
import FolderIcon from '@/entrypoints/popup/components/Folders/FolderIcon';
import { HeaderIcon, HeaderIconType } from '@/entrypoints/popup/components/Icons/HeaderIcons';
+import Icon from '@/entrypoints/popup/components/Icons/Icon';
import LoadingSpinner from '@/entrypoints/popup/components/LoadingSpinner';
import PageTitle from '@/entrypoints/popup/components/PageTitle';
import ReloadButton from '@/entrypoints/popup/components/ReloadButton';
@@ -427,9 +428,7 @@ const FamilySharingSettings: React.FC = () => {
<div className="bg-white dark:bg-gray-800 rounded-lg shadow-sm border border-gray-200 dark:border-gray-700 p-3">
<button onClick={() => toggleRoster(group.groupId)} className="flex items-center justify-between w-full text-left">
<span className="font-medium text-gray-900 dark:text-white">{familySharingText.members} ({group.members.length})</span>
- <svg className={`w-5 h-5 text-gray-500 transition-transform ${isRosterExpanded(group.groupId) ? 'rotate-180' : ''}`} fill="none" stroke="currentColor" viewBox="0 0 24 24">
- <path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M19 9l-7 7-7-7" />
- </svg>
+ <Icon name="chevron-down" className={`w-5 h-5 text-gray-500 transition-transform ${isRosterExpanded(group.groupId) ? 'rotate-180' : ''}`} />
</button>
{isRosterExpanded(group.groupId) && (
@@ -471,9 +470,7 @@ const FamilySharingSettings: React.FC = () => {
<button onClick={() => navigate(`/items/folder/${folderId}/${folderId}`)} className="flex flex-1 items-center gap-2 min-w-0 px-1.5 py-1 rounded-md hover:bg-gray-100 dark:hover:bg-gray-700 transition-colors">
<FolderIcon isShared className="w-4 h-4 text-orange-500 dark:text-orange-400" />
<span className="font-medium text-gray-900 dark:text-white truncate">{vaultLabel(manifest)}</span>
- <svg className="w-4 h-4 ml-auto shrink-0 text-gray-400" fill="none" stroke="currentColor" viewBox="0 0 24 24">
- <path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M9 5l7 7-7 7" />
- </svg>
+ <Icon name="chevron-right" className="w-4 h-4 ml-auto shrink-0 text-gray-400" />
</button>
) : (
<div className="flex flex-1 items-center gap-2 min-w-0 px-1.5 py-1">
@@ -613,9 +610,7 @@ const FamilySharingSettings: React.FC = () => {
onClick={() => setPendingVaultCreate(group)}
className="w-full px-4 py-2 border-2 border-dashed border-gray-300 dark:border-gray-600 text-gray-600 dark:text-gray-400 rounded-md hover:border-primary-500 hover:text-primary-600 dark:hover:text-primary-400 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-primary-500 transition-colors flex items-center justify-center gap-2 disabled:opacity-50"
>
- <svg className="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24">
- <path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M12 6v6m0 0v6m0-6h6m-6 0H6" />
- </svg>
+ <Icon name="plus-sm" className="w-5 h-5" />
<span className="text-sm font-medium">{familySharingText.createSharedVault}</span>
</button>
)}
diff --git a/apps/browser-extension/src/entrypoints/popup/pages/settings/Settings.tsx b/apps/browser-extension/src/entrypoints/popup/pages/settings/Settings.tsx
index a0adccbfa..44782786f 100644
--- a/apps/browser-extension/src/entrypoints/popup/pages/settings/Settings.tsx
+++ b/apps/browser-extension/src/entrypoints/popup/pages/settings/Settings.tsx
@@ -8,6 +8,7 @@ import { useNavigate } from 'react-router-dom';
import LogoutConfirmModal from '@/entrypoints/popup/components/Dialogs/LogoutConfirmModal';
import HeaderButton from '@/entrypoints/popup/components/HeaderButton';
import { HeaderIconType } from '@/entrypoints/popup/components/Icons/HeaderIcons';
+import Icon from '@/entrypoints/popup/components/Icons/Icon';
import PageTitle from '@/entrypoints/popup/components/PageTitle';
import { SettingsGroup, SettingsRow } from '@/entrypoints/popup/components/Settings/SettingsMenu';
import { useApp } from '@/entrypoints/popup/context/AppContext';
@@ -208,20 +209,7 @@ const Settings: React.FC = () => {
title={t('settings.lock')}
className="p-2 bg-gray-100 hover:bg-gray-200 dark:bg-gray-700 dark:hover:bg-gray-600 text-gray-600 hover:text-gray-700 dark:text-gray-400 dark:hover:text-gray-300 rounded-md transition-colors"
>
- <svg
- className="w-5 h-5"
- fill="none"
- stroke="currentColor"
- strokeWidth={2}
- viewBox="0 0 24 24"
- aria-label={t('settings.lock')}
- >
- <path
- strokeLinecap="round"
- strokeLinejoin="round"
- d="M12 15v2m-6 4h12a2 2 0 002-2v-6a2 2 0 00-2-2H6a2 2 0 00-2 2v6a2 2 0 002 2zm10-10V7a4 4 0 00-8 0v4h8z"
- />
- </svg>
+ <Icon name="lock-closed" className="w-5 h-5" aria-label={t('settings.lock')} />
</button>
<button
id="logout-button"
@@ -229,20 +217,7 @@ const Settings: React.FC = () => {
title={t('common.logout')}
className="p-2 bg-red-100 hover:bg-red-200 dark:bg-red-900/30 dark:hover:bg-red-900/50 text-red-600 hover:text-red-700 dark:text-red-400 dark:hover:text-red-300 rounded-md transition-colors"
>
- <svg
- className="w-5 h-5"
- fill="none"
- stroke="currentColor"
- strokeWidth={2}
- viewBox="0 0 24 24"
- aria-label={t('common.logout')}
- >
- <path
- strokeLinecap="round"
- strokeLinejoin="round"
- d="M17 16l4-4m0 0l-4-4m4 4H7m6 4v1a3 3 0 01-3 3H6a3 3 0 01-3-3V7a3 3 0 013-3h4a3 3 0 013 3v1"
- />
- </svg>
+ <Icon name="logout" className="w-5 h-5" aria-label={t('common.logout')} />
</button>
</div>
</div>
@@ -252,7 +227,7 @@ const Settings: React.FC = () => {
label={familySharingText.title}
badge={familySharingText.beta}
onClick={() => navigate('/settings/family-sharing')}
- icon={<path strokeLinecap="round" strokeLinejoin="round" d="M17 20h5v-2a3 3 0 00-5.356-1.857M17 20H7m10 0v-2c0-.656-.126-1.283-.356-1.857M7 20H2v-2a3 3 0 015.356-1.857M7 20v-2c0-.656.126-1.283.356-1.857m0 0a5.002 5.002 0 019.288 0M15 7a3 3 0 11-6 0 3 3 0 016 0zm6 3a2 2 0 11-4 0 2 2 0 014 0zM7 10a2 2 0 11-4 0 2 2 0 014 0z" />}
+ icon="user-group"
/>
)}
</div>
@@ -262,24 +237,24 @@ const Settings: React.FC = () => {
<SettingsRow
label={t('settings.autofillSettings')}
onClick={() => navigate('/settings/autofill')}
- icon={<path strokeLinecap="round" strokeLinejoin="round" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" />}
+ icon="document-text"
/>
<SettingsRow
label={t('settings.passkeySettings')}
onClick={() => navigate('/settings/passkeys')}
- icon={<path strokeLinecap="round" strokeLinejoin="round" d="M15 7a2 2 0 012 2m4 0a6 6 0 01-7.743 5.743L11 17H9v2H7v2H4a1 1 0 01-1-1v-2.586a1 1 0 01.293-.707l5.964-5.964A6 6 0 1121 9z" />}
+ icon="key"
/>
<SettingsRow
label={t('settings.contextMenuSettings')}
onClick={() => navigate('/settings/context-menu')}
- icon={<path strokeLinecap="round" strokeLinejoin="round" d="M4 6h16M4 12h16m-7 6h7" />}
+ icon="menu-alt-3"
/>
{openKeyboardShortcuts && (
<SettingsRow
label={t('settings.keyboardShortcuts')}
onClick={openKeyboardShortcuts}
external
- icon={<path strokeLinecap="round" strokeLinejoin="round" d="M5 7h14a2 2 0 012 2v6a2 2 0 01-2 2H5a2 2 0 01-2-2V9a2 2 0 012-2zM7 11h.01M11 11h.01M15 11h.01M8 15h8" />}
+ icon="keyboard"
/>
)}
</SettingsGroup>
@@ -288,23 +263,23 @@ const Settings: React.FC = () => {
<SettingsRow
label={t('settings.vaultUnlock')}
onClick={() => navigate('/settings/unlock-method')}
- icon={<path strokeLinecap="round" strokeLinejoin="round" d="M7 20l4-16m2 16l4-16M6 9h14M4 15h14" />}
+ icon="hashtag"
/>
<SettingsRow
label={t('settings.autoLock')}
onClick={() => navigate('/settings/auto-lock')}
- icon={<path strokeLinecap="round" strokeLinejoin="round" d="M12 15v2m-6 4h12a2 2 0 002-2v-6a2 2 0 00-2-2H6a2 2 0 00-2 2v6a2 2 0 002 2zm10-10V7a4 4 0 00-8 0v4h8z" />}
+ icon="lock-closed"
/>
<SettingsRow
label={t('settings.clipboardClear')}
onClick={() => navigate('/settings/clipboard')}
- icon={<path strokeLinecap="round" strokeLinejoin="round" d="M8 7v8a2 2 0 002 2h6M8 7V5a2 2 0 012-2h4.586a1 1 0 01.707.293l4.414 4.414a1 1 0 01.293.707V15a2 2 0 01-2 2h-2M8 7H6a2 2 0 00-2 2v10a2 2 0 002 2h8a2 2 0 002-2v-2" />}
+ icon="document-duplicate"
/>
<SettingsRow
id="security-settings-button"
label={t('settings.accountSecurity')}
onClick={() => navigate('/settings/security')}
- icon={<path strokeLinecap="round" strokeLinejoin="round" d="M9 12l2 2 4-4m5.618-4.016A11.955 11.955 0 0112 2.944a11.955 11.955 0 01-8.618 3.04A12.02 12.02 0 003 9c0 5.591 3.824 10.29 9 11.622 5.176-1.332 9-6.03 9-11.622 0-1.042-.133-2.052-.382-3.016z" />}
+ icon="shield-check"
/>
</SettingsGroup>
@@ -312,12 +287,12 @@ const Settings: React.FC = () => {
<SettingsRow
label={t('settings.passwordGenerator')}
onClick={() => navigate('/settings/password-generator')}
- icon={<path strokeLinecap="round" strokeLinejoin="round" d="M15 7a2 2 0 012 2m4 0a6 6 0 01-7.743 5.743L11 17H9v2H7v2H4a1 1 0 01-1-1v-2.586a1 1 0 01.293-.707l5.964-5.964A6 6 0 1121 9z" />}
+ icon="key"
/>
<SettingsRow
label={t('settings.identityGenerator')}
onClick={() => navigate('/settings/identity-generator')}
- icon={<path strokeLinecap="round" strokeLinejoin="round" d="M16 7a4 4 0 11-8 0 4 4 0 018 0zM12 14a7 7 0 00-7 7h14a7 7 0 00-7-7z" />}
+ icon="user"
/>
</SettingsGroup>
@@ -325,12 +300,12 @@ const Settings: React.FC = () => {
<SettingsRow
label={t('settings.appearance')}
onClick={() => navigate('/settings/appearance')}
- icon={<path strokeLinecap="round" strokeLinejoin="round" d="M7 21a4 4 0 01-4-4V5a2 2 0 012-2h4a2 2 0 012 2v12a4 4 0 01-4 4zm0 0h12a2 2 0 002-2v-4a2 2 0 00-2-2h-2.343M11 7.343l1.657-1.657a2 2 0 012.828 0l2.829 2.829a2 2 0 010 2.828L9.828 19.071M7 17h.01" />}
+ icon="color-swatch"
/>
<SettingsRow
label={t('settings.language')}
onClick={() => navigate('/settings/language')}
- icon={<path strokeLinecap="round" strokeLinejoin="round" d="M3 5h12M9 3v2m1.048 9.5A18.022 18.022 0 016.412 9m6.088 9h7M11 21l5-10 5 10M12.751 5C11.783 10.77 8.07 15.61 3 18.129" />}
+ icon="translate"
/>
</SettingsGroup>
diff --git a/apps/browser-extension/src/entrypoints/popup/pages/settings/VaultUnlockSettings.tsx b/apps/browser-extension/src/entrypoints/popup/pages/settings/VaultUnlockSettings.tsx
index 3e34aa545..f819f8c09 100644
--- a/apps/browser-extension/src/entrypoints/popup/pages/settings/VaultUnlockSettings.tsx
+++ b/apps/browser-extension/src/entrypoints/popup/pages/settings/VaultUnlockSettings.tsx
@@ -6,6 +6,7 @@ import AlertMessage from '@/entrypoints/popup/components/AlertMessage';
import Button from '@/entrypoints/popup/components/Button';
import HelpModal from '@/entrypoints/popup/components/Dialogs/HelpModal';
import ModalWrapper from '@/entrypoints/popup/components/Dialogs/ModalWrapper';
+import Icon from '@/entrypoints/popup/components/Icons/Icon';
import PageTitle from '@/entrypoints/popup/components/PageTitle';
import { useDb } from '@/entrypoints/popup/context/DbContext';
import { useLoading } from '@/entrypoints/popup/context/LoadingContext';
@@ -212,9 +213,7 @@ const VaultUnlockSettings: React.FC = () => {
<div className="p-4">
<div className="flex items-center justify-between">
<div className="flex items-center">
- <svg className="w-5 h-5 mr-2 text-gray-600 dark:text-gray-400" fill="none" stroke="currentColor" viewBox="0 0 24 24">
- <path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M7 20l4-16m2 16l4-16M6 9h14M4 15h14" />
- </svg>
+ <Icon name="hashtag" className="w-5 h-5 mr-2 text-gray-600 dark:text-gray-400" />
<div>
<div className="flex items-center">
<p className="font-medium text-gray-900 dark:text-white">{t('settings.vaultUnlockSettings.pin')}</p>
@@ -252,9 +251,7 @@ const VaultUnlockSettings: React.FC = () => {
<div className="p-4">
<div className="flex items-center justify-between">
<div className="flex items-center">
- <svg className="w-5 h-5 mr-2 text-gray-600 dark:text-gray-400" fill="none" stroke="currentColor" viewBox="0 0 24 24">
- <path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M12 15v2m-6 4h12a2 2 0 002-2v-6a2 2 0 00-2-2H6a2 2 0 00-2 2v6a2 2 0 002 2zm10-10V7a4 4 0 00-8 0v4h8z" />
- </svg>
+ <Icon name="lock-closed" className="w-5 h-5 mr-2 text-gray-600 dark:text-gray-400" />
<div>
<p className="font-medium text-gray-900 dark:text-white">{t('auth.masterPassword')}</p>
</div>
diff --git a/apps/browser-extension/src/entrypoints/popup/pages/settings/security/SecuritySettings.tsx b/apps/browser-extension/src/entrypoints/popup/pages/settings/security/SecuritySettings.tsx
index 8cca9f29e..5f00da3c0 100644
--- a/apps/browser-extension/src/entrypoints/popup/pages/settings/security/SecuritySettings.tsx
+++ b/apps/browser-extension/src/entrypoints/popup/pages/settings/security/SecuritySettings.tsx
@@ -29,7 +29,7 @@ const SecuritySettings: React.FC = () => {
onClick={() => navigate('/settings/security/change-password')}
disabled={dbContext.isOffline}
disabledReason={offlineReason}
- icon={<path strokeLinecap="round" strokeLinejoin="round" d="M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15" />}
+ icon="refresh"
/>
<SettingsRow
id="active-sessions-button"
@@ -37,7 +37,7 @@ const SecuritySettings: React.FC = () => {
onClick={() => navigate('/settings/security/active-sessions')}
disabled={dbContext.isOffline}
disabledReason={offlineReason}
- icon={<path strokeLinecap="round" strokeLinejoin="round" d="M9.75 17L9 20l-1 1h8l-1-1-.75-3M3 13h18M5 17h14a2 2 0 002-2V5a2 2 0 00-2-2H5a2 2 0 00-2 2v10a2 2 0 002 2z" />}
+ icon="desktop-computer"
/>
<SettingsRow
id="auth-logs-button"
@@ -45,7 +45,7 @@ const SecuritySettings: React.FC = () => {
onClick={() => navigate('/settings/security/auth-logs')}
disabled={dbContext.isOffline}
disabledReason={offlineReason}
- icon={<path strokeLinecap="round" strokeLinejoin="round" d="M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-3 7h3m-3 4h3m-6-4h.01M9 16h.01" />}
+ icon="clipboard-list"
/>
</SettingsGroup>
@@ -57,7 +57,7 @@ const SecuritySettings: React.FC = () => {
danger
disabled={dbContext.isOffline}
disabledReason={offlineReason}
- icon={<path strokeLinecap="round" strokeLinejoin="round" d="M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16" />}
+ icon="trash"
/>
</SettingsGroup>
</div>
diff --git a/apps/mobile-app/android/app/src/main/java/net/aliasvault/app/vaultstore/models/AppIcons.kt b/apps/mobile-app/android/app/src/main/java/net/aliasvault/app/vaultstore/models/BuiltinLogos.kt
similarity index 60%
rename from apps/mobile-app/android/app/src/main/java/net/aliasvault/app/vaultstore/models/AppIcons.kt
rename to apps/mobile-app/android/app/src/main/java/net/aliasvault/app/vaultstore/models/BuiltinLogos.kt
index d74feee10..a085141bc 100644
--- a/apps/mobile-app/android/app/src/main/java/net/aliasvault/app/vaultstore/models/AppIcons.kt
+++ b/apps/mobile-app/android/app/src/main/java/net/aliasvault/app/vaultstore/models/BuiltinLogos.kt
@@ -1,28 +1,29 @@
// <auto-generated />
-// This file is auto-generated from core/models/src/icons/AppIcons.ts
-// Do not edit this file directly. Run 'npm run generate:models' to regenerate.
+// This file is auto-generated from core/models/src/icons/svg by core/models/scripts/generate-icons.cjs.
+// Do not edit this file directly. Run 'node core/models/scripts/generate-icons.cjs' to regenerate.
@file:Suppress("MaxLineLength")
package net.aliasvault.app.vaultstore.models
/**
- * The catalog of built-in icons a user can pick for an item, keyed by the Source a builtin logo row stores.
- * Single source of truth for all built-in icons across platforms.
+ * The built-in logos a user can pick for an item, keyed by the Source a builtin logo row stores.
+ * Single source of truth for all built-in logos across platforms.
*/
-object AppIcons {
+object BuiltinLogos {
/**
- * Shopping icon SVG.
+ * shopping icon SVG.
*/
val SHOPPING = """
<svg viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg">
- <path d="M4 5H7L9.5 19H24L27 9H10" stroke="#f49541" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round"/>
- <circle cx="11" cy="25" r="2.5" fill="#d68338"/>
- <circle cx="22" cy="25" r="2.5" fill="#d68338"/>
+ <path d="M11 12.5V9C11 6.24 13.24 4 16 4C18.76 4 21 6.24 21 9V12.5" stroke="#d68338" stroke-width="2.5" stroke-linecap="round"/>
+ <path d="M6.3 10H25.7L27.2 26.2C27.31 27.37 26.39 28.4 25.21 28.4H6.79C5.61 28.4 4.69 27.37 4.8 26.2L6.3 10Z" fill="#f49541"/>
+ <circle cx="11" cy="14" r="1.5" fill="#ffe096"/>
+ <circle cx="21" cy="14" r="1.5" fill="#ffe096"/>
</svg>
""".trimIndent()
/**
- * Bank icon SVG.
+ * bank icon SVG.
*/
val BANK = """
<svg viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg">
@@ -35,7 +36,7 @@ object AppIcons {
""".trimIndent()
/**
- * Mail icon SVG.
+ * mail icon SVG.
*/
val MAIL = """
<svg viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg">
@@ -45,19 +46,19 @@ object AppIcons {
""".trimIndent()
/**
- * Social icon SVG.
+ * social icon SVG.
*/
val SOCIAL = """
<svg viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg">
+ <circle cx="22" cy="11" r="4" fill="#d68338"/>
+ <path d="M18 27C18 21.5 20.5 18.5 23.5 18.5C26.5 18.5 29.5 21 29.5 27H18Z" fill="#d68338"/>
<circle cx="12" cy="11" r="5" fill="#f49541"/>
- <path d="M3 27C3 21.5 7 18 12 18C17 18 21 21.5 21 27H3Z" fill="#f49541"/>
- <circle cx="23" cy="12" r="4" fill="#d68338"/>
- <path d="M20 27C20 22 23 19.5 26 19.5C28.5 19.5 30 22 30 27H20Z" fill="#d68338"/>
+ <path d="M2.5 27C2.5 21.5 6.5 18 12 18C17.5 18 21.5 21.5 21.5 27H2.5Z" fill="#f49541"/>
</svg>
""".trimIndent()
/**
- * Work icon SVG.
+ * work icon SVG.
*/
val WORK = """
<svg viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg">
@@ -69,20 +70,20 @@ object AppIcons {
""".trimIndent()
/**
- * Game icon SVG.
+ * game icon SVG.
*/
val GAME = """
<svg viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg">
- <rect x="2" y="9" width="28" height="15" rx="7.5" fill="#f49541"/>
- <rect x="7" y="14" width="6" height="2" rx="1" fill="#ffe096"/>
- <rect x="9" y="12" width="2" height="6" rx="1" fill="#ffe096"/>
- <circle cx="21" cy="14.5" r="1.8" fill="#d68338"/>
- <circle cx="24.5" cy="18" r="1.8" fill="#d68338"/>
+ <rect x="2" y="7" width="28" height="18" rx="9" fill="#f49541"/>
+ <rect x="7" y="15" width="7" height="2.2" rx="1.1" fill="#ffe096"/>
+ <rect x="9.4" y="12.6" width="2.2" height="7" rx="1.1" fill="#ffe096"/>
+ <circle cx="21" cy="14" r="1.9" fill="#ffe096"/>
+ <circle cx="24.5" cy="18" r="1.9" fill="#ffe096"/>
</svg>
""".trimIndent()
/**
- * Media icon SVG.
+ * media icon SVG.
*/
val MEDIA = """
<svg viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg">
@@ -92,16 +93,18 @@ object AppIcons {
""".trimIndent()
/**
- * Travel icon SVG.
+ * travel icon SVG.
*/
val TRAVEL = """
<svg viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg">
- <path d="M15 3C16.1 3 17 3.9 17 5V12.5L29 19V22L17 18.5V24L20 26.5V29L15 27.5L10 29V26.5L13 24V18.5L1 22V19L13 12.5V5C13 3.9 13.9 3 15 3Z" fill="#f49541"/>
+ <path d="M14 12.4L2 19V22L14 18.5V12.4ZM18 12.4L30 19V22L18 18.5V12.4Z" fill="#d68338"/>
+ <path d="M14 23.5L11 26V28.5L16 27L21 28.5V26L18 23.5H14Z" fill="#d68338"/>
+ <path d="M16 3C17.1 3 18 3.9 18 5V24C18 25.5 17.1 27 16 27C14.9 27 14 25.5 14 24V5C14 3.9 14.9 3 16 3Z" fill="#f49541"/>
</svg>
""".trimIndent()
/**
- * Health icon SVG.
+ * health icon SVG.
*/
val HEALTH = """
<svg viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg">
@@ -111,7 +114,7 @@ object AppIcons {
""".trimIndent()
/**
- * Dev icon SVG.
+ * dev icon SVG.
*/
val DEV = """
<svg viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg">
@@ -125,16 +128,16 @@ object AppIcons {
* The SVG for an icon key, or null when the key is unknown to this client.
*/
fun svgFor(key: String): String? = when (key) {
- "Shopping" -> SHOPPING
- "Bank" -> BANK
- "Mail" -> MAIL
- "Social" -> SOCIAL
- "Work" -> WORK
- "Game" -> GAME
- "Media" -> MEDIA
- "Travel" -> TRAVEL
- "Health" -> HEALTH
- "Dev" -> DEV
+ "shopping" -> SHOPPING
+ "bank" -> BANK
+ "mail" -> MAIL
+ "social" -> SOCIAL
+ "work" -> WORK
+ "game" -> GAME
+ "media" -> MEDIA
+ "travel" -> TRAVEL
+ "health" -> HEALTH
+ "dev" -> DEV
else -> null
}
}
diff --git a/apps/mobile-app/android/app/src/main/java/net/aliasvault/app/vaultstore/models/ItemTypeIcons.kt b/apps/mobile-app/android/app/src/main/java/net/aliasvault/app/vaultstore/models/ItemTypeIcons.kt
index 20fce3bd9..28011188a 100644
--- a/apps/mobile-app/android/app/src/main/java/net/aliasvault/app/vaultstore/models/ItemTypeIcons.kt
+++ b/apps/mobile-app/android/app/src/main/java/net/aliasvault/app/vaultstore/models/ItemTypeIcons.kt
@@ -1,6 +1,6 @@
// <auto-generated />
-// This file is auto-generated from core/models/src/icons/ItemTypeIcons.ts
-// Do not edit this file directly. Run 'npm run generate:models' to regenerate.
+// This file is auto-generated from core/models/src/icons/svg by core/models/scripts/generate-icons.cjs.
+// Do not edit this file directly. Run 'node core/models/scripts/generate-icons.cjs' to regenerate.
@file:Suppress("MaxLineLength")
package net.aliasvault.app.vaultstore.models
@@ -11,7 +11,7 @@ package net.aliasvault.app.vaultstore.models
*/
object ItemTypeIcons {
/**
- * Placeholder icon SVG.
+ * placeholder icon SVG.
*/
val PLACEHOLDER = """
<svg viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg">
@@ -24,7 +24,7 @@ object ItemTypeIcons {
""".trimIndent()
/**
- * Note icon SVG.
+ * note icon SVG.
*/
val NOTE = """
<svg viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg">
@@ -37,7 +37,7 @@ object ItemTypeIcons {
""".trimIndent()
/**
- * CreditCard icon SVG.
+ * credit-card icon SVG.
*/
val CREDIT_CARD = """
<svg viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg">
@@ -49,47 +49,45 @@ object ItemTypeIcons {
""".trimIndent()
/**
- * Visa icon SVG.
+ * visa icon SVG.
*/
val VISA = """
<svg viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg">
<rect x="2" y="6" width="28" height="20" rx="3" fill="#f49541"/>
- <path d="M13.5 13L11.5 19H10L8.5 14.5C8.5 14.5 8.35 14 8 14C7.65 14 7 13.8 7 13.8L7.05 13.5H9.5C9.85 13.5 10.15 13.75 10.2 14.1L10.8 17L12.5 13.5H13.5V13ZM15 19H14L15 13H16L15 19ZM20 13.5C20 13.5 19.4 13.3 18.7 13.3C17.35 13.3 16.4 14 16.4 15C16.4 15.8 17.1 16.2 17.65 16.5C18.2 16.8 18.4 17 18.4 17.2C18.4 17.5 18.05 17.7 17.6 17.7C17 17.7 16.5 17.5 16.5 17.5L16.3 18.7C16.3 18.7 16.9 19 17.7 19C19.2 19 20.1 18.2 20.1 17.1C20.1 15.7 18.4 15.6 18.4 15C18.4 14.7 18.7 14.5 19.15 14.5C19.6 14.5 20.1 14.7 20.1 14.7L20.3 13.5H20V13.5ZM24 19L23.1 13.5H22C21.7 13.5 21.45 13.7 21.35 13.95L19 19H20.5L20.8 18H22.7L22.9 19H24ZM21.2 17L22 14.5L22.45 17H21.2Z" fill="#ffe096"/>
+ <path d="M7 13L9 19L11 13M13.2 13V19M18.6 13.7C18.1 13.2 17.4 13 16.7 13C15.7 13 15 13.6 15 14.4C15 16.2 18.8 15.8 18.8 17.6C18.8 18.4 18 19 17 19C16.2 19 15.4 18.7 14.9 18.2M20.5 19L22.75 13L25 19M21.3 17H24.2" stroke="#ffe096" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round"/>
</svg>
""".trimIndent()
/**
- * Mastercard icon SVG.
+ * mastercard icon SVG.
*/
val MASTERCARD = """
<svg viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg">
<rect x="2" y="6" width="28" height="20" rx="3" fill="#f49541"/>
- <circle cx="13" cy="16" r="5" fill="#d68338"/>
- <circle cx="19" cy="16" r="5" fill="#ffe096"/>
- <path d="M16 12.5C17.1 13.4 17.8 14.6 17.8 16C17.8 17.4 17.1 18.6 16 19.5C14.9 18.6 14.2 17.4 14.2 16C14.2 14.6 14.9 13.4 16 12.5Z" fill="#fbcb74"/>
+ <path d="M16 11.75C17.35 12.76 18.2 14.28 18.2 16C18.2 17.72 17.35 19.24 16 20.25C14.65 19.24 13.8 17.72 13.8 16C13.8 14.28 14.65 12.76 16 11.75Z" fill="#fbcb74"/>
+ <circle cx="12.5" cy="16" r="5" stroke="#ffe096" stroke-width="1.6"/>
+ <circle cx="19.5" cy="16" r="5" stroke="#ffe096" stroke-width="1.6"/>
</svg>
""".trimIndent()
/**
- * Amex icon SVG.
+ * amex icon SVG.
*/
val AMEX = """
<svg viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg">
<rect x="2" y="6" width="28" height="20" rx="3" fill="#f49541"/>
- <text x="16" y="18" text-anchor="middle" fill="#ffe096" font-size="8" font-weight="bold" font-family="Arial, sans-serif">AMEX</text>
+ <path d="M7 19L8.8 13L10.6 19M7.6 17H10M12 19V13L13.8 16.5L15.6 13V19M20.4 13H17.4V19H20.4M17.4 16H19.8M22 13L25.2 19M25.2 13L22 19" stroke="#ffe096" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
</svg>
""".trimIndent()
/**
- * Discover icon SVG.
+ * discover icon SVG.
*/
val DISCOVER = """
<svg viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg">
<rect x="2" y="6" width="28" height="20" rx="3" fill="#f49541"/>
- <circle cx="20" cy="16" r="4" fill="#ffe096"/>
- <path d="M7 14H8.5C9.3 14 10 14.7 10 15.5C10 16.3 9.3 17 8.5 17H7V14Z" fill="#ffe096"/>
- <rect x="11" y="14" width="1.5" height="3" fill="#ffe096"/>
- <path d="M14 15C14 14.4 14.4 14 15 14C15.3 14 15.5 14.1 15.7 14.3L16.5 13.5C16.1 13.2 15.6 13 15 13C13.9 13 13 13.9 13 15C13 16.1 13.9 17 15 17C15.6 17 16.1 16.8 16.5 16.5L15.7 15.7C15.5 15.9 15.3 16 15 16C14.4 16 14 15.6 14 15Z" fill="#ffe096"/>
+ <path d="M6 13.5V18.5H7.2C8.6 18.5 9.5 17.5 9.5 16C9.5 14.5 8.6 13.5 7.2 13.5H6ZM11.4 13.5V18.5M15.5 14C15.1 13.7 14.6 13.5 14.1 13.5C13.4 13.5 12.9 13.9 12.9 14.5C12.9 15.8 15.7 15.4 15.7 16.9C15.7 17.5 15.1 18.5 14.1 18.5C13.6 18.5 13.1 18.3 12.7 18" stroke="#ffe096" stroke-width="1.4" stroke-linecap="round" stroke-linejoin="round"/>
+ <circle cx="22" cy="16" r="4" fill="#ffe096"/>
</svg>
""".trimIndent()
}
diff --git a/apps/mobile-app/android/app/src/main/java/net/aliasvault/app/vaultstore/repositories/ItemRepository.kt b/apps/mobile-app/android/app/src/main/java/net/aliasvault/app/vaultstore/repositories/ItemRepository.kt
index 22b4622c9..1e7f5d5b3 100644
--- a/apps/mobile-app/android/app/src/main/java/net/aliasvault/app/vaultstore/repositories/ItemRepository.kt
+++ b/apps/mobile-app/android/app/src/main/java/net/aliasvault/app/vaultstore/repositories/ItemRepository.kt
@@ -3,7 +3,7 @@ package net.aliasvault.app.vaultstore.repositories
import android.util.Log
import net.aliasvault.app.utils.DateHelpers
import net.aliasvault.app.vaultstore.VaultDatabase
-import net.aliasvault.app.vaultstore.models.AppIcons
+import net.aliasvault.app.vaultstore.models.BuiltinLogos
import net.aliasvault.app.vaultstore.models.FieldKey
import net.aliasvault.app.vaultstore.models.FieldType
import net.aliasvault.app.vaultstore.models.Item
@@ -42,7 +42,7 @@ class ItemRepository(database: VaultDatabase) : BaseRepository(database) {
*/
private fun resolveLogo(row: Map<String, Any?>): ByteArray? {
if (row["LogoKind"] as? String == LOGO_KIND_BUILTIN) {
- return (row["LogoSource"] as? String)?.let { AppIcons.svgFor(it) }?.toByteArray(Charsets.UTF_8)
+ return (row["LogoSource"] as? String)?.let { BuiltinLogos.svgFor(it) }?.toByteArray(Charsets.UTF_8)
}
return row["Logo"] as? ByteArray
}
diff --git a/apps/mobile-app/components/folders/FolderIcon.tsx b/apps/mobile-app/components/folders/FolderIcon.tsx
index f999eb4c9..8a4d8b76c 100644
--- a/apps/mobile-app/components/folders/FolderIcon.tsx
+++ b/apps/mobile-app/components/folders/FolderIcon.tsx
@@ -1,7 +1,7 @@
import React from 'react';
import { StyleSheet, View } from 'react-native';
-import Svg, { Path } from 'react-native-svg';
+import { UiIcon } from '@/components/ui/UiIcon';
import { useColors } from '@/hooks/useColorScheme';
import type { StyleProp, ViewStyle } from 'react-native';
@@ -13,9 +13,6 @@ type FolderIconProps = {
style?: StyleProp<ViewStyle>;
};
-const FOLDER_PATH = 'M10 4H4a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-8l-2-2z';
-const PEOPLE_PATH = 'M4.5 6.375a4.125 4.125 0 118.25 0 4.125 4.125 0 01-8.25 0zM14.25 8.625a3.375 3.375 0 116.75 0 3.375 3.375 0 01-6.75 0zM1.5 19.125a7.125 7.125 0 0114.25 0v.003l-.001.119a.75.75 0 01-.363.63 13.067 13.067 0 01-6.761 1.873c-2.472 0-4.786-.684-6.76-1.873a.75.75 0 01-.364-.63l-.001-.122zM17.25 19.128l-.001.144a2.25 2.25 0 01-.233.96 10.088 10.088 0 005.06-1.01.75.75 0 00.42-.643 4.875 4.875 0 00-6.957-4.611 8.586 8.586 0 011.71 5.157v.003z';
-
/**
* Folder glyph, optionally carrying a small people badge that marks the folder as shared with other people.
* Same drawing as the browser extension's FolderIcon, with the badge scaled to the glyph.
@@ -27,9 +24,7 @@ export const FolderIcon: React.FC<FolderIconProps> = ({ isShared = false, size,
return (
<View style={[{ width: size, height: size }, style]}>
- <Svg width={size} height={size} viewBox="0 0 24 24" fill={color}>
- <Path d={FOLDER_PATH} />
- </Svg>
+ <UiIcon name="folder-filled" size={size} color={color} />
{isShared && (
<View
style={[styles.badge, {
@@ -42,9 +37,7 @@ export const FolderIcon: React.FC<FolderIconProps> = ({ isShared = false, size,
width: badgeSize,
}]}
>
- <Svg width={badgeSize * 0.75} height={badgeSize * 0.75} viewBox="0 0 24 24" fill={colors.primary}>
- <Path d={PEOPLE_PATH} />
- </Svg>
+ <UiIcon name="users" size={badgeSize * 0.75} color={colors.primary} />
</View>
)}
</View>
diff --git a/apps/mobile-app/components/items/AppIconComponents.tsx b/apps/mobile-app/components/items/BuiltinLogoComponents.tsx
similarity index 66%
rename from apps/mobile-app/components/items/AppIconComponents.tsx
rename to apps/mobile-app/components/items/BuiltinLogoComponents.tsx
index f876508e9..8595c340b 100644
--- a/apps/mobile-app/components/items/AppIconComponents.tsx
+++ b/apps/mobile-app/components/items/BuiltinLogoComponents.tsx
@@ -1,15 +1,16 @@
// <auto-generated />
-// This file is auto-generated from core/models/src/icons/AppIcons.ts
-// Do not edit this file directly. Run 'npm run generate:models' to regenerate.
+// This file is auto-generated from core/models/src/icons/svg by core/models/scripts/generate-icons.cjs.
+// Do not edit this file directly. Run 'node core/models/scripts/generate-icons.cjs' to regenerate.
import React from 'react';
-import Svg, { Circle, Path, Rect, Text as SvgText } from 'react-native-svg';
+import Svg, { Circle, Path, Rect } from 'react-native-svg';
export const ShoppingIcon = ({ width = 32, height = 32 }: { width?: number; height?: number }): React.ReactElement => (
<Svg width={width} height={height} viewBox="0 0 32 32" fill="none">
- <Path d="M4 5H7L9.5 19H24L27 9H10" stroke="#f49541" strokeWidth="2.5" strokeLinecap="round" strokeLinejoin="round" />
- <Circle cx="11" cy="25" r="2.5" fill="#d68338" />
- <Circle cx="22" cy="25" r="2.5" fill="#d68338" />
+ <Path d="M11 12.5V9C11 6.24 13.24 4 16 4C18.76 4 21 6.24 21 9V12.5" stroke="#d68338" strokeWidth="2.5" strokeLinecap="round" />
+ <Path d="M6.3 10H25.7L27.2 26.2C27.31 27.37 26.39 28.4 25.21 28.4H6.79C5.61 28.4 4.69 27.37 4.8 26.2L6.3 10Z" fill="#f49541" />
+ <Circle cx="11" cy="14" r="1.5" fill="#ffe096" />
+ <Circle cx="21" cy="14" r="1.5" fill="#ffe096" />
</Svg>
);
@@ -32,10 +33,10 @@ export const MailIcon = ({ width = 32, height = 32 }: { width?: number; height?:
export const SocialIcon = ({ width = 32, height = 32 }: { width?: number; height?: number }): React.ReactElement => (
<Svg width={width} height={height} viewBox="0 0 32 32" fill="none">
+ <Circle cx="22" cy="11" r="4" fill="#d68338" />
+ <Path d="M18 27C18 21.5 20.5 18.5 23.5 18.5C26.5 18.5 29.5 21 29.5 27H18Z" fill="#d68338" />
<Circle cx="12" cy="11" r="5" fill="#f49541" />
- <Path d="M3 27C3 21.5 7 18 12 18C17 18 21 21.5 21 27H3Z" fill="#f49541" />
- <Circle cx="23" cy="12" r="4" fill="#d68338" />
- <Path d="M20 27C20 22 23 19.5 26 19.5C28.5 19.5 30 22 30 27H20Z" fill="#d68338" />
+ <Path d="M2.5 27C2.5 21.5 6.5 18 12 18C17.5 18 21.5 21.5 21.5 27H2.5Z" fill="#f49541" />
</Svg>
);
@@ -50,11 +51,11 @@ export const WorkIcon = ({ width = 32, height = 32 }: { width?: number; height?:
export const GameIcon = ({ width = 32, height = 32 }: { width?: number; height?: number }): React.ReactElement => (
<Svg width={width} height={height} viewBox="0 0 32 32" fill="none">
- <Rect x="2" y="9" width="28" height="15" rx="7.5" fill="#f49541" />
- <Rect x="7" y="14" width="6" height="2" rx="1" fill="#ffe096" />
- <Rect x="9" y="12" width="2" height="6" rx="1" fill="#ffe096" />
- <Circle cx="21" cy="14.5" r="1.8" fill="#d68338" />
- <Circle cx="24.5" cy="18" r="1.8" fill="#d68338" />
+ <Rect x="2" y="7" width="28" height="18" rx="9" fill="#f49541" />
+ <Rect x="7" y="15" width="7" height="2.2" rx="1.1" fill="#ffe096" />
+ <Rect x="9.4" y="12.6" width="2.2" height="7" rx="1.1" fill="#ffe096" />
+ <Circle cx="21" cy="14" r="1.9" fill="#ffe096" />
+ <Circle cx="24.5" cy="18" r="1.9" fill="#ffe096" />
</Svg>
);
@@ -67,7 +68,9 @@ export const MediaIcon = ({ width = 32, height = 32 }: { width?: number; height?
export const TravelIcon = ({ width = 32, height = 32 }: { width?: number; height?: number }): React.ReactElement => (
<Svg width={width} height={height} viewBox="0 0 32 32" fill="none">
- <Path d="M15 3C16.1 3 17 3.9 17 5V12.5L29 19V22L17 18.5V24L20 26.5V29L15 27.5L10 29V26.5L13 24V18.5L1 22V19L13 12.5V5C13 3.9 13.9 3 15 3Z" fill="#f49541" />
+ <Path d="M14 12.4L2 19V22L14 18.5V12.4ZM18 12.4L30 19V22L18 18.5V12.4Z" fill="#d68338" />
+ <Path d="M14 23.5L11 26V28.5L16 27L21 28.5V26L18 23.5H14Z" fill="#d68338" />
+ <Path d="M16 3C17.1 3 18 3.9 18 5V24C18 25.5 17.1 27 16 27C14.9 27 14 25.5 14 24V5C14 3.9 14.9 3 16 3Z" fill="#f49541" />
</Svg>
);
@@ -85,20 +88,21 @@ export const DevIcon = ({ width = 32, height = 32 }: { width?: number; height?:
<Path d="M20 12L24 16.5L20 21" stroke="#ffe096" strokeWidth="2.5" strokeLinecap="round" strokeLinejoin="round" />
</Svg>
);
+
/**
* Map of icon key to React Native SVG component.
*/
-export const appIconComponents = {
- Shopping: ShoppingIcon,
- Bank: BankIcon,
- Mail: MailIcon,
- Social: SocialIcon,
- Work: WorkIcon,
- Game: GameIcon,
- Media: MediaIcon,
- Travel: TravelIcon,
- Health: HealthIcon,
- Dev: DevIcon,
+export const builtinLogoComponents = {
+ 'shopping': ShoppingIcon,
+ 'bank': BankIcon,
+ 'mail': MailIcon,
+ 'social': SocialIcon,
+ 'work': WorkIcon,
+ 'game': GameIcon,
+ 'media': MediaIcon,
+ 'travel': TravelIcon,
+ 'health': HealthIcon,
+ 'dev': DevIcon,
};
-export type AppIconKey = keyof typeof appIconComponents;
+export type BuiltinLogoComponentKey = keyof typeof builtinLogoComponents;
diff --git a/apps/mobile-app/components/items/ItemIcon.tsx b/apps/mobile-app/components/items/ItemIcon.tsx
index c5b30da30..7f1a5d45d 100644
--- a/apps/mobile-app/components/items/ItemIcon.tsx
+++ b/apps/mobile-app/components/items/ItemIcon.tsx
@@ -12,13 +12,13 @@ import {
import type { DisplayItem } from '@/utils/DisplayItem';
-// Import centralized icon components (auto-generated from core/models/src/icons/AppIcons.ts and ItemTypeIcons.ts)
-import { appIconComponents, type AppIconKey } from './AppIconComponents';
+// Import centralized icon components (auto-generated from core/models/src/icons)
+import { builtinLogoComponents, type BuiltinLogoComponentKey } from './BuiltinLogoComponents';
import {
- iconComponents,
+ itemTypeIconComponents,
PlaceholderIcon,
NoteIcon,
- type IconKey,
+ type ItemTypeIconComponentKey,
} from './ItemTypeIconComponents';
/**
@@ -42,32 +42,32 @@ type ItemIconProps = {
/**
* Detect credit card brand from card number using BIN prefixes.
*/
-const detectCardBrand = (cardNumber: string | undefined): IconKey => {
- if (!cardNumber) return 'CreditCard';
+const detectCardBrand = (cardNumber: string | undefined): ItemTypeIconComponentKey => {
+ if (!cardNumber) return 'credit-card';
const cleaned = cardNumber.replace(/[\s-]/g, '');
- if (!/^\d{4,}/.test(cleaned)) return 'CreditCard';
+ if (!/^\d{4,}/.test(cleaned)) return 'credit-card';
- if (/^4/.test(cleaned)) return 'Visa';
- if (/^5[1-5]/.test(cleaned) || /^2[2-7]/.test(cleaned)) return 'Mastercard';
- if (/^3[47]/.test(cleaned)) return 'Amex';
- if (/^6(?:011|22|4[4-9]|5)/.test(cleaned)) return 'Discover';
+ if (/^4/.test(cleaned)) return 'visa';
+ if (/^5[1-5]/.test(cleaned) || /^2[2-7]/.test(cleaned)) return 'mastercard';
+ if (/^3[47]/.test(cleaned)) return 'amex';
+ if (/^6(?:011|22|4[4-9]|5)/.test(cleaned)) return 'discover';
- return 'CreditCard';
+ return 'credit-card';
};
/**
* The component for a built-in icon key, or null when the key is unknown to this client (a newer version may have added it).
*/
-export const getAppIconComponent = (key: string): typeof appIconComponents[AppIconKey] | null => {
- return Object.prototype.hasOwnProperty.call(appIconComponents, key) ? appIconComponents[key as AppIconKey] : null;
+export const getBuiltinLogoComponent = (key: string): typeof builtinLogoComponents[BuiltinLogoComponentKey] | null => {
+ return Object.prototype.hasOwnProperty.call(builtinLogoComponents, key) ? builtinLogoComponents[key as BuiltinLogoComponentKey] : null;
};
/**
* Get the appropriate icon component for a card number.
*/
const getCardIconComponent = (cardNumber: string | undefined) => {
- return iconComponents[detectCardBrand(cardNumber)];
+ return itemTypeIconComponents[detectCardBrand(cardNumber)];
};
/**
@@ -79,7 +79,7 @@ export function ItemIcon({ item, style }: ItemIconProps) : React.ReactNode {
// A built-in icon carries no bytes: every platform draws it from the shared catalog.
if (item.LogoInfo?.Kind === LogoKinds.Builtin) {
- const BuiltinIcon = getAppIconComponent(item.LogoInfo.Source);
+ const BuiltinIcon = getBuiltinLogoComponent(item.LogoInfo.Source);
if (BuiltinIcon) {
return (
<View style={[styles.iconContainer, style]}>
diff --git a/apps/mobile-app/components/items/ItemTypeIconComponents.tsx b/apps/mobile-app/components/items/ItemTypeIconComponents.tsx
index f0c6a50dc..bc11b34b4 100644
--- a/apps/mobile-app/components/items/ItemTypeIconComponents.tsx
+++ b/apps/mobile-app/components/items/ItemTypeIconComponents.tsx
@@ -1,9 +1,9 @@
// <auto-generated />
-// This file is auto-generated from core/models/src/icons/ItemTypeIcons.ts
-// Do not edit this file directly. Run 'npm run generate:models' to regenerate.
+// This file is auto-generated from core/models/src/icons/svg by core/models/scripts/generate-icons.cjs.
+// Do not edit this file directly. Run 'node core/models/scripts/generate-icons.cjs' to regenerate.
import React from 'react';
-import Svg, { Circle, Path, Rect, Text as SvgText } from 'react-native-svg';
+import Svg, { Circle, Path, Rect } from 'react-native-svg';
export const PlaceholderIcon = ({ width = 32, height = 32 }: { width?: number; height?: number }): React.ReactElement => (
<Svg width={width} height={height} viewBox="0 0 32 32" fill="none">
@@ -37,46 +37,45 @@ export const CreditCardIcon = ({ width = 32, height = 32 }: { width?: number; he
export const VisaIcon = ({ width = 32, height = 32 }: { width?: number; height?: number }): React.ReactElement => (
<Svg width={width} height={height} viewBox="0 0 32 32" fill="none">
<Rect x="2" y="6" width="28" height="20" rx="3" fill="#f49541" />
- <Path d="M13.5 13L11.5 19H10L8.5 14.5C8.5 14.5 8.35 14 8 14C7.65 14 7 13.8 7 13.8L7.05 13.5H9.5C9.85 13.5 10.15 13.75 10.2 14.1L10.8 17L12.5 13.5H13.5V13ZM15 19H14L15 13H16L15 19ZM20 13.5C20 13.5 19.4 13.3 18.7 13.3C17.35 13.3 16.4 14 16.4 15C16.4 15.8 17.1 16.2 17.65 16.5C18.2 16.8 18.4 17 18.4 17.2C18.4 17.5 18.05 17.7 17.6 17.7C17 17.7 16.5 17.5 16.5 17.5L16.3 18.7C16.3 18.7 16.9 19 17.7 19C19.2 19 20.1 18.2 20.1 17.1C20.1 15.7 18.4 15.6 18.4 15C18.4 14.7 18.7 14.5 19.15 14.5C19.6 14.5 20.1 14.7 20.1 14.7L20.3 13.5H20V13.5ZM24 19L23.1 13.5H22C21.7 13.5 21.45 13.7 21.35 13.95L19 19H20.5L20.8 18H22.7L22.9 19H24ZM21.2 17L22 14.5L22.45 17H21.2Z" fill="#ffe096" />
+ <Path d="M7 13L9 19L11 13M13.2 13V19M18.6 13.7C18.1 13.2 17.4 13 16.7 13C15.7 13 15 13.6 15 14.4C15 16.2 18.8 15.8 18.8 17.6C18.8 18.4 18 19 17 19C16.2 19 15.4 18.7 14.9 18.2M20.5 19L22.75 13L25 19M21.3 17H24.2" stroke="#ffe096" strokeWidth="1.6" strokeLinecap="round" strokeLinejoin="round" />
</Svg>
);
export const MastercardIcon = ({ width = 32, height = 32 }: { width?: number; height?: number }): React.ReactElement => (
<Svg width={width} height={height} viewBox="0 0 32 32" fill="none">
<Rect x="2" y="6" width="28" height="20" rx="3" fill="#f49541" />
- <Circle cx="13" cy="16" r="5" fill="#d68338" />
- <Circle cx="19" cy="16" r="5" fill="#ffe096" />
- <Path d="M16 12.5C17.1 13.4 17.8 14.6 17.8 16C17.8 17.4 17.1 18.6 16 19.5C14.9 18.6 14.2 17.4 14.2 16C14.2 14.6 14.9 13.4 16 12.5Z" fill="#fbcb74" />
+ <Path d="M16 11.75C17.35 12.76 18.2 14.28 18.2 16C18.2 17.72 17.35 19.24 16 20.25C14.65 19.24 13.8 17.72 13.8 16C13.8 14.28 14.65 12.76 16 11.75Z" fill="#fbcb74" />
+ <Circle cx="12.5" cy="16" r="5" stroke="#ffe096" strokeWidth="1.6" />
+ <Circle cx="19.5" cy="16" r="5" stroke="#ffe096" strokeWidth="1.6" />
</Svg>
);
export const AmexIcon = ({ width = 32, height = 32 }: { width?: number; height?: number }): React.ReactElement => (
<Svg width={width} height={height} viewBox="0 0 32 32" fill="none">
<Rect x="2" y="6" width="28" height="20" rx="3" fill="#f49541" />
- <SvgText x="16" y="18" textAnchor="middle" fill="#ffe096" fontSize="8" fontWeight="bold" fontFamily="Arial, sans-serif">AMEX</SvgText>
+ <Path d="M7 19L8.8 13L10.6 19M7.6 17H10M12 19V13L13.8 16.5L15.6 13V19M20.4 13H17.4V19H20.4M17.4 16H19.8M22 13L25.2 19M25.2 13L22 19" stroke="#ffe096" strokeWidth="1.5" strokeLinecap="round" strokeLinejoin="round" />
</Svg>
);
export const DiscoverIcon = ({ width = 32, height = 32 }: { width?: number; height?: number }): React.ReactElement => (
<Svg width={width} height={height} viewBox="0 0 32 32" fill="none">
<Rect x="2" y="6" width="28" height="20" rx="3" fill="#f49541" />
- <Circle cx="20" cy="16" r="4" fill="#ffe096" />
- <Path d="M7 14H8.5C9.3 14 10 14.7 10 15.5C10 16.3 9.3 17 8.5 17H7V14Z" fill="#ffe096" />
- <Rect x="11" y="14" width="1.5" height="3" fill="#ffe096" />
- <Path d="M14 15C14 14.4 14.4 14 15 14C15.3 14 15.5 14.1 15.7 14.3L16.5 13.5C16.1 13.2 15.6 13 15 13C13.9 13 13 13.9 13 15C13 16.1 13.9 17 15 17C15.6 17 16.1 16.8 16.5 16.5L15.7 15.7C15.5 15.9 15.3 16 15 16C14.4 16 14 15.6 14 15Z" fill="#ffe096" />
+ <Path d="M6 13.5V18.5H7.2C8.6 18.5 9.5 17.5 9.5 16C9.5 14.5 8.6 13.5 7.2 13.5H6ZM11.4 13.5V18.5M15.5 14C15.1 13.7 14.6 13.5 14.1 13.5C13.4 13.5 12.9 13.9 12.9 14.5C12.9 15.8 15.7 15.4 15.7 16.9C15.7 17.5 15.1 18.5 14.1 18.5C13.6 18.5 13.1 18.3 12.7 18" stroke="#ffe096" strokeWidth="1.4" strokeLinecap="round" strokeLinejoin="round" />
+ <Circle cx="22" cy="16" r="4" fill="#ffe096" />
</Svg>
);
+
/**
* Map of icon key to React Native SVG component.
*/
-export const iconComponents = {
- Placeholder: PlaceholderIcon,
- Note: NoteIcon,
- CreditCard: CreditCardIcon,
- Visa: VisaIcon,
- Mastercard: MastercardIcon,
- Amex: AmexIcon,
- Discover: DiscoverIcon,
+export const itemTypeIconComponents = {
+ 'placeholder': PlaceholderIcon,
+ 'note': NoteIcon,
+ 'credit-card': CreditCardIcon,
+ 'visa': VisaIcon,
+ 'mastercard': MastercardIcon,
+ 'amex': AmexIcon,
+ 'discover': DiscoverIcon,
};
-export type IconKey = keyof typeof iconComponents;
+export type ItemTypeIconComponentKey = keyof typeof itemTypeIconComponents;
diff --git a/apps/mobile-app/components/items/LogoPickerModal.tsx b/apps/mobile-app/components/items/LogoPickerModal.tsx
index 5ed4f3188..5aa4a7c5b 100644
--- a/apps/mobile-app/components/items/LogoPickerModal.tsx
+++ b/apps/mobile-app/components/items/LogoPickerModal.tsx
@@ -1,5 +1,5 @@
import { logoSourceTranslationKey } from '@aliasvault/client/items/ItemLogoView';
-import { getAllAppIconKeys } from '@aliasvault/models/icons';
+import { getAllBuiltinLogoKeys } from '@aliasvault/models/icons';
import { LogoKinds } from '@aliasvault/models/vault';
import MaterialIcons from '@expo/vector-icons/MaterialIcons';
import React, { useCallback } from 'react';
@@ -12,7 +12,7 @@ import { HapticsUtility } from '@/utils/HapticsUtility';
import { useColors } from '@/hooks/useColorScheme';
import { ModalWrapper } from '@/components/common/ModalWrapper';
-import { appIconComponents } from '@/components/items/AppIconComponents';
+import { builtinLogoComponents } from '@/components/items/BuiltinLogoComponents';
import { ItemIcon } from '@/components/items/ItemIcon';
import type { ItemLogo, LogoSelection } from '@aliasvault/models/vault';
@@ -189,8 +189,8 @@ export const LogoPickerModal: React.FC<LogoPickerModalProps> = ({ isOpen, onClos
<Text style={styles.sectionLabel}>{t('items.logo.builtinLogos')}</Text>
<View style={styles.grid}>
- {getAllAppIconKeys().map(key => {
- const Icon = appIconComponents[key];
+ {getAllBuiltinLogoKeys().map(key => {
+ const Icon = builtinLogoComponents[key];
return (
<View key={key} style={styles.cell}>
<TouchableOpacity
diff --git a/apps/mobile-app/components/ui/UiIcon.tsx b/apps/mobile-app/components/ui/UiIcon.tsx
new file mode 100644
index 000000000..77d1ec17f
--- /dev/null
+++ b/apps/mobile-app/components/ui/UiIcon.tsx
@@ -0,0 +1,36 @@
+import React from 'react';
+import Svg, { Circle, Ellipse, Line, Path, Polygon, Polyline, Rect } from 'react-native-svg';
+
+import { UiIcons, type UiIconName, type UiIconTag } from '@aliasvault/models/icons';
+
+type UiIconProps = {
+ name: UiIconName;
+ size: number;
+ /** The color for currentColor in the icon. */
+ color: string;
+ strokeWidth?: number;
+};
+
+const SHAPES: Record<UiIconTag, React.ElementType> = {
+ path: Path,
+ circle: Circle,
+ rect: Rect,
+ line: Line,
+ polyline: Polyline,
+ polygon: Polygon,
+ ellipse: Ellipse,
+};
+
+/**
+ * A UI icon from the shared catalog in core/models/src/icons, drawn with react-native-svg.
+ */
+export const UiIcon: React.FC<UiIconProps> = ({ name, size, color, strokeWidth }) => {
+ const icon = UiIcons[name];
+ return (
+ <Svg width={size} height={size} viewBox={icon.viewBox} color={color} {...icon.attrs} {...(strokeWidth === undefined ? {} : { strokeWidth })}>
+ {icon.nodes.map(([tag, attrs], index) => React.createElement(SHAPES[tag], { key: String(index), ...attrs }))}
+ </Svg>
+ );
+};
+
+export default UiIcon;
diff --git a/apps/mobile-app/ios/VaultModels/AppIcons.swift b/apps/mobile-app/ios/VaultModels/BuiltinLogos.swift
similarity index 57%
rename from apps/mobile-app/ios/VaultModels/AppIcons.swift
rename to apps/mobile-app/ios/VaultModels/BuiltinLogos.swift
index d8c913e9b..8baca41f0 100644
--- a/apps/mobile-app/ios/VaultModels/AppIcons.swift
+++ b/apps/mobile-app/ios/VaultModels/BuiltinLogos.swift
@@ -1,23 +1,24 @@
// <auto-generated />
-// This file is auto-generated from core/models/src/icons/AppIcons.ts
-// Do not edit this file directly. Run 'npm run generate:models' to regenerate.
+// This file is auto-generated from core/models/src/icons/svg by core/models/scripts/generate-icons.cjs.
+// Do not edit this file directly. Run 'node core/models/scripts/generate-icons.cjs' to regenerate.
// swiftlint:disable line_length
import Foundation
-/// The catalog of built-in icons a user can pick for an item, keyed by the Source a builtin logo row stores.
-/// Single source of truth for all built-in icons across platforms.
-public struct AppIcons {
- /// Shopping icon SVG.
+/// The built-in logos a user can pick for an item, keyed by the Source a builtin logo row stores.
+/// Single source of truth for all built-in logos across platforms.
+public struct BuiltinLogos {
+ /// shopping icon SVG.
public static let shopping = """
<svg viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg">
- <path d="M4 5H7L9.5 19H24L27 9H10" stroke="#f49541" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round"/>
- <circle cx="11" cy="25" r="2.5" fill="#d68338"/>
- <circle cx="22" cy="25" r="2.5" fill="#d68338"/>
+ <path d="M11 12.5V9C11 6.24 13.24 4 16 4C18.76 4 21 6.24 21 9V12.5" stroke="#d68338" stroke-width="2.5" stroke-linecap="round"/>
+ <path d="M6.3 10H25.7L27.2 26.2C27.31 27.37 26.39 28.4 25.21 28.4H6.79C5.61 28.4 4.69 27.37 4.8 26.2L6.3 10Z" fill="#f49541"/>
+ <circle cx="11" cy="14" r="1.5" fill="#ffe096"/>
+ <circle cx="21" cy="14" r="1.5" fill="#ffe096"/>
</svg>
"""
- /// Bank icon SVG.
+ /// bank icon SVG.
public static let bank = """
<svg viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M16 4L29 11H3L16 4Z" fill="#f49541"/>
@@ -28,7 +29,7 @@ public struct AppIcons {
</svg>
"""
- /// Mail icon SVG.
+ /// mail icon SVG.
public static let mail = """
<svg viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg">
<rect x="3" y="7" width="26" height="18" rx="3" fill="#f49541"/>
@@ -36,17 +37,17 @@ public struct AppIcons {
</svg>
"""
- /// Social icon SVG.
+ /// social icon SVG.
public static let social = """
<svg viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg">
+ <circle cx="22" cy="11" r="4" fill="#d68338"/>
+ <path d="M18 27C18 21.5 20.5 18.5 23.5 18.5C26.5 18.5 29.5 21 29.5 27H18Z" fill="#d68338"/>
<circle cx="12" cy="11" r="5" fill="#f49541"/>
- <path d="M3 27C3 21.5 7 18 12 18C17 18 21 21.5 21 27H3Z" fill="#f49541"/>
- <circle cx="23" cy="12" r="4" fill="#d68338"/>
- <path d="M20 27C20 22 23 19.5 26 19.5C28.5 19.5 30 22 30 27H20Z" fill="#d68338"/>
+ <path d="M2.5 27C2.5 21.5 6.5 18 12 18C17.5 18 21.5 21.5 21.5 27H2.5Z" fill="#f49541"/>
</svg>
"""
- /// Work icon SVG.
+ /// work icon SVG.
public static let work = """
<svg viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M12 8V6C12 5 12.9 4 14 4H18C19.1 4 20 5 20 6V8" stroke="#d68338" stroke-width="2.5" stroke-linecap="round"/>
@@ -56,18 +57,18 @@ public struct AppIcons {
</svg>
"""
- /// Game icon SVG.
+ /// game icon SVG.
public static let game = """
<svg viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg">
- <rect x="2" y="9" width="28" height="15" rx="7.5" fill="#f49541"/>
- <rect x="7" y="14" width="6" height="2" rx="1" fill="#ffe096"/>
- <rect x="9" y="12" width="2" height="6" rx="1" fill="#ffe096"/>
- <circle cx="21" cy="14.5" r="1.8" fill="#d68338"/>
- <circle cx="24.5" cy="18" r="1.8" fill="#d68338"/>
+ <rect x="2" y="7" width="28" height="18" rx="9" fill="#f49541"/>
+ <rect x="7" y="15" width="7" height="2.2" rx="1.1" fill="#ffe096"/>
+ <rect x="9.4" y="12.6" width="2.2" height="7" rx="1.1" fill="#ffe096"/>
+ <circle cx="21" cy="14" r="1.9" fill="#ffe096"/>
+ <circle cx="24.5" cy="18" r="1.9" fill="#ffe096"/>
</svg>
"""
- /// Media icon SVG.
+ /// media icon SVG.
public static let media = """
<svg viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg">
<rect x="3" y="5" width="26" height="22" rx="4" fill="#f49541"/>
@@ -75,14 +76,16 @@ public struct AppIcons {
</svg>
"""
- /// Travel icon SVG.
+ /// travel icon SVG.
public static let travel = """
<svg viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg">
- <path d="M15 3C16.1 3 17 3.9 17 5V12.5L29 19V22L17 18.5V24L20 26.5V29L15 27.5L10 29V26.5L13 24V18.5L1 22V19L13 12.5V5C13 3.9 13.9 3 15 3Z" fill="#f49541"/>
+ <path d="M14 12.4L2 19V22L14 18.5V12.4ZM18 12.4L30 19V22L18 18.5V12.4Z" fill="#d68338"/>
+ <path d="M14 23.5L11 26V28.5L16 27L21 28.5V26L18 23.5H14Z" fill="#d68338"/>
+ <path d="M16 3C17.1 3 18 3.9 18 5V24C18 25.5 17.1 27 16 27C14.9 27 14 25.5 14 24V5C14 3.9 14.9 3 16 3Z" fill="#f49541"/>
</svg>
"""
- /// Health icon SVG.
+ /// health icon SVG.
public static let health = """
<svg viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M16 27C16 27 3 19.5 3 11.5C3 7.4 6.1 4.5 9.8 4.5C12.2 4.5 14.5 5.9 16 8C17.5 5.9 19.8 4.5 22.2 4.5C25.9 4.5 29 7.4 29 11.5C29 19.5 16 27 16 27Z" fill="#f49541"/>
@@ -90,7 +93,7 @@ public struct AppIcons {
</svg>
"""
- /// Dev icon SVG.
+ /// dev icon SVG.
public static let dev = """
<svg viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg">
<rect x="2" y="5" width="28" height="22" rx="4" fill="#f49541"/>
@@ -102,16 +105,16 @@ public struct AppIcons {
/// The SVG for an icon key, or nil when the key is unknown to this client.
public static func svg(for key: String) -> String? {
switch key {
- case "Shopping": return shopping
- case "Bank": return bank
- case "Mail": return mail
- case "Social": return social
- case "Work": return work
- case "Game": return game
- case "Media": return media
- case "Travel": return travel
- case "Health": return health
- case "Dev": return dev
+ case "shopping": return shopping
+ case "bank": return bank
+ case "mail": return mail
+ case "social": return social
+ case "work": return work
+ case "game": return game
+ case "media": return media
+ case "travel": return travel
+ case "health": return health
+ case "dev": return dev
default: return nil
}
}
diff --git a/apps/mobile-app/ios/VaultModels/ItemTypeIcons.swift b/apps/mobile-app/ios/VaultModels/ItemTypeIcons.swift
index 1c90720b5..583126bcb 100644
--- a/apps/mobile-app/ios/VaultModels/ItemTypeIcons.swift
+++ b/apps/mobile-app/ios/VaultModels/ItemTypeIcons.swift
@@ -1,6 +1,6 @@
// <auto-generated />
-// This file is auto-generated from core/models/src/icons/ItemTypeIcons.ts
-// Do not edit this file directly. Run 'npm run generate:models' to regenerate.
+// This file is auto-generated from core/models/src/icons/svg by core/models/scripts/generate-icons.cjs.
+// Do not edit this file directly. Run 'node core/models/scripts/generate-icons.cjs' to regenerate.
// swiftlint:disable line_length
import Foundation
@@ -8,7 +8,7 @@ import Foundation
/// Centralized SVG icon definitions for item types.
/// Single source of truth for all item type icons across platforms.
public struct ItemTypeIcons {
- /// Placeholder icon SVG.
+ /// placeholder icon SVG.
public static let placeholder = """
<svg viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg">
<circle cx="10" cy="10" r="6.5" fill="none" stroke="#f49541" stroke-width="2.5"/>
@@ -19,7 +19,7 @@ public struct ItemTypeIcons {
</svg>
"""
- /// Note icon SVG.
+ /// note icon SVG.
public static let note = """
<svg viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M8 4C6.9 4 6 4.9 6 6V26C6 27.1 6.9 28 8 28H24C25.1 28 26 27.1 26 26V11L19 4H8Z" fill="#f49541"/>
@@ -30,7 +30,7 @@ public struct ItemTypeIcons {
</svg>
"""
- /// CreditCard icon SVG.
+ /// credit-card icon SVG.
public static let creditCard = """
<svg viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg">
<rect x="2" y="6" width="28" height="20" rx="3" fill="#f49541"/>
@@ -40,40 +40,38 @@ public struct ItemTypeIcons {
</svg>
"""
- /// Visa icon SVG.
+ /// visa icon SVG.
public static let visa = """
<svg viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg">
<rect x="2" y="6" width="28" height="20" rx="3" fill="#f49541"/>
- <path d="M13.5 13L11.5 19H10L8.5 14.5C8.5 14.5 8.35 14 8 14C7.65 14 7 13.8 7 13.8L7.05 13.5H9.5C9.85 13.5 10.15 13.75 10.2 14.1L10.8 17L12.5 13.5H13.5V13ZM15 19H14L15 13H16L15 19ZM20 13.5C20 13.5 19.4 13.3 18.7 13.3C17.35 13.3 16.4 14 16.4 15C16.4 15.8 17.1 16.2 17.65 16.5C18.2 16.8 18.4 17 18.4 17.2C18.4 17.5 18.05 17.7 17.6 17.7C17 17.7 16.5 17.5 16.5 17.5L16.3 18.7C16.3 18.7 16.9 19 17.7 19C19.2 19 20.1 18.2 20.1 17.1C20.1 15.7 18.4 15.6 18.4 15C18.4 14.7 18.7 14.5 19.15 14.5C19.6 14.5 20.1 14.7 20.1 14.7L20.3 13.5H20V13.5ZM24 19L23.1 13.5H22C21.7 13.5 21.45 13.7 21.35 13.95L19 19H20.5L20.8 18H22.7L22.9 19H24ZM21.2 17L22 14.5L22.45 17H21.2Z" fill="#ffe096"/>
+ <path d="M7 13L9 19L11 13M13.2 13V19M18.6 13.7C18.1 13.2 17.4 13 16.7 13C15.7 13 15 13.6 15 14.4C15 16.2 18.8 15.8 18.8 17.6C18.8 18.4 18 19 17 19C16.2 19 15.4 18.7 14.9 18.2M20.5 19L22.75 13L25 19M21.3 17H24.2" stroke="#ffe096" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round"/>
</svg>
"""
- /// Mastercard icon SVG.
+ /// mastercard icon SVG.
public static let mastercard = """
<svg viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg">
<rect x="2" y="6" width="28" height="20" rx="3" fill="#f49541"/>
- <circle cx="13" cy="16" r="5" fill="#d68338"/>
- <circle cx="19" cy="16" r="5" fill="#ffe096"/>
- <path d="M16 12.5C17.1 13.4 17.8 14.6 17.8 16C17.8 17.4 17.1 18.6 16 19.5C14.9 18.6 14.2 17.4 14.2 16C14.2 14.6 14.9 13.4 16 12.5Z" fill="#fbcb74"/>
+ <path d="M16 11.75C17.35 12.76 18.2 14.28 18.2 16C18.2 17.72 17.35 19.24 16 20.25C14.65 19.24 13.8 17.72 13.8 16C13.8 14.28 14.65 12.76 16 11.75Z" fill="#fbcb74"/>
+ <circle cx="12.5" cy="16" r="5" stroke="#ffe096" stroke-width="1.6"/>
+ <circle cx="19.5" cy="16" r="5" stroke="#ffe096" stroke-width="1.6"/>
</svg>
"""
- /// Amex icon SVG.
+ /// amex icon SVG.
public static let amex = """
<svg viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg">
<rect x="2" y="6" width="28" height="20" rx="3" fill="#f49541"/>
- <text x="16" y="18" text-anchor="middle" fill="#ffe096" font-size="8" font-weight="bold" font-family="Arial, sans-serif">AMEX</text>
+ <path d="M7 19L8.8 13L10.6 19M7.6 17H10M12 19V13L13.8 16.5L15.6 13V19M20.4 13H17.4V19H20.4M17.4 16H19.8M22 13L25.2 19M25.2 13L22 19" stroke="#ffe096" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
</svg>
"""
- /// Discover icon SVG.
+ /// discover icon SVG.
public static let discover = """
<svg viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg">
<rect x="2" y="6" width="28" height="20" rx="3" fill="#f49541"/>
- <circle cx="20" cy="16" r="4" fill="#ffe096"/>
- <path d="M7 14H8.5C9.3 14 10 14.7 10 15.5C10 16.3 9.3 17 8.5 17H7V14Z" fill="#ffe096"/>
- <rect x="11" y="14" width="1.5" height="3" fill="#ffe096"/>
- <path d="M14 15C14 14.4 14.4 14 15 14C15.3 14 15.5 14.1 15.7 14.3L16.5 13.5C16.1 13.2 15.6 13 15 13C13.9 13 13 13.9 13 15C13 16.1 13.9 17 15 17C15.6 17 16.1 16.8 16.5 16.5L15.7 15.7C15.5 15.9 15.3 16 15 16C14.4 16 14 15.6 14 15Z" fill="#ffe096"/>
+ <path d="M6 13.5V18.5H7.2C8.6 18.5 9.5 17.5 9.5 16C9.5 14.5 8.6 13.5 7.2 13.5H6ZM11.4 13.5V18.5M15.5 14C15.1 13.7 14.6 13.5 14.1 13.5C13.4 13.5 12.9 13.9 12.9 14.5C12.9 15.8 15.7 15.4 15.7 16.9C15.7 17.5 15.1 18.5 14.1 18.5C13.6 18.5 13.1 18.3 12.7 18" stroke="#ffe096" stroke-width="1.4" stroke-linecap="round" stroke-linejoin="round"/>
+ <circle cx="22" cy="16" r="4" fill="#ffe096"/>
</svg>
"""
}
diff --git a/apps/mobile-app/ios/VaultStoreKit/Database/Mappers/ItemMapper.swift b/apps/mobile-app/ios/VaultStoreKit/Database/Mappers/ItemMapper.swift
index bfbcb8714..7c1099e3c 100644
--- a/apps/mobile-app/ios/VaultStoreKit/Database/Mappers/ItemMapper.swift
+++ b/apps/mobile-app/ios/VaultStoreKit/Database/Mappers/ItemMapper.swift
@@ -36,7 +36,7 @@ public struct ItemRow {
// A built-in logo carries no bytes: it is drawn from the shared catalog, keyed by its Source.
if row["LogoKind"] as? String == "builtin", let source = row["LogoSource"] as? String {
- self.logo = AppIcons.svg(for: source)?.data(using: .utf8)
+ self.logo = BuiltinLogos.svg(for: source)?.data(using: .utf8)
} else if let logoBase64 = row["Logo"] as? String {
// BLOB columns arrive as base64 text
self.logo = Data(base64Encoded: logoBase64, options: .ignoreUnknownCharacters)
diff --git a/apps/server/AliasVault.Admin/Main/Components/Alerts/MessageInfo.razor b/apps/server/AliasVault.Admin/Main/Components/Alerts/MessageInfo.razor
index e1d1c1a11..12c220824 100644
--- a/apps/server/AliasVault.Admin/Main/Components/Alerts/MessageInfo.razor
+++ b/apps/server/AliasVault.Admin/Main/Components/Alerts/MessageInfo.razor
@@ -5,9 +5,7 @@
<div class="bg-orange-100 border-l-4 border-orange-500 text-orange-700 p-4 mb-6" role="alert">
<div class="flex">
<div class="py-1">
- <svg class="fill-current h-6 w-6 text-orange-500 mr-4" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20">
- <path d="M2.93 17.07A10 10 0 1 1 17.07 2.93 10 10 0 0 1 2.93 17.07zm12.73-1.41A8 8 0 1 0 4.34 4.34a8 8 0 0 0 11.32 11.32zM9 11V9h2v6H9v-4zm0-6h2v2H9V5z"/>
- </svg>
+ <UiIcon Icon="UiIcons.InformationCircle" class="h-6 w-6 text-orange-500 mr-4" />
</div>
<div>
@if (!string.IsNullOrEmpty(Title))
diff --git a/apps/server/AliasVault.Admin/Main/Components/Buttons/DeleteButton.razor b/apps/server/AliasVault.Admin/Main/Components/Buttons/DeleteButton.razor
index 2f6fcbc5d..c27c26c5f 100644
--- a/apps/server/AliasVault.Admin/Main/Components/Buttons/DeleteButton.razor
+++ b/apps/server/AliasVault.Admin/Main/Components/Buttons/DeleteButton.razor
@@ -2,9 +2,7 @@
<Button OnClick="HandleClick"
Display="flex"
Color="danger">
- <svg class="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
- <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16"></path>
- </svg>
+ <UiIcon Icon="UiIcons.Trash" class="w-4 h-4" />
<span class="ml-2">@ButtonText</span>
</Button>
diff --git a/apps/server/AliasVault.Admin/Main/Components/Buttons/RefreshButton.razor b/apps/server/AliasVault.Admin/Main/Components/Buttons/RefreshButton.razor
index 09b4d72aa..9ec3bcb83 100644
--- a/apps/server/AliasVault.Admin/Main/Components/Buttons/RefreshButton.razor
+++ b/apps/server/AliasVault.Admin/Main/Components/Buttons/RefreshButton.razor
@@ -5,9 +5,7 @@
Display="flex"
Color="@Color"
AdditionalClasses="@AdditionalClasses">
- <svg class="@GetIconClasses()" fill="none" stroke="currentColor" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
- <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15"></path>
- </svg>
+ <UiIcon Icon="UiIcons.Refresh" class="@GetIconClasses()" />
<span class="ml-2">@ButtonText</span>
</Button>
diff --git a/apps/server/AliasVault.Admin/Main/Components/CopyField.razor b/apps/server/AliasVault.Admin/Main/Components/CopyField.razor
index 95448a73e..17ea554d0 100644
--- a/apps/server/AliasVault.Admin/Main/Components/CopyField.razor
+++ b/apps/server/AliasVault.Admin/Main/Components/CopyField.razor
@@ -7,16 +7,12 @@
<button type="button" @onclick="CopyAsync" class="inline-flex shrink-0 items-center gap-2 rounded-r-lg border border-primary-600 bg-primary-600 px-4 text-sm font-medium text-white hover:bg-primary-700 focus:outline-none focus:ring-2 focus:ring-primary-300 dark:hover:bg-primary-700 dark:focus:ring-primary-800">
@if (_copied)
{
- <svg class="h-4 w-4" fill="none" stroke="currentColor" stroke-width="2" viewBox="0 0 24 24" aria-hidden="true">
- <path stroke-linecap="round" stroke-linejoin="round" d="M5 13l4 4L19 7" />
- </svg>
+ <UiIcon Icon="UiIcons.Check" class="h-4 w-4" />
<span>Copied</span>
}
else
{
- <svg class="h-4 w-4" fill="none" stroke="currentColor" stroke-width="2" viewBox="0 0 24 24" aria-hidden="true">
- <path stroke-linecap="round" stroke-linejoin="round" d="M8 16H6a2 2 0 01-2-2V6a2 2 0 012-2h8a2 2 0 012 2v2m-6 12h8a2 2 0 002-2v-8a2 2 0 00-2-2h-8a2 2 0 00-2 2v8a2 2 0 002 2z" />
- </svg>
+ <UiIcon Icon="UiIcons.Duplicate" class="h-4 w-4" />
<span>Copy</span>
}
</button>
diff --git a/apps/server/AliasVault.Admin/Main/Components/Headings/Breadcrumb.razor b/apps/server/AliasVault.Admin/Main/Components/Headings/Breadcrumb.razor
index 62b65b415..648630153 100644
--- a/apps/server/AliasVault.Admin/Main/Components/Headings/Breadcrumb.razor
+++ b/apps/server/AliasVault.Admin/Main/Components/Headings/Breadcrumb.razor
@@ -11,12 +11,12 @@
<li class="inline-flex items-center">
@if (!isFirst)
{
- <svg class="w-6 h-6 text-gray-400 dark:text-gray-400" fill="currentColor" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" d="M7.293 14.707a1 1 0 010-1.414L10.586 10 7.293 6.707a1 1 0 011.414-1.414l4 4a1 1 0 010 1.414l-4 4a1 1 0 01-1.414 0z" clip-rule="evenodd"></path></svg>
+ <UiIcon Icon="UiIcons.ChevronRight" class="w-6 h-6 text-gray-400 dark:text-gray-400" />
}
<a href="@item.Url" class="inline-flex items-center text-gray-700 hover:text-primary-600 dark:text-gray-300 dark:hover:text-primary-500">
@if (isFirst && item.ShowHomeIcon)
{
- <svg class="w-5 h-5 mr-2.5" fill="currentColor" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M10.707 2.293a1 1 0 00-1.414 0l-7 7a1 1 0 001.414 1.414L4 10.414V17a1 1 0 001 1h2a1 1 0 001-1v-2a1 1 0 011-1h2a1 1 0 011 1v2a1 1 0 001 1h2a1 1 0 001-1v-6.586l.293.293a1 1 0 001.414-1.414l-7-7z"></path></svg>
+ <UiIcon Icon="UiIcons.Home" class="w-5 h-5 mr-2.5" />
}
@item.DisplayName
</a>
@@ -27,12 +27,12 @@
<li class="inline-flex items-center">
@if (!isFirst)
{
- <svg class="w-6 h-6 text-gray-400 dark:text-gray-400" fill="currentColor" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" d="M7.293 14.707a1 1 0 010-1.414L10.586 10 7.293 6.707a1 1 0 011.414-1.414l4 4a1 1 0 010 1.414l-4 4a1 1 0 01-1.414 0z" clip-rule="evenodd"></path></svg>
+ <UiIcon Icon="UiIcons.ChevronRight" class="w-6 h-6 text-gray-400 dark:text-gray-400" />
}
<span class="text-gray-400 dark:text-gray-400">
@if (isFirst && item.ShowHomeIcon)
{
- <svg class="w-5 h-5 mr-2.5 inline" fill="currentColor" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M10.707 2.293a1 1 0 00-1.414 0l-7 7a1 1 0 001.414 1.414L4 10.414V17a1 1 0 001 1h2a1 1 0 001-1v-2a1 1 0 011-1h2a1 1 0 011 1v2a1 1 0 001 1h2a1 1 0 001-1v-6.586l.293.293a1 1 0 001.414-1.414l-7-7z"></path></svg>
+ <UiIcon Icon="UiIcons.Home" class="w-5 h-5 mr-2.5 inline" />
}
@item.DisplayName
</span>
diff --git a/apps/server/AliasVault.Admin/Main/Components/Icons/SearchIcon.razor b/apps/server/AliasVault.Admin/Main/Components/Icons/SearchIcon.razor
index 0e27b6a0f..d9f9e5c0d 100644
--- a/apps/server/AliasVault.Admin/Main/Components/Icons/SearchIcon.razor
+++ b/apps/server/AliasVault.Admin/Main/Components/Icons/SearchIcon.razor
@@ -1,5 +1,3 @@
<div class="absolute inset-y-0 left-0 flex items-center pl-3 pointer-events-none">
- <svg class="w-5 h-5 text-gray-500 dark:text-gray-400" aria-hidden="true" fill="currentColor" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg">
- <path fill-rule="evenodd" d="M8 4a4 4 0 100 8 4 4 0 000-8zM2 8a6 6 0 1110.89 3.476l4.817 4.817a1 1 0 01-1.414 1.414l-4.816-4.816A6 6 0 012 8z" clip-rule="evenodd"></path>
- </svg>
+ <UiIcon Icon="UiIcons.Search" class="w-5 h-5 text-gray-500 dark:text-gray-400" />
</div>
diff --git a/apps/server/AliasVault.Admin/Main/Components/Icons/UiIcon.razor b/apps/server/AliasVault.Admin/Main/Components/Icons/UiIcon.razor
new file mode 100644
index 000000000..bd3f24107
--- /dev/null
+++ b/apps/server/AliasVault.Admin/Main/Components/Icons/UiIcon.razor
@@ -0,0 +1,36 @@
+<svg @attributes="Attributes">@((MarkupString)Icon.Body)</svg>
+
+@code {
+ /// <summary>
+ /// Gets or sets the icon to render, from <see cref="UiIcons"/>.
+ /// </summary>
+ [Parameter]
+ [EditorRequired]
+ public UiIconDefinition Icon { get; set; } = null!;
+
+ /// <summary>
+ /// Gets or sets the svg attributes (class, stroke-width, ...), which override the icon's own.
+ /// </summary>
+ [Parameter(CaptureUnmatchedValues = true)]
+ public Dictionary<string, object>? AdditionalAttributes { get; set; }
+
+ private Dictionary<string, object> Attributes
+ {
+ get
+ {
+ var attributes = new Dictionary<string, object>(Icon.Attributes)
+ {
+ ["xmlns"] = "http://www.w3.org/2000/svg",
+ ["viewBox"] = Icon.ViewBox,
+ ["aria-hidden"] = "true",
+ };
+
+ foreach (var (name, value) in AdditionalAttributes ?? [])
+ {
+ attributes[name] = value;
+ }
+
+ return attributes;
+ }
+ }
+}
diff --git a/apps/server/AliasVault.Admin/Main/Components/Icons/UiIcons.cs b/apps/server/AliasVault.Admin/Main/Components/Icons/UiIcons.cs
new file mode 100644
index 000000000..3acc099b4
--- /dev/null
+++ b/apps/server/AliasVault.Admin/Main/Components/Icons/UiIcons.cs
@@ -0,0 +1,261 @@
+// <auto-generated />
+// This file is auto-generated from core/models/src/icons/svg by core/models/scripts/generate-icons.cjs.
+// Do not edit this file directly. Run 'node core/models/scripts/generate-icons.cjs' to regenerate.
+
+namespace AliasVault.Admin.Main.Components.Icons;
+
+using System.Collections.Generic;
+
+/// <summary>
+/// A UI icon: its viewBox, root svg attributes and inner shape markup.
+/// </summary>
+/// <param name="ViewBox">The svg viewBox.</param>
+/// <param name="Attributes">The root svg attributes (fill, stroke and so on).</param>
+/// <param name="Body">The inner shape markup.</param>
+public sealed record UiIconDefinition(string ViewBox, IReadOnlyDictionary<string, object> Attributes, string Body);
+
+/// <summary>
+/// The UI icons shared by all apps.
+/// </summary>
+public static class UiIcons
+{
+ /// <summary>Gets the "archive" icon.</summary>
+ public static UiIconDefinition Archive { get; } = new("0 0 24 24", new Dictionary<string, object> { { "fill", "none" }, { "stroke", "currentColor" }, { "stroke-width", "2" }, { "stroke-linecap", "round" }, { "stroke-linejoin", "round" } }, @"<path d=""M5 8h14M5 8a2 2 0 110-4h14a2 2 0 110 4M5 8v10a2 2 0 002 2h10a2 2 0 002-2V8m-9 4h4""/>");
+
+ /// <summary>Gets the "arrow-circle-down" icon.</summary>
+ public static UiIconDefinition ArrowCircleDown { get; } = new("0 0 24 24", new Dictionary<string, object> { { "fill", "none" }, { "stroke", "currentColor" }, { "stroke-width", "2" }, { "stroke-linecap", "round" }, { "stroke-linejoin", "round" } }, @"<path d=""M15 13l-3 3m0 0l-3-3m3 3V8m0 13a9 9 0 110-18 9 9 0 010 18z""/>");
+
+ /// <summary>Gets the "arrow-left" icon.</summary>
+ public static UiIconDefinition ArrowLeft { get; } = new("0 0 24 24", new Dictionary<string, object> { { "fill", "none" }, { "stroke", "currentColor" }, { "stroke-width", "2" }, { "stroke-linecap", "round" }, { "stroke-linejoin", "round" } }, @"<path d=""M10 19l-7-7m0 0l7-7m-7 7h18""/>");
+
+ /// <summary>Gets the "arrow-narrow-down" icon.</summary>
+ public static UiIconDefinition ArrowNarrowDown { get; } = new("0 0 24 24", new Dictionary<string, object> { { "fill", "none" }, { "stroke", "currentColor" }, { "stroke-width", "2" }, { "stroke-linecap", "round" }, { "stroke-linejoin", "round" } }, @"<path d=""M16 17l-4 4m0 0l-4-4m4 4V3""/>");
+
+ /// <summary>Gets the "arrow-narrow-up" icon.</summary>
+ public static UiIconDefinition ArrowNarrowUp { get; } = new("0 0 24 24", new Dictionary<string, object> { { "fill", "none" }, { "stroke", "currentColor" }, { "stroke-width", "2" }, { "stroke-linecap", "round" }, { "stroke-linejoin", "round" } }, @"<path d=""M8 7l4-4m0 0l4 4m-4-4v18""/>");
+
+ /// <summary>Gets the "arrow-right" icon.</summary>
+ public static UiIconDefinition ArrowRight { get; } = new("0 0 24 24", new Dictionary<string, object> { { "fill", "none" }, { "stroke", "currentColor" }, { "stroke-width", "2" }, { "stroke-linecap", "round" }, { "stroke-linejoin", "round" } }, @"<path d=""M14 5l7 7m0 0l-7 7m7-7H3""/>");
+
+ /// <summary>Gets the "arrows-expand" icon.</summary>
+ public static UiIconDefinition ArrowsExpand { get; } = new("0 0 24 24", new Dictionary<string, object> { { "fill", "none" }, { "stroke", "currentColor" }, { "stroke-width", "2" }, { "stroke-linecap", "round" }, { "stroke-linejoin", "round" } }, @"<path d=""M4 8V4m0 0h4M4 4l5 5m11-1V4m0 0h-4m4 0l-5 5M4 16v4m0 0h4m-4 0l5-5m11 5l-5-5m5 5v-4m0 4h-4""/>");
+
+ /// <summary>Gets the "backspace" icon.</summary>
+ public static UiIconDefinition Backspace { get; } = new("0 0 24 24", new Dictionary<string, object> { { "fill", "none" }, { "stroke", "currentColor" }, { "stroke-width", "2" }, { "stroke-linecap", "round" }, { "stroke-linejoin", "round" } }, @"<path d=""M12 14l2-2m0 0l2-2m-2 2l-2-2m2 2l2 2M3 12l6.414 6.414a2 2 0 001.414.586H19a2 2 0 002-2V7a2 2 0 00-2-2h-8.172a2 2 0 00-1.414.586L3 12z""/>");
+
+ /// <summary>Gets the "chart-bar" icon.</summary>
+ public static UiIconDefinition ChartBar { get; } = new("0 0 24 24", new Dictionary<string, object> { { "fill", "none" }, { "stroke", "currentColor" }, { "stroke-width", "2" }, { "stroke-linecap", "round" }, { "stroke-linejoin", "round" } }, @"<path d=""M9 19v-6a2 2 0 00-2-2H5a2 2 0 00-2 2v6a2 2 0 002 2h2a2 2 0 002-2zm0 0V9a2 2 0 012-2h2a2 2 0 012 2v10m-6 0a2 2 0 002 2h2a2 2 0 002-2m0 0V5a2 2 0 012-2h2a2 2 0 012 2v14a2 2 0 01-2 2h-2a2 2 0 01-2-2z""/>");
+
+ /// <summary>Gets the "check" icon.</summary>
+ public static UiIconDefinition Check { get; } = new("0 0 24 24", new Dictionary<string, object> { { "fill", "none" }, { "stroke", "currentColor" }, { "stroke-width", "2" }, { "stroke-linecap", "round" }, { "stroke-linejoin", "round" } }, @"<path d=""M5 13l4 4L19 7""/>");
+
+ /// <summary>Gets the "check-circle" icon.</summary>
+ public static UiIconDefinition CheckCircle { get; } = new("0 0 24 24", new Dictionary<string, object> { { "fill", "none" }, { "stroke", "currentColor" }, { "stroke-width", "2" }, { "stroke-linecap", "round" }, { "stroke-linejoin", "round" } }, @"<path d=""M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z""/>");
+
+ /// <summary>Gets the "chevron-down" icon.</summary>
+ public static UiIconDefinition ChevronDown { get; } = new("0 0 24 24", new Dictionary<string, object> { { "fill", "none" }, { "stroke", "currentColor" }, { "stroke-width", "2" }, { "stroke-linecap", "round" }, { "stroke-linejoin", "round" } }, @"<path d=""M19 9l-7 7-7-7""/>");
+
+ /// <summary>Gets the "chevron-left" icon.</summary>
+ public static UiIconDefinition ChevronLeft { get; } = new("0 0 24 24", new Dictionary<string, object> { { "fill", "none" }, { "stroke", "currentColor" }, { "stroke-width", "2" }, { "stroke-linecap", "round" }, { "stroke-linejoin", "round" } }, @"<path d=""M15 19l-7-7 7-7""/>");
+
+ /// <summary>Gets the "chevron-right" icon.</summary>
+ public static UiIconDefinition ChevronRight { get; } = new("0 0 24 24", new Dictionary<string, object> { { "fill", "none" }, { "stroke", "currentColor" }, { "stroke-width", "2" }, { "stroke-linecap", "round" }, { "stroke-linejoin", "round" } }, @"<path d=""M9 5l7 7-7 7""/>");
+
+ /// <summary>Gets the "clipboard" icon.</summary>
+ public static UiIconDefinition Clipboard { get; } = new("0 0 24 24", new Dictionary<string, object> { { "fill", "none" }, { "stroke", "currentColor" }, { "stroke-width", "2" }, { "stroke-linecap", "round" }, { "stroke-linejoin", "round" } }, @"<path d=""M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2""/>");
+
+ /// <summary>Gets the "clipboard-list" icon.</summary>
+ public static UiIconDefinition ClipboardList { get; } = new("0 0 24 24", new Dictionary<string, object> { { "fill", "none" }, { "stroke", "currentColor" }, { "stroke-width", "2" }, { "stroke-linecap", "round" }, { "stroke-linejoin", "round" } }, @"<path d=""M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-3 7h3m-3 4h3m-6-4h.01M9 16h.01""/>");
+
+ /// <summary>Gets the "clock" icon.</summary>
+ public static UiIconDefinition Clock { get; } = new("0 0 24 24", new Dictionary<string, object> { { "fill", "none" }, { "stroke", "currentColor" }, { "stroke-width", "2" }, { "stroke-linecap", "round" }, { "stroke-linejoin", "round" } }, @"<path d=""M12 8v4l3 3m6-3a9 9 0 11-18 0 9 9 0 0118 0z""/>");
+
+ /// <summary>Gets the "cloud-upload" icon.</summary>
+ public static UiIconDefinition CloudUpload { get; } = new("0 0 24 24", new Dictionary<string, object> { { "fill", "none" }, { "stroke", "currentColor" }, { "stroke-width", "2" }, { "stroke-linecap", "round" }, { "stroke-linejoin", "round" } }, @"<path d=""M7 16a4 4 0 01-.88-7.903A5 5 0 1115.9 6L16 6a5 5 0 011 9.9M15 13l-3-3m0 0l-3 3m3-3v12""/>");
+
+ /// <summary>Gets the "cog" icon.</summary>
+ public static UiIconDefinition Cog { get; } = new("0 0 24 24", new Dictionary<string, object> { { "fill", "none" }, { "stroke", "currentColor" }, { "stroke-width", "2" }, { "stroke-linecap", "round" }, { "stroke-linejoin", "round" } }, @"<path d=""M10.325 4.317c.426-1.756 2.924-1.756 3.35 0a1.724 1.724 0 002.573 1.066c1.543-.94 3.31.826 2.37 2.37a1.724 1.724 0 001.065 2.572c1.756.426 1.756 2.924 0 3.35a1.724 1.724 0 00-1.066 2.573c.94 1.543-.826 3.31-2.37 2.37a1.724 1.724 0 00-2.572 1.065c-.426 1.756-2.924 1.756-3.35 0a1.724 1.724 0 00-2.573-1.066c-1.543.94-3.31-.826-2.37-2.37a1.724 1.724 0 00-1.065-2.572c-1.756-.426-1.756-2.924 0-3.35a1.724 1.724 0 001.066-2.573c-.94-1.543.826-3.31 2.37-2.37.996.608 2.296.07 2.572-1.065z""/><path d=""M15 12a3 3 0 11-6 0 3 3 0 016 0z""/>");
+
+ /// <summary>Gets the "collection" icon.</summary>
+ public static UiIconDefinition Collection { get; } = new("0 0 24 24", new Dictionary<string, object> { { "fill", "none" }, { "stroke", "currentColor" }, { "stroke-width", "2" }, { "stroke-linecap", "round" }, { "stroke-linejoin", "round" } }, @"<path d=""M19 11H5m14 0a2 2 0 012 2v6a2 2 0 01-2 2H5a2 2 0 01-2-2v-6a2 2 0 012-2m14 0V9a2 2 0 00-2-2M5 11V9a2 2 0 012-2m0 0V5a2 2 0 012-2h6a2 2 0 012 2v2M7 7h10""/>");
+
+ /// <summary>Gets the "color-swatch" icon.</summary>
+ public static UiIconDefinition ColorSwatch { get; } = new("0 0 24 24", new Dictionary<string, object> { { "fill", "none" }, { "stroke", "currentColor" }, { "stroke-width", "2" }, { "stroke-linecap", "round" }, { "stroke-linejoin", "round" } }, @"<path d=""M7 21a4 4 0 01-4-4V5a2 2 0 012-2h4a2 2 0 012 2v12a4 4 0 01-4 4zm0 0h12a2 2 0 002-2v-4a2 2 0 00-2-2h-2.343M11 7.343l1.657-1.657a2 2 0 012.828 0l2.829 2.829a2 2 0 010 2.828l-8.486 8.485M7 17h.01""/>");
+
+ /// <summary>Gets the "credit-card" icon.</summary>
+ public static UiIconDefinition CreditCard { get; } = new("0 0 24 24", new Dictionary<string, object> { { "fill", "none" }, { "stroke", "currentColor" }, { "stroke-width", "2" }, { "stroke-linecap", "round" }, { "stroke-linejoin", "round" } }, @"<path d=""M3 10h18M7 15h1m4 0h1m-7 4h12a3 3 0 003-3V8a3 3 0 00-3-3H6a3 3 0 00-3 3v8a3 3 0 003 3z""/>");
+
+ /// <summary>Gets the "database" icon.</summary>
+ public static UiIconDefinition Database { get; } = new("0 0 24 24", new Dictionary<string, object> { { "fill", "none" }, { "stroke", "currentColor" }, { "stroke-width", "2" }, { "stroke-linecap", "round" }, { "stroke-linejoin", "round" } }, @"<path d=""M4 7v10c0 2.21 3.582 4 8 4s8-1.79 8-4V7M4 7c0 2.21 3.582 4 8 4s8-1.79 8-4M4 7c0-2.21 3.582-4 8-4s8 1.79 8 4m0 5c0 2.21-3.582 4-8 4s-8-1.79-8-4""/>");
+
+ /// <summary>Gets the "desktop-computer" icon.</summary>
+ public static UiIconDefinition DesktopComputer { get; } = new("0 0 24 24", new Dictionary<string, object> { { "fill", "none" }, { "stroke", "currentColor" }, { "stroke-width", "2" }, { "stroke-linecap", "round" }, { "stroke-linejoin", "round" } }, @"<path d=""M9.75 17L9 20l-1 1h8l-1-1-.75-3M3 13h18M5 17h14a2 2 0 002-2V5a2 2 0 00-2-2H5a2 2 0 00-2 2v10a2 2 0 002 2z""/>");
+
+ /// <summary>Gets the "device-mobile" icon.</summary>
+ public static UiIconDefinition DeviceMobile { get; } = new("0 0 24 24", new Dictionary<string, object> { { "fill", "none" }, { "stroke", "currentColor" }, { "stroke-width", "2" }, { "stroke-linecap", "round" }, { "stroke-linejoin", "round" } }, @"<path d=""M12 18h.01M8 21h8a2 2 0 002-2V5a2 2 0 00-2-2H8a2 2 0 00-2 2v14a2 2 0 002 2z""/>");
+
+ /// <summary>Gets the "document-duplicate" icon.</summary>
+ public static UiIconDefinition DocumentDuplicate { get; } = new("0 0 24 24", new Dictionary<string, object> { { "fill", "none" }, { "stroke", "currentColor" }, { "stroke-width", "2" }, { "stroke-linecap", "round" }, { "stroke-linejoin", "round" } }, @"<path d=""M8 7v8a2 2 0 002 2h6M8 7V5a2 2 0 012-2h4.586a1 1 0 01.707.293l4.414 4.414a1 1 0 01.293.707V15a2 2 0 01-2 2h-2M8 7H6a2 2 0 00-2 2v10a2 2 0 002 2h8a2 2 0 002-2v-2""/>");
+
+ /// <summary>Gets the "document-text" icon.</summary>
+ public static UiIconDefinition DocumentText { get; } = new("0 0 24 24", new Dictionary<string, object> { { "fill", "none" }, { "stroke", "currentColor" }, { "stroke-width", "2" }, { "stroke-linecap", "round" }, { "stroke-linejoin", "round" } }, @"<path d=""M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z""/>");
+
+ /// <summary>Gets the "dots-vertical-narrow" icon.</summary>
+ public static UiIconDefinition DotsVerticalNarrow { get; } = new("0 0 12 24", new Dictionary<string, object> { { "fill", "currentColor" } }, @"<circle cx=""6"" cy=""5"" r=""2""/><circle cx=""6"" cy=""12"" r=""2""/><circle cx=""6"" cy=""19"" r=""2""/>");
+
+ /// <summary>Gets the "download" icon.</summary>
+ public static UiIconDefinition Download { get; } = new("0 0 24 24", new Dictionary<string, object> { { "fill", "none" }, { "stroke", "currentColor" }, { "stroke-width", "2" }, { "stroke-linecap", "round" }, { "stroke-linejoin", "round" } }, @"<path d=""M4 16v1a3 3 0 003 3h10a3 3 0 003-3v-1m-4-4l-4 4m0 0l-4-4m4 4V4""/>");
+
+ /// <summary>Gets the "duplicate" icon.</summary>
+ public static UiIconDefinition Duplicate { get; } = new("0 0 24 24", new Dictionary<string, object> { { "fill", "none" }, { "stroke", "currentColor" }, { "stroke-width", "2" }, { "stroke-linecap", "round" }, { "stroke-linejoin", "round" } }, @"<path d=""M8 16H6a2 2 0 01-2-2V6a2 2 0 012-2h8a2 2 0 012 2v2m-6 12h8a2 2 0 002-2v-8a2 2 0 00-2-2h-8a2 2 0 00-2 2v8a2 2 0 002 2z""/>");
+
+ /// <summary>Gets the "exclamation" icon.</summary>
+ public static UiIconDefinition Exclamation { get; } = new("0 0 24 24", new Dictionary<string, object> { { "fill", "none" }, { "stroke", "currentColor" }, { "stroke-width", "2" }, { "stroke-linecap", "round" }, { "stroke-linejoin", "round" } }, @"<path d=""M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z""/>");
+
+ /// <summary>Gets the "external-link" icon.</summary>
+ public static UiIconDefinition ExternalLink { get; } = new("0 0 24 24", new Dictionary<string, object> { { "fill", "none" }, { "stroke", "currentColor" }, { "stroke-width", "2" }, { "stroke-linecap", "round" }, { "stroke-linejoin", "round" } }, @"<path d=""M10 6H6a2 2 0 00-2 2v10a2 2 0 002 2h10a2 2 0 002-2v-4M14 4h6m0 0v6m0-6L10 14""/>");
+
+ /// <summary>Gets the "eye" icon.</summary>
+ public static UiIconDefinition Eye { get; } = new("0 0 24 24", new Dictionary<string, object> { { "fill", "none" }, { "stroke", "currentColor" }, { "stroke-width", "2" }, { "stroke-linecap", "round" }, { "stroke-linejoin", "round" } }, @"<path d=""M15 12a3 3 0 11-6 0 3 3 0 016 0z""/><path d=""M2.458 12C3.732 7.943 7.523 5 12 5c4.478 0 8.268 2.943 9.542 7-1.274 4.057-5.064 7-9.542 7-4.477 0-8.268-2.943-9.542-7z""/>");
+
+ /// <summary>Gets the "eye-off" icon.</summary>
+ public static UiIconDefinition EyeOff { get; } = new("0 0 24 24", new Dictionary<string, object> { { "fill", "none" }, { "stroke", "currentColor" }, { "stroke-width", "2" }, { "stroke-linecap", "round" }, { "stroke-linejoin", "round" } }, @"<path d=""M13.875 18.825A10.05 10.05 0 0112 19c-4.478 0-8.268-2.943-9.543-7a9.97 9.97 0 011.563-3.029m5.858.908a3 3 0 114.243 4.243M9.878 9.878l4.242 4.242M9.88 9.88l-3.29-3.29m7.532 7.532l3.29 3.29M3 3l3.59 3.59m0 0A9.953 9.953 0 0112 5c4.478 0 8.268 2.943 9.543 7a10.025 10.025 0 01-4.132 5.411m0 0L21 21""/>");
+
+ /// <summary>Gets the "folder" icon.</summary>
+ public static UiIconDefinition Folder { get; } = new("0 0 24 24", new Dictionary<string, object> { { "fill", "none" }, { "stroke", "currentColor" }, { "stroke-width", "2" }, { "stroke-linecap", "round" }, { "stroke-linejoin", "round" } }, @"<path d=""M3 7v10a2 2 0 002 2h14a2 2 0 002-2V9a2 2 0 00-2-2h-6l-2-2H5a2 2 0 00-2 2z""/>");
+
+ /// <summary>Gets the "folder-check" icon.</summary>
+ public static UiIconDefinition FolderCheck { get; } = new("0 0 24 24", new Dictionary<string, object> { { "fill", "none" }, { "stroke", "currentColor" }, { "stroke-width", "2" }, { "stroke-linecap", "round" }, { "stroke-linejoin", "round" } }, @"<path d=""M3 7v10a2 2 0 002 2h14a2 2 0 002-2V9a2 2 0 00-2-2h-6l-2-2H5a2 2 0 00-2 2z""/><path d=""M9 14l2 2 4-4""/>");
+
+ /// <summary>Gets the "folder-filled" icon.</summary>
+ public static UiIconDefinition FolderFilled { get; } = new("0 0 24 24", new Dictionary<string, object> { { "fill", "currentColor" } }, @"<path d=""M10 4H4a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-8l-2-2z""/>");
+
+ /// <summary>Gets the "globe-alt" icon.</summary>
+ public static UiIconDefinition GlobeAlt { get; } = new("0 0 24 24", new Dictionary<string, object> { { "fill", "none" }, { "stroke", "currentColor" }, { "stroke-width", "2" }, { "stroke-linecap", "round" }, { "stroke-linejoin", "round" } }, @"<path d=""M21 12a9 9 0 01-9 9m9-9a9 9 0 00-9-9m9 9H3m9 9a9 9 0 01-9-9m9 9c1.657 0 3-4.03 3-9s-1.343-9-3-9m0 18c-1.657 0-3-4.03-3-9s1.343-9 3-9m-9 9a9 9 0 019-9""/>");
+
+ /// <summary>Gets the "grip-vertical" icon.</summary>
+ public static UiIconDefinition GripVertical { get; } = new("0 0 20 20", new Dictionary<string, object> { { "fill", "currentColor" } }, @"<path d=""M7 4a1.5 1.5 0 11-3 0 1.5 1.5 0 013 0zm0 6a1.5 1.5 0 11-3 0 1.5 1.5 0 013 0zm-1.5 7.5a1.5 1.5 0 100-3 1.5 1.5 0 000 3zM16 4a1.5 1.5 0 11-3 0 1.5 1.5 0 013 0zm-1.5 7.5a1.5 1.5 0 100-3 1.5 1.5 0 000 3zM16 16a1.5 1.5 0 11-3 0 1.5 1.5 0 013 0z""/>");
+
+ /// <summary>Gets the "hashtag" icon.</summary>
+ public static UiIconDefinition Hashtag { get; } = new("0 0 24 24", new Dictionary<string, object> { { "fill", "none" }, { "stroke", "currentColor" }, { "stroke-width", "2" }, { "stroke-linecap", "round" }, { "stroke-linejoin", "round" } }, @"<path d=""M7 20l4-16m2 16l4-16M6 9h14M4 15h14""/>");
+
+ /// <summary>Gets the "home" icon.</summary>
+ public static UiIconDefinition Home { get; } = new("0 0 24 24", new Dictionary<string, object> { { "fill", "none" }, { "stroke", "currentColor" }, { "stroke-width", "2" }, { "stroke-linecap", "round" }, { "stroke-linejoin", "round" } }, @"<path d=""M3 12l2-2m0 0l7-7 7 7M5 10v10a1 1 0 001 1h3m10-11l2 2m-2-2v10a1 1 0 01-1 1h-3m-6 0a1 1 0 001-1v-4a1 1 0 011-1h2a1 1 0 011 1v4a1 1 0 001 1m-6 0h6""/>");
+
+ /// <summary>Gets the "information-circle" icon.</summary>
+ public static UiIconDefinition InformationCircle { get; } = new("0 0 24 24", new Dictionary<string, object> { { "fill", "none" }, { "stroke", "currentColor" }, { "stroke-width", "2" }, { "stroke-linecap", "round" }, { "stroke-linejoin", "round" } }, @"<path d=""M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z""/>");
+
+ /// <summary>Gets the "key" icon.</summary>
+ public static UiIconDefinition Key { get; } = new("0 0 24 24", new Dictionary<string, object> { { "fill", "none" }, { "stroke", "currentColor" }, { "stroke-width", "2" }, { "stroke-linecap", "round" }, { "stroke-linejoin", "round" } }, @"<path d=""M15 7a2 2 0 012 2m4 0a6 6 0 01-7.743 5.743L11 17H9v2H7v2H4a1 1 0 01-1-1v-2.586a1 1 0 01.293-.707l5.964-5.964A6 6 0 1121 9z""/>");
+
+ /// <summary>Gets the "keyboard" icon.</summary>
+ public static UiIconDefinition Keyboard { get; } = new("0 0 24 24", new Dictionary<string, object> { { "fill", "none" }, { "stroke", "currentColor" }, { "stroke-width", "2" }, { "stroke-linecap", "round" }, { "stroke-linejoin", "round" } }, @"<path d=""M5 7h14a2 2 0 012 2v6a2 2 0 01-2 2H5a2 2 0 01-2-2V9a2 2 0 012-2zM7 11h.01M11 11h.01M15 11h.01M8 15h8""/>");
+
+ /// <summary>Gets the "lock-closed" icon.</summary>
+ public static UiIconDefinition LockClosed { get; } = new("0 0 24 24", new Dictionary<string, object> { { "fill", "none" }, { "stroke", "currentColor" }, { "stroke-width", "2" }, { "stroke-linecap", "round" }, { "stroke-linejoin", "round" } }, @"<path d=""M12 15v2m-6 4h12a2 2 0 002-2v-6a2 2 0 00-2-2H6a2 2 0 00-2 2v6a2 2 0 002 2zm10-10V7a4 4 0 00-8 0v4h8z""/>");
+
+ /// <summary>Gets the "logout" icon.</summary>
+ public static UiIconDefinition Logout { get; } = new("0 0 24 24", new Dictionary<string, object> { { "fill", "none" }, { "stroke", "currentColor" }, { "stroke-width", "2" }, { "stroke-linecap", "round" }, { "stroke-linejoin", "round" } }, @"<path d=""M17 16l4-4m0 0l-4-4m4 4H7m6 4v1a3 3 0 01-3 3H6a3 3 0 01-3-3V7a3 3 0 013-3h4a3 3 0 013 3v1""/>");
+
+ /// <summary>Gets the "mail" icon.</summary>
+ public static UiIconDefinition Mail { get; } = new("0 0 24 24", new Dictionary<string, object> { { "fill", "none" }, { "stroke", "currentColor" }, { "stroke-width", "2" }, { "stroke-linecap", "round" }, { "stroke-linejoin", "round" } }, @"<path d=""M3 8l7.89 5.26a2 2 0 002.22 0L21 8M5 19h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v10a2 2 0 002 2z""/>");
+
+ /// <summary>Gets the "menu" icon.</summary>
+ public static UiIconDefinition Menu { get; } = new("0 0 24 24", new Dictionary<string, object> { { "fill", "none" }, { "stroke", "currentColor" }, { "stroke-width", "2" }, { "stroke-linecap", "round" }, { "stroke-linejoin", "round" } }, @"<path d=""M4 6h16M4 12h16M4 18h16""/>");
+
+ /// <summary>Gets the "menu-alt-3" icon.</summary>
+ public static UiIconDefinition MenuAlt3 { get; } = new("0 0 24 24", new Dictionary<string, object> { { "fill", "none" }, { "stroke", "currentColor" }, { "stroke-width", "2" }, { "stroke-linecap", "round" }, { "stroke-linejoin", "round" } }, @"<path d=""M4 6h16M4 12h16m-7 6h7""/>");
+
+ /// <summary>Gets the "moon" icon.</summary>
+ public static UiIconDefinition Moon { get; } = new("0 0 24 24", new Dictionary<string, object> { { "fill", "none" }, { "stroke", "currentColor" }, { "stroke-width", "2" }, { "stroke-linecap", "round" }, { "stroke-linejoin", "round" } }, @"<path d=""M20.354 15.354A9 9 0 018.646 3.646 9.003 9.003 0 0012 21a9.003 9.003 0 008.354-5.646z""/>");
+
+ /// <summary>Gets the "paper-clip" icon.</summary>
+ public static UiIconDefinition PaperClip { get; } = new("0 0 24 24", new Dictionary<string, object> { { "fill", "none" }, { "stroke", "currentColor" }, { "stroke-width", "2" }, { "stroke-linecap", "round" }, { "stroke-linejoin", "round" } }, @"<path d=""M15.172 7l-6.586 6.586a2 2 0 102.828 2.828l6.414-6.586a4 4 0 00-5.656-5.656l-6.415 6.585a6 6 0 108.486 8.486L20.5 13""/>");
+
+ /// <summary>Gets the "pencil" icon.</summary>
+ public static UiIconDefinition Pencil { get; } = new("0 0 24 24", new Dictionary<string, object> { { "fill", "none" }, { "stroke", "currentColor" }, { "stroke-width", "2" }, { "stroke-linecap", "round" }, { "stroke-linejoin", "round" } }, @"<path d=""M15.232 5.232l3.536 3.536m-2.036-5.036a2.5 2.5 0 113.536 3.536L6.5 21.036H3v-3.572L16.732 3.732z""/>");
+
+ /// <summary>Gets the "pencil-alt" icon.</summary>
+ public static UiIconDefinition PencilAlt { get; } = new("0 0 24 24", new Dictionary<string, object> { { "fill", "none" }, { "stroke", "currentColor" }, { "stroke-width", "2" }, { "stroke-linecap", "round" }, { "stroke-linejoin", "round" } }, @"<path d=""M11 5H6a2 2 0 00-2 2v11a2 2 0 002 2h11a2 2 0 002-2v-5m-1.414-9.414a2 2 0 112.828 2.828L11.828 15H9v-2.828l8.586-8.586z""/>");
+
+ /// <summary>Gets the "pin-material" icon.</summary>
+ public static UiIconDefinition PinMaterial { get; } = new("0 -960 960 960", new Dictionary<string, object> { { "fill", "currentColor" } }, @"<path d=""M160-160q-33 0-56.5-23.5T80-240v-480q0-33 23.5-56.5T160-800h640q33 0 56.5 23.5T880-720v480q0 33-23.5 56.5T800-160H160Zm100-200h46v-240h-36l-70 50 24 36 36-26v180Zm124 0h156v-40h-94l-2-2q21-20 34.5-34t21.5-22q18-18 27-36t9-38q0-29-22-48.5T458-600q-26 0-47 15t-29 39l40 16q5-13 14.5-20.5T458-558q15 0 24.5 8t9.5 20q0 11-4 20.5T470-486l-32 32-54 54v40Zm296 0q36 0 58-20t22-52q0-18-10-32t-28-22v-2q14-8 22-20.5t8-29.5q0-27-21-44.5T678-600q-25 0-46.5 14.5T604-550l40 16q4-12 13-19t21-7q13 0 21.5 7.5T708-534q0 14-10 22t-26 8h-18v40h20q20 0 31 8t11 22q0 13-11 22.5t-25 9.5q-17 0-26-7.5T638-436l-40 16q7 29 28.5 44.5T680-360ZM160-240h640v-480H160v480Zm0 0v-480 480Z""/>");
+
+ /// <summary>Gets the "plus" icon.</summary>
+ public static UiIconDefinition Plus { get; } = new("0 0 24 24", new Dictionary<string, object> { { "fill", "none" }, { "stroke", "currentColor" }, { "stroke-width", "2" }, { "stroke-linecap", "round" }, { "stroke-linejoin", "round" } }, @"<path d=""M12 4v16m8-8H4""/>");
+
+ /// <summary>Gets the "plus-sm" icon.</summary>
+ public static UiIconDefinition PlusSm { get; } = new("0 0 24 24", new Dictionary<string, object> { { "fill", "none" }, { "stroke", "currentColor" }, { "stroke-width", "2" }, { "stroke-linecap", "round" }, { "stroke-linejoin", "round" } }, @"<path d=""M12 6v6m0 0v6m0-6h6m-6 0H6""/>");
+
+ /// <summary>Gets the "qrcode" icon.</summary>
+ public static UiIconDefinition Qrcode { get; } = new("0 0 24 24", new Dictionary<string, object> { { "fill", "none" }, { "stroke", "currentColor" }, { "stroke-width", "2" }, { "stroke-linecap", "round" }, { "stroke-linejoin", "round" } }, @"<path d=""M12 4v1m6 11h2m-6 0h-2v4m0-11v3m0 0h.01M12 12h4.01M16 20h4M4 12h4m12 0h.01M5 8h2a1 1 0 001-1V5a1 1 0 00-1-1H5a1 1 0 00-1 1v2a1 1 0 001 1zm12 0h2a1 1 0 001-1V5a1 1 0 00-1-1h-2a1 1 0 00-1 1v2a1 1 0 001 1zM5 20h2a1 1 0 001-1v-2a1 1 0 00-1-1H5a1 1 0 00-1 1v2a1 1 0 001 1z""/>");
+
+ /// <summary>Gets the "question-mark-circle" icon.</summary>
+ public static UiIconDefinition QuestionMarkCircle { get; } = new("0 0 24 24", new Dictionary<string, object> { { "fill", "none" }, { "stroke", "currentColor" }, { "stroke-width", "2" }, { "stroke-linecap", "round" }, { "stroke-linejoin", "round" } }, @"<path d=""M8.228 9c.549-1.165 2.03-2 3.772-2 2.21 0 4 1.343 4 3 0 1.4-1.278 2.575-3.006 2.907-.542.104-.994.54-.994 1.093m0 3h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z""/>");
+
+ /// <summary>Gets the "refresh" icon.</summary>
+ public static UiIconDefinition Refresh { get; } = new("0 0 24 24", new Dictionary<string, object> { { "fill", "none" }, { "stroke", "currentColor" }, { "stroke-width", "2" }, { "stroke-linecap", "round" }, { "stroke-linejoin", "round" } }, @"<path d=""M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15""/>");
+
+ /// <summary>Gets the "reply" icon.</summary>
+ public static UiIconDefinition Reply { get; } = new("0 0 24 24", new Dictionary<string, object> { { "fill", "none" }, { "stroke", "currentColor" }, { "stroke-width", "2" }, { "stroke-linecap", "round" }, { "stroke-linejoin", "round" } }, @"<path d=""M3 10h10a8 8 0 018 8v2M3 10l6 6m-6-6l6-6""/>");
+
+ /// <summary>Gets the "search" icon.</summary>
+ public static UiIconDefinition Search { get; } = new("0 0 24 24", new Dictionary<string, object> { { "fill", "none" }, { "stroke", "currentColor" }, { "stroke-width", "2" }, { "stroke-linecap", "round" }, { "stroke-linejoin", "round" } }, @"<path d=""M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z""/>");
+
+ /// <summary>Gets the "shield-check" icon.</summary>
+ public static UiIconDefinition ShieldCheck { get; } = new("0 0 24 24", new Dictionary<string, object> { { "fill", "none" }, { "stroke", "currentColor" }, { "stroke-width", "2" }, { "stroke-linecap", "round" }, { "stroke-linejoin", "round" } }, @"<path d=""M9 12l2 2 4-4m5.618-4.016A11.955 11.955 0 0112 2.944a11.955 11.955 0 01-8.618 3.04A12.02 12.02 0 003 9c0 5.591 3.824 10.29 9 11.622 5.176-1.332 9-6.03 9-11.622 0-1.042-.133-2.052-.382-3.016z""/>");
+
+ /// <summary>Gets the "shield-exclamation" icon.</summary>
+ public static UiIconDefinition ShieldExclamation { get; } = new("0 0 24 24", new Dictionary<string, object> { { "fill", "none" }, { "stroke", "currentColor" }, { "stroke-width", "2" }, { "stroke-linecap", "round" }, { "stroke-linejoin", "round" } }, @"<path d=""M20.618 5.984A11.955 11.955 0 0112 2.944a11.955 11.955 0 01-8.618 3.04A12.02 12.02 0 003 9c0 5.591 3.824 10.29 9 11.622 5.176-1.332 9-6.03 9-11.622 0-1.042-.133-2.052-.382-3.016zM12 9v2m0 4h.01""/>");
+
+ /// <summary>Gets the "sort-descending" icon.</summary>
+ public static UiIconDefinition SortDescending { get; } = new("0 0 24 24", new Dictionary<string, object> { { "fill", "none" }, { "stroke", "currentColor" }, { "stroke-width", "2" }, { "stroke-linecap", "round" }, { "stroke-linejoin", "round" } }, @"<path d=""M3 4h13M3 8h9m-9 4h9m5-4v12m0 0l-4-4m4 4l4-4""/>");
+
+ /// <summary>Gets the "spinner" icon.</summary>
+ public static UiIconDefinition Spinner { get; } = new("0 0 24 24", new Dictionary<string, object> { { "fill", "none" } }, @"<circle opacity=""0.25"" cx=""12"" cy=""12"" r=""10"" stroke=""currentColor"" stroke-width=""4""/><path opacity=""0.75"" fill=""currentColor"" d=""M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z""/>");
+
+ /// <summary>Gets the "spinner-flowbite" icon.</summary>
+ public static UiIconDefinition SpinnerFlowbite { get; } = new("0 0 100 101", new Dictionary<string, object> { { "fill", "none" } }, @"<path fill=""currentColor"" d=""M100 50.5908C100 78.2051 77.6142 100.591 50 100.591C22.3858 100.591 0 78.2051 0 50.5908C0 22.9766 22.3858 0.59082 50 0.59082C77.6142 0.59082 100 22.9766 100 50.5908ZM9.08144 50.5908C9.08144 73.1895 27.4013 91.5094 50 91.5094C72.5987 91.5094 90.9186 73.1895 90.9186 50.5908C90.9186 27.9921 72.5987 9.67226 50 9.67226C27.4013 9.67226 9.08144 27.9921 9.08144 50.5908Z""/><path fill=""currentFill"" d=""M93.9676 39.0409C96.393 38.4038 97.8624 35.9116 97.0079 33.5539C95.2932 28.8227 92.871 24.3692 89.8167 20.348C85.8452 15.1192 80.8826 10.7238 75.2124 7.41289C69.5422 4.10194 63.2754 1.94025 56.7698 1.05124C51.7666 0.367541 46.6976 0.446843 41.7345 1.27873C39.2613 1.69328 37.813 4.19778 38.4501 6.62326C39.0873 9.04874 41.5694 10.4717 44.0505 10.1071C47.8511 9.54855 51.7191 9.52689 55.5402 10.0491C60.8642 10.7766 65.9928 12.5457 70.6331 15.2552C75.2735 17.9648 79.3347 21.5619 82.5849 25.841C84.9175 28.9121 86.7997 32.2913 88.1811 35.8758C89.083 38.2158 91.5421 39.6781 93.9676 39.0409Z""/>");
+
+ /// <summary>Gets the "square-check" icon.</summary>
+ public static UiIconDefinition SquareCheck { get; } = new("0 0 24 24", new Dictionary<string, object> { { "fill", "none" }, { "stroke", "currentColor" }, { "stroke-width", "2" }, { "stroke-linecap", "round" }, { "stroke-linejoin", "round" } }, @"<rect x=""3"" y=""3"" width=""18"" height=""18"" rx=""2"" ry=""2""/><polyline points=""7 12 10 15 17 8""/>");
+
+ /// <summary>Gets the "square-feather" icon.</summary>
+ public static UiIconDefinition SquareFeather { get; } = new("0 0 24 24", new Dictionary<string, object> { { "fill", "none" }, { "stroke", "currentColor" }, { "stroke-width", "2" }, { "stroke-linecap", "round" }, { "stroke-linejoin", "round" } }, @"<rect x=""3"" y=""3"" width=""18"" height=""18"" rx=""2"" ry=""2""/>");
+
+ /// <summary>Gets the "status-offline" icon.</summary>
+ public static UiIconDefinition StatusOffline { get; } = new("0 0 24 24", new Dictionary<string, object> { { "fill", "none" }, { "stroke", "currentColor" }, { "stroke-width", "2" }, { "stroke-linecap", "round" }, { "stroke-linejoin", "round" } }, @"<path d=""M18.364 5.636a9 9 0 010 12.728m0 0l-2.829-2.829m2.829 2.829L21 21M15.536 8.464a5 5 0 010 7.072m0 0l-2.829-2.829m-4.243 2.829a4.978 4.978 0 01-1.414-2.83m-1.414 5.658a9 9 0 01-2.167-9.238m7.824 2.167a1 1 0 111.414 1.414m-1.414-1.414L3 3m8.293 8.293l1.414 1.414""/>");
+
+ /// <summary>Gets the "sun" icon.</summary>
+ public static UiIconDefinition Sun { get; } = new("0 0 24 24", new Dictionary<string, object> { { "fill", "none" }, { "stroke", "currentColor" }, { "stroke-width", "2" }, { "stroke-linecap", "round" }, { "stroke-linejoin", "round" } }, @"<path d=""M12 3v1m0 16v1m9-9h-1M4 12H3m15.364 6.364l-.707-.707M6.343 6.343l-.707-.707m12.728 0l-.707.707M6.343 17.657l-.707.707M16 12a4 4 0 11-8 0 4 4 0 018 0z""/>");
+
+ /// <summary>Gets the "switch-horizontal" icon.</summary>
+ public static UiIconDefinition SwitchHorizontal { get; } = new("0 0 24 24", new Dictionary<string, object> { { "fill", "none" }, { "stroke", "currentColor" }, { "stroke-width", "2" }, { "stroke-linecap", "round" }, { "stroke-linejoin", "round" } }, @"<path d=""M8 7h12m0 0l-4-4m4 4l-4 4m0 6H4m0 0l4 4m-4-4l4-4""/>");
+
+ /// <summary>Gets the "translate" icon.</summary>
+ public static UiIconDefinition Translate { get; } = new("0 0 24 24", new Dictionary<string, object> { { "fill", "none" }, { "stroke", "currentColor" }, { "stroke-width", "2" }, { "stroke-linecap", "round" }, { "stroke-linejoin", "round" } }, @"<path d=""M3 5h12M9 3v2m1.048 9.5A18.022 18.022 0 016.412 9m6.088 9h7M11 21l5-10 5 10M12.751 5C11.783 10.77 8.07 15.61 3 18.129""/>");
+
+ /// <summary>Gets the "trash" icon.</summary>
+ public static UiIconDefinition Trash { get; } = new("0 0 24 24", new Dictionary<string, object> { { "fill", "none" }, { "stroke", "currentColor" }, { "stroke-width", "2" }, { "stroke-linecap", "round" }, { "stroke-linejoin", "round" } }, @"<path d=""M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16""/>");
+
+ /// <summary>Gets the "upload" icon.</summary>
+ public static UiIconDefinition Upload { get; } = new("0 0 24 24", new Dictionary<string, object> { { "fill", "none" }, { "stroke", "currentColor" }, { "stroke-width", "2" }, { "stroke-linecap", "round" }, { "stroke-linejoin", "round" } }, @"<path d=""M4 16v1a3 3 0 003 3h10a3 3 0 003-3v-1m-4-8l-4-4m0 0L8 8m4-4v12""/>");
+
+ /// <summary>Gets the "user" icon.</summary>
+ public static UiIconDefinition User { get; } = new("0 0 24 24", new Dictionary<string, object> { { "fill", "none" }, { "stroke", "currentColor" }, { "stroke-width", "2" }, { "stroke-linecap", "round" }, { "stroke-linejoin", "round" } }, @"<path d=""M16 7a4 4 0 11-8 0 4 4 0 018 0zM12 14a7 7 0 00-7 7h14a7 7 0 00-7-7z""/>");
+
+ /// <summary>Gets the "user-group" icon.</summary>
+ public static UiIconDefinition UserGroup { get; } = new("0 0 24 24", new Dictionary<string, object> { { "fill", "none" }, { "stroke", "currentColor" }, { "stroke-width", "2" }, { "stroke-linecap", "round" }, { "stroke-linejoin", "round" } }, @"<path d=""M17 20h5v-2a3 3 0 00-5.356-1.857M17 20H7m10 0v-2c0-.656-.126-1.283-.356-1.857M7 20H2v-2a3 3 0 015.356-1.857M7 20v-2c0-.656.126-1.283.356-1.857m0 0a5.002 5.002 0 019.288 0M15 7a3 3 0 11-6 0 3 3 0 016 0zm6 3a2 2 0 11-4 0 2 2 0 014 0zM7 10a2 2 0 11-4 0 2 2 0 014 0z""/>");
+
+ /// <summary>Gets the "users" icon.</summary>
+ public static UiIconDefinition Users { get; } = new("0 0 24 24", new Dictionary<string, object> { { "fill", "none" }, { "stroke", "currentColor" }, { "stroke-width", "2" }, { "stroke-linecap", "round" }, { "stroke-linejoin", "round" } }, @"<path d=""M12 4.354a4 4 0 110 5.292M15 21H3v-1a6 6 0 0112 0v1zm0 0h6v-1a6 6 0 00-9-5.197M13 7a4 4 0 11-8 0 4 4 0 018 0z""/>");
+
+ /// <summary>Gets the "view-grid-add" icon.</summary>
+ public static UiIconDefinition ViewGridAdd { get; } = new("0 0 24 24", new Dictionary<string, object> { { "fill", "none" }, { "stroke", "currentColor" }, { "stroke-width", "2" }, { "stroke-linecap", "round" }, { "stroke-linejoin", "round" } }, @"<path d=""M17 14v6m-3-3h6M6 10h2a2 2 0 002-2V6a2 2 0 00-2-2H6a2 2 0 00-2 2v2a2 2 0 002 2zm10 0h2a2 2 0 002-2V6a2 2 0 00-2-2h-2a2 2 0 00-2 2v2a2 2 0 002 2zM6 20h2a2 2 0 002-2v-2a2 2 0 00-2-2H6a2 2 0 00-2 2v2a2 2 0 002 2z""/>");
+
+ /// <summary>Gets the "x" icon.</summary>
+ public static UiIconDefinition X { get; } = new("0 0 24 24", new Dictionary<string, object> { { "fill", "none" }, { "stroke", "currentColor" }, { "stroke-width", "2" }, { "stroke-linecap", "round" }, { "stroke-linejoin", "round" } }, @"<path d=""M6 18L18 6M6 6l12 12""/>");
+
+ /// <summary>Gets the "x-circle" icon.</summary>
+ public static UiIconDefinition XCircle { get; } = new("0 0 24 24", new Dictionary<string, object> { { "fill", "none" }, { "stroke", "currentColor" }, { "stroke-width", "2" }, { "stroke-linecap", "round" }, { "stroke-linejoin", "round" } }, @"<path d=""M10 14l2-2m0 0l2-2m-2 2l-2-2m2 2l2 2m7-2a9 9 0 11-18 0 9 9 0 0118 0z""/>");
+}
diff --git a/apps/server/AliasVault.Admin/Main/Components/Loading/LoadingIndicator.razor b/apps/server/AliasVault.Admin/Main/Components/Loading/LoadingIndicator.razor
index 9628844fc..18637f005 100644
--- a/apps/server/AliasVault.Admin/Main/Components/Loading/LoadingIndicator.razor
+++ b/apps/server/AliasVault.Admin/Main/Components/Loading/LoadingIndicator.razor
@@ -1,7 +1,4 @@
<div role="status" class="px-4 mt-4">
- <svg aria-hidden="true" class="inline w-10 h-10 text-gray-200 animate-spin dark:text-gray-600 fill-primary-600" viewBox="0 0 100 101" fill="none" xmlns="http://www.w3.org/2000/svg">
- <path d="M100 50.5908C100 78.2051 77.6142 100.591 50 100.591C22.3858 100.591 0 78.2051 0 50.5908C0 22.9766 22.3858 0.59082 50 0.59082C77.6142 0.59082 100 22.9766 100 50.5908ZM9.08144 50.5908C9.08144 73.1895 27.4013 91.5094 50 91.5094C72.5987 91.5094 90.9186 73.1895 90.9186 50.5908C90.9186 27.9921 72.5987 9.67226 50 9.67226C27.4013 9.67226 9.08144 27.9921 9.08144 50.5908Z" fill="currentColor"/>
- <path d="M93.9676 39.0409C96.393 38.4038 97.8624 35.9116 97.0079 33.5539C95.2932 28.8227 92.871 24.3692 89.8167 20.348C85.8452 15.1192 80.8826 10.7238 75.2124 7.41289C69.5422 4.10194 63.2754 1.94025 56.7698 1.05124C51.7666 0.367541 46.6976 0.446843 41.7345 1.27873C39.2613 1.69328 37.813 4.19778 38.4501 6.62326C39.0873 9.04874 41.5694 10.4717 44.0505 10.1071C47.8511 9.54855 51.7191 9.52689 55.5402 10.0491C60.8642 10.7766 65.9928 12.5457 70.6331 15.2552C75.2735 17.9648 79.3347 21.5619 82.5849 25.841C84.9175 28.9121 86.7997 32.2913 88.1811 35.8758C89.083 38.2158 91.5421 39.6781 93.9676 39.0409Z" fill="currentFill"/>
- </svg>
+ <UiIcon Icon="UiIcons.SpinnerFlowbite" class="inline w-10 h-10 text-gray-200 animate-spin dark:text-gray-600 fill-primary-600" />
<span class="sr-only">Loading...</span>
</div>
diff --git a/apps/server/AliasVault.Admin/Main/Components/Loading/SmallLoadingIndicator.razor b/apps/server/AliasVault.Admin/Main/Components/Loading/SmallLoadingIndicator.razor
index 4547c0479..b50a66b92 100644
--- a/apps/server/AliasVault.Admin/Main/Components/Loading/SmallLoadingIndicator.razor
+++ b/apps/server/AliasVault.Admin/Main/Components/Loading/SmallLoadingIndicator.razor
@@ -1,8 +1,5 @@
<div role="status" class="px-2" title="@Title">
- <svg aria-hidden="true" class="inline w-7 h-7 text-gray-200 @(Spinning ? "animate-spin fill-primary-600" : "") dark:text-gray-600" viewBox="0 0 100 101" fill="none" xmlns="http://www.w3.org/2000/svg">
- <path d="M100 50.5908C100 78.2051 77.6142 100.591 50 100.591C22.3858 100.591 0 78.2051 0 50.5908C0 22.9766 22.3858 0.59082 50 0.59082C77.6142 0.59082 100 22.9766 100 50.5908ZM9.08144 50.5908C9.08144 73.1895 27.4013 91.5094 50 91.5094C72.5987 91.5094 90.9186 73.1895 90.9186 50.5908C90.9186 27.9921 72.5987 9.67226 50 9.67226C27.4013 9.67226 9.08144 27.9921 9.08144 50.5908Z" fill="currentColor" />
- <path d="M93.9676 39.0409C96.393 38.4038 97.8624 35.9116 97.0079 33.5539C95.2932 28.8227 92.871 24.3692 89.8167 20.348C85.8452 15.1192 80.8826 10.7238 75.2124 7.41289C69.5422 4.10194 63.2754 1.94025 56.7698 1.05124C51.7666 0.367541 46.6976 0.446843 41.7345 1.27873C39.2613 1.69328 37.813 4.19778 38.4501 6.62326C39.0873 9.04874 41.5694 10.4717 44.0505 10.1071C47.8511 9.54855 51.7191 9.52689 55.5402 10.0491C60.8642 10.7766 65.9928 12.5457 70.6331 15.2552C75.2735 17.9648 79.3347 21.5619 82.5849 25.841C84.9175 28.9121 86.7997 32.2913 88.1811 35.8758C89.083 38.2158 91.5421 39.6781 93.9676 39.0409Z" fill="currentFill" />
- </svg>
+ <UiIcon Icon="UiIcons.SpinnerFlowbite" class="@($"inline w-7 h-7 text-gray-200 {(Spinning ? "animate-spin fill-primary-600" : string.Empty)} dark:text-gray-600")" />
<span class="sr-only">Loading...</span>
</div>
diff --git a/apps/server/AliasVault.Admin/Main/Components/Paginators/ResponsivePaginator.razor b/apps/server/AliasVault.Admin/Main/Components/Paginators/ResponsivePaginator.razor
index 60f301c38..dd31de4cc 100644
--- a/apps/server/AliasVault.Admin/Main/Components/Paginators/ResponsivePaginator.razor
+++ b/apps/server/AliasVault.Admin/Main/Components/Paginators/ResponsivePaginator.razor
@@ -41,9 +41,7 @@
@onclick="() => ChangePage(-1)"
disabled="@(CurrentPage == 1)"
class="px-3 py-2 bg-primary-100 text-primary-700 border border-primary-300 rounded hover:bg-primary-200 transition duration-300 shadow-sm disabled:opacity-50 disabled:cursor-not-allowed">
- <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 20 20">
- <path fill-rule="evenodd" d="M12.707 5.293a1 1 0 010 1.414L9.414 10l3.293 3.293a1 1 0 01-1.414 1.414l-4-4a1 1 0 010-1.414l4-4a1 1 0 011.414 0z" clip-rule="evenodd"/>
- </svg>
+ <UiIcon Icon="UiIcons.ChevronLeft" class="w-4 h-4" />
</button>
</li>
@@ -60,9 +58,7 @@
@onclick="() => ChangePage(1)"
disabled="@(CurrentPage == PageCount)"
class="px-3 py-2 bg-primary-100 text-primary-700 border border-primary-300 rounded hover:bg-primary-200 transition duration-300 shadow-sm disabled:opacity-50 disabled:cursor-not-allowed">
- <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 20 20">
- <path fill-rule="evenodd" d="M7.293 14.707a1 1 0 010-1.414L10.586 10 7.293 6.707a1 1 0 011.414-1.414l4 4a1 1 0 010 1.414l-4 4a1 1 0 01-1.414 0z" clip-rule="evenodd"/>
- </svg>
+ <UiIcon Icon="UiIcons.ChevronRight" class="w-4 h-4" />
</button>
</li>
</ul>
diff --git a/apps/server/AliasVault.Admin/Main/Components/Tables/SortableTable.razor b/apps/server/AliasVault.Admin/Main/Components/Tables/SortableTable.razor
index a1a7e59b1..8eabfe4a5 100644
--- a/apps/server/AliasVault.Admin/Main/Components/Tables/SortableTable.razor
+++ b/apps/server/AliasVault.Admin/Main/Components/Tables/SortableTable.razor
@@ -15,15 +15,11 @@
{
@if (SortDirection == SortDirection.Ascending)
{
- <svg class="w-3 h-3" fill="currentColor" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg">
- <path fill-rule="evenodd" d="M5.293 7.707a1 1 0 010-1.414l4-4a1 1 0 011.414 0l4 4a1 1 0 01-1.414 1.414L11 5.414V17a1 1 0 11-2 0V5.414L6.707 7.707a1 1 0 01-1.414 0z" clip-rule="evenodd"></path>
- </svg>
+ <UiIcon Icon="UiIcons.ArrowNarrowUp" class="w-3 h-3" />
}
else
{
- <svg class="w-3 h-3" fill="currentColor" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg">
- <path fill-rule="evenodd" d="M14.707 12.293a1 1 0 010 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 111.414-1.414L9 14.586V3a1 1 0 012 0v11.586l2.293-2.293a1 1 0 011.414 0z" clip-rule="evenodd"></path>
- </svg>
+ <UiIcon Icon="UiIcons.ArrowNarrowDown" class="w-3 h-3" />
}
}
</span>
diff --git a/apps/server/AliasVault.Admin/Main/Layout/TopMenu.razor b/apps/server/AliasVault.Admin/Main/Layout/TopMenu.razor
index 1cf8d8f44..ddb5d2cb0 100644
--- a/apps/server/AliasVault.Admin/Main/Layout/TopMenu.razor
+++ b/apps/server/AliasVault.Admin/Main/Layout/TopMenu.razor
@@ -36,8 +36,8 @@
</div>
<div class="flex justify-end items-center lg:order-2">
<button id="theme-toggle" data-tooltip-target="tooltip-toggle" type="button" class="hidden md:block text-gray-500 dark:text-gray-400 hover:bg-gray-100 dark:hover:bg-gray-700 focus:outline-none focus:ring-4 focus:ring-gray-200 dark:focus:ring-gray-700 rounded-lg text-sm p-2.5">
- <svg id="theme-toggle-dark-icon" class="hidden w-5 h-5" fill="currentColor" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M17.293 13.293A8 8 0 016.707 2.707a8.001 8.001 0 1010.586 10.586z"></path></svg>
- <svg id="theme-toggle-light-icon" class="hidden w-5 h-5" fill="currentColor" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M10 2a1 1 0 011 1v1a1 1 0 11-2 0V3a1 1 0 011-1zm4 8a4 4 0 11-8 0 4 4 0 018 0zm-.464 4.95l.707.707a1 1 0 001.414-1.414l-.707-.707a1 1 0 00-1.414 1.414zm2.12-10.607a1 1 0 010 1.414l-.706.707a1 1 0 11-1.414-1.414l.707-.707a1 1 0 011.414 0zM17 11a1 1 0 100-2h-1a1 1 0 100 2h1zm-7 4a1 1 0 011 1v1a1 1 0 11-2 0v-1a1 1 0 011-1zM5.05 6.464A1 1 0 106.465 5.05l-.708-.707a1 1 0 00-1.414 1.414l.707.707zm1.414 8.486l-.707.707a1 1 0 01-1.414-1.414l.707-.707a1 1 0 011.414 1.414zM4 11a1 1 0 100-2H3a1 1 0 000 2h1z" fill-rule="evenodd" clip-rule="evenodd"></path></svg>
+ <UiIcon Icon="UiIcons.Moon" id="theme-toggle-dark-icon" class="hidden w-5 h-5" />
+ <UiIcon Icon="UiIcons.Sun" id="theme-toggle-light-icon" class="hidden w-5 h-5" />
</button>
<div id="tooltip-toggle" role="tooltip" class="inline-block absolute invisible z-10 py-2 px-3 text-sm font-medium text-white bg-gray-900 rounded-lg shadow-sm opacity-0 transition-opacity duration-300 tooltip" data-popper-placement="bottom" style="position: absolute; inset: 0px auto auto 0px; margin: 0px; transform: translate3d(1377px, 60px, 0px);">
Toggle dark mode
@@ -72,7 +72,7 @@
<button @onclick="ToggleMobileMenu" type="button" id="toggleMobileMenuButton" class="flex items-center p-2 text-gray-500 rounded-lg ml-1 lg:hidden hover:text-gray-900 hover:bg-gray-100 dark:text-gray-400 dark:hover:text-white dark:hover:bg-gray-700 focus:ring-4 focus:ring-gray-300 dark:focus:ring-gray-600">
<span class="sr-only">Open menu</span>
- <svg class="w-6 h-6" aria-hidden="true" fill="currentColor" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" d="M3 5a1 1 0 011-1h12a1 1 0 110 2H4a1 1 0 01-1-1zM3 10a1 1 0 011-1h12a1 1 0 110 2H4a1 1 0 01-1-1zM3 15a1 1 0 011-1h12a1 1 0 110 2H4a1 1 0 01-1-1z" clip-rule="evenodd"></path></svg>
+ <UiIcon Icon="UiIcons.Menu" class="w-6 h-6" />
</button>
</div>
</div>
diff --git a/apps/server/AliasVault.Admin/Main/Pages/Account/Manage/GenerateRecoveryCodes.razor b/apps/server/AliasVault.Admin/Main/Pages/Account/Manage/GenerateRecoveryCodes.razor
index 67e10222d..a0b1ee0e6 100644
--- a/apps/server/AliasVault.Admin/Main/Pages/Account/Manage/GenerateRecoveryCodes.razor
+++ b/apps/server/AliasVault.Admin/Main/Pages/Account/Manage/GenerateRecoveryCodes.razor
@@ -16,9 +16,7 @@ else
<h3 class="text-xl font-bold mb-4">Generate two-factor authentication (2FA) recovery codes</h3>
<div class="bg-primary-100 border-l-4 border-primary-500 text-primary-700 p-4 mb-4" role="alert">
<p class="mb-2">
- <svg class="inline w-5 h-5 mr-2" fill="none" stroke="currentColor" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
- <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z"></path>
- </svg>
+ <UiIcon Icon="UiIcons.Exclamation" class="inline w-5 h-5 mr-2" />
<strong>Put these codes in a safe place.</strong>
</p>
<p class="mb-2">
diff --git a/apps/server/AliasVault.Admin/Main/Pages/Account/Manage/ResetAuthenticator.razor b/apps/server/AliasVault.Admin/Main/Pages/Account/Manage/ResetAuthenticator.razor
index b70f714c5..776ba1d0b 100644
--- a/apps/server/AliasVault.Admin/Main/Pages/Account/Manage/ResetAuthenticator.razor
+++ b/apps/server/AliasVault.Admin/Main/Pages/Account/Manage/ResetAuthenticator.razor
@@ -10,9 +10,7 @@
<h3 class="text-xl font-bold mb-4 dark:text-white">Reset authenticator key</h3>
<div class="bg-primary-100 border-l-4 border-primary-500 text-primary-700 p-4 mb-4" role="alert">
<p class="mb-2">
- <svg class="inline w-5 h-5 mr-2" fill="none" stroke="currentColor" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
- <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z"></path>
- </svg>
+ <UiIcon Icon="UiIcons.Exclamation" class="inline w-5 h-5 mr-2" />
<strong>If you reset your authenticator key your authenticator app will not work until you reconfigure it.</strong>
</p>
<p>
diff --git a/apps/server/AliasVault.Admin/Main/Pages/Dashboard/AllTimeStats.razor b/apps/server/AliasVault.Admin/Main/Pages/Dashboard/AllTimeStats.razor
index f4f0f8ffa..87c88bfc3 100644
--- a/apps/server/AliasVault.Admin/Main/Pages/Dashboard/AllTimeStats.razor
+++ b/apps/server/AliasVault.Admin/Main/Pages/Dashboard/AllTimeStats.razor
@@ -278,9 +278,7 @@
{
<div class="p-4 bg-white border border-gray-200 rounded-lg shadow-sm dark:border-gray-700 sm:p-6 dark:bg-gray-800">
<div class="text-center text-gray-500 dark:text-gray-400">
- <svg class="mx-auto h-12 w-12 text-gray-300 dark:text-gray-600" fill="none" viewBox="0 0 24 24" stroke="currentColor">
- <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9.75 17L9 20l-1 1h8l-1-1-.75-3M3 13h18M5 17h14a2 2 0 002-2V5a2 2 0 00-2-2H5a2 2 0 00-2 2v10a2 2 0 002 2z"/>
- </svg>
+ <UiIcon Icon="UiIcons.DesktopComputer" class="mx-auto h-12 w-12 text-gray-300 dark:text-gray-600" />
<h3 class="mt-2 text-sm font-medium text-gray-900 dark:text-white">No IP Address Data</h3>
<p class="mt-1 text-sm text-gray-500 dark:text-gray-400">IP addresses are fully anonymized or no successful logins recorded.</p>
</div>
@@ -307,9 +305,7 @@
<div class="bg-red-50 dark:bg-red-900/20 border border-red-200 dark:border-red-800 rounded-lg p-4">
<div class="flex">
<div class="flex-shrink-0">
- <svg class="h-5 w-5 text-red-400" fill="currentColor" viewBox="0 0 20 20">
- <path fill-rule="evenodd" d="M10 18a8 8 0 100-16 8 8 0 000 16zM8.707 7.293a1 1 0 00-1.414 1.414L8.586 10l-1.293 1.293a1 1 0 101.414 1.414L10 11.414l1.293 1.293a1 1 0 001.414-1.414L11.414 10l1.293-1.293a1 1 0 00-1.414-1.414L10 8.586 8.707 7.293z" clip-rule="evenodd"/>
- </svg>
+ <UiIcon Icon="UiIcons.XCircle" class="h-5 w-5 text-red-400" />
</div>
<div class="ml-3">
<h3 class="text-sm font-medium text-red-800 dark:text-red-200">Error Loading Statistics</h3>
diff --git a/apps/server/AliasVault.Admin/Main/Pages/Dashboard/Components/ServiceStatusCard.razor b/apps/server/AliasVault.Admin/Main/Pages/Dashboard/Components/ServiceStatusCard.razor
index b6ceaeab6..d5154b5c5 100644
--- a/apps/server/AliasVault.Admin/Main/Pages/Dashboard/Components/ServiceStatusCard.razor
+++ b/apps/server/AliasVault.Admin/Main/Pages/Dashboard/Components/ServiceStatusCard.razor
@@ -180,19 +180,19 @@
switch (level)
{
case StatusLevel.Ok:
- <svg class="w-6 h-6 shrink-0 text-green-600 dark:text-green-400" fill="none" stroke="currentColor" stroke-width="2" viewBox="0 0 24 24" aria-hidden="true"><path stroke-linecap="round" stroke-linejoin="round" d="M9 12.75 11.25 15 15 9.75M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0Z" /></svg>
+ <UiIcon Icon="UiIcons.CheckCircle" class="w-6 h-6 shrink-0 text-green-600 dark:text-green-400" />
break;
case StatusLevel.Warning:
- <svg class="w-6 h-6 shrink-0 text-yellow-600 dark:text-yellow-400" fill="none" stroke="currentColor" stroke-width="2" viewBox="0 0 24 24" aria-hidden="true"><path stroke-linecap="round" stroke-linejoin="round" d="M12 9v3.75m-9.303 3.376c-.866 1.5.217 3.374 1.948 3.374h14.71c1.73 0 2.813-1.874 1.948-3.374L13.949 3.378c-.866-1.5-3.032-1.5-3.898 0L2.697 16.126ZM12 15.75h.007v.008H12v-.008Z" /></svg>
+ <UiIcon Icon="UiIcons.Exclamation" class="w-6 h-6 shrink-0 text-yellow-600 dark:text-yellow-400" />
break;
case StatusLevel.Error:
- <svg class="w-6 h-6 shrink-0 text-red-600 dark:text-red-400" fill="none" stroke="currentColor" stroke-width="2" viewBox="0 0 24 24" aria-hidden="true"><path stroke-linecap="round" stroke-linejoin="round" d="m9.75 9.75 4.5 4.5m0-4.5-4.5 4.5M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0Z" /></svg>
+ <UiIcon Icon="UiIcons.XCircle" class="w-6 h-6 shrink-0 text-red-600 dark:text-red-400" />
break;
case StatusLevel.Info:
- <svg class="w-6 h-6 shrink-0 text-blue-600 dark:text-blue-400" fill="none" stroke="currentColor" stroke-width="2" viewBox="0 0 24 24" aria-hidden="true"><path stroke-linecap="round" stroke-linejoin="round" d="m11.25 11.25.041-.02a.75.75 0 0 1 1.063.852l-.708 2.836a.75.75 0 0 0 1.063.853l.041-.021M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0Zm-9-3.75h.008v.008H12V8.25Z" /></svg>
+ <UiIcon Icon="UiIcons.InformationCircle" class="w-6 h-6 shrink-0 text-blue-600 dark:text-blue-400" />
break;
default:
- <svg class="w-6 h-6 shrink-0 text-gray-500 dark:text-gray-400" fill="none" stroke="currentColor" stroke-width="2" viewBox="0 0 24 24" aria-hidden="true"><path stroke-linecap="round" stroke-linejoin="round" d="M9.879 7.519c1.171-1.025 3.071-1.025 4.242 0 1.172 1.025 1.172 2.687 0 3.712-.203.179-.43.326-.67.442-.745.361-1.45.999-1.45 1.827v.75M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0Zm-9 5.25h.008v.008H12v-.008Z" /></svg>
+ <UiIcon Icon="UiIcons.QuestionMarkCircle" class="w-6 h-6 shrink-0 text-gray-500 dark:text-gray-400" />
break;
}
};
diff --git a/apps/server/AliasVault.Admin/Main/Pages/Dashboard/Index.razor b/apps/server/AliasVault.Admin/Main/Pages/Dashboard/Index.razor
index dc9d12b31..fd6e50145 100644
--- a/apps/server/AliasVault.Admin/Main/Pages/Dashboard/Index.razor
+++ b/apps/server/AliasVault.Admin/Main/Pages/Dashboard/Index.razor
@@ -11,9 +11,7 @@
<CustomActions>
<RefreshButton OnClick="RefreshData" ButtonText="Refresh" />
<a href="all-time-stats" class="@($"inline-flex {ButtonStyles.BaseClasses} {ButtonStyles.GetColorClasses("light")}")">
- <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 20 20">
- <path d="M2 11a1 1 0 011-1h2a1 1 0 011 1v5a1 1 0 01-1 1H3a1 1 0 01-1-1v-5zM8 7a1 1 0 011-1h2a1 1 0 011 1v9a1 1 0 01-1 1H9a1 1 0 01-1-1V7zM14 4a1 1 0 011-1h2a1 1 0 011 1v12a1 1 0 01-1 1h-2a1 1 0 01-1-1V4z"/>
- </svg>
+ <UiIcon Icon="UiIcons.ChartBar" class="w-4 h-4" />
<span class="inline ml-2">All-Time Stats</span>
</a>
</CustomActions>
diff --git a/apps/server/AliasVault.Admin/Main/Pages/Users/View/Index.razor b/apps/server/AliasVault.Admin/Main/Pages/Users/View/Index.razor
index c564e2b26..0ba0d0504 100644
--- a/apps/server/AliasVault.Admin/Main/Pages/Users/View/Index.razor
+++ b/apps/server/AliasVault.Admin/Main/Pages/Users/View/Index.razor
@@ -44,9 +44,7 @@ else
<button type="button" id="edit-username-button" @onclick="StartEditingUsername"
class="inline-flex items-center justify-center px-3 py-2 text-sm font-medium text-white rounded-lg focus:outline-none focus:ring-4 bg-gray-700 hover:bg-gray-800 focus:ring-gray-300 dark:bg-gray-600 dark:hover:bg-gray-700 dark:focus:ring-gray-800"
title="Change username">
- <svg class="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
- <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M11 5H6a2 2 0 00-2 2v11a2 2 0 002 2h11a2 2 0 002-2v-5m-1.414-9.414a2 2 0 112.828 2.828L11.828 15H9v-2.828l8.586-8.586z"></path>
- </svg>
+ <UiIcon Icon="UiIcons.PencilAlt" class="w-4 h-4" />
</button>
}
</div>
@@ -57,9 +55,7 @@ else
<div class="mb-4 space-y-3 p-4 bg-gray-50 dark:bg-gray-700 rounded-lg">
<div class="mb-3">
<div class="flex items-center mb-2">
- <svg class="w-5 h-5 text-orange-600 dark:text-orange-400 mr-2" fill="currentColor" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg">
- <path fill-rule="evenodd" d="M8.257 3.099c.765-1.36 2.722-1.36 3.486 0l5.58 9.92c.75 1.334-.213 2.98-1.742 2.98H4.42c-1.53 0-2.493-1.646-1.743-2.98l5.58-9.92zM11 13a1 1 0 11-2 0 1 1 0 012 0zm-1-8a1 1 0 00-1 1v3a1 1 0 002 0V6a1 1 0 00-1-1z" clip-rule="evenodd"></path>
- </svg>
+ <UiIcon Icon="UiIcons.Exclamation" class="w-5 h-5 text-orange-600 dark:text-orange-400 mr-2" />
<h4 class="text-lg font-semibold text-gray-900 dark:text-white">Change Username</h4>
</div>
<p class="text-sm text-gray-600 dark:text-gray-300 mb-3">
diff --git a/apps/server/Databases/AliasClientDb/Logo.cs b/apps/server/Databases/AliasClientDb/Logo.cs
index 7138d8d2d..974041b87 100644
--- a/apps/server/Databases/AliasClientDb/Logo.cs
+++ b/apps/server/Databases/AliasClientDb/Logo.cs
@@ -23,7 +23,7 @@ public class Logo : ManifestScopedEntity
/// <summary>
/// The <see cref="Kind"/> of a logo the user picked from the built-in catalog. <see cref="Source"/>
- /// is the catalog key (see core/models/src/icons/AppIcons.ts) and there is no image data: every
+ /// is the catalog key (see core/models/src/icons/BuiltinLogos.ts) and there is no image data: every
/// platform draws the logo itself.
/// </summary>
public const string KindBuiltin = "builtin";
diff --git a/apps/web/src/components/alerts/CriticalErrorPanel.tsx b/apps/web/src/components/alerts/CriticalErrorPanel.tsx
index 0a8f10f69..30eb30b63 100644
--- a/apps/web/src/components/alerts/CriticalErrorPanel.tsx
+++ b/apps/web/src/components/alerts/CriticalErrorPanel.tsx
@@ -4,6 +4,7 @@ import { useTranslation } from 'react-i18next';
import AlertMessageError from '@/components/alerts/AlertMessageError';
import SupportContact from '@/components/alerts/SupportContact';
import Button from '@/components/shared/Button';
+import Icon from '@/components/shared/Icon';
type CriticalErrorPanelProps = {
report?: string | null;
@@ -54,10 +55,7 @@ const CriticalErrorPanel: React.FC<CriticalErrorPanelProps> = ({ report, title,
)}
<div className="mt-2 flex justify-end">
<button type="button" id="copy-error-report" onClick={copyReport} className={`inline-flex items-center gap-1.5 text-sm font-medium hover:underline ${copied ? 'text-green-600 dark:text-green-400' : 'text-primary-700 dark:text-primary-500'}`}>
- <svg className="w-4 h-4" fill="currentColor" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg" aria-hidden="true">
- <path d="M8 3a1 1 0 011-1h2a1 1 0 110 2H9a1 1 0 01-1-1z"></path>
- <path d="M6 3a2 2 0 00-2 2v11a2 2 0 002 2h8a2 2 0 002-2V5a2 2 0 00-2-2 3 3 0 01-3 3H9a3 3 0 01-3-3z"></path>
- </svg>
+ <Icon name="clipboard" className="w-4 h-4" />
{copied ? t('common.copiedShort') : t('app.vaultError.copyErrorDetails')}
</button>
</div>
diff --git a/apps/web/src/components/alerts/MessageInfo.tsx b/apps/web/src/components/alerts/MessageInfo.tsx
index 56a3dbbed..c65e1029b 100644
--- a/apps/web/src/components/alerts/MessageInfo.tsx
+++ b/apps/web/src/components/alerts/MessageInfo.tsx
@@ -1,5 +1,7 @@
import React from 'react';
+import Icon from '@/components/shared/Icon';
+
/**
* Orange info box with a title.
*/
@@ -7,9 +9,7 @@ const MessageInfo: React.FC<{ title?: string; children: React.ReactNode }> = ({
<div className="bg-orange-100 border-l-4 border-orange-500 text-orange-700 p-4 mb-6" role="alert">
<div className="flex">
<div className="py-1">
- <svg className="fill-current h-6 w-6 text-orange-500 mr-4" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20">
- <path d="M2.93 17.07A10 10 0 1 1 17.07 2.93 10 10 0 0 1 2.93 17.07zm12.73-1.41A8 8 0 1 0 4.34 4.34a8 8 0 0 0 11.32 11.32zM9 11V9h2v6H9v-4zm0-6h2v2H9V5z" />
- </svg>
+ <Icon name="information-circle" className="h-6 w-6 text-orange-500 mr-4" />
</div>
<div>
{title && <p className="font-bold">{title}</p>}
diff --git a/apps/web/src/components/attachments/AttachmentViewer.tsx b/apps/web/src/components/attachments/AttachmentViewer.tsx
index 285d797df..a43254ad5 100644
--- a/apps/web/src/components/attachments/AttachmentViewer.tsx
+++ b/apps/web/src/components/attachments/AttachmentViewer.tsx
@@ -3,6 +3,7 @@ import React from 'react';
import { useTranslation } from 'react-i18next';
import Card from '@/components/shared/Card';
+import Icon from '@/components/shared/Icon';
import SectionTitle from '@/components/shared/SectionTitle';
import Text from '@/components/shared/Text';
@@ -31,18 +32,14 @@ const formatSize = (bytes: number): string => {
* Paperclip icon.
*/
const AttachmentIcon: React.FC = () => (
- <svg className="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24" aria-hidden="true">
- <path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M15.172 7l-6.586 6.586a2 2 0 102.828 2.828l6.414-6.586a4 4 0 00-5.656-5.656l-6.415 6.585a6 6 0 108.486 8.486L20.5 13" />
- </svg>
+ <Icon name="paper-clip" className="w-5 h-5" />
);
/**
* Download icon.
*/
const DownloadIcon: React.FC = () => (
- <svg className="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24" aria-hidden="true">
- <path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M4 16v1a3 3 0 003 3h10a3 3 0 003-3v-1m-4-4l-4 4m0 0l-4-4m4 4V4" />
- </svg>
+ <Icon name="download" className="w-5 h-5" />
);
/**
diff --git a/apps/web/src/components/auth/LanguageSwitcher.tsx b/apps/web/src/components/auth/LanguageSwitcher.tsx
index 56d63076e..288507b2b 100644
--- a/apps/web/src/components/auth/LanguageSwitcher.tsx
+++ b/apps/web/src/components/auth/LanguageSwitcher.tsx
@@ -1,6 +1,7 @@
import React from 'react';
import { useTranslation } from 'react-i18next';
+import Icon from '@/components/shared/Icon';
import { AVAILABLE_LANGUAGES } from '@/i18n/config';
import { changeLanguage } from '@/i18n/i18n';
@@ -21,9 +22,7 @@ const LanguageSwitcher: React.FC = () => {
<option key={language.code} value={language.code}>{language.flag} {language.nativeName}</option>
))}
</select>
- <svg className="w-4 h-4 absolute right-2.5 top-1/2 -translate-y-1/2 pointer-events-none text-gray-500 dark:text-gray-400" fill="none" stroke="currentColor" viewBox="0 0 24 24">
- <path strokeLinecap="round" strokeLinejoin="round" strokeWidth="2" d="m19 9-7 7-7-7"></path>
- </svg>
+ <Icon name="chevron-down" className="w-4 h-4 absolute right-2.5 top-1/2 -translate-y-1/2 pointer-events-none text-gray-500 dark:text-gray-400" />
</div>
);
};
diff --git a/apps/web/src/components/auth/PasswordInputField.tsx b/apps/web/src/components/auth/PasswordInputField.tsx
index 48525d489..152d56a6a 100644
--- a/apps/web/src/components/auth/PasswordInputField.tsx
+++ b/apps/web/src/components/auth/PasswordInputField.tsx
@@ -1,5 +1,7 @@
import React, { forwardRef, useState } from 'react';
+import Icon from '@/components/shared/Icon';
+
type PasswordInputFieldProps = {
id: string;
value: string;
@@ -33,14 +35,9 @@ const PasswordInputField = forwardRef<HTMLInputElement, PasswordInputFieldProps>
className="absolute inset-y-0 right-0 flex items-center pr-3 text-gray-500 hover:text-gray-700 dark:text-gray-400 dark:hover:text-gray-200"
aria-label={showPassword ? 'Hide password' : 'Show password'}>
{showPassword ? (
- <svg className="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
- <path strokeLinecap="round" strokeLinejoin="round" strokeWidth="2" d="M13.875 18.825A10.05 10.05 0 0112 19c-4.478 0-8.268-2.943-9.543-7a9.97 9.97 0 011.563-3.029m5.858.908a3 3 0 114.243 4.243M9.878 9.878l4.242 4.242M9.88 9.88l-3.29-3.29m7.532 7.532l3.29 3.29M3 3l3.59 3.59m0 0A9.953 9.953 0 0112 5c4.478 0 8.268 2.943 9.543 7a10.025 10.025 0 01-4.132 5.411m0 0L21 21"></path>
- </svg>
+ <Icon name="eye-off" className="w-5 h-5" />
) : (
- <svg className="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
- <path strokeLinecap="round" strokeLinejoin="round" strokeWidth="2" d="M15 12a3 3 0 11-6 0 3 3 0 016 0z"></path>
- <path strokeLinecap="round" strokeLinejoin="round" strokeWidth="2" d="M2.458 12C3.732 7.943 7.523 5 12 5c4.478 0 8.268 2.943 9.542 7-1.274 4.057-5.064 7-9.542 7-4.477 0-8.268-2.943-9.542-7z"></path>
- </svg>
+ <Icon name="eye" className="w-5 h-5" />
)}
</button>
</div>
diff --git a/apps/web/src/components/email/EmailModal.tsx b/apps/web/src/components/email/EmailModal.tsx
index 64097d2fe..0502ee309 100644
--- a/apps/web/src/components/email/EmailModal.tsx
+++ b/apps/web/src/components/email/EmailModal.tsx
@@ -4,6 +4,7 @@ import { useTranslation } from 'react-i18next';
import { useNavigate } from 'react-router-dom';
import SkeletonBase from '@/components/loading/SkeletonBase';
+import Icon from '@/components/shared/Icon';
import Modal from '@/components/shared/Modal';
import ModalHeaderAction from '@/components/shared/ModalHeaderAction';
import { useConfirmModal } from '@/context/ConfirmModalContext';
@@ -145,15 +146,11 @@ const EmailModal: React.FC<EmailModalProps> = ({ email, onClose, onEmailDeleted,
)}
{email !== null && (
<ModalHeaderAction onClick={() => void showDeleteConfirmation()} title={t('common.delete')} variant="danger">
- <svg className="h-5 w-5" fill="none" viewBox="0 0 24 24" stroke="currentColor">
- <path strokeLinecap="round" strokeLinejoin="round" strokeWidth="2" d="M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16" />
- </svg>
+ <Icon name="trash" className="h-5 w-5" />
</ModalHeaderAction>
)}
<ModalHeaderAction onClick={onClose} title={t('common.close')}>
- <svg className="h-5 w-5" fill="none" viewBox="0 0 24 24" stroke="currentColor">
- <path strokeLinecap="round" strokeLinejoin="round" strokeWidth="2" d="M6 18L18 6M6 6l12 12" />
- </svg>
+ <Icon name="x" className="h-5 w-5" />
</ModalHeaderAction>
</div>
</div>
@@ -218,9 +215,7 @@ const EmailModal: React.FC<EmailModalProps> = ({ email, onClose, onEmailDeleted,
<div className="grid grid-cols-1 sm:grid-cols-2 md:grid-cols-3 gap-4">
{email.attachments.map((attachment) => (
<div key={attachment.index} className="flex items-center space-x-2">
- <svg className="w-4 h-4 text-gray-500 dark:text-gray-400 flex-shrink-0" fill="none" stroke="currentColor" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
- <path strokeLinecap="round" strokeLinejoin="round" strokeWidth="2" d="M15.172 7l-6.586 6.586a2 2 0 102.828 2.828l6.414-6.586a4 4 0 00-5.656-5.656l-6.415 6.585a6 6 0 108.486 8.486L20.5 13"></path>
- </svg>
+ <Icon name="paper-clip" className="w-4 h-4 text-gray-500 dark:text-gray-400 flex-shrink-0" />
<button type="button" onClick={() => void downloadAttachment(attachment)} className="text-primary-600 hover:underline text-sm truncate dark:text-primary-400 attachment-link">
({Math.ceil(attachment.size / 1024)} KB) {attachment.filename}
</button>
diff --git a/apps/web/src/components/email/EmailPreview.tsx b/apps/web/src/components/email/EmailPreview.tsx
index 3c6cd1ccc..c54ecc03a 100644
--- a/apps/web/src/components/email/EmailPreview.tsx
+++ b/apps/web/src/components/email/EmailPreview.tsx
@@ -2,6 +2,7 @@ import { downloadBytes } from '@aliasvault/client/utilities/FileDownload';
import React from 'react';
import { useTranslation } from 'react-i18next';
+import Icon from '@/components/shared/Icon';
import { useConfirmModal } from '@/context/ConfirmModalContext';
import { useDb } from '@/context/DbContext';
import { useNotifications } from '@/context/NotificationContext';
@@ -95,9 +96,7 @@ const EmailPreview: React.FC<EmailPreviewProps> = ({ email, onEmailDeleted, item
</button>
)}
<button type="button" onClick={() => void showDeleteConfirmation()} id="delete-email" className="text-red-500 hover:text-red-700 dark:text-red-400 dark:hover:text-red-300">
- <svg className="h-5 w-5" fill="none" viewBox="0 0 24 24" stroke="currentColor">
- <path strokeLinecap="round" strokeLinejoin="round" strokeWidth="2" d="M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16" />
- </svg>
+ <Icon name="trash" className="h-5 w-5" />
</button>
</div>
</div>
@@ -133,9 +132,7 @@ const EmailPreview: React.FC<EmailPreviewProps> = ({ email, onEmailDeleted, item
<div className="grid grid-cols-1 gap-2 max-h-32 overflow-y-auto">
{email.attachments.map((attachment) => (
<div key={attachment.index} className="flex items-center space-x-2">
- <svg className="w-4 h-4 text-gray-500 dark:text-gray-400 flex-shrink-0" fill="none" stroke="currentColor" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
- <path strokeLinecap="round" strokeLinejoin="round" strokeWidth="2" d="M15.172 7l-6.586 6.586a2 2 0 102.828 2.828l6.414-6.586a4 4 0 00-5.656-5.656l-6.415 6.585a6 6 0 108.486 8.486L20.5 13"></path>
- </svg>
+ <Icon name="paper-clip" className="w-4 h-4 text-gray-500 dark:text-gray-400 flex-shrink-0" />
<button type="button" onClick={() => void downloadAttachment(attachment)} className="text-primary-600 hover:underline text-sm truncate dark:text-primary-400 attachment-link">
({Math.ceil(attachment.size / 1024)} KB) {attachment.filename}
</button>
@@ -149,9 +146,7 @@ const EmailPreview: React.FC<EmailPreviewProps> = ({ email, onEmailDeleted, item
) : (
<div className="flex bg-gray-50 dark:bg-gray-700 items-center justify-center h-full text-gray-500 dark:text-gray-400">
<div className="text-center">
- <svg className="mx-auto h-12 w-12 text-gray-300 dark:text-gray-600" fill="none" viewBox="0 0 24 24" stroke="currentColor">
- <path strokeLinecap="round" strokeLinejoin="round" strokeWidth="2" d="M3 8l7.89 4.26a2 2 0 002.22 0L21 8M5 19h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v10a2 2 0 002 2z" />
- </svg>
+ <Icon name="mail" className="mx-auto h-12 w-12 text-gray-300 dark:text-gray-600" />
<p className="mt-2 text-sm">{t('emails.preview.selectEmailMessage')}</p>
</div>
</div>
diff --git a/apps/web/src/components/email/EmailRow.tsx b/apps/web/src/components/email/EmailRow.tsx
index 45baa4558..ed428b59a 100644
--- a/apps/web/src/components/email/EmailRow.tsx
+++ b/apps/web/src/components/email/EmailRow.tsx
@@ -2,6 +2,7 @@ import React from 'react';
import { useTranslation } from 'react-i18next';
import SenderInitials from '@/components/email/SenderInitials';
+import Icon from '@/components/shared/Icon';
import type { ItemRef } from '@aliasvault/client/database/ItemRef';
@@ -60,9 +61,7 @@ const EmailRowComponent: React.FC<EmailRowProps> = ({ email, onEmailClick, onEma
<div className="text-gray-800 dark:text-gray-200 font-medium truncate mb-1 flex items-center">
{email.fromName}
{email.hasAttachments && (
- <svg className="attachment-indicator w-3 h-3 ml-1 text-gray-500 dark:text-gray-400 flex-shrink-0" fill="none" stroke="currentColor" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
- <path strokeLinecap="round" strokeLinejoin="round" strokeWidth="2" d="M15.172 7l-6.586 6.586a2 2 0 102.828 2.828l6.414-6.586a4 4 0 00-5.656-5.656l-6.415 6.585a6 6 0 108.486 8.486L20.5 13"></path>
- </svg>
+ <Icon name="paper-clip" className="attachment-indicator w-3 h-3 ml-1 text-gray-500 dark:text-gray-400 flex-shrink-0" />
)}
{isNewEmail && (
<div className="w-2 h-2 ml-1 bg-yellow-500 rounded-full animate-pulse flex-shrink-0" title={t('emails.row.newEmailTooltip')}></div>
diff --git a/apps/web/src/components/email/RecentEmails.tsx b/apps/web/src/components/email/RecentEmails.tsx
index 8e85edfa5..dc93563bf 100644
--- a/apps/web/src/components/email/RecentEmails.tsx
+++ b/apps/web/src/components/email/RecentEmails.tsx
@@ -7,6 +7,7 @@ import AlertMessageError from '@/components/alerts/AlertMessageError';
import EmailModal from '@/components/email/EmailModal';
import SkeletonBase from '@/components/loading/SkeletonBase';
import Card from '@/components/shared/Card';
+import Icon from '@/components/shared/Icon';
import SectionTitle from '@/components/shared/SectionTitle';
import { useDb } from '@/context/DbContext';
import { useWebApi } from '@/context/WebApiContext';
@@ -209,9 +210,7 @@ const RecentEmails: React.FC<RecentEmailsProps> = ({ emailAddress }) => {
<div className="w-3 h-3 mr-2 rounded-full bg-primary-300 border-2 border-primary-100 animate-pulse" title={t('emails.home.autoRefreshEnabledTooltip')}></div>
)}
<button id="recent-email-refresh" onClick={() => void manualRefresh()} type="button" className="text-gray-500 border border-gray-300 hover:bg-gray-100 hover:text-gray-700 focus:ring-4 focus:outline-none focus:ring-gray-200 font-medium rounded-full text-sm p-2 text-center inline-flex items-center dark:border-gray-600 dark:text-gray-400 dark:hover:bg-gray-700 dark:hover:text-gray-200 dark:focus:ring-gray-700">
- <svg className="w-4 h-4" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" strokeWidth="2.5" stroke="currentColor">
- <path strokeLinecap="round" strokeLinejoin="round" d="M16.023 9.348h4.992v-.001M2.985 19.644v-4.992m0 0h4.992m-4.993 0l3.181 3.183a8.25 8.25 0 0013.803-3.7M4.031 9.865a8.25 8.25 0 0113.803-3.7l3.181 3.182m0-4.991v4.99" />
- </svg>
+ <Icon name="refresh" className="w-4 h-4" strokeWidth={2.5} />
</button>
</div>
</div>
@@ -271,9 +270,7 @@ const RecentEmails: React.FC<RecentEmailsProps> = ({ emailAddress }) => {
{canLoadMore && (
<button onClick={() => setDisplayedCount(c => c + EMAILS_PER_LOAD)} type="button" className="w-full mt-3 py-1 px-3 bg-gray-50 dark:bg-gray-800 hover:bg-gray-100 dark:hover:bg-gray-700 border border-gray-200 dark:border-gray-600 rounded-md transition-colors duration-200 text-sm text-gray-600 dark:text-gray-300 hover:text-gray-800 dark:hover:text-gray-100 flex items-center justify-center gap-1">
<span>{t('common.loadMore')}</span>
- <svg className="w-3 h-3" fill="none" stroke="currentColor" viewBox="0 0 24 24">
- <path strokeLinecap="round" strokeLinejoin="round" strokeWidth="2" d="M19 9l-7 7-7-7" />
- </svg>
+ <Icon name="chevron-down" className="w-3 h-3" />
</button>
)}
</div>
diff --git a/apps/web/src/components/folders/DeleteFolderModal.tsx b/apps/web/src/components/folders/DeleteFolderModal.tsx
index 1493cfe04..358a9e999 100644
--- a/apps/web/src/components/folders/DeleteFolderModal.tsx
+++ b/apps/web/src/components/folders/DeleteFolderModal.tsx
@@ -2,6 +2,7 @@ import React, { useState } from 'react';
import { useTranslation } from 'react-i18next';
import FormModal from '@/components/shared/FormModal';
+import Icon from '@/components/shared/Icon';
type DeleteFolderModalProps = {
isOpen: boolean;
@@ -40,9 +41,7 @@ const DeleteFolderModal: React.FC<DeleteFolderModalProps> = ({ isOpen, folderNam
showDefaultFooter={false}
onClose={onClose}
icon={(
- <svg className="h-6 w-6 text-red-600 dark:text-red-400" fill="none" viewBox="0 0 24 24" strokeWidth="1.5" stroke="currentColor">
- <path strokeLinecap="round" strokeLinejoin="round" d="M12 9v3.75m-9.303 3.376c-.866 1.5.217 3.374 1.948 3.374h14.71c1.73 0 2.813-1.874 1.948-3.374L13.949 3.378c-.866-1.5-3.032-1.5-3.898 0L2.697 16.126zM12 15.75h.007v.008H12v-.008z" />
- </svg>
+ <Icon name="exclamation" className="h-6 w-6 text-red-600 dark:text-red-400" />
)}
footerContent={(
<div className="w-full space-y-2">
@@ -52,9 +51,7 @@ const DeleteFolderModal: React.FC<DeleteFolderModalProps> = ({ isOpen, folderNam
disabled={isDeleting}
className="w-full flex items-center gap-3 p-3 rounded-lg border border-orange-200 bg-orange-50 hover:bg-orange-100 dark:border-orange-800 dark:bg-orange-900/20 dark:hover:bg-orange-900/30 transition-colors disabled:opacity-50 disabled:cursor-not-allowed">
<div className="flex-shrink-0 w-10 h-10 flex items-center justify-center rounded-full bg-orange-100 dark:bg-orange-900/40">
- <svg className="w-5 h-5 text-orange-600 dark:text-orange-400" viewBox="0 0 24 24" fill="currentColor">
- <path d="M10 4H4a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-8l-2-2z" />
- </svg>
+ <Icon name="folder-filled" className="w-5 h-5 text-orange-600 dark:text-orange-400" />
</div>
<div className="flex-1 text-left">
<div className="font-medium text-orange-700 dark:text-orange-300">{t('items.folders.deleteFolderKeepItems')}</div>
@@ -69,10 +66,7 @@ const DeleteFolderModal: React.FC<DeleteFolderModalProps> = ({ isOpen, folderNam
disabled={isDeleting}
className="w-full flex items-center gap-3 p-3 rounded-lg border border-red-200 bg-red-50 hover:bg-red-100 dark:border-red-800 dark:bg-red-900/20 dark:hover:bg-red-900/30 transition-colors disabled:opacity-50 disabled:cursor-not-allowed">
<div className="flex-shrink-0 w-10 h-10 flex items-center justify-center rounded-full bg-red-100 dark:bg-red-900/40">
- <svg className="w-5 h-5 text-red-600 dark:text-red-400" fill="none" viewBox="0 0 24 24" stroke="currentColor" strokeWidth="2">
- <polyline points="3 6 5 6 21 6" />
- <path d="M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2" />
- </svg>
+ <Icon name="trash" className="w-5 h-5 text-red-600 dark:text-red-400" />
</div>
<div className="flex-1 text-left">
<div className="font-medium text-red-700 dark:text-red-300">{t('items.folders.deleteModal.deleteFolderAndContentsTitle')}</div>
diff --git a/apps/web/src/components/folders/FolderIcon.tsx b/apps/web/src/components/folders/FolderIcon.tsx
index fc39b2d21..f5a7d6f64 100644
--- a/apps/web/src/components/folders/FolderIcon.tsx
+++ b/apps/web/src/components/folders/FolderIcon.tsx
@@ -1,6 +1,8 @@
import { familySharingText } from '@aliasvault/client/sharing/FamilySharingView';
import React from 'react';
+import Icon from '@/components/shared/Icon';
+
type FolderIconProps = {
isShared?: boolean;
variant?: 'filled' | 'outline';
@@ -14,19 +16,13 @@ type FolderIconProps = {
const FolderIcon: React.FC<FolderIconProps> = ({ isShared = false, variant = 'filled', className = 'w-4 h-4', badgeClassName = 'bg-white dark:bg-gray-800 ring-gray-200 dark:ring-gray-600' }) => (
<span className="relative flex-shrink-0">
{variant === 'filled' ? (
- <svg className={className} viewBox="0 0 24 24" fill="currentColor">
- <path d="M10 4H4a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-8l-2-2z" />
- </svg>
+ <Icon name="folder-filled" className={className} />
) : (
- <svg className={className} viewBox="0 0 24 24" fill="none" stroke="currentColor">
- <path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M3 7v10a2 2 0 002 2h14a2 2 0 002-2V9a2 2 0 00-2-2h-6l-2-2H5a2 2 0 00-2 2z" />
- </svg>
+ <Icon name="folder" className={className} />
)}
{isShared && (
<span title={familySharingText.sharedVault} className={`absolute -bottom-1 -right-1 flex items-center justify-center w-2.5 h-2.5 rounded-full ring-1 ${badgeClassName}`}>
- <svg className="w-2 h-2 text-primary-500 dark:text-primary-400" viewBox="0 0 24 24" fill="currentColor">
- <path d="M4.5 6.375a4.125 4.125 0 118.25 0 4.125 4.125 0 01-8.25 0zM14.25 8.625a3.375 3.375 0 116.75 0 3.375 3.375 0 01-6.75 0zM1.5 19.125a7.125 7.125 0 0114.25 0v.003l-.001.119a.75.75 0 01-.363.63 13.067 13.067 0 01-6.761 1.873c-2.472 0-4.786-.684-6.76-1.873a.75.75 0 01-.364-.63l-.001-.122zM17.25 19.128l-.001.144a2.25 2.25 0 01-.233.96 10.088 10.088 0 005.06-1.01.75.75 0 00.42-.643 4.875 4.875 0 00-6.957-4.611 8.586 8.586 0 011.71 5.157v.003z" />
- </svg>
+ <Icon name="users" className="w-2 h-2 text-primary-500 dark:text-primary-400" />
</span>
)}
</span>
diff --git a/apps/web/src/components/folders/FolderModal.tsx b/apps/web/src/components/folders/FolderModal.tsx
index 362151266..70e1b01c1 100644
--- a/apps/web/src/components/folders/FolderModal.tsx
+++ b/apps/web/src/components/folders/FolderModal.tsx
@@ -2,6 +2,7 @@ import React, { useEffect, useState } from 'react';
import { useTranslation } from 'react-i18next';
import FormModal from '@/components/shared/FormModal';
+import Icon from '@/components/shared/Icon';
type FolderModalProps = {
isOpen: boolean;
@@ -61,9 +62,7 @@ const FolderModal: React.FC<FolderModalProps> = ({ isOpen, mode, initialName = '
onClose={onClose}
onConfirm={handleSave}
icon={(
- <svg className="h-6 w-6 text-orange-600 dark:text-orange-400" viewBox="0 0 24 24" fill="currentColor">
- <path d="M10 4H4a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-8l-2-2z" />
- </svg>
+ <Icon name="folder-filled" className="h-6 w-6 text-orange-600 dark:text-orange-400" />
)}>
<label htmlFor="folder-name" className="block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1">
{t('items.folders.folderName')}
diff --git a/apps/web/src/components/forms/CopyPasteFormRow.tsx b/apps/web/src/components/forms/CopyPasteFormRow.tsx
index ed742f95b..ce1a165d3 100644
--- a/apps/web/src/components/forms/CopyPasteFormRow.tsx
+++ b/apps/web/src/components/forms/CopyPasteFormRow.tsx
@@ -1,6 +1,7 @@
import React from 'react';
import FormLabel from '@/components/shared/FormLabel';
+import Icon from '@/components/shared/Icon';
import { useClipboardCopy } from '@/hooks/useClipboardCopy';
import type { ItemRef } from '@aliasvault/client/database/ItemRef';
@@ -27,10 +28,7 @@ const CopyPasteFormRow: React.FC<CopyPasteFormRowProps> = ({ id, label = null, v
<input type="text" autoComplete="off" id={id} className={`outline-0 shadow-sm bg-gray-50 border ${copied ? 'border-green-500 border-2' : 'border-gray-300'} text-gray-900 sm:text-sm rounded-lg block w-full p-2.5 pr-10 dark:bg-gray-700 ${copied ? 'dark:border-green-500' : 'dark:border-gray-600'} dark:placeholder-gray-400 dark:text-white`} value={value} onClick={() => void copyToClipboard(value)} readOnly />
{copied && (
<span className="absolute inset-y-0 right-0 flex items-center pr-3 text-green-500 dark:text-green-400">
- <svg className="w-5 h-5" fill="currentColor" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg">
- <path d="M8 3a1 1 0 011-1h2a1 1 0 110 2H9a1 1 0 01-1-1z"></path>
- <path d="M6 3a2 2 0 00-2 2v11a2 2 0 002 2h8a2 2 0 002-2V5a2 2 0 00-2-2 3 3 0 01-3 3H9a3 3 0 01-3-3z"></path>
- </svg>
+ <Icon name="clipboard" className="w-5 h-5" />
</span>
)}
</div>
diff --git a/apps/web/src/components/forms/CopyPastePasswordFormRow.tsx b/apps/web/src/components/forms/CopyPastePasswordFormRow.tsx
index 6c730d715..773531791 100644
--- a/apps/web/src/components/forms/CopyPastePasswordFormRow.tsx
+++ b/apps/web/src/components/forms/CopyPastePasswordFormRow.tsx
@@ -1,6 +1,7 @@
import React, { useState } from 'react';
import FormLabel from '@/components/shared/FormLabel';
+import Icon from '@/components/shared/Icon';
import { useClipboardCopy } from '@/hooks/useClipboardCopy';
import type { ItemRef } from '@aliasvault/client/database/ItemRef';
@@ -30,23 +31,11 @@ const CopyPastePasswordFormRow: React.FC<CopyPastePasswordFormRowProps> = ({ id,
<input type="password" id={id} className={`outline-0 shadow-sm bg-gray-50 border ${borderClasses} text-gray-900 sm:text-sm rounded-lg block w-full p-2.5 pr-20 dark:bg-gray-700 dark:placeholder-gray-400 dark:text-white`} value={value} onClick={() => void copyToClipboard(value)} readOnly />
)}
<button type="button" className="absolute inset-y-1 right-1 flex items-center justify-center w-10 h-8 text-gray-500 bg-gray-200 rounded-md shadow-sm hover:bg-gray-300 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-primary-500 transition-colors duration-200 dark:bg-gray-600 dark:hover:bg-gray-500 dark:text-gray-300" onClick={() => setIsPasswordVisible(v => !v)}>
- <svg className="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
- {isPasswordVisible ? (
- <>
- <path strokeLinecap="round" strokeLinejoin="round" strokeWidth="2" d="M15 12a3 3 0 11-6 0 3 3 0 016 0z"></path>
- <path strokeLinecap="round" strokeLinejoin="round" strokeWidth="2" d="M2.458 12C3.732 7.943 7.523 5 12 5c4.478 0 8.268 2.943 9.542 7-1.274 4.057-5.064 7-9.542 7-4.477 0-8.268-2.943-9.542-7z"></path>
- </>
- ) : (
- <path strokeLinecap="round" strokeLinejoin="round" strokeWidth="2" d="M13.875 18.825A10.05 10.05 0 0112 19c-4.478 0-8.268-2.943-9.543-7a9.97 9.97 0 011.563-3.029m5.858.908a3 3 0 114.243 4.243M9.878 9.878l4.242 4.242M9.88 9.88l-3.29-3.29m7.532 7.532l3.29 3.29M3 3l3.59 3.59m0 0A9.953 9.953 0 0112 5c4.478 0 8.268 2.943 9.543 7a10.025 10.025 0 01-4.132 5.411m0 0L21 21"></path>
- )}
- </svg>
+ <Icon name={isPasswordVisible ? 'eye' : 'eye-off'} className="w-5 h-5" />
</button>
{copied && (
<span className="absolute top-1 h-8 right-10 flex items-center pr-3 text-green-500 dark:text-green-400">
- <svg className="w-5 h-5" fill="currentColor" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg">
- <path d="M8 3a1 1 0 011-1h2a1 1 0 110 2H9a1 1 0 01-1-1z"></path>
- <path d="M6 3a2 2 0 00-2 2v11a2 2 0 002 2h8a2 2 0 002-2V5a2 2 0 00-2-2 3 3 0 01-3 3H9a3 3 0 01-3-3z"></path>
- </svg>
+ <Icon name="clipboard" className="w-5 h-5" />
</span>
)}
</div>
diff --git a/apps/web/src/components/forms/CustomFieldLabel.tsx b/apps/web/src/components/forms/CustomFieldLabel.tsx
index 29bdb036b..07c4304e0 100644
--- a/apps/web/src/components/forms/CustomFieldLabel.tsx
+++ b/apps/web/src/components/forms/CustomFieldLabel.tsx
@@ -1,6 +1,8 @@
import React from 'react';
import { useTranslation } from 'react-i18next';
+import Icon from '@/components/shared/Icon';
+
type CustomFieldLabelProps = {
htmlFor: string;
label: string;
@@ -18,15 +20,11 @@ const CustomFieldLabel: React.FC<CustomFieldLabelProps> = ({ htmlFor, label, onE
<div className="flex items-center gap-2 mb-2">
<label htmlFor={htmlFor} className="text-sm font-medium text-gray-900 dark:text-white">{label}</label>
<button type="button" onClick={onEdit} className="text-gray-400 hover:text-gray-600 dark:hover:text-gray-300 text-xs" title={t('items.editableFieldLabel.editLabel')}>
- <svg className="w-3 h-3" fill="none" stroke="currentColor" viewBox="0 0 24 24">
- <path strokeLinecap="round" strokeLinejoin="round" strokeWidth="2" d="M15.232 5.232l3.536 3.536m-2.036-5.036a2.5 2.5 0 113.536 3.536L6.5 21.036H3v-3.572L16.732 3.732z" />
- </svg>
+ <Icon name="pencil" className="w-3 h-3" />
</button>
{onDelete && (
<button type="button" onClick={onDelete} className="text-red-600 dark:text-red-400 hover:text-red-700 dark:hover:text-red-300 text-xs" title={t('items.editableFieldLabel.deleteField')}>
- <svg className="w-3 h-3" fill="none" stroke="currentColor" viewBox="0 0 24 24">
- <path strokeLinecap="round" strokeLinejoin="round" strokeWidth="2" d="M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16" />
- </svg>
+ <Icon name="trash" className="w-3 h-3" />
</button>
)}
</div>
diff --git a/apps/web/src/components/forms/CustomFieldModal.tsx b/apps/web/src/components/forms/CustomFieldModal.tsx
index a17e54361..837db4950 100644
--- a/apps/web/src/components/forms/CustomFieldModal.tsx
+++ b/apps/web/src/components/forms/CustomFieldModal.tsx
@@ -3,6 +3,7 @@ import React, { useEffect, useRef, useState } from 'react';
import { useTranslation } from 'react-i18next';
import FormModal from '@/components/shared/FormModal';
+import Icon from '@/components/shared/Icon';
type CustomFieldModalProps = {
isOpen: boolean;
@@ -70,9 +71,7 @@ const CustomFieldModal: React.FC<CustomFieldModalProps> = ({ isOpen, isEditMode
onClose={onClose}
onConfirm={handleConfirm}
icon={(
- <svg className="h-6 w-6 text-primary-600 dark:text-primary-400" fill="none" stroke="currentColor" viewBox="0 0 24 24">
- <path strokeLinecap="round" strokeLinejoin="round" strokeWidth="2" d="M12 6v6m0 0v6m0-6h6m-6 0H6" />
- </svg>
+ <Icon name="plus-sm" className="h-6 w-6 text-primary-600 dark:text-primary-400" />
)}
>
<div className="space-y-4">
diff --git a/apps/web/src/components/forms/DraggableCustomFieldsList.tsx b/apps/web/src/components/forms/DraggableCustomFieldsList.tsx
index 8a1cef21c..d9131a2d3 100644
--- a/apps/web/src/components/forms/DraggableCustomFieldsList.tsx
+++ b/apps/web/src/components/forms/DraggableCustomFieldsList.tsx
@@ -5,6 +5,7 @@ import CustomFieldLabel from '@/components/forms/CustomFieldLabel';
import CustomFieldModal from '@/components/forms/CustomFieldModal';
import EditPasswordFormRow from '@/components/forms/EditPasswordFormRow';
import FormInput from '@/components/forms/FormInput';
+import Icon from '@/components/shared/Icon';
import type { FieldEdit } from '@/models/ItemEdit';
type DraggableCustomFieldsListProps = {
@@ -111,9 +112,7 @@ const DraggableCustomFieldsList: React.FC<DraggableCustomFieldsListProps> = ({ c
<div data-drag-item={field.FieldKey} style={isDragged ? DRAGGED_STYLE : undefined} className="relative bg-white dark:bg-gray-800 rounded-lg group">
<div className="relative cursor-grab active:cursor-grabbing" draggable onDragStart={e => handleDragStart(e, field, slotIndex)} onDragEnd={endDrag}>
<CustomFieldLabel htmlFor={inputId} label={field.Label} onEdit={() => setEditingField(field)} onDelete={() => onDelete(field.FieldKey)} />
- <svg className="absolute right-0 top-0 w-4 h-4 text-gray-400 opacity-0 group-hover:opacity-100 transition-opacity" fill="currentColor" viewBox="0 0 20 20" aria-hidden="true">
- <path d="M7 4a1.5 1.5 0 11-3 0 1.5 1.5 0 013 0zm0 6a1.5 1.5 0 11-3 0 1.5 1.5 0 013 0zm-1.5 7.5a1.5 1.5 0 100-3 1.5 1.5 0 000 3zM16 4a1.5 1.5 0 11-3 0 1.5 1.5 0 013 0zm-1.5 7.5a1.5 1.5 0 100-3 1.5 1.5 0 000 3zM16 16a1.5 1.5 0 11-3 0 1.5 1.5 0 013 0z" />
- </svg>
+ <Icon name="grip-vertical" className="absolute right-0 top-0 w-4 h-4 text-gray-400 opacity-0 group-hover:opacity-100 transition-opacity" />
</div>
{field.FieldType === FieldTypes.TextArea ? (
diff --git a/apps/web/src/components/forms/EditPasswordFormRow.tsx b/apps/web/src/components/forms/EditPasswordFormRow.tsx
index e3a1b7c2a..6a51e451c 100644
--- a/apps/web/src/components/forms/EditPasswordFormRow.tsx
+++ b/apps/web/src/components/forms/EditPasswordFormRow.tsx
@@ -7,6 +7,7 @@ import { useTranslation } from 'react-i18next';
import FormInput from '@/components/forms/FormInput';
import PasswordSettingsPopup from '@/components/settings/PasswordSettingsPopup';
import FormLabel from '@/components/shared/FormLabel';
+import Icon from '@/components/shared/Icon';
import { useDb } from '@/context/DbContext';
import type { PasswordSettings } from '@aliasvault/models/vault';
@@ -78,29 +79,15 @@ const EditPasswordFormRow: React.FC<EditPasswordFormRowProps> = ({ id, label, va
</div>
<div className="flex">
<button type="button" className={visibilityButtonClasses} onClick={() => setIsVisible(v => !v)}>
- <svg className="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
- {isVisible ? (
- <>
- <path strokeLinecap="round" strokeLinejoin="round" strokeWidth="2" d="M15 12a3 3 0 11-6 0 3 3 0 016 0z"></path>
- <path strokeLinecap="round" strokeLinejoin="round" strokeWidth="2" d="M2.458 12C3.732 7.943 7.523 5 12 5c4.478 0 8.268 2.943 9.542 7-1.274 4.057-5.064 7-9.542 7-4.477 0-8.268-2.943-9.542-7z"></path>
- </>
- ) : (
- <path strokeLinecap="round" strokeLinejoin="round" strokeWidth="2" d="M13.875 18.825A10.05 10.05 0 0112 19c-4.478 0-8.268-2.943-9.543-7a9.97 9.97 0 011.563-3.029m5.858.908a3 3 0 114.243 4.243M9.878 9.878l4.242 4.242M9.88 9.88l-3.29-3.29m7.532 7.532l3.29 3.29M3 3l3.59 3.59m0 0A9.953 9.953 0 0112 5c4.478 0 8.268 2.943 9.543 7a10.025 10.025 0 01-4.132 5.411m0 0L21 21"></path>
- )}
- </svg>
+ <Icon name={isVisible ? 'eye' : 'eye-off'} className="w-5 h-5" />
</button>
{showGenerateButtons && (
<>
<button type="button" id={`${id}-generator-settings`} className="px-3 text-gray-500 dark:text-white bg-gray-200 hover:bg-gray-300 focus:ring-4 focus:outline-none focus:ring-gray-300 font-medium text-sm border-l border-gray-300 dark:border-gray-700 dark:bg-gray-600 dark:hover:bg-gray-700 dark:focus:ring-gray-800" onClick={() => setIsSettingsVisible(true)}>
- <svg className="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
- <path strokeLinecap="round" strokeLinejoin="round" strokeWidth="2" d="M10.325 4.317c.426-1.756 2.924-1.756 3.35 0a1.724 1.724 0 002.573 1.066c1.543-.94 3.31.826 2.37 2.37a1.724 1.724 0 001.065 2.572c1.756.426 1.756 2.924 0 3.35a1.724 1.724 0 00-1.066 2.573c.94 1.543-.826 3.31-2.37 2.37a1.724 1.724 0 00-2.572 1.065c-.426 1.756-2.924 1.756-3.35 0a1.724 1.724 0 00-2.573-1.066c-1.543.94-3.31-.826-2.37-2.37a1.724 1.724 0 00-1.065-2.572c-1.756-.426-1.756-2.924 0-3.35a1.724 1.724 0 001.066-2.573c-.94-1.543.826-3.31 2.37-2.37.996.608 2.296.07 2.572-1.065z"></path>
- <path strokeLinecap="round" strokeLinejoin="round" strokeWidth="2" d="M15 12a3 3 0 11-6 0 3 3 0 016 0z"></path>
- </svg>
+ <Icon name="cog" className="w-5 h-5" />
</button>
<button type="button" className="px-3 text-gray-500 dark:text-white bg-gray-200 hover:bg-gray-300 focus:ring-4 focus:outline-none focus:ring-gray-300 font-medium rounded-r-lg text-sm border-l border-gray-300 dark:border-gray-700 dark:bg-gray-600 dark:hover:bg-gray-700 dark:focus:ring-gray-800" onClick={() => settings && void regenerate(settings)}>
- <svg className="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
- <path strokeLinecap="round" strokeLinejoin="round" strokeWidth="2" d="M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15"></path>
- </svg>
+ <Icon name="refresh" className="w-5 h-5" />
</button>
</>
)}
diff --git a/apps/web/src/components/forms/EditUsernameFormRow.tsx b/apps/web/src/components/forms/EditUsernameFormRow.tsx
index 9e2dd3db2..1b8239a2b 100644
--- a/apps/web/src/components/forms/EditUsernameFormRow.tsx
+++ b/apps/web/src/components/forms/EditUsernameFormRow.tsx
@@ -2,6 +2,7 @@ import React from 'react';
import FormInput from '@/components/forms/FormInput';
import FormLabel from '@/components/shared/FormLabel';
+import Icon from '@/components/shared/Icon';
type EditUsernameFormRowProps = {
id: string;
@@ -23,9 +24,7 @@ const EditUsernameFormRow: React.FC<EditUsernameFormRowProps> = ({ id, label, va
<FormInput id={id} attached="right" trailingSpace="none" value={value} onValueChange={onChange} placeholder={placeholder} />
</div>
<button type="button" id="generate-username-button" className="px-3 text-gray-500 bg-gray-200 hover:bg-gray-300 focus:ring-4 focus:outline-none focus:ring-gray-300 font-medium rounded-r-lg text-sm dark:text-white dark:bg-gray-600 dark:hover:bg-gray-700 dark:focus:ring-gray-800" onClick={onGenerateNewUsername}>
- <svg className="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
- <path strokeLinecap="round" strokeLinejoin="round" strokeWidth="2" d="M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15"></path>
- </svg>
+ <Icon name="refresh" className="w-5 h-5" />
</button>
</div>
</>
diff --git a/apps/web/src/components/forms/EmailDomainField.tsx b/apps/web/src/components/forms/EmailDomainField.tsx
index efc9f971c..4fc41ba69 100644
--- a/apps/web/src/components/forms/EmailDomainField.tsx
+++ b/apps/web/src/components/forms/EmailDomainField.tsx
@@ -1,6 +1,7 @@
import React, { useEffect, useRef, useState } from 'react';
import { useTranslation } from 'react-i18next';
+import Icon from '@/components/shared/Icon';
import ToggleChip from '@/components/shared/ToggleChip';
import { getAppConfig } from '@/config/AppConfig';
import { useDb } from '@/context/DbContext';
@@ -184,10 +185,7 @@ const EmailDomainField: React.FC<EmailDomainFieldProps> = ({ id, value, onChange
</div>
{onRemove && (
<button type="button" onClick={onRemove} className="w-5 h-5 flex items-center justify-center text-gray-300 hover:text-red-400 dark:text-gray-500 dark:hover:text-red-400 transition-colors" title={t('common.delete')}>
- <svg className="w-4 h-4" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round">
- <line x1="18" y1="6" x2="6" y2="18" />
- <line x1="6" y1="6" x2="18" y2="18" />
- </svg>
+ <Icon name="x" className="w-4 h-4" />
</button>
)}
</div>
@@ -203,9 +201,7 @@ const EmailDomainField: React.FC<EmailDomainFieldProps> = ({ id, value, onChange
)}
{!isCustomDomain && onGenerateAlias && (
<button type="button" onClick={handleRegenerate} className="px-3 text-gray-500 dark:text-white bg-gray-200 hover:bg-gray-300 focus:ring-4 focus:outline-none focus:ring-gray-300 font-medium rounded-r-lg text-sm border-l border-gray-300 dark:border-gray-700 dark:bg-gray-600 dark:hover:bg-gray-700 dark:focus:ring-gray-800" title={t('common.generate')}>
- <svg className="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24">
- <path strokeLinecap="round" strokeLinejoin="round" strokeWidth="2" d="M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15" />
- </svg>
+ <Icon name="refresh" className="w-5 h-5" />
</button>
)}
</div>
diff --git a/apps/web/src/components/forms/MultiValueFormRow.tsx b/apps/web/src/components/forms/MultiValueFormRow.tsx
index de0440cae..f918e1e7f 100644
--- a/apps/web/src/components/forms/MultiValueFormRow.tsx
+++ b/apps/web/src/components/forms/MultiValueFormRow.tsx
@@ -2,6 +2,7 @@ import React from 'react';
import FormInput from '@/components/forms/FormInput';
import FormLabel from '@/components/shared/FormLabel';
+import Icon from '@/components/shared/Icon';
type MultiValueFormRowProps = {
id: string;
@@ -27,9 +28,7 @@ const MultiValueFormRow: React.FC<MultiValueFormRowProps> = ({ id, label, values
<FormInput id={`${id}-${index}`} value={value} onValueChange={next => onChange(shown.map((v, i) => i === index ? next : v))} onFocus={e => onFocus?.(index, e)} placeholder={placeholder} />
{index === shown.length - 1 && (
<button type="button" id={`add-${id}`} onClick={() => onChange([...shown, ''])} className="absolute right-2 top-1/2 -translate-y-1/2 w-6 h-6 flex items-center justify-center text-gray-400 hover:text-primary-500 dark:hover:text-primary-400 transition-colors">
- <svg className="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24">
- <path strokeLinecap="round" strokeLinejoin="round" strokeWidth="2" d="M12 6v6m0 0v6m0-6h6m-6 0H6" />
- </svg>
+ <Icon name="plus-sm" className="w-5 h-5" />
</button>
)}
</div>
diff --git a/apps/web/src/components/forms/RemovableSection.tsx b/apps/web/src/components/forms/RemovableSection.tsx
index 3456875d8..accb67815 100644
--- a/apps/web/src/components/forms/RemovableSection.tsx
+++ b/apps/web/src/components/forms/RemovableSection.tsx
@@ -2,6 +2,7 @@ import React from 'react';
import { useTranslation } from 'react-i18next';
import Card from '@/components/shared/Card';
+import Icon from '@/components/shared/Icon';
import SectionTitle from '@/components/shared/SectionTitle';
type RemovableSectionProps = {
@@ -25,9 +26,7 @@ const RemovableSection: React.FC<RemovableSectionProps> = ({ title = '', canRemo
</div>
{canRemove && (
<button type="button" onClick={onRemove} className="absolute top-3 right-3 text-gray-400 hover:text-red-500 transition-colors" title={t('common.delete')}>
- <svg className="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24">
- <path strokeLinecap="round" strokeLinejoin="round" strokeWidth="2" d="M6 18L18 6M6 6l12 12" />
- </svg>
+ <Icon name="x" className="w-5 h-5" />
</button>
)}
</Card>
diff --git a/apps/web/src/components/items/AddFieldMenu.tsx b/apps/web/src/components/items/AddFieldMenu.tsx
index 98730b0d4..5ee12ee9b 100644
--- a/apps/web/src/components/items/AddFieldMenu.tsx
+++ b/apps/web/src/components/items/AddFieldMenu.tsx
@@ -3,6 +3,7 @@ import React, { useState } from 'react';
import { useTranslation } from 'react-i18next';
import CustomFieldModal from '@/components/forms/CustomFieldModal';
+import Icon from '@/components/shared/Icon';
import MenuItem from '@/components/shared/MenuItem';
type AddFieldMenuProps = {
@@ -25,11 +26,11 @@ type AddFieldMenuProps = {
const FieldIcon: React.FC<{ category: string }> = ({ category }) => {
switch (category) {
case FieldCategories.Notes:
- return <svg className="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path strokeLinecap="round" strokeLinejoin="round" strokeWidth="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /></svg>;
+ return <Icon name="document-text" className="w-5 h-5" />;
case FieldCategories.Card:
- return <svg className="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path strokeLinecap="round" strokeLinejoin="round" strokeWidth="2" d="M3 10h18M7 15h1m4 0h1m-7 4h12a3 3 0 003-3V8a3 3 0 00-3-3H6a3 3 0 00-3 3v8a3 3 0 003 3z" /></svg>;
+ return <Icon name="credit-card" className="w-5 h-5" />;
default:
- return <svg className="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path strokeLinecap="round" strokeLinejoin="round" strokeWidth="2" d="M12 6v6m0 0v6m0-6h6m-6 0H6" /></svg>;
+ return <Icon name="plus-sm" className="w-5 h-5" />;
}
};
@@ -45,9 +46,7 @@ const AddFieldMenu: React.FC<AddFieldMenuProps> = ({ optionalSystemFields, visib
return (
<div className="relative">
<button type="button" onClick={() => setIsOpen(v => !v)} className="w-full px-4 py-2 border-2 border-dashed border-gray-300 dark:border-gray-600 text-gray-600 dark:text-gray-400 rounded-md hover:border-primary-500 hover:text-primary-600 dark:hover:text-primary-400 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-primary-500 transition-colors flex items-center justify-center gap-2">
- <svg className="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24">
- <path strokeLinecap="round" strokeLinejoin="round" strokeWidth="2" d="M12 6v6m0 0v6m0-6h6m-6 0H6" />
- </svg>
+ <Icon name="plus-sm" className="w-5 h-5" />
</button>
{isOpen && (
@@ -62,26 +61,20 @@ const AddFieldMenu: React.FC<AddFieldMenuProps> = ({ optionalSystemFields, visib
))}
{!show2FA && hasLoginFields && (
- <MenuItem size="md" icon={<svg className="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24">
- <path strokeLinecap="round" strokeLinejoin="round" strokeWidth="2" d="M12 15v2m-6 4h12a2 2 0 002-2v-6a2 2 0 00-2-2H6a2 2 0 00-2 2v6a2 2 0 002 2zm10-10V7a4 4 0 00-8 0v4h8z" />
- </svg>} label={t('common.twoFactorAuthentication')} onClick={() => {
+ <MenuItem size="md" icon={<Icon name="lock-closed" className="w-5 h-5" />} label={t('common.twoFactorAuthentication')} onClick={() => {
onAdd2FA();
setIsOpen(false);
}} />
)}
{!showAttachments && (
- <MenuItem size="md" icon={<svg className="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24">
- <path strokeLinecap="round" strokeLinejoin="round" strokeWidth="2" d="M15.172 7l-6.586 6.586a2 2 0 102.828 2.828l6.414-6.586a4 4 0 00-5.656-5.656l-6.415 6.585a6 6 0 108.486 8.486L20.5 13" />
- </svg>} label={t('common.attachments')} onClick={() => {
+ <MenuItem size="md" icon={<Icon name="paper-clip" className="w-5 h-5" />} label={t('common.attachments')} onClick={() => {
onAddAttachments();
setIsOpen(false);
}} />
)}
- <MenuItem size="md" icon={<svg className="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24">
- <path strokeLinecap="round" strokeLinejoin="round" strokeWidth="2" d="M12 6v6m0 0v6m0-6h6m-6 0H6" />
- </svg>} label={t('itemTypes.addCustomField')} onClick={() => {
+ <MenuItem size="md" icon={<Icon name="plus-sm" className="w-5 h-5" />} label={t('itemTypes.addCustomField')} onClick={() => {
setCustomFieldLabel(t('items.addFieldMenu.defaultFieldLabel', { number: customFieldCount + 1 }));
setShowCustomFieldModal(true);
setIsOpen(false);
diff --git a/apps/web/src/components/items/FieldBlock.tsx b/apps/web/src/components/items/FieldBlock.tsx
index 1636ecceb..79555ad67 100644
--- a/apps/web/src/components/items/FieldBlock.tsx
+++ b/apps/web/src/components/items/FieldBlock.tsx
@@ -7,6 +7,7 @@ import CopyPastePasswordFormRow from '@/components/forms/CopyPastePasswordFormRo
import type { DisplayField } from '@/components/items/DisplayField';
import FieldHistoryModal from '@/components/items/FieldHistoryModal';
import FormLabel from '@/components/shared/FormLabel';
+import Icon from '@/components/shared/Icon';
import { useDb } from '@/context/DbContext';
import type { ItemRef } from '@aliasvault/client/database/ItemRef';
@@ -97,9 +98,7 @@ const FieldBlock: React.FC<FieldBlockProps> = ({ field, item, fullWidth = false,
{label}
{field.EnableHistory && historyCount > 0 && (
<button type="button" className="ml-2 inline-flex items-center text-gray-500 hover:text-gray-700 dark:text-gray-400 dark:hover:text-gray-200 focus:outline-none" title={t('items.viewHistory')} onClick={() => setShowHistoryModal(true)}>
- <svg className="h-4 w-4" fill="none" viewBox="0 0 24 24" strokeWidth="1.5" stroke="currentColor">
- <path strokeLinecap="round" strokeLinejoin="round" d="M12 6v6h4.5m4.5 0a9 9 0 1 1-18 0 9 9 0 0 1 18 0Z" />
- </svg>
+ <Icon name="clock" className="h-4 w-4" />
</button>
)}
</FormLabel>
diff --git a/apps/web/src/components/items/FieldHistoryModal.tsx b/apps/web/src/components/items/FieldHistoryModal.tsx
index 00050f9c8..d4c1e2aa0 100644
--- a/apps/web/src/components/items/FieldHistoryModal.tsx
+++ b/apps/web/src/components/items/FieldHistoryModal.tsx
@@ -3,6 +3,7 @@ import { useTranslation } from 'react-i18next';
import CopyPasteFormRow from '@/components/forms/CopyPasteFormRow';
import CopyPastePasswordFormRow from '@/components/forms/CopyPastePasswordFormRow';
+import Icon from '@/components/shared/Icon';
import Modal from '@/components/shared/Modal';
import Text from '@/components/shared/Text';
import { useDb } from '@/context/DbContext';
@@ -90,9 +91,7 @@ const FieldHistoryModal: React.FC<FieldHistoryModalProps> = ({ item, fieldKey, f
{t('items.history')} - {fieldLabel}
</h2>
<button type="button" onClick={onClose} className="text-gray-400 hover:text-gray-500 dark:hover:text-gray-300" title={t('common.close')} aria-label={t('common.close')}>
- <svg className="h-6 w-6" fill="none" viewBox="0 0 24 24" stroke="currentColor">
- <path strokeLinecap="round" strokeLinejoin="round" strokeWidth="2" d="M6 18L18 6M6 6l12 12" />
- </svg>
+ <Icon name="x" className="h-6 w-6" />
</button>
</div>
</div>
@@ -100,10 +99,7 @@ const FieldHistoryModal: React.FC<FieldHistoryModalProps> = ({ item, fieldKey, f
<div className="flex-1 overflow-y-auto p-4">
{isLoading ? (
<div className="flex justify-center items-center py-8">
- <svg className="animate-spin h-8 w-8 text-gray-500" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24">
- <circle className="opacity-25" cx="12" cy="12" r="10" stroke="currentColor" strokeWidth="4"></circle>
- <path className="opacity-75" fill="currentColor" d="M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"></path>
- </svg>
+ <Icon name="spinner" className="animate-spin h-8 w-8 text-gray-500" />
</div>
) : records.length === 0 ? (
<Text variant="muted" className="text-center py-8">{t('items.noHistoryAvailable')}</Text>
@@ -127,9 +123,7 @@ const FieldHistoryModal: React.FC<FieldHistoryModalProps> = ({ item, fieldKey, f
</div>
) : (
<button type="button" onClick={() => setConfirmDeleteId(record.Id)} className="text-gray-500 hover:text-red-600 dark:text-gray-400 dark:hover:text-red-400 transition-colors" title={t('common.delete')}>
- <svg className="h-4 w-4" fill="none" viewBox="0 0 24 24" strokeWidth="1.5" stroke="currentColor">
- <path strokeLinecap="round" strokeLinejoin="round" d="m14.74 9-.346 9m-4.788 0L9.26 9m9.968-3.21c.342.052.682.107 1.022.166m-1.022-.165L18.16 19.673a2.25 2.25 0 0 1-2.244 2.077H8.084a2.25 2.25 0 0 1-2.244-2.077L4.772 5.79m14.456 0a48.108 48.108 0 0 0-3.478-.397m-12 .562c.34-.059.68-.114 1.022-.165m0 0a48.11 48.11 0 0 1 3.478-.397m7.5 0v-.916c0-1.18-.91-2.164-2.09-2.201a51.964 51.964 0 0 0-3.32 0c-1.18.037-2.09 1.022-2.09 2.201v.916m7.5 0a48.667 48.667 0 0 0-7.5 0" />
- </svg>
+ <Icon name="trash" className="h-4 w-4" />
</button>
)}
</div>
diff --git a/apps/web/src/components/items/FolderSelector.tsx b/apps/web/src/components/items/FolderSelector.tsx
index a72b98ed7..41ade515f 100644
--- a/apps/web/src/components/items/FolderSelector.tsx
+++ b/apps/web/src/components/items/FolderSelector.tsx
@@ -5,6 +5,7 @@ import { useTranslation } from 'react-i18next';
import FolderIcon from '@/components/folders/FolderIcon';
import FormModal from '@/components/shared/FormModal';
+import Icon from '@/components/shared/Icon';
import { useDb } from '@/context/DbContext';
import type { Folder, FolderRef } from '@aliasvault/client/database/repositories/FolderRepository';
@@ -105,9 +106,7 @@ const FolderSelector: React.FC<FolderSelectorProps> = ({ selectedFolder, onSelec
const selectedFolderRow = selectedKey ? folders.find(f => folderKey(f) === selectedKey) : undefined;
const checkIcon = (
- <svg className="w-5 h-5 ml-auto flex-shrink-0 text-primary-600 dark:text-primary-400" fill="currentColor" viewBox="0 0 20 20">
- <path fillRule="evenodd" d="M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z" clipRule="evenodd" />
- </svg>
+ <Icon name="check" className="w-5 h-5 ml-auto flex-shrink-0 text-primary-600 dark:text-primary-400" />
);
return (
@@ -123,14 +122,10 @@ const FolderSelector: React.FC<FolderSelectorProps> = ({ selectedFolder, onSelec
{selectedFolder ? (
<FolderIcon isShared={selectedFolderRow !== undefined && isSharedFolder(selectedFolderRow, personalManifestId)} className="w-4 h-4 text-orange-500" badgeClassName="bg-gray-100 dark:bg-gray-700 ring-gray-200 dark:ring-gray-600" />
) : (
- <svg className="w-4 h-4 flex-shrink-0" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2">
- <path strokeLinecap="round" strokeLinejoin="round" d="M3 7v10a2 2 0 002 2h14a2 2 0 002-2V9a2 2 0 00-2-2h-6l-2-2H5a2 2 0 00-2 2z" />
- </svg>
+ <Icon name="folder" className="w-4 h-4 flex-shrink-0" />
)}
<span className="truncate">{selectedFolder ? selectedFolderRow?.Name : t('items.folderSelector.noFolder')}</span>
- <svg className="w-3.5 h-3.5 ml-auto flex-shrink-0 opacity-70" fill="none" viewBox="0 0 24 24" stroke="currentColor" strokeWidth="2">
- <path strokeLinecap="round" strokeLinejoin="round" d="M19 9l-7 7-7-7" />
- </svg>
+ <Icon name="chevron-down" className="w-3.5 h-3.5 ml-auto flex-shrink-0 opacity-70" />
</button>
<FormModal
@@ -140,16 +135,12 @@ const FolderSelector: React.FC<FolderSelectorProps> = ({ selectedFolder, onSelec
maxWidth="sm"
onClose={() => setShowFolderModal(false)}
icon={(
- <svg className="h-6 w-6 text-orange-600 dark:text-orange-400" viewBox="0 0 24 24" fill="currentColor">
- <path d="M10 4H4a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-8l-2-2z" />
- </svg>
+ <Icon name="folder-filled" className="h-6 w-6 text-orange-600 dark:text-orange-400" />
)}
>
<div className="space-y-1 max-h-64 overflow-y-auto -mx-2">
<button type="button" onClick={() => selectFolder(null)} className={`w-full px-3 py-2 text-left rounded-md flex items-center gap-3 transition-colors ${rowClass(null)}`}>
- <svg className={iconClass(null)} fill="none" stroke="currentColor" viewBox="0 0 24 24">
- <path strokeLinecap="round" strokeLinejoin="round" strokeWidth="2" d="M5 8h14M5 8a2 2 0 110-4h14a2 2 0 110 4M5 8v10a2 2 0 002 2h10a2 2 0 002-2V8m-9 4h4" />
- </svg>
+ <Icon name="archive" className={iconClass(null)} />
<span className="font-medium">&mdash;</span>
{!selectedFolder && checkIcon}
</button>
@@ -163,9 +154,7 @@ const FolderSelector: React.FC<FolderSelectorProps> = ({ selectedFolder, onSelec
<div key={key} className={`flex items-center rounded-md transition-colors ${rowClass(key)}`} style={{ paddingLeft: `${node.depth * FOLDER_INDENT_REM + 0.25}rem` }}>
{hasChildren ? (
<button type="button" onClick={() => toggleExpansion(key)} aria-expanded={isExpanded} className="flex-shrink-0 w-7 h-7 flex items-center justify-center rounded text-gray-500 dark:text-gray-400 hover:bg-gray-200 dark:hover:bg-gray-600 transition-colors">
- <svg className={`w-4 h-4 transition-transform ${isExpanded ? 'rotate-90' : ''}`} fill="none" stroke="currentColor" viewBox="0 0 24 24">
- <path strokeLinecap="round" strokeLinejoin="round" strokeWidth="2" d="M9 5l7 7-7 7" />
- </svg>
+ <Icon name="chevron-right" className={`w-4 h-4 transition-transform ${isExpanded ? 'rotate-90' : ''}`} />
</button>
) : (
<span className="flex-shrink-0 w-7" />
diff --git a/apps/web/src/components/items/ItemCard.tsx b/apps/web/src/components/items/ItemCard.tsx
index fc19e02d7..8ea227562 100644
--- a/apps/web/src/components/items/ItemCard.tsx
+++ b/apps/web/src/components/items/ItemCard.tsx
@@ -6,6 +6,7 @@ import { useNavigate } from 'react-router-dom';
import ItemContextMenu, { type ItemContextMenuHandle } from '@/components/items/ItemContextMenu';
import ItemIcon from '@/components/items/ItemIcon';
import type { ItemListEntry } from '@/components/items/ItemListEntry';
+import Icon from '@/components/shared/Icon';
import { itemRoute } from '@/utils/ItemRoute';
type ItemCardProps = {
@@ -54,19 +55,13 @@ const ItemCard: React.FC<ItemCardProps> = ({ entry, onMutated }) => {
<div className="flex items-center justify-start md:justify-center gap-1.5 w-full">
<div className="text-gray-900 dark:text-gray-100 break-words truncate md:max-w-[150px]" title={serviceName}>{serviceName}</div>
{entry.hasTotp && (
- <svg className="w-3.5 h-3.5 text-gray-500 dark:text-gray-400 flex-shrink-0" viewBox="0 -960 960 960" fill="currentColor" aria-label={t('items.hasTotp')}>
- <path d="M160-160q-33 0-56.5-23.5T80-240v-480q0-33 23.5-56.5T160-800h640q33 0 56.5 23.5T880-720v480q0 33-23.5 56.5T800-160H160Zm100-200h46v-240h-36l-70 50 24 36 36-26v180Zm124 0h156v-40h-94l-2-2q21-20 34.5-34t21.5-22q18-18 27-36t9-38q0-29-22-48.5T458-600q-26 0-47 15t-29 39l40 16q5-13 14.5-20.5T458-558q15 0 24.5 8t9.5 20q0 11-4 20.5T470-486l-32 32-54 54v40Zm296 0q36 0 58-20t22-52q0-18-10-32t-28-22v-2q14-8 22-20.5t8-29.5q0-27-21-44.5T678-600q-25 0-46.5 14.5T604-550l40 16q4-12 13-19t21-7q13 0 21.5 7.5T708-534q0 14-10 22t-26 8h-18v40h20q20 0 31 8t11 22q0 13-11 22.5t-25 9.5q-17 0-26-7.5T638-436l-40 16q7 29 28.5 44.5T680-360ZM160-240h640v-480H160v480Zm0 0v-480 480Z" />
- </svg>
+ <Icon name="pin-material" className="w-3.5 h-3.5 text-gray-500 dark:text-gray-400 flex-shrink-0" aria-label={t('items.hasTotp')} />
)}
{entry.hasPasskey && (
- <svg className="w-3.5 h-3.5 text-gray-500 dark:text-gray-400 flex-shrink-0" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round" aria-label={t('items.hasPasskey')}>
- <path d="M21 2l-2 2m-7.61 7.61a5.5 5.5 0 1 1-7.778 7.778 5.5 5.5 0 0 1 7.777-7.777zm0 0L15.5 7.5m0 0l3 3L22 7l-3-3m-3.5 3.5L19 4" />
- </svg>
+ <Icon name="key" className="w-3.5 h-3.5 text-gray-500 dark:text-gray-400 flex-shrink-0" aria-label={t('items.hasPasskey')} />
)}
{entry.hasAttachment && (
- <svg className="w-3.5 h-3.5 text-gray-500 dark:text-gray-400 flex-shrink-0" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round" aria-label={t('items.hasAttachments')}>
- <path d="M21.44 11.05l-9.19 9.19a6 6 0 0 1-8.49-8.49l9.19-9.19a4 4 0 0 1 5.66 5.66l-9.2 9.19a2 2 0 0 1-2.83-2.83l8.49-8.48" />
- </svg>
+ <Icon name="paper-clip" className="w-3.5 h-3.5 text-gray-500 dark:text-gray-400 flex-shrink-0" aria-label={t('items.hasAttachments')} />
)}
</div>
<div className="text-gray-500 dark:text-gray-400 break-words w-full text-sm truncate" title={getDisplayText(entry)}>{getDisplayText(entry)}</div>
diff --git a/apps/web/src/components/items/ItemContextMenu.tsx b/apps/web/src/components/items/ItemContextMenu.tsx
index 443fac661..98acc1aea 100644
--- a/apps/web/src/components/items/ItemContextMenu.tsx
+++ b/apps/web/src/components/items/ItemContextMenu.tsx
@@ -4,6 +4,7 @@ import { useTranslation } from 'react-i18next';
import { useNavigate } from 'react-router-dom';
import FormModal from '@/components/shared/FormModal';
+import Icon from '@/components/shared/Icon';
import { useDb } from '@/context/DbContext';
import { useNotifications } from '@/context/NotificationContext';
import { useClickOutside } from '@/hooks/useClickOutside';
@@ -135,11 +136,7 @@ const ItemContextMenu = forwardRef<ItemContextMenuHandle, ItemContextMenuProps>(
aria-label={t('items.contextMenu.title')}
aria-haspopup="menu"
className={`px-0.5 py-1 rounded text-gray-400 transition-opacity ${isOpen ? 'opacity-100' : 'opacity-0'} group-hover:opacity-100 group-focus-within:opacity-100 focus:opacity-100 hover:text-gray-600 dark:hover:text-gray-300 hover:bg-gray-100 dark:hover:bg-gray-600 focus:outline-none focus:ring-2 focus:ring-primary-500`}>
- <svg className="w-2 h-4" viewBox="0 0 12 24" fill="currentColor" aria-hidden="true">
- <circle cx="6" cy="5" r="2" />
- <circle cx="6" cy="12" r="2" />
- <circle cx="6" cy="19" r="2" />
- </svg>
+ <Icon name="dots-vertical-narrow" className="w-2 h-4" />
</button>
{isOpen && (
@@ -169,9 +166,7 @@ const ItemContextMenu = forwardRef<ItemContextMenuHandle, ItemContextMenuProps>(
onConfirm={confirmDelete}
onClose={() => !isDeleting && setShowDeleteModal(false)}
icon={(
- <svg className="h-6 w-6 text-red-600 dark:text-red-400" fill="none" viewBox="0 0 24 24" strokeWidth="1.5" stroke="currentColor">
- <path strokeLinecap="round" strokeLinejoin="round" d="M12 9v3.75m-9.303 3.376c-.866 1.5.217 3.374 1.948 3.374h14.71c1.73 0 2.813-1.874 1.948-3.374L13.949 3.378c-.866-1.5-3.032-1.5-3.898 0L2.697 16.126zM12 15.75h.007v.008H12v-.008z" />
- </svg>
+ <Icon name="exclamation" className="h-6 w-6 text-red-600 dark:text-red-400" />
)}>
<p className="text-sm text-gray-500 dark:text-gray-400 mb-3">
{t('items.delete.deleteItemDescription', { days: TRASH_RETENTION_DEFAULT_DAYS })}
diff --git a/apps/web/src/components/items/ItemFilterDropdown.tsx b/apps/web/src/components/items/ItemFilterDropdown.tsx
index f34fc9fe7..8c7139ea3 100644
--- a/apps/web/src/components/items/ItemFilterDropdown.tsx
+++ b/apps/web/src/components/items/ItemFilterDropdown.tsx
@@ -3,6 +3,7 @@ import React, { useCallback, useRef, useState } from 'react';
import { useTranslation } from 'react-i18next';
import FolderIcon from '@/components/folders/FolderIcon';
+import Icon from '@/components/shared/Icon';
import { useClickOutside } from '@/hooks/useClickOutside';
type ItemFilterDropdownProps = {
@@ -69,9 +70,7 @@ const ItemFilterDropdown: React.FC<ItemFilterDropdownProps> = ({ title, count, t
<span className="text-base text-gray-500 dark:text-gray-400">({count})</span>
)}
</h1>
- <svg className="w-5 h-5" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round">
- <polyline points="6 9 12 15 18 9" />
- </svg>
+ <Icon name="chevron-down" className="w-5 h-5" />
</button>
{titleActions}
@@ -88,37 +87,26 @@ const ItemFilterDropdown: React.FC<ItemFilterDropdownProps> = ({ title, count, t
e.stopPropagation(); setIsOpen(false); onToggleShowFolders();
}} className="flex items-center gap-1.5 text-xs text-gray-500 dark:text-gray-400 hover:text-gray-700 dark:hover:text-gray-300">
<span>{t('items.filters.showFolders')}</span>
- <svg className={`w-5 h-5 ${showFolders ? 'text-orange-500 dark:text-orange-400' : 'text-gray-400 dark:text-gray-500'}`} viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2">
- <rect x="3" y="3" width="18" height="18" rx="2" />
- {showFolders && <polyline points="7 12 10 15 17 8" />}
- </svg>
+ <Icon name={showFolders ? 'square-check' : 'square-feather'} className={`w-5 h-5 ${showFolders ? 'text-orange-500 dark:text-orange-400' : 'text-gray-400 dark:text-gray-500'}`} />
</button>
)}
</div>
<div className="border-t border-gray-200 dark:border-gray-600 my-1"></div>
<button onClick={() => pickFilter(ItemFilter.Login)} className={rowClass(ItemFilter.Login, true)}>
- <svg className={iconClass(ItemFilter.Login)} fill="none" stroke="currentColor" viewBox="0 0 24 24">
- <path strokeLinecap="round" strokeLinejoin="round" strokeWidth="2" d="M15 7a2 2 0 012 2m4 0a6 6 0 01-7.743 5.743L11 17H9v2H7v2H4a1 1 0 01-1-1v-2.586a1 1 0 01.293-.707l5.964-5.964A6 6 0 1121 9z" />
- </svg>
+ <Icon name="key" className={iconClass(ItemFilter.Login)} />
{t('itemTypes.login.title')}
</button>
<button onClick={() => pickFilter(ItemFilter.Alias)} className={rowClass(ItemFilter.Alias, true)}>
- <svg className={iconClass(ItemFilter.Alias)} fill="none" stroke="currentColor" viewBox="0 0 24 24">
- <path strokeLinecap="round" strokeLinejoin="round" strokeWidth="2" d="M16 7a4 4 0 11-8 0 4 4 0 018 0zM12 14a7 7 0 00-7 7h14a7 7 0 00-7-7z" />
- </svg>
+ <Icon name="user" className={iconClass(ItemFilter.Alias)} />
{t('itemTypes.alias.title')}
</button>
<button onClick={() => pickFilter(ItemFilter.CreditCard)} className={rowClass(ItemFilter.CreditCard, true)}>
- <svg className={iconClass(ItemFilter.CreditCard)} fill="none" stroke="currentColor" viewBox="0 0 24 24">
- <path strokeLinecap="round" strokeLinejoin="round" strokeWidth="2" d="M3 10h18M7 15h1m4 0h1m-7 4h12a3 3 0 003-3V8a3 3 0 00-3-3H6a3 3 0 00-3 3v8a3 3 0 003 3z" />
- </svg>
+ <Icon name="credit-card" className={iconClass(ItemFilter.CreditCard)} />
{t('itemTypes.creditCard.title')}
</button>
<button onClick={() => pickFilter(ItemFilter.Note)} className={rowClass(ItemFilter.Note, true)}>
- <svg className={iconClass(ItemFilter.Note)} fill="none" stroke="currentColor" viewBox="0 0 24 24">
- <path strokeLinecap="round" strokeLinejoin="round" strokeWidth="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" />
- </svg>
+ <Icon name="document-text" className={iconClass(ItemFilter.Note)} />
{t('itemTypes.secureNote')}
</button>
diff --git a/apps/web/src/components/items/ItemIcon.tsx b/apps/web/src/components/items/ItemIcon.tsx
index e13a3fcb8..11adace06 100644
--- a/apps/web/src/components/items/ItemIcon.tsx
+++ b/apps/web/src/components/items/ItemIcon.tsx
@@ -1,5 +1,5 @@
import SqliteClient from '@aliasvault/client/database/SqliteClient';
-import { getAppIconSvg, ItemTypeIconSvgs } from '@aliasvault/models/icons';
+import { getBuiltinLogoSvg, ItemTypeIconSvgs } from '@aliasvault/models/icons';
import { FieldKey, ItemTypes, LogoKinds, type Item } from '@aliasvault/models/vault';
import React, { useState } from 'react';
@@ -25,25 +25,25 @@ const SvgIcon: React.FC<{ svg: string; sizeClass: string }> = ({ svg, sizeClass
*/
const detectCardBrand = (cardNumber: string | null | undefined): ItemTypeIconKey => {
if (!cardNumber) {
- return 'CreditCard';
+ return 'credit-card';
}
const cleaned = cardNumber.replace(/[\s-]/g, '');
if (!/^\d{4,}/.test(cleaned)) {
- return 'CreditCard';
+ return 'credit-card';
}
if (/^4/.test(cleaned)) {
- return 'Visa';
+ return 'visa';
}
if (/^5[1-5]/.test(cleaned) || /^2[2-7]/.test(cleaned)) {
- return 'Mastercard';
+ return 'mastercard';
}
if (/^3[47]/.test(cleaned)) {
- return 'Amex';
+ return 'amex';
}
if (/^6(?:011|22|4[4-9]|5)/.test(cleaned)) {
- return 'Discover';
+ return 'discover';
}
- return 'CreditCard';
+ return 'credit-card';
};
/**
@@ -55,7 +55,7 @@ const ItemIcon: React.FC<ItemIconProps> = ({ item, altText, sizeClass = 'w-10 h-
const chosen = item.LogoInfo && item.LogoInfo.Kind !== LogoKinds.Favicon ? item.LogoInfo : null;
if (chosen?.Kind === LogoKinds.Builtin) {
- const builtinSvg = getAppIconSvg(chosen.Source);
+ const builtinSvg = getBuiltinLogoSvg(chosen.Source);
if (builtinSvg) {
return <SvgIcon svg={builtinSvg} sizeClass={sizeClass} />;
}
@@ -68,7 +68,7 @@ const ItemIcon: React.FC<ItemIconProps> = ({ item, altText, sizeClass = 'w-10 h-
}
if (item.ItemType === ItemTypes.Note) {
- return <SvgIcon svg={ItemTypeIconSvgs.Note} sizeClass={sizeClass} />;
+ return <SvgIcon svg={ItemTypeIconSvgs.note} sizeClass={sizeClass} />;
}
if (item.ItemType === ItemTypes.CreditCard) {
@@ -82,7 +82,7 @@ const ItemIcon: React.FC<ItemIconProps> = ({ item, altText, sizeClass = 'w-10 h-
return <img src={logoSrc} alt={altText ?? item.Name ?? 'Item'} className={`${sizeClass} flex-shrink-0 rounded-[17%]`} loading="lazy" decoding="async" onError={() => setImageFailed(true)} />;
}
- return <SvgIcon svg={ItemTypeIconSvgs.Placeholder} sizeClass={sizeClass} />;
+ return <SvgIcon svg={ItemTypeIconSvgs.placeholder} sizeClass={sizeClass} />;
};
export default ItemIcon;
diff --git a/apps/web/src/components/items/ItemLogoPicker.tsx b/apps/web/src/components/items/ItemLogoPicker.tsx
index 0987465d9..a64474d45 100644
--- a/apps/web/src/components/items/ItemLogoPicker.tsx
+++ b/apps/web/src/components/items/ItemLogoPicker.tsx
@@ -4,6 +4,7 @@ import { useTranslation } from 'react-i18next';
import ItemIcon from '@/components/items/ItemIcon';
import LogoPickerModal from '@/components/items/LogoPickerModal';
+import Icon from '@/components/shared/Icon';
import type { Item, LogoSelection } from '@aliasvault/models/vault';
@@ -39,10 +40,7 @@ const ItemLogoPicker: React.FC<ItemLogoPickerProps> = ({ item, pendingSelection,
className="flex items-center justify-center w-20 h-20 flex-shrink-0 cursor-pointer rounded-lg bg-gray-50 dark:bg-gray-700 border border-gray-300 dark:border-gray-600 hover:bg-primary-50 dark:hover:bg-primary-900/30 hover:border-primary-500 dark:hover:border-primary-500 focus:outline-none focus:ring-2 focus:ring-primary-500 transition-colors"
>
{isFetching ? (
- <svg className="animate-spin w-7 h-7 text-gray-500 dark:text-gray-300" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24">
- <circle className="opacity-25" cx="12" cy="12" r="10" stroke="currentColor" strokeWidth="4"></circle>
- <path className="opacity-75" fill="currentColor" d="M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"></path>
- </svg>
+ <Icon name="spinner" className="animate-spin w-7 h-7 text-gray-500 dark:text-gray-300" />
) : (
<ItemIcon item={{ ...item, LogoInfo: effectiveLogo }} sizeClass="w-12 h-12" />
)}
diff --git a/apps/web/src/components/items/ItemTypeSelector.tsx b/apps/web/src/components/items/ItemTypeSelector.tsx
index ffcc85b79..7970c6d0d 100644
--- a/apps/web/src/components/items/ItemTypeSelector.tsx
+++ b/apps/web/src/components/items/ItemTypeSelector.tsx
@@ -2,6 +2,7 @@ import { type ItemType, ItemTypes } from '@aliasvault/models/vault';
import React, { useCallback, useEffect, useRef } from 'react';
import { useTranslation } from 'react-i18next';
+import Icon from '@/components/shared/Icon';
import { useClickOutside } from '@/hooks/useClickOutside';
type ItemTypeSelectorProps = {
@@ -20,13 +21,13 @@ const ALL_TYPES: ItemType[] = [ItemTypes.Login, ItemTypes.Alias, ItemTypes.Credi
const TypeIcon: React.FC<{ itemType: ItemType; className?: string }> = ({ itemType, className = 'w-5 h-5' }) => {
switch (itemType) {
case ItemTypes.Login:
- return <svg className={className} fill="none" stroke="currentColor" viewBox="0 0 24 24"><path strokeLinecap="round" strokeLinejoin="round" strokeWidth="2" d="M15 7a2 2 0 012 2m4 0a6 6 0 01-7.743 5.743L11 17H9v2H7v2H4a1 1 0 01-1-1v-2.586a1 1 0 01.293-.707l5.964-5.964A6 6 0 1121 9z" /></svg>;
+ return <Icon name="key" className={className} />;
case ItemTypes.Alias:
- return <svg className={className} fill="none" stroke="currentColor" viewBox="0 0 24 24"><path strokeLinecap="round" strokeLinejoin="round" strokeWidth="2" d="M16 7a4 4 0 11-8 0 4 4 0 018 0zM12 14a7 7 0 00-7 7h14a7 7 0 00-7-7z" /></svg>;
+ return <Icon name="user" className={className} />;
case ItemTypes.CreditCard:
- return <svg className={className} fill="none" stroke="currentColor" viewBox="0 0 24 24"><path strokeLinecap="round" strokeLinejoin="round" strokeWidth="2" d="M3 10h18M7 15h1m4 0h1m-7 4h12a3 3 0 003-3V8a3 3 0 00-3-3H6a3 3 0 00-3 3v8a3 3 0 003 3z" /></svg>;
+ return <Icon name="credit-card" className={className} />;
default:
- return <svg className={className} fill="none" stroke="currentColor" viewBox="0 0 24 24"><path strokeLinecap="round" strokeLinejoin="round" strokeWidth="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /></svg>;
+ return <Icon name="document-text" className={className} />;
}
};
@@ -69,9 +70,7 @@ export const ItemTypePill: React.FC<ItemTypePillProps> = ({ itemType, onClick, i
<span className="shrink-0 text-primary-600 dark:text-primary-400"><TypeIcon itemType={itemType} className="w-3.5 h-3.5" /></span>
<span className="text-xs font-medium whitespace-nowrap text-primary-700 dark:text-primary-300">{t(typeNameKey(itemType))}</span>
<span className="ml-1 text-xs whitespace-nowrap text-primary-600/70 dark:text-primary-400/70">{t('itemTypes.typeLabel')}</span>
- <svg className={`w-3 h-3 shrink-0 text-primary-500 transition-transform ${isOpen ? 'rotate-180' : ''}`} fill="none" stroke="currentColor" viewBox="0 0 24 24">
- <path strokeLinecap="round" strokeLinejoin="round" strokeWidth="2" d="M19 9l-7 7-7-7" />
- </svg>
+ <Icon name="chevron-down" className={`w-3 h-3 shrink-0 text-primary-500 transition-transform ${isOpen ? 'rotate-180' : ''}`} />
</button>
);
};
@@ -119,9 +118,7 @@ const ItemTypeSelector: React.FC<ItemTypeSelectorProps> = ({ selectedType, onSel
<span className={selected ? 'text-primary-600 dark:text-primary-400' : 'text-gray-500 dark:text-gray-400'}><TypeIcon itemType={itemType} /></span>
<span className="font-medium text-sm">{t(typeNameKey(itemType))}</span>
{selected && (
- <svg className="w-5 h-5 ml-auto text-primary-600 dark:text-primary-400" fill="currentColor" viewBox="0 0 20 20">
- <path fillRule="evenodd" d="M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z" clipRule="evenodd" />
- </svg>
+ <Icon name="check" className="w-5 h-5 ml-auto text-primary-600 dark:text-primary-400" />
)}
</button>
);
diff --git a/apps/web/src/components/items/LogoPickerModal.tsx b/apps/web/src/components/items/LogoPickerModal.tsx
index c073dbf62..dc212cd85 100644
--- a/apps/web/src/components/items/LogoPickerModal.tsx
+++ b/apps/web/src/components/items/LogoPickerModal.tsx
@@ -1,10 +1,11 @@
import { logoSourceTranslationKey } from '@aliasvault/client/items/ItemLogoView';
-import { AppIconSvgs, getAllAppIconKeys } from '@aliasvault/models/icons';
+import { BuiltinLogoSvgs, getAllBuiltinLogoKeys } from '@aliasvault/models/icons';
import { LogoKinds } from '@aliasvault/models/vault';
import React, { useCallback, useEffect } from 'react';
import { useTranslation } from 'react-i18next';
import ItemIcon from '@/components/items/ItemIcon';
+import Icon from '@/components/shared/Icon';
import Modal from '@/components/shared/Modal';
import type { Item, ItemLogo, LogoSelection } from '@aliasvault/models/vault';
@@ -62,9 +63,7 @@ const LogoPickerModal: React.FC<LogoPickerModalProps> = ({ item, currentLogo, we
<div className="flex items-center justify-between">
<h2 className="text-xl font-bold text-gray-900 dark:text-white">{t('items.logo.chooseLogo')}</h2>
<button type="button" onClick={onClose} className="text-gray-400 hover:text-gray-500 dark:hover:text-gray-300" title={t('common.close')} aria-label={t('common.close')}>
- <svg className="h-6 w-6" fill="none" viewBox="0 0 24 24" stroke="currentColor">
- <path strokeLinecap="round" strokeLinejoin="round" strokeWidth="2" d="M6 18L18 6M6 6l12 12" />
- </svg>
+ <Icon name="x" className="h-6 w-6" />
</button>
</div>
</div>
@@ -83,7 +82,7 @@ const LogoPickerModal: React.FC<LogoPickerModalProps> = ({ item, currentLogo, we
<div>
<h3 className="text-sm font-medium text-gray-700 dark:text-gray-300 mb-2">{t('items.logo.builtinLogos')}</h3>
<div className="grid grid-cols-5 gap-2">
- {getAllAppIconKeys().map(key => (
+ {getAllBuiltinLogoKeys().map(key => (
<button
key={key}
type="button"
@@ -92,7 +91,7 @@ const LogoPickerModal: React.FC<LogoPickerModalProps> = ({ item, currentLogo, we
onClick={() => choose({ Kind: LogoKinds.Builtin, Source: key })}
className="flex items-center justify-center p-2 rounded-lg border border-gray-200 dark:border-gray-600 transition-colors hover:bg-primary-50 dark:hover:bg-primary-900/30 hover:border-primary-500 dark:hover:border-primary-500"
>
- <span className="w-8 h-8 inline-block [&>svg]:w-full [&>svg]:h-full" dangerouslySetInnerHTML={{ __html: AppIconSvgs[key] }} />
+ <span className="w-8 h-8 inline-block [&>svg]:w-full [&>svg]:h-full" dangerouslySetInnerHTML={{ __html: BuiltinLogoSvgs[key] }} />
</button>
))}
</div>
@@ -105,7 +104,7 @@ const LogoPickerModal: React.FC<LogoPickerModalProps> = ({ item, currentLogo, we
onClick={() => choose({ Kind: LogoKinds.Favicon })}
className="w-full flex items-center gap-3 px-3 py-2 text-left rounded-lg border border-gray-200 dark:border-gray-600 transition-colors hover:bg-primary-50 dark:hover:bg-primary-900/30 hover:border-primary-500 dark:hover:border-primary-500"
>
- <svg className="w-5 h-5 flex-shrink-0 text-primary-600 dark:text-primary-400" fill="none" viewBox="0 0 24 24" strokeWidth="1.5" stroke="currentColor"><path strokeLinecap="round" strokeLinejoin="round" d="M12 21a9 9 0 100-18 9 9 0 000 18zm0 0a8.95 8.95 0 003.2-9 8.95 8.95 0 00-3.2-9m0 18a8.95 8.95 0 01-3.2-9A8.95 8.95 0 0112 3m-8.7 6h17.4M3.3 15h17.4" /></svg>
+ <Icon name="globe-alt" className="w-5 h-5 flex-shrink-0 text-primary-600 dark:text-primary-400" />
<span className="min-w-0">
<span className="block text-sm text-gray-900 dark:text-white">
{currentLogo?.Kind === LogoKinds.Favicon ? t('items.logo.refetchFromWebsite') : t('items.logo.fetchFromWebsite')}
diff --git a/apps/web/src/components/items/QuickCreateDialog.tsx b/apps/web/src/components/items/QuickCreateDialog.tsx
index a1eeea645..54ac51070 100644
--- a/apps/web/src/components/items/QuickCreateDialog.tsx
+++ b/apps/web/src/components/items/QuickCreateDialog.tsx
@@ -4,6 +4,7 @@ import { useTranslation } from 'react-i18next';
import { useLocation, useNavigate } from 'react-router-dom';
import FormLabel from '@/components/shared/FormLabel';
+import Icon from '@/components/shared/Icon';
import Modal from '@/components/shared/Modal';
import { useDb } from '@/context/DbContext';
import { useLoading } from '@/context/LoadingContext';
@@ -15,16 +16,17 @@ import { generateIdentity } from '@/utils/IdentityGenerator';
import { itemRoute } from '@/utils/ItemRoute';
import type { FolderRef } from '@aliasvault/client/database/repositories/FolderRepository';
+import type { UiIconName } from '@aliasvault/models/icons';
/** The URL prefilled in the website field. */
const DEFAULT_SERVICE_URL = 'https://';
/** The icon of each item type in the type selector. */
-const TYPE_ICON_PATHS: Record<ItemType, string> = {
- [ItemTypes.Login]: 'M15 7a2 2 0 012 2m4 0a6 6 0 01-7.743 5.743L11 17H9v2H7v2H4a1 1 0 01-1-1v-2.586a1 1 0 01.293-.707l5.964-5.964A6 6 0 1121 9z',
- [ItemTypes.Alias]: 'M16 7a4 4 0 11-8 0 4 4 0 018 0zM12 14a7 7 0 00-7 7h14a7 7 0 00-7-7z',
- [ItemTypes.CreditCard]: 'M3 10h18M7 15h1m4 0h1m-7 4h12a3 3 0 003-3V8a3 3 0 00-3-3H6a3 3 0 00-3 3v8a3 3 0 003 3z',
- [ItemTypes.Note]: 'M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z',
+const TYPE_ICONS: Record<ItemType, UiIconName> = {
+ [ItemTypes.Login]: 'key',
+ [ItemTypes.Alias]: 'user',
+ [ItemTypes.CreditCard]: 'credit-card',
+ [ItemTypes.Note]: 'document-text',
};
const ALL_TYPES: ItemType[] = [ItemTypes.Login, ItemTypes.Alias, ItemTypes.CreditCard, ItemTypes.Note];
@@ -196,7 +198,7 @@ const QuickCreateDialog: React.FC<QuickCreateDialogProps> = ({ initialType, onCl
id={`quickIdentityType_${type}`}
onClick={() => setItemType(type)}
className={`flex-1 px-2 py-2 text-xs font-medium rounded-md transition-colors flex flex-col items-center gap-1 ${itemType === type ? 'bg-primary-100 text-primary-700 dark:bg-primary-900/30 dark:text-primary-300 border border-primary-300 dark:border-primary-700' : 'bg-gray-100 text-gray-600 dark:bg-gray-700 dark:text-gray-300 hover:bg-gray-200 dark:hover:bg-gray-600 border border-transparent'}`}>
- <svg className="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path strokeLinecap="round" strokeLinejoin="round" strokeWidth="2" d={TYPE_ICON_PATHS[type]} /></svg>
+ <Icon name={TYPE_ICONS[type]} className="w-4 h-4" />
<span>{getTypeDisplayName(type)}</span>
</button>
))}
@@ -240,9 +242,7 @@ const QuickCreateDialog: React.FC<QuickCreateDialogProps> = ({ initialType, onCl
{itemType === ItemTypes.Alias ? t('common.create') : (
<>
{t('common.continue')}
- <svg className="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24">
- <path strokeLinecap="round" strokeLinejoin="round" strokeWidth="2" d="M9 5l7 7-7 7" />
- </svg>
+ <Icon name="chevron-right" className="w-4 h-4" />
</>
)}
</button>
diff --git a/apps/web/src/components/layout/DbStatusIndicator.tsx b/apps/web/src/components/layout/DbStatusIndicator.tsx
index b6e8977f8..d82dfd215 100644
--- a/apps/web/src/components/layout/DbStatusIndicator.tsx
+++ b/apps/web/src/components/layout/DbStatusIndicator.tsx
@@ -4,6 +4,7 @@ import React, { useCallback, useEffect, useRef, useState } from 'react';
import { useTranslation } from 'react-i18next';
import SmallLoadingIndicator from '@/components/loading/SmallLoadingIndicator';
+import Icon from '@/components/shared/Icon';
import { useDb } from '@/context/DbContext';
import { useNotifications } from '@/context/NotificationContext';
import { useVaultSync } from '@/hooks/useVaultSync';
@@ -141,9 +142,7 @@ const DbStatusIndicator: React.FC = () => {
<SmallLoadingIndicator title={getStatusTitle()} spinning={isSpinning}>
{!isSpinning && (
<button className="absolute p-2 hover:bg-gray-200 dark:hover:bg-gray-700 rounded-2xl" id="vault-refresh-btn" onClick={onRefreshClick}>
- <svg xmlns="http://www.w3.org/2000/svg" className="h-4 w-4 text-gray-400" viewBox="0 0 20 20" fill="currentColor">
- <path fillRule="evenodd" d="M4 2a1 1 0 011 1v2.101a7.002 7.002 0 0111.601 2.566 1 1 0 11-1.885.666A5.002 5.002 0 005.999 7H9a1 1 0 010 2H4a1 1 0 01-1-1V3a1 1 0 011-1zm.008 9.057a1 1 0 011.276.61A5.002 5.002 0 0014.001 13H11a1 1 0 110-2h5a1 1 0 011 1v5a1 1 0 11-2 0v-2.101a7.002 7.002 0 01-11.601-2.566 1 1 0 01.61-1.276z" clipRule="evenodd" />
- </svg>
+ <Icon name="refresh" className="h-4 w-4 text-gray-400" />
{showSyncError && <span className="absolute top-1 right-1 w-2 h-2 rounded-full bg-red-500" aria-hidden="true"></span>}
</button>
)}
diff --git a/apps/web/src/components/layout/SearchWidget.tsx b/apps/web/src/components/layout/SearchWidget.tsx
index 1578d3f29..c91cde543 100644
--- a/apps/web/src/components/layout/SearchWidget.tsx
+++ b/apps/web/src/components/layout/SearchWidget.tsx
@@ -8,6 +8,7 @@ import { useLocation, useNavigate } from 'react-router-dom';
import ItemIcon from '@/components/items/ItemIcon';
import { getFieldValue } from '@/components/items/ItemListEntry';
+import Icon from '@/components/shared/Icon';
import { useDb } from '@/context/DbContext';
import { useClickOutside } from '@/hooks/useClickOutside';
import { useKeyboardShortcut } from '@/hooks/useKeyboardShortcut';
@@ -167,10 +168,7 @@ const SearchWidget: React.FC = () => {
isLoading ? (
<div className={popupClass}>
<div className="px-4 py-2 flex items-center">
- <svg className="animate-spin -ml-1 mr-3 h-4 w-4 text-gray-500" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24">
- <circle className="opacity-25" cx="12" cy="12" r="10" stroke="currentColor" strokeWidth="4"></circle>
- <path className="opacity-75" fill="currentColor" d="M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"></path>
- </svg>
+ <Icon name="spinner" className="animate-spin -ml-1 mr-3 h-4 w-4 text-gray-500" />
{t('items.search.searchingMessage')}
</div>
</div>
diff --git a/apps/web/src/components/layout/TopMenu.tsx b/apps/web/src/components/layout/TopMenu.tsx
index efcd2ada2..19261525e 100644
--- a/apps/web/src/components/layout/TopMenu.tsx
+++ b/apps/web/src/components/layout/TopMenu.tsx
@@ -11,6 +11,7 @@ import DbStatusIndicator from '@/components/layout/DbStatusIndicator';
import NavBarLink from '@/components/layout/NavBarLink';
import SearchWidget from '@/components/layout/SearchWidget';
import SettingsIcon, { type SettingsIconName } from '@/components/settings/SettingsIcon';
+import Icon from '@/components/shared/Icon';
import MenuItem from '@/components/shared/MenuItem';
import { useAccountReminders } from '@/context/AccountReminderContext';
import { useAuth } from '@/context/AuthContext';
@@ -97,7 +98,7 @@ const TopMenu: React.FC = () => {
<DbStatusIndicator />
<div ref={quickCreateRef} className="relative ms-1 md:ms-2">
<button type="button" id="topBarQuickCreateButton" onClick={() => setIsQuickCreateOpen(!isQuickCreateOpen)} aria-expanded={isQuickCreateOpen} title={t('items.quickCreate.newAliasButtonText')} className="flex items-center justify-center h-9 w-9 md:w-auto md:px-4 rounded-lg text-sm font-medium text-white bg-primary-600 hover:bg-primary-700 shadow-sm focus:outline-none focus-visible:ring-2 focus-visible:ring-primary-400 transition-colors">
- <svg className="w-5 h-5 md:hidden" aria-hidden="true" fill="none" stroke="currentColor" strokeWidth={2.25} viewBox="0 0 24 24"><path strokeLinecap="round" strokeLinejoin="round" d="M12 5v14m-7-7h14" /></svg>
+ <Icon name="plus" className="w-5 h-5 md:hidden" strokeWidth={2.25} />
<span className="sr-only md:not-sr-only">{t('items.quickCreate.newAliasButtonText')}</span>
</button>
{isQuickCreateOpen && <QuickCreateDialog variant="popover" initialType={ItemTypes.Login} onClose={closeQuickCreate} />}
@@ -109,7 +110,7 @@ const TopMenu: React.FC = () => {
{hasReminders && <span className="absolute top-0 right-0 w-2 h-2 rounded-full bg-primary-500 ring-2 ring-white dark:ring-gray-800" aria-hidden="true" />}
</span>
<span className="hidden md:block max-w-[8rem] truncate text-sm font-medium text-gray-700 dark:text-gray-200">{username}</span>
- <svg className={`hidden md:block w-4 h-4 text-gray-400 transition-transform ${isUserMenuOpen ? 'rotate-180' : ''}`} fill="none" stroke="currentColor" strokeWidth={2} viewBox="0 0 24 24" aria-hidden="true"><path strokeLinecap="round" strokeLinejoin="round" d="M19 9l-7 7-7-7" /></svg>
+ <Icon name="chevron-down" className={`hidden md:block w-4 h-4 text-gray-400 transition-transform ${isUserMenuOpen ? 'rotate-180' : ''}`} />
</button>
<div ref={userMenuRef} id="userMenu" className={`absolute right-0 top-full mt-3 w-72 z-50 overflow-hidden bg-white rounded-lg shadow-lg border border-gray-200 dark:bg-gray-700 dark:border-gray-600 ${isUserMenuOpen ? 'block' : 'hidden'}`}>
<div className="flex items-start gap-2 px-4 py-3">
diff --git a/apps/web/src/components/loading/SmallLoadingIndicator.tsx b/apps/web/src/components/loading/SmallLoadingIndicator.tsx
index c9db9e22b..475afd7fd 100644
--- a/apps/web/src/components/loading/SmallLoadingIndicator.tsx
+++ b/apps/web/src/components/loading/SmallLoadingIndicator.tsx
@@ -1,6 +1,8 @@
import React from 'react';
import { useTranslation } from 'react-i18next';
+import Icon from '@/components/shared/Icon';
+
type SmallLoadingIndicatorProps = {
title?: string;
spinning?: boolean;
@@ -16,10 +18,7 @@ const SmallLoadingIndicator: React.FC<SmallLoadingIndicatorProps> = ({ title = '
<div role="status" className="px-2 flex items-center" title={title}>
<div className="relative inline-flex items-center justify-center">
{children}
- <svg aria-hidden="true" className={`inline w-8 h-8 text-gray-200 ${spinning ? 'animate-spin fill-primary-600' : ''} dark:text-gray-600`} viewBox="0 0 100 101" fill="none" xmlns="http://www.w3.org/2000/svg">
- <path d="M100 50.5908C100 78.2051 77.6142 100.591 50 100.591C22.3858 100.591 0 78.2051 0 50.5908C0 22.9766 22.3858 0.59082 50 0.59082C77.6142 0.59082 100 22.9766 100 50.5908ZM9.08144 50.5908C9.08144 73.1895 27.4013 91.5094 50 91.5094C72.5987 91.5094 90.9186 73.1895 90.9186 50.5908C90.9186 27.9921 72.5987 9.67226 50 9.67226C27.4013 9.67226 9.08144 27.9921 9.08144 50.5908Z" fill="currentColor" />
- <path d="M93.9676 39.0409C96.393 38.4038 97.8624 35.9116 97.0079 33.5539C95.2932 28.8227 92.871 24.3692 89.8167 20.348C85.8452 15.1192 80.8826 10.7238 75.2124 7.41289C69.5422 4.10194 63.2754 1.94025 56.7698 1.05124C51.7666 0.367541 46.6976 0.446843 41.7345 1.27873C39.2613 1.69328 37.813 4.19778 38.4501 6.62326C39.0873 9.04874 41.5694 10.4717 44.0505 10.1071C47.8511 9.54855 51.7191 9.52689 55.5402 10.0491C60.8642 10.7766 65.9928 12.5457 70.6331 15.2552C75.2735 17.9648 79.3347 21.5619 82.5849 25.841C84.9175 28.9121 86.7997 32.2913 88.1811 35.8758C89.083 38.2158 91.5421 39.6781 93.9676 39.0409Z" fill="currentFill" />
- </svg>
+ <Icon name="spinner-flowbite" className={`inline w-8 h-8 text-gray-200 ${spinning ? 'animate-spin fill-primary-600' : ''} dark:text-gray-600`} />
</div>
<span className="sr-only">{t('common.loading')}</span>
</div>
diff --git a/apps/web/src/components/settings/PasswordSettingsPopup.tsx b/apps/web/src/components/settings/PasswordSettingsPopup.tsx
index b843d7395..05a08ec34 100644
--- a/apps/web/src/components/settings/PasswordSettingsPopup.tsx
+++ b/apps/web/src/components/settings/PasswordSettingsPopup.tsx
@@ -5,6 +5,7 @@ import React, { useEffect, useMemo, useState } from 'react';
import { useTranslation } from 'react-i18next';
import CopyPasteFormRow from '@/components/forms/CopyPasteFormRow';
+import Icon from '@/components/shared/Icon';
import Modal from '@/components/shared/Modal';
import TabButton from '@/components/shared/TabButton';
import ToggleChip from '@/components/shared/ToggleChip';
@@ -137,9 +138,7 @@ const PasswordSettingsPopup: React.FC<PasswordSettingsPopupProps> = ({ passwordS
<div className="mt-1 flex">
<div className="flex-grow"><CopyPasteFormRow id="preview-password" value={previewPassword} /></div>
<button type="button" className="ml-2 px-3 py-2 text-sm text-gray-500 dark:text-white bg-gray-200 hover:bg-gray-300 focus:ring-4 focus:outline-none focus:ring-gray-300 font-medium rounded-md dark:bg-gray-600 dark:hover:bg-gray-700 dark:focus:ring-gray-800" onClick={handleRefreshPreview}>
- <svg className="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
- <path strokeLinecap="round" strokeLinejoin="round" strokeWidth="2" d="M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15"></path>
- </svg>
+ <Icon name="refresh" className="w-5 h-5" />
</button>
</div>
</div>
diff --git a/apps/web/src/components/settings/SettingsIcon.tsx b/apps/web/src/components/settings/SettingsIcon.tsx
index f749bf394..c7473230c 100644
--- a/apps/web/src/components/settings/SettingsIcon.tsx
+++ b/apps/web/src/components/settings/SettingsIcon.tsx
@@ -1,39 +1,41 @@
import React from 'react';
+import Icon from '@/components/shared/Icon';
+
+import type { UiIconName } from '@aliasvault/models/icons';
+
/**
* The icons of the settings pages, shared by the settings overview rows and the page headers.
*/
export type SettingsIconName = 'twoFactor' | 'security' | 'sessions' | 'passwordGenerator' | 'identityGenerator' | 'importExport' | 'storage' | 'general' | 'apps' | 'themeLight' | 'themeDark' | 'lock' | 'securityWarning' | 'logout' | 'warning' | 'vault' | 'emails' | 'familySharing';
-/** The path data of each 24x24 outline icon. */
-const SETTINGS_ICON_PATHS: Record<SettingsIconName, string[]> = {
- twoFactor: ['M12 18h.01M8 21h8a2 2 0 002-2V5a2 2 0 00-2-2H8a2 2 0 00-2 2v14a2 2 0 002 2z'],
- security: ['M9 12l2 2 4-4m5.618-4.016A11.955 11.955 0 0112 2.944a11.955 11.955 0 01-8.618 3.04A12.02 12.02 0 003 9c0 5.591 3.824 10.29 9 11.622 5.176-1.332 9-6.03 9-11.622 0-1.042-.133-2.052-.382-3.016z'],
- sessions: ['M9.75 17L9 20l-1 1h8l-1-1-.75-3M3 13h18M5 17h14a2 2 0 002-2V5a2 2 0 00-2-2H5a2 2 0 00-2 2v10a2 2 0 002 2z'],
- passwordGenerator: ['M15 7a2 2 0 012 2m4 0a6 6 0 01-7.743 5.743L11 17H9v2H7v2H4a1 1 0 01-1-1v-2.586a1 1 0 01.293-.707l5.964-5.964A6 6 0 1121 9z'],
- identityGenerator: ['M16 7a4 4 0 11-8 0 4 4 0 018 0zM12 14a7 7 0 00-7 7h14a7 7 0 00-7-7z'],
- importExport: ['M8 7h12m0 0l-4-4m4 4l-4 4m0 6H4m0 0l4 4m-4-4l4-4'],
- storage: ['M4 7v10c0 2.21 3.582 4 8 4s8-1.79 8-4V7M4 7c0 2.21 3.582 4 8 4s8-1.79 8-4M4 7c0-2.21 3.582-4 8-4s8 1.79 8 4m0 5c0 2.21-3.582 4-8 4s-8-1.79-8-4'],
- general: ['M10.325 4.317c.426-1.756 2.924-1.756 3.35 0a1.724 1.724 0 002.573 1.066c1.543-.94 3.31.826 2.37 2.37a1.724 1.724 0 001.065 2.572c1.756.426 1.756 2.924 0 3.35a1.724 1.724 0 00-1.066 2.573c.94 1.543-.826 3.31-2.37 2.37a1.724 1.724 0 00-2.572 1.065c-.426 1.756-2.924 1.756-3.35 0a1.724 1.724 0 00-2.573-1.066c-1.543.94-3.31-.826-2.37-2.37a1.724 1.724 0 00-1.065-2.572c-1.756-.426-1.756-2.924 0-3.35a1.724 1.724 0 001.066-2.573c-.94-1.543.826-3.31 2.37-2.37.996.608 2.296.07 2.572-1.065z', 'M15 12a3 3 0 11-6 0 3 3 0 016 0z'],
- apps: ['M17 14v6m-3-3h6M6 10h2a2 2 0 002-2V6a2 2 0 00-2-2H6a2 2 0 00-2 2v2a2 2 0 002 2zm10 0h2a2 2 0 002-2V6a2 2 0 00-2-2h-2a2 2 0 00-2 2v2a2 2 0 002 2zM6 20h2a2 2 0 002-2v-2a2 2 0 00-2-2H6a2 2 0 00-2 2v2a2 2 0 002 2z'],
- themeLight: ['M12 3v1m0 16v1m9-9h-1M4 12H3m15.364 6.364l-.707-.707M6.343 6.343l-.707-.707m12.728 0l-.707.707M6.343 17.657l-.707.707M16 12a4 4 0 11-8 0 4 4 0 018 0z'],
- themeDark: ['M20.354 15.354A9 9 0 018.646 3.646 9.003 9.003 0 0012 21a9.003 9.003 0 008.354-5.646z'],
- securityWarning: ['M12 9v3.75m0 3.75h.008M20.618 5.984A11.955 11.955 0 0112 2.944a11.955 11.955 0 01-8.618 3.04A12.02 12.02 0 003 9c0 5.591 3.824 10.29 9 11.622 5.176-1.332 9-6.03 9-11.622 0-1.042-.133-2.052-.382-3.016z'],
- logout: ['M17 16l4-4m0 0l-4-4m4 4H7m6 4v1a3 3 0 01-3 3H6a3 3 0 01-3-3V7a3 3 0 013-3h4a3 3 0 013 3v1'],
- warning: ['M12 9v3.75m-9.303 3.376c-.866 1.5.217 3.374 1.948 3.374h14.71c1.73 0 2.813-1.874 1.948-3.374L13.949 3.378c-.866-1.5-3.032-1.5-3.898 0L2.697 16.126zM12 15.75h.007v.008H12v-.008z'],
- vault: ['M5 8h14M5 8a2 2 0 110-4h14a2 2 0 110 4M5 8v10a2 2 0 002 2h10a2 2 0 002-2V8m-9 4h4'],
- emails: ['M3 8l7.89 5.26a2 2 0 002.22 0L21 8M5 19h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v10a2 2 0 002 2z'],
- lock: ['M12 15v2m-6 4h12a2 2 0 002-2v-6a2 2 0 00-2-2H6a2 2 0 00-2 2v6a2 2 0 002 2zm10-10V7a4 4 0 00-8 0v4h8z'],
- familySharing: ['M17 20h5v-2a3 3 0 00-5.356-1.857M17 20H7m10 0v-2c0-.656-.126-1.283-.356-1.857M7 20H2v-2a3 3 0 015.356-1.857M7 20v-2c0-.656.126-1.283.356-1.857m0 0a5.002 5.002 0 019.288 0M15 7a3 3 0 11-6 0 3 3 0 016 0zm6 3a2 2 0 11-4 0 2 2 0 014 0zM7 10a2 2 0 11-4 0 2 2 0 014 0z'],
+/** The catalog icon of each settings icon. */
+const SETTINGS_ICONS: Record<SettingsIconName, UiIconName> = {
+ twoFactor: 'device-mobile',
+ security: 'shield-check',
+ sessions: 'desktop-computer',
+ passwordGenerator: 'key',
+ identityGenerator: 'user',
+ importExport: 'switch-horizontal',
+ storage: 'database',
+ general: 'cog',
+ apps: 'view-grid-add',
+ themeLight: 'sun',
+ themeDark: 'moon',
+ securityWarning: 'shield-exclamation',
+ logout: 'logout',
+ warning: 'exclamation',
+ vault: 'archive',
+ emails: 'mail',
+ lock: 'lock-closed',
+ familySharing: 'user-group',
};
/**
* A settings page icon.
*/
const SettingsIcon: React.FC<{ name: SettingsIconName; className?: string; strokeWidth?: number }> = ({ name, className = 'w-5 h-5', strokeWidth = 2 }) => (
- <svg className={className} fill="none" stroke="currentColor" strokeWidth={strokeWidth} viewBox="0 0 24 24" aria-hidden="true">
- {SETTINGS_ICON_PATHS[name].map((d) => <path key={d} strokeLinecap="round" strokeLinejoin="round" d={d} />)}
- </svg>
+ <Icon name={SETTINGS_ICONS[name]} className={className} strokeWidth={strokeWidth} />
);
export default SettingsIcon;
diff --git a/apps/web/src/components/settings/SettingsPageHeader.tsx b/apps/web/src/components/settings/SettingsPageHeader.tsx
index 69b8557a1..63e4eb4ae 100644
--- a/apps/web/src/components/settings/SettingsPageHeader.tsx
+++ b/apps/web/src/components/settings/SettingsPageHeader.tsx
@@ -5,6 +5,7 @@ import { Link } from 'react-router-dom';
import SettingsIcon, { type SettingsIconName } from '@/components/settings/SettingsIcon';
import Breadcrumb, { type BreadcrumbItem } from '@/components/shared/Breadcrumb';
import H1 from '@/components/shared/H1';
+import Icon from '@/components/shared/Icon';
type SettingsPageHeaderProps = {
icon: SettingsIconName;
@@ -35,7 +36,7 @@ const SettingsPageHeader: React.FC<SettingsPageHeaderProps> = ({ icon, title, de
<div className="flex items-start gap-3 sm:gap-4 min-w-0">
<Link to={back.url} id="settingsBackButton" title={back.label} className="flex-shrink-0 flex items-center h-12 pl-2.5 pr-4 -ml-2 -mr-1.5 sm:-mr-2.5 rounded-xl text-gray-500 hover:text-gray-900 hover:bg-gray-200 dark:text-gray-400 dark:hover:text-white dark:hover:bg-gray-700 transition-colors">
<span className="sr-only">{back.label}</span>
- <svg className="w-5 h-5" fill="none" stroke="currentColor" strokeWidth={2} viewBox="0 0 24 24" aria-hidden="true"><path strokeLinecap="round" strokeLinejoin="round" d="M15 19l-7-7 7-7" /></svg>
+ <Icon name="chevron-left" className="w-5 h-5" />
</Link>
<span className="flex-shrink-0 flex items-center justify-center w-12 h-12 rounded-xl bg-white border border-gray-200 shadow-sm text-primary-600 dark:bg-gray-800 dark:border-gray-700 dark:text-primary-400">
<SettingsIcon name={icon} className="w-6 h-6" />
diff --git a/apps/web/src/components/settings/importexport/ExportPasswordModal.tsx b/apps/web/src/components/settings/importexport/ExportPasswordModal.tsx
index 59bd77819..6439dbea4 100644
--- a/apps/web/src/components/settings/importexport/ExportPasswordModal.tsx
+++ b/apps/web/src/components/settings/importexport/ExportPasswordModal.tsx
@@ -5,6 +5,7 @@ import { useTranslation } from 'react-i18next';
import AlertMessageError from '@/components/alerts/AlertMessageError';
import PasswordInputField from '@/components/auth/PasswordInputField';
import FormModal from '@/components/shared/FormModal';
+import Icon from '@/components/shared/Icon';
import PasswordStrengthIndicator from '@/components/shared/PasswordStrengthIndicator';
const VALIDATION_DEBOUNCE_MS = 800;
@@ -109,9 +110,7 @@ const ExportPasswordModal: React.FC<ExportPasswordModalProps> = ({ isOpen, title
closeOnOverlayClick={false}
submitOnEnter={false}
icon={(
- <svg className="h-6 w-6 text-orange-600 dark:text-orange-400" fill="none" viewBox="0 0 24 24" strokeWidth="1.5" stroke="currentColor">
- <path strokeLinecap="round" strokeLinejoin="round" d="M3 16.5v2.25A2.25 2.25 0 005.25 21h13.5A2.25 2.25 0 0021 18.75V16.5m-13.5-9L12 3m0 0l4.5 4.5M12 3v13.5" />
- </svg>
+ <Icon name="upload" className="h-6 w-6 text-orange-600 dark:text-orange-400" />
)}
footerContent={(
<>
diff --git a/apps/web/src/components/settings/importexport/ImportServiceCard.tsx b/apps/web/src/components/settings/importexport/ImportServiceCard.tsx
index e57ad640c..d77cd5068 100644
--- a/apps/web/src/components/settings/importexport/ImportServiceCard.tsx
+++ b/apps/web/src/components/settings/importexport/ImportServiceCard.tsx
@@ -11,6 +11,7 @@ import { useNavigate } from 'react-router-dom';
import LoadingIndicator from '@/components/loading/LoadingIndicator';
import Button from '@/components/shared/Button';
+import Icon from '@/components/shared/Icon';
import Modal from '@/components/shared/Modal';
import Text from '@/components/shared/Text';
import { useDb } from '@/context/DbContext';
@@ -601,9 +602,7 @@ const ImportServiceCard: React.FC<ImportServiceCardProps> = ({ serviceName, desc
const renderParseFailures = (): React.ReactNode => (
<div className="mb-4 p-4 rounded-lg bg-amber-50 border border-amber-400 dark:bg-amber-900/20 dark:border-amber-700" role="alert">
<div className="flex items-start gap-2 mb-2">
- <svg xmlns="http://www.w3.org/2000/svg" className="w-5 h-5 shrink-0 text-amber-600 dark:text-amber-400" fill="none" viewBox="0 0 24 24" stroke="currentColor" strokeWidth="2" aria-hidden="true">
- <path strokeLinecap="round" strokeLinejoin="round" d="M12 9v3.75m-9.303 3.376c-.866 1.5.217 3.374 1.948 3.374h14.71c1.73 0 2.813-1.874 1.948-3.374L13.949 3.378c-.866-1.5-3.032-1.5-3.898 0L2.697 16.126ZM12 15.75h.008v.008H12v-.008Z" />
- </svg>
+ <Icon name="exclamation" className="w-5 h-5 shrink-0 text-amber-600 dark:text-amber-400" />
<p className="font-medium text-amber-900 dark:text-amber-200">{t('importExport.serviceCard.importPartialFailureWarning', { count: parseFailures.length })}</p>
</div>
<ul className="mb-3 ml-7 text-xs list-disc pl-5 space-y-0.5 text-gray-700 dark:text-gray-300">
@@ -625,9 +624,7 @@ const ImportServiceCard: React.FC<ImportServiceCardProps> = ({ serviceName, desc
<div className="mt-2 ml-7 flex items-start gap-2">
<textarea readOnly rows={4} value={buildFailureDetailsText()} className="flex-1 text-xs font-mono p-2 rounded border border-gray-300 dark:border-gray-700 bg-gray-50 dark:bg-gray-900 text-gray-800 dark:text-gray-200 leading-snug" />
<button type="button" onClick={() => void copyToClipboard(buildFailureDetailsText())} title={t('importExport.serviceCard.importErrorCopyDetailsButton')} className="shrink-0 inline-flex items-center gap-1 px-2.5 py-1.5 text-xs font-medium rounded border border-gray-300 dark:border-gray-600 bg-white dark:bg-gray-700 text-gray-700 dark:text-gray-200 hover:bg-gray-100 dark:hover:bg-gray-600">
- <svg xmlns="http://www.w3.org/2000/svg" className="w-3.5 h-3.5" fill="none" viewBox="0 0 24 24" stroke="currentColor" strokeWidth="2" aria-hidden="true">
- <path strokeLinecap="round" strokeLinejoin="round" d="M15.75 17.25v3.375c0 .621-.504 1.125-1.125 1.125h-9.75a1.125 1.125 0 0 1-1.125-1.125V7.875c0-.621.504-1.125 1.125-1.125H6.75a9.06 9.06 0 0 1 1.5.124m7.5 10.376h3.375c.621 0 1.125-.504 1.125-1.125V11.25c0-4.46-3.243-8.161-7.5-8.876a9.06 9.06 0 0 0-1.5-.124H9.375c-.621 0-1.125.504-1.125 1.125v3.5m7.5 10.375H9.375a1.125 1.125 0 0 1-1.125-1.125v-9.25m12 6.625v-1.875a3.375 3.375 0 0 0-3.375-3.375h-1.5a1.125 1.125 0 0 1-1.125-1.125v-1.5a3.375 3.375 0 0 0-3.375-3.375H9.75" />
- </svg>
+ <Icon name="document-duplicate" className="w-3.5 h-3.5" />
{t('importExport.serviceCard.importErrorCopyDetailsButton')}
</button>
</div>
@@ -771,9 +768,7 @@ const ImportServiceCard: React.FC<ImportServiceCardProps> = ({ serviceName, desc
<h3 className="text-xl font-semibold dark:text-white">{t('importExport.serviceCard.importFromServiceTitle', { service: serviceName })}</h3>
</div>
<button type="button" onClick={closeModal} className="text-gray-500 hover:text-gray-700 dark:text-gray-400 dark:hover:text-gray-300">
- <svg className="w-6 h-6" fill="none" stroke="currentColor" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
- <path strokeLinecap="round" strokeLinejoin="round" strokeWidth="2" d="M6 18L18 6M6 6l12 12"></path>
- </svg>
+ <Icon name="x" className="w-6 h-6" />
</button>
</div>
diff --git a/apps/web/src/components/shared/Breadcrumb.tsx b/apps/web/src/components/shared/Breadcrumb.tsx
index e6a76bf9d..55a7bd9a2 100644
--- a/apps/web/src/components/shared/Breadcrumb.tsx
+++ b/apps/web/src/components/shared/Breadcrumb.tsx
@@ -1,6 +1,8 @@
import React from 'react';
import { Link } from 'react-router-dom';
+import Icon from '@/components/shared/Icon';
+
/**
* One breadcrumb entry.
*/
@@ -16,14 +18,14 @@ export type BreadcrumbItem = {
* Separator between breadcrumb entries.
*/
const ChevronIcon: React.FC = () => (
- <svg className="w-6 h-6 text-gray-400 dark:text-gray-400" fill="currentColor" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path fillRule="evenodd" d="M7.293 14.707a1 1 0 010-1.414L10.586 10 7.293 6.707a1 1 0 011.414-1.414l4 4a1 1 0 010 1.414l-4 4a1 1 0 01-1.414 0z" clipRule="evenodd"></path></svg>
+ <Icon name="chevron-right" className="w-6 h-6 text-gray-400 dark:text-gray-400" />
);
/**
* Home icon of the first entry.
*/
const HomeIcon: React.FC<{ inline?: boolean }> = ({ inline = false }) => (
- <svg className={`w-5 h-5 mr-2.5 ${inline ? 'inline' : ''}`} fill="currentColor" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M10.707 2.293a1 1 0 00-1.414 0l-7 7a1 1 0 001.414 1.414L4 10.414V17a1 1 0 001 1h2a1 1 0 001-1v-2a1 1 0 011-1h2a1 1 0 011 1v2a1 1 0 001 1h2a1 1 0 001-1v-6.586l.293.293a1 1 0 001.414-1.414l-7-7z"></path></svg>
+ <Icon name="home" className={`w-5 h-5 mr-2.5 ${inline ? 'inline' : ''}`} />
);
/**
diff --git a/apps/web/src/components/shared/Button.tsx b/apps/web/src/components/shared/Button.tsx
index f40275e20..33d3c057b 100644
--- a/apps/web/src/components/shared/Button.tsx
+++ b/apps/web/src/components/shared/Button.tsx
@@ -1,5 +1,7 @@
import React from 'react';
+import Icon from '@/components/shared/Icon';
+
/** Button colors. */
export type ButtonColor = 'primary' | 'secondary' | 'danger' | 'success' | 'outline';
@@ -56,9 +58,7 @@ export const getButtonColorClasses = (color: ButtonColor): string => {
* A small arrow icon for a button that moves through a process.
*/
export const ButtonArrow: React.FC<{ direction: ButtonArrowDirection }> = ({ direction }) => (
- <svg className="w-4 h-4 flex-shrink-0 opacity-80" fill="none" stroke="currentColor" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg" aria-hidden="true">
- <path strokeLinecap="round" strokeLinejoin="round" strokeWidth="2" d={direction === 'forward' ? 'M14 5l7 7m0 0l-7 7m7-7H3' : 'M10 19l-7-7m0 0l7-7m-7 7h18'} />
- </svg>
+ <Icon name={direction === 'forward' ? 'arrow-right' : 'arrow-left'} className="w-4 h-4 flex-shrink-0 opacity-80" />
);
/**
diff --git a/apps/web/src/components/shared/DeleteAllSelectedButton.tsx b/apps/web/src/components/shared/DeleteAllSelectedButton.tsx
index 76357b5f2..2a24cae75 100644
--- a/apps/web/src/components/shared/DeleteAllSelectedButton.tsx
+++ b/apps/web/src/components/shared/DeleteAllSelectedButton.tsx
@@ -1,6 +1,7 @@
import React from 'react';
import Button from '@/components/shared/Button';
+import Icon from '@/components/shared/Icon';
type DeleteAllSelectedButtonProps = {
onClick: () => void;
@@ -12,9 +13,7 @@ type DeleteAllSelectedButtonProps = {
*/
const DeleteAllSelectedButton: React.FC<DeleteAllSelectedButtonProps> = ({ onClick, buttonText }) => (
<Button onClick={onClick} display="flex" color="danger">
- <svg className="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
- <path strokeLinecap="round" strokeLinejoin="round" strokeWidth="2" d="M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16"></path>
- </svg>
+ <Icon name="trash" className="w-4 h-4" />
<span className="ml-2">{buttonText}</span>
</Button>
);
diff --git a/apps/web/src/components/shared/FormModal.tsx b/apps/web/src/components/shared/FormModal.tsx
index e39dc7013..cbdb86ea4 100644
--- a/apps/web/src/components/shared/FormModal.tsx
+++ b/apps/web/src/components/shared/FormModal.tsx
@@ -1,6 +1,7 @@
import React, { useEffect, useRef } from 'react';
import { useTranslation } from 'react-i18next';
+import Icon from '@/components/shared/Icon';
import Modal from '@/components/shared/Modal';
type FormModalProps = {
@@ -104,10 +105,7 @@ const FormModal: React.FC<FormModalProps> = ({
disabled={isLoading || confirmDisabled}
className={`inline-flex w-full justify-center rounded-md ${confirmButtonClass} px-3 py-2 text-sm font-semibold text-white shadow-sm sm:w-auto disabled:opacity-50 disabled:cursor-not-allowed`}>
{isLoading && (
- <svg className="animate-spin -ml-1 mr-2 h-4 w-4 text-white" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24">
- <circle className="opacity-25" cx="12" cy="12" r="10" stroke="currentColor" strokeWidth="4"></circle>
- <path className="opacity-75" fill="currentColor" d="M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"></path>
- </svg>
+ <Icon name="spinner" className="animate-spin -ml-1 mr-2 h-4 w-4 text-white" />
)}
{confirmText ?? t('common.confirm')}
</button>
diff --git a/apps/web/src/components/shared/Icon.tsx b/apps/web/src/components/shared/Icon.tsx
new file mode 100644
index 000000000..b65ddf17c
--- /dev/null
+++ b/apps/web/src/components/shared/Icon.tsx
@@ -0,0 +1,23 @@
+import { UiIcons, type UiIconName } from '@aliasvault/models/icons';
+import React from 'react';
+
+/**
+ * Icon props: the icon name plus any svg prop, which overrides the icon's own attributes.
+ */
+export type IconProps = Omit<React.SVGProps<SVGSVGElement>, 'name'> & {
+ name: UiIconName;
+};
+
+/**
+ * A UI icon from the shared catalog in core/models/src/icons.
+ */
+const Icon: React.FC<IconProps> = ({ name, ...props }) => {
+ const icon = UiIcons[name];
+ return (
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox={icon.viewBox} aria-hidden={props['aria-label'] ? undefined : true} {...icon.attrs} {...props}>
+ {icon.nodes.map(([tag, attrs], index) => React.createElement(tag, { key: index, ...attrs }))}
+ </svg>
+ );
+};
+
+export default Icon;
diff --git a/apps/web/src/components/shared/PasswordConfirmationModal.tsx b/apps/web/src/components/shared/PasswordConfirmationModal.tsx
index 9a86a8d82..52050b803 100644
--- a/apps/web/src/components/shared/PasswordConfirmationModal.tsx
+++ b/apps/web/src/components/shared/PasswordConfirmationModal.tsx
@@ -4,6 +4,7 @@ import { useTranslation } from 'react-i18next';
import AlertMessageError from '@/components/alerts/AlertMessageError';
import PasswordInputField from '@/components/auth/PasswordInputField';
import FormModal from '@/components/shared/FormModal';
+import Icon from '@/components/shared/Icon';
type PasswordConfirmationModalProps = {
isOpen: boolean;
@@ -61,9 +62,7 @@ const PasswordConfirmationModal: React.FC<PasswordConfirmationModalProps> = ({ i
closeOnOverlayClick={false}
submitOnEnter={true}
icon={(
- <svg className="h-6 w-6 text-orange-600 dark:text-orange-400" fill="none" viewBox="0 0 24 24" strokeWidth="1.5" stroke="currentColor">
- <path strokeLinecap="round" strokeLinejoin="round" d="M16.5 10.5V6.75a4.5 4.5 0 10-9 0v3.75m-.75 11.25h10.5a2.25 2.25 0 002.25-2.25v-6.75a2.25 2.25 0 00-2.25-2.25H6.75a2.25 2.25 0 00-2.25 2.25v6.75a2.25 2.25 0 002.25 2.25z" />
- </svg>
+ <Icon name="lock-closed" className="h-6 w-6 text-orange-600 dark:text-orange-400" />
)}>
<p className="text-sm text-gray-500 dark:text-gray-400 mb-4">{description}</p>
diff --git a/apps/web/src/components/shared/RefreshButton.tsx b/apps/web/src/components/shared/RefreshButton.tsx
index 034418952..22b20c0aa 100644
--- a/apps/web/src/components/shared/RefreshButton.tsx
+++ b/apps/web/src/components/shared/RefreshButton.tsx
@@ -1,6 +1,7 @@
import React, { useCallback, useEffect, useRef, useState } from 'react';
import Button from '@/components/shared/Button';
+import Icon from '@/components/shared/Icon';
type RefreshButtonProps = {
onClick: () => void | Promise<void>;
@@ -37,9 +38,7 @@ const RefreshButton: React.FC<RefreshButtonProps> = ({ onClick, buttonText, addi
return (
<Button onClick={() => void handleClick()} display="flex" color="outline" additionalClasses={additionalClasses}>
- <svg className={`w-4 h-4 ${isRefreshing ? 'animate-spin-ccw' : ''}`} fill="none" stroke="currentColor" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
- <path strokeLinecap="round" strokeLinejoin="round" strokeWidth="2" d="M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15"></path>
- </svg>
+ <Icon name="refresh" className={`w-4 h-4 ${isRefreshing ? 'animate-spin-ccw' : ''}`} />
<span className="ml-2">{buttonText}</span>
</Button>
);
diff --git a/apps/web/src/components/shared/ResponsivePaginator.tsx b/apps/web/src/components/shared/ResponsivePaginator.tsx
index 7290ce016..91f3ae89f 100644
--- a/apps/web/src/components/shared/ResponsivePaginator.tsx
+++ b/apps/web/src/components/shared/ResponsivePaginator.tsx
@@ -1,6 +1,8 @@
import React from 'react';
import { useTranslation } from 'react-i18next';
+import Icon from '@/components/shared/Icon';
+
type ResponsivePaginatorProps = {
currentPage: number;
pageSize: number;
@@ -60,9 +62,7 @@ const ResponsivePaginator: React.FC<ResponsivePaginatorProps> = ({ currentPage,
<ul className="flex items-center space-x-2">
<li className={currentPage === 1 ? 'opacity-50 cursor-not-allowed' : ''}>
<button onClick={() => setPage(currentPage - 1)} disabled={currentPage === 1} className={`${pillClasses} disabled:opacity-50 disabled:cursor-not-allowed`}>
- <svg className="w-4 h-4" fill="currentColor" viewBox="0 0 20 20">
- <path fillRule="evenodd" d="M12.707 5.293a1 1 0 010 1.414L9.414 10l3.293 3.293a1 1 0 01-1.414 1.414l-4-4a1 1 0 010-1.414l4-4a1 1 0 011.414 0z" clipRule="evenodd" />
- </svg>
+ <Icon name="chevron-left" className="w-4 h-4" />
</button>
</li>
<li>
@@ -72,9 +72,7 @@ const ResponsivePaginator: React.FC<ResponsivePaginatorProps> = ({ currentPage,
</li>
<li className={currentPage === pageCount ? 'opacity-50 cursor-not-allowed' : ''}>
<button onClick={() => setPage(currentPage + 1)} disabled={currentPage === pageCount} className={`${pillClasses} disabled:opacity-50 disabled:cursor-not-allowed`}>
- <svg className="w-4 h-4" fill="currentColor" viewBox="0 0 20 20">
- <path fillRule="evenodd" d="M7.293 14.707a1 1 0 010-1.414L10.586 10 7.293 6.707a1 1 0 011.414-1.414l4 4a1 1 0 010 1.414l-4 4a1 1 0 01-1.414 0z" clipRule="evenodd" />
- </svg>
+ <Icon name="chevron-right" className="w-4 h-4" />
</button>
</li>
</ul>
diff --git a/apps/web/src/components/shared/SortableTable.tsx b/apps/web/src/components/shared/SortableTable.tsx
index 1e714784f..00a3b2513 100644
--- a/apps/web/src/components/shared/SortableTable.tsx
+++ b/apps/web/src/components/shared/SortableTable.tsx
@@ -1,5 +1,7 @@
import React from 'react';
+import Icon from '@/components/shared/Icon';
+
/** Sort direction. */
export type SortDirection = 'asc' | 'desc';
@@ -46,13 +48,9 @@ const SortableTable: React.FC<SortableTableProps> = ({ columns, sortColumn, sort
<span className="ml-1">
{sortColumn === column.propertyName && (
sortDirection === 'asc' ? (
- <svg className="w-3 h-3" fill="currentColor" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg">
- <path fillRule="evenodd" d="M5.293 7.707a1 1 0 010-1.414l4-4a1 1 0 011.414 0l4 4a1 1 0 01-1.414 1.414L11 5.414V17a1 1 0 11-2 0V5.414L6.707 7.707a1 1 0 01-1.414 0z" clipRule="evenodd"></path>
- </svg>
+ <Icon name="arrow-narrow-up" className="w-3 h-3" />
) : (
- <svg className="w-3 h-3" fill="currentColor" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg">
- <path fillRule="evenodd" d="M14.707 12.293a1 1 0 010 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 111.414-1.414L9 14.586V3a1 1 0 012 0v11.586l2.293-2.293a1 1 0 011.414 0z" clipRule="evenodd"></path>
- </svg>
+ <Icon name="arrow-narrow-down" className="w-3 h-3" />
)
)}
</span>
diff --git a/apps/web/src/components/totp/TotpCodes.tsx b/apps/web/src/components/totp/TotpCodes.tsx
index 52f312a19..720262e01 100644
--- a/apps/web/src/components/totp/TotpCodes.tsx
+++ b/apps/web/src/components/totp/TotpCodes.tsx
@@ -8,6 +8,7 @@ import Button from '@/components/shared/Button';
import Card from '@/components/shared/Card';
import FormLabel from '@/components/shared/FormLabel';
import FormModal from '@/components/shared/FormModal';
+import Icon from '@/components/shared/Icon';
import InputTextField from '@/components/shared/InputTextField';
import SectionTitle from '@/components/shared/SectionTitle';
import { useConfirmModal } from '@/context/ConfirmModalContext';
@@ -155,10 +156,7 @@ const TotpCodes: React.FC<TotpCodesProps> = ({ totpCodes, onTotpCodesChange, can
}, [editingCode, itemDisplayName, itemUsername, showQrCode]);
const removeIcon = (
- <svg className="w-4 h-4" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round">
- <line x1="18" y1="6" x2="6" y2="18" />
- <line x1="6" y1="6" x2="18" y2="18" />
- </svg>
+ <Icon name="x" className="w-4 h-4" />
);
return (
@@ -171,16 +169,12 @@ const TotpCodes: React.FC<TotpCodesProps> = ({ totpCodes, onTotpCodesChange, can
<div className="flex items-center gap-2">
{visibleCodes.length > 0 && !isAddFormVisible && (
<button id="add-totp-code" onClick={showAddForm} type="button" className="text-primary-700 hover:text-white border border-primary-700 hover:bg-primary-800 focus:ring-2 focus:outline-none focus:ring-primary-300 font-medium rounded-lg text-xs w-8 h-8 flex items-center justify-center dark:border-primary-500 dark:text-primary-500 dark:hover:text-white dark:hover:bg-primary-600 dark:focus:ring-primary-800" title={t('totp.addTotpCodeDescription')}>
- <svg className="w-4 h-4" fill="none" stroke="currentColor" strokeWidth="2.5" viewBox="0 0 24 24">
- <path strokeLinecap="round" strokeLinejoin="round" d="M12 4.5v15m7.5-7.5h-15" />
- </svg>
+ <Icon name="plus" className="w-4 h-4" strokeWidth={2.5} />
</button>
)}
{canRemove && (
<button type="button" onClick={onRemove} className="text-gray-400 hover:text-red-500 transition-colors w-6 h-6 flex items-center justify-center" title={t('common.delete')}>
- <svg className="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24">
- <path strokeLinecap="round" strokeLinejoin="round" strokeWidth="2" d="M6 18L18 6M6 6l12 12" />
- </svg>
+ <Icon name="x" className="w-5 h-5" />
</button>
)}
</div>
@@ -198,9 +192,7 @@ const TotpCodes: React.FC<TotpCodesProps> = ({ totpCodes, onTotpCodesChange, can
<h4 className="text-lg font-medium text-gray-900 dark:text-white">{t('totp.addTotpCodeModalTitle')}</h4>
{visibleCodes.length > 0 && (
<button onClick={() => setIsAddFormVisible(false)} type="button" className="text-gray-400 bg-transparent hover:bg-gray-200 hover:text-gray-900 rounded-lg text-sm w-8 h-8 ms-auto inline-flex justify-center items-center dark:hover:bg-gray-600 dark:hover:text-white">
- <svg className="w-3 h-3" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 14 14">
- <path stroke="currentColor" strokeLinecap="round" strokeLinejoin="round" strokeWidth="2" d="m1 1 6 6m0 0 6 6M7 7l6-6M7 7l-6 6" />
- </svg>
+ <Icon name="x" className="w-3 h-3" />
<span className="sr-only">{t('totp.closeFormButton')}</span>
</button>
)}
@@ -253,14 +245,10 @@ const TotpCodes: React.FC<TotpCodesProps> = ({ totpCodes, onTotpCodesChange, can
<div className="text-sm text-gray-500 dark:text-gray-400">{t('totp.saveToViewCode')}</div>
</div>
<button type="button" onClick={() => showEditModal(code)} className="edit-totp-code text-gray-400 hover:text-gray-600 dark:hover:text-gray-300" title={t('common.edit')}>
- <svg className="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24">
- <path strokeLinecap="round" strokeLinejoin="round" strokeWidth="2" d="M11 5H6a2 2 0 00-2 2v11a2 2 0 002 2h11a2 2 0 002-2v-5m-1.414-9.414a2 2 0 112.828 2.828L11.828 15H9v-2.828l8.586-8.586z"></path>
- </svg>
+ <Icon name="pencil-alt" className="w-5 h-5" />
</button>
<button type="button" onClick={() => void deleteTotpCode(code)} className="delete-totp-code text-red-600 hover:text-red-800 dark:text-red-500 dark:hover:text-red-400">
- <svg className="w-5 h-5" fill="currentColor" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg">
- <path fillRule="evenodd" d="M9 2a1 1 0 00-.894.553L7.382 4H4a1 1 0 000 2v10a2 2 0 002 2h8a2 2 0 002-2V6a1 1 0 100-2h-3.382l-.724-1.447A1 1 0 0011 2H9zM7 8a1 1 0 012 0v6a1 1 0 11-2 0V8zm5-1a1 1 0 00-1 1v6a1 1 0 102 0V8a1 1 0 00-1-1z" clipRule="evenodd"></path>
- </svg>
+ <Icon name="trash" className="w-5 h-5" />
</button>
</div>
</div>
@@ -277,9 +265,7 @@ const TotpCodes: React.FC<TotpCodesProps> = ({ totpCodes, onTotpCodesChange, can
<div className="flex items-center justify-between mb-2">
<label className="text-sm font-medium text-gray-900 dark:text-white">{t('totp.secretKey')}</label>
<button type="button" onClick={() => setShowQrCode(v => !v)} className="text-gray-400 hover:text-gray-600 dark:hover:text-gray-300 p-1" title={`${showQrCode ? t('common.hide') : t('common.show')} QR Code`}>
- <svg className="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24">
- <path strokeLinecap="round" strokeLinejoin="round" strokeWidth="2" d="M12 4v1m6 11h2m-6 0h-2v4m0-11v3m0 0h.01M12 12h4.01M16 20h4M4 12h4m12 0h.01M5 8h2a1 1 0 001-1V5a1 1 0 00-1-1H5a1 1 0 00-1 1v2a1 1 0 001 1zm12 0h2a1 1 0 001-1V5a1 1 0 00-1-1h-2a1 1 0 00-1 1v2a1 1 0 001 1zM5 20h2a1 1 0 001-1v-2a1 1 0 00-1-1H5a1 1 0 00-1 1v2a1 1 0 001 1z" />
- </svg>
+ <Icon name="qrcode" className="w-5 h-5" />
</button>
</div>
<input type="text" value={editSecret} onChange={e => setEditSecret(e.target.value)} className="bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-primary-500 focus:border-primary-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:text-white font-mono" placeholder={t('totp.secretKey')} />
diff --git a/apps/web/src/pages/Welcome.tsx b/apps/web/src/pages/Welcome.tsx
index b3b567d9f..175fe5624 100644
--- a/apps/web/src/pages/Welcome.tsx
+++ b/apps/web/src/pages/Welcome.tsx
@@ -3,6 +3,7 @@ import { useTranslation } from 'react-i18next';
import { useNavigate } from 'react-router-dom';
import { ButtonLabel } from '@/components/shared/Button';
+import Icon from '@/components/shared/Icon';
import { useDb } from '@/context/DbContext';
import { useLoading } from '@/context/LoadingContext';
import { usePageTitle } from '@/hooks/usePageTitle';
@@ -111,9 +112,7 @@ const Welcome: React.FC = () => {
{step === 'welcome' && (
<div className="space-y-4">
<p className="flex items-start gap-2 text-gray-600 dark:text-gray-400">
- <svg className="w-5 h-5 mt-0.5 flex-shrink-0 text-green-600 dark:text-green-400" fill="currentColor" viewBox="0 0 20 20" aria-hidden="true">
- <path fillRule="evenodd" d="M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z" clipRule="evenodd" />
- </svg>
+ <Icon name="check" className="w-5 h-5 mt-0.5 flex-shrink-0 text-green-600 dark:text-green-400" />
<span>{t('web.welcome.welcomeMessage')}</span>
</p>
</div>
diff --git a/apps/web/src/pages/auth/Login.tsx b/apps/web/src/pages/auth/Login.tsx
index 32f6126f2..9569f963a 100644
--- a/apps/web/src/pages/auth/Login.tsx
+++ b/apps/web/src/pages/auth/Login.tsx
@@ -15,6 +15,7 @@ import PasswordInputField from '@/components/auth/PasswordInputField';
import FooterLogin from '@/components/layout/FooterLogin';
import Button from '@/components/shared/Button';
import FormLabel from '@/components/shared/FormLabel';
+import Icon from '@/components/shared/Icon';
import InputTextField from '@/components/shared/InputTextField';
import { getAppConfig } from '@/config/AppConfig';
import { useAuth } from '@/context/AuthContext';
@@ -366,9 +367,7 @@ const Login: React.FC = () => {
<div className="flex flex-col gap-4">
<Button type="submit" id="login-button" size="lg" display="flex" additionalClasses="w-full">{t('auth.login')}</Button>
<Button id="mobile-login-button" onClick={() => setShowMobileLoginModal(true)} color="outline" size="lg" display="flex" additionalClasses="hidden md:flex w-full">
- <svg className="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
- <path strokeLinecap="round" strokeLinejoin="round" strokeWidth="2" d="M12 18h.01M8 21h8a2 2 0 002-2V5a2 2 0 00-2-2H8a2 2 0 00-2 2v14a2 2 0 002 2z"></path>
- </svg>
+ <Icon name="device-mobile" className="w-5 h-5" />
{t('auth.loginWithMobile')}
</Button>
</div>
diff --git a/apps/web/src/pages/auth/Setup.tsx b/apps/web/src/pages/auth/Setup.tsx
index c8ebfd2c0..f5999c540 100644
--- a/apps/web/src/pages/auth/Setup.tsx
+++ b/apps/web/src/pages/auth/Setup.tsx
@@ -9,6 +9,7 @@ import LanguageSwitcher from '@/components/auth/LanguageSwitcher';
import Logo from '@/components/auth/Logo';
import { CreatingStep, PasswordStep, TermsAndConditionsStep, UsernameStep } from '@/components/auth/setup/SetupSteps';
import { ButtonLabel } from '@/components/shared/Button';
+import Icon from '@/components/shared/Icon';
import { getAppConfig } from '@/config/AppConfig';
import { useWebApi } from '@/context/WebApiContext';
import { usePageTitle } from '@/hooks/usePageTitle';
@@ -118,18 +119,14 @@ const Setup: React.FC = () => {
<div className="flex justify-between items-center mb-4">
<div>
<button type="button" onClick={goBack} className={`text-gray-500 hover:text-gray-800 dark:text-gray-400 dark:hover:text-gray-200 ${stepIndex === 0 ? 'invisible' : ''}`}>
- <svg className="w-8 h-8" fill="none" stroke="currentColor" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
- <path strokeLinecap="round" strokeLinejoin="round" strokeWidth="2" d="M10 19l-7-7m0 0l7-7m-7 7h18"></path>
- </svg>
+ <Icon name="arrow-left" className="w-8 h-8" />
</button>
</div>
<div className="flex-grow text-center">
<h2 className="text-xl font-semibold text-gray-900 dark:text-white">{stepTitle()}</h2>
</div>
<button type="button" onClick={() => navigate('/')} className="text-gray-500 -mt-1 hover:text-gray-800 dark:text-gray-400 dark:hover:text-gray-200">
- <svg className="w-8 h-8" fill="none" stroke="currentColor" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
- <path strokeLinecap="round" strokeLinejoin="round" strokeWidth="2" d="M6 18L18 6M6 6l12 12"></path>
- </svg>
+ <Icon name="x" className="w-8 h-8" />
</button>
</div>
{progressPercentage > 0 && (
diff --git a/apps/web/src/pages/auth/Unlock.tsx b/apps/web/src/pages/auth/Unlock.tsx
index 2e64fea99..95f4c3594 100644
--- a/apps/web/src/pages/auth/Unlock.tsx
+++ b/apps/web/src/pages/auth/Unlock.tsx
@@ -19,6 +19,7 @@ import FooterLogin from '@/components/layout/FooterLogin';
import BoldLoadingIndicator from '@/components/loading/BoldLoadingIndicator';
import Button from '@/components/shared/Button';
import FormLabel from '@/components/shared/FormLabel';
+import Icon from '@/components/shared/Icon';
import { useAuth } from '@/context/AuthContext';
import { useDb } from '@/context/DbContext';
import { useLoading } from '@/context/LoadingContext';
@@ -283,7 +284,7 @@ const Unlock: React.FC = () => {
<div className="flex space-x-4">
<button type="button" onClick={() => void unlockWithWebAuthn()} className="flex-grow inline-flex items-center justify-center px-5 py-2 text-base font-medium text-center text-white rounded-lg bg-primary-700 hover:bg-primary-800 focus:ring-4 focus:ring-primary-300 sm:w-auto dark:bg-primary-600 dark:hover:bg-primary-700 dark:focus:ring-primary-800">
- <svg className="w-5 h-5 mr-2 -ml-1" fill="currentColor" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M17.414 2.586a2 2 0 00-2.828 0L7 10.172V13h2.828l7.586-7.586a2 2 0 000-2.828z"></path><path fillRule="evenodd" d="M2 6a2 2 0 012-2h4a1 1 0 010 2H4v10h10v-4a1 1 0 112 0v4a2 2 0 01-2 2H4a2 2 0 01-2-2V6z" clipRule="evenodd"></path></svg>
+ <Icon name="pencil-alt" className="w-5 h-5 mr-2 -ml-1" />
{t('auth.unlockPage.unlockWithWebAuthn')}
</button>
<button type="button" onClick={showPasswordUnlock} className="inline-flex items-center justify-center px-5 py-2 text-base font-medium text-center text-gray-900 rounded-lg border border-gray-300 hover:bg-gray-100 focus:ring-4 focus:ring-gray-100 dark:text-white dark:border-gray-700 dark:hover:bg-gray-700 dark:focus:ring-gray-800">
@@ -312,9 +313,7 @@ const Unlock: React.FC = () => {
{!dbContext.isOffline && (
<Button id="mobile-unlock-button" onClick={() => setShowMobileUnlockModal(true)} color="outline" size="lg" display="flex" additionalClasses="hidden md:flex w-full mt-4">
- <svg className="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
- <path strokeLinecap="round" strokeLinejoin="round" strokeWidth="2" d="M12 18h.01M8 21h8a2 2 0 002-2V5a2 2 0 00-2-2H8a2 2 0 00-2 2v14a2 2 0 002 2z"></path>
- </svg>
+ <Icon name="device-mobile" className="w-5 h-5" />
{t('auth.unlockPage.unlockWithMobileButton')}
</Button>
)}
diff --git a/apps/web/src/pages/emails/Home.tsx b/apps/web/src/pages/emails/Home.tsx
index 4a7930549..caea1e3db 100644
--- a/apps/web/src/pages/emails/Home.tsx
+++ b/apps/web/src/pages/emails/Home.tsx
@@ -11,6 +11,7 @@ import EmailPreviewSkeleton from '@/components/email/EmailPreviewSkeleton';
import EmailRow, { type MailListEntry } from '@/components/email/EmailRow';
import EmailRowSkeleton from '@/components/email/EmailRowSkeleton';
import DeleteAllSelectedButton from '@/components/shared/DeleteAllSelectedButton';
+import Icon from '@/components/shared/Icon';
import PageContent from '@/components/shared/PageContent';
import PageHeader from '@/components/shared/PageHeader';
import RefreshButton from '@/components/shared/RefreshButton';
@@ -506,10 +507,7 @@ const EmailsHome: React.FC = () => {
className="w-full px-4 py-2 text-sm font-medium text-primary-600 bg-primary-50 border border-primary-200 rounded-md hover:bg-primary-100 focus:outline-none focus:ring-2 focus:ring-primary-500 focus:ring-offset-2 disabled:opacity-50 disabled:cursor-not-allowed dark:text-primary-400 dark:bg-primary-900/20 dark:border-primary-800 dark:hover:bg-primary-900/30">
{isLoadingMore ? (
<span className="flex items-center justify-center">
- <svg className="animate-spin -ml-1 mr-2 h-4 w-4" fill="none" viewBox="0 0 24 24">
- <circle className="opacity-25" cx="12" cy="12" r="10" stroke="currentColor" strokeWidth="4"></circle>
- <path className="opacity-75" fill="currentColor" d="M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"></path>
- </svg>
+ <Icon name="spinner" className="animate-spin -ml-1 mr-2 h-4 w-4" />
{t('common.loading')}
</span>
) : (
diff --git a/apps/web/src/pages/items/AddEdit.tsx b/apps/web/src/pages/items/AddEdit.tsx
index 1bacace4c..709b11bb8 100644
--- a/apps/web/src/pages/items/AddEdit.tsx
+++ b/apps/web/src/pages/items/AddEdit.tsx
@@ -23,6 +23,7 @@ import type { BreadcrumbItem } from '@/components/shared/Breadcrumb';
import Button from '@/components/shared/Button';
import Card from '@/components/shared/Card';
import FormLabel from '@/components/shared/FormLabel';
+import Icon from '@/components/shared/Icon';
import PageContent from '@/components/shared/PageContent';
import PageHeader from '@/components/shared/PageHeader';
import SectionTitle from '@/components/shared/SectionTitle';
@@ -62,9 +63,7 @@ const Section: React.FC<{ title?: React.ReactNode; children: React.ReactNode; cl
* The passkey key icon.
*/
const PasskeyIcon: React.FC<{ className: string }> = ({ className }) => (
- <svg className={className} viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round">
- <path d="M21 2l-2 2m-7.61 7.61a5.5 5.5 0 1 1-7.778 7.778 5.5 5.5 0 0 1 7.777-7.777zm0 0L15.5 7.5m0 0l3 3L22 7l-3-3m-3.5 3.5L19 4" />
- </svg>
+ <Icon name="key" className={className} />
);
/**
@@ -589,10 +588,7 @@ const ItemAddEditForm: React.FC = () => {
<span>{t('items.loginCredentials')}</span>
{edit.ItemType === ItemTypes.Login && !shouldShowField(FieldKey.LoginEmail) && (
<button type="button" onClick={() => addOptionalField(FieldKey.LoginEmail)} className="inline-flex items-center gap-1 px-2 py-0.5 text-xs rounded-full transition-colors focus:outline-none text-gray-500 dark:text-gray-400 hover:text-primary-600 dark:hover:text-primary-400 border border-dashed border-gray-300 dark:border-gray-600 hover:border-primary-400 dark:hover:border-primary-500">
- <svg className="w-2.5 h-2.5 -ml-0.5" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2.5">
- <line x1="12" y1="5" x2="12" y2="19" />
- <line x1="5" y1="12" x2="19" y2="12" />
- </svg>
+ <Icon name="plus" className="w-2.5 h-2.5 -ml-0.5" strokeWidth={2.5} />
<span>{t('common.email')}</span>
</button>
)}
@@ -610,12 +606,7 @@ const ItemAddEditForm: React.FC = () => {
<div className="mb-1 flex items-center justify-between">
<span className="text-sm font-semibold text-gray-900 dark:text-white">{t('passkeys.passkey')}</span>
<button type="button" onClick={() => setPasskeyMarkedForDeletion(true)} className="text-red-600 dark:text-red-400 hover:text-red-700 dark:hover:text-red-300" title={t('items.addEdit.deletePasskeyButton')}>
- <svg className="w-4 h-4" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round">
- <polyline points="3 6 5 6 21 6" />
- <path d="M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2" />
- <line x1="10" y1="11" x2="10" y2="17" />
- <line x1="14" y1="11" x2="14" y2="17" />
- </svg>
+ <Icon name="trash" className="w-4 h-4" />
</button>
</div>
<div className="space-y-1 mb-2">
@@ -646,10 +637,7 @@ const ItemAddEditForm: React.FC = () => {
<div className="mb-1 flex items-center justify-between">
<span className="text-sm font-semibold text-red-900 dark:text-red-100">{t('passkeys.passkeyMarkedForDeletion')}</span>
<button type="button" onClick={() => setPasskeyMarkedForDeletion(false)} className="text-gray-600 dark:text-gray-400 hover:text-gray-700 dark:hover:text-gray-300" title={t('common.undo')}>
- <svg className="w-4 h-4" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round">
- <path d="M3 7v6h6" />
- <path d="M21 17a9 9 0 00-9-9 9 9 0 00-6 2.3L3 13" />
- </svg>
+ <Icon name="reply" className="w-4 h-4" />
</button>
</div>
<p className="text-xs text-red-800 dark:text-red-200">{t('items.addEdit.passkeyWillBeDeleted')}</p>
@@ -677,10 +665,7 @@ const ItemAddEditForm: React.FC = () => {
<SectionTitle className="mb-3 flex items-center justify-between gap-2">
<span>{t('common.alias')}</span>
<button type="button" id="generate-random-alias" onClick={() => void onGenerateRandomAlias()} className="p-1.5 text-gray-400 hover:text-primary-500 transition-colors focus:outline-none" title={t('common.generate')}>
- <svg className="w-4 h-4" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round">
- <path d="M23 4v6h-6" />
- <path d="M20.49 15a9 9 0 1 1-2.12-9.36L23 10" />
- </svg>
+ <Icon name="refresh" className="w-4 h-4" />
</button>
</SectionTitle>
<div className="grid gap-4">
@@ -706,9 +691,7 @@ const ItemAddEditForm: React.FC = () => {
{secretField(FieldKey.CardPin, 'pin', t('fieldLabels.card.pin'))}
{canRemoveField(FieldKey.CardPin) && (
<button type="button" onClick={() => removeOptionalField(FieldKey.CardPin)} className="absolute top-0 right-0 text-gray-400 hover:text-red-500 transition-colors" title={t('items.addEdit.removeField')}>
- <svg className="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24">
- <path strokeLinecap="round" strokeLinejoin="round" strokeWidth="2" d="M6 18L18 6M6 6l12 12" />
- </svg>
+ <Icon name="x" className="w-4 h-4" />
</button>
)}
</div>
diff --git a/apps/web/src/pages/items/Home.tsx b/apps/web/src/pages/items/Home.tsx
index 6d3956603..02ffc9e64 100644
--- a/apps/web/src/pages/items/Home.tsx
+++ b/apps/web/src/pages/items/Home.tsx
@@ -19,6 +19,7 @@ import LoadingIndicator from '@/components/loading/LoadingIndicator';
import type { BreadcrumbItem } from '@/components/shared/Breadcrumb';
import Button from '@/components/shared/Button';
import FormLabel from '@/components/shared/FormLabel';
+import Icon from '@/components/shared/Icon';
import LinkButton from '@/components/shared/LinkButton';
import PageContent from '@/components/shared/PageContent';
import PageHeader from '@/components/shared/PageHeader';
@@ -489,15 +490,10 @@ const ItemsHome: React.FC = () => {
titleActions={isInFolder && !currentFolderIsVirtual ? (
<>
<button onClick={() => setShowEditFolderModal(true)} title={t('items.folders.editFolder')} className="p-1.5 text-gray-400 hover:text-orange-500 dark:text-gray-500 dark:hover:text-orange-400 hover:bg-gray-100 dark:hover:bg-gray-700 rounded-lg transition-colors">
- <svg className="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24">
- <path strokeLinecap="round" strokeLinejoin="round" strokeWidth="2" d="M11 5H6a2 2 0 00-2 2v11a2 2 0 002 2h11a2 2 0 002-2v-5m-1.414-9.414a2 2 0 112.828 2.828L11.828 15H9v-2.828l8.586-8.586z" />
- </svg>
+ <Icon name="pencil-alt" className="w-5 h-5" />
</button>
<button onClick={() => setShowDeleteFolderModal(true)} title={t('items.folders.deleteFolder')} className="p-1.5 text-gray-400 hover:text-red-500 dark:text-gray-500 dark:hover:text-red-400 hover:bg-gray-100 dark:hover:bg-gray-700 rounded-lg transition-colors">
- <svg className="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24">
- <polyline points="3 6 5 6 21 6" />
- <path d="M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2" />
- </svg>
+ <Icon name="trash" className="w-5 h-5" strokeWidth={1} />
</button>
</>
) : undefined} />
@@ -506,9 +502,7 @@ const ItemsHome: React.FC = () => {
<>
<div className="relative">
<button ref={settingsButtonRef} onClick={() => setShowSettingsDropdown(!showSettingsDropdown)} id="settingsButton" className="p-2 text-gray-500 rounded-lg hover:text-gray-900 hover:bg-gray-100 dark:text-gray-400 dark:hover:text-white dark:hover:bg-gray-700">
- <svg className="w-5 h-5" fill="currentColor" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg">
- <path fillRule="evenodd" d="M11.49 3.17c-.38-1.56-2.6-1.56-2.98 0a1.532 1.532 0 01-2.286.948c-1.372-.836-2.942.734-2.106 2.106.54.886.061 2.042-.947 2.287-1.561.379-1.561 2.6 0 2.978a1.532 1.532 0 01.947 2.287c-.836 1.372.734 2.942 2.106 2.106a1.532 1.532 0 012.287.947c.379 1.561 2.6 1.561 2.978 0a1.533 1.533 0 012.287-.947c1.372.836 2.942-.734 2.106-2.106a1.533 1.533 0 01.947-2.287c1.561-.379 1.561-2.6 0-2.978a1.532 1.532 0 01-.947-2.287c.836-1.372-.734-2.942-2.106-2.106a1.532 1.532 0 01-2.287-.947zM10 13a3 3 0 100-6 3 3 0 000 6z" clipRule="evenodd"></path>
- </svg>
+ <Icon name="cog" className="w-5 h-5" />
</button>
{showSettingsDropdown && (
@@ -550,10 +544,7 @@ const ItemsHome: React.FC = () => {
<span className="text-sm text-gray-500 dark:text-gray-400">{t('items.home.filteringBy')}</span>
<button onClick={() => setFilter(ItemFilter.All)} className="inline-flex items-center gap-1 px-3 py-1.5 text-sm bg-orange-100 dark:bg-orange-900/30 hover:bg-orange-200 dark:hover:bg-orange-900/50 text-orange-700 dark:text-orange-300 rounded-lg transition-colors">
<span>{getFilterTitle()}</span>
- <svg className="w-4 h-4" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2">
- <line x1="18" y1="6" x2="6" y2="18" />
- <line x1="6" y1="6" x2="18" y2="18" />
- </svg>
+ <Icon name="x" className="w-4 h-4" />
</button>
</div>
)}
@@ -567,13 +558,8 @@ const ItemsHome: React.FC = () => {
))}
{canCreateSubfolder && (
<button onClick={() => setShowFolderModal(true)} className={getAddFolderButtonClass()}>
- <svg className="w-4 h-4" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2">
- <path strokeLinecap="round" strokeLinejoin="round" d="M3 7v10a2 2 0 002 2h14a2 2 0 002-2V9a2 2 0 00-2-2h-6l-2-2H5a2 2 0 00-2 2z" />
- </svg>
- <svg className="w-3.5 h-3.5 -ml-0.5" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2.5">
- <line x1="12" y1="5" x2="12" y2="19" />
- <line x1="5" y1="12" x2="19" y2="12" />
- </svg>
+ <Icon name="folder" className="w-4 h-4" />
+ <Icon name="plus" className="w-3.5 h-3.5 -ml-0.5" strokeWidth={2.5} />
{currentLevelFolders.length === 0 && <span>{t('items.folders.newFolder')}</span>}
</button>
)}
@@ -610,10 +596,7 @@ const ItemsHome: React.FC = () => {
<div ref={sentinelRef} className="flex justify-center py-4 min-h-[40px]">
{isLoadingMore && (
<div className="flex items-center gap-2 text-sm text-gray-500 dark:text-gray-400">
- <svg className="w-4 h-4 animate-spin" fill="none" viewBox="0 0 24 24">
- <circle className="opacity-25" cx="12" cy="12" r="10" stroke="currentColor" strokeWidth="4"></circle>
- <path className="opacity-75" fill="currentColor" d="M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"></path>
- </svg>
+ <Icon name="spinner" className="w-4 h-4 animate-spin" />
<span>{t('items.home.loadingMore')}</span>
</div>
)}
diff --git a/apps/web/src/pages/items/RecentlyDeleted.tsx b/apps/web/src/pages/items/RecentlyDeleted.tsx
index 33346c7db..61455a4c9 100644
--- a/apps/web/src/pages/items/RecentlyDeleted.tsx
+++ b/apps/web/src/pages/items/RecentlyDeleted.tsx
@@ -9,6 +9,7 @@ import ItemFilterDropdown from '@/components/items/ItemFilterDropdown';
import ItemIcon from '@/components/items/ItemIcon';
import LoadingIndicator from '@/components/loading/LoadingIndicator';
import FormModal from '@/components/shared/FormModal';
+import Icon from '@/components/shared/Icon';
import PageContent from '@/components/shared/PageContent';
import PageHeader from '@/components/shared/PageHeader';
import Text from '@/components/shared/Text';
@@ -39,9 +40,7 @@ const getDaysRemaining = (deletedAt: string | undefined): number => {
* Red warning icon of the delete confirmations.
*/
const DeleteIcon: React.FC = () => (
- <svg className="h-6 w-6 text-red-600 dark:text-red-400" fill="none" viewBox="0 0 24 24" strokeWidth="1.5" stroke="currentColor">
- <path strokeLinecap="round" strokeLinejoin="round" d="M12 9v3.75m-9.303 3.376c-.866 1.5.217 3.374 1.948 3.374h14.71c1.73 0 2.813-1.874 1.948-3.374L13.949 3.378c-.866-1.5-3.032-1.5-3.898 0L2.697 16.126zM12 15.75h.007v.008H12v-.008z" />
- </svg>
+ <Icon name="exclamation" className="h-6 w-6 text-red-600 dark:text-red-400" />
);
/**
diff --git a/apps/web/src/pages/items/View.tsx b/apps/web/src/pages/items/View.tsx
index b5077c8ba..6ad2ce443 100644
--- a/apps/web/src/pages/items/View.tsx
+++ b/apps/web/src/pages/items/View.tsx
@@ -18,6 +18,7 @@ import type { BreadcrumbItem } from '@/components/shared/Breadcrumb';
import Button from '@/components/shared/Button';
import Card from '@/components/shared/Card';
import FormModal from '@/components/shared/FormModal';
+import Icon from '@/components/shared/Icon';
import LinkButton from '@/components/shared/LinkButton';
import PageContent from '@/components/shared/PageContent';
import PageHeader from '@/components/shared/PageHeader';
@@ -234,9 +235,7 @@ const ItemView: React.FC = () => {
{passkey && (
<div className="mb-6 p-3 rounded-lg bg-gray-50 dark:bg-gray-900 border border-gray-200 dark:border-gray-700">
<div className="flex items-start gap-3">
- <svg className="w-5 h-5 text-gray-600 dark:text-gray-400 mt-0.5 flex-shrink-0" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round">
- <path d="M21 2l-2 2m-7.61 7.61a5.5 5.5 0 1 1-7.778 7.778 5.5 5.5 0 0 1 7.777-7.777zm0 0L15.5 7.5m0 0l3 3L22 7l-3-3m-3.5 3.5L19 4" />
- </svg>
+ <Icon name="key" className="w-5 h-5 text-gray-600 dark:text-gray-400 mt-0.5 flex-shrink-0" />
<div className="flex-1">
<div className="mb-1">
<span className="text-sm font-semibold text-gray-900 dark:text-white">{t('passkeys.passkey')}</span>
@@ -318,9 +317,7 @@ const ItemView: React.FC = () => {
}
}}
icon={(
- <svg className="h-6 w-6 text-red-600 dark:text-red-400" fill="none" viewBox="0 0 24 24" strokeWidth="1.5" stroke="currentColor">
- <path strokeLinecap="round" strokeLinejoin="round" d="M12 9v3.75m-9.303 3.376c-.866 1.5.217 3.374 1.948 3.374h14.71c1.73 0 2.813-1.874 1.948-3.374L13.949 3.378c-.866-1.5-3.032-1.5-3.898 0L2.697 16.126zM12 15.75h.007v.008H12v-.008z" />
- </svg>
+ <Icon name="exclamation" className="h-6 w-6 text-red-600 dark:text-red-400" />
)}
>
<p className="text-sm text-gray-500 dark:text-gray-400 mb-3">{t('items.delete.deleteItemDescription', { days: TRASH_RETENTION_DEFAULT_DAYS })}</p>
diff --git a/apps/web/src/pages/settings/FamilySharing.tsx b/apps/web/src/pages/settings/FamilySharing.tsx
index 9ad80e554..8b692b828 100644
--- a/apps/web/src/pages/settings/FamilySharing.tsx
+++ b/apps/web/src/pages/settings/FamilySharing.tsx
@@ -16,6 +16,7 @@ import LoadingIndicator from '@/components/loading/LoadingIndicator';
import SettingsPageHeader from '@/components/settings/SettingsPageHeader';
import Button from '@/components/shared/Button';
import Card from '@/components/shared/Card';
+import Icon from '@/components/shared/Icon';
import InputTextField from '@/components/shared/InputTextField';
import PageContent from '@/components/shared/PageContent';
import PasswordConfirmationModal from '@/components/shared/PasswordConfirmationModal';
@@ -442,9 +443,7 @@ const FamilySharing: React.FC = () => {
<Link to={folderRoute({ Id: folderId, ManifestId: folderId })} className="flex flex-1 items-center gap-2 min-w-0 px-2 py-1.5 rounded-lg hover:bg-gray-100 dark:hover:bg-gray-700 transition-colors">
<FolderIcon isShared className="w-5 h-5 text-orange-500" />
<span className="text-lg font-medium text-gray-900 dark:text-white truncate" title={vaultLabel(manifest)}>{vaultLabel(manifest)}</span>
- <svg className="w-4 h-4 ml-auto shrink-0 text-gray-400" fill="none" stroke="currentColor" viewBox="0 0 24 24">
- <path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M9 5l7 7-7 7" />
- </svg>
+ <Icon name="chevron-right" className="w-4 h-4 ml-auto shrink-0 text-gray-400" />
</Link>
) : (
<div className="flex flex-1 items-center gap-2 min-w-0 px-2 py-1.5">
@@ -460,10 +459,7 @@ const FamilySharing: React.FC = () => {
aria-label={t('common.edit')}
className="p-1.5 rounded-md text-gray-500 hover:text-gray-700 dark:text-gray-400 dark:hover:text-gray-200 hover:bg-gray-100 dark:hover:bg-gray-700 disabled:opacity-50"
>
- <svg className="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24">
- <path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M10.325 4.317c.426-1.756 2.924-1.756 3.35 0a1.724 1.724 0 002.573 1.066c1.543-.94 3.31.826 2.37 2.37a1.724 1.724 0 001.065 2.572c1.756.426 1.756 2.924 0 3.35a1.724 1.724 0 00-1.066 2.573c.94 1.543-.826 3.31-2.37 2.37a1.724 1.724 0 00-2.572 1.065c-.426 1.756-2.924 1.756-3.35 0a1.724 1.724 0 00-2.573-1.066c-1.543.94-3.31-.826-2.37-2.37a1.724 1.724 0 00-1.065-2.572c-1.756-.426-1.756-2.924 0-3.35a1.724 1.724 0 001.066-2.573c-.94-1.543.826-3.31 2.37-2.37.996.608 2.296.07 2.572-1.065z" />
- <path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M15 12a3 3 0 11-6 0 3 3 0 016 0z" />
- </svg>
+ <Icon name="cog" className="w-5 h-5" />
</button>
{openVaultMenuId === manifest.manifestId && (
diff --git a/apps/web/src/pages/sync/Sync.tsx b/apps/web/src/pages/sync/Sync.tsx
index 16038b9a2..d12ade741 100644
--- a/apps/web/src/pages/sync/Sync.tsx
+++ b/apps/web/src/pages/sync/Sync.tsx
@@ -11,6 +11,7 @@ import AlertMessageError from '@/components/alerts/AlertMessageError';
import CriticalErrorPanel from '@/components/alerts/CriticalErrorPanel';
import BoldLoadingIndicator from '@/components/loading/BoldLoadingIndicator';
import Button from '@/components/shared/Button';
+import Icon from '@/components/shared/Icon';
import { useAuth } from '@/context/AuthContext';
import { useDb } from '@/context/DbContext';
import { usePageTitle } from '@/hooks/usePageTitle';
@@ -293,9 +294,7 @@ const Sync: React.FC = () => {
return (
<div className="relative p-6 sm:p-8 bg-white dark:bg-gray-800 rounded-lg sm:shadow-xl max-w-md w-full mx-auto">
<div className="text-center space-y-4">
- <svg className="w-12 h-12 mx-auto text-green-600 dark:text-green-400" fill="none" stroke="currentColor" viewBox="0 0 24 24">
- <path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z" />
- </svg>
+ <Icon name="check-circle" className="w-12 h-12 mx-auto text-green-600 dark:text-green-400" />
<h2 className="text-xl font-semibold text-gray-900 dark:text-white">{t('upgrade.upgradeSuccessMessage')}</h2>
<p className="text-sm text-gray-500 dark:text-gray-400">{t('upgrade.successOtherDevices')}</p>
<button onClick={() => void navigateToHome()} type="button" id="upgrade-continue-button" className="px-4 mt-4 py-2 text-white bg-primary-600 rounded-lg hover:bg-primary-700 focus:ring-4 focus:ring-primary-300 dark:bg-primary-500 dark:hover:bg-primary-600 dark:focus:ring-primary-800">
diff --git a/core/client/src/items/__tests__/ItemLogoView.test.ts b/core/client/src/items/__tests__/ItemLogoView.test.ts
index b157d8066..96813ce96 100644
--- a/core/client/src/items/__tests__/ItemLogoView.test.ts
+++ b/core/client/src/items/__tests__/ItemLogoView.test.ts
@@ -5,13 +5,13 @@ import { effectiveItemLogo, logoSourceTranslationKey, usesWebsiteLogo } from '..
import type { ItemLogo } from '@aliasvault/models/vault';
-const stored: ItemLogo = { Id: 'logo-1', Kind: LogoKinds.Builtin, Source: 'Bank' };
+const stored: ItemLogo = { Id: 'logo-1', Kind: LogoKinds.Builtin, Source: 'bank' };
describe('usesWebsiteLogo', () => {
it('follows the website without a choice or with a favicon choice', () => {
expect(usesWebsiteLogo(undefined)).toBe(true);
expect(usesWebsiteLogo({ Kind: LogoKinds.Favicon })).toBe(true);
- expect(usesWebsiteLogo({ Kind: LogoKinds.Builtin, Source: 'Mail' })).toBe(false);
+ expect(usesWebsiteLogo({ Kind: LogoKinds.Builtin, Source: 'mail' })).toBe(false);
});
});
@@ -21,7 +21,7 @@ describe('effectiveItemLogo', () => {
});
it('previews a built-in choice over the stored logo', () => {
- expect(effectiveItemLogo(stored, { Kind: LogoKinds.Builtin, Source: 'Mail' }, null)).toEqual({ Id: '', Kind: LogoKinds.Builtin, Source: 'Mail', Name: undefined });
+ expect(effectiveItemLogo(stored, { Kind: LogoKinds.Builtin, Source: 'mail' }, null)).toEqual({ Id: '', Kind: LogoKinds.Builtin, Source: 'mail', Name: undefined });
});
it('previews the resolved domain when going back to the website icon', () => {