Merge remote-tracking branch 'origin/main' into react/collections

; Conflicts:
;	pnpm-lock.yaml
This commit is contained in:
Elian Doran
2025-09-12 13:58:00 +03:00
46 changed files with 2336 additions and 1908 deletions

View File

@@ -22,7 +22,6 @@ const FormCheckbox = memo(({ name, disabled, label, currentValue, onChange, hint
const labelRef = useRef<HTMLLabelElement>(null);
const id = useUniqueName(name);
// Fix: Move useEffect outside conditional
useEffect(() => {
if (!hint || !labelRef.current) return;
@@ -34,22 +33,19 @@ const FormCheckbox = memo(({ name, disabled, label, currentValue, onChange, hint
return () => tooltipInstance?.dispose();
}, [hint]); // Proper dependency
// Memoize style object
const labelStyle = useMemo(() =>
hint ? { textDecoration: "underline dotted var(--main-text-color)" } : undefined,
[hint]
);
// Memoize onChange handler
const handleChange = useCallback((e: Event) => {
onChange((e.target as HTMLInputElement).checked);
}, [onChange]);
// Memoize title attribute
const titleText = useMemo(() => hint ? escapeQuotes(hint) : undefined, [hint]);
return (
<div className="form-checkbox" style={containerStyle}>
<div className={`form-checkbox ${disabled ? "disabled" : ""}`} style={containerStyle}>
<label
className="form-check-label tn-checkbox"
style={labelStyle}