cleans up children snippet
This commit is contained in:
parent
72d26e2573
commit
ad707fdfe0
2 changed files with 7 additions and 6 deletions
|
|
@ -6,16 +6,17 @@
|
||||||
* Whether to wrap the graphic with an aria hidden tag.
|
* Whether to wrap the graphic with an aria hidden tag.
|
||||||
*/
|
*/
|
||||||
hidden?: boolean;
|
hidden?: boolean;
|
||||||
|
/** Content to put inside `AriaHidden`*/
|
||||||
children: Snippet;
|
children: Snippet;
|
||||||
}
|
}
|
||||||
|
|
||||||
let { hidden = false, children }: Props = $props();
|
let { hidden = false, children }: Props = $props();
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
{#if hidden && children}
|
{#if hidden}
|
||||||
<div aria-hidden="true">
|
<div aria-hidden="true">
|
||||||
{@render children()}
|
{@render children()}
|
||||||
</div>
|
</div>
|
||||||
{:else if children}
|
{:else}
|
||||||
{@render children()}
|
{@render children()}
|
||||||
{/if}
|
{/if}
|
||||||
|
|
|
||||||
|
|
@ -6,17 +6,17 @@
|
||||||
interface Props {
|
interface Props {
|
||||||
/** Width of the component within the text well. */
|
/** Width of the component within the text well. */
|
||||||
width?: ContainerWidth;
|
width?: ContainerWidth;
|
||||||
// children?: import('svelte').Snippet;
|
/** Content to put inside `TextBlock`*/
|
||||||
children?: Snippet;
|
children: Snippet;
|
||||||
}
|
}
|
||||||
|
|
||||||
let { width, children }: Props = $props();
|
let { width, children }: Props = $props();
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
{#if width && children}
|
{#if width}
|
||||||
<Block {width} class="notes fmy-0">
|
<Block {width} class="notes fmy-0">
|
||||||
{@render children()}
|
{@render children()}
|
||||||
</Block>
|
</Block>
|
||||||
{:else if children}
|
{:else}
|
||||||
{@render children()}
|
{@render children()}
|
||||||
{/if}
|
{/if}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue