mirror of
https://github.com/Memo-2023/mana-monorepo.git
synced 2026-05-21 12:06:41 +02:00
feat: major update with network graphs, themes, todo extensions, and more
## New Features ### Network Graph Visualization (Contacts, Calendar, Todo) - D3.js force simulation for physics-based layout - Zoom & pan with mouse/touchpad - Keyboard shortcuts: +/- zoom, 0 reset, Esc deselect, / search, F focus - Filtering by tags, company/location/project, connection strength - Shared components in @manacore/shared-ui ### Central Tags API (mana-core-auth) - CRUD endpoints for tags - Schema: tags table with userId, name, color, app - Shared tag components in @manacore/shared-ui ### Custom Themes System - Theme editor with live preview and color picker - Community theme gallery - Theme sharing (public, unlisted, private) - Backend API in mana-core-auth ### Todo App Extensions - Glass-pill design for task input and items - Settings page with 20+ preferences - Task edit modal with inline editing - Statistics page with visualizations - PWA support with offline capabilities - Multiple kanban boards ### Contacts App Features - Duplicate detection - Photo upload - Batch operations - Enhanced favorites page with multiple view modes - Alphabet view improvements - Search modal ### Help System - @manacore/shared-help-content - @manacore/shared-help-ui - @manacore/shared-help-types ### Other Features - Themes page for all apps - Referral system frontend - CommandBar (global search) - Skeleton loaders - Settings page improvements ## Bug Fixes - Network graph simulation initialization - Database schema TEXT for user_id columns (Better Auth compatibility) - Various styling fixes ## Documentation - Daily report for 2025-12-10 - CI/CD deployment guide 🤖 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
e84371aa94
commit
ee42b6cc76
381 changed files with 39284 additions and 6275 deletions
|
|
@ -21,87 +21,42 @@
|
|||
class: className = '',
|
||||
children,
|
||||
}: Props = $props();
|
||||
|
||||
// Base card classes using Tailwind
|
||||
const baseCardClasses =
|
||||
'rounded-2xl overflow-hidden shadow-md border backdrop-blur-xl ' +
|
||||
'bg-white/85 border-black/10 ' +
|
||||
'dark:bg-white/[0.06] dark:border-white/10 dark:shadow-lg';
|
||||
|
||||
const dangerCardClasses =
|
||||
'rounded-2xl overflow-hidden shadow-md border backdrop-blur-xl ' +
|
||||
'bg-red-500/[0.08] border-red-500/30 ' +
|
||||
'dark:bg-red-500/[0.12] dark:border-red-500/25 dark:shadow-lg';
|
||||
|
||||
const headerClasses = 'px-5 py-4 border-b border-black/[0.08] dark:border-white/10';
|
||||
|
||||
const dangerHeaderClasses = 'px-5 py-4 border-b border-red-500/20 bg-red-500/10';
|
||||
</script>
|
||||
|
||||
<div class="settings-card settings-card--{variant} {className}">
|
||||
<div class="{variant === 'danger' ? dangerCardClasses : baseCardClasses} {className}">
|
||||
{#if title || description}
|
||||
<header class="settings-card__header">
|
||||
<header class={variant === 'danger' ? dangerHeaderClasses : headerClasses}>
|
||||
{#if title}
|
||||
<h3 class="settings-card__title">{title}</h3>
|
||||
<h3
|
||||
class="text-base font-semibold text-foreground {variant === 'danger'
|
||||
? 'text-red-500 dark:text-red-400'
|
||||
: ''}"
|
||||
>
|
||||
{title}
|
||||
</h3>
|
||||
{/if}
|
||||
{#if description}
|
||||
<p class="settings-card__description">{description}</p>
|
||||
<p class="text-sm text-muted-foreground mt-1">{description}</p>
|
||||
{/if}
|
||||
</header>
|
||||
{/if}
|
||||
|
||||
<div class="settings-card__content">
|
||||
<div class="flex flex-col">
|
||||
{@render children()}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<style>
|
||||
.settings-card {
|
||||
/* Glass effect */
|
||||
background: rgba(255, 255, 255, 0.85);
|
||||
backdrop-filter: blur(12px);
|
||||
-webkit-backdrop-filter: blur(12px);
|
||||
border: 1px solid rgba(0, 0, 0, 0.1);
|
||||
border-radius: 1rem;
|
||||
overflow: hidden;
|
||||
box-shadow:
|
||||
0 4px 6px -1px rgba(0, 0, 0, 0.1),
|
||||
0 2px 4px -1px rgba(0, 0, 0, 0.06);
|
||||
}
|
||||
|
||||
:global(.dark) .settings-card {
|
||||
background: rgba(255, 255, 255, 0.08);
|
||||
border: 1px solid rgba(255, 255, 255, 0.12);
|
||||
}
|
||||
|
||||
.settings-card--danger {
|
||||
border-color: hsl(var(--destructive) / 0.3);
|
||||
background: rgba(239, 68, 68, 0.08);
|
||||
}
|
||||
|
||||
:global(.dark) .settings-card--danger {
|
||||
background: rgba(239, 68, 68, 0.12);
|
||||
border-color: rgba(239, 68, 68, 0.25);
|
||||
}
|
||||
|
||||
.settings-card__header {
|
||||
padding: 1rem 1.25rem;
|
||||
border-bottom: 1px solid rgba(0, 0, 0, 0.08);
|
||||
}
|
||||
|
||||
:global(.dark) .settings-card__header {
|
||||
border-bottom-color: rgba(255, 255, 255, 0.1);
|
||||
}
|
||||
|
||||
.settings-card--danger .settings-card__header {
|
||||
border-bottom-color: hsl(var(--destructive) / 0.2);
|
||||
background: rgba(239, 68, 68, 0.1);
|
||||
}
|
||||
|
||||
.settings-card__title {
|
||||
font-size: 1rem;
|
||||
font-weight: 600;
|
||||
color: hsl(var(--foreground));
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.settings-card--danger .settings-card__title {
|
||||
color: hsl(var(--destructive));
|
||||
}
|
||||
|
||||
.settings-card__description {
|
||||
font-size: 0.875rem;
|
||||
color: hsl(var(--muted-foreground));
|
||||
margin: 0.25rem 0 0 0;
|
||||
}
|
||||
|
||||
.settings-card__content {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
</style>
|
||||
|
|
|
|||
|
|
@ -30,148 +30,46 @@
|
|||
disabled = false,
|
||||
class: className = '',
|
||||
}: Props = $props();
|
||||
|
||||
// Tailwind classes
|
||||
const baseClasses = 'flex items-center justify-between gap-4 px-5 py-4';
|
||||
const borderClasses = 'border-b border-red-500/[0.12] dark:border-red-500/[0.18] last:border-b-0';
|
||||
const disabledClasses = 'opacity-50 cursor-not-allowed';
|
||||
|
||||
const iconClasses =
|
||||
'flex items-center justify-center flex-shrink-0 w-9 h-9 rounded-[0.625rem] bg-red-500/10 dark:bg-red-500/[0.15] text-red-500 dark:text-red-400 [&>svg]:w-[1.125rem] [&>svg]:h-[1.125rem]';
|
||||
</script>
|
||||
|
||||
<div
|
||||
class="settings-danger-button {border ? 'settings-danger-button--border' : ''} {disabled
|
||||
? 'settings-danger-button--disabled'
|
||||
: ''} {className}"
|
||||
class="{baseClasses} {border ? borderClasses : ''} {disabled ? disabledClasses : ''} {className}"
|
||||
>
|
||||
<div class="settings-danger-button__content">
|
||||
<div class="flex items-center gap-3 flex-1 min-w-0">
|
||||
{#if icon}
|
||||
<span class="settings-danger-button__icon">
|
||||
<span class={iconClasses}>
|
||||
{@render icon()}
|
||||
</span>
|
||||
{/if}
|
||||
<div class="settings-danger-button__text">
|
||||
<span class="settings-danger-button__label">{label}</span>
|
||||
<div class="flex flex-col gap-0.5 min-w-0">
|
||||
<span class="text-[0.9375rem] font-medium text-gray-700 dark:text-gray-100">{label}</span>
|
||||
{#if description}
|
||||
<span class="settings-danger-button__description">{description}</span>
|
||||
<span class="text-[0.8125rem] text-gray-500 dark:text-gray-400 leading-snug"
|
||||
>{description}</span
|
||||
>
|
||||
{/if}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<button type="button" {onclick} class="settings-danger-button__button" {disabled}>
|
||||
<button
|
||||
type="button"
|
||||
{onclick}
|
||||
class="px-4 py-2 text-sm font-medium text-red-500 dark:text-red-400
|
||||
bg-red-500/10 dark:bg-red-500/[0.15] border border-red-500/20 dark:border-red-500/25
|
||||
rounded-lg cursor-pointer flex-shrink-0 transition-all duration-200
|
||||
hover:bg-red-500/20 dark:hover:bg-red-500/25 hover:border-red-500/30 dark:hover:border-red-500/35
|
||||
focus-visible:outline-2 focus-visible:outline-red-500/40 focus-visible:outline-offset-2
|
||||
disabled:cursor-not-allowed"
|
||||
{disabled}
|
||||
>
|
||||
{buttonText || label}
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<style>
|
||||
.settings-danger-button {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
gap: 1rem;
|
||||
padding: 1rem 1.25rem;
|
||||
}
|
||||
|
||||
.settings-danger-button--border {
|
||||
border-bottom: 1px solid rgba(239, 68, 68, 0.12);
|
||||
}
|
||||
|
||||
:global(.dark) .settings-danger-button--border {
|
||||
border-bottom-color: rgba(239, 68, 68, 0.18);
|
||||
}
|
||||
|
||||
.settings-danger-button--border:last-child {
|
||||
border-bottom: none;
|
||||
}
|
||||
|
||||
.settings-danger-button--disabled {
|
||||
opacity: 0.5;
|
||||
cursor: not-allowed;
|
||||
}
|
||||
|
||||
.settings-danger-button__content {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 0.75rem;
|
||||
flex: 1;
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
.settings-danger-button__icon {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
flex-shrink: 0;
|
||||
width: 2.25rem;
|
||||
height: 2.25rem;
|
||||
border-radius: 0.625rem;
|
||||
background: rgba(239, 68, 68, 0.1);
|
||||
color: hsl(var(--destructive));
|
||||
}
|
||||
|
||||
:global(.dark) .settings-danger-button__icon {
|
||||
background: rgba(239, 68, 68, 0.15);
|
||||
}
|
||||
|
||||
.settings-danger-button__icon :global(svg) {
|
||||
width: 1.125rem;
|
||||
height: 1.125rem;
|
||||
}
|
||||
|
||||
.settings-danger-button__text {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 0.125rem;
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
.settings-danger-button__label {
|
||||
font-size: 0.9375rem;
|
||||
font-weight: 500;
|
||||
color: #374151;
|
||||
}
|
||||
|
||||
:global(.dark) .settings-danger-button__label {
|
||||
color: #f3f4f6;
|
||||
}
|
||||
|
||||
.settings-danger-button__description {
|
||||
font-size: 0.8125rem;
|
||||
color: #6b7280;
|
||||
line-height: 1.4;
|
||||
}
|
||||
|
||||
:global(.dark) .settings-danger-button__description {
|
||||
color: #9ca3af;
|
||||
}
|
||||
|
||||
.settings-danger-button__button {
|
||||
padding: 0.5rem 1rem;
|
||||
font-size: 0.875rem;
|
||||
font-weight: 500;
|
||||
color: hsl(var(--destructive));
|
||||
background: rgba(239, 68, 68, 0.1);
|
||||
border: 1px solid rgba(239, 68, 68, 0.2);
|
||||
border-radius: 0.5rem;
|
||||
cursor: pointer;
|
||||
flex-shrink: 0;
|
||||
transition: all 0.2s ease;
|
||||
}
|
||||
|
||||
:global(.dark) .settings-danger-button__button {
|
||||
background: rgba(239, 68, 68, 0.15);
|
||||
border-color: rgba(239, 68, 68, 0.25);
|
||||
}
|
||||
|
||||
.settings-danger-button__button:hover:not(:disabled) {
|
||||
background: rgba(239, 68, 68, 0.2);
|
||||
border-color: rgba(239, 68, 68, 0.3);
|
||||
}
|
||||
|
||||
:global(.dark) .settings-danger-button__button:hover:not(:disabled) {
|
||||
background: rgba(239, 68, 68, 0.25);
|
||||
border-color: rgba(239, 68, 68, 0.35);
|
||||
}
|
||||
|
||||
.settings-danger-button__button:disabled {
|
||||
cursor: not-allowed;
|
||||
}
|
||||
|
||||
.settings-danger-button__button:focus-visible {
|
||||
outline: 2px solid rgba(239, 68, 68, 0.4);
|
||||
outline-offset: 2px;
|
||||
}
|
||||
</style>
|
||||
|
|
|
|||
|
|
@ -13,55 +13,16 @@
|
|||
let { title = 'Danger Zone', class: className = '', children }: Props = $props();
|
||||
</script>
|
||||
|
||||
<section class="settings-danger-zone {className}">
|
||||
<header class="settings-danger-zone__header">
|
||||
<h2 class="settings-danger-zone__title">{title}</h2>
|
||||
<section
|
||||
class="bg-red-500/[0.08] dark:bg-red-500/[0.12] backdrop-blur-xl border border-red-500/20 dark:border-red-500/25 rounded-2xl overflow-hidden shadow-md {className}"
|
||||
>
|
||||
<header
|
||||
class="px-5 py-4 border-b border-red-500/[0.15] dark:border-red-500/20 bg-red-500/10 dark:bg-red-500/[0.15]"
|
||||
>
|
||||
<h2 class="text-base font-semibold text-red-500 dark:text-red-400 m-0">{title}</h2>
|
||||
</header>
|
||||
|
||||
<div class="settings-danger-zone__content">
|
||||
<div class="flex flex-col">
|
||||
{@render children()}
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<style>
|
||||
.settings-danger-zone {
|
||||
/* Glass effect with danger tint */
|
||||
background: rgba(239, 68, 68, 0.08);
|
||||
backdrop-filter: blur(12px);
|
||||
-webkit-backdrop-filter: blur(12px);
|
||||
border: 1px solid rgba(239, 68, 68, 0.2);
|
||||
border-radius: 1rem;
|
||||
overflow: hidden;
|
||||
box-shadow:
|
||||
0 4px 6px -1px rgba(239, 68, 68, 0.1),
|
||||
0 2px 4px -1px rgba(239, 68, 68, 0.06);
|
||||
}
|
||||
|
||||
:global(.dark) .settings-danger-zone {
|
||||
background: rgba(239, 68, 68, 0.12);
|
||||
border-color: rgba(239, 68, 68, 0.25);
|
||||
}
|
||||
|
||||
.settings-danger-zone__header {
|
||||
padding: 1rem 1.25rem;
|
||||
border-bottom: 1px solid rgba(239, 68, 68, 0.15);
|
||||
background: rgba(239, 68, 68, 0.1);
|
||||
}
|
||||
|
||||
:global(.dark) .settings-danger-zone__header {
|
||||
border-bottom-color: rgba(239, 68, 68, 0.2);
|
||||
background: rgba(239, 68, 68, 0.15);
|
||||
}
|
||||
|
||||
.settings-danger-zone__title {
|
||||
font-size: 1rem;
|
||||
font-weight: 600;
|
||||
color: hsl(var(--destructive));
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.settings-danger-zone__content {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
</style>
|
||||
|
|
|
|||
|
|
@ -61,30 +61,45 @@
|
|||
onchange(clampedValue);
|
||||
}
|
||||
}
|
||||
|
||||
// Tailwind classes
|
||||
const baseClasses = 'flex items-center justify-between gap-4 px-5 py-4';
|
||||
const borderClasses = 'border-b border-black/[0.08] dark:border-white/10 last:border-b-0';
|
||||
const disabledClasses = 'opacity-50 cursor-not-allowed';
|
||||
|
||||
const iconClasses =
|
||||
'flex items-center justify-center flex-shrink-0 w-9 h-9 rounded-[0.625rem] bg-black/[0.04] dark:bg-white/[0.08] text-primary [&>svg]:w-[1.125rem] [&>svg]:h-[1.125rem]';
|
||||
</script>
|
||||
|
||||
<div
|
||||
class="settings-number {border ? 'settings-number--border' : ''} {disabled
|
||||
? 'settings-number--disabled'
|
||||
: ''} {className}"
|
||||
class="{baseClasses} {border ? borderClasses : ''} {disabled ? disabledClasses : ''} {className}"
|
||||
>
|
||||
<div class="settings-number__content">
|
||||
<div class="flex items-center gap-3 flex-1 min-w-0">
|
||||
{#if icon}
|
||||
<span class="settings-number__icon">
|
||||
<span class={iconClasses}>
|
||||
{@render icon()}
|
||||
</span>
|
||||
{/if}
|
||||
<div class="settings-number__text">
|
||||
<span class="settings-number__label">{label}</span>
|
||||
<div class="flex flex-col gap-0.5 min-w-0">
|
||||
<span class="text-[0.9375rem] font-medium text-gray-700 dark:text-gray-100">{label}</span>
|
||||
{#if description}
|
||||
<span class="settings-number__description">{description}</span>
|
||||
<span class="text-[0.8125rem] text-gray-500 dark:text-gray-400 leading-snug"
|
||||
>{description}</span
|
||||
>
|
||||
{/if}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<input
|
||||
type="number"
|
||||
class="settings-number__input"
|
||||
class="w-20 px-3 py-2 text-sm font-medium text-gray-700 dark:text-gray-100 text-center
|
||||
bg-black/[0.04] dark:bg-white/[0.08] border border-black/10 dark:border-white/[0.15]
|
||||
rounded-lg transition-all duration-200
|
||||
hover:border-black/20 dark:hover:border-white/25 hover:bg-black/[0.06] dark:hover:bg-white/[0.12]
|
||||
focus-visible:outline-2 focus-visible:outline-primary/40 focus-visible:outline-offset-2 focus-visible:border-primary
|
||||
disabled:cursor-not-allowed disabled:opacity-60
|
||||
placeholder:text-gray-400 dark:placeholder:text-gray-500 placeholder:font-normal
|
||||
[appearance:textfield] [&::-webkit-outer-spin-button]:appearance-none [&::-webkit-inner-spin-button]:appearance-none"
|
||||
value={value ?? ''}
|
||||
oninput={handleInput}
|
||||
{min}
|
||||
|
|
@ -95,147 +110,3 @@
|
|||
aria-label={label}
|
||||
/>
|
||||
</div>
|
||||
|
||||
<style>
|
||||
.settings-number {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
gap: 1rem;
|
||||
padding: 1rem 1.25rem;
|
||||
}
|
||||
|
||||
.settings-number--border {
|
||||
border-bottom: 1px solid rgba(0, 0, 0, 0.08);
|
||||
}
|
||||
|
||||
:global(.dark) .settings-number--border {
|
||||
border-bottom-color: rgba(255, 255, 255, 0.1);
|
||||
}
|
||||
|
||||
.settings-number--border:last-child {
|
||||
border-bottom: none;
|
||||
}
|
||||
|
||||
.settings-number--disabled {
|
||||
opacity: 0.5;
|
||||
cursor: not-allowed;
|
||||
}
|
||||
|
||||
.settings-number__content {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 0.75rem;
|
||||
flex: 1;
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
.settings-number__icon {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
flex-shrink: 0;
|
||||
width: 2.25rem;
|
||||
height: 2.25rem;
|
||||
border-radius: 0.625rem;
|
||||
background: rgba(0, 0, 0, 0.04);
|
||||
color: hsl(var(--primary));
|
||||
}
|
||||
|
||||
:global(.dark) .settings-number__icon {
|
||||
background: rgba(255, 255, 255, 0.08);
|
||||
}
|
||||
|
||||
.settings-number__icon :global(svg) {
|
||||
width: 1.125rem;
|
||||
height: 1.125rem;
|
||||
}
|
||||
|
||||
.settings-number__text {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 0.125rem;
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
.settings-number__label {
|
||||
font-size: 0.9375rem;
|
||||
font-weight: 500;
|
||||
color: #374151;
|
||||
}
|
||||
|
||||
:global(.dark) .settings-number__label {
|
||||
color: #f3f4f6;
|
||||
}
|
||||
|
||||
.settings-number__description {
|
||||
font-size: 0.8125rem;
|
||||
color: #6b7280;
|
||||
line-height: 1.4;
|
||||
}
|
||||
|
||||
:global(.dark) .settings-number__description {
|
||||
color: #9ca3af;
|
||||
}
|
||||
|
||||
/* Number Input - Glass style */
|
||||
.settings-number__input {
|
||||
width: 5rem;
|
||||
padding: 0.5rem 0.75rem;
|
||||
font-size: 0.875rem;
|
||||
font-weight: 500;
|
||||
color: #374151;
|
||||
text-align: center;
|
||||
background-color: rgba(0, 0, 0, 0.04);
|
||||
border: 1px solid rgba(0, 0, 0, 0.1);
|
||||
border-radius: 0.5rem;
|
||||
transition: all 0.2s ease;
|
||||
}
|
||||
|
||||
:global(.dark) .settings-number__input {
|
||||
color: #f3f4f6;
|
||||
background-color: rgba(255, 255, 255, 0.08);
|
||||
border-color: rgba(255, 255, 255, 0.15);
|
||||
}
|
||||
|
||||
.settings-number__input:hover:not(:disabled) {
|
||||
border-color: rgba(0, 0, 0, 0.2);
|
||||
background-color: rgba(0, 0, 0, 0.06);
|
||||
}
|
||||
|
||||
:global(.dark) .settings-number__input:hover:not(:disabled) {
|
||||
border-color: rgba(255, 255, 255, 0.25);
|
||||
background-color: rgba(255, 255, 255, 0.12);
|
||||
}
|
||||
|
||||
.settings-number__input:focus-visible {
|
||||
outline: 2px solid hsl(var(--primary) / 0.4);
|
||||
outline-offset: 2px;
|
||||
border-color: hsl(var(--primary));
|
||||
}
|
||||
|
||||
.settings-number__input:disabled {
|
||||
cursor: not-allowed;
|
||||
opacity: 0.6;
|
||||
}
|
||||
|
||||
.settings-number__input::placeholder {
|
||||
color: #9ca3af;
|
||||
font-weight: 400;
|
||||
}
|
||||
|
||||
:global(.dark) .settings-number__input::placeholder {
|
||||
color: #6b7280;
|
||||
}
|
||||
|
||||
/* Hide spinner buttons */
|
||||
.settings-number__input::-webkit-outer-spin-button,
|
||||
.settings-number__input::-webkit-inner-spin-button {
|
||||
-webkit-appearance: none;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.settings-number__input[type='number'] {
|
||||
-moz-appearance: textfield;
|
||||
}
|
||||
</style>
|
||||
|
|
|
|||
|
|
@ -1,5 +1,12 @@
|
|||
<script lang="ts">
|
||||
import type { Snippet } from 'svelte';
|
||||
import { onMount } from 'svelte';
|
||||
|
||||
interface TocItem {
|
||||
id: string;
|
||||
title: string;
|
||||
icon?: string;
|
||||
}
|
||||
|
||||
interface Props {
|
||||
/** Page title */
|
||||
|
|
@ -22,65 +29,234 @@
|
|||
lg: 'max-w-3xl',
|
||||
xl: 'max-w-4xl',
|
||||
};
|
||||
|
||||
let tocItems = $state<TocItem[]>([]);
|
||||
let activeSection = $state<string>('');
|
||||
let contentEl: HTMLElement;
|
||||
|
||||
onMount(() => {
|
||||
// Collect all section headers
|
||||
const sections = contentEl.querySelectorAll('[data-settings-section]');
|
||||
const items: TocItem[] = [];
|
||||
|
||||
sections.forEach((section, index) => {
|
||||
const id = section.getAttribute('data-settings-section') || `section-${index}`;
|
||||
const titleEl = section.querySelector('.section-title');
|
||||
const title = titleEl?.textContent || `Section ${index + 1}`;
|
||||
items.push({ id, title });
|
||||
});
|
||||
|
||||
tocItems = items;
|
||||
|
||||
// Find the currently active section based on scroll position
|
||||
function updateActiveSection() {
|
||||
const scrollPosition = window.scrollY + window.innerHeight;
|
||||
const pageHeight = document.documentElement.scrollHeight;
|
||||
const bottomThreshold = 50;
|
||||
|
||||
// If at bottom of page, activate last section
|
||||
if (pageHeight - scrollPosition <= bottomThreshold && tocItems.length > 0) {
|
||||
activeSection = tocItems[tocItems.length - 1].id;
|
||||
return;
|
||||
}
|
||||
|
||||
// Find which section is currently in view
|
||||
const viewportTop = window.scrollY + 120; // Account for sticky header offset
|
||||
|
||||
let currentSection = '';
|
||||
sections.forEach((section) => {
|
||||
const rect = section.getBoundingClientRect();
|
||||
const sectionTop = rect.top + window.scrollY;
|
||||
|
||||
// Section is active if its top is above our viewport check point
|
||||
if (sectionTop <= viewportTop) {
|
||||
const id = section.getAttribute('data-settings-section');
|
||||
if (id) currentSection = id;
|
||||
}
|
||||
});
|
||||
|
||||
if (currentSection) {
|
||||
activeSection = currentSection;
|
||||
} else if (tocItems.length > 0) {
|
||||
// Default to first section if nothing else matches
|
||||
activeSection = tocItems[0].id;
|
||||
}
|
||||
}
|
||||
|
||||
// Initial check
|
||||
updateActiveSection();
|
||||
|
||||
// Update on scroll
|
||||
window.addEventListener('scroll', updateActiveSection, { passive: true });
|
||||
|
||||
return () => {
|
||||
window.removeEventListener('scroll', updateActiveSection);
|
||||
};
|
||||
});
|
||||
|
||||
function scrollToSection(id: string) {
|
||||
const section = contentEl.querySelector(`[data-settings-section="${id}"]`);
|
||||
if (section) {
|
||||
const y = section.getBoundingClientRect().top + window.scrollY - 100;
|
||||
window.scrollTo({ top: y, behavior: 'smooth' });
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<div class="settings-page {className}">
|
||||
<div class="settings-page__container {maxWidthClasses[maxWidth]}">
|
||||
<header class="settings-page__header">
|
||||
<h1 class="settings-page__title">{title}</h1>
|
||||
{#if subtitle}
|
||||
<p class="settings-page__subtitle">{subtitle}</p>
|
||||
{/if}
|
||||
</header>
|
||||
|
||||
<div class="settings-page__content">
|
||||
{@render children()}
|
||||
<div class="settings-page bg-background {className}">
|
||||
<!-- Table of Contents - Desktop only -->
|
||||
<aside class="toc-sidebar">
|
||||
<div class="toc-container">
|
||||
<p class="toc-title">Inhalt</p>
|
||||
<nav class="toc-nav">
|
||||
{#each tocItems as item}
|
||||
<button
|
||||
class="toc-item"
|
||||
class:active={activeSection === item.id}
|
||||
onclick={() => scrollToSection(item.id)}
|
||||
>
|
||||
{item.title}
|
||||
</button>
|
||||
{/each}
|
||||
</nav>
|
||||
</div>
|
||||
</div>
|
||||
</aside>
|
||||
|
||||
<!-- Main Content -->
|
||||
<main class="settings-main">
|
||||
<div class="settings-content {maxWidthClasses[maxWidth]}">
|
||||
<header class="settings-header">
|
||||
<h1 class="text-2xl sm:text-[1.75rem] font-bold text-foreground m-0">{title}</h1>
|
||||
{#if subtitle}
|
||||
<p class="text-sm text-muted-foreground mt-1">{subtitle}</p>
|
||||
{/if}
|
||||
</header>
|
||||
|
||||
<div class="sections-container" bind:this={contentEl}>
|
||||
{@render children()}
|
||||
</div>
|
||||
</div>
|
||||
</main>
|
||||
</div>
|
||||
|
||||
<style>
|
||||
.settings-page {
|
||||
min-height: calc(100vh - 4rem);
|
||||
padding: 2rem 1rem;
|
||||
background-color: hsl(var(--background));
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.settings-page__container {
|
||||
/* Table of Contents Sidebar - Fixed position on the left */
|
||||
.toc-sidebar {
|
||||
display: none;
|
||||
}
|
||||
|
||||
@media (min-width: 1400px) {
|
||||
.toc-sidebar {
|
||||
display: block;
|
||||
position: fixed;
|
||||
left: 2rem;
|
||||
top: 100px;
|
||||
width: 240px;
|
||||
max-height: calc(100vh - 140px);
|
||||
overflow-y: auto;
|
||||
z-index: 10;
|
||||
}
|
||||
}
|
||||
|
||||
.toc-container {
|
||||
background: rgba(255, 255, 255, 0.85);
|
||||
backdrop-filter: blur(12px);
|
||||
-webkit-backdrop-filter: blur(12px);
|
||||
border: 1px solid rgba(0, 0, 0, 0.1);
|
||||
border-radius: 1rem;
|
||||
padding: 1.25rem;
|
||||
box-shadow:
|
||||
0 4px 6px -1px rgba(0, 0, 0, 0.1),
|
||||
0 2px 4px -1px rgba(0, 0, 0, 0.06);
|
||||
}
|
||||
|
||||
:global(.dark) .toc-container {
|
||||
background: rgba(255, 255, 255, 0.08);
|
||||
border: 1px solid rgba(255, 255, 255, 0.1);
|
||||
}
|
||||
|
||||
.toc-title {
|
||||
font-size: 0.875rem;
|
||||
font-weight: 600;
|
||||
color: hsl(var(--foreground));
|
||||
margin: 0 0 1rem 0;
|
||||
padding-bottom: 0.75rem;
|
||||
border-bottom: 1px solid rgba(0, 0, 0, 0.08);
|
||||
}
|
||||
|
||||
:global(.dark) .toc-title {
|
||||
border-bottom-color: rgba(255, 255, 255, 0.1);
|
||||
}
|
||||
|
||||
.toc-nav {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 0.25rem;
|
||||
}
|
||||
|
||||
.toc-item {
|
||||
display: block;
|
||||
width: 100%;
|
||||
text-align: left;
|
||||
padding: 0.625rem 0.875rem;
|
||||
font-size: 0.875rem;
|
||||
color: hsl(var(--muted-foreground));
|
||||
background: transparent;
|
||||
border: none;
|
||||
border-radius: 0.5rem;
|
||||
cursor: pointer;
|
||||
transition: all 0.15s ease;
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
|
||||
.toc-item:hover {
|
||||
color: hsl(var(--foreground));
|
||||
background: hsl(var(--muted) / 0.5);
|
||||
}
|
||||
|
||||
.toc-item.active {
|
||||
color: hsl(var(--primary));
|
||||
background: hsl(var(--primary) / 0.12);
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
/* Main Content Area - Always centered */
|
||||
.settings-main {
|
||||
width: 100%;
|
||||
padding: 2rem 1rem;
|
||||
}
|
||||
|
||||
@media (min-width: 640px) {
|
||||
.settings-main {
|
||||
padding: 2rem 1.5rem;
|
||||
}
|
||||
}
|
||||
|
||||
@media (min-width: 1024px) {
|
||||
.settings-main {
|
||||
padding: 2rem;
|
||||
}
|
||||
}
|
||||
|
||||
.settings-content {
|
||||
margin-left: auto;
|
||||
margin-right: auto;
|
||||
}
|
||||
|
||||
.settings-page__header {
|
||||
.settings-header {
|
||||
margin-bottom: 2rem;
|
||||
}
|
||||
|
||||
.settings-page__title {
|
||||
font-size: 1.5rem;
|
||||
font-weight: 700;
|
||||
color: hsl(var(--foreground));
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.settings-page__subtitle {
|
||||
font-size: 0.875rem;
|
||||
color: hsl(var(--muted-foreground));
|
||||
margin: 0.25rem 0 0 0;
|
||||
}
|
||||
|
||||
.settings-page__content {
|
||||
.sections-container {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 1.5rem;
|
||||
}
|
||||
|
||||
@media (min-width: 640px) {
|
||||
.settings-page {
|
||||
padding: 2rem 1.5rem;
|
||||
}
|
||||
|
||||
.settings-page__title {
|
||||
font-size: 1.75rem;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
|
|
|||
|
|
@ -35,33 +35,56 @@
|
|||
}: Props = $props();
|
||||
|
||||
const isClickable = $derived(!!href || !!onclick);
|
||||
|
||||
// Tailwind classes
|
||||
const baseRowClasses =
|
||||
'flex items-center justify-between gap-4 px-5 py-4 bg-transparent w-full text-left no-underline transition-all duration-200';
|
||||
|
||||
const borderClasses = 'border-b border-black/[0.08] dark:border-white/10 last:border-b-0';
|
||||
|
||||
const clickableClasses = 'cursor-pointer hover:bg-black/[0.04] dark:hover:bg-white/[0.06]';
|
||||
|
||||
const disabledClasses = 'opacity-50 cursor-not-allowed pointer-events-none';
|
||||
|
||||
const iconClasses =
|
||||
'flex items-center justify-center flex-shrink-0 w-9 h-9 rounded-[0.625rem] bg-black/[0.04] dark:bg-white/[0.08] text-primary';
|
||||
|
||||
function getRowClasses(isBordered: boolean, isClick: boolean, isDisabled: boolean): string {
|
||||
let classes = baseRowClasses;
|
||||
if (isBordered) classes += ' ' + borderClasses;
|
||||
if (isClick) classes += ' ' + clickableClasses;
|
||||
if (isDisabled) classes += ' ' + disabledClasses;
|
||||
return classes;
|
||||
}
|
||||
</script>
|
||||
|
||||
{#if href}
|
||||
<a
|
||||
{href}
|
||||
class="settings-row {border ? 'settings-row--border' : ''} settings-row--clickable {disabled
|
||||
? 'settings-row--disabled'
|
||||
: ''} {className}"
|
||||
>
|
||||
<div class="settings-row__content">
|
||||
<a {href} class="{getRowClasses(border, true, disabled)} {className}">
|
||||
<div class="flex items-center gap-3 flex-1 min-w-0">
|
||||
{#if icon}
|
||||
<span class="settings-row__icon">
|
||||
<span class={iconClasses}>
|
||||
{@render icon()}
|
||||
</span>
|
||||
{/if}
|
||||
<div class="settings-row__text">
|
||||
<span class="settings-row__label">{label}</span>
|
||||
<div class="flex flex-col gap-0.5 min-w-0">
|
||||
<span class="text-[0.9375rem] font-medium text-gray-700 dark:text-gray-100">{label}</span>
|
||||
{#if description}
|
||||
<span class="settings-row__description">{description}</span>
|
||||
<span class="text-[0.8125rem] text-gray-500 dark:text-gray-400 leading-snug"
|
||||
>{description}</span
|
||||
>
|
||||
{/if}
|
||||
</div>
|
||||
</div>
|
||||
<div class="settings-row__control">
|
||||
<div class="flex items-center flex-shrink-0">
|
||||
{#if children}
|
||||
{@render children()}
|
||||
{:else}
|
||||
<svg class="settings-row__chevron" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
||||
<svg
|
||||
class="w-5 h-5 text-gray-400 dark:text-gray-500"
|
||||
fill="none"
|
||||
stroke="currentColor"
|
||||
viewBox="0 0 24 24"
|
||||
>
|
||||
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 5l7 7-7 7" />
|
||||
</svg>
|
||||
{/if}
|
||||
|
|
@ -71,55 +94,58 @@
|
|||
<button
|
||||
type="button"
|
||||
{onclick}
|
||||
class="settings-row {border ? 'settings-row--border' : ''} settings-row--clickable {disabled
|
||||
? 'settings-row--disabled'
|
||||
: ''} {className}"
|
||||
class="{getRowClasses(border, true, disabled)} {className}"
|
||||
{disabled}
|
||||
>
|
||||
<div class="settings-row__content">
|
||||
<div class="flex items-center gap-3 flex-1 min-w-0">
|
||||
{#if icon}
|
||||
<span class="settings-row__icon">
|
||||
<span class={iconClasses}>
|
||||
{@render icon()}
|
||||
</span>
|
||||
{/if}
|
||||
<div class="settings-row__text">
|
||||
<span class="settings-row__label">{label}</span>
|
||||
<div class="flex flex-col gap-0.5 min-w-0">
|
||||
<span class="text-[0.9375rem] font-medium text-gray-700 dark:text-gray-100">{label}</span>
|
||||
{#if description}
|
||||
<span class="settings-row__description">{description}</span>
|
||||
<span class="text-[0.8125rem] text-gray-500 dark:text-gray-400 leading-snug"
|
||||
>{description}</span
|
||||
>
|
||||
{/if}
|
||||
</div>
|
||||
</div>
|
||||
<div class="settings-row__control">
|
||||
<div class="flex items-center flex-shrink-0">
|
||||
{#if children}
|
||||
{@render children()}
|
||||
{:else}
|
||||
<svg class="settings-row__chevron" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
||||
<svg
|
||||
class="w-5 h-5 text-gray-400 dark:text-gray-500"
|
||||
fill="none"
|
||||
stroke="currentColor"
|
||||
viewBox="0 0 24 24"
|
||||
>
|
||||
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 5l7 7-7 7" />
|
||||
</svg>
|
||||
{/if}
|
||||
</div>
|
||||
</button>
|
||||
{:else}
|
||||
<div
|
||||
class="settings-row {border ? 'settings-row--border' : ''} {disabled
|
||||
? 'settings-row--disabled'
|
||||
: ''} {className}"
|
||||
>
|
||||
<div class="settings-row__content">
|
||||
<div class="{getRowClasses(border, false, disabled)} {className}">
|
||||
<div class="flex items-center gap-3 flex-1 min-w-0">
|
||||
{#if icon}
|
||||
<span class="settings-row__icon">
|
||||
<span class={iconClasses}>
|
||||
{@render icon()}
|
||||
</span>
|
||||
{/if}
|
||||
<div class="settings-row__text">
|
||||
<span class="settings-row__label">{label}</span>
|
||||
<div class="flex flex-col gap-0.5 min-w-0">
|
||||
<span class="text-[0.9375rem] font-medium text-gray-700 dark:text-gray-100">{label}</span>
|
||||
{#if description}
|
||||
<span class="settings-row__description">{description}</span>
|
||||
<span class="text-[0.8125rem] text-gray-500 dark:text-gray-400 leading-snug"
|
||||
>{description}</span
|
||||
>
|
||||
{/if}
|
||||
</div>
|
||||
</div>
|
||||
{#if children}
|
||||
<div class="settings-row__control">
|
||||
<div class="flex items-center flex-shrink-0">
|
||||
{@render children()}
|
||||
</div>
|
||||
{/if}
|
||||
|
|
@ -127,120 +153,9 @@
|
|||
{/if}
|
||||
|
||||
<style>
|
||||
.settings-row {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
gap: 1rem;
|
||||
padding: 1rem 1.25rem;
|
||||
background: transparent;
|
||||
border: none;
|
||||
width: 100%;
|
||||
text-align: left;
|
||||
text-decoration: none;
|
||||
color: inherit;
|
||||
transition: all 0.2s ease;
|
||||
}
|
||||
|
||||
.settings-row--border {
|
||||
border-bottom: 1px solid rgba(0, 0, 0, 0.08);
|
||||
}
|
||||
|
||||
:global(.dark) .settings-row--border {
|
||||
border-bottom-color: rgba(255, 255, 255, 0.1);
|
||||
}
|
||||
|
||||
.settings-row--border:last-child {
|
||||
border-bottom: none;
|
||||
}
|
||||
|
||||
.settings-row--clickable {
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.settings-row--clickable:hover {
|
||||
background: rgba(0, 0, 0, 0.04);
|
||||
}
|
||||
|
||||
:global(.dark) .settings-row--clickable:hover {
|
||||
background: rgba(255, 255, 255, 0.06);
|
||||
}
|
||||
|
||||
.settings-row--disabled {
|
||||
opacity: 0.5;
|
||||
cursor: not-allowed;
|
||||
pointer-events: none;
|
||||
}
|
||||
|
||||
.settings-row__content {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 0.75rem;
|
||||
flex: 1;
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
.settings-row__icon {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
flex-shrink: 0;
|
||||
width: 2.25rem;
|
||||
height: 2.25rem;
|
||||
border-radius: 0.625rem;
|
||||
background: rgba(0, 0, 0, 0.04);
|
||||
color: hsl(var(--primary));
|
||||
}
|
||||
|
||||
:global(.dark) .settings-row__icon {
|
||||
background: rgba(255, 255, 255, 0.08);
|
||||
}
|
||||
|
||||
.settings-row__icon :global(svg) {
|
||||
/* Keep SVG sizing for icons passed via snippet */
|
||||
:global(svg) {
|
||||
width: 1.125rem;
|
||||
height: 1.125rem;
|
||||
}
|
||||
|
||||
.settings-row__text {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 0.125rem;
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
.settings-row__label {
|
||||
font-size: 0.9375rem;
|
||||
font-weight: 500;
|
||||
color: #374151;
|
||||
}
|
||||
|
||||
:global(.dark) .settings-row__label {
|
||||
color: #f3f4f6;
|
||||
}
|
||||
|
||||
.settings-row__description {
|
||||
font-size: 0.8125rem;
|
||||
color: #6b7280;
|
||||
line-height: 1.4;
|
||||
}
|
||||
|
||||
:global(.dark) .settings-row__description {
|
||||
color: #9ca3af;
|
||||
}
|
||||
|
||||
.settings-row__control {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
.settings-row__chevron {
|
||||
width: 1.25rem;
|
||||
height: 1.25rem;
|
||||
color: #9ca3af;
|
||||
}
|
||||
|
||||
:global(.dark) .settings-row__chevron {
|
||||
color: #6b7280;
|
||||
}
|
||||
</style>
|
||||
|
|
|
|||
|
|
@ -13,21 +13,32 @@
|
|||
}
|
||||
|
||||
let { title, icon, class: className = '', children }: Props = $props();
|
||||
|
||||
// Generate a slug from title for TOC navigation
|
||||
const sectionId =
|
||||
title
|
||||
?.toLowerCase()
|
||||
.replace(/[^a-z0-9]+/g, '-')
|
||||
.replace(/(^-|-$)/g, '') || '';
|
||||
</script>
|
||||
|
||||
<section class="settings-section {className}">
|
||||
<section class="settings-section {className}" data-settings-section={sectionId}>
|
||||
{#if title}
|
||||
<header class="settings-section__header">
|
||||
{#if icon}
|
||||
<span class="settings-section__icon">
|
||||
{@render icon()}
|
||||
</span>
|
||||
{/if}
|
||||
<h2 class="settings-section__title">{title}</h2>
|
||||
<header class="section-header-wrapper">
|
||||
<div class="section-header-pill">
|
||||
{#if icon}
|
||||
<span class="section-icon">
|
||||
{@render icon()}
|
||||
</span>
|
||||
{/if}
|
||||
<h2 class="section-title">
|
||||
{title}
|
||||
</h2>
|
||||
</div>
|
||||
</header>
|
||||
{/if}
|
||||
|
||||
<div class="settings-section__content">
|
||||
<div class="section-content">
|
||||
{@render children()}
|
||||
</div>
|
||||
</section>
|
||||
|
|
@ -39,48 +50,69 @@
|
|||
gap: 0.75rem;
|
||||
}
|
||||
|
||||
.settings-section__header {
|
||||
display: flex;
|
||||
.section-header-wrapper {
|
||||
position: sticky;
|
||||
top: 70px;
|
||||
z-index: 20;
|
||||
padding: 0.5rem 0;
|
||||
}
|
||||
|
||||
.section-header-pill {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
gap: 0.5rem;
|
||||
padding-left: 0.25rem;
|
||||
}
|
||||
|
||||
.settings-section__icon {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
width: 1.75rem;
|
||||
height: 1.75rem;
|
||||
border-radius: 0.5rem;
|
||||
background: rgba(0, 0, 0, 0.04);
|
||||
color: hsl(var(--primary));
|
||||
}
|
||||
|
||||
:global(.dark) .settings-section__icon {
|
||||
background: rgba(255, 255, 255, 0.08);
|
||||
}
|
||||
|
||||
.settings-section__icon :global(svg) {
|
||||
width: 1rem;
|
||||
height: 1rem;
|
||||
}
|
||||
|
||||
.settings-section__title {
|
||||
padding: 0.5rem 1rem;
|
||||
border-radius: 9999px;
|
||||
font-size: 0.9375rem;
|
||||
font-weight: 600;
|
||||
white-space: nowrap;
|
||||
background: rgba(255, 255, 255, 0.85);
|
||||
backdrop-filter: blur(12px);
|
||||
-webkit-backdrop-filter: blur(12px);
|
||||
border: 1px solid rgba(0, 0, 0, 0.1);
|
||||
box-shadow:
|
||||
0 4px 6px -1px rgba(0, 0, 0, 0.1),
|
||||
0 2px 4px -1px rgba(0, 0, 0, 0.06);
|
||||
color: #374151;
|
||||
margin: 0;
|
||||
letter-spacing: -0.01em;
|
||||
}
|
||||
|
||||
:global(.dark) .settings-section__title {
|
||||
:global(.dark) .section-header-pill {
|
||||
background: rgba(255, 255, 255, 0.12);
|
||||
border: 1px solid rgba(255, 255, 255, 0.15);
|
||||
color: #f3f4f6;
|
||||
}
|
||||
|
||||
.settings-section__content {
|
||||
.section-icon {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
width: 1.5rem;
|
||||
height: 1.5rem;
|
||||
color: hsl(var(--primary));
|
||||
}
|
||||
|
||||
.section-icon :global(svg) {
|
||||
width: 1.125rem;
|
||||
height: 1.125rem;
|
||||
}
|
||||
|
||||
.section-title {
|
||||
margin: 0;
|
||||
font-size: inherit;
|
||||
font-weight: inherit;
|
||||
color: inherit;
|
||||
letter-spacing: -0.01em;
|
||||
}
|
||||
|
||||
.section-content {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 0.5rem;
|
||||
}
|
||||
|
||||
@media (max-width: 768px) {
|
||||
.section-header-wrapper {
|
||||
top: 80px;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
|
|
|||
|
|
@ -57,176 +57,55 @@
|
|||
onchange(rawValue);
|
||||
}
|
||||
}
|
||||
|
||||
// Tailwind classes
|
||||
const baseClasses = 'flex items-center justify-between gap-4 px-5 py-4';
|
||||
const borderClasses = 'border-b border-black/[0.08] dark:border-white/10 last:border-b-0';
|
||||
const disabledClasses = 'opacity-50 cursor-not-allowed';
|
||||
|
||||
const iconClasses =
|
||||
'flex items-center justify-center flex-shrink-0 w-9 h-9 rounded-[0.625rem] bg-black/[0.04] dark:bg-white/[0.08] text-primary [&>svg]:w-[1.125rem] [&>svg]:h-[1.125rem]';
|
||||
</script>
|
||||
|
||||
<div
|
||||
class="settings-select {border ? 'settings-select--border' : ''} {disabled
|
||||
? 'settings-select--disabled'
|
||||
: ''} {className}"
|
||||
class="{baseClasses} {border ? borderClasses : ''} {disabled ? disabledClasses : ''} {className}"
|
||||
>
|
||||
<div class="settings-select__content">
|
||||
<div class="flex items-center gap-3 flex-1 min-w-0">
|
||||
{#if icon}
|
||||
<span class="settings-select__icon">
|
||||
<span class={iconClasses}>
|
||||
{@render icon()}
|
||||
</span>
|
||||
{/if}
|
||||
<div class="settings-select__text">
|
||||
<span class="settings-select__label">{label}</span>
|
||||
<div class="flex flex-col gap-0.5 min-w-0">
|
||||
<span class="text-[0.9375rem] font-medium text-gray-700 dark:text-gray-100">{label}</span>
|
||||
{#if description}
|
||||
<span class="settings-select__description">{description}</span>
|
||||
<span class="text-[0.8125rem] text-gray-500 dark:text-gray-400 leading-snug"
|
||||
>{description}</span
|
||||
>
|
||||
{/if}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<select
|
||||
class="settings-select__dropdown"
|
||||
class="min-w-32 px-3 pr-8 py-2 text-sm font-medium text-gray-700 dark:text-gray-100
|
||||
bg-black/[0.04] dark:bg-white/[0.08] border border-black/10 dark:border-white/[0.15]
|
||||
rounded-lg cursor-pointer appearance-none transition-all duration-200
|
||||
hover:border-black/20 dark:hover:border-white/25 hover:bg-black/[0.06] dark:hover:bg-white/[0.12]
|
||||
focus-visible:outline-2 focus-visible:outline-primary/40 focus-visible:outline-offset-2 focus-visible:border-primary
|
||||
disabled:cursor-not-allowed disabled:opacity-60
|
||||
bg-[url('data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2216%22%20height%3D%2216%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22%236b7280%22%20stroke-width%3D%222%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpath%20d%3D%22m6%209%206%206%206-6%22%2F%3E%3C%2Fsvg%3E')]
|
||||
dark:bg-[url('data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2216%22%20height%3D%2216%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22%239ca3af%22%20stroke-width%3D%222%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpath%20d%3D%22m6%209%206%206%206-6%22%2F%3E%3C%2Fsvg%3E')]
|
||||
bg-no-repeat bg-[right_0.5rem_center] bg-[length:1rem]"
|
||||
value={value ?? ''}
|
||||
onchange={handleChange}
|
||||
{disabled}
|
||||
aria-label={label}
|
||||
>
|
||||
{#each options as option}
|
||||
<option value={option.value ?? ''}>{option.label}</option>
|
||||
<option
|
||||
value={option.value ?? ''}
|
||||
class="bg-white dark:bg-gray-800 text-gray-700 dark:text-gray-100">{option.label}</option
|
||||
>
|
||||
{/each}
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<style>
|
||||
.settings-select {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
gap: 1rem;
|
||||
padding: 1rem 1.25rem;
|
||||
}
|
||||
|
||||
.settings-select--border {
|
||||
border-bottom: 1px solid rgba(0, 0, 0, 0.08);
|
||||
}
|
||||
|
||||
:global(.dark) .settings-select--border {
|
||||
border-bottom-color: rgba(255, 255, 255, 0.1);
|
||||
}
|
||||
|
||||
.settings-select--border:last-child {
|
||||
border-bottom: none;
|
||||
}
|
||||
|
||||
.settings-select--disabled {
|
||||
opacity: 0.5;
|
||||
cursor: not-allowed;
|
||||
}
|
||||
|
||||
.settings-select__content {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 0.75rem;
|
||||
flex: 1;
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
.settings-select__icon {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
flex-shrink: 0;
|
||||
width: 2.25rem;
|
||||
height: 2.25rem;
|
||||
border-radius: 0.625rem;
|
||||
background: rgba(0, 0, 0, 0.04);
|
||||
color: hsl(var(--primary));
|
||||
}
|
||||
|
||||
:global(.dark) .settings-select__icon {
|
||||
background: rgba(255, 255, 255, 0.08);
|
||||
}
|
||||
|
||||
.settings-select__icon :global(svg) {
|
||||
width: 1.125rem;
|
||||
height: 1.125rem;
|
||||
}
|
||||
|
||||
.settings-select__text {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 0.125rem;
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
.settings-select__label {
|
||||
font-size: 0.9375rem;
|
||||
font-weight: 500;
|
||||
color: #374151;
|
||||
}
|
||||
|
||||
:global(.dark) .settings-select__label {
|
||||
color: #f3f4f6;
|
||||
}
|
||||
|
||||
.settings-select__description {
|
||||
font-size: 0.8125rem;
|
||||
color: #6b7280;
|
||||
line-height: 1.4;
|
||||
}
|
||||
|
||||
:global(.dark) .settings-select__description {
|
||||
color: #9ca3af;
|
||||
}
|
||||
|
||||
/* Select Dropdown - Glass style */
|
||||
.settings-select__dropdown {
|
||||
min-width: 8rem;
|
||||
padding: 0.5rem 2rem 0.5rem 0.75rem;
|
||||
font-size: 0.875rem;
|
||||
font-weight: 500;
|
||||
color: #374151;
|
||||
background-color: rgba(0, 0, 0, 0.04);
|
||||
border: 1px solid rgba(0, 0, 0, 0.1);
|
||||
border-radius: 0.5rem;
|
||||
cursor: pointer;
|
||||
appearance: none;
|
||||
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
|
||||
background-repeat: no-repeat;
|
||||
background-position: right 0.5rem center;
|
||||
background-size: 1rem;
|
||||
transition: all 0.2s ease;
|
||||
}
|
||||
|
||||
:global(.dark) .settings-select__dropdown {
|
||||
color: #f3f4f6;
|
||||
background-color: rgba(255, 255, 255, 0.08);
|
||||
border-color: rgba(255, 255, 255, 0.15);
|
||||
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%239ca3af' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
|
||||
}
|
||||
|
||||
.settings-select__dropdown:hover:not(:disabled) {
|
||||
border-color: rgba(0, 0, 0, 0.2);
|
||||
background-color: rgba(0, 0, 0, 0.06);
|
||||
}
|
||||
|
||||
:global(.dark) .settings-select__dropdown:hover:not(:disabled) {
|
||||
border-color: rgba(255, 255, 255, 0.25);
|
||||
background-color: rgba(255, 255, 255, 0.12);
|
||||
}
|
||||
|
||||
.settings-select__dropdown:focus-visible {
|
||||
outline: 2px solid hsl(var(--primary) / 0.4);
|
||||
outline-offset: 2px;
|
||||
border-color: hsl(var(--primary));
|
||||
}
|
||||
|
||||
.settings-select__dropdown:disabled {
|
||||
cursor: not-allowed;
|
||||
opacity: 0.6;
|
||||
}
|
||||
|
||||
.settings-select__dropdown option {
|
||||
background-color: white;
|
||||
color: #374151;
|
||||
}
|
||||
|
||||
:global(.dark) .settings-select__dropdown option {
|
||||
background-color: #1f2937;
|
||||
color: #f3f4f6;
|
||||
}
|
||||
</style>
|
||||
|
|
|
|||
|
|
@ -52,31 +52,46 @@
|
|||
function handleClear() {
|
||||
onchange(null);
|
||||
}
|
||||
|
||||
// Tailwind classes
|
||||
const baseClasses = 'flex items-center justify-between gap-4 px-5 py-4';
|
||||
const borderClasses = 'border-b border-black/[0.08] dark:border-white/10 last:border-b-0';
|
||||
const disabledClasses = 'opacity-50 cursor-not-allowed';
|
||||
|
||||
const iconClasses =
|
||||
'flex items-center justify-center flex-shrink-0 w-9 h-9 rounded-[0.625rem] bg-black/[0.04] dark:bg-white/[0.08] text-primary [&>svg]:w-[1.125rem] [&>svg]:h-[1.125rem]';
|
||||
</script>
|
||||
|
||||
<div
|
||||
class="settings-time {border ? 'settings-time--border' : ''} {disabled
|
||||
? 'settings-time--disabled'
|
||||
: ''} {className}"
|
||||
class="{baseClasses} {border ? borderClasses : ''} {disabled ? disabledClasses : ''} {className}"
|
||||
>
|
||||
<div class="settings-time__content">
|
||||
<div class="flex items-center gap-3 flex-1 min-w-0">
|
||||
{#if icon}
|
||||
<span class="settings-time__icon">
|
||||
<span class={iconClasses}>
|
||||
{@render icon()}
|
||||
</span>
|
||||
{/if}
|
||||
<div class="settings-time__text">
|
||||
<span class="settings-time__label">{label}</span>
|
||||
<div class="flex flex-col gap-0.5 min-w-0">
|
||||
<span class="text-[0.9375rem] font-medium text-gray-700 dark:text-gray-100">{label}</span>
|
||||
{#if description}
|
||||
<span class="settings-time__description">{description}</span>
|
||||
<span class="text-[0.8125rem] text-gray-500 dark:text-gray-400 leading-snug"
|
||||
>{description}</span
|
||||
>
|
||||
{/if}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="settings-time__input-wrapper">
|
||||
<div class="flex items-center gap-1">
|
||||
<input
|
||||
type="time"
|
||||
class="settings-time__input"
|
||||
class="w-24 px-3 py-2 text-sm font-medium text-gray-700 dark:text-gray-100 text-center
|
||||
bg-black/[0.04] dark:bg-white/[0.08] border border-black/10 dark:border-white/[0.15]
|
||||
rounded-lg transition-all duration-200
|
||||
hover:border-black/20 dark:hover:border-white/25 hover:bg-black/[0.06] dark:hover:bg-white/[0.12]
|
||||
focus-visible:outline-2 focus-visible:outline-primary/40 focus-visible:outline-offset-2 focus-visible:border-primary
|
||||
disabled:cursor-not-allowed disabled:opacity-60
|
||||
[&::-webkit-calendar-picker-indicator]:opacity-50 [&::-webkit-calendar-picker-indicator]:cursor-pointer
|
||||
dark:[&::-webkit-calendar-picker-indicator]:invert dark:[&::-webkit-calendar-picker-indicator]:opacity-70"
|
||||
value={value ?? ''}
|
||||
oninput={handleInput}
|
||||
{placeholder}
|
||||
|
|
@ -86,7 +101,9 @@
|
|||
{#if value}
|
||||
<button
|
||||
type="button"
|
||||
class="settings-time__clear"
|
||||
class="flex items-center justify-center w-7 h-7 p-0 text-gray-500 dark:text-gray-400 bg-transparent border-none rounded-md cursor-pointer transition-all duration-200
|
||||
hover:text-red-500 hover:bg-red-500/10 dark:hover:bg-red-500/20
|
||||
disabled:cursor-not-allowed disabled:opacity-50"
|
||||
onclick={handleClear}
|
||||
aria-label="Clear time"
|
||||
{disabled}
|
||||
|
|
@ -109,179 +126,3 @@
|
|||
{/if}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<style>
|
||||
.settings-time {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
gap: 1rem;
|
||||
padding: 1rem 1.25rem;
|
||||
}
|
||||
|
||||
.settings-time--border {
|
||||
border-bottom: 1px solid rgba(0, 0, 0, 0.08);
|
||||
}
|
||||
|
||||
:global(.dark) .settings-time--border {
|
||||
border-bottom-color: rgba(255, 255, 255, 0.1);
|
||||
}
|
||||
|
||||
.settings-time--border:last-child {
|
||||
border-bottom: none;
|
||||
}
|
||||
|
||||
.settings-time--disabled {
|
||||
opacity: 0.5;
|
||||
cursor: not-allowed;
|
||||
}
|
||||
|
||||
.settings-time__content {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 0.75rem;
|
||||
flex: 1;
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
.settings-time__icon {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
flex-shrink: 0;
|
||||
width: 2.25rem;
|
||||
height: 2.25rem;
|
||||
border-radius: 0.625rem;
|
||||
background: rgba(0, 0, 0, 0.04);
|
||||
color: hsl(var(--primary));
|
||||
}
|
||||
|
||||
:global(.dark) .settings-time__icon {
|
||||
background: rgba(255, 255, 255, 0.08);
|
||||
}
|
||||
|
||||
.settings-time__icon :global(svg) {
|
||||
width: 1.125rem;
|
||||
height: 1.125rem;
|
||||
}
|
||||
|
||||
.settings-time__text {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 0.125rem;
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
.settings-time__label {
|
||||
font-size: 0.9375rem;
|
||||
font-weight: 500;
|
||||
color: #374151;
|
||||
}
|
||||
|
||||
:global(.dark) .settings-time__label {
|
||||
color: #f3f4f6;
|
||||
}
|
||||
|
||||
.settings-time__description {
|
||||
font-size: 0.8125rem;
|
||||
color: #6b7280;
|
||||
line-height: 1.4;
|
||||
}
|
||||
|
||||
:global(.dark) .settings-time__description {
|
||||
color: #9ca3af;
|
||||
}
|
||||
|
||||
/* Input wrapper */
|
||||
.settings-time__input-wrapper {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 0.25rem;
|
||||
}
|
||||
|
||||
/* Time Input - Glass style */
|
||||
.settings-time__input {
|
||||
width: 6rem;
|
||||
padding: 0.5rem 0.75rem;
|
||||
font-size: 0.875rem;
|
||||
font-weight: 500;
|
||||
color: #374151;
|
||||
text-align: center;
|
||||
background-color: rgba(0, 0, 0, 0.04);
|
||||
border: 1px solid rgba(0, 0, 0, 0.1);
|
||||
border-radius: 0.5rem;
|
||||
transition: all 0.2s ease;
|
||||
}
|
||||
|
||||
:global(.dark) .settings-time__input {
|
||||
color: #f3f4f6;
|
||||
background-color: rgba(255, 255, 255, 0.08);
|
||||
border-color: rgba(255, 255, 255, 0.15);
|
||||
}
|
||||
|
||||
.settings-time__input:hover:not(:disabled) {
|
||||
border-color: rgba(0, 0, 0, 0.2);
|
||||
background-color: rgba(0, 0, 0, 0.06);
|
||||
}
|
||||
|
||||
:global(.dark) .settings-time__input:hover:not(:disabled) {
|
||||
border-color: rgba(255, 255, 255, 0.25);
|
||||
background-color: rgba(255, 255, 255, 0.12);
|
||||
}
|
||||
|
||||
.settings-time__input:focus-visible {
|
||||
outline: 2px solid hsl(var(--primary) / 0.4);
|
||||
outline-offset: 2px;
|
||||
border-color: hsl(var(--primary));
|
||||
}
|
||||
|
||||
.settings-time__input:disabled {
|
||||
cursor: not-allowed;
|
||||
opacity: 0.6;
|
||||
}
|
||||
|
||||
/* Clear button */
|
||||
.settings-time__clear {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
width: 1.75rem;
|
||||
height: 1.75rem;
|
||||
padding: 0;
|
||||
color: #6b7280;
|
||||
background: transparent;
|
||||
border: none;
|
||||
border-radius: 0.375rem;
|
||||
cursor: pointer;
|
||||
transition: all 0.2s ease;
|
||||
}
|
||||
|
||||
.settings-time__clear:hover:not(:disabled) {
|
||||
color: #ef4444;
|
||||
background-color: rgba(239, 68, 68, 0.1);
|
||||
}
|
||||
|
||||
:global(.dark) .settings-time__clear {
|
||||
color: #9ca3af;
|
||||
}
|
||||
|
||||
:global(.dark) .settings-time__clear:hover:not(:disabled) {
|
||||
color: #ef4444;
|
||||
background-color: rgba(239, 68, 68, 0.2);
|
||||
}
|
||||
|
||||
.settings-time__clear:disabled {
|
||||
cursor: not-allowed;
|
||||
opacity: 0.5;
|
||||
}
|
||||
|
||||
/* Style the time input appearance */
|
||||
.settings-time__input::-webkit-calendar-picker-indicator {
|
||||
filter: invert(0.5);
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
:global(.dark) .settings-time__input::-webkit-calendar-picker-indicator {
|
||||
filter: invert(0.7);
|
||||
}
|
||||
</style>
|
||||
|
|
|
|||
|
|
@ -36,23 +36,31 @@
|
|||
onToggle(!isOn);
|
||||
}
|
||||
}
|
||||
|
||||
// Tailwind classes
|
||||
const baseClasses = 'flex items-center justify-between gap-4 px-5 py-4';
|
||||
const borderClasses = 'border-b border-black/[0.08] dark:border-white/10 last:border-b-0';
|
||||
const disabledClasses = 'opacity-50 cursor-not-allowed';
|
||||
|
||||
const iconClasses =
|
||||
'flex items-center justify-center flex-shrink-0 w-9 h-9 rounded-[0.625rem] bg-black/[0.04] dark:bg-white/[0.08] text-primary [&>svg]:w-[1.125rem] [&>svg]:h-[1.125rem]';
|
||||
</script>
|
||||
|
||||
<div
|
||||
class="settings-toggle {border ? 'settings-toggle--border' : ''} {disabled
|
||||
? 'settings-toggle--disabled'
|
||||
: ''} {className}"
|
||||
class="{baseClasses} {border ? borderClasses : ''} {disabled ? disabledClasses : ''} {className}"
|
||||
>
|
||||
<div class="settings-toggle__content">
|
||||
<div class="flex items-center gap-3 flex-1 min-w-0">
|
||||
{#if icon}
|
||||
<span class="settings-toggle__icon">
|
||||
<span class={iconClasses}>
|
||||
{@render icon()}
|
||||
</span>
|
||||
{/if}
|
||||
<div class="settings-toggle__text">
|
||||
<span class="settings-toggle__label">{label}</span>
|
||||
<div class="flex flex-col gap-0.5 min-w-0">
|
||||
<span class="text-[0.9375rem] font-medium text-gray-700 dark:text-gray-100">{label}</span>
|
||||
{#if description}
|
||||
<span class="settings-toggle__description">{description}</span>
|
||||
<span class="text-[0.8125rem] text-gray-500 dark:text-gray-400 leading-snug"
|
||||
>{description}</span
|
||||
>
|
||||
{/if}
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -60,165 +68,22 @@
|
|||
<button
|
||||
type="button"
|
||||
onclick={handleToggle}
|
||||
class="settings-toggle__switch {isOn ? 'settings-toggle__switch--on' : ''}"
|
||||
class="relative w-12 h-7 rounded-full border flex-shrink-0 transition-all duration-200
|
||||
{isOn
|
||||
? 'bg-primary border-primary shadow-[0_0_0_2px_hsl(var(--primary)/0.2)] dark:shadow-[0_0_0_2px_hsl(var(--primary)/0.3)]'
|
||||
: 'bg-black/[0.08] border-black/10 dark:bg-white/[0.12] dark:border-white/[0.15]'}
|
||||
{!disabled
|
||||
? 'cursor-pointer hover:border-black/20 dark:hover:border-white/25'
|
||||
: 'cursor-not-allowed'}
|
||||
focus-visible:outline-2 focus-visible:outline-primary/40 focus-visible:outline-offset-2"
|
||||
role="switch"
|
||||
aria-checked={isOn}
|
||||
aria-label={label}
|
||||
{disabled}
|
||||
>
|
||||
<span class="settings-toggle__thumb"></span>
|
||||
<span
|
||||
class="absolute top-[1px] left-[1px] w-6 h-6 rounded-full bg-white shadow-md transition-transform duration-200
|
||||
{isOn ? 'translate-x-5' : ''}"
|
||||
></span>
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<style>
|
||||
.settings-toggle {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
gap: 1rem;
|
||||
padding: 1rem 1.25rem;
|
||||
}
|
||||
|
||||
.settings-toggle--border {
|
||||
border-bottom: 1px solid rgba(0, 0, 0, 0.08);
|
||||
}
|
||||
|
||||
:global(.dark) .settings-toggle--border {
|
||||
border-bottom-color: rgba(255, 255, 255, 0.1);
|
||||
}
|
||||
|
||||
.settings-toggle--border:last-child {
|
||||
border-bottom: none;
|
||||
}
|
||||
|
||||
.settings-toggle--disabled {
|
||||
opacity: 0.5;
|
||||
cursor: not-allowed;
|
||||
}
|
||||
|
||||
.settings-toggle__content {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 0.75rem;
|
||||
flex: 1;
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
.settings-toggle__icon {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
flex-shrink: 0;
|
||||
width: 2.25rem;
|
||||
height: 2.25rem;
|
||||
border-radius: 0.625rem;
|
||||
background: rgba(0, 0, 0, 0.04);
|
||||
color: hsl(var(--primary));
|
||||
}
|
||||
|
||||
:global(.dark) .settings-toggle__icon {
|
||||
background: rgba(255, 255, 255, 0.08);
|
||||
}
|
||||
|
||||
.settings-toggle__icon :global(svg) {
|
||||
width: 1.125rem;
|
||||
height: 1.125rem;
|
||||
}
|
||||
|
||||
.settings-toggle__text {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 0.125rem;
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
.settings-toggle__label {
|
||||
font-size: 0.9375rem;
|
||||
font-weight: 500;
|
||||
color: #374151;
|
||||
}
|
||||
|
||||
:global(.dark) .settings-toggle__label {
|
||||
color: #f3f4f6;
|
||||
}
|
||||
|
||||
.settings-toggle__description {
|
||||
font-size: 0.8125rem;
|
||||
color: #6b7280;
|
||||
line-height: 1.4;
|
||||
}
|
||||
|
||||
:global(.dark) .settings-toggle__description {
|
||||
color: #9ca3af;
|
||||
}
|
||||
|
||||
/* Toggle Switch - Glass style */
|
||||
.settings-toggle__switch {
|
||||
position: relative;
|
||||
width: 3rem;
|
||||
height: 1.75rem;
|
||||
border-radius: 9999px;
|
||||
border: 1px solid rgba(0, 0, 0, 0.1);
|
||||
background: rgba(0, 0, 0, 0.08);
|
||||
cursor: pointer;
|
||||
flex-shrink: 0;
|
||||
transition: all 0.2s ease;
|
||||
}
|
||||
|
||||
:global(.dark) .settings-toggle__switch {
|
||||
background: rgba(255, 255, 255, 0.12);
|
||||
border-color: rgba(255, 255, 255, 0.15);
|
||||
}
|
||||
|
||||
.settings-toggle__switch:disabled {
|
||||
cursor: not-allowed;
|
||||
}
|
||||
|
||||
.settings-toggle__switch--on {
|
||||
background: hsl(var(--primary));
|
||||
border-color: hsl(var(--primary));
|
||||
box-shadow: 0 0 0 2px hsl(var(--primary) / 0.2);
|
||||
}
|
||||
|
||||
:global(.dark) .settings-toggle__switch--on {
|
||||
background: hsl(var(--primary));
|
||||
border-color: hsl(var(--primary));
|
||||
box-shadow: 0 0 0 2px hsl(var(--primary) / 0.3);
|
||||
}
|
||||
|
||||
.settings-toggle__thumb {
|
||||
position: absolute;
|
||||
top: 0.0625rem;
|
||||
left: 0.0625rem;
|
||||
width: 1.5rem;
|
||||
height: 1.5rem;
|
||||
border-radius: 9999px;
|
||||
background-color: white;
|
||||
box-shadow:
|
||||
0 2px 4px rgba(0, 0, 0, 0.15),
|
||||
0 1px 2px rgba(0, 0, 0, 0.1);
|
||||
transition: transform 0.2s ease;
|
||||
}
|
||||
|
||||
.settings-toggle__switch--on .settings-toggle__thumb {
|
||||
transform: translateX(1.25rem);
|
||||
}
|
||||
|
||||
.settings-toggle__switch:hover:not(:disabled) {
|
||||
border-color: rgba(0, 0, 0, 0.2);
|
||||
}
|
||||
|
||||
:global(.dark) .settings-toggle__switch:hover:not(:disabled) {
|
||||
border-color: rgba(255, 255, 255, 0.25);
|
||||
}
|
||||
|
||||
.settings-toggle__switch--on:hover:not(:disabled) {
|
||||
filter: brightness(1.1);
|
||||
border-color: hsl(var(--primary));
|
||||
}
|
||||
|
||||
.settings-toggle__switch:focus-visible {
|
||||
outline: 2px solid hsl(var(--primary) / 0.4);
|
||||
outline-offset: 2px;
|
||||
}
|
||||
</style>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue