extract svg from component

This commit is contained in:
Kiril Videlov 2023-06-21 09:37:44 +02:00 committed by Kiril Videlov
parent 2f58d4439a
commit 54ca096c32
3 changed files with 21 additions and 4 deletions

View File

@ -0,0 +1,18 @@
<script lang="ts">
let className = '';
export { className as class };
</script>
<svg
class={className}
width="14"
height="16"
viewBox="0 0 14 16"
fill="none"
xmlns="http://www.w3.org/2000/svg"
>
<path
d="M8.75044 2.57052C8.75058 2.09915 8.88299 1.6369 9.1332 1.23426C9.3834 0.831632 9.74177 0.504123 10.1691 0.287529C10.5965 0.0709351 11.0764 -0.0264083 11.5564 0.00613711C12.0365 0.0386825 12.4981 0.199864 12.891 0.472067C13.2838 0.74427 13.5927 1.11702 13.7839 1.54958C13.9751 1.98214 14.0412 2.45786 13.9751 2.92475C13.9089 3.39165 13.7131 3.83175 13.4088 4.19695C13.1046 4.56216 12.7038 4.83842 12.2501 4.99555V5.71322C12.2501 6.47095 11.9429 7.19764 11.3959 7.73343C10.849 8.26922 10.1072 8.57022 9.33372 8.57022H4.66745C4.35805 8.57022 4.06133 8.69063 3.84256 8.90494C3.62379 9.11926 3.50088 9.40993 3.50088 9.71302V11.0021C4.08497 11.2043 4.57728 11.6023 4.89079 12.1257C5.2043 12.6491 5.31882 13.2642 5.21412 13.8624C5.10941 14.4605 4.79221 15.0031 4.31859 15.3943C3.84498 15.7855 3.24544 16 2.62595 16C2.00647 16 1.40693 15.7855 0.933311 15.3943C0.459693 15.0031 0.142496 14.4605 0.037788 13.8624C-0.0669202 13.2642 0.047603 12.6491 0.361114 12.1257C0.674626 11.6023 1.16694 11.2043 1.75103 11.0021V4.99555C1.16726 4.79336 0.675255 4.39552 0.361964 3.87233C0.0486728 3.34915 -0.065731 2.73431 0.0389726 2.13649C0.143676 1.53867 0.460746 0.996349 0.934141 0.605389C1.40754 0.21443 2.00678 7.94625e-07 2.62595 7.94625e-07C3.24513 7.94625e-07 3.84437 0.21443 4.31776 0.605389C4.79116 0.996349 5.10823 1.53867 5.21293 2.13649C5.31763 2.73431 5.20323 3.34915 4.88994 3.87233C4.57665 4.39552 4.08464 4.79336 3.50088 4.99555V7.09373C3.86882 6.93647 4.26601 6.85554 4.66745 6.85602H9.33372C9.64312 6.85602 9.93984 6.73562 10.1586 6.5213C10.3774 6.30699 10.5003 6.01631 10.5003 5.71322V4.99555C9.98842 4.81826 9.54526 4.48983 9.23187 4.05552C8.91847 3.62121 8.75027 3.10239 8.75044 2.57052ZM1.75103 2.57052C1.75103 2.79784 1.8432 3.01585 2.00729 3.17658C2.17137 3.33732 2.39391 3.42762 2.62595 3.42762C2.858 3.42762 3.08054 3.33732 3.24462 3.17658C3.4087 3.01585 3.50088 2.79784 3.50088 2.57052C3.50088 2.34321 3.4087 2.1252 3.24462 1.96446C3.08054 1.80373 2.858 1.71342 2.62595 1.71342C2.39391 1.71342 2.17137 1.80373 2.00729 1.96446C1.8432 2.1252 1.75103 2.34321 1.75103 2.57052ZM11.3752 1.71342C11.1432 1.71342 10.9206 1.80373 10.7566 1.96446C10.5925 2.1252 10.5003 2.34321 10.5003 2.57052C10.5003 2.79784 10.5925 3.01585 10.7566 3.17658C10.9206 3.33732 11.1432 3.42762 11.3752 3.42762C11.6073 3.42762 11.8298 3.33732 11.9939 3.17658C12.158 3.01585 12.2501 2.79784 12.2501 2.57052C12.2501 2.34321 12.158 2.1252 11.9939 1.96446C11.8298 1.80373 11.6073 1.71342 11.3752 1.71342ZM2.62595 12.57C2.39391 12.57 2.17137 12.6603 2.00729 12.8211C1.8432 12.9818 1.75103 13.1998 1.75103 13.4271C1.75103 13.6544 1.8432 13.8724 2.00729 14.0332C2.17137 14.1939 2.39391 14.2842 2.62595 14.2842C2.858 14.2842 3.08054 14.1939 3.24462 14.0332C3.4087 13.8724 3.50088 13.6544 3.50088 13.4271C3.50088 13.1998 3.4087 12.9818 3.24462 12.8211C3.08054 12.6603 2.858 12.57 2.62595 12.57Z"
fill="currentColor"
/>
</svg>

View File

@ -28,3 +28,4 @@ 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';

View File

@ -6,6 +6,7 @@
import { createFile } from './helpers';
import FileCard from './FileCard.svelte';
import { invoke } from '@tauri-apps/api';
import { IconBranch } from '$lib/icons';
export let branchId: string;
export let name: string;
@ -75,10 +76,7 @@
class="gb-bg-1 gb-border-1 flex max-h-full w-96 shrink-0 flex-col overflow-y-hidden rounded-xl border px-2 pb-2 shadow"
>
<div class="flex h-16 shrink-0 items-center px-3 text-lg font-bold">
<!-- prettier-ignore -->
<svg class="mr-3" width="14" height="16" viewBox="0 0 14 16" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M8.75044 2.57052C8.75058 2.09915 8.88299 1.6369 9.1332 1.23426C9.3834 0.831632 9.74177 0.504123 10.1691 0.287529C10.5965 0.0709351 11.0764 -0.0264083 11.5564 0.00613711C12.0365 0.0386825 12.4981 0.199864 12.891 0.472067C13.2838 0.74427 13.5927 1.11702 13.7839 1.54958C13.9751 1.98214 14.0412 2.45786 13.9751 2.92475C13.9089 3.39165 13.7131 3.83175 13.4088 4.19695C13.1046 4.56216 12.7038 4.83842 12.2501 4.99555V5.71322C12.2501 6.47095 11.9429 7.19764 11.3959 7.73343C10.849 8.26922 10.1072 8.57022 9.33372 8.57022H4.66745C4.35805 8.57022 4.06133 8.69063 3.84256 8.90494C3.62379 9.11926 3.50088 9.40993 3.50088 9.71302V11.0021C4.08497 11.2043 4.57728 11.6023 4.89079 12.1257C5.2043 12.6491 5.31882 13.2642 5.21412 13.8624C5.10941 14.4605 4.79221 15.0031 4.31859 15.3943C3.84498 15.7855 3.24544 16 2.62595 16C2.00647 16 1.40693 15.7855 0.933311 15.3943C0.459693 15.0031 0.142496 14.4605 0.037788 13.8624C-0.0669202 13.2642 0.047603 12.6491 0.361114 12.1257C0.674626 11.6023 1.16694 11.2043 1.75103 11.0021V4.99555C1.16726 4.79336 0.675255 4.39552 0.361964 3.87233C0.0486728 3.34915 -0.065731 2.73431 0.0389726 2.13649C0.143676 1.53867 0.460746 0.996349 0.934141 0.605389C1.40754 0.21443 2.00678 7.94625e-07 2.62595 7.94625e-07C3.24513 7.94625e-07 3.84437 0.21443 4.31776 0.605389C4.79116 0.996349 5.10823 1.53867 5.21293 2.13649C5.31763 2.73431 5.20323 3.34915 4.88994 3.87233C4.57665 4.39552 4.08464 4.79336 3.50088 4.99555V7.09373C3.86882 6.93647 4.26601 6.85554 4.66745 6.85602H9.33372C9.64312 6.85602 9.93984 6.73562 10.1586 6.5213C10.3774 6.30699 10.5003 6.01631 10.5003 5.71322V4.99555C9.98842 4.81826 9.54526 4.48983 9.23187 4.05552C8.91847 3.62121 8.75027 3.10239 8.75044 2.57052ZM1.75103 2.57052C1.75103 2.79784 1.8432 3.01585 2.00729 3.17658C2.17137 3.33732 2.39391 3.42762 2.62595 3.42762C2.858 3.42762 3.08054 3.33732 3.24462 3.17658C3.4087 3.01585 3.50088 2.79784 3.50088 2.57052C3.50088 2.34321 3.4087 2.1252 3.24462 1.96446C3.08054 1.80373 2.858 1.71342 2.62595 1.71342C2.39391 1.71342 2.17137 1.80373 2.00729 1.96446C1.8432 2.1252 1.75103 2.34321 1.75103 2.57052ZM11.3752 1.71342C11.1432 1.71342 10.9206 1.80373 10.7566 1.96446C10.5925 2.1252 10.5003 2.34321 10.5003 2.57052C10.5003 2.79784 10.5925 3.01585 10.7566 3.17658C10.9206 3.33732 11.1432 3.42762 11.3752 3.42762C11.6073 3.42762 11.8298 3.33732 11.9939 3.17658C12.158 3.01585 12.2501 2.79784 12.2501 2.57052C12.2501 2.34321 12.158 2.1252 11.9939 1.96446C11.8298 1.80373 11.6073 1.71342 11.3752 1.71342ZM2.62595 12.57C2.39391 12.57 2.17137 12.6603 2.00729 12.8211C1.8432 12.9818 1.75103 13.1998 1.75103 13.4271C1.75103 13.6544 1.8432 13.8724 2.00729 14.0332C2.17137 14.1939 2.39391 14.2842 2.62595 14.2842C2.858 14.2842 3.08054 14.1939 3.24462 14.0332C3.4087 13.8724 3.50088 13.6544 3.50088 13.4271C3.50088 13.1998 3.4087 12.9818 3.24462 12.8211C3.08054 12.6603 2.858 12.57 2.62595 12.57Z" fill="#A1A1AA"/>
</svg>
<IconBranch class="mr-3 text-[#A1A1AA]" />
{name}
</div>
<div class="gb-bg-2 gb-border-3 flex flex-col overflow-y-hidden rounded-lg border p-2">