-
Notifications
You must be signed in to change notification settings - Fork 49
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #321 from CommandDash/web-marketplace
Integration of the web marketplace
- Loading branch information
Showing
18 changed files
with
601 additions
and
104 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<script lang="ts"> | ||
import CarbonClose from "~icons/carbon/close"; | ||
import CarbonTextAlignJustify from "~icons/carbon/text-align-justify"; | ||
export let isCollapsed: boolean; | ||
export let classNames: string; | ||
</script> | ||
|
||
<button | ||
on:click | ||
class="{classNames} group flex h-16 w-6 flex-col items-center justify-center -space-y-1 outline-none max-md:hidden ml-2" | ||
> | ||
{#if isCollapsed} | ||
<CarbonTextAlignJustify color="white" height="2em" width="2em" /> | ||
{:else} | ||
<CarbonClose color="white" height="2em" width="2em" /> | ||
{/if} | ||
</button> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
<script lang="ts"> | ||
import { navigating } from "$app/stores"; | ||
import { createEventDispatcher } from "svelte"; | ||
import { page } from "$app/stores"; | ||
import { browser } from "$app/environment"; | ||
import CarbonClose from "~icons/carbon/close"; | ||
import CarbonTextAlignJustify from "~icons/carbon/text-align-justify"; | ||
import IconNew from "$lib/components/icons/IconNew.svelte"; | ||
export let isOpen = false; | ||
export let title: string | undefined; | ||
$: title = title ?? "CommandDash"; | ||
let closeEl: HTMLButtonElement; | ||
let openEl: HTMLButtonElement; | ||
const dispatch = createEventDispatcher(); | ||
$: if ($navigating) { | ||
dispatch("toggle", false); | ||
} | ||
$: if (isOpen && closeEl) { | ||
closeEl.focus(); | ||
} else if (!isOpen && browser && document.activeElement === closeEl) { | ||
openEl.focus(); | ||
} | ||
</script> | ||
|
||
<nav | ||
class="flex h-12 items-center justify-between border-b bg-gray-50 px-3 md:hidden dark:border-gray-800 dark:bg-gray-800/70" | ||
> | ||
<button | ||
type="button" | ||
class="-ml-3 flex size-12 shrink-0 items-center justify-center text-lg" | ||
on:click={() => dispatch("toggle", true)} | ||
aria-label="Open menu" | ||
bind:this={openEl}><CarbonTextAlignJustify /></button | ||
> | ||
<span class="truncate px-4">{title}</span> | ||
<div | ||
class="-mr-3 flex size-12 shrink-0 items-center justify-center text-lg" /> | ||
</nav> | ||
<nav | ||
class="fixed inset-0 z-30 grid max-h-screen grid-cols-1 grid-rows-[auto,auto,1fr,auto] bg-white dark:bg-gray-900 {isOpen | ||
? 'block' | ||
: 'hidden'}" | ||
> | ||
<div class="flex h-12 items-center px-4"> | ||
<button | ||
type="button" | ||
class="-mr-3 ml-auto flex size-12 items-center justify-center text-lg" | ||
on:click={() => dispatch("toggle", false)} | ||
aria-label="Close menu" | ||
bind:this={closeEl}><CarbonClose /></button | ||
> | ||
</div> | ||
<slot /> | ||
</nav> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
<script lang="ts"> | ||
import { fade } from "svelte/transition"; | ||
import { ToastType } from "$lib/types/Toast"; | ||
import IconDazzled from "$lib/components/icons/IconDazzled.svelte"; | ||
import CarbonError from "~icons/carbon/error"; | ||
import CarbonInformation from "~icons/carbon/information-filled"; | ||
import CarbonCheck from "~icons/carbon/checkmark-filled"; | ||
export let message: string | null = ""; | ||
export let toastType: ToastType | null = ToastType.INFO; | ||
</script> | ||
|
||
<div | ||
transition:fade|global={{ duration: 300 }} | ||
class="pointer-events-none fixed right-0 top-12 z-20 bg-gradient-to-bl from-red-500/20 via-red-500/0 to-red-500/0 pb-36 pl-36 pr-2 pt-2 md:top-0 md:pr-8 md:pt-5" | ||
> | ||
<div | ||
class="pointer-events-auto flex items-center rounded-full bg-white/90 px-3 py-1 shadow-sm dark:bg-gray-900/80" | ||
> | ||
{#if ToastType.SUCCESS === toastType} | ||
<CarbonCheck color="green" height="1.5em" width="1.5em" class="mx-2" /> | ||
{:else if ToastType.INFO === toastType} | ||
<CarbonInformation color="#f5b70c" height="1.5em" width="1.5em" class="mx-2" /> | ||
{:else if ToastType.ERROR === toastType} | ||
<CarbonError color="red" height="1.5em" width="1.5em" class="mx-2" /> | ||
{/if} | ||
<h2 class="font-semibold mx-2">{message}</h2> | ||
</div> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
<script lang="ts"> | ||
export let classNames = ""; | ||
</script> | ||
|
||
<svg | ||
xmlns="http://www.w3.org/2000/svg" | ||
width="1em" | ||
height="1em" | ||
class={classNames} | ||
fill="none" | ||
viewBox="0 0 26 23" | ||
> | ||
<path | ||
fill="url(#a)" | ||
d="M.93 10.65A10.17 10.17 0 0 1 11.11.48h4.67a9.45 9.45 0 0 1 0 18.89H4.53L1.62 22.2a.38.38 0 0 1-.69-.28V10.65Z" | ||
/> | ||
<path | ||
fill="#000" | ||
fill-rule="evenodd" | ||
d="M11.52 7.4a1.86 1.86 0 1 1-3.72 0 1.86 1.86 0 0 1 3.72 0Zm7.57 0a1.86 1.86 0 1 1-3.73 0 1.86 1.86 0 0 1 3.73 0ZM8.9 12.9a.55.55 0 0 0-.11.35.76.76 0 0 1-1.51 0c0-.95.67-1.94 1.76-1.94 1.09 0 1.76 1 1.76 1.94H9.3a.55.55 0 0 0-.12-.35c-.06-.07-.1-.08-.13-.08s-.08 0-.14.08Zm4.04 0a.55.55 0 0 0-.12.35h-1.51c0-.95.68-1.94 1.76-1.94 1.1 0 1.77 1 1.77 1.94h-1.51a.55.55 0 0 0-.12-.35c-.06-.07-.11-.08-.14-.08-.02 0-.07 0-.13.08Zm-1.89.79c-.02 0-.07-.01-.13-.08a.55.55 0 0 1-.12-.36h-1.5c0 .95.67 1.95 1.75 1.95 1.1 0 1.77-1 1.77-1.95h-1.51c0 .16-.06.28-.12.36-.06.07-.11.08-.14.08Zm4.04 0c-.03 0-.08-.01-.14-.08a.55.55 0 0 1-.12-.36h-1.5c0 .95.67 1.95 1.76 1.95 1.08 0 1.76-1 1.76-1.95h-1.51c0 .16-.06.28-.12.36-.06.07-.11.08-.13.08Zm1.76-.44c0-.16.05-.28.12-.35.06-.07.1-.08.13-.08s.08 0 .14.08c.06.07.11.2.11.35a.76.76 0 0 0 1.51 0c0-.95-.67-1.94-1.76-1.94-1.09 0-1.76 1-1.76 1.94h1.5Z" | ||
clip-rule="evenodd" | ||
/> | ||
<defs> | ||
<radialGradient | ||
id="a" | ||
cx="0" | ||
cy="0" | ||
r="1" | ||
gradientTransform="matrix(0 31.37 -34.85 0 13.08 -9.02)" | ||
gradientUnits="userSpaceOnUse" | ||
> | ||
<stop stop-color="#FFD21E" /> | ||
<stop offset="1" stop-color="red" /> | ||
</radialGradient> | ||
</defs> | ||
</svg> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<script lang="ts"> | ||
export let classNames = ""; | ||
</script> | ||
|
||
<svg | ||
xmlns="http://www.w3.org/2000/svg" | ||
class={classNames} | ||
width="1em" | ||
height="1em" | ||
fill="none" | ||
viewBox="0 0 32 32" | ||
><path | ||
fill="currentColor" | ||
fill-rule="evenodd" | ||
d="M3.143 20.286h4.286v2.142H3.143A2.143 2.143 0 0 1 1 20.287V3.143A2.143 2.143 0 0 1 3.143 1h17.143a2.143 2.143 0 0 1 2.142 2.143v4.286h-2.142V3.143H3.143v17.143Zm9.643-12.857v3.214H16v2.143h-3.214V16h-2.143v-3.214H7.429v-2.143h3.214V7.429h2.143Zm14.185 2.639 3.533 3.532a1.7 1.7 0 0 1 0 2.4L15.5 31H9.57v-5.928l15-15.004a1.7 1.7 0 0 1 2.4 0Zm-15.257 18.79h2.897l10.116-10.116-2.899-2.897L11.714 25.96v2.897ZM23.346 14.33l2.897 2.897 2.429-2.43-2.897-2.896-2.43 2.429Z" | ||
clip-rule="evenodd" | ||
/></svg | ||
> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import type { ToastType } from "$lib/types/Toast"; | ||
import { writable } from "svelte/store"; | ||
|
||
interface Toast { | ||
message: string; | ||
type: ToastType | ||
} | ||
|
||
export const toastStore = writable<Toast | null>(null); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.