mirror of
https://github.com/Memo-2023/mana-monorepo.git
synced 2026-05-14 19:41:09 +02:00
fix(shared-ui): improve PillNavigation and PillDropdown components
- Fix PillNavigation styling and spacing - Improve PillDropdown animation and positioning - Adjust PillToolbar for better responsiveness - Fix PillTimeRangeSelector hour selection 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
parent
e473a026ee
commit
21f2b28bf0
4 changed files with 44 additions and 10 deletions
|
|
@ -13,6 +13,8 @@
|
|||
header?: Snippet;
|
||||
/** Optional footer content (e.g., a11y toggles) */
|
||||
footer?: Snippet;
|
||||
/** Show only the icon without label */
|
||||
iconOnly?: boolean;
|
||||
}
|
||||
|
||||
let {
|
||||
|
|
@ -24,6 +26,7 @@
|
|||
onToggle,
|
||||
header,
|
||||
footer,
|
||||
iconOnly = false,
|
||||
}: Props = $props();
|
||||
|
||||
let internalOpen = $state(false);
|
||||
|
|
@ -123,13 +126,20 @@
|
|||
|
||||
<div class="pill-dropdown">
|
||||
<!-- Trigger Button -->
|
||||
<button bind:this={triggerButton} onclick={toggle} class="pill glass-pill trigger-button">
|
||||
<button
|
||||
bind:this={triggerButton}
|
||||
onclick={toggle}
|
||||
class="pill glass-pill trigger-button"
|
||||
class:icon-only={iconOnly}
|
||||
>
|
||||
{#if icon}
|
||||
<svg class="pill-icon" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
||||
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d={getIcon(icon)} />
|
||||
</svg>
|
||||
{/if}
|
||||
<span class="pill-label">{label}</span>
|
||||
{#if !iconOnly}
|
||||
<span class="pill-label">{label}</span>
|
||||
{/if}
|
||||
<svg
|
||||
class="chevron-icon"
|
||||
class:rotated={open}
|
||||
|
|
@ -281,6 +291,10 @@
|
|||
z-index: 10;
|
||||
}
|
||||
|
||||
.trigger-button.icon-only {
|
||||
padding: 0.5rem 0.625rem;
|
||||
}
|
||||
|
||||
.chevron-icon {
|
||||
width: 0.75rem;
|
||||
height: 0.75rem;
|
||||
|
|
|
|||
|
|
@ -27,6 +27,7 @@
|
|||
Tray,
|
||||
Check,
|
||||
CheckCircle,
|
||||
CheckSquare,
|
||||
Plus,
|
||||
Columns,
|
||||
Microphone,
|
||||
|
|
@ -73,6 +74,7 @@
|
|||
inbox: Tray,
|
||||
check: Check,
|
||||
checkCircle: CheckCircle,
|
||||
'check-square': CheckSquare,
|
||||
plus: Plus,
|
||||
columns: Columns,
|
||||
kanban: Columns,
|
||||
|
|
@ -84,6 +86,7 @@
|
|||
music: MusicNote,
|
||||
document: File,
|
||||
chart: ChartBar,
|
||||
'bar-chart-3': ChartBar,
|
||||
search: MagnifyingGlass,
|
||||
list: List,
|
||||
compass: Compass,
|
||||
|
|
@ -443,6 +446,7 @@
|
|||
direction={dropdownDirection}
|
||||
label={appName}
|
||||
icon="grid"
|
||||
iconOnly={!isSidebarMode}
|
||||
/>
|
||||
{:else}
|
||||
<a href={homeRoute} class="pill glass-pill logo-pill">
|
||||
|
|
@ -853,6 +857,9 @@
|
|||
z-index: 1000;
|
||||
padding: 0.75rem 0 1.5rem;
|
||||
pointer-events: none;
|
||||
/* Container query context */
|
||||
container-type: inline-size;
|
||||
container-name: pillnav;
|
||||
}
|
||||
|
||||
/* Desktop bottom position */
|
||||
|
|
@ -882,6 +889,25 @@
|
|||
-ms-overflow-style: none;
|
||||
pointer-events: auto;
|
||||
padding: 0.5rem 2rem;
|
||||
/* Default: left-aligned with fit-content */
|
||||
width: fit-content;
|
||||
max-width: 100%;
|
||||
}
|
||||
|
||||
/* Center when container has enough space (> 600px) */
|
||||
@container pillnav (min-width: 600px) {
|
||||
.pill-nav-container:not(.sidebar-container) {
|
||||
margin-left: auto;
|
||||
margin-right: auto;
|
||||
}
|
||||
}
|
||||
|
||||
/* Larger screens: always centered */
|
||||
@container pillnav (min-width: 900px) {
|
||||
.pill-nav-container:not(.sidebar-container) {
|
||||
margin-left: auto;
|
||||
margin-right: auto;
|
||||
}
|
||||
}
|
||||
|
||||
.pill-nav-container::-webkit-scrollbar {
|
||||
|
|
|
|||
|
|
@ -174,7 +174,6 @@
|
|||
|
||||
.trigger-button {
|
||||
position: relative;
|
||||
z-index: 10;
|
||||
}
|
||||
|
||||
.pill {
|
||||
|
|
|
|||
|
|
@ -39,7 +39,7 @@
|
|||
top: var(--toolbar-top-offset, 70px);
|
||||
left: 0;
|
||||
right: 0;
|
||||
z-index: 999;
|
||||
z-index: 50;
|
||||
padding: 0.375rem 1rem;
|
||||
pointer-events: none;
|
||||
display: flex;
|
||||
|
|
@ -68,12 +68,7 @@
|
|||
padding: 0.25rem;
|
||||
pointer-events: auto;
|
||||
max-width: 100%;
|
||||
overflow-x: auto;
|
||||
scrollbar-width: none;
|
||||
}
|
||||
|
||||
.toolbar-bar::-webkit-scrollbar {
|
||||
display: none;
|
||||
overflow: visible;
|
||||
}
|
||||
|
||||
.glass-pill {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue