From 883f78310162f0f4da48bf606668291e5a68a958 Mon Sep 17 00:00:00 2001 From: razzle Date: Fri, 13 Jan 2023 12:02:01 -0600 Subject: [PATCH] Cleanup Icon component implementation (#1183) The `icon.svelte` component has a re-implementation of the `material-symbols` library. Since the library exports a [typescript type](https://github.com/marella/material-symbols/blob/main/material-symbols/index.d.ts), a wrapper component around this should be used instead. There is also a fallback for Zarf-specific icons (such as `package` and `component`). --- src/ui/lib/components/header.svelte | 5 +- src/ui/lib/components/icon.svelte | 128 +++++++----------- src/ui/lib/palette.ts | 3 + .../routes/initialize/configure/+page.svelte | 2 +- src/ui/routes/packages/+page.svelte | 4 +- 5 files changed, 57 insertions(+), 85 deletions(-) diff --git a/src/ui/lib/components/header.svelte b/src/ui/lib/components/header.svelte index a5691f1299..e3f6d0383e 100644 --- a/src/ui/lib/components/header.svelte +++ b/src/ui/lib/components/header.svelte @@ -21,7 +21,7 @@
-
+
@@ -54,7 +54,4 @@ margin-right: 0.5rem; align-items: center; } - .header-end-icon { - cursor: pointer; - } diff --git a/src/ui/lib/components/icon.svelte b/src/ui/lib/components/icon.svelte index c2be0d4cb5..ee4710035f 100644 --- a/src/ui/lib/components/icon.svelte +++ b/src/ui/lib/components/icon.svelte @@ -3,84 +3,56 @@ // SPDX-FileCopyrightText: 2021-Present The Zarf Authors --> - - {#if variant === 'component'} - - - - {:else if variant === 'package'} - - - - {:else if variant === 'sun'} - - - - {:else if variant === 'cancelCloud'} - - - - {:else if variant === 'shieldPlus'} - - - - {:else if variant === 'rocket'} - - + {#if variant === 'component'} + + + + {:else if variant === 'package'} + - - - - - - - - - - - - {/if} - + + + {/if} + +{:else} + + {variant} + +{/if} diff --git a/src/ui/lib/palette.ts b/src/ui/lib/palette.ts index 80a2f55dc3..2d7f84d6fc 100644 --- a/src/ui/lib/palette.ts +++ b/src/ui/lib/palette.ts @@ -1,3 +1,6 @@ +// SPDX-License-Identifier: Apache-2.0 +// SPDX-FileCopyrightText: 2021-Present The Zarf Authors + import type { Palettes } from '@ui'; // Current default from @ui diff --git a/src/ui/routes/initialize/configure/+page.svelte b/src/ui/routes/initialize/configure/+page.svelte index 1bad59e13c..03b7a8c69c 100644 --- a/src/ui/routes/initialize/configure/+page.svelte +++ b/src/ui/routes/initialize/configure/+page.svelte @@ -34,7 +34,7 @@ Package Components The following components will be deployed into the cluster. Optional components that are not selected will not be deployed. diff --git a/src/ui/routes/packages/+page.svelte b/src/ui/routes/packages/+page.svelte index b135aeb984..ac4ebd4004 100644 --- a/src/ui/routes/packages/+page.svelte +++ b/src/ui/routes/packages/+page.svelte @@ -5,7 +5,7 @@ {#await Packages.getDeployedPackages()} @@ -22,7 +22,7 @@
Deployment Details