misc: update mono ui
This commit is contained in:
1 parent
e284ae14ef
commit
8129275fa7
7 files changed
+41
-40
No files matched your search
@@ -51,7 +51,7 @@
|
|||||||
<!-- svelte-ignore a11y-click-events-have-key-events -->
|
<!-- svelte-ignore a11y-click-events-have-key-events -->
|
||||||
<!-- svelte-ignore a11y-positive-tabindex -->
|
<!-- svelte-ignore a11y-positive-tabindex -->
|
||||||
<div
|
<div
|
||||||
class="fixed top-0 left-0 w-screen h-[100svh] overflow-auto bg-black/50
|
class="fixed top-0 left-0 w-screen h-[100svh] overflow-auto bg-white/50 dark:bg-black/50
|
||||||
flex flex-col z-[100] backdrop-blur-sm"
|
flex flex-col z-[100] backdrop-blur-sm"
|
||||||
transition:fade={{ duration: 150 }}
|
transition:fade={{ duration: 150 }}
|
||||||
on:click={() => history.back()}
|
on:click={() => history.back()}
|
||||||
@@ -80,9 +80,10 @@
|
|||||||
transition:fly={{ duration: 350, y: 14, easing: backOut }}
|
transition:fly={{ duration: 350, y: 14, easing: backOut }}
|
||||||
>
|
>
|
||||||
<Material
|
<Material
|
||||||
class="gap-1 p-2 flex flex-row items-center"
|
class="gap-1 p-2 flex flex-row items-center dark:bg-zinc-950"
|
||||||
rounding="full"
|
rounding="full"
|
||||||
padding="none"
|
padding="none"
|
||||||
|
color="uniform"
|
||||||
on:click={(e) => e.stopPropagation()}
|
on:click={(e) => e.stopPropagation()}
|
||||||
>
|
>
|
||||||
<Button
|
<Button
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
export const buttonAlignment = {
|
export const buttonAlignment = {
|
||||||
left: 'justify-start text-left',
|
left: 'justify-start text-left',
|
||||||
center: 'justify-center text-center',
|
center: 'justify-center text-center',
|
||||||
right: 'justify-end text-right'
|
right: 'justify-end text-right',
|
||||||
}
|
}
|
||||||
|
|
||||||
export const buttonColor = {
|
export const buttonColor = {
|
||||||
@@ -20,7 +20,8 @@
|
|||||||
tertiary:
|
tertiary:
|
||||||
'border border-transparent bg-transparent hover:bg-slate-100 hover:dark:bg-zinc-800 dark:text-zinc-200',
|
'border border-transparent bg-transparent hover:bg-slate-100 hover:dark:bg-zinc-800 dark:text-zinc-200',
|
||||||
|
|
||||||
danger: 'border border-red-500 bg-red-500 hover:text-red-500 hover:bg-transparent text-white',
|
danger:
|
||||||
|
'border border-red-500 bg-red-500 hover:text-red-500 hover:bg-transparent text-white',
|
||||||
'danger-subtle': 'text-red-500 hover:bg-red-500 hover:!text-inherit',
|
'danger-subtle': 'text-red-500 hover:bg-red-500 hover:!text-inherit',
|
||||||
|
|
||||||
'success-subtle': 'text-green-500 hover:bg-green-500 hover:!text-inherit',
|
'success-subtle': 'text-green-500 hover:bg-green-500 hover:!text-inherit',
|
||||||
@@ -39,12 +40,12 @@
|
|||||||
dark:border-zinc-800 hover:bg-slate-200 hover:dark:bg-zinc-800 hover:border-slate-300
|
dark:border-zinc-800 hover:bg-slate-200 hover:dark:bg-zinc-800 hover:border-slate-300
|
||||||
hover:dark:border-zinc-700`,
|
hover:dark:border-zinc-700`,
|
||||||
|
|
||||||
none: ''
|
none: '',
|
||||||
}
|
}
|
||||||
|
|
||||||
export const buttonShadow = {
|
export const buttonShadow = {
|
||||||
sm: 'shadow-sm',
|
sm: 'shadow-sm',
|
||||||
none: 'shadow-none'
|
none: 'shadow-none',
|
||||||
}
|
}
|
||||||
|
|
||||||
export type ButtonSize = keyof typeof buttonSize
|
export type ButtonSize = keyof typeof buttonSize
|
||||||
@@ -58,7 +59,7 @@
|
|||||||
'square-md': 'w-8 h-8',
|
'square-md': 'w-8 h-8',
|
||||||
'square-lg': 'w-10 h-10',
|
'square-lg': 'w-10 h-10',
|
||||||
'square-xl': 'w-12 h-12',
|
'square-xl': 'w-12 h-12',
|
||||||
custom: ''
|
custom: '',
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
@@ -74,7 +75,7 @@
|
|||||||
left: 'rounded-l-full',
|
left: 'rounded-l-full',
|
||||||
right: 'rounded-r-full',
|
right: 'rounded-r-full',
|
||||||
top: 'rounded-t-full',
|
top: 'rounded-t-full',
|
||||||
bottom: 'rounded-b-full'
|
bottom: 'rounded-b-full',
|
||||||
},
|
},
|
||||||
|
|
||||||
xl: {
|
xl: {
|
||||||
@@ -82,7 +83,7 @@
|
|||||||
left: 'rounded-l-xl',
|
left: 'rounded-l-xl',
|
||||||
right: 'rounded-r-xl',
|
right: 'rounded-r-xl',
|
||||||
top: 'rounded-t-xl',
|
top: 'rounded-t-xl',
|
||||||
bottom: 'rounded-b-xl'
|
bottom: 'rounded-b-xl',
|
||||||
},
|
},
|
||||||
|
|
||||||
lg: {
|
lg: {
|
||||||
@@ -90,7 +91,7 @@
|
|||||||
left: 'rounded-l-lg',
|
left: 'rounded-l-lg',
|
||||||
right: 'rounded-r-lg',
|
right: 'rounded-r-lg',
|
||||||
top: 'rounded-t-lg',
|
top: 'rounded-t-lg',
|
||||||
bottom: 'rounded-b-lg'
|
bottom: 'rounded-b-lg',
|
||||||
},
|
},
|
||||||
|
|
||||||
md: {
|
md: {
|
||||||
@@ -98,7 +99,7 @@
|
|||||||
left: 'rounded-l-md',
|
left: 'rounded-l-md',
|
||||||
right: 'rounded-r-md',
|
right: 'rounded-r-md',
|
||||||
top: 'rounded-t-md',
|
top: 'rounded-t-md',
|
||||||
bottom: 'rounded-b-md'
|
bottom: 'rounded-b-md',
|
||||||
},
|
},
|
||||||
|
|
||||||
none: {
|
none: {
|
||||||
@@ -106,8 +107,8 @@
|
|||||||
left: '',
|
left: '',
|
||||||
right: '',
|
right: '',
|
||||||
top: '',
|
top: '',
|
||||||
bottom: ''
|
bottom: '',
|
||||||
}
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
export let loading = false
|
export let loading = false
|
||||||
@@ -147,7 +148,11 @@
|
|||||||
disabled:dark:!border-zinc-700 disabled:dark:!bg-zinc-800 disabled:text-inherit
|
disabled:dark:!border-zinc-700 disabled:dark:!bg-zinc-800 disabled:text-inherit
|
||||||
font-medium cursor-pointer
|
font-medium cursor-pointer
|
||||||
{$$props.class}
|
{$$props.class}
|
||||||
{loading ? (color == 'primary' ? '!bg-transparent !text-inherit' : '') : ''}"
|
{loading
|
||||||
|
? color == 'primary'
|
||||||
|
? '!bg-transparent !text-inherit'
|
||||||
|
: ''
|
||||||
|
: ''}"
|
||||||
type={submit ? 'submit' : 'button'}
|
type={submit ? 'submit' : 'button'}
|
||||||
>
|
>
|
||||||
<div
|
<div
|
||||||
@@ -156,16 +161,7 @@
|
|||||||
: 'flex-row items-center'} h-full gap-1.5 {buttonAlignment[alignment]}"
|
: 'flex-row items-center'} h-full gap-1.5 {buttonAlignment[alignment]}"
|
||||||
>
|
>
|
||||||
{#if loading}
|
{#if loading}
|
||||||
<Spinner
|
<Spinner width={loaderWidth ?? 16}
|
||||||
width={loaderWidth
|
|
||||||
? loaderWidth
|
|
||||||
: size == 'lg'
|
|
||||||
? 18
|
|
||||||
: size == 'md'
|
|
||||||
? 16
|
|
||||||
: size == 'sm'
|
|
||||||
? 14
|
|
||||||
: 14}
|
|
||||||
/>
|
/>
|
||||||
{:else if $$slots.prefix}
|
{:else if $$slots.prefix}
|
||||||
<slot name="prefix" />
|
<slot name="prefix" />
|
||||||
|
|||||||
@@ -10,7 +10,7 @@
|
|||||||
medium: 'shadow-sm',
|
medium: 'shadow-sm',
|
||||||
high: 'shadow-md',
|
high: 'shadow-md',
|
||||||
xhigh: 'shadow-lg',
|
xhigh: 'shadow-lg',
|
||||||
max: 'shadow-xl'
|
max: 'shadow-xl',
|
||||||
}
|
}
|
||||||
|
|
||||||
const paddingClass = {
|
const paddingClass = {
|
||||||
@@ -18,7 +18,7 @@
|
|||||||
sm: 'p-2',
|
sm: 'p-2',
|
||||||
md: 'p-4',
|
md: 'p-4',
|
||||||
lg: 'p-5',
|
lg: 'p-5',
|
||||||
xl: 'p-6'
|
xl: 'p-6',
|
||||||
}
|
}
|
||||||
|
|
||||||
const roundedClass = {
|
const roundedClass = {
|
||||||
@@ -28,7 +28,7 @@
|
|||||||
lg: 'rounded-lg',
|
lg: 'rounded-lg',
|
||||||
xl: 'rounded-xl',
|
xl: 'rounded-xl',
|
||||||
'2xl': 'rounded-2xl',
|
'2xl': 'rounded-2xl',
|
||||||
full: 'rounded-full'
|
full: 'rounded-full',
|
||||||
}
|
}
|
||||||
|
|
||||||
const colorClass = {
|
const colorClass = {
|
||||||
@@ -38,7 +38,9 @@
|
|||||||
'bg-white dark:bg-zinc-900 border border-slate-200 dark:border-zinc-800 border-b-slate-300 dark:border-t-zinc-700',
|
'bg-white dark:bg-zinc-900 border border-slate-200 dark:border-zinc-800 border-b-slate-300 dark:border-t-zinc-700',
|
||||||
transparent:
|
transparent:
|
||||||
'border border-slate-200 dark:border-zinc-900 border-b-slate-300 dark:border-t-zinc-800',
|
'border border-slate-200 dark:border-zinc-900 border-b-slate-300 dark:border-t-zinc-800',
|
||||||
none: ''
|
uniform:
|
||||||
|
'bg-white dark:bg-zinc-900 border border-slate-100 dark:border-zinc-800',
|
||||||
|
none: '',
|
||||||
}
|
}
|
||||||
|
|
||||||
export let elevation: Elevation = 'flat'
|
export let elevation: Elevation = 'flat'
|
||||||
|
|||||||
@@ -14,6 +14,7 @@
|
|||||||
|
|
||||||
export let openOnHover: boolean = false
|
export let openOnHover: boolean = false
|
||||||
export let open: boolean = false
|
export let open: boolean = false
|
||||||
|
export let manual: boolean = false
|
||||||
|
|
||||||
export let placement: Placement = 'bottom-start'
|
export let placement: Placement = 'bottom-start'
|
||||||
export let middleware: Middleware[] = [
|
export let middleware: Middleware[] = [
|
||||||
@@ -29,6 +30,7 @@
|
|||||||
{placement}
|
{placement}
|
||||||
{middleware}
|
{middleware}
|
||||||
{strategy}
|
{strategy}
|
||||||
|
{manual}
|
||||||
{...$$restProps}
|
{...$$restProps}
|
||||||
bind:open
|
bind:open
|
||||||
popoverClass="backdrop-blur-xl rounded-xl w-full max-w-[280px]"
|
popoverClass="backdrop-blur-xl rounded-xl w-full max-w-[280px]"
|
||||||
@@ -40,13 +42,12 @@
|
|||||||
class="w-full max-w-[280px] origin-top-left
|
class="w-full max-w-[280px] origin-top-left
|
||||||
max-h-[32rem] overflow-auto list-none shadow-lg rounded-xl"
|
max-h-[32rem] overflow-auto list-none shadow-lg rounded-xl"
|
||||||
>
|
>
|
||||||
<Material
|
<div
|
||||||
class="flex flex-col py-2 list-none bg-white/80 dark:bg-zinc-900/80 px-2 gap-px"
|
class="flex flex-col py-2 list-none bg-white/80 dark:bg-zinc-900/80 px-2 gap-px
|
||||||
color="distinct"
|
rounded-xl
|
||||||
padding="none"
|
border border-slate-200 dark:border-zinc-800 border-opacity-50"
|
||||||
rounding="xl"
|
|
||||||
>
|
>
|
||||||
<slot />
|
<slot />
|
||||||
</Material>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</Popover>
|
</Popover>
|
||||||
@@ -68,7 +68,7 @@
|
|||||||
on:click={(e) => {
|
on:click={(e) => {
|
||||||
if (openOnHover) return
|
if (openOnHover) return
|
||||||
|
|
||||||
if (!el?.contains(e.target)) {
|
if (!el?.contains(e.target) && open) {
|
||||||
open = false
|
open = false
|
||||||
}
|
}
|
||||||
}}
|
}}
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { Spinner } from '../index.js'
|
import { Spinner } from '../index.js'
|
||||||
import { backOut } from 'svelte/easing'
|
import { backOut, expoOut } from 'svelte/easing'
|
||||||
import { type Toast, toasts, toastColors } from './toasts.js'
|
import { type Toast, toasts, toastColors } from './toasts.js'
|
||||||
import {
|
import {
|
||||||
InformationCircle,
|
InformationCircle,
|
||||||
@@ -19,11 +19,12 @@
|
|||||||
<div
|
<div
|
||||||
class="{toastColors[
|
class="{toastColors[
|
||||||
toast.type
|
toast.type
|
||||||
]} relative w-80 rounded-lg overflow-hidden flex flex-row items-center"
|
]} relative w-80 rounded-xl overflow-hidden flex flex-row items-center"
|
||||||
transition:fly={{
|
transition:fly={{
|
||||||
duration: 300,
|
duration: 600,
|
||||||
y: 8,
|
y: 8,
|
||||||
opacity: 0,
|
opacity: 0,
|
||||||
|
easing: expoOut,
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{#if toast.loading}
|
{#if toast.loading}
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
import Toast from './Toast.svelte'
|
import Toast from './Toast.svelte'
|
||||||
import { flip } from 'svelte/animate'
|
import { flip } from 'svelte/animate'
|
||||||
import { toasts } from './toasts.js'
|
import { toasts } from './toasts.js'
|
||||||
import { backInOut, backOut } from 'svelte/easing'
|
import { backInOut, backOut, expoOut } from 'svelte/easing'
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<div
|
<div
|
||||||
@@ -11,7 +11,7 @@
|
|||||||
>
|
>
|
||||||
{#each $toasts as toast, index (toast.id)}
|
{#each $toasts as toast, index (toast.id)}
|
||||||
<div
|
<div
|
||||||
animate:flip={{ duration: 500, easing: backOut }}
|
animate:flip={{ duration: 500, easing: expoOut }}
|
||||||
class="pointer-events-auto transition-all
|
class="pointer-events-auto transition-all
|
||||||
duration-300"
|
duration-300"
|
||||||
>
|
>
|
||||||
|
|||||||
Reference in new issue
Block a user