@immich/ui 0.13.0 → 0.14.0
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.
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
+
import { page } from '$app/state';
|
|
2
3
|
import Icon from '../Icon/Icon.svelte';
|
|
3
4
|
import type { IconProps } from '../../types.js';
|
|
4
5
|
import { tv } from 'tailwind-variants';
|
|
@@ -8,9 +9,22 @@
|
|
|
8
9
|
active?: boolean;
|
|
9
10
|
href: string;
|
|
10
11
|
variant?: 'compact';
|
|
12
|
+
isActive?: () => boolean;
|
|
11
13
|
} & { icon?: string & Omit<IconProps, 'icon'> };
|
|
12
14
|
|
|
13
|
-
|
|
15
|
+
const startsWithHref = () => page.url.pathname.startsWith(href);
|
|
16
|
+
|
|
17
|
+
let {
|
|
18
|
+
href,
|
|
19
|
+
isActive: isActiveOverride,
|
|
20
|
+
title,
|
|
21
|
+
variant,
|
|
22
|
+
active: activeOverride,
|
|
23
|
+
...iconProps
|
|
24
|
+
}: Props = $props();
|
|
25
|
+
|
|
26
|
+
const isActive = isActiveOverride ?? startsWithHref;
|
|
27
|
+
let active = $derived(activeOverride ?? isActive());
|
|
14
28
|
|
|
15
29
|
const styles = tv({
|
|
16
30
|
base: 'flex w-full place-items-center gap-4 transition-[padding] delay-100 duration-100 hover:bg-subtle hover:text-primary group-hover:sm:px-5 md:rounded-r-full md:px-5',
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@immich/ui",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.14.0",
|
|
4
4
|
"license": "GNU Affero General Public License version 3",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"create": "node scripts/create.js",
|
|
@@ -47,7 +47,7 @@
|
|
|
47
47
|
"@types/eslint": "^9.6.0",
|
|
48
48
|
"autoprefixer": "^10.4.20",
|
|
49
49
|
"eslint": "^9.7.0",
|
|
50
|
-
"eslint-config-prettier": "^
|
|
50
|
+
"eslint-config-prettier": "^10.0.0",
|
|
51
51
|
"eslint-plugin-svelte": "^2.36.0",
|
|
52
52
|
"globals": "^15.0.0",
|
|
53
53
|
"prettier": "^3.3.2",
|