From d8e18c00e1a5724726520cc5dc3b236e434d305f Mon Sep 17 00:00:00 2001 From: Justin Edmund Date: Mon, 29 Sep 2025 23:48:02 -0700 Subject: [PATCH] update ui components --- .../components/examples/SearchExample.svelte | 4 +- .../party/PartySegmentedControl.svelte | 2 +- .../modifications/AwakeningDisplay.svelte | 29 +++++-- src/lib/components/ui/DetailItem.svelte | 4 +- src/lib/components/ui/Input.svelte | 28 +++--- src/lib/components/ui/Sidebar.svelte | 86 +++++++++++-------- src/lib/components/ui/SidebarHeader.svelte | 1 - src/lib/services/conflict.service.ts | 2 +- src/lib/services/grid.service.ts | 3 +- src/lib/services/party.service.ts | 2 +- src/lib/stores/sidebar.svelte.ts | 14 ++- src/lib/types/api/party.ts | 9 +- src/routes/+layout.svelte | 1 + 13 files changed, 113 insertions(+), 72 deletions(-) diff --git a/src/lib/components/examples/SearchExample.svelte b/src/lib/components/examples/SearchExample.svelte index c825b971..fe4b1fef 100644 --- a/src/lib/components/examples/SearchExample.svelte +++ b/src/lib/components/examples/SearchExample.svelte @@ -6,8 +6,8 @@ --> -{#if awakeningData && imageUrl} +{#if awakeningData}
- {displayName} + {#if imageUrl} + {displayName} + {:else} +
+ {/if}
{displayName} {#if showLevel && awakeningData.level !== undefined} @@ -86,6 +92,13 @@ .awakening-icon { border-radius: layout.$item-corner-small; flex-shrink: 0; + + &.placeholder { + background: colors.$grey-70; + display: flex; + align-items: center; + justify-content: center; + } } .awakening-info { diff --git a/src/lib/components/ui/DetailItem.svelte b/src/lib/components/ui/DetailItem.svelte index a6a6699b..6cef92fe 100644 --- a/src/lib/components/ui/DetailItem.svelte +++ b/src/lib/components/ui/DetailItem.svelte @@ -55,12 +55,12 @@ bind:value type="number" variant="number" - bound={true} + contained={true} {placeholder} alignRight={true} /> {:else} - + {/if}
{:else if children} diff --git a/src/lib/components/ui/Input.svelte b/src/lib/components/ui/Input.svelte index 41b656f7..776643be 100644 --- a/src/lib/components/ui/Input.svelte +++ b/src/lib/components/ui/Input.svelte @@ -4,8 +4,8 @@ import Icon from '../Icon.svelte' interface Props extends HTMLInputAttributes { - variant?: 'default' | 'bound' | 'duration' | 'number' | 'range' - bound?: boolean + variant?: 'default' | 'contained' | 'duration' | 'number' | 'range' + contained?: boolean error?: string label?: string leftIcon?: string @@ -21,7 +21,7 @@ let { variant = 'default', - bound = false, + contained = false, error, label, leftIcon, @@ -54,7 +54,7 @@ const inputClasses = $derived( [ 'input', - (variant === 'bound' || bound) && 'bound', + (variant === 'contained' || contained) && 'contained', variant === 'duration' && 'duration', variant === 'number' && 'number', variant === 'range' && 'range', @@ -276,7 +276,7 @@ @include smooth-transition($duration-quick, border-color); &:focus { - @include focus-ring($blue); + // @include focus-ring($blue); } } @@ -312,20 +312,24 @@ &:has(.counter) input { padding-right: $unit-8x; } + + input { + border: 2px solid transparent; + } } &[type='number']::-webkit-inner-spin-button { -webkit-appearance: none; } - &.bound { + &.contained { background-color: var(--input-bound-bg); &:hover:not(:disabled) { background-color: var(--input-bound-bg-hover); } - // For wrapper variant with bound + // For wrapper variant with contained &.wrapper { background-color: var(--input-bound-bg); @@ -367,12 +371,12 @@ text-align: right; } - &:hover:not(:disabled):not(.bound) { + &:hover:not(:disabled):not(.contained) { background-color: var(--input-bg-hover); } &:focus { - @include focus-ring($blue); + // @include focus-ring($blue); } &:disabled { @@ -400,7 +404,7 @@ -webkit-appearance: none; } - &.bound { + &.contained { background-color: var(--input-bound-bg); &:hover:not(:disabled) { @@ -443,12 +447,12 @@ height: 100%; } - &:hover:not(:disabled):not(.bound) { + &:hover:not(:disabled):not(.contained) { background-color: var(--input-bg-hover); } &:focus { - @include focus-ring($blue); + // @include focus-ring($blue); } &:disabled { diff --git a/src/lib/components/ui/Sidebar.svelte b/src/lib/components/ui/Sidebar.svelte index 44cb89d7..8bdce188 100644 --- a/src/lib/components/ui/Sidebar.svelte +++ b/src/lib/components/ui/Sidebar.svelte @@ -16,9 +16,11 @@ children?: Snippet /** Optional header actions */ headerActions?: Snippet + /** Whether the sidebar content should scroll. Default true. */ + scrollable?: boolean } - const { open = false, title, onclose, children, headerActions }: Props = $props() + const { open = false, title, onclose, children, headerActions, scrollable = true }: Props = $props()