Primer remate de v2 (elegido por el usuario). chat-typing gana una parte opcional `Avatars`: un slot antes de los dots donde la app compone `AvatarGroup` / `Avatar` para quienes escriben. Decorativo (aria-hidden: la label ya los nombra). Morfo part + soma provider/wrapper + eidos wrapper/recipe (layout mínimo; el AvatarGroup ya apila) + demo con toggle. Verificado (Playwright): slot presente con 2 avatares al activar 2 typers, aria-hidden, antes de los dots; ausente en idle; toggle off = solo dots. component:audit PASS, eidos-lint invalid=0, check en baseline (76). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>alpha-0.1-sec-dom
parent
5773ee6073
commit
3f3658da96
@ -0,0 +1,10 @@
|
||||
<script lang="ts">
|
||||
import * as ChatTyping from '$soma/components/chat-typing';
|
||||
import type { ChatTypingAvatarsProps } from './types';
|
||||
|
||||
let { children, ...rest }: ChatTypingAvatarsProps = $props();
|
||||
</script>
|
||||
|
||||
<ChatTyping.Avatars {...rest}>
|
||||
{@render children?.()}
|
||||
</ChatTyping.Avatars>
|
||||
@ -0,0 +1,35 @@
|
||||
<script lang="ts">
|
||||
import { readableActive, writableActive } from '$libs/reactive';
|
||||
import { mergeProps } from '../../../props';
|
||||
import { createId } from '$active-uix/id';
|
||||
import { ChatTypingAvatarsProvider } from '../chat-typing-provider.svelte';
|
||||
import type { ChatTypingAvatarsProps } from '../types';
|
||||
|
||||
const uid = $props.id();
|
||||
|
||||
let {
|
||||
ref = $bindable(null),
|
||||
id = createId(uid, 'chat-typing-avatars'),
|
||||
children,
|
||||
child,
|
||||
...restProps
|
||||
}: ChatTypingAvatarsProps = $props();
|
||||
|
||||
const provider = ChatTypingAvatarsProvider.create({
|
||||
id: readableActive(() => id),
|
||||
ref: writableActive(
|
||||
() => ref,
|
||||
(v) => (ref = v)
|
||||
)
|
||||
});
|
||||
|
||||
const mergedProps = $derived(mergeProps(restProps, provider.props));
|
||||
</script>
|
||||
|
||||
{#if child}
|
||||
{@render child({ props: mergedProps })}
|
||||
{:else}
|
||||
<span {...mergedProps}>
|
||||
{@render children?.()}
|
||||
</span>
|
||||
{/if}
|
||||
Loading…
Reference in new issue