From d0111ff18f1817162f80cb1853c6666bc9a7a5a0 Mon Sep 17 00:00:00 2001 From: "Thomas G. Lopes" <26071571+TGlide@users.noreply.github.com> Date: Mon, 22 Apr 2024 13:28:31 +0100 Subject: [PATCH 1/2] fix lint --- .../functions/useActiveElement/useActiveElement.svelte.ts | 5 ++--- .../lib/functions/useElementSize/useElementSize.svelte.ts | 8 +++----- sites/docs/content/functions/use-active-element.md | 4 ++-- .../docs/src/lib/components/demos/use-element-size.svelte | 2 +- .../lib/components/layout/mobile-nav/mobile-nav.svelte | 2 +- sites/docs/src/lib/components/ui/skeleton/skeleton.svelte | 2 +- sites/docs/src/lib/components/ui/textarea/textarea.svelte | 2 +- 7 files changed, 11 insertions(+), 14 deletions(-) diff --git a/packages/runed/src/lib/functions/useActiveElement/useActiveElement.svelte.ts b/packages/runed/src/lib/functions/useActiveElement/useActiveElement.svelte.ts index f463a411..3e083675 100644 --- a/packages/runed/src/lib/functions/useActiveElement/useActiveElement.svelte.ts +++ b/packages/runed/src/lib/functions/useActiveElement/useActiveElement.svelte.ts @@ -1,12 +1,11 @@ import { isBrowser } from "$lib/internal/utils/browser.js"; - /** * Returns a reactive value that is equal to `document.activeElement`. * It automatically listens for changes, keeping the reference up to date. * - * @export - * @returns {{ value: Readonly }} + * @returns an object with a reactive value `value` that is equal to `document.activeElement`, or `null` + * if there's no active element. */ export function useActiveElement(): { value: Readonly } { const activeElement = $state({ value: isBrowser() ? document.activeElement : null }); diff --git a/packages/runed/src/lib/functions/useElementSize/useElementSize.svelte.ts b/packages/runed/src/lib/functions/useElementSize/useElementSize.svelte.ts index 566b9f8b..1901f330 100644 --- a/packages/runed/src/lib/functions/useElementSize/useElementSize.svelte.ts +++ b/packages/runed/src/lib/functions/useElementSize/useElementSize.svelte.ts @@ -9,15 +9,13 @@ type Options = { box?: "content-box" | "border-box"; }; - - /** * Returns a reactive value holding the size of `node`. - * + * * Accepts an `options` object with the following properties: * - `initialSize`: The initial size of the element. Defaults to `{ width: 0, height: 0 }`. * - `box`: The box model to use. Can be either `"content-box"` or `"border-box"`. Defaults to `"border-box"`. - * + * * @returns an object with `width` and `height` properties. */ export function useElementSize( @@ -25,7 +23,7 @@ export function useElementSize( options: Options = { box: "border-box", } -): { width: number; height: number; } { +): { width: number; height: number } { const node = boxed(_node); const size = $state({ width: options.initialSize?.width ?? 0, diff --git a/sites/docs/content/functions/use-active-element.md b/sites/docs/content/functions/use-active-element.md index 4a7949f1..133e0c4d 100644 --- a/sites/docs/content/functions/use-active-element.md +++ b/sites/docs/content/functions/use-active-element.md @@ -21,7 +21,7 @@ import { UseActiveElementDemo } from '$lib/components/demos';

- Currently active element: - {activeElement.value?.localName ?? 'No active element found'} + Currently active element: + {activeElement.value?.localName ?? "No active element found"}

``` diff --git a/sites/docs/src/lib/components/demos/use-element-size.svelte b/sites/docs/src/lib/components/demos/use-element-size.svelte index 94cb28a2..ace772b8 100644 --- a/sites/docs/src/lib/components/demos/use-element-size.svelte +++ b/sites/docs/src/lib/components/demos/use-element-size.svelte @@ -11,5 +11,5 @@ bind:this={el} class="h-[200px] min-h-[100px] w-[300px] min-w-[200px] resize rounded-md bg-muted p-4" value={text} - /> + > diff --git a/sites/docs/src/lib/components/layout/mobile-nav/mobile-nav.svelte b/sites/docs/src/lib/components/layout/mobile-nav/mobile-nav.svelte index 93a86410..1b14b919 100644 --- a/sites/docs/src/lib/components/layout/mobile-nav/mobile-nav.svelte +++ b/sites/docs/src/lib/components/layout/mobile-nav/mobile-nav.svelte @@ -22,7 +22,7 @@ class="fixed bottom-0 left-0 right-0 z-[70] mt-24 flex max-h-[96%] flex-col rounded-t-[10px] bg-background" >
-
+
Navigation