This commit is contained in:
eewing
2026-02-17 14:10:16 -06:00
parent 2bca5834c5
commit cf73cd3b4c
11246 changed files with 1690552 additions and 0 deletions
+2
View File
@@ -0,0 +1,2 @@
export { default as VisuallyHidden } from "./visually-hidden.svelte";
export type * from "./types.js";
+1
View File
@@ -0,0 +1 @@
export { default as VisuallyHidden } from "./visually-hidden.svelte";
+3
View File
@@ -0,0 +1,3 @@
import type { WithChild } from "../../../internal/types.js";
import type { BitsPrimitiveSpanAttributes } from "../../../shared/attributes.js";
export type VisuallyHiddenProps = WithChild<BitsPrimitiveSpanAttributes>;
+1
View File
@@ -0,0 +1 @@
export {};
@@ -0,0 +1,31 @@
<script lang="ts">
import { mergeProps } from "svelte-toolbelt";
import type { VisuallyHiddenProps } from "./types.js";
import type { StyleProperties } from "../../../shared/index.js";
let { children, child, ...restProps }: VisuallyHiddenProps = $props();
const style: StyleProperties = {
position: "absolute",
border: 0,
width: "1px",
display: "inline-block",
height: "1px",
padding: 0,
margin: "-1px",
overflow: "hidden",
clip: "rect(0 0 0 0)",
whiteSpace: "nowrap",
wordWrap: "normal",
};
const mergedProps = $derived(mergeProps(restProps, { style }));
</script>
{#if child}
{@render child({ props: mergedProps })}
{:else}
<span {...mergedProps}>
{@render children?.()}
</span>
{/if}
@@ -0,0 +1,4 @@
import type { VisuallyHiddenProps } from "./types.js";
declare const VisuallyHidden: import("svelte").Component<VisuallyHiddenProps, {}, "">;
type VisuallyHidden = ReturnType<typeof VisuallyHidden>;
export default VisuallyHidden;