@immich/ui 0.62.0 → 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.
@@ -2,6 +2,7 @@
2
2
  import { setChildContext } from '../../common/context.svelte.js';
3
3
  import IconButton from '../IconButton/IconButton.svelte';
4
4
  import { ChildKey } from '../../constants.js';
5
+ import { t } from '../../services/translation.svelte.js';
5
6
  import type { Color } from '../../types.js';
6
7
  import { cleanClass } from '../../utilities/internal.js';
7
8
  import { mdiChevronDown } from '@mdi/js';
@@ -114,7 +115,7 @@
114
115
  variant="ghost"
115
116
  shape="round"
116
117
  size="large"
117
- aria-label="Expand"
118
+ aria-label={t('expand')}
118
119
  />
119
120
  </div>
120
121
  </button>
@@ -4,10 +4,11 @@
4
4
  import IconButton from '../components/IconButton/IconButton.svelte';
5
5
  import Label from '../components/Label/Label.svelte';
6
6
  import { zIndex } from '../constants.js';
7
+ import { t } from '../services/translation.svelte.js';
7
8
  import { getLocale } from '../state/locale-state.svelte.js';
8
9
  import { styleVariants } from '../styles.js';
9
10
  import type { Shape, Size } from '../types.js';
10
- import { cleanClass, generateId } from '../utilities/internal.js';
11
+ import { cleanClass } from '../utilities/internal.js';
11
12
  import type { DateValue } from '@internationalized/date';
12
13
  import { mdiCalendar, mdiChevronLeft, mdiChevronRight } from '@mdi/js';
13
14
  import { DatePicker } from 'bits-ui';
@@ -37,10 +38,6 @@
37
38
  const { readOnly, required, invalid, disabled, label, ...labelProps } = $derived(context());
38
39
  const size = $derived(initialSize ?? labelProps.size ?? 'small');
39
40
 
40
- const id = generateId();
41
- const inputId = `datepicker-${id}`;
42
- const labelId = `label-${id}`;
43
-
44
41
  const containerStyles = tv({
45
42
  base: cleanClass(styleVariants.inputContainerCommon, 'flex w-full items-center'),
46
43
  variants: {
@@ -66,10 +63,6 @@
66
63
  </script>
67
64
 
68
65
  <div class={cleanClass('flex w-full flex-col gap-1', className)}>
69
- {#if label}
70
- <Label id={labelId} for={inputId} {label} requiredIndicator={required === 'indicator'} {...labelProps} {size} />
71
- {/if}
72
-
73
66
  <DatePicker.Root
74
67
  onValueChange={onChange}
75
68
  minValue={minDate}
@@ -79,9 +72,22 @@
79
72
  locale={getLocale()}
80
73
  {disabled}
81
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
+
82
90
  <DatePicker.Input
83
- id={inputId}
84
- aria-labelledby={labelId}
85
91
  class={containerStyles({
86
92
  shape,
87
93
  roundedSize: shape === 'semi-round' ? size : undefined,
@@ -104,7 +110,7 @@
104
110
  {size}
105
111
  icon={mdiCalendar}
106
112
  {disabled}
107
- aria-label="Open calendar"
113
+ aria-label={t('open_calendar')}
108
114
  />
109
115
  </DatePicker.Trigger>
110
116
  {/snippet}
@@ -4,6 +4,7 @@
4
4
  import IconButton from '../components/IconButton/IconButton.svelte';
5
5
  import Input from '../components/Input/Input.svelte';
6
6
  import { zIndex } from '../constants.js';
7
+ import { t } from '../services/translation.svelte.js';
7
8
  import type { SelectCommonProps, SelectOption } from '../types.js';
8
9
  import { cleanClass } from '../utilities/internal.js';
9
10
  import { mdiArrowDown, mdiArrowUp, mdiCheck, mdiChevronDown } from '@mdi/js';
@@ -107,7 +108,7 @@
107
108
  class="m-1"
108
109
  icon={mdiChevronDown}
109
110
  {disabled}
110
- aria-label="Expand"
111
+ aria-label={t('expand')}
111
112
  />
112
113
  {/snippet}
113
114
  </Input>
@@ -1,5 +1,5 @@
1
1
  import type { ActionItem, MaybePromise, TranslationProps } from '../types.js';
2
- export type CommandPaletteTranslations = TranslationProps<'search_placeholder' | 'search_no_results' | 'search_recently_used' | 'command_palette_prompt_default' | 'command_palette_to_select' | 'command_palette_to_close' | 'command_palette_to_navigate' | 'command_palette_to_show_all' | 'global'>;
2
+ export type CommandPaletteTranslations = TranslationProps<'search_placeholder' | 'search_no_results' | 'command_palette_prompt_default' | 'command_palette_to_select' | 'command_palette_to_close' | 'command_palette_to_navigate' | 'command_palette_to_show_all'>;
3
3
  export type ActionProvider = {
4
4
  name: string;
5
5
  onSearch: (query?: string) => MaybePromise<ActionItem[]>;
@@ -9,7 +9,6 @@ declare const defaultTranslations: {
9
9
  code_copied: string;
10
10
  search_placeholder: string;
11
11
  search_no_results: string;
12
- search_recently_used: string;
13
12
  prompt_default: string;
14
13
  show_password: string;
15
14
  hide_password: string;
@@ -22,13 +21,13 @@ declare const defaultTranslations: {
22
21
  command_palette_to_show_all: string;
23
22
  navigate_next: string;
24
23
  navigate_previous: string;
24
+ open_calendar: string;
25
25
  toast_success_title: string;
26
26
  toast_info_title: string;
27
27
  toast_warning_title: string;
28
28
  toast_danger_title: string;
29
29
  save: string;
30
30
  supporter: string;
31
- global: string;
32
31
  };
33
32
  export type Translations = typeof defaultTranslations;
34
33
  export declare const translate: <T extends keyof Translations>(key: T, overrides?: TranslationProps<T>) => string;
@@ -11,7 +11,6 @@ const defaultTranslations = {
11
11
  // search
12
12
  search_placeholder: 'Search...',
13
13
  search_no_results: 'No results',
14
- search_recently_used: 'Recently used',
15
14
  // modal
16
15
  prompt_default: 'Are you sure you want to do this?',
17
16
  // password input
@@ -30,13 +29,14 @@ const defaultTranslations = {
30
29
  // navigation
31
30
  navigate_next: 'Next',
32
31
  navigate_previous: 'Previous',
32
+ // date picker
33
+ open_calendar: 'Open calendar',
33
34
  toast_success_title: 'Success',
34
35
  toast_info_title: 'Info',
35
36
  toast_warning_title: 'Warning',
36
37
  toast_danger_title: 'Error',
37
38
  save: 'Save',
38
39
  supporter: 'Supporter',
39
- global: 'Global',
40
40
  };
41
41
  let translations = $state(defaultTranslations);
42
42
  export const translate = (key, overrides) => overrides?.[key] ?? translations[key];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@immich/ui",
3
- "version": "0.62.0",
3
+ "version": "0.62.2",
4
4
  "license": "GNU Affero General Public License version 3",
5
5
  "repository": {
6
6
  "type": "git",