From c2e6c89819f041163e20207c80db772a1e0945f2 Mon Sep 17 00:00:00 2001 From: Mattias Granlund Date: Mon, 20 Nov 2023 14:38:58 +0100 Subject: [PATCH] Replace a few icons with new JSON version Testing out icons provided in JSON format by pavel. --- packages/ui/src/lib/icons/Icon.svelte | 11 ++++++++ packages/ui/src/lib/icons/IconBranch.svelte | 18 ------------ packages/ui/src/lib/icons/IconEmail.svelte | 28 ------------------- packages/ui/src/lib/icons/IconLock.svelte | 19 ------------- packages/ui/src/lib/icons/IconSettings.svelte | 20 ------------- packages/ui/src/lib/icons/icons.json | 12 ++++++++ packages/ui/src/lib/icons/index.ts | 3 -- .../[projectId]/components/FileCard.svelte | 4 +-- .../navigation/BaseBranchCard.svelte | 4 +-- .../navigation/DomainButton.svelte | 7 +++-- .../[projectId]/navigation/Footer.svelte | 7 ++--- .../[projectId]/navigation/Navigation.svelte | 3 +- 12 files changed, 35 insertions(+), 101 deletions(-) create mode 100644 packages/ui/src/lib/icons/Icon.svelte delete mode 100644 packages/ui/src/lib/icons/IconBranch.svelte delete mode 100644 packages/ui/src/lib/icons/IconEmail.svelte delete mode 100644 packages/ui/src/lib/icons/IconLock.svelte delete mode 100644 packages/ui/src/lib/icons/IconSettings.svelte create mode 100644 packages/ui/src/lib/icons/icons.json diff --git a/packages/ui/src/lib/icons/Icon.svelte b/packages/ui/src/lib/icons/Icon.svelte new file mode 100644 index 000000000..92bba8f70 --- /dev/null +++ b/packages/ui/src/lib/icons/Icon.svelte @@ -0,0 +1,11 @@ + + + + + diff --git a/packages/ui/src/lib/icons/IconBranch.svelte b/packages/ui/src/lib/icons/IconBranch.svelte deleted file mode 100644 index d61bcd90f..000000000 --- a/packages/ui/src/lib/icons/IconBranch.svelte +++ /dev/null @@ -1,18 +0,0 @@ - - - - - diff --git a/packages/ui/src/lib/icons/IconEmail.svelte b/packages/ui/src/lib/icons/IconEmail.svelte deleted file mode 100644 index 3cb92203b..000000000 --- a/packages/ui/src/lib/icons/IconEmail.svelte +++ /dev/null @@ -1,28 +0,0 @@ - - - - - - diff --git a/packages/ui/src/lib/icons/IconLock.svelte b/packages/ui/src/lib/icons/IconLock.svelte deleted file mode 100644 index 0e38787ca..000000000 --- a/packages/ui/src/lib/icons/IconLock.svelte +++ /dev/null @@ -1,19 +0,0 @@ - - - - - diff --git a/packages/ui/src/lib/icons/IconSettings.svelte b/packages/ui/src/lib/icons/IconSettings.svelte deleted file mode 100644 index 9c6f15ae6..000000000 --- a/packages/ui/src/lib/icons/IconSettings.svelte +++ /dev/null @@ -1,20 +0,0 @@ - - - - - - diff --git a/packages/ui/src/lib/icons/icons.json b/packages/ui/src/lib/icons/icons.json new file mode 100644 index 000000000..ee410e1bd --- /dev/null +++ b/packages/ui/src/lib/icons/icons.json @@ -0,0 +1,12 @@ +{ + "mail": "M0 5.83C0 4.12153 0 3.26729 0.33776 2.61708C0.622386 2.06915 1.06915 1.62239 1.61708 1.33776C2.26729 1 3.12153 1 4.83 1H11.17C12.8785 1 13.7327 1 14.3829 1.33776C14.9309 1.62239 15.3776 2.06915 15.6622 2.61708C16 3.26729 16 4.12153 16 5.83V10.17C16 11.8785 16 12.7327 15.6622 13.3829C15.3776 13.9309 14.9309 14.3776 14.3829 14.6622C13.7327 15 12.8785 15 11.17 15H4.83C3.12153 15 2.26729 15 1.61708 14.6622C1.06915 14.3776 0.622386 13.9309 0.33776 13.3829C0 12.7327 0 11.8785 0 10.17V5.83ZM4.83 2.5H11.17C12.0494 2.5 12.6173 2.50121 13.0492 2.53707C13.4631 2.57145 13.6161 2.62976 13.6915 2.66888C13.9654 2.81119 14.1888 3.03457 14.3311 3.30854C14.352 3.34874 14.3783 3.41107 14.4036 3.5234L8.81349 8.31493C8.34537 8.71617 7.65462 8.71617 7.18651 8.31493L1.5964 3.52341C1.62165 3.41107 1.648 3.34874 1.66888 3.30854C1.81119 3.03457 2.03457 2.81119 2.30854 2.66888C2.38385 2.62976 2.53687 2.57145 2.95083 2.53707C3.38275 2.50121 3.95059 2.5 4.83 2.5ZM1.50025 5.41662C1.50003 5.54634 1.5 5.68387 1.5 5.83V10.17C1.5 11.0494 1.50121 11.6173 1.53707 12.0492C1.57145 12.4631 1.62976 12.6161 1.66888 12.6915C1.81119 12.9654 2.03457 13.1888 2.30854 13.3311C2.38385 13.3702 2.53687 13.4285 2.95083 13.4629C3.38275 13.4988 3.95059 13.5 4.83 13.5H11.17C12.0494 13.5 12.6173 13.4988 13.0492 13.4629C13.4631 13.4285 13.6161 13.3702 13.6915 13.3311C13.9654 13.1888 14.1888 12.9654 14.3311 12.6915C14.3702 12.6161 14.4285 12.4631 14.4629 12.0492C14.4988 11.6173 14.5 11.0494 14.5 10.17V5.83C14.5 5.68387 14.5 5.54634 14.4997 5.41661L9.78967 9.45382C8.75982 10.3365 7.24017 10.3365 6.21032 9.45382L1.50025 5.41662Z", + "pull-request": "M5 0.75C3.48122 0.75 2.25 1.98122 2.25 3.5C2.25 4.75878 3.09575 5.82002 4.25 6.14648V9.85352C3.09575 10.18 2.25 11.2412 2.25 12.5C2.25 14.0188 3.48122 15.25 5 15.25C6.51878 15.25 7.75 14.0188 7.75 12.5C7.75 11.2412 6.90425 10.18 5.75 9.85352V6.14648C6.90425 5.82002 7.75 4.75878 7.75 3.5C7.75 1.98122 6.51878 0.75 5 0.75ZM3.75 3.5C3.75 2.80964 4.30964 2.25 5 2.25C5.69036 2.25 6.25 2.80964 6.25 3.5C6.25 4.19036 5.69036 4.75 5 4.75C4.30964 4.75 3.75 4.19036 3.75 3.5ZM3.75 12.5C3.75 11.8096 4.30964 11.25 5 11.25C5.69036 11.25 6.25 11.8096 6.25 12.5C6.25 13.1904 5.69036 13.75 5 13.75C4.30964 13.75 3.75 13.1904 3.75 12.5Z M12.75 2.25H8.5V3.75H11.25V9.85352C10.0957 10.18 9.25 11.2412 9.25 12.5C9.25 14.0188 10.4812 15.25 12 15.25C13.5188 15.25 14.75 14.0188 14.75 12.5C14.75 11.2412 13.9043 10.18 12.75 9.85352V2.25ZM12 11.25C11.3096 11.25 10.75 11.8096 10.75 12.5C10.75 13.1904 11.3096 13.75 12 13.75C12.6904 13.75 13.25 13.1904 13.25 12.5C13.25 11.8096 12.6904 11.25 12 11.25Z", + "branch": "M5 0.25C3.48122 0.25 2.25 1.48122 2.25 3C2.25 4.25877 3.09575 5.32001 4.25 5.64648V10.3535C3.09575 10.68 2.25 11.7412 2.25 13C2.25 14.5188 3.48122 15.75 5 15.75C6.51878 15.75 7.74999 14.5188 7.74999 13C7.74999 12.0539 7.27224 11.2194 6.54483 10.7246L9.53828 8.32984C9.96171 8.59605 10.4628 8.75002 10.9999 8.75002C12.5187 8.75002 13.7499 7.51881 13.7499 6.00003C13.7499 4.48125 12.5187 3.25003 10.9999 3.25003C9.48115 3.25003 8.24994 4.48125 8.24994 6.00003C8.24994 6.43583 8.35131 6.84796 8.53177 7.21411L5.75 9.43953V5.64648C6.90425 5.32001 7.74999 4.25877 7.74999 3C7.74999 1.48122 6.51878 0.25 5 0.25ZM3.75 3C3.75 2.30964 4.30964 1.75 5 1.75C5.69035 1.75 6.24999 2.30964 6.24999 3C6.24999 3.69035 5.69035 4.24999 5 4.24999C4.30964 4.24999 3.75 3.69035 3.75 3ZM10.9999 4.75003C10.3096 4.75003 9.74994 5.30967 9.74994 6.00003C9.74994 6.69038 10.3096 7.25002 10.9999 7.25002C11.6903 7.25002 12.2499 6.69038 12.2499 6.00003C12.2499 5.30967 11.6903 4.75003 10.9999 4.75003ZM5 11.75C4.30964 11.75 3.75 12.3096 3.75 13C3.75 13.6904 4.30964 14.25 5 14.25C5.69035 14.25 6.24999 13.6904 6.24999 13C6.24999 12.3096 5.69035 11.75 5 11.75Z", + "chevron-down": "M8.17677 9.76257C8.07914 9.8602 7.92085 9.8602 7.82322 9.76257L3.53033 5.46967L2.46967 6.53033L6.76256 10.8232C7.44598 11.5066 8.55402 11.5066 9.23743 10.8232L13.5303 6.53033L12.4697 5.46967L8.17677 9.76257Z", + "select-chevron": "M7.85 4.05C7.93889 3.98333 8.06111 3.98333 8.15 4.05L11.55 6.6L12.45 5.4L9.05 2.85C8.42778 2.38333 7.57223 2.38333 6.95 2.85L3.55 5.4L4.45 6.6L7.85 4.05Z M7.85 11.95C7.93889 12.0167 8.06111 12.0167 8.15 11.95L11.55 9.4L12.45 10.6L9.05 13.15C8.42778 13.6167 7.57223 13.6167 6.95 13.15L3.55 10.6L4.45 9.4L7.85 11.95Z", + "copy": "M7 1.25C6.0335 1.25 5.25 2.0335 5.25 3V4.25H3C2.0335 4.25 1.25 5.0335 1.25 6V13C1.25 13.9665 2.0335 14.75 3 14.75H9C9.9665 14.75 10.75 13.9665 10.75 13V11.75H13C13.9665 11.75 14.75 10.9665 14.75 10V3C14.75 2.0335 13.9665 1.25 13 1.25H7ZM10.75 10.25H13C13.1381 10.25 13.25 10.1381 13.25 10V3C13.25 2.86193 13.1381 2.75 13 2.75H7C6.86193 2.75 6.75 2.86193 6.75 3V4.25H9C9.9665 4.25 10.75 5.0335 10.75 6V10.25ZM2.75 6C2.75 5.86193 2.86193 5.75 3 5.75H9C9.13807 5.75 9.25 5.86193 9.25 6V13C9.25 13.1381 9.13807 13.25 9 13.25H3C2.86193 13.25 2.75 13.1381 2.75 13V6Z", + "locked": "M8.75 9V12H7.25V9H8.75Z M8 1.25C5.92893 1.25 4.25 2.92893 4.25 5V6.25H4C3.0335 6.25 2.25 7.0335 2.25 8V13C2.25 13.9665 3.0335 14.75 4 14.75H12C12.9665 14.75 13.75 13.9665 13.75 13V8C13.75 7.0335 12.9665 6.25 12 6.25H11.75V5C11.75 2.92893 10.0711 1.25 8 1.25ZM10.25 6.25V5C10.25 3.75736 9.24264 2.75 8 2.75C6.75736 2.75 5.75 3.75736 5.75 5V6.25H10.25ZM3.75 8C3.75 7.86193 3.86193 7.75 4 7.75H12C12.1381 7.75 12.25 7.86193 12.25 8V13C12.25 13.1381 12.1381 13.25 12 13.25H4C3.86193 13.25 3.75 13.1381 3.75 13V8Z", + "settings": "M8.87501 4.63915C8.33356 4.32654 7.66647 4.32654 7.12501 4.63915L5.52694 5.5618C4.98549 5.87441 4.65194 6.45213 4.65194 7.07734V8.92264C4.65194 9.54786 4.98549 10.1256 5.52694 10.4382L7.12501 11.3608C7.66647 11.6734 8.33356 11.6734 8.87501 11.3608L10.4731 10.4382C11.0145 10.1256 11.3481 9.54786 11.3481 8.92264V7.07734C11.3481 6.45213 11.0145 5.87441 10.4731 5.5618L8.87501 4.63915ZM7.87501 5.93819C7.95236 5.89353 8.04766 5.89353 8.12501 5.93819L9.72309 6.86084C9.80044 6.9055 9.84809 6.98803 9.84809 7.07734V8.92264C9.84809 9.01196 9.80044 9.09449 9.72309 9.13915L8.12501 10.0618C8.04766 10.1065 7.95236 10.1065 7.87501 10.0618L6.27694 9.13915C6.19959 9.09449 6.15194 9.01196 6.15194 8.92264V7.07734C6.15194 6.98803 6.19959 6.9055 6.27694 6.86084L7.87501 5.93819Z M8.87501 0.639149C8.33356 0.326542 7.66647 0.326542 7.12501 0.639149L2.06284 3.5618C1.52138 3.87441 1.18784 4.45213 1.18784 5.07734V10.9226C1.18784 11.5479 1.52138 12.1256 2.06284 12.4382L7.12501 15.3608C7.66647 15.6734 8.33356 15.6734 8.87501 15.3608L13.9372 12.4382C14.4786 12.1256 14.8122 11.5479 14.8122 10.9226V5.07734C14.8122 4.45213 14.4786 3.87441 13.9372 3.5618L8.87501 0.639149ZM7.87501 1.93819C7.95236 1.89353 8.04766 1.89353 8.12501 1.93819L13.1872 4.86084C13.2645 4.9055 13.3122 4.98803 13.3122 5.07734V10.9226C13.3122 11.012 13.2645 11.0945 13.1872 11.1391L8.12501 14.0618C8.04766 14.1065 7.95236 14.1065 7.87501 14.0618L2.81284 11.1391C2.73549 11.0945 2.68784 11.012 2.68784 10.9226V5.07734C2.68784 4.98803 2.73549 4.9055 2.81284 4.86084L7.87501 1.93819Z", + "filter": "M1.25 3C1.25 2.0335 2.0335 1.25 3 1.25H13C13.9665 1.25 14.75 2.0335 14.75 3V6.07094C14.75 6.66496 14.4487 7.21842 13.9498 7.5408L10.5786 9.71908C10.5073 9.76513 10.4643 9.8442 10.4643 9.92906V13C10.4643 13.9665 9.68078 14.75 8.71429 14.75H7.28571C6.31921 14.75 5.53571 13.9665 5.53571 13V9.92906C5.53571 9.8442 5.49267 9.76513 5.42139 9.71908L2.05025 7.5408C1.55132 7.21842 1.25 6.66496 1.25 6.07094V3ZM3 2.75C2.86193 2.75 2.75 2.86193 2.75 3V6.07094C2.75 6.1558 2.79305 6.23487 2.86432 6.28092L6.23547 8.4592C6.73439 8.78158 7.03571 9.33504 7.03571 9.92906V13C7.03571 13.1381 7.14764 13.25 7.28571 13.25H8.71429C8.85236 13.25 8.96429 13.1381 8.96429 13V9.92906C8.96429 9.33504 9.26561 8.78158 9.76453 8.4592L13.1357 6.28092C13.207 6.23487 13.25 6.1558 13.25 6.07094V3C13.25 2.86193 13.1381 2.75 13 2.75H3Z", + "docs": "M12 5.75H4V4.25H12V5.75Z M4 8.75H10V7.25H4V8.75Z M5.35241e-05 12.9852L0 3.22C0 2.08102 0 1.51153 0.225173 1.07805C0.414924 0.712765 0.712765 0.414924 1.07805 0.225173C1.51153 0 2.08102 0 3.22 0H16V16H2C1.46143 16 0.972588 15.7871 0.613012 15.4409C0.587144 15.416 0.56195 15.3904 0.537457 15.3642C0.204038 15.0069 0 14.5273 0 14V13L5.35241e-05 12.9852ZM3.22 1.5H14.5V11H2C1.82735 11 1.65981 11.0219 1.5 11.063V3.22C1.5 2.62533 1.50121 2.27105 1.523 2.0086C1.53628 1.84867 1.55378 1.78152 1.55949 1.76346C1.60596 1.67691 1.67691 1.60596 1.76346 1.55949C1.78152 1.55378 1.84867 1.53628 2.0086 1.523C2.27105 1.50121 2.62533 1.5 3.22 1.5ZM3.22 14.5C2.62533 14.5 2.27105 14.4988 2.0086 14.477C1.84867 14.4637 1.78152 14.4462 1.76346 14.4405C1.67691 14.394 1.60596 14.3231 1.55949 14.2365C1.55378 14.2185 1.53628 14.1513 1.523 13.9914C1.50391 13.7615 1.50061 13.4611 1.50009 12.9903C1.50527 12.7186 1.7271 12.5 2 12.5H14.5L14.5 14.5H3.22Z" +} diff --git a/packages/ui/src/lib/icons/index.ts b/packages/ui/src/lib/icons/index.ts index 197f78758..96bc2e17b 100644 --- a/packages/ui/src/lib/icons/index.ts +++ b/packages/ui/src/lib/icons/index.ts @@ -13,7 +13,6 @@ export { default as IconLoading } from './IconLoading.svelte'; export { default as IconProject } from './IconProject.svelte'; export { default as IconTerminal } from './IconTerminal.svelte'; export { default as IconClose } from './IconClose.svelte'; -export { default as IconSettings } from './IconSettings.svelte'; export { default as IconAdjustmentsHorizontal } from './IconAdjustmentsHorizontal.svelte'; export { default as IconDiscord } from './IconDiscord.svelte'; export { default as IconExternalLink } from './IconExternalLink.svelte'; @@ -25,10 +24,8 @@ export { default as IconArrowRight } from './IconArrowRight.svelte'; export { default as IconBookmark } from './IconBookmark.svelte'; export { default as IconFolder } from './IconFolder.svelte'; export { default as IconFolderPlus } from './IconFolderPlus.svelte'; -export { default as IconEmail } from './IconEmail.svelte'; export { default as IconBookmarkFilled } from './IconBookmarkFilled.svelte'; export { default as IconAISparkles } from './IconAISparkles.svelte'; -export { default as IconBranch } from './IconBranch.svelte'; export { default as IconTriangleUp } from './IconTriangleUp.svelte'; export { default as IconTriangleDown } from './IconTriangleDown.svelte'; export { default as IconRemote } from './IconRemote.svelte'; diff --git a/packages/ui/src/routes/[projectId]/components/FileCard.svelte b/packages/ui/src/routes/[projectId]/components/FileCard.svelte index 811cc93ef..06afdb1e7 100644 --- a/packages/ui/src/routes/[projectId]/components/FileCard.svelte +++ b/packages/ui/src/routes/[projectId]/components/FileCard.svelte @@ -21,9 +21,9 @@ import { SETTINGS_CONTEXT, type SettingsStore } from '$lib/settings/userSettings'; import { summarizeHunk } from './summaries'; import Tooltip from '$lib/components/Tooltip.svelte'; - import IconLock from '$lib/icons/IconLock.svelte'; import HunkContextMenu from './HunkContextMenu.svelte'; import { draggableFile, draggableHunk } from '$lib/draggables'; + import Icon from '$lib/icons/Icon.svelte'; export let branchId: string; export let file: File; @@ -134,7 +134,7 @@ - + {/if} diff --git a/packages/ui/src/routes/[projectId]/navigation/BaseBranchCard.svelte b/packages/ui/src/routes/[projectId]/navigation/BaseBranchCard.svelte index 7487fbdb0..f4a25c99d 100644 --- a/packages/ui/src/routes/[projectId]/navigation/BaseBranchCard.svelte +++ b/packages/ui/src/routes/[projectId]/navigation/BaseBranchCard.svelte @@ -6,7 +6,7 @@ import TimeAgo from '$lib/components/TimeAgo.svelte'; import Tooltip from '$lib/components/Tooltip.svelte'; import type { PrService } from '$lib/github/pullrequest'; - import IconBranch from '$lib/icons/IconBranch.svelte'; + import Icon from '$lib/icons/Icon.svelte'; import IconGithub from '$lib/icons/IconGithub.svelte'; import IconRefresh from '$lib/icons/IconRefresh.svelte'; import type { BranchController } from '$lib/vbranches/branchController'; @@ -35,7 +35,7 @@ {#if $base$?.remoteUrl.includes('github.com')} {:else} - + {/if}
diff --git a/packages/ui/src/routes/[projectId]/navigation/DomainButton.svelte b/packages/ui/src/routes/[projectId]/navigation/DomainButton.svelte index b4e849161..bfd7e4b51 100644 --- a/packages/ui/src/routes/[projectId]/navigation/DomainButton.svelte +++ b/packages/ui/src/routes/[projectId]/navigation/DomainButton.svelte @@ -1,9 +1,10 @@ @@ -12,6 +13,6 @@ class="mx-4 flex items-center gap-x-1 rounded px-3 py-2 font-semibold" style:background-color={selected ? 'var(--bg-surface-highlight)' : undefined} > - + diff --git a/packages/ui/src/routes/[projectId]/navigation/Footer.svelte b/packages/ui/src/routes/[projectId]/navigation/Footer.svelte index a55d7117c..693d5f7ca 100644 --- a/packages/ui/src/routes/[projectId]/navigation/Footer.svelte +++ b/packages/ui/src/routes/[projectId]/navigation/Footer.svelte @@ -3,9 +3,8 @@ import { isLoading, loadStack } from '$lib/backend/ipc'; import Link from '$lib/components/Link.svelte'; import Tooltip from '$lib/components/Tooltip.svelte'; - import IconEmail from '$lib/icons/IconEmail.svelte'; + import Icon from '$lib/icons/Icon.svelte'; import IconHome from '$lib/icons/IconHome.svelte'; - import IconSettings from '$lib/icons/IconSettings.svelte'; import IconSpinner from '$lib/icons/IconSpinner.svelte'; import * as events from '$lib/utils/events'; @@ -22,11 +21,11 @@ - + {#if $isLoading} diff --git a/packages/ui/src/routes/[projectId]/navigation/Navigation.svelte b/packages/ui/src/routes/[projectId]/navigation/Navigation.svelte index 02f1f7e54..addb5222e 100644 --- a/packages/ui/src/routes/[projectId]/navigation/Navigation.svelte +++ b/packages/ui/src/routes/[projectId]/navigation/Navigation.svelte @@ -14,7 +14,6 @@ import type { Loadable } from '@square/svelte-store'; import type { Update } from '../../updater'; import DomainButton from './DomainButton.svelte'; - import IconBranch from '$lib/icons/IconBranch.svelte'; import type { PrService } from '$lib/github/pullrequest'; import type { BaseBranchService, VirtualBranchService } from '$lib/vbranches/branchStoresCache'; import type { RemoteBranchService } from '$lib/stores/remoteBranches'; @@ -52,7 +51,7 @@
- Applied branches + Applied branches
{#if githubContext}