Update props in components pass 2

This commit is contained in:
adilallo
2026-02-06 17:46:07 -07:00
parent 1ca11a2229
commit af0888798f
11 changed files with 145 additions and 14 deletions
@@ -8,16 +8,23 @@ import { normalizeState } from "../../../../lib/propNormalization";
const SwitchContainer = memo(
forwardRef<HTMLButtonElement, SwitchProps>((props, ref) => {
const {
checked = false,
checked: checkedProp,
propSwitch: propSwitchProp,
onChange,
onFocus,
onBlur,
state: stateProp = "default",
label,
label: labelProp,
text: textProp,
className = "",
...rest
} = props;
// Backward compatibility: use propSwitch if provided, otherwise use checked
const checked = propSwitchProp !== undefined ? propSwitchProp : (checkedProp !== undefined ? checkedProp : false);
// Backward compatibility: use text if provided, otherwise use label
const label = textProp !== undefined ? textProp : labelProp;
// Normalize props to handle both PascalCase (Figma) and lowercase (codebase)
const state = normalizeState(stateProp);