@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}` : undefined);
78
+ const descriptionId = $derived(description ? `description-${id}` : restProps['aria-describedby']);
79
79
  </script>
80
80
 
81
- <Switch.Root
82
- bind:checked
83
- bind:ref
84
- id={inputId}
85
- disabled={disabled || readOnly}
86
- required={!!required}
87
- class={cleanClass(label && 'w-full', className)}
88
- aria-readonly={readOnly}
89
- aria-labelledby={labelId}
90
- aria-describedby={descriptionId}
91
- {...restProps}
92
- >
93
- <Switch.Thumb>
94
- {#snippet child()}
95
- <div class={cleanClass(label && 'flex items-center justify-between gap-1')}>
96
- {#if label}
97
- <div class="text-start">
98
- <Label
99
- id={labelId}
100
- for={inputId}
101
- {label}
102
- requiredIndicator={required === 'indicator'}
103
- {...labelProps}
104
- {size}
105
- />
106
- {#if description}
107
- <Text color="muted" size="small" id={descriptionId}>{description}</Text>
108
- {/if}
109
- </div>
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
- forceMount
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
- {#snippet child({ wrapperProps, props, open })}
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>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@immich/ui",
3
- "version": "0.61.2",
3
+ "version": "0.61.4",
4
4
  "license": "GNU Affero General Public License version 3",
5
5
  "repository": {
6
6
  "type": "git",