ColorField: shared color-input primitive, Theme Builder + Chart Builder migration

This commit is contained in:
2026-06-14 11:02:20 +03:00
parent 236b1c8a37
commit df6a0b3845
8 changed files with 240 additions and 114 deletions
+5 -4
View File
@@ -76,6 +76,7 @@ import {
} from '../stores/ChartBuilderStore';
import { SegmentedControl, type SegmentedOption } from './SegmentedControl';
import { Button } from './Button';
import { ColorField } from './ColorField';
import { IconButton } from './IconButton';
import { SelectControl } from './SelectControl';
import { Icon } from './Icon';
@@ -310,12 +311,12 @@ function ChannelPill({
<div className={`${styles.pill} ${styles.pillConst}`}>
<span className={styles.pillTag}>value</span>
{isColor ? (
<input
type="color"
<ColorField
size="sm"
className={styles.constColor}
aria-label={`${CHANNEL_LABELS[channel]} constant colour`}
label={`${CHANNEL_LABELS[channel]} constant colour`}
value={typeof mapping.value === 'string' ? mapping.value : '#000000'}
onChange={(e) => setChannelConstant(channel, e.target.value)}
onChange={(v) => setChannelConstant(channel, v)}
/>
) : (
<input