diff options
| author | Martin Kagamino Lehoux <martin@lehoux.net> | 2026-09-12 22:24:19 +0200 |
|---|---|---|
| committer | Martin Kagamino Lehoux <martin@lehoux.net> | 2026-09-12 22:24:19 +0200 |
| commit | 5f0a73920034741236034ed7a721c68eceb8ab82 (patch) | |
| tree | c5653093db0484e7474b9d69941666dfc308b083 /src/lib/components/Row.svelte | |
| parent | 1cef356be95a67f95d40f5b0b131f98d11f13c13 (diff) | |
Extract Row primitive, migrate all call sites
Variants card/ref/plain with scoped skin. Padding and wrap
one-offs via style prop; draggable and handlers via rest
spread. GroceryRow absorbs item-btn/ref-link globals with
local names; BestRef scopes best-ref. Delete item-* globals
and dead page overrides.
Diffstat (limited to 'src/lib/components/Row.svelte')
| -rw-r--r-- | src/lib/components/Row.svelte | 54 |
1 files changed, 54 insertions, 0 deletions
diff --git a/src/lib/components/Row.svelte b/src/lib/components/Row.svelte new file mode 100644 index 0000000..e388392 --- /dev/null +++ b/src/lib/components/Row.svelte @@ -0,0 +1,54 @@ +<script lang="ts"> + import type { Snippet } from 'svelte'; + import type { HTMLLiAttributes } from 'svelte/elements'; + + let { + variant = 'card', + style, + children, + ...rest + }: { + variant?: 'card' | 'ref' | 'plain'; + style?: string; + children: Snippet; + } & HTMLLiAttributes = $props(); +</script> + +<li class={variant} {style} {...rest}> + {@render children()} +</li> + +<style> + li { + display: flex; + align-items: center; + gap: 0.5rem; + } + + .card { + padding: 0.5rem 0.75rem; + background: var(--surface); + border-radius: 0.75rem; + box-shadow: 0 1px 2px var(--shadow); + transition: all 0.2s ease; + } + + .card:hover { + box-shadow: 0 2px 6px var(--shadow); + transform: translateY(-1px); + } + + .ref { + padding: 0.875rem 1rem; + gap: 0.75rem; + background: var(--surface); + border-radius: 0.75rem; + box-shadow: 0 1px 2px var(--shadow); + transition: all 0.2s ease; + } + + .ref:hover { + box-shadow: 0 2px 6px var(--shadow); + transform: translateY(-1px); + } +</style> |
