( Object.assign(incomingComponentProps, applySxAncestorPassingProps); Object.assign(incomingComponentProps, componentProps); - Object.assign(themeDefaultProps, incomingComponentProps); + const { + variantProps: defaultVariantProps, + restProps: defaultComponentPropsWithoutVariants, + } = getVariantProps(themeDefaultProps, theme); + + const { + variantProps: inlineVariantProps, + restProps: inlineComponentPropsWithoutVariants, + } = getVariantProps(incomingComponentProps, theme); - const { variantProps, restProps: componentPropsWithoutVariants } = - getVariantProps(themeDefaultProps, theme); + const variantProps = Object.assign(defaultVariantProps, inlineVariantProps); const { baseStyleCSSIds: applyBaseStyleCSSIds, @@ -1309,10 +1316,17 @@ export function verboseStyled
( // 520ms // Inline prop based style resolution TODO: Diagram insertion - const resolvedInlineProps = resolveInlineProps( + const defaultResolvedInlineProps = resolveInlineProps( componentStyleConfig, componentExtendedConfig, - componentPropsWithoutVariants, + defaultComponentPropsWithoutVariants, + CONFIG + ); + + const inlineResolvedInlineProps = resolveInlineProps( + componentStyleConfig, + componentExtendedConfig, + inlineComponentPropsWithoutVariants, CONFIG ); @@ -1325,7 +1339,10 @@ export function verboseStyled
( const { sx: filteredComponentSx, rest: filteredComponentRemainingProps } = convertUtiltiyToSXFromProps( - componentPropsWithoutVariants, + Object.assign( + defaultComponentPropsWithoutVariants, + inlineComponentPropsWithoutVariants + ), styledSystemProps, componentStyleConfig ); @@ -1339,7 +1356,9 @@ export function verboseStyled
( let containsSX = false; Object.assign(applyComponentInlineProps, filteredPassingRemainingProps); - Object.assign(applyComponentInlineProps, resolvedInlineProps); + Object.assign(applyComponentInlineProps, defaultResolvedInlineProps); + + Object.assign(applyComponentInlineProps, inlineResolvedInlineProps); Object.assign(applyComponentInlineProps, filteredComponentRemainingProps); if ( @@ -1552,6 +1571,21 @@ export function verboseStyled
( CONFIG ); + // if (componentName === 'Switch') { + // console.log( + // // passingPropsUpdated, + // // resolvedPassingRemainingProps, + // resolvedInlineProps, + // // componentStyleConfig, + // '>>>>>>' + // ); + // } + + // Object.assign(applyComponentInlineProps, defaultResolvedInlineProps); + // Object.assign(applyComponentInlineProps, filteredPassingRemainingProps); + // Object.assign(applyComponentInlineProps, defaultInlineResolvedInlineProps); + // Object.assign(applyComponentInlineProps, filteredComponentRemainingProps); + Object.assign( applyComponentInlineProps, filteredPassingRemainingPropsUpdated @@ -1559,7 +1593,7 @@ export function verboseStyled
( Object.assign(applyComponentInlineProps, resolvedPassingRemainingProps); - Object.assign(applyComponentInlineProps, resolvedInlineProps); + Object.assign(applyComponentInlineProps, inlineResolvedInlineProps); Object.assign( applyComponentInlineProps, @@ -1782,10 +1816,10 @@ export function verboseStyled
( ...applySxStateBaseStyleCSSIds.current, ]; - Object.assign(resolvedInlineProps, applyComponentInlineProps); + // Object.assign(resolvedInlineProps, applyComponentInlineProps); const resolvedStyleProps = generateStylePropsFromCSSIds( - resolvedInlineProps, + applyComponentInlineProps, styleCSSIds, CONFIG, activeTheme