diff --git a/gitbutler-ui/src/lib/branches/types.ts b/gitbutler-ui/src/lib/branches/types.ts index b46907481..df0e22b6a 100644 --- a/gitbutler-ui/src/lib/branches/types.ts +++ b/gitbutler-ui/src/lib/branches/types.ts @@ -1,7 +1,5 @@ import type { PullRequest } from '$lib/github/types'; import type { Author, Branch, RemoteBranch } from '$lib/vbranches/types'; -import type iconsJson from '$lib/icons/icons.json'; -import type { IconColor } from '$lib/icons/Icon.svelte'; export class CombinedBranch { pr?: PullRequest; @@ -52,18 +50,20 @@ export class CombinedBranch { return this.authors[0]; } - get icon(): keyof typeof iconsJson | undefined { - if (this.vbranch) return 'branch'; + get icon(): 'remote-branch' | 'virtual-branch' | 'pr' | 'pr-draft' | 'pr-closed' | undefined { + if (this.vbranch) return 'virtual-branch'; if (this.pr) return 'pr'; - if (this.remoteBranch) return 'branch'; + if (this.remoteBranch) return 'remote-branch'; return undefined; // or implement a default icon? } - get color(): IconColor { - if (this.pr?.mergedAt) return 'pop'; - if (this.vbranch && this.vbranch.active == false) return 'warn'; - if (this.remoteBranch?.isMergeable) return 'success'; - return 'pop'; + // GH colors reference https://github.blog/changelog/2021-06-08-new-issue-and-pull-request-state-icons + get color(): 'neutral' | 'success' | 'pop' | 'purple' | undefined { + if (this.pr?.mergedAt) return 'purple'; // merged PR + if (this.pr) return 'success'; // open PR + if (this.vbranch && this.vbranch.active == false) return 'pop'; // stashed virtual branches + if (this.remoteBranch?.isMergeable) return 'success'; // remote branches + return 'neutral'; } get modifiedAt(): Date | undefined { diff --git a/gitbutler-ui/src/lib/components/Button.svelte b/gitbutler-ui/src/lib/components/Button.svelte index 0c230ce3b..60c152053 100644 --- a/gitbutler-ui/src/lib/components/Button.svelte +++ b/gitbutler-ui/src/lib/components/Button.svelte @@ -1,3 +1,7 @@ + + + + + +
+ +
+
+
{title}
+
+ +
+
+
+ {#if secondary} + + {/if} + {#if primary} + + {/if} +
+
+
+ + diff --git a/gitbutler-ui/src/lib/components/Toggle.svelte b/gitbutler-ui/src/lib/components/Toggle.svelte index 01d4941c6..7c21efaf4 100644 --- a/gitbutler-ui/src/lib/components/Toggle.svelte +++ b/gitbutler-ui/src/lib/components/Toggle.svelte @@ -25,7 +25,7 @@ width: calc(var(--space-24) + var(--space-2)); height: var(--space-16); border-radius: var(--space-16); - background-color: var(--clr-theme-container-mid); + background-color: var(--clr-theme-container-sub); box-shadow: inset 0 0 0 1px var(--clr-theme-container-outline-light); transition: background-color var(--transition-fast), @@ -37,7 +37,7 @@ /* not checked */ &:hover, &:focus { - background-color: var(--clr-theme-container-dark); + background-color: var(--clr-theme-container-dim); outline: none; } diff --git a/gitbutler-ui/src/lib/icons/Icon.svelte b/gitbutler-ui/src/lib/icons/Icon.svelte index e02a4db5e..77ab45c47 100644 --- a/gitbutler-ui/src/lib/icons/Icon.svelte +++ b/gitbutler-ui/src/lib/icons/Icon.svelte @@ -1,5 +1,5 @@ + +
+ {#if name == 'virtual-branch'} + + + + + {/if} + {#if name == 'remote-branch'} + + + + {/if} + {#if name == 'pr'} + + + + + {/if} + {#if name == 'pr-draft'} + + + + + + + {/if} + {#if name == 'pr-closed'} + + + + + + {/if} +
+ + diff --git a/gitbutler-ui/src/routes/[projectId]/navigation/BranchItem.svelte b/gitbutler-ui/src/routes/[projectId]/navigation/BranchItem.svelte index d98313258..3ff4b45f8 100644 --- a/gitbutler-ui/src/routes/[projectId]/navigation/BranchItem.svelte +++ b/gitbutler-ui/src/routes/[projectId]/navigation/BranchItem.svelte @@ -2,7 +2,8 @@ import { page } from '$app/stores'; import AuthorIcons from '$lib/components/AuthorIcons.svelte'; import TimeAgo from '$lib/components/TimeAgo.svelte'; - import Icon from '$lib/icons/Icon.svelte'; + import BranchIcon from './BranchIcon.svelte'; + // import Icon from '$lib/icons/Icon.svelte'; import type { CombinedBranch } from '$lib/branches/types'; export let projectId: string; @@ -21,7 +22,8 @@ {#if branch.icon} -
+ + {/if}

@@ -78,8 +80,4 @@ .selected { background-color: var(--clr-theme-container-pale); } - - .item__icon { - flex-shrink: 0; - } diff --git a/gitbutler-ui/src/routes/[projectId]/navigation/Navigation.svelte b/gitbutler-ui/src/routes/[projectId]/navigation/Navigation.svelte index 9cd278471..c9a826cea 100644 --- a/gitbutler-ui/src/routes/[projectId]/navigation/Navigation.svelte +++ b/gitbutler-ui/src/routes/[projectId]/navigation/Navigation.svelte @@ -64,10 +64,14 @@ fill="none" xmlns="http://www.w3.org/2000/svg" > - - - + + + + Applied branches {#if ($base$?.behind || 0) > 0} diff --git a/gitbutler-ui/src/styles/tokens.css b/gitbutler-ui/src/styles/tokens.css index fc66b5c5c..52c624280 100644 --- a/gitbutler-ui/src/styles/tokens.css +++ b/gitbutler-ui/src/styles/tokens.css @@ -26,45 +26,45 @@ --clr-core-err-90: #fdf1f4; --clr-core-err-95: #fff8fb; --clr-core-ntrl-0: #000000; - --clr-core-ntrl-5: #141415; - --clr-core-ntrl-10: #1c1c1c; - --clr-core-ntrl-15: #252527; - --clr-core-ntrl-20: #2d2d2f; - --clr-core-ntrl-25: #383838; - --clr-core-ntrl-30: #424242; - --clr-core-ntrl-35: #4d4d4d; - --clr-core-ntrl-40: #676767; - --clr-core-ntrl-45: #7a7a7a; - --clr-core-ntrl-50: #989898; - --clr-core-ntrl-55: #afafaf; - --clr-core-ntrl-60: #c4c4c4; - --clr-core-ntrl-65: #d4d4d4; - --clr-core-ntrl-70: #d9d9d9; - --clr-core-ntrl-75: #e1e1e1; - --clr-core-ntrl-80: #e7e7e7; - --clr-core-ntrl-85: #eeeeee; - --clr-core-ntrl-90: #f4f4f4; - --clr-core-ntrl-95: #f9f9f9; + --clr-core-ntrl-5: #151514; + --clr-core-ntrl-10: #1a1a19; + --clr-core-ntrl-15: #1f1f1e; + --clr-core-ntrl-20: #242423; + --clr-core-ntrl-25: #2c2c2a; + --clr-core-ntrl-30: #373634; + --clr-core-ntrl-35: #444341; + --clr-core-ntrl-40: #51504d; + --clr-core-ntrl-45: #787773; + --clr-core-ntrl-50: #999894; + --clr-core-ntrl-55: #b1b0ad; + --clr-core-ntrl-60: #c5c5c3; + --clr-core-ntrl-65: #d5d5d3; + --clr-core-ntrl-70: #dbdad7; + --clr-core-ntrl-75: #e3e2df; + --clr-core-ntrl-80: #e9e8e5; + --clr-core-ntrl-85: #f0efec; + --clr-core-ntrl-90: #f5f5f3; + --clr-core-ntrl-95: #fbfaf9; --clr-core-ntrl-100: #ffffff; - --clr-core-pop-5: #27273f; - --clr-core-pop-10: #2a2b50; - --clr-core-pop-15: #363763; - --clr-core-pop-20: #3d3f7b; - --clr-core-pop-25: #414595; - --clr-core-pop-30: #484cad; - --clr-core-pop-35: #565ac2; - --clr-core-pop-40: #666ad6; - --clr-core-pop-45: #7176e4; - --clr-core-pop-50: #7c81e3; - --clr-core-pop-55: #a0a4f7; - --clr-core-pop-60: #b5b9f8; - --clr-core-pop-65: #cacdff; - --clr-core-pop-70: #d6d8fd; - --clr-core-pop-75: #dfe1ff; - --clr-core-pop-80: #e8eaff; - --clr-core-pop-85: #eeefff; - --clr-core-pop-90: #f4f4ff; - --clr-core-pop-95: #f9f9ff; + --clr-core-pop-5: #073e3b; + --clr-core-pop-10: #084643; + --clr-core-pop-15: #094e4b; + --clr-core-pop-20: #0a5d59; + --clr-core-pop-25: #0c6e69; + --clr-core-pop-30: #0e7c76; + --clr-core-pop-35: #108e88; + --clr-core-pop-40: #12a19a; + --clr-core-pop-45: #14b8af; + --clr-core-pop-50: #1eccc3; + --clr-core-pop-55: #6cdad5; + --clr-core-pop-60: #91e3df; + --clr-core-pop-65: #a5e9e5; + --clr-core-pop-70: #baeeeb; + --clr-core-pop-75: #c6f1ef; + --clr-core-pop-80: #d2f4f2; + --clr-core-pop-85: #e2f8f7; + --clr-core-pop-90: #ebfaf9; + --clr-core-pop-95: #f3fcfb; --clr-core-succ-5: #112c1f; --clr-core-succ-10: #153727; --clr-core-succ-15: #1b412f; @@ -116,7 +116,6 @@ --clr-theme-container-pale: var(--clr-core-ntrl-90); --clr-theme-container-sub: var(--clr-core-ntrl-80); --clr-theme-err-container: var(--clr-core-err-95); - --clr-theme-err-container-dark: var(--clr-core-err-70); --clr-theme-err-container-dim: var(--clr-core-err-80); --clr-theme-err-element: var(--clr-core-err-50); --clr-theme-err-element-dark: var(--clr-core-err-35); @@ -124,11 +123,9 @@ --clr-theme-err-on-container: var(--clr-core-err-40); --clr-theme-err-on-element: var(--clr-core-err-95); --clr-theme-err-outline: var(--clr-core-err-45); - --clr-theme-err-outline-dark: var(--clr-core-err-35); --clr-theme-err-outline-dim: var(--clr-core-err-40); --clr-theme-overlay-bg: #cfcfcf4d; --clr-theme-pop-container: var(--clr-core-pop-95); - --clr-theme-pop-container-dark: var(--clr-core-pop-70); --clr-theme-pop-container-dim: var(--clr-core-pop-80); --clr-theme-pop-element: var(--clr-core-pop-40); --clr-theme-pop-element-dark: var(--clr-core-pop-20); @@ -136,7 +133,6 @@ --clr-theme-pop-on-container: var(--clr-core-pop-10); --clr-theme-pop-on-element: var(--clr-core-ntrl-100); --clr-theme-pop-outline: var(--clr-core-pop-40); - --clr-theme-pop-outline-dark: var(--clr-core-pop-20); --clr-theme-pop-outline-dim: var(--clr-core-pop-30); --clr-theme-scale-err-10: var(--clr-core-err-10); --clr-theme-scale-err-20: var(--clr-core-err-20); @@ -186,7 +182,6 @@ --clr-theme-scale-warn-80: var(--clr-core-warn-80); --clr-theme-scale-warn-90: var(--clr-core-warn-90); --clr-theme-succ-container: var(--clr-core-succ-95); - --clr-theme-succ-container-dark: var(--clr-core-succ-70); --clr-theme-succ-container-dim: var(--clr-core-succ-80); --clr-theme-succ-element: var(--clr-core-succ-50); --clr-theme-succ-element-dark: var(--clr-core-succ-35); @@ -194,19 +189,18 @@ --clr-theme-succ-on-container: var(--clr-core-succ-40); --clr-theme-succ-on-element: var(--clr-core-succ-95); --clr-theme-succ-outline: var(--clr-core-succ-45); - --clr-theme-succ-outline-dark: var(--clr-core-succ-35); --clr-theme-succ-outline-dim: var(--clr-core-succ-40); --clr-theme-warn-container: var(--clr-core-warn-95); - --clr-theme-warn-container-dark: var(--clr-core-warn-75); --clr-theme-warn-container-dim: var(--clr-core-warn-80); - --clr-theme-warn-eleemnt-dark: var(--clr-core-warn-40); + --clr-theme-warn-element-dark: var(--clr-core-warn-40); --clr-theme-warn-element: var(--clr-core-warn-55); + --clr-theme-warn-element-dark: var(--clr-core-warn-40); --clr-theme-warn-element-dim: var(--clr-core-warn-50); --clr-theme-warn-on-container: var(--clr-core-warn-40); --clr-theme-warn-on-element: var(--clr-core-warn-95); --clr-theme-warn-outline: var(--clr-core-warn-45); - --clr-theme-warn-outline-dark: var(--clr-core-warn-35); --clr-theme-warn-outline-dim: var(--clr-core-warn-40); + /* other */ --fx-shadow-l: 0 16px 40px 0 #0000001f; --fx-shadow-m: 0 10px 30px 0 #00000024; --fx-shadow-s: 0 7px 14px 0 #0000001a; @@ -257,7 +251,6 @@ --clr-theme-container-pale: var(--clr-core-ntrl-20); --clr-theme-container-sub: var(--clr-core-ntrl-15); --clr-theme-err-container: var(--clr-core-err-20); - --clr-theme-err-container-dark: var(--clr-core-err-10); --clr-theme-err-container-dim: var(--clr-core-err-15); --clr-theme-err-element: var(--clr-core-err-40); --clr-theme-err-element-dark: var(--clr-core-err-30); @@ -265,19 +258,16 @@ --clr-theme-err-on-container: var(--clr-core-err-65); --clr-theme-err-on-element: var(--clr-core-err-90); --clr-theme-err-outline: var(--clr-core-err-55); - --clr-theme-err-outline-dark: var(--clr-core-err-65); --clr-theme-err-outline-dim: var(--clr-core-err-60); --clr-theme-overlay-bg: #20202099; - --clr-theme-pop-container: var(--clr-core-pop-20); - --clr-theme-pop-container-dark: var(--clr-core-pop-10); - --clr-theme-pop-container-dim: var(--clr-core-pop-15); - --clr-theme-pop-element: var(--clr-core-pop-40); + --clr-theme-pop-container: var(--clr-core-pop-15); + --clr-theme-pop-container-dim: var(--clr-core-pop-10); + --clr-theme-pop-element: var(--clr-core-pop-35); --clr-theme-pop-element-dark: var(--clr-core-pop-20); --clr-theme-pop-element-dim: var(--clr-core-pop-30); --clr-theme-pop-on-container: var(--clr-core-pop-80); --clr-theme-pop-on-element: var(--clr-core-ntrl-100); --clr-theme-pop-outline: var(--clr-core-pop-55); - --clr-theme-pop-outline-dark: var(--clr-core-pop-65); --clr-theme-pop-outline-dim: var(--clr-core-pop-60); --clr-theme-scale-err-10: var(--clr-core-err-90); --clr-theme-scale-err-20: var(--clr-core-err-80); @@ -327,7 +317,6 @@ --clr-theme-scale-warn-80: var(--clr-core-warn-20); --clr-theme-scale-warn-90: var(--clr-core-warn-10); --clr-theme-succ-container: var(--clr-core-succ-20); - --clr-theme-succ-container-dark: var(--clr-core-succ-10); --clr-theme-succ-container-dim: var(--clr-core-succ-15); --clr-theme-succ-element: var(--clr-core-succ-40); --clr-theme-succ-element-dark: var(--clr-core-succ-25); @@ -335,19 +324,18 @@ --clr-theme-succ-on-container: var(--clr-core-succ-80); --clr-theme-succ-on-element: var(--clr-core-succ-90); --clr-theme-succ-outline: var(--clr-core-succ-55); - --clr-theme-succ-outline-dark: var(--clr-core-succ-65); --clr-theme-succ-outline-dim: var(--clr-core-succ-60); --clr-theme-warn-container: var(--clr-core-warn-20); - --clr-theme-warn-container-dark: var(--clr-core-warn-10); --clr-theme-warn-container-dim: var(--clr-core-warn-15); - --clr-theme-warn-eleemnt-dark: var(--clr-core-warn-35); + --clr-theme-warn-element-dark: var(--clr-core-warn-35); --clr-theme-warn-element: var(--clr-core-warn-45); + --clr-theme-warn-element-dark: var(--clr-core-warn-35); --clr-theme-warn-element-dim: var(--clr-core-warn-40); --clr-theme-warn-on-container: var(--clr-core-warn-80); --clr-theme-warn-on-element: var(--clr-core-warn-90); --clr-theme-warn-outline: var(--clr-core-warn-55); - --clr-theme-warn-outline-dark: var(--clr-core-warn-65); --clr-theme-warn-outline-dim: var(--clr-core-warn-60); + /* other */ --helpers-invert-0: 1; --helpers-invert-1: 0; }