diff --git a/src/components/editor/ColorPicker.tsx b/src/components/editor/ColorPicker.tsx index e88d89d..413e82a 100644 --- a/src/components/editor/ColorPicker.tsx +++ b/src/components/editor/ColorPicker.tsx @@ -1,3 +1,5 @@ +import { useId } from 'react'; + interface ColorPickerProps { label: string; value: string; @@ -5,20 +7,30 @@ interface ColorPickerProps { } export function ColorPicker({ label, value, onChange }: ColorPickerProps) { + const id = useId(); + const colorId = `${id}-color`; + const hexId = `${id}-hex`; const displayValue = value.startsWith('#') ? value : `#${value}`; return (
- + +
onChange(e.target.value)} /> + onChange(e.target.value)} diff --git a/src/components/editor/FontSelector.tsx b/src/components/editor/FontSelector.tsx index 4aa2d2f..17dd912 100644 --- a/src/components/editor/FontSelector.tsx +++ b/src/components/editor/FontSelector.tsx @@ -1,3 +1,5 @@ +import { useId } from 'react'; + interface FontSelectorProps { label: string; value: string; @@ -12,12 +14,17 @@ const defaultFontOptions = [ ]; export function FontSelector({ label, value, onChange, options }: FontSelectorProps) { + const id = useId(); const opts = options || defaultFontOptions; return (
- + + onChange(e.target.value)} placeholder="Image URL or upload..." /> -
); diff --git a/src/components/editor/SliderControl.tsx b/src/components/editor/SliderControl.tsx index 09cb0a2..44890fc 100644 --- a/src/components/editor/SliderControl.tsx +++ b/src/components/editor/SliderControl.tsx @@ -1,3 +1,5 @@ +import { useId } from 'react'; + interface SliderControlProps { label: string; value: number; @@ -7,13 +9,19 @@ interface SliderControlProps { } export function SliderControl({ label, value, onChange, min = 0, max = 100 }: SliderControlProps) { + const id = useId(); + return (
- + {value}
+ - + + {label} + +