@immich/ui 0.62.1 → 0.62.2

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.
@@ -8,7 +8,7 @@
8
8
  import { getLocale } from '../state/locale-state.svelte.js';
9
9
  import { styleVariants } from '../styles.js';
10
10
  import type { Shape, Size } from '../types.js';
11
- import { cleanClass, generateId } from '../utilities/internal.js';
11
+ import { cleanClass } from '../utilities/internal.js';
12
12
  import type { DateValue } from '@internationalized/date';
13
13
  import { mdiCalendar, mdiChevronLeft, mdiChevronRight } from '@mdi/js';
14
14
  import { DatePicker } from 'bits-ui';
@@ -38,10 +38,6 @@
38
38
  const { readOnly, required, invalid, disabled, label, ...labelProps } = $derived(context());
39
39
  const size = $derived(initialSize ?? labelProps.size ?? 'small');
40
40
 
41
- const id = generateId();
42
- const inputId = `datepicker-${id}`;
43
- const labelId = `label-${id}`;
44
-
45
41
  const containerStyles = tv({
46
42
  base: cleanClass(styleVariants.inputContainerCommon, 'flex w-full items-center'),
47
43
  variants: {
@@ -67,10 +63,6 @@
67
63
  </script>
68
64
 
69
65
  <div class={cleanClass('flex w-full flex-col gap-1', className)}>
70
- {#if label}
71
- <Label id={labelId} for={inputId} {label} requiredIndicator={required === 'indicator'} {...labelProps} {size} />
72
- {/if}
73
-
74
66
  <DatePicker.Root
75
67
  onValueChange={onChange}
76
68
  minValue={minDate}
@@ -80,9 +72,22 @@
80
72
  locale={getLocale()}
81
73
  {disabled}
82
74
  >
75
+ {#if label}
76
+ <DatePicker.Label>
77
+ {#snippet child({ props })}
78
+ <Label
79
+ {...labelProps}
80
+ {...props}
81
+ class={cleanClass(labelProps.class, props.class)}
82
+ requiredIndicator={required === 'indicator'}
83
+ {label}
84
+ {size}
85
+ />
86
+ {/snippet}
87
+ </DatePicker.Label>
88
+ {/if}
89
+
83
90
  <DatePicker.Input
84
- id={inputId}
85
- aria-labelledby={labelId}
86
91
  class={containerStyles({
87
92
  shape,
88
93
  roundedSize: shape === 'semi-round' ? size : undefined,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@immich/ui",
3
- "version": "0.62.1",
3
+ "version": "0.62.2",
4
4
  "license": "GNU Affero General Public License version 3",
5
5
  "repository": {
6
6
  "type": "git",