Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions Client/svelte/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions Client/svelte/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
"devDependencies": {
"@internationalized/date": "^3.11.0",
"@lucide/svelte": "^0.561.0",
"@mdi/font": "^7.4.47",
"@sveltejs/adapter-auto": "^7.0.0",
"@sveltejs/adapter-static": "^3.0.10",
"@sveltejs/kit": "^2.50.2",
Expand Down
8 changes: 8 additions & 0 deletions Client/svelte/src/lib/amcf/MdiIcon.svelte
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<script lang="ts">
import '@mdi/font/css/materialdesignicons.min.css';
import Home from '@lucide/svelte/icons/house';
import LayoutDashboard from '@lucide/svelte/icons/layout-dashboard';
import Settings from '@lucide/svelte/icons/settings';
Expand Down Expand Up @@ -178,11 +179,18 @@
};

let Icon = $derived(mdiMap[icon] || null);
// Names without a lucide equivalent render from the MDI webfont, as in the vue2 client.
let isMdiName = $derived(/^mdi-[a-z0-9-]+$/.test(icon));
</script>

{#if Icon}
{@const ResolvedIcon = Icon}
<ResolvedIcon class={className} />
{:else if isMdiName}
<!-- The glyph is sized from the box (100cqh), so callers size it with h-*/w-* like a lucide icon. -->
<span class="inline-block shrink-0 {className}" style="container-type: size" aria-hidden="true">
<i class="mdi {icon} block leading-none" style="font-size: 100cqh"></i>
</span>
{:else if icon}
<CircleIcon class={className} />
{/if}
Loading