mirror of
https://github.com/Ku6epXBOCTuK/easy-png-tools.git
synced 2026-09-14 13:36:36 +00:00
refactor: update panel component
This commit is contained in:
@@ -1,13 +1,17 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import type { Snippet } from "svelte";
|
import type { Snippet } from "svelte";
|
||||||
|
import PanelHeading from "../PanelHeading.svelte";
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
|
title: string;
|
||||||
|
eyebrow: string;
|
||||||
children: Snippet;
|
children: Snippet;
|
||||||
}
|
}
|
||||||
let { children }: Props = $props();
|
let { title, eyebrow, children }: Props = $props();
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<section class="panel">
|
<section class="panel">
|
||||||
|
<PanelHeading {title} {eyebrow} />
|
||||||
{@render children()}
|
{@render children()}
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
@@ -16,5 +20,6 @@
|
|||||||
background: var(--color-panel);
|
background: var(--color-panel);
|
||||||
border: var(--size-border) solid var(--color-border);
|
border: var(--size-border) solid var(--color-border);
|
||||||
border-radius: var(--radius-s);
|
border-radius: var(--radius-s);
|
||||||
|
padding: var(--space-l);
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -63,7 +63,7 @@
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<main class="preview-root" data-theme={theme}>
|
<main class="preview-root" data-theme={theme}>
|
||||||
<TopBar {theme} {crumb} {status} ontoggle={toggle} />
|
<TopBar {theme} {crumb} ontoggle={toggle} />
|
||||||
{@render children()}
|
{@render children()}
|
||||||
<Footer />
|
<Footer />
|
||||||
</main>
|
</main>
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import Panel from "$lib/components/kit/layout/Panel.svelte";
|
import Panel from "$lib/components/kit/layout/Panel.svelte";
|
||||||
import PanelHeading from "$lib/components/kit/PanelHeading.svelte";
|
|
||||||
import SettingsFooter from "$lib/components/kit/SettingsFooter.svelte";
|
import SettingsFooter from "$lib/components/kit/SettingsFooter.svelte";
|
||||||
import TextField from "$lib/components/kit/TextField.svelte";
|
import TextField from "$lib/components/kit/TextField.svelte";
|
||||||
import ToolCard from "$lib/components/kit/ToolCard.svelte";
|
import ToolCard from "$lib/components/kit/ToolCard.svelte";
|
||||||
@@ -28,8 +27,7 @@
|
|||||||
</p>
|
</p>
|
||||||
</header>
|
</header>
|
||||||
|
|
||||||
<Panel>
|
<Panel title="Search" eyebrow="tools">
|
||||||
<PanelHeading title="Search" eyebrow="tools" />
|
|
||||||
<div class="ws-search">
|
<div class="ws-search">
|
||||||
<div class="ws-field">
|
<div class="ws-field">
|
||||||
<TextField
|
<TextField
|
||||||
|
|||||||
@@ -296,9 +296,6 @@
|
|||||||
gap: 5px;
|
gap: 5px;
|
||||||
display: flex;
|
display: flex;
|
||||||
}
|
}
|
||||||
.image-preview.active {
|
|
||||||
border-color: var(--blue);
|
|
||||||
}
|
|
||||||
.sample-icon {
|
.sample-icon {
|
||||||
border: 1px solid;
|
border: 1px solid;
|
||||||
padding: 3px 5px;
|
padding: 3px 5px;
|
||||||
|
|||||||
@@ -7,7 +7,6 @@
|
|||||||
import ImageCard from "$lib/components/kit/ImageCard.svelte";
|
import ImageCard from "$lib/components/kit/ImageCard.svelte";
|
||||||
import Panel from "$lib/components/kit/layout/Panel.svelte";
|
import Panel from "$lib/components/kit/layout/Panel.svelte";
|
||||||
import MetaList from "$lib/components/kit/MetaList.svelte";
|
import MetaList from "$lib/components/kit/MetaList.svelte";
|
||||||
import PanelHeading from "$lib/components/kit/PanelHeading.svelte";
|
|
||||||
import PreviewTile from "$lib/components/kit/PreviewTile.svelte";
|
import PreviewTile from "$lib/components/kit/PreviewTile.svelte";
|
||||||
import Segmented from "$lib/components/kit/Segmented.svelte";
|
import Segmented from "$lib/components/kit/Segmented.svelte";
|
||||||
import SelectField from "$lib/components/kit/SelectField.svelte";
|
import SelectField from "$lib/components/kit/SelectField.svelte";
|
||||||
@@ -58,8 +57,7 @@
|
|||||||
<StatusLine label="rendering ok" />
|
<StatusLine label="rendering ok" />
|
||||||
</header>
|
</header>
|
||||||
|
|
||||||
<Panel>
|
<Panel title="Buttons" eyebrow="controls">
|
||||||
<PanelHeading title="Buttons" eyebrow="controls" />
|
|
||||||
<div class="stack">
|
<div class="stack">
|
||||||
<SettingGroup label="variants">
|
<SettingGroup label="variants">
|
||||||
<Button onclick={() => {}} label="Primary" />
|
<Button onclick={() => {}} label="Primary" />
|
||||||
@@ -89,8 +87,7 @@
|
|||||||
</SettingsFooter>
|
</SettingsFooter>
|
||||||
</Panel>
|
</Panel>
|
||||||
|
|
||||||
<Panel>
|
<Panel title="Inputs" eyebrow="controls">
|
||||||
<PanelHeading title="Inputs" eyebrow="controls" />
|
|
||||||
<div class="stack">
|
<div class="stack">
|
||||||
<SliderField
|
<SliderField
|
||||||
label="corner radius"
|
label="corner radius"
|
||||||
@@ -121,8 +118,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</Panel>
|
</Panel>
|
||||||
|
|
||||||
<Panel>
|
<Panel title="Segmented & badges" eyebrow="controls">
|
||||||
<PanelHeading title="Segmented & badges" eyebrow="controls" />
|
|
||||||
<div class="stack">
|
<div class="stack">
|
||||||
<Segmented
|
<Segmented
|
||||||
bind:value={mode}
|
bind:value={mode}
|
||||||
@@ -143,8 +139,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</Panel>
|
</Panel>
|
||||||
|
|
||||||
<Panel>
|
<Panel title="Steps" eyebrow="pipeline">
|
||||||
<PanelHeading title="Steps" eyebrow="pipeline" />
|
|
||||||
<div class="stack">
|
<div class="stack">
|
||||||
<StepCard index={1} type="BACKGROUND" title="Gradient fill">
|
<StepCard index={1} type="BACKGROUND" title="Gradient fill">
|
||||||
<ColorField label="color" bind:value={tint} />
|
<ColorField label="color" bind:value={tint} />
|
||||||
@@ -155,8 +150,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</Panel>
|
</Panel>
|
||||||
|
|
||||||
<Panel>
|
<Panel title="Tools" eyebrow="catalog">
|
||||||
<PanelHeading title="Tools" eyebrow="catalog" />
|
|
||||||
<div class="tool-grid">
|
<div class="tool-grid">
|
||||||
{#each tools as tool, i (tool.title)}
|
{#each tools as tool, i (tool.title)}
|
||||||
<ToolCard
|
<ToolCard
|
||||||
@@ -170,8 +164,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</Panel>
|
</Panel>
|
||||||
|
|
||||||
<Panel>
|
<Panel title="Preview" eyebrow="canvas">
|
||||||
<PanelHeading title="Preview" eyebrow="canvas" />
|
|
||||||
<div class="preview-grid">
|
<div class="preview-grid">
|
||||||
<ImageCard label="result.png · 512×512">
|
<ImageCard label="result.png · 512×512">
|
||||||
<CheckerCanvas size="sm" />
|
<CheckerCanvas size="sm" />
|
||||||
@@ -194,8 +187,7 @@
|
|||||||
</SettingsFooter>
|
</SettingsFooter>
|
||||||
</Panel>
|
</Panel>
|
||||||
|
|
||||||
<Panel>
|
<Panel title="States & code" eyebrow="misc">
|
||||||
<PanelHeading title="States & code" eyebrow="misc" />
|
|
||||||
<div class="stack">
|
<div class="stack">
|
||||||
<EmptyState
|
<EmptyState
|
||||||
icon={ImageOff}
|
icon={ImageOff}
|
||||||
|
|||||||
@@ -4,7 +4,6 @@
|
|||||||
import EmptyState from "$lib/components/kit/EmptyState.svelte";
|
import EmptyState from "$lib/components/kit/EmptyState.svelte";
|
||||||
import Panel from "$lib/components/kit/layout/Panel.svelte";
|
import Panel from "$lib/components/kit/layout/Panel.svelte";
|
||||||
import MetaList from "$lib/components/kit/MetaList.svelte";
|
import MetaList from "$lib/components/kit/MetaList.svelte";
|
||||||
import PanelHeading from "$lib/components/kit/PanelHeading.svelte";
|
|
||||||
import PreviewStack from "$lib/components/kit/PreviewStack.svelte";
|
import PreviewStack from "$lib/components/kit/PreviewStack.svelte";
|
||||||
import PreviewTile from "$lib/components/kit/PreviewTile.svelte";
|
import PreviewTile from "$lib/components/kit/PreviewTile.svelte";
|
||||||
import StatusLine from "$lib/components/kit/StatusLine.svelte";
|
import StatusLine from "$lib/components/kit/StatusLine.svelte";
|
||||||
@@ -52,14 +51,11 @@
|
|||||||
}: Props = $props();
|
}: Props = $props();
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<Panel>
|
<Panel title="Pipeline output" eyebrow="RESULT">
|
||||||
<PanelHeading title="Pipeline output" eyebrow="RESULT">
|
|
||||||
{#snippet actions()}
|
|
||||||
{#if resultUrl}
|
{#if resultUrl}
|
||||||
<DownloadButton label="Download result" onclick={onDownload} />
|
<DownloadButton label="Download result" onclick={onDownload} />
|
||||||
{/if}
|
{/if}
|
||||||
{/snippet}
|
|
||||||
</PanelHeading>
|
|
||||||
<div class="preview-body">
|
<div class="preview-body">
|
||||||
{#if chainError}
|
{#if chainError}
|
||||||
<EmptyState title="Pipeline failed" description={chainError} />
|
<EmptyState title="Pipeline failed" description={chainError} />
|
||||||
|
|||||||
@@ -1,11 +1,9 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import EmptyState from "$lib/components/kit/EmptyState.svelte";
|
import EmptyState from "$lib/components/kit/EmptyState.svelte";
|
||||||
import Panel from "$lib/components/kit/layout/Panel.svelte";
|
import Panel from "$lib/components/kit/layout/Panel.svelte";
|
||||||
import PanelHeading from "$lib/components/kit/PanelHeading.svelte";
|
|
||||||
import SelectField from "$lib/components/kit/SelectField.svelte";
|
import SelectField from "$lib/components/kit/SelectField.svelte";
|
||||||
import SettingsFooter from "$lib/components/kit/SettingsFooter.svelte";
|
import SettingsFooter from "$lib/components/kit/SettingsFooter.svelte";
|
||||||
import StepCard from "$lib/components/kit/StepCard.svelte";
|
import StepCard from "$lib/components/kit/StepCard.svelte";
|
||||||
import Badge from "$lib/components/kit/ui/Badge.svelte";
|
|
||||||
import Button from "$lib/components/kit/ui/Button.svelte";
|
import Button from "$lib/components/kit/ui/Button.svelte";
|
||||||
import { getTool } from "$lib/registry";
|
import { getTool } from "$lib/registry";
|
||||||
import ParamControl from "./ParamControl.svelte";
|
import ParamControl from "./ParamControl.svelte";
|
||||||
@@ -38,12 +36,7 @@
|
|||||||
}: Props = $props();
|
}: Props = $props();
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<Panel>
|
<Panel title="Pipeline" eyebrow="STEPS">
|
||||||
<PanelHeading title="Pipeline" eyebrow="STEPS">
|
|
||||||
{#snippet actions()}
|
|
||||||
<Badge tone="accent" label="AUTO" />
|
|
||||||
{/snippet}
|
|
||||||
</PanelHeading>
|
|
||||||
<div class="pipeline-body">
|
<div class="pipeline-body">
|
||||||
{#if steps.length === 0}
|
{#if steps.length === 0}
|
||||||
<EmptyState title="Pipeline empty" description="Add a tool step below." />
|
<EmptyState title="Pipeline empty" description="Add a tool step below." />
|
||||||
|
|||||||
Reference in New Issue
Block a user