From fddf37a95d2758495d1a00de8540f8462726d9e0 Mon Sep 17 00:00:00 2001 From: Pavel Laptev Date: Sat, 2 Mar 2024 16:04:31 +0100 Subject: [PATCH 1/7] styles: `Tag` spinner style updated --- gitbutler-ui/src/lib/components/Icon.svelte | 2 +- gitbutler-ui/src/lib/components/Tag.svelte | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/gitbutler-ui/src/lib/components/Icon.svelte b/gitbutler-ui/src/lib/components/Icon.svelte index 5db6ef95b..79dbc87bb 100644 --- a/gitbutler-ui/src/lib/components/Icon.svelte +++ b/gitbutler-ui/src/lib/components/Icon.svelte @@ -64,7 +64,7 @@ } } .spinner-path { - stroke-width: calc(var(--space-2) / 1.3); + stroke-width: calc(var(--space-2) / 1.4); stroke: currentColor; animation: spinning-path 1.5s infinite ease-in-out; } diff --git a/gitbutler-ui/src/lib/components/Tag.svelte b/gitbutler-ui/src/lib/components/Tag.svelte index 1f5dbfa93..cee5a73f7 100644 --- a/gitbutler-ui/src/lib/components/Tag.svelte +++ b/gitbutler-ui/src/lib/components/Tag.svelte @@ -55,7 +55,7 @@ {#if icon}
- +
{/if} From a30a5083cd94026dab37ecdf6e2d2f41e3dd80b3 Mon Sep 17 00:00:00 2001 From: Pavel Laptev Date: Sat, 2 Mar 2024 17:04:49 +0100 Subject: [PATCH 2/7] updated `Spinner` animation and styles --- gitbutler-ui/src/lib/components/Icon.svelte | 34 +++++++++++++++------ 1 file changed, 25 insertions(+), 9 deletions(-) diff --git a/gitbutler-ui/src/lib/components/Icon.svelte b/gitbutler-ui/src/lib/components/Icon.svelte index 79dbc87bb..2a7a03c78 100644 --- a/gitbutler-ui/src/lib/components/Icon.svelte +++ b/gitbutler-ui/src/lib/components/Icon.svelte @@ -26,9 +26,18 @@ style:fill-opacity={opacity} style:width={pxToRem(size)} style:height={pxToRem(size)} + style="--spinner-radius: {spinnerRadius}" > {#if name == 'spinner'} - + + {:else} {/if} @@ -36,6 +45,7 @@ From 32d4b026a0c7c58147c5468c754d216818640d7f Mon Sep 17 00:00:00 2001 From: Pavel Laptev Date: Sat, 2 Mar 2024 20:43:01 +0100 Subject: [PATCH 3/7] Refactor: Button and Dropdown - removed `:global` rule - removed `class` prop from `Button` as not used - removed `joinClassNames` function as not efficient and almost not used - added `isDropdownChild` to `Button` --- gitbutler-ui/src/lib/components/Button.svelte | 37 +++++++++++++++++-- .../src/lib/components/DropDownButton.svelte | 29 ++------------- 2 files changed, 36 insertions(+), 30 deletions(-) diff --git a/gitbutler-ui/src/lib/components/Button.svelte b/gitbutler-ui/src/lib/components/Button.svelte index f17773b9b..b990717a4 100644 --- a/gitbutler-ui/src/lib/components/Button.svelte +++ b/gitbutler-ui/src/lib/components/Button.svelte @@ -14,6 +14,7 @@ export let iconAlign: 'left' | 'right' = 'right'; export let color: ButtonColor = 'primary'; export let kind: 'filled' | 'outlined' = 'filled'; + export let isDropdownChild = false; export let disabled = false; export let notClickable = false; export let id: string | undefined = undefined; @@ -27,9 +28,6 @@ export let element: HTMLAnchorElement | HTMLButtonElement | HTMLElement | null = null; - let className = ''; - export { className as class }; - const SLOTS = $$props.$$slots; onMount(() => { @@ -39,7 +37,7 @@