You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
|
|
<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 './select.css';
|
|
|
|
|
import { ActiveEidos } from '$uix/eidos';
|
|
|
|
|
import * as Select from '$soma/components/select';
|
|
|
|
|
import { setSelectVisualContext } from './context.svelte';
|
|
|
|
|
import type { SelectProps } from './types';
|
|
|
|
|
|
|
|
|
|
let {
|
|
|
|
|
size = 'md',
|
|
|
|
|
variant = 'surface',
|
|
|
|
|
color = 'primary',
|
|
|
|
|
value = $bindable([]),
|
|
|
|
|
open = $bindable(false),
|
|
|
|
|
children,
|
|
|
|
|
...rest
|
|
|
|
|
}: SelectProps = $props();
|
|
|
|
|
|
|
|
|
|
const eidos = ActiveEidos.require();
|
|
|
|
|
const resolvedSize = $derived(eidos.resolve(size, 'md'));
|
|
|
|
|
|
|
|
|
|
setSelectVisualContext({
|
|
|
|
|
getSize: () => resolvedSize,
|
|
|
|
|
getVariant: () => variant,
|
|
|
|
|
getColor: () => color
|
|
|
|
|
});
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
<Select.Provider
|
|
|
|
|
{...rest}
|
|
|
|
|
bind:value
|
|
|
|
|
bind:open
|
|
|
|
|
data-size={resolvedSize}
|
|
|
|
|
data-variant={variant}
|
|
|
|
|
data-color={color}
|
|
|
|
|
>
|
|
|
|
|
{@render children?.()}
|
|
|
|
|
</Select.Provider>
|