diff --git a/modules/ppcp-settings/resources/css/components/reusable-components/_payment-method-item.scss b/modules/ppcp-settings/resources/css/components/reusable-components/_payment-method-item.scss index c1afcb4e8..729eb94f4 100644 --- a/modules/ppcp-settings/resources/css/components/reusable-components/_payment-method-item.scss +++ b/modules/ppcp-settings/resources/css/components/reusable-components/_payment-method-item.scss @@ -82,3 +82,82 @@ } } } + +// Disabled state styling +.ppcp--method-item--disabled { + position: relative; + + // Apply grayscale and disable interactions + .ppcp--method-inner { + opacity: 0.65; + filter: grayscale(0.9); + pointer-events: none; + transition: filter 0.2s ease; + } + + // Override text colors + .ppcp--method-title { + color: $color-gray-600 !important; + } + + .ppcp--method-description p { + color: $color-gray-500 !important; + } + + .ppcp--method-disabled-message { + opacity: 0; + transform: translateY(-5px); + transition: opacity 0.2s ease, transform 0.2s ease; + } + + // Style all buttons and toggle controls + .components-button, + .components-form-toggle { + opacity: 0.5; + } + + // Hover state - only blur the inner content + &:hover { + .ppcp--method-inner { + filter: blur(2px) grayscale(0.9); + } + + .ppcp--method-disabled-message { + opacity: 1; + transform: translateY(0); + } + } +} + +// Disabled overlay +.ppcp--method-disabled-overlay { + position: absolute; + top: 0; + left: 0; + right: 0; + bottom: 0; + background: rgba($color-white, 0.4); + display: flex; + align-items: center; + justify-content: center; + z-index: 50; + border-radius: var(--container-border-radius); + pointer-events: auto; + opacity: 0; + transition: opacity 0.2s ease; +} + +.ppcp--method-item--disabled:hover .ppcp--method-disabled-overlay { + opacity: 1; +} + +.ppcp--method-disabled-message { + padding: 14px 18px; + max-width: 80%; + text-align: center; + @include font(13, 20, 500); + color: $color-text-tertiary; + position: relative; + z-index: 51; + border: none; +} diff --git a/modules/ppcp-settings/resources/js/Components/ReusableComponents/SettingsBlocks/PaymentMethodItemBlock.js b/modules/ppcp-settings/resources/js/Components/ReusableComponents/SettingsBlocks/PaymentMethodItemBlock.js index f2e915dbd..dc26260f7 100644 --- a/modules/ppcp-settings/resources/js/Components/ReusableComponents/SettingsBlocks/PaymentMethodItemBlock.js +++ b/modules/ppcp-settings/resources/js/Components/ReusableComponents/SettingsBlocks/PaymentMethodItemBlock.js @@ -11,6 +11,8 @@ const PaymentMethodItemBlock = ( { onTriggerModal, onSelect, isSelected, + isDisabled, + disabledMessage, } ) => { const { activeHighlight, setActiveHighlight } = useActiveHighlight(); const isHighlighted = activeHighlight === paymentMethod.id; @@ -31,9 +33,16 @@ const PaymentMethodItemBlock = ( { id={ paymentMethod.id } className={ `ppcp--method-item ${ isHighlighted ? 'ppcp-highlight' : '' - }` } + } ${ isDisabled ? 'ppcp--method-item--disabled' : '' }` } separatorAndGap={ false } > + { isDisabled && ( +
+ { disabledMessage } +
+