managarten/packages/shared-ui/src/navigation/PillToolbarButton.svelte
Till-JS 88c91e22b0 fix(ui): replace hardcoded colors with theme variables
- InputBar: use --color-primary, --color-surface, --color-border for
  focus ring, backgrounds, and syntax highlighting
- PillToolbarButton: active state uses --color-primary
- PillViewSwitcher: sliding indicator and active text use theme colors
- PillTimeRangeSelector: all glass effects and active states themed
- CalendarToolbar: FAB active state uses theme colors
- CalendarToolbarContent: removed hardcoded primaryColor prop
- DateStrip: replaced all #3b82f6 with theme variables

All UI components now automatically adapt to the selected theme
(Ocean, Sunset, Forest, etc.)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-13 14:40:16 +01:00

83 lines
1.5 KiB
Svelte

<script lang="ts">
import type { Snippet } from 'svelte';
interface Props {
/** Click handler */
onclick: () => void;
/** Whether the button is in active state */
active?: boolean;
/** Tooltip title */
title?: string;
/** Whether to render as icon-only (smaller padding) */
iconOnly?: boolean;
/** Disabled state */
disabled?: boolean;
/** Button content (icon and/or text) */
children: Snippet;
}
let {
onclick,
active = false,
title,
iconOnly = false,
disabled = false,
children,
}: Props = $props();
</script>
<button
type="button"
class="toolbar-btn"
class:active
class:icon-only={iconOnly}
{title}
{disabled}
{onclick}
>
{@render children()}
</button>
<style>
.toolbar-btn {
display: flex;
align-items: center;
justify-content: center;
gap: 0.375rem;
padding: 0.5rem 0.75rem;
background: transparent;
border: none;
border-radius: 9999px;
cursor: pointer;
color: hsl(var(--color-foreground));
font-size: 0.875rem;
font-weight: 500;
white-space: nowrap;
transition: all 0.15s ease;
}
.toolbar-btn:hover:not(:disabled) {
background: hsl(var(--color-foreground) / 0.05);
}
.toolbar-btn.active {
background: hsl(var(--color-primary) / 0.15);
color: hsl(var(--color-primary));
}
.toolbar-btn.icon-only {
padding: 0.5rem;
}
.toolbar-btn:disabled {
opacity: 0.5;
cursor: not-allowed;
}
/* Icon styling */
.toolbar-btn :global(svg) {
width: 1rem;
height: 1rem;
flex-shrink: 0;
}
</style>