diff --git a/src/lib/components/ui/breadcrumb/breadcrumb-ellipsis.svelte b/src/lib/components/ui/breadcrumb/breadcrumb-ellipsis.svelte index 135c40f6..f40df5be 100644 --- a/src/lib/components/ui/breadcrumb/breadcrumb-ellipsis.svelte +++ b/src/lib/components/ui/breadcrumb/breadcrumb-ellipsis.svelte @@ -1,5 +1,5 @@ - +{#if type === 'file'} + +{:else} + +{/if} diff --git a/src/lib/components/ui/select/select-item.svelte b/src/lib/components/ui/select/select-item.svelte index e75e8472..cb2a82f8 100644 --- a/src/lib/components/ui/select/select-item.svelte +++ b/src/lib/components/ui/select/select-item.svelte @@ -1,5 +1,5 @@ = T & { - currentTarget: EventTarget & HTMLTextAreaElement; -}; - -type TextareaEvents = { - blur: FormTextareaEvent; - change: FormTextareaEvent; - click: FormTextareaEvent; - focus: FormTextareaEvent; - keydown: FormTextareaEvent; - keypress: FormTextareaEvent; - keyup: FormTextareaEvent; - mouseover: FormTextareaEvent; - mouseenter: FormTextareaEvent; - mouseleave: FormTextareaEvent; - paste: FormTextareaEvent; - input: FormTextareaEvent; -}; - export { Root, // - Root as Textarea, - type TextareaEvents, - type FormTextareaEvent + Root as Textarea }; diff --git a/src/lib/hooks/is-mobile.svelte.ts b/src/lib/hooks/is-mobile.svelte.ts index a957a64f..0f1afe95 100644 --- a/src/lib/hooks/is-mobile.svelte.ts +++ b/src/lib/hooks/is-mobile.svelte.ts @@ -1,27 +1,9 @@ -import { untrack } from 'svelte'; +import { MediaQuery } from 'svelte/reactivity'; const MOBILE_BREAKPOINT = 768; -export class IsMobile { - #current = $state(false); - +export class IsMobile extends MediaQuery { constructor() { - $effect(() => { - return untrack(() => { - const mql = window.matchMedia(`(max-width: ${MOBILE_BREAKPOINT - 1}px)`); - const onChange = () => { - this.#current = window.innerWidth < MOBILE_BREAKPOINT; - }; - mql.addEventListener('change', onChange); - onChange(); - return () => { - mql.removeEventListener('change', onChange); - }; - }); - }); - } - - get current() { - return this.#current; + super(`max-width: ${MOBILE_BREAKPOINT - 1}px`); } }