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.
33 lines
762 B
33 lines
762 B
<script lang="ts">
|
|
import './css-field.css';
|
|
import { ActiveEidos } from '$uix/eidos';
|
|
/**
|
|
* Eidos `<CssField>` — visual wrapper over Soma's CSS-value spinbutton.
|
|
* Soma owns parsing, validation, min/max, scrub and keyboard behavior.
|
|
*/
|
|
import * as CssField from '$soma/components/css-field';
|
|
import type { CssFieldProps } from './types';
|
|
|
|
let {
|
|
size = 'md',
|
|
variant = 'surface',
|
|
color = 'primary',
|
|
value = $bindable(),
|
|
children,
|
|
...rest
|
|
}: CssFieldProps = $props();
|
|
|
|
const eidos = ActiveEidos.require();
|
|
const resolvedSize = $derived(eidos.resolve(size, 'md'));
|
|
</script>
|
|
|
|
<CssField.Provider
|
|
{...rest}
|
|
bind:value
|
|
data-size={resolvedSize}
|
|
data-variant={variant}
|
|
data-color={color}
|
|
>
|
|
{@render children?.()}
|
|
</CssField.Provider>
|