@immich/ui 0.61.2 → 0.61.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -75,44 +75,35 @@
|
|
|
75
75
|
|
|
76
76
|
const inputId = $derived(`input-${id}`);
|
|
77
77
|
const labelId = $derived(`label-${id}`);
|
|
78
|
-
const descriptionId = $derived(description ? `description-${id}` :
|
|
78
|
+
const descriptionId = $derived(description ? `description-${id}` : restProps['aria-describedby']);
|
|
79
79
|
</script>
|
|
80
80
|
|
|
81
|
-
<
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
{
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
{/if}
|
|
111
|
-
<span class={wrapper({ disabled })}>
|
|
112
|
-
<span class={bar({ fillColor: enabled ? color : 'default' })}> </span>
|
|
113
|
-
<span class={dot({ checked: enabled, fillColor: enabled ? color : 'default' })}></span>
|
|
114
|
-
</span>
|
|
115
|
-
</div>
|
|
116
|
-
{/snippet}
|
|
117
|
-
</Switch.Thumb>
|
|
118
|
-
</Switch.Root>
|
|
81
|
+
<div class={cleanClass(label ? 'flex w-full items-center gap-3' : undefined, className)}>
|
|
82
|
+
{#if label}
|
|
83
|
+
<div class="min-w-0 flex-1 text-start">
|
|
84
|
+
<Label id={labelId} for={inputId} {label} requiredIndicator={required === 'indicator'} {...labelProps} {size} />
|
|
85
|
+
{#if description}
|
|
86
|
+
<Text color="muted" size="small" id={descriptionId}>{description}</Text>
|
|
87
|
+
{/if}
|
|
88
|
+
</div>
|
|
89
|
+
{/if}
|
|
90
|
+
|
|
91
|
+
<Switch.Root
|
|
92
|
+
bind:checked
|
|
93
|
+
bind:ref
|
|
94
|
+
id={inputId}
|
|
95
|
+
disabled={disabled || readOnly}
|
|
96
|
+
required={!!required}
|
|
97
|
+
aria-readonly={readOnly}
|
|
98
|
+
aria-labelledby={labelId}
|
|
99
|
+
aria-describedby={descriptionId}
|
|
100
|
+
{...restProps}
|
|
101
|
+
>
|
|
102
|
+
<Switch.Thumb>
|
|
103
|
+
<span class={wrapper({ disabled })}>
|
|
104
|
+
<span class={bar({ fillColor: enabled ? color : 'default' })}> </span>
|
|
105
|
+
<span class={dot({ checked: enabled, fillColor: enabled ? color : 'default' })}></span>
|
|
106
|
+
</span>
|
|
107
|
+
</Switch.Thumb>
|
|
108
|
+
</Switch.Root>
|
|
109
|
+
</div>
|
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
import { zIndex } from '../../constants.js';
|
|
3
3
|
import { Tooltip } from 'bits-ui';
|
|
4
4
|
import type { Snippet } from 'svelte';
|
|
5
|
-
import { fly } from 'svelte/transition';
|
|
6
5
|
|
|
7
6
|
type Props = Tooltip.RootProps & {
|
|
8
7
|
text?: string | null;
|
|
@@ -18,21 +17,30 @@
|
|
|
18
17
|
<Tooltip.Portal>
|
|
19
18
|
<Tooltip.Content
|
|
20
19
|
sideOffset={8}
|
|
21
|
-
|
|
22
|
-
class="bg-light-800 text-light {zIndex.Tooltip} rounded-lg px-3.5 py-2 text-xs shadow-lg"
|
|
20
|
+
class="tooltip-content bg-light-800 text-light {zIndex.Tooltip} rounded-lg px-3.5 py-2 text-xs shadow-lg"
|
|
23
21
|
>
|
|
24
|
-
{
|
|
25
|
-
{#if open}
|
|
26
|
-
<div {...wrapperProps}>
|
|
27
|
-
<div {...props} transition:fly={{ y: 4, duration: 150 }}>
|
|
28
|
-
{text}
|
|
29
|
-
</div>
|
|
30
|
-
</div>
|
|
31
|
-
{/if}
|
|
32
|
-
{/snippet}
|
|
22
|
+
{text}
|
|
33
23
|
</Tooltip.Content>
|
|
34
24
|
</Tooltip.Portal>
|
|
35
25
|
</Tooltip.Root>
|
|
36
26
|
{:else}
|
|
37
27
|
{@render child({ props: {} })}
|
|
38
28
|
{/if}
|
|
29
|
+
|
|
30
|
+
<style>
|
|
31
|
+
:global(.tooltip-content[data-state='delayed-open']),
|
|
32
|
+
:global(.tooltip-content[data-state='instant-open']) {
|
|
33
|
+
animation: tooltip-enter 150ms ease-out;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
@keyframes tooltip-enter {
|
|
37
|
+
from {
|
|
38
|
+
opacity: 0;
|
|
39
|
+
transform: translateY(4px);
|
|
40
|
+
}
|
|
41
|
+
to {
|
|
42
|
+
opacity: 1;
|
|
43
|
+
transform: translateY(0);
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
</style>
|