|
|
|
|
<script lang="ts">
|
perf(eidos): code-split 15 form-control recipes (Phase 3, batch 3)
field form number-field toggle toggle-group switch checkbox radio-group
rating-group search-field select combobox tags-input file-upload editable.
Caught + fixed a real coupling: toggle-group items are DOM-equivalent to
a standalone <Toggle> (carry data-toggle via the morfo, per the 2026-05-28
structural-identity refactor) and rely on toggle.css for their base
treatment — but the group never mounts an eidos <Toggle>. Without the
aggregate, items rendered as raw buttons (bg #f0f0f0, 2px outset border).
Fix: toggle-group.svelte imports toggle.css FIRST (before its own grouping
rules, so attached-corner overrides still win). Verified: item now bg
srgb(0.133), 1px border, font-weight 500, min-block-size 36px.
All recipes left the monolith (residual [data-*] are base.css token
contracts, verified base==monolith counts). Portaled select content
verified styled. index.css 51→36 @imports. Monolith 633,277→533,103 raw
(−100 KB) / 86,535→74,716 gz (−11.8 KB). check 0 errors.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
4 months ago
|
|
|
import './rating-group.css';
|
|
|
|
|
import { ActiveEidos } from '$uix/eidos';
|
|
|
|
|
/**
|
|
|
|
|
* Eidos `<RatingGroup>` — visual wrapper over Soma's rating primitive.
|
|
|
|
|
* Soma owns slider semantics, pointer preview and item state; Eidos adds `size`.
|
|
|
|
|
*/
|
|
|
|
|
import * as RatingGroup from '$soma/components/rating-group';
|
|
|
|
|
import type { RatingGroupProps } from './types';
|
|
|
|
|
|
|
|
|
|
let {
|
|
|
|
|
size = 'md',
|
|
|
|
|
value = $bindable(0),
|
|
|
|
|
children: bodyContent,
|
|
|
|
|
...rest
|
|
|
|
|
}: RatingGroupProps = $props();
|
|
|
|
|
|
|
|
|
|
const eidos = ActiveEidos.require();
|
|
|
|
|
const resolvedSize = $derived(eidos.resolve(size, 'md'));
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
<RatingGroup.Provider {...rest} bind:value data-size={resolvedSize}>
|
|
|
|
|
{#snippet children(snippetProps)}
|
|
|
|
|
{@render bodyContent?.(snippetProps)}
|
|
|
|
|
{/snippet}
|
|
|
|
|
</RatingGroup.Provider>
|