impr: improve design consistency/rounding

This commit is contained in:
James Xylight committed 2025-06-11 14:00:59 -07:00
1 parent 664af6382e
commit 33c3fb321f
10 files changed
+65 -38

No files matched your search

@@ -147,7 +147,7 @@
<button
class={[
'row-span-2 shrink-0 mr-2 self-center group/btn',
'bg-slate-200 dark:bg-zinc-800 rounded-md cursor-pointer',
'bg-slate-200 dark:bg-zinc-800 rounded-lg cursor-pointer',
]}
>
<Avatar
@@ -72,7 +72,7 @@
buttonColor.ghost,
'rounded-full h-full font-medium flex items-center *:p-2',
'hover:bg-white dark:hover:bg-zinc-900 overflow-hidden transition-colors shrink-0',
'text-inherit! divide-x divide-slate-200 dark:divide-zinc-800',
'text-inherit! divide-x divide-slate-200 dark:divide-zinc-800 shadow-xs',
loading && 'animate-pulse opacity-75 pointer-events-none',
]}
role="group"
@@ -145,7 +145,7 @@
<div
class="flex flex-col border border-slate-200 border-b-slate-300 dark:border-t-zinc-700/70 dark:border-zinc-800
focus-within:border-primary-900 dark:focus-within:border-primary-100 focus-within:ring-3 ring-slate-300
dark:ring-zinc-700 rounded-xl
dark:ring-zinc-700 rounded-2xl
overflow-hidden transition-colors {clazz}"
class:mt-1={label}
>
+10 -6
View File
@@ -65,17 +65,21 @@
{alt}
{width}
{title}
class={['aspect-square object-cover overflow-hidden shrink-0', clazz]}
class={[
'aspect-square object-cover overflow-hidden shrink-0',
circle ? 'rounded-full' : 'rounded-lg',
clazz,
]}
style="width: {width}px; height: {width}px; {style}"
class:rounded-full={circle}
class:rounded-md={!circle}
/>
{:else}
<div
style="width: {width}px; height: {width}px;"
class={['aspect-square object-cover overflow-hidden shrink-0', clazz]}
class:rounded-full={circle}
class:rounded-md={!circle}
class={[
'aspect-square object-cover overflow-hidden shrink-0',
circle ? 'rounded-full' : 'rounded-lg',
clazz,
]}
>
{@html createAvatar(initials, {
seed: alt,
@@ -1,8 +1,16 @@
<script lang="ts">
const sizes = {
sm: 'text-2xl',
md: 'text-3xl',
lg: 'text-4xl',
xl: 'text-6xl',
}
interface Props {
pageHeader?: boolean
style?: string
class?: string
size?: keyof typeof sizes
children?: import('svelte').Snippet
extended?: import('svelte').Snippet
}
@@ -11,6 +19,7 @@
pageHeader = false,
style = '',
class: clazz = '',
size = 'lg',
children,
extended,
}: Props = $props()
@@ -26,7 +35,7 @@
{style}
>
<h1
class="text-4xl flex gap-2 w-full tracking-tight font-medium {clazz ?? ''}"
class={[sizes[size], 'flex gap-2 w-full tracking-tight font-medium', clazz]}
>
{@render children?.()}
</h1>
+2 -2
View File
@@ -173,8 +173,8 @@
buttonSize[size],
buttonRounding[rounding][roundingSide],
buttonShadow[shadow],
'text-sm transition-all font-medium cursor-pointer duration-75 disabled:opacity-50 disabled:pointer-events-none',
disabled && 'pointer-events-none opacity-50',
'text-sm transition-all font-medium cursor-pointer duration-75 disabled:opacity-50 disabled:pointer-events-none disabled:shadow-none',
disabled && 'pointer-events-none opacity-50 shadow-none',
alignment == 'center'
? 'origin-center'
: alignment == 'left'
+7 -9
View File
@@ -55,7 +55,7 @@
shadow = 'none',
element = $bindable(),
class: clazz = '',
customLabel,
customLabel: passedCustomLabel,
prefix,
suffix,
children,
@@ -64,7 +64,7 @@
</script>
<div class="flex flex-col gap-1 {clazz}">
{#if customLabel || label}
{#if passedCustomLabel || label}
<Label
for={id}
text={label}
@@ -72,9 +72,7 @@
? "after:content-['*'] after:text-red-500 after:ml-1"
: ''}"
>
{#snippet customLabel()}
{@render customLabel?.()}
{/snippet}
{@render passedCustomLabel?.()}
</Label>
{/if}
<div
@@ -84,13 +82,13 @@
`border focus-within:border-primary-900 dark:focus-within:border-primary-100 focus-within:ring-2
ring-slate-300 dark:ring-zinc-700
transition-colors
rounded-lg flex flex-row items-center text-sm`,
rounded-xl flex flex-row items-center text-sm`,
clazz,
]}
>
{#if prefix}
<div
class="rounded-lg rounded-r-none
class="rounded-xl rounded-r-none
text-slate-600 dark:text-zinc-400 {inlineAffixes
? 'bg-white dark:bg-zinc-950 pr-0 w-8'
: ''} {sizeClass[size]}"
@@ -109,7 +107,7 @@
class={[
sizeClass[size],
`bg-white dark:bg-zinc-950
focus:outline-hidden rounded-lg text-sm w-full disabled:bg-slate-100
focus:outline-hidden rounded-xl text-sm w-full disabled:bg-slate-100
disabled:cursor-not-allowed dark:disabled:bg-zinc-950 invalid:border-red-500!
peer invalid:text-red-500 z-10`,
prefix && 'rounded-l-none',
@@ -122,7 +120,7 @@
{#if suffix}
<div
class={[
'rounded-lg rounded-l-none text-slate-600 dark:text-zinc-400',
'rounded-xl rounded-l-none text-slate-600 dark:text-zinc-400',
inlineAffixes && 'bg-white dark:bg-zinc-950 pl-0',
sizeClass[size],
]}