Normalize local UI kit button/select/input heights to 2.5rem
The local shadcn-style button (default h-9, sm h-8, icon h-9) and select trigger (h-9) rendered shorter than the search input elsewhere, and shorter than the shared design system's 2.5rem controls. Collapse all size variants to h-10 (2.5rem), keeping their padding/font-size differences. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
1 parent
8327214942
commit
b9dd2ffde6
3 files changed
+59
-59
No files matched your search
@@ -1,39 +1,39 @@
|
|||||||
<script module>
|
<script module>
|
||||||
import { cva } from 'class-variance-authority';
|
import { cva } from 'class-variance-authority';
|
||||||
|
|
||||||
export const buttonVariants = cva(
|
export const buttonVariants = cva(
|
||||||
'inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 [&_svg]:size-4 [&_svg]:shrink-0',
|
'inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 [&_svg]:size-4 [&_svg]:shrink-0',
|
||||||
{
|
{
|
||||||
variants: {
|
variants: {
|
||||||
variant: {
|
variant: {
|
||||||
default: 'bg-primary text-primary-fg hover:opacity-90',
|
default: 'bg-primary text-primary-fg hover:opacity-90',
|
||||||
secondary: 'bg-surface text-fg hover:bg-surface-hover border border-border',
|
secondary: 'bg-surface text-fg hover:bg-surface-hover border border-border',
|
||||||
ghost: 'hover:bg-surface-hover text-fg',
|
ghost: 'hover:bg-surface-hover text-fg',
|
||||||
outline: 'border border-border bg-transparent hover:bg-surface-hover text-fg',
|
outline: 'border border-border bg-transparent hover:bg-surface-hover text-fg',
|
||||||
danger: 'bg-danger text-danger-fg hover:opacity-90',
|
danger: 'bg-danger text-danger-fg hover:opacity-90',
|
||||||
link: 'text-primary underline-offset-4 hover:underline',
|
link: 'text-primary underline-offset-4 hover:underline',
|
||||||
},
|
},
|
||||||
size: {
|
size: {
|
||||||
default: 'h-9 px-4 py-2',
|
default: 'h-10 px-4 py-2',
|
||||||
sm: 'h-8 rounded-md px-3 text-xs',
|
sm: 'h-10 rounded-md px-3 text-xs',
|
||||||
lg: 'h-10 rounded-md px-6',
|
lg: 'h-10 rounded-md px-6',
|
||||||
icon: 'h-9 w-9',
|
icon: 'h-10 w-10',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
defaultVariants: {
|
defaultVariants: {
|
||||||
variant: 'default',
|
variant: 'default',
|
||||||
size: 'default',
|
size: 'default',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { cn } from '$lib/utils/cn.js';
|
import { cn } from '$lib/utils/cn.js';
|
||||||
|
|
||||||
let { class: className, variant, size, type = 'button', ref = $bindable(null), children, ...restProps } = $props();
|
let { class: className, variant, size, type = 'button', ref = $bindable(null), children, ...restProps } = $props();
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<button bind:this={ref} {type} class={cn(buttonVariants({ variant, size }), className)} {...restProps}>
|
<button bind:this={ref} {type} class={cn(buttonVariants({ variant, size }), className)} {...restProps}>
|
||||||
{@render children?.()}
|
{@render children?.()}
|
||||||
</button>
|
</button>
|
||||||
@@ -1,19 +1,19 @@
|
|||||||
<script>
|
<script>
|
||||||
import { Select } from 'bits-ui';
|
import { Select } from 'bits-ui';
|
||||||
import { ChevronDown } from '@lucide/svelte';
|
import { ChevronDown } from '@lucide/svelte';
|
||||||
import { cn } from '$lib/utils/cn.js';
|
import { cn } from '$lib/utils/cn.js';
|
||||||
|
|
||||||
let { ref = $bindable(null), class: className, children, ...restProps } = $props();
|
let { ref = $bindable(null), class: className, children, ...restProps } = $props();
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<Select.Trigger
|
<Select.Trigger
|
||||||
bind:ref
|
bind:ref
|
||||||
class={cn(
|
class={cn(
|
||||||
'flex h-9 items-center justify-between gap-2 rounded-md border border-border bg-bg px-3 text-sm outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50',
|
'flex h-10 items-center justify-between gap-2 rounded-md border border-border bg-bg px-3 text-sm outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50',
|
||||||
className,
|
className,
|
||||||
)}
|
)}
|
||||||
{...restProps}
|
{...restProps}
|
||||||
>
|
>
|
||||||
{@render children?.()}
|
{@render children?.()}
|
||||||
<ChevronDown class="size-4 opacity-60" />
|
<ChevronDown class="size-4 opacity-60" />
|
||||||
</Select.Trigger>
|
</Select.Trigger>
|
||||||
@@ -92,7 +92,7 @@
|
|||||||
bind:value={searchState.query}
|
bind:value={searchState.query}
|
||||||
placeholder="Search lists…"
|
placeholder="Search lists…"
|
||||||
autocapitalize="none"
|
autocapitalize="none"
|
||||||
class="h-9 w-full rounded-md border border-border bg-bg pl-8 pr-8 text-sm text-fg outline-none focus-visible:ring-2 focus-visible:ring-ring"
|
class="h-10 w-full rounded-md border border-border bg-bg pl-8 pr-8 text-sm text-fg outline-none focus-visible:ring-2 focus-visible:ring-ring"
|
||||||
/>
|
/>
|
||||||
{#if searchState.query}
|
{#if searchState.query}
|
||||||
<button
|
<button
|
||||||
|
|||||||
Reference in new issue
Block a user