El accent (regla del header, focus ring, grip de resize) pasa de 8 bloques per-rol al forward compartido en la parte `content` (el panel portala y estampa su propio `data-color` via ctx). El default real NO era el "fantasma" que temia el handoff: la recipe SI tiene `accent: neutral-border` y el root siempre estampa `color='neutral'` por defecto → estampa-siempre + regla generica es fiel (host del forward = neutral-border, el valor del default). El fallback sin-ctx (`var(--float-panel-accent)`) queda intacto. Tipos: `FloatPanelColor = ComponentColorProp` (era ColorRole); el Content resuelve via resolveComponentColor con seed `--color-custom` para raw values. Verificado en Chrome: default neutral = probe exacto; threat/iris = token compartido; sin estampa → fallback neutral-border; custom → color-mix del seed. Contract test sin fallos nuevos. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>alpha-0.1-sec-dom
parent
c9db0a8d26
commit
18026dfd84
@ -1,18 +1,28 @@
|
||||
<script lang="ts">
|
||||
import * as FloatPanel from '$soma/components/float-panel';
|
||||
import { composeInlineStyle } from '$uix/eidos/lib/style';
|
||||
import { resolveComponentColor } from '$uix/eidos/lib/component-color';
|
||||
import { getFloatPanelCtx } from './context';
|
||||
import type { FloatPanelContentProps } from './types';
|
||||
|
||||
let { motion = 'scale-fade', children, ...rest }: FloatPanelContentProps = $props();
|
||||
let { motion = 'scale-fade', style, children, ...rest }: FloatPanelContentProps = $props();
|
||||
const ctx = getFloatPanelCtx();
|
||||
|
||||
// `color` accepts the full system: canonical → `data-color`, raw value →
|
||||
// `data-color-custom` + the `--color-custom` seed. Without a root ctx
|
||||
// nothing stamps and the base no-accent fallback applies, as before.
|
||||
const colorAttrs = $derived(resolveComponentColor(ctx?.color));
|
||||
const mergedStyle = $derived(composeInlineStyle(style, colorAttrs.customStyle));
|
||||
</script>
|
||||
|
||||
<FloatPanel.Content
|
||||
{...rest}
|
||||
data-variant={ctx?.variant}
|
||||
data-color={ctx?.color}
|
||||
data-color={colorAttrs.dataColor}
|
||||
data-color-custom={colorAttrs.isCustom ? '' : undefined}
|
||||
data-depth="overlay"
|
||||
data-animation-style={motion === 'none' ? undefined : motion}
|
||||
style={mergedStyle}
|
||||
>
|
||||
{@render children?.()}
|
||||
</FloatPanel.Content>
|
||||
|
||||
Loading…
Reference in new issue