Skip to content

Commit 1451129

Browse files
authored
UI-Update-button-and-tags (#5878)
* Update Terrazzo config * Update design tokens * UI: update button oacity with variables * Update `Badge` component * replace non-clickable buttons with tags * css fix: `overflow: hidden` was cutting off the kebabab menu * ui: size badge update
1 parent 8901271 commit 1451129

26 files changed

+749
-330
lines changed

apps/desktop/src/lib/branch/ActiveBranchStatus.svelte

Lines changed: 0 additions & 101 deletions
This file was deleted.

apps/desktop/src/lib/branch/BranchPreviewHeader.svelte

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
import { openExternalUrl } from '$lib/utils/url';
88
import { BranchController } from '$lib/vbranches/branchController';
99
import { getContext } from '@gitbutler/shared/context';
10+
import Badge from '@gitbutler/ui/Badge.svelte';
1011
import Button from '@gitbutler/ui/Button.svelte';
1112
import Icon from '@gitbutler/ui/Icon.svelte';
1213
import Modal from '@gitbutler/ui/Modal.svelte';
@@ -45,9 +46,9 @@
4546
<div class="header__remote-branch">
4647
{#if remoteBranch}
4748
<Tooltip text="At least some of your changes have been pushed">
48-
<Button size="tag" icon="branch-small" style="neutral" kind="solid" clickable={false}>
49+
<Badge size="tag" icon="branch-small" style="neutral" kind="solid">
4950
{localBranch ? 'local and remote' : 'remote'}
50-
</Button>
51+
</Badge>
5152
</Tooltip>
5253

5354
{#if forgeBranch}
@@ -75,7 +76,6 @@
7576
{#if pr?.htmlUrl}
7677
<Button
7778
size="tag"
78-
clickable
7979
icon="pr-small"
8080
style="ghost"
8181
outline

apps/desktop/src/lib/commit/CommitsAccordion.svelte

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,6 @@
8686
&.is-last {
8787
border-bottom: none;
8888
border-radius: 0 0 var(--radius-m) var(--radius-m);
89-
overflow: hidden;
9089
}
9190
9291
&.is-open {

apps/desktop/src/lib/components/EditMode.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -266,7 +266,7 @@
266266
<div bind:this={filesList} class="card files">
267267
<div class="header" class:show-border={isCommitListScrolled}>
268268
<h3 class="text-13 text-semibold">Commit files</h3>
269-
<Badge label={files.length} />
269+
<Badge>{files.length}</Badge>
270270
</div>
271271
<ScrollableContainer
272272
onscroll={(e) => {

apps/desktop/src/lib/components/IntegrateUpstreamModal.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,7 @@
206206
{#if $base}
207207
<div class="section">
208208
<h3 class="text-14 text-semibold section-title">
209-
<span>Incoming changes</span><Badge label={$base.upstreamCommits.length} />
209+
<span>Incoming changes</span><Badge>{$base.upstreamCommits.length}</Badge>
210210
</h3>
211211
<div class="scroll-wrap">
212212
<ScrollableContainer maxHeight={pxToRem(268)}>

apps/desktop/src/lib/components/PullRequestPreview.svelte

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
import { BranchController } from '$lib/vbranches/branchController';
1010
import { VirtualBranchService } from '$lib/vbranches/virtualBranch';
1111
import { getContext } from '@gitbutler/shared/context';
12+
import Badge from '@gitbutler/ui/Badge.svelte';
1213
import Button from '@gitbutler/ui/Button.svelte';
1314
import Modal from '@gitbutler/ui/Modal.svelte';
1415
import Textbox from '@gitbutler/ui/Textbox.svelte';
@@ -96,11 +97,9 @@
9697
</span>
9798
</h2>
9899
{#if pr.draft}
99-
<Button size="tag" clickable={false} style="neutral" icon="draft-pr-small">Draft</Button>
100+
<Badge size="tag" style="neutral" icon="draft-pr-small">Draft</Badge>
100101
{:else}
101-
<Button size="tag" clickable={false} style="success" kind="solid" icon="pr-small">
102-
Open
103-
</Button>
102+
<Badge size="tag" style="success" kind="solid" icon="pr-small">Open</Badge>
104103
{/if}
105104
</div>
106105

apps/desktop/src/lib/components/SyncButton.svelte

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717

1818
<Button
1919
size="tag"
20-
clickable
2120
reversedDirection
2221
style="ghost"
2322
outline

apps/desktop/src/lib/file/BranchFilesHeader.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@
7070
{/if}
7171
<div class="header__title text-13 text-semibold">
7272
<span>{title}</span>
73-
<Badge label={files.length + (conflictedFiles?.entries.size || 0)} />
73+
<Badge>{files.length + (conflictedFiles?.entries.size || 0)}</Badge>
7474
</div>
7575
</div>
7676
</div>

apps/desktop/src/lib/file/FileCardHeader.svelte

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
import FileStatusTag from './FileStatusTag.svelte';
33
import { computeFileStatus } from '$lib/utils/fileStatus';
44
import { computeAddedRemovedByFiles } from '$lib/utils/metrics';
5+
import Badge from '@gitbutler/ui/Badge.svelte';
56
import Button from '@gitbutler/ui/Button.svelte';
67
import FileIcon from '@gitbutler/ui/file/FileIcon.svelte';
78
import { splitFilePath } from '@gitbutler/ui/utils/filePath';
@@ -33,32 +34,25 @@
3334
{#if file.conflicted || isFileLocked}
3435
<div class="header__tag-group">
3536
{#if isFileLocked}
36-
<Button
37+
<Badge
3738
size="tag"
38-
clickable={false}
3939
icon="locked-small"
4040
style="warning"
4141
tooltip="File changes cannot be moved because part of this file was already committed into this branch"
42-
>Locked</Button
42+
>Locked</Badge
4343
>
4444
{/if}
4545
{#if file.conflicted}
46-
<Button size="tag" clickable={false} icon="warning-small" style="error"
47-
>Has conflicts</Button
48-
>
46+
<Badge size="tag" icon="warning-small" style="error">Has conflicts</Badge>
4947
{/if}
5048
</div>
5149
{/if}
5250
<div class="header__tag-group">
5351
{#if fileStats.added}
54-
<Button size="tag" clickable={false} style="success" kind="soft"
55-
>+{fileStats.added}</Button
56-
>
52+
<Badge size="icon" style="success" kind="soft">+{fileStats.added}</Badge>
5753
{/if}
5854
{#if fileStats.removed}
59-
<Button size="tag" clickable={false} style="error" kind="soft"
60-
>-{fileStats.removed}</Button
61-
>
55+
<Badge size="icon" style="error" kind="soft">-{fileStats.removed}</Badge>
6256
{/if}
6357
{#if fileStatus}
6458
<FileStatusTag status={fileStatus} />

apps/desktop/src/lib/file/FileContextMenu.svelte

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,6 @@
141141
<ul class="file-list">
142142
{#each item.files as file}
143143
<FileListItem filePath={file.path} fileStatus={file.status} clickable={false} />
144-
<!-- <li><code class="code-string">{file.path}</code></li> -->
145144
{/each}
146145
</ul>
147146
{:else}

0 commit comments

Comments
 (0)