lutra 0.1.9 → 0.1.12
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,19 +1,25 @@
|
|
1
1
|
<script lang="ts">
|
2
2
|
import type { Component, Snippet } from "svelte";
|
3
|
+
import Icon from "./Icon.svelte";
|
3
4
|
|
4
5
|
let {
|
5
6
|
text,
|
6
7
|
snippet,
|
7
8
|
component: Comp,
|
8
|
-
props
|
9
|
+
props,
|
10
|
+
icon
|
9
11
|
}: {
|
10
12
|
text?: string;
|
11
13
|
snippet?: Snippet;
|
12
14
|
component?: Component;
|
13
15
|
props?: any;
|
16
|
+
icon?: string | Component;
|
14
17
|
} = $props();
|
15
18
|
</script>
|
16
19
|
|
20
|
+
{#if icon}
|
21
|
+
<Icon {icon} alt={text} />
|
22
|
+
{/if}
|
17
23
|
{#if text}
|
18
24
|
{text}
|
19
25
|
{/if}
|
@@ -22,4 +28,10 @@
|
|
22
28
|
{/if}
|
23
29
|
{#if Comp}
|
24
30
|
<Comp {...props} />
|
25
|
-
{/if}
|
31
|
+
{/if}
|
32
|
+
|
33
|
+
<style>
|
34
|
+
:global(.Icon) {
|
35
|
+
margin-inline-end: var(--menu-item-icon-gap, var(--space-sm));
|
36
|
+
}
|
37
|
+
</style>
|
@@ -12,6 +12,8 @@ export type MenuItem = {
|
|
12
12
|
snippet?: Snippet;
|
13
13
|
/** Component to display. */
|
14
14
|
component?: Component;
|
15
|
+
/** Icon to display. Pass either a Svelte Component or an URL. Use the Icon component to recolor your icons according to the user theme. */
|
16
|
+
icon?: string | Component;
|
15
17
|
/** Color to use for the item. */
|
16
18
|
color?: StatusColorOrString;
|
17
19
|
} | {
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "lutra",
|
3
|
-
"version": "0.1.
|
3
|
+
"version": "0.1.12",
|
4
4
|
"scripts": {
|
5
5
|
"dev": "vite dev",
|
6
6
|
"build": "vite build && npm run package",
|
@@ -8,7 +8,10 @@
|
|
8
8
|
"package": "svelte-kit sync && svelte-package && publint",
|
9
9
|
"prepublishOnly": "npm run package",
|
10
10
|
"check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json",
|
11
|
-
"check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch"
|
11
|
+
"check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch",
|
12
|
+
"version:patch": "node scripts/bump-version.js patch",
|
13
|
+
"version:minor": "node scripts/bump-version.js minor",
|
14
|
+
"version:major": "node scripts/bump-version.js major"
|
12
15
|
},
|
13
16
|
"files": [
|
14
17
|
"dist",
|