mirror of
https://github.com/immich-app/immich.git
synced 2026-03-07 10:37:22 +03:00
* chore(web): standardize settings labels - spelling out "max" and "min" in full - accordions use title case - labels for settings all use sentence case - remove the "Enable"/"Enabled"/"ENABLED" titles for toggles, in favor of just using the description - change any gray labels to be immich blue, to match the look and feel of the other settings * chore: update user settings toggle, remove unused "enable" strings
54 lines
1.3 KiB
Svelte
54 lines
1.3 KiB
Svelte
<script lang="ts">
|
|
import { quintOut } from 'svelte/easing';
|
|
import { fly } from 'svelte/transition';
|
|
|
|
export let value: string;
|
|
export let label = '';
|
|
export let desc = '';
|
|
export let required = false;
|
|
export let disabled = false;
|
|
export let isEdited = false;
|
|
|
|
const handleInput = (e: Event) => {
|
|
value = (e.target as HTMLInputElement).value;
|
|
};
|
|
</script>
|
|
|
|
<div class="mb-4 w-full">
|
|
<div class={`flex h-[26px] place-items-center gap-1`}>
|
|
<label class="font-medium text-immich-primary dark:text-immich-dark-primary text-sm" for={label}>{label}</label>
|
|
{#if required}
|
|
<div class="text-red-400">*</div>
|
|
{/if}
|
|
|
|
{#if isEdited}
|
|
<div
|
|
transition:fly={{ x: 10, duration: 200, easing: quintOut }}
|
|
class="rounded-full bg-orange-100 px-2 text-[10px] text-orange-900"
|
|
>
|
|
Unsaved change
|
|
</div>
|
|
{/if}
|
|
</div>
|
|
|
|
{#if desc}
|
|
<p class="immich-form-label pb-2 text-sm" id="{label}-desc">
|
|
{desc}
|
|
</p>
|
|
{:else}
|
|
<slot name="desc" />
|
|
{/if}
|
|
|
|
<textarea
|
|
class="immich-form-input w-full pb-2"
|
|
aria-describedby={desc ? `${label}-desc` : undefined}
|
|
aria-labelledby="{label}-label"
|
|
id={label}
|
|
name={label}
|
|
{required}
|
|
{value}
|
|
on:input={handleInput}
|
|
{disabled}
|
|
/>
|
|
</div>
|