mirror of
https://github.com/Memo-2023/mana-monorepo.git
synced 2026-05-21 03:06:42 +02:00
chore: various UI improvements and fixes
Calendar: - Fix EventDetailModal and QuickEventOverlay component updates - Update TodoDetailModal and TodoItem components - Remove unused settings section code - Fix network page styling Todo Backend: - Improve task service validation Shared UI: - Update Card, DataCard, Input components with improvements - Enhance TagBadge with better color handling - Fix TagEditModal and TagList components - Update PillNavigation and PillDropdown styling - Add NetworkGraph improvements - Update CommandBar, FormModal, AppsPage components - Fix chart types and GlobalSettingsSection 🤖 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
b92dc296a1
commit
0b28eba3f2
26 changed files with 167 additions and 198 deletions
|
|
@ -164,10 +164,7 @@
|
|||
border-bottom: none;
|
||||
}
|
||||
|
||||
/* Body */
|
||||
.card__body {
|
||||
/* Padding applied via variant classes above */
|
||||
}
|
||||
/* Body - padding applied via variant classes above */
|
||||
|
||||
/* Footer */
|
||||
.card__footer {
|
||||
|
|
|
|||
|
|
@ -2,8 +2,6 @@
|
|||
* Shared Types for Chart Components
|
||||
*/
|
||||
|
||||
import type { Component } from 'svelte';
|
||||
|
||||
// Stat card variant colors
|
||||
export type StatVariant = 'success' | 'primary' | 'neutral' | 'danger' | 'info' | 'accent';
|
||||
|
||||
|
|
@ -17,11 +15,13 @@ export const STAT_VARIANT_COLORS: Record<StatVariant, { bg: string; color: strin
|
|||
};
|
||||
|
||||
// StatsGrid types
|
||||
|
||||
export interface StatItem {
|
||||
id: string;
|
||||
label: string;
|
||||
value: number | string;
|
||||
icon: Component;
|
||||
/** Svelte component to render as icon (e.g., lucide-svelte icon) */
|
||||
icon: any;
|
||||
variant: StatVariant;
|
||||
/** Optional: only show this stat if condition is true */
|
||||
showCondition?: boolean;
|
||||
|
|
|
|||
|
|
@ -102,7 +102,7 @@
|
|||
let creating = $state(false);
|
||||
let selectedIndex = $state(0);
|
||||
let searchTimeout: ReturnType<typeof setTimeout>;
|
||||
let inputElement: HTMLInputElement;
|
||||
let inputElement = $state<HTMLInputElement | null>(null);
|
||||
|
||||
// Computed create preview
|
||||
let createPreview = $derived(
|
||||
|
|
@ -260,6 +260,7 @@
|
|||
role="dialog"
|
||||
aria-modal="true"
|
||||
aria-label="Suchen"
|
||||
tabindex="-1"
|
||||
onclick={handleBackdropClick}
|
||||
onkeydown={handleKeydown}
|
||||
>
|
||||
|
|
|
|||
|
|
@ -80,6 +80,7 @@
|
|||
const isClickable = $derived(interactive || !!onclick);
|
||||
</script>
|
||||
|
||||
<!-- svelte-ignore a11y_no_noninteractive_tabindex -->
|
||||
<div
|
||||
class="data-card rounded-xl p-4 transition-colors {variantClasses[variant]} {isClickable
|
||||
? 'cursor-pointer hover:bg-menu-hover'
|
||||
|
|
@ -153,6 +154,7 @@
|
|||
.line-clamp-2 {
|
||||
display: -webkit-box;
|
||||
-webkit-line-clamp: 2;
|
||||
line-clamp: 2;
|
||||
-webkit-box-orient: vertical;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@
|
|||
value: string;
|
||||
oninput?: (value: string) => void;
|
||||
onchange?: (value: string) => void;
|
||||
onkeydown?: (e: KeyboardEvent) => void;
|
||||
label?: string;
|
||||
placeholder?: string;
|
||||
type?: 'text' | 'email' | 'password' | 'number' | 'tel' | 'url';
|
||||
|
|
@ -21,6 +22,7 @@
|
|||
value = $bindable(),
|
||||
oninput,
|
||||
onchange,
|
||||
onkeydown,
|
||||
label,
|
||||
placeholder,
|
||||
type = 'text',
|
||||
|
|
@ -66,6 +68,7 @@
|
|||
autocomplete={autocomplete as HTMLInputAttributes['autocomplete']}
|
||||
oninput={handleInput}
|
||||
onchange={handleChange}
|
||||
{onkeydown}
|
||||
class="w-full rounded-lg border px-4 py-2.5 text-theme bg-content transition-colors focus:outline-none focus:ring-2 focus:ring-primary/50 disabled:opacity-50 disabled:cursor-not-allowed {error
|
||||
? 'border-red-500 focus:ring-red-500/50'
|
||||
: 'border-theme'}"
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@
|
|||
/** Alternative name field (for compatibility) */
|
||||
text?: string;
|
||||
/** Tag color (hex) */
|
||||
color?: string;
|
||||
color?: string | null;
|
||||
/** Nested style object with color */
|
||||
style?: { color?: string };
|
||||
}
|
||||
|
|
@ -55,36 +55,64 @@
|
|||
}
|
||||
</script>
|
||||
|
||||
<span
|
||||
class="inline-flex items-center gap-1.5 rounded-full px-3 py-1 text-sm font-medium transition-all"
|
||||
class:cursor-pointer={clickable}
|
||||
class:hover:scale-105={clickable}
|
||||
style="background-color: {tagColor}20; color: {tagColor}"
|
||||
onclick={handleClick}
|
||||
onkeydown={handleKeyDown}
|
||||
role={clickable ? 'button' : undefined}
|
||||
tabindex={clickable ? 0 : undefined}
|
||||
>
|
||||
<!-- Color indicator dot -->
|
||||
<div class="h-2 w-2 rounded-full" style="background-color: {tagColor}"></div>
|
||||
{#if clickable}
|
||||
<span
|
||||
class="inline-flex items-center gap-1.5 rounded-full px-3 py-1 text-sm font-medium transition-all cursor-pointer hover:scale-105"
|
||||
style="background-color: {tagColor}20; color: {tagColor}"
|
||||
onclick={handleClick}
|
||||
onkeydown={handleKeyDown}
|
||||
role="button"
|
||||
tabindex="0"
|
||||
>
|
||||
<!-- Color indicator dot -->
|
||||
<div class="h-2 w-2 rounded-full" style="background-color: {tagColor}"></div>
|
||||
|
||||
<span>{tagName}</span>
|
||||
<span>{tagName}</span>
|
||||
|
||||
{#if removable}
|
||||
<button
|
||||
onclick={handleRemove}
|
||||
class="ml-1 rounded-full hover:bg-black/10 p-0.5 transition-colors"
|
||||
type="button"
|
||||
aria-label="Remove tag"
|
||||
>
|
||||
<svg class="h-3 w-3" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
||||
<path
|
||||
stroke-linecap="round"
|
||||
stroke-linejoin="round"
|
||||
stroke-width="2"
|
||||
d="M6 18L18 6M6 6l12 12"
|
||||
/>
|
||||
</svg>
|
||||
</button>
|
||||
{/if}
|
||||
</span>
|
||||
{#if removable}
|
||||
<button
|
||||
onclick={handleRemove}
|
||||
class="ml-1 rounded-full hover:bg-black/10 p-0.5 transition-colors"
|
||||
type="button"
|
||||
aria-label="Remove tag"
|
||||
>
|
||||
<svg class="h-3 w-3" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
||||
<path
|
||||
stroke-linecap="round"
|
||||
stroke-linejoin="round"
|
||||
stroke-width="2"
|
||||
d="M6 18L18 6M6 6l12 12"
|
||||
/>
|
||||
</svg>
|
||||
</button>
|
||||
{/if}
|
||||
</span>
|
||||
{:else}
|
||||
<span
|
||||
class="inline-flex items-center gap-1.5 rounded-full px-3 py-1 text-sm font-medium"
|
||||
style="background-color: {tagColor}20; color: {tagColor}"
|
||||
>
|
||||
<!-- Color indicator dot -->
|
||||
<div class="h-2 w-2 rounded-full" style="background-color: {tagColor}"></div>
|
||||
|
||||
<span>{tagName}</span>
|
||||
|
||||
{#if removable}
|
||||
<button
|
||||
onclick={handleRemove}
|
||||
class="ml-1 rounded-full hover:bg-black/10 p-0.5 transition-colors"
|
||||
type="button"
|
||||
aria-label="Remove tag"
|
||||
>
|
||||
<svg class="h-3 w-3" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
||||
<path
|
||||
stroke-linecap="round"
|
||||
stroke-linejoin="round"
|
||||
stroke-width="2"
|
||||
d="M6 18L18 6M6 6l12 12"
|
||||
/>
|
||||
</svg>
|
||||
</button>
|
||||
{/if}
|
||||
</span>
|
||||
{/if}
|
||||
|
|
|
|||
|
|
@ -79,22 +79,22 @@
|
|||
<div class="space-y-6">
|
||||
<!-- Name Input -->
|
||||
<div>
|
||||
<Input bind:value={name} placeholder={namePlaceholder} onkeydown={handleKeyDown} autofocus />
|
||||
<Input bind:value={name} placeholder={namePlaceholder} onkeydown={handleKeyDown} />
|
||||
</div>
|
||||
|
||||
<!-- Color Picker -->
|
||||
<div>
|
||||
<label class="block text-sm font-medium text-muted-foreground mb-3">
|
||||
<span class="block text-sm font-medium text-muted-foreground mb-3">
|
||||
{colorLabel}
|
||||
</label>
|
||||
</span>
|
||||
<TagColorPicker selectedColor={color} onColorChange={(c) => (color = c)} />
|
||||
</div>
|
||||
|
||||
<!-- Preview -->
|
||||
<div>
|
||||
<label class="block text-sm font-medium text-muted-foreground mb-3">
|
||||
<span class="block text-sm font-medium text-muted-foreground mb-3">
|
||||
{previewLabel}
|
||||
</label>
|
||||
</span>
|
||||
<div class="flex items-center gap-2">
|
||||
<TagBadge tag={previewTag} />
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -83,6 +83,7 @@
|
|||
<div class={layout === 'grid' ? gridClasses : listClasses}>
|
||||
{#each tags as tag (tag.id)}
|
||||
{@const color = getTagColor(tag)}
|
||||
<!-- svelte-ignore a11y_no_noninteractive_tabindex -->
|
||||
<div
|
||||
class="
|
||||
group relative flex items-center gap-3 p-4
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@ export interface Tag {
|
|||
export interface TagData {
|
||||
name?: string;
|
||||
text?: string;
|
||||
color?: string;
|
||||
color?: string | null;
|
||||
style?: { color?: string };
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -148,7 +148,11 @@
|
|||
|
||||
{#if open}
|
||||
<!-- Backdrop -->
|
||||
<button class="menu-backdrop" onclick={close} onkeydown={(e) => e.key === 'Escape' && close()}
|
||||
<button
|
||||
class="menu-backdrop"
|
||||
onclick={close}
|
||||
onkeydown={(e) => e.key === 'Escape' && close()}
|
||||
aria-label="Close dropdown"
|
||||
></button>
|
||||
|
||||
<!-- Dropdown items -->
|
||||
|
|
|
|||
|
|
@ -467,7 +467,8 @@
|
|||
{:else if item.iconSvg}
|
||||
{@html item.iconSvg}
|
||||
{:else if phosphorIcons[item.icon]}
|
||||
<svelte:component this={phosphorIcons[item.icon]} size={18} class="pill-icon" />
|
||||
{@const IconComponent = phosphorIcons[item.icon]}
|
||||
<IconComponent size={18} class="pill-icon" />
|
||||
{:else}
|
||||
<svg class="pill-icon" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
||||
<path
|
||||
|
|
@ -500,7 +501,8 @@
|
|||
<a href={element.href} class="pill glass-pill" class:active={isActive(element.href)}>
|
||||
{#if element.icon}
|
||||
{#if phosphorIcons[element.icon]}
|
||||
<svelte:component this={phosphorIcons[element.icon]} size={18} class="pill-icon" />
|
||||
{@const IconComponent = phosphorIcons[element.icon]}
|
||||
<IconComponent size={18} class="pill-icon" />
|
||||
{:else}
|
||||
<svg class="pill-icon" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
||||
<path
|
||||
|
|
@ -1206,9 +1208,7 @@
|
|||
min-height: 1rem;
|
||||
}
|
||||
|
||||
.sidebar-container .toggle-pill {
|
||||
margin-top: auto;
|
||||
}
|
||||
/* Note: .toggle-pill class may be applied dynamically */
|
||||
|
||||
/* Segmented control */
|
||||
.segmented-control {
|
||||
|
|
|
|||
|
|
@ -84,6 +84,7 @@
|
|||
</script>
|
||||
|
||||
<Modal {visible} {onClose} {title} {icon} {maxWidth}>
|
||||
<!-- svelte-ignore a11y_no_noninteractive_element_interactions -->
|
||||
<form onsubmit={handleSubmit} onkeydown={handleKeydown} class="space-y-4">
|
||||
<!-- Error message -->
|
||||
{#if error}
|
||||
|
|
|
|||
|
|
@ -256,6 +256,7 @@
|
|||
export { resetZoom, zoomIn, zoomOut, focusOnSelectedNode };
|
||||
</script>
|
||||
|
||||
<!-- svelte-ignore a11y_no_noninteractive_element_interactions -->
|
||||
<div
|
||||
bind:this={containerElement}
|
||||
class="network-graph-container"
|
||||
|
|
@ -265,11 +266,14 @@
|
|||
role="application"
|
||||
aria-label="Network Graph"
|
||||
>
|
||||
<!-- svelte-ignore a11y_click_events_have_key_events -->
|
||||
<svg
|
||||
bind:this={svgElement}
|
||||
class="network-graph-svg"
|
||||
style="width: 100%; height: 100%;"
|
||||
onclick={handleBackgroundClick}
|
||||
role="img"
|
||||
aria-label="Network graph visualization"
|
||||
>
|
||||
<g transform="translate({transform.x}, {transform.y}) scale({transform.k})">
|
||||
<!-- Links -->
|
||||
|
|
@ -280,6 +284,7 @@
|
|||
{@const targetId = typeof link.target === 'string' ? link.target : link.target.id}
|
||||
{@const isHighlighted =
|
||||
selectedNodeId && (sourceId === selectedNodeId || targetId === selectedNodeId)}
|
||||
<!-- svelte-ignore a11y_no_static_element_interactions -->
|
||||
<!-- Invisible wider line for easier hover -->
|
||||
<line
|
||||
x1={coords.x1}
|
||||
|
|
|
|||
|
|
@ -156,6 +156,7 @@
|
|||
|
||||
<!-- Modal -->
|
||||
{#if selectedAppIndex !== null}
|
||||
<!-- svelte-ignore a11y_click_events_have_key_events -->
|
||||
<div class="modal-overlay" onclick={closeModal} role="dialog" aria-modal="true" tabindex="-1">
|
||||
<button onclick={closeModal} class="modal-close-btn" aria-label="Close modal">
|
||||
<svg
|
||||
|
|
@ -383,6 +384,7 @@
|
|||
margin: 0;
|
||||
display: -webkit-box;
|
||||
-webkit-line-clamp: 2;
|
||||
line-clamp: 2;
|
||||
-webkit-box-orient: vertical;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -209,6 +209,7 @@
|
|||
: 'bg-gray-200 dark:bg-gray-700'}"
|
||||
onclick={() =>
|
||||
handleSidebarChange(!userSettings.globalSettings.nav.sidebarCollapsed)}
|
||||
aria-label="Toggle sidebar collapsed state"
|
||||
>
|
||||
<span
|
||||
class="inline-block h-4 w-4 transform rounded-full bg-white transition-transform {userSettings
|
||||
|
|
@ -416,6 +417,7 @@
|
|||
? 'bg-[hsl(var(--primary))]'
|
||||
: 'bg-gray-200 dark:bg-gray-700'}"
|
||||
onclick={() => handleSoundsChange(!(userSettings.general?.soundsEnabled ?? true))}
|
||||
aria-label="Toggle sound effects"
|
||||
>
|
||||
<span
|
||||
class="inline-block h-4 w-4 transform rounded-full bg-white transition-transform {(userSettings
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue