@automattic/newspack-blocks 2.4.0 → 2.5.0-alpha.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (32) hide show
  1. package/.cache/babel/02ad6a86292b6e33c821027a444c0a1a.json.gz +0 -0
  2. package/.cache/babel/18dda1142078f066419138e7284f03bf.json.gz +0 -0
  3. package/.cache/babel/f60f8c23ec2b4448cb2815d79207d8c0.json.gz +0 -0
  4. package/CHANGELOG.md +8 -0
  5. package/dist/donate/view.asset.php +1 -1
  6. package/dist/donate/view.css +1 -1
  7. package/dist/donate/view.rtl.css +1 -1
  8. package/dist/editor.asset.php +1 -1
  9. package/dist/editor.css +1 -1
  10. package/dist/editor.js +1 -1
  11. package/dist/editor.rtl.css +1 -1
  12. package/dist/frequencyBased.asset.php +1 -1
  13. package/dist/frequencyBased.css +1 -1
  14. package/dist/frequencyBased.js +1 -1
  15. package/dist/frequencyBased.rtl.css +1 -1
  16. package/newspack-blocks.php +2 -2
  17. package/package.json +1 -1
  18. package/src/blocks/donate/edit/FrequencyBasedLayout.tsx +27 -12
  19. package/src/blocks/donate/edit/index.tsx +21 -16
  20. package/src/blocks/donate/frequency-based/index.ts +82 -2
  21. package/src/blocks/donate/frequency-based/style.scss +35 -65
  22. package/src/blocks/donate/frontend/class-newspack-blocks-donate-renderer-frequency-based.php +56 -7
  23. package/src/blocks/donate/styles/editor.scss +1 -1
  24. package/src/blocks/donate/styles/style-variations.scss +72 -53
  25. package/src/blocks/donate/styles/view.scss +2 -1
  26. package/vendor/autoload.php +1 -1
  27. package/vendor/composer/autoload_real.php +4 -4
  28. package/vendor/composer/autoload_static.php +2 -2
  29. package/vendor/composer/installed.php +2 -2
  30. package/.cache/babel/1a4260339411b753b8516a4ddf857188.json.gz +0 -0
  31. package/.cache/babel/405a59e43e00b2c52dbadde7c6a04c87.json.gz +0 -0
  32. package/.cache/babel/429db10e32cec5144b0a70372ca4be2a.json.gz +0 -0
@@ -1 +1 @@
1
- <?php return array('dependencies' => array('wp-polyfill'), 'version' => 'e9ad0b5b5f7cb110d2da07d847723c6d');
1
+ <?php return array('dependencies' => array('wp-polyfill'), 'version' => '64db686390f39306203d8a619e6659de');
@@ -1 +1 @@
1
- .wpbnbd--frequency-based{background:#fff;border:1px solid #ccc;color:#111;position:relative;width:100%}.wpbnbd--frequency-based input[type=radio]{left:-99999em;position:absolute}.wpbnbd--frequency-based input[readonly]{background-color:#f1f1f1;color:#666}.wpbnbd--frequency-based .freq-label,.wpbnbd--frequency-based .input-container,.wpbnbd--frequency-based .tier-label{display:block;font-weight:700;cursor:pointer}.wpbnbd--frequency-based .freq-label{box-sizing:border-box;overflow:hidden;white-space:nowrap;width:100%;z-index:1}.wpbnbd--frequency-based .submit-button,.wpbnbd--frequency-based button{margin:0 .76rem .76rem}@media only screen and (min-width:782px){.wpbnbd--frequency-based .submit-button,.wpbnbd--frequency-based button{margin:0 1.5rem 1.5rem}}.wpbnbd--frequency-based label.wpbnbd__button{text-transform:uppercase}.wpbnbd--frequency-based .thanks{color:#767676;font-size:.8em;margin:.38rem .76rem .76rem;display:none}@media only screen and (min-width:600px){.wpbnbd--frequency-based .thanks{display:block}}@media only screen and (min-width:782px){.wpbnbd--frequency-based .thanks{margin-left:1.5rem;margin-right:1.5rem}}.wpbnbd.tiered .tiers{margin:.38rem;display:none;flex-wrap:wrap;position:relative}@media only screen and (min-width:782px){.wpbnbd.tiered .tiers{margin:1.12rem 1.12rem .38rem}}.wpbnbd.tiered .tiers .tier-label{border:1px solid #ccc;border-radius:5px;margin:.38rem;padding:.38rem .76rem}.wpbnbd.tiered .tiers .tier-label:hover{background:#f1f1f1}.wpbnbd.tiered .tiers input[type=radio]:focus+.tier-label{background:#f1f1f1;outline:1px dotted currentcolor;outline-offset:-4px}.wpbnbd.tiered .tiers input[type=radio]:checked+.tier-label{background-color:#757575;border-color:transparent;color:#fff}.wpbnbd.tiered .tiers .odl{font-weight:700;left:.38rem;position:absolute;bottom:calc(1.6em + 1.1rem + 2px)}.wpbnbd.tiered .tiers input.other-input~.money-input,.wpbnbd.tiered .tiers input.other-input~.odl{display:none}.wpbnbd.tiered .tiers input.other-input:checked~.money-input{display:flex}.wpbnbd.tiered .tiers input.other-input:checked~.odl{display:block}.wpbnbd.tiered .tiers input.other-input:checked+label{margin-bottom:calc(3.2em + 1.86rem + 2px)}.wpbnbd.tiered .money-input{bottom:.38rem;left:.38rem;position:absolute}.wpbnbd.untiered .input-container{margin:.76rem;display:none}@media only screen and (min-width:782px){.wpbnbd.untiered .input-container{margin:1.5rem 1.5rem .76rem}}.wpbnbd.untiered input[type=radio]:checked~.input-container{display:block}.wpbnbd .money-input{display:flex;align-items:center;position:relative;max-width:200px;background-color:#fff;border-radius:3px;border:1px solid #ccc}.wpbnbd .money-input[focus-within]{border-color:#111;outline:thin solid rgba(17,17,17,.15);outline-offset:-4px}.wpbnbd .money-input:focus-within{border-color:#111;outline:thin solid rgba(17,17,17,.15);outline-offset:-4px}.wpbnbd .money-input .currency{cursor:default;font-size:.8em;padding-left:.5em}.wpbnbd .money-input input[type=number]{background:none;max-width:174px}.wpbnbd .money-input input[type=number],.wpbnbd .money-input input[type=number]:focus{border:none;outline:none;box-shadow:none}.wpbnbd .frequencies{position:relative;font-size:.7em;padding-top:2.65em}@media only screen and (min-width:600px){.wpbnbd .frequencies{font-size:.8em}}.wpbnbd .frequency .freq-label{position:absolute;top:0;left:0;border-width:0 0 1px}.wpbnbd .frequency input[type=radio]:checked+.freq-label{color:inherit;border-bottom-color:transparent}.wpbnbd .frequency input[type=radio]:checked+.freq-label:hover{background:#fff}.wpbnbd .frequency input[type=radio]:checked~.tiers{display:flex}.wpbnbd .frequency input[type=radio]:focus+.freq-label{text-decoration:underline;-webkit-text-decoration-style:dotted;text-decoration-style:dotted;text-decoration-thickness:1px}.wpbnbd .frequency:nth-of-type(3) .freq-label{left:66.66%}.wpbnbd-frequencies--2.wpbnbd .frequency .freq-label{width:50%}.wpbnbd-frequencies--2.wpbnbd .frequency:nth-of-type(2) .freq-label{border-left-width:1px;left:50%;top:0}.wpbnbd-frequencies--3.wpbnbd .frequency .freq-label{width:33.33%}.wpbnbd-frequencies--3.wpbnbd .frequency:nth-of-type(2) .freq-label{border-left-width:1px;border-right-width:1px;left:33.33%;top:0}
1
+ .wpbnbd--frequency-based{background:#fff;border:1px solid #ccc;color:#111;position:relative;width:100%}.wpbnbd--frequency-based input[type=radio]{position:absolute;left:-99999em}.wpbnbd--frequency-based input[type=radio][name=donation_frequency],.wpbnbd--frequency-based input[type=radio][name=donation_frequency]+label{display:none}.wpbnbd--frequency-based input[readonly]{background-color:#f1f1f1;color:#666}.wpbnbd--frequency-based .freq-label,.wpbnbd--frequency-based .input-container,.wpbnbd--frequency-based .tier-label{display:block;font-weight:700;cursor:pointer}.wpbnbd--frequency-based .freq-label{box-sizing:border-box;overflow:hidden;white-space:nowrap;width:100%;z-index:1}.wpbnbd--frequency-based .submit-button,.wpbnbd--frequency-based button{margin:0 .76rem .76rem}@media only screen and (min-width:782px){.wpbnbd--frequency-based .submit-button,.wpbnbd--frequency-based button{margin:0 1.5rem 1.5rem}}.wpbnbd--frequency-based .submit-button:disabled,.wpbnbd--frequency-based button:disabled{opacity:.5}.wpbnbd--frequency-based .wpbnbd__button{font-size:16px;text-transform:uppercase}.wpbnbd--frequency-based .thanks{color:#767676;font-size:.8em;margin:.38rem .76rem .76rem;display:none}@media only screen and (min-width:600px){.wpbnbd--frequency-based .thanks{display:block}}@media only screen and (min-width:782px){.wpbnbd--frequency-based .thanks{margin-left:1.5rem;margin-right:1.5rem}}.wpbnbd.tiered .tiers{margin:.38rem;display:none;flex-wrap:wrap;position:relative}@media only screen and (min-width:782px){.wpbnbd.tiered .tiers{margin:1.12rem 1.12rem .38rem}}.wpbnbd.tiered .tiers .tier-label{border:1px solid #ccc;border-radius:5px;margin:.38rem;padding:.38rem .76rem}.wpbnbd.tiered .tiers .tier-label:hover{background:#f1f1f1}.wpbnbd.tiered .tiers input[type=radio]:focus+.tier-label{background:#f1f1f1;outline:1px dotted currentcolor;outline-offset:-4px}.wpbnbd.tiered .tiers input[type=radio]:checked+.tier-label{background-color:#757575;border-color:transparent;color:#fff}.wpbnbd.tiered .tiers .odl{font-weight:700;left:.38rem;position:absolute;bottom:calc(1.6em + 1.1rem + 2px)}.wpbnbd.tiered .tiers input.other-input~.money-input,.wpbnbd.tiered .tiers input.other-input~.odl{display:none}.wpbnbd.tiered .tiers input.other-input:checked~.money-input{display:flex}.wpbnbd.tiered .tiers input.other-input:checked~.odl{display:block}.wpbnbd.tiered .tiers input.other-input:checked+label{margin-bottom:calc(3.2em + 1.86rem + 2px)}.wpbnbd.tiered .money-input{bottom:.38rem;left:.38rem;position:absolute}.wpbnbd.untiered .input-container{margin:.76rem;display:none}@media only screen and (min-width:782px){.wpbnbd.untiered .input-container{margin:1.5rem 1.5rem .76rem}}.wpbnbd.untiered input[type=radio]:checked~.input-container{display:block}.wpbnbd .money-input{display:flex;align-items:center;position:relative;max-width:200px;background-color:#fff;border-radius:3px;border:1px solid #ccc}.wpbnbd .money-input[focus-within]{border-color:#111;outline:thin solid rgba(17,17,17,.15);outline-offset:-4px}.wpbnbd .money-input:focus-within{border-color:#111;outline:thin solid rgba(17,17,17,.15);outline-offset:-4px}.wpbnbd .money-input .currency{cursor:default;font-size:.8em;padding-left:.5em}.wpbnbd .money-input input[type=number]{background:none;max-width:174px}.wpbnbd .money-input input[type=number],.wpbnbd .money-input input[type=number]:focus{border:none;outline:none;box-shadow:none}.wpbnbd .frequencies{position:relative;font-size:.7em}@media only screen and (min-width:600px){.wpbnbd .frequencies{font-size:.8em}}.wpbnbd .frequency input[type=radio]:checked~.tiers,.wpbnbd .tab-container{display:flex}.wpbnbd .tab-container .freq-label{border-radius:0;margin:0}.wpbnbd .tab-container .freq-label.wpbnbd__button--active{color:#111}.wpbnbd .tab-container .freq-label:focus{outline:0;text-decoration:underline;-webkit-text-decoration-style:dotted;text-decoration-style:dotted;text-decoration-thickness:1px}
@@ -1 +1 @@
1
- (()=>{"use strict";var e={d:(t,n)=>{for(var r in n)e.o(n,r)&&!e.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:n[r]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r:e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},t={};e.r(t),e.d(t,{processFrequencyBasedElements:()=>o});var n,r=function(e){var t=e.querySelectorAll(".tiers");if(null!=t&&t.length){var n=e.querySelectorAll('input[name="donation_frequency"]');t.forEach((function(e){var t=e.querySelectorAll('input[type="radio"]'),r=e.querySelector(".money-input input");if(null!=t&&t.length&&r){var o=r.getAttribute("value"),u=function(){r.value=o||""};t.forEach((function(e){e.addEventListener("change",u)})),n.forEach((function(e){e.addEventListener("change",u)}))}}))}},o=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:document,t=e.querySelectorAll(".wpbnbd--frequency-based");t.forEach((function(e){r(e)}))};"undefined"!=typeof window&&(n=function(){return o()},"undefined"!=typeof document&&("complete"!==document.readyState&&"interactive"!==document.readyState?document.addEventListener("DOMContentLoaded",n):n()));var u=window;for(var a in t)u[a]=t[a];t.__esModule&&Object.defineProperty(u,"__esModule",{value:!0})})();
1
+ (()=>{"use strict";var e={d:(t,n)=>{for(var r in n)e.o(n,r)&&!e.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:n[r]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r:e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},t={};e.r(t),e.d(t,{processFrequencyBasedElements:()=>a});var n,r=function(e){var t=e.querySelectorAll(".tiers");if(null!=t&&t.length){var n=e.querySelectorAll('input[name="donation_frequency"]'),r=e.querySelector('button[type="submit"]');t.forEach((function(e){var t=e.querySelectorAll('input[type="radio"]'),o=e.querySelector(".money-input input");if(null!=t&&t.length&&o){var i=o.getAttribute("value"),a=function(){o.value=i||""},u=function(){var t=e.querySelector('input[type="radio"]:checked');t&&("other"!==t.value||o.value?null==r||r.removeAttribute("disabled"):null==r||r.setAttribute("disabled","disabled"))};o.addEventListener("keyup",u),u(),t.forEach((function(e){e.addEventListener("change",a),e.addEventListener("change",u)})),n.forEach((function(e){e.addEventListener("change",a),e.addEventListener("change",u)}))}}))}},o=function(e){var t,n=e.querySelectorAll('div[role="tablist"] [role="tab"]'),r=e.querySelectorAll('div[role="tabpanel"]'),o=e.querySelectorAll('input[type="radio"][name="donation_frequency"]'),a=(null===(t=Array.from(o).find((function(e){return e.checked})))||void 0===t?void 0:t.id)||null;if(a){var u,d="tab-".concat(a);null===(u=document.getElementById(d))||void 0===u||u.setAttribute("aria-selected","true")}n.forEach((function(e){e.addEventListener("click",(function(){i(e,n,o,r)}))}))},i=function(e,t,n,r){t.forEach((function(t){e===t?(t.setAttribute("aria-selected","true"),t.classList.add("wpbnbd__button--active")):(t.setAttribute("aria-selected","false"),t.classList.remove("wpbnbd__button--active"))}));var o=(e.id||"").replace("tab-","");n.forEach((function(e){e.checked=o===e.id})),r.forEach((function(t){e.getAttribute("aria-controls")===t.id?t.setAttribute("tabindex","0"):t.removeAttribute("tabindex")}))},a=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:document,t=e.querySelectorAll(".wpbnbd--frequency-based");t.forEach((function(e){r(e),o(e)}))};"undefined"!=typeof window&&(n=function(){return a()},"undefined"!=typeof document&&("complete"!==document.readyState&&"interactive"!==document.readyState?document.addEventListener("DOMContentLoaded",n):n()));var u=window;for(var d in t)u[d]=t[d];t.__esModule&&Object.defineProperty(u,"__esModule",{value:!0})})();
@@ -1 +1 @@
1
- .wpbnbd--frequency-based{background:#fff;border:1px solid #ccc;color:#111;position:relative;width:100%}.wpbnbd--frequency-based input[type=radio]{right:-99999em;position:absolute}.wpbnbd--frequency-based input[readonly]{background-color:#f1f1f1;color:#666}.wpbnbd--frequency-based .freq-label,.wpbnbd--frequency-based .input-container,.wpbnbd--frequency-based .tier-label{display:block;font-weight:700;cursor:pointer}.wpbnbd--frequency-based .freq-label{box-sizing:border-box;overflow:hidden;white-space:nowrap;width:100%;z-index:1}.wpbnbd--frequency-based .submit-button,.wpbnbd--frequency-based button{margin:0 .76rem .76rem}@media only screen and (min-width:782px){.wpbnbd--frequency-based .submit-button,.wpbnbd--frequency-based button{margin:0 1.5rem 1.5rem}}.wpbnbd--frequency-based label.wpbnbd__button{text-transform:uppercase}.wpbnbd--frequency-based .thanks{color:#767676;font-size:.8em;margin:.38rem .76rem .76rem;display:none}@media only screen and (min-width:600px){.wpbnbd--frequency-based .thanks{display:block}}@media only screen and (min-width:782px){.wpbnbd--frequency-based .thanks{margin-right:1.5rem;margin-left:1.5rem}}.wpbnbd.tiered .tiers{margin:.38rem;display:none;flex-wrap:wrap;position:relative}@media only screen and (min-width:782px){.wpbnbd.tiered .tiers{margin:1.12rem 1.12rem .38rem}}.wpbnbd.tiered .tiers .tier-label{border:1px solid #ccc;border-radius:5px;margin:.38rem;padding:.38rem .76rem}.wpbnbd.tiered .tiers .tier-label:hover{background:#f1f1f1}.wpbnbd.tiered .tiers input[type=radio]:focus+.tier-label{background:#f1f1f1;outline:1px dotted currentcolor;outline-offset:-4px}.wpbnbd.tiered .tiers input[type=radio]:checked+.tier-label{background-color:#757575;border-color:transparent;color:#fff}.wpbnbd.tiered .tiers .odl{font-weight:700;right:.38rem;position:absolute;bottom:calc(1.6em + 1.1rem + 2px)}.wpbnbd.tiered .tiers input.other-input~.money-input,.wpbnbd.tiered .tiers input.other-input~.odl{display:none}.wpbnbd.tiered .tiers input.other-input:checked~.money-input{display:flex}.wpbnbd.tiered .tiers input.other-input:checked~.odl{display:block}.wpbnbd.tiered .tiers input.other-input:checked+label{margin-bottom:calc(3.2em + 1.86rem + 2px)}.wpbnbd.tiered .money-input{bottom:.38rem;right:.38rem;position:absolute}.wpbnbd.untiered .input-container{margin:.76rem;display:none}@media only screen and (min-width:782px){.wpbnbd.untiered .input-container{margin:1.5rem 1.5rem .76rem}}.wpbnbd.untiered input[type=radio]:checked~.input-container{display:block}.wpbnbd .money-input{display:flex;align-items:center;position:relative;max-width:200px;background-color:#fff;border-radius:3px;border:1px solid #ccc}.wpbnbd .money-input[focus-within]{border-color:#111;outline:thin solid rgba(17,17,17,.15);outline-offset:-4px}.wpbnbd .money-input:focus-within{border-color:#111;outline:thin solid rgba(17,17,17,.15);outline-offset:-4px}.wpbnbd .money-input .currency{cursor:default;font-size:.8em;padding-right:.5em}.wpbnbd .money-input input[type=number]{background:none;max-width:174px}.wpbnbd .money-input input[type=number],.wpbnbd .money-input input[type=number]:focus{border:none;outline:none;box-shadow:none}.wpbnbd .frequencies{position:relative;font-size:.7em;padding-top:2.65em}@media only screen and (min-width:600px){.wpbnbd .frequencies{font-size:.8em}}.wpbnbd .frequency .freq-label{position:absolute;top:0;right:0;border-width:0 0 1px}.wpbnbd .frequency input[type=radio]:checked+.freq-label{color:inherit;border-bottom-color:transparent}.wpbnbd .frequency input[type=radio]:checked+.freq-label:hover{background:#fff}.wpbnbd .frequency input[type=radio]:checked~.tiers{display:flex}.wpbnbd .frequency input[type=radio]:focus+.freq-label{text-decoration:underline;-webkit-text-decoration-style:dotted;text-decoration-style:dotted;text-decoration-thickness:1px}.wpbnbd .frequency:nth-of-type(3) .freq-label{right:66.66%}.wpbnbd-frequencies--2.wpbnbd .frequency .freq-label{width:50%}.wpbnbd-frequencies--2.wpbnbd .frequency:nth-of-type(2) .freq-label{border-right-width:1px;right:50%;top:0}.wpbnbd-frequencies--3.wpbnbd .frequency .freq-label{width:33.33%}.wpbnbd-frequencies--3.wpbnbd .frequency:nth-of-type(2) .freq-label{border-right-width:1px;border-left-width:1px;right:33.33%;top:0}
1
+ .wpbnbd--frequency-based{background:#fff;border:1px solid #ccc;color:#111;position:relative;width:100%}.wpbnbd--frequency-based input[type=radio]{position:absolute;right:-99999em}.wpbnbd--frequency-based input[type=radio][name=donation_frequency],.wpbnbd--frequency-based input[type=radio][name=donation_frequency]+label{display:none}.wpbnbd--frequency-based input[readonly]{background-color:#f1f1f1;color:#666}.wpbnbd--frequency-based .freq-label,.wpbnbd--frequency-based .input-container,.wpbnbd--frequency-based .tier-label{display:block;font-weight:700;cursor:pointer}.wpbnbd--frequency-based .freq-label{box-sizing:border-box;overflow:hidden;white-space:nowrap;width:100%;z-index:1}.wpbnbd--frequency-based .submit-button,.wpbnbd--frequency-based button{margin:0 .76rem .76rem}@media only screen and (min-width:782px){.wpbnbd--frequency-based .submit-button,.wpbnbd--frequency-based button{margin:0 1.5rem 1.5rem}}.wpbnbd--frequency-based .submit-button:disabled,.wpbnbd--frequency-based button:disabled{opacity:.5}.wpbnbd--frequency-based .wpbnbd__button{font-size:16px;text-transform:uppercase}.wpbnbd--frequency-based .thanks{color:#767676;font-size:.8em;margin:.38rem .76rem .76rem;display:none}@media only screen and (min-width:600px){.wpbnbd--frequency-based .thanks{display:block}}@media only screen and (min-width:782px){.wpbnbd--frequency-based .thanks{margin-right:1.5rem;margin-left:1.5rem}}.wpbnbd.tiered .tiers{margin:.38rem;display:none;flex-wrap:wrap;position:relative}@media only screen and (min-width:782px){.wpbnbd.tiered .tiers{margin:1.12rem 1.12rem .38rem}}.wpbnbd.tiered .tiers .tier-label{border:1px solid #ccc;border-radius:5px;margin:.38rem;padding:.38rem .76rem}.wpbnbd.tiered .tiers .tier-label:hover{background:#f1f1f1}.wpbnbd.tiered .tiers input[type=radio]:focus+.tier-label{background:#f1f1f1;outline:1px dotted currentcolor;outline-offset:-4px}.wpbnbd.tiered .tiers input[type=radio]:checked+.tier-label{background-color:#757575;border-color:transparent;color:#fff}.wpbnbd.tiered .tiers .odl{font-weight:700;right:.38rem;position:absolute;bottom:calc(1.6em + 1.1rem + 2px)}.wpbnbd.tiered .tiers input.other-input~.money-input,.wpbnbd.tiered .tiers input.other-input~.odl{display:none}.wpbnbd.tiered .tiers input.other-input:checked~.money-input{display:flex}.wpbnbd.tiered .tiers input.other-input:checked~.odl{display:block}.wpbnbd.tiered .tiers input.other-input:checked+label{margin-bottom:calc(3.2em + 1.86rem + 2px)}.wpbnbd.tiered .money-input{bottom:.38rem;right:.38rem;position:absolute}.wpbnbd.untiered .input-container{margin:.76rem;display:none}@media only screen and (min-width:782px){.wpbnbd.untiered .input-container{margin:1.5rem 1.5rem .76rem}}.wpbnbd.untiered input[type=radio]:checked~.input-container{display:block}.wpbnbd .money-input{display:flex;align-items:center;position:relative;max-width:200px;background-color:#fff;border-radius:3px;border:1px solid #ccc}.wpbnbd .money-input[focus-within]{border-color:#111;outline:thin solid rgba(17,17,17,.15);outline-offset:-4px}.wpbnbd .money-input:focus-within{border-color:#111;outline:thin solid rgba(17,17,17,.15);outline-offset:-4px}.wpbnbd .money-input .currency{cursor:default;font-size:.8em;padding-right:.5em}.wpbnbd .money-input input[type=number]{background:none;max-width:174px}.wpbnbd .money-input input[type=number],.wpbnbd .money-input input[type=number]:focus{border:none;outline:none;box-shadow:none}.wpbnbd .frequencies{position:relative;font-size:.7em}@media only screen and (min-width:600px){.wpbnbd .frequencies{font-size:.8em}}.wpbnbd .frequency input[type=radio]:checked~.tiers,.wpbnbd .tab-container{display:flex}.wpbnbd .tab-container .freq-label{border-radius:0;margin:0}.wpbnbd .tab-container .freq-label.wpbnbd__button--active{color:#111}.wpbnbd .tab-container .freq-label:focus{outline:0;text-decoration:underline;-webkit-text-decoration-style:dotted;text-decoration-style:dotted;text-decoration-thickness:1px}
@@ -7,7 +7,7 @@
7
7
  * Author URI: https://newspack.com/
8
8
  * Text Domain: newspack-blocks
9
9
  * Domain Path: /languages
10
- * Version: 2.4.0
10
+ * Version: 2.5.0-alpha.1
11
11
  *
12
12
  * @package Newspack_Blocks
13
13
  */
@@ -15,7 +15,7 @@
15
15
  define( 'NEWSPACK_BLOCKS__PLUGIN_FILE', __FILE__ );
16
16
  define( 'NEWSPACK_BLOCKS__BLOCKS_DIRECTORY', 'dist/' );
17
17
  define( 'NEWSPACK_BLOCKS__PLUGIN_DIR', plugin_dir_path( NEWSPACK_BLOCKS__PLUGIN_FILE ) );
18
- define( 'NEWSPACK_BLOCKS__VERSION', '2.4.0' );
18
+ define( 'NEWSPACK_BLOCKS__VERSION', '2.5.0-alpha.1' );
19
19
 
20
20
  require_once NEWSPACK_BLOCKS__PLUGIN_DIR . 'includes/class-newspack-blocks.php';
21
21
  require_once NEWSPACK_BLOCKS__PLUGIN_DIR . 'includes/class-newspack-blocks-api.php';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@automattic/newspack-blocks",
3
- "version": "2.4.0",
3
+ "version": "2.5.0-alpha.1",
4
4
  "author": "Automattic",
5
5
  "devDependencies": {
6
6
  "@rushstack/eslint-patch": "^1.5.1",
@@ -7,7 +7,7 @@ import classNames from 'classnames';
7
7
  * WordPress dependencies
8
8
  */
9
9
  import { __ } from '@wordpress/i18n';
10
- import { useMemo, useEffect, useRef } from '@wordpress/element';
10
+ import { useMemo, useEffect, useRef, useState } from '@wordpress/element';
11
11
  import { SelectControl } from '@wordpress/components';
12
12
  import { RichText } from '@wordpress/block-editor';
13
13
 
@@ -68,6 +68,8 @@ const FrequencyBasedLayout = ( props: { isTiered: boolean } & ComponentProps ) =
68
68
  const isRenderingStripePaymentForm =
69
69
  window.newspack_blocks_data?.is_rendering_stripe_payment_form;
70
70
 
71
+ const [ selectedFrequency, setSelectedFrequency ] = useState( attributes.defaultFrequency );
72
+
71
73
  const renderFrequencySelect = ( frequencySlug: DonationFrequencySlug ) => (
72
74
  <>
73
75
  <input
@@ -75,22 +77,39 @@ const FrequencyBasedLayout = ( props: { isTiered: boolean } & ComponentProps ) =
75
77
  value={ frequencySlug }
76
78
  id={ `newspack-donate-${ frequencySlug }-${ uid }` }
77
79
  name="donation_frequency"
78
- defaultChecked={ frequencySlug === attributes.defaultFrequency }
80
+ checked={ frequencySlug === selectedFrequency }
81
+ onChange={ evt => setSelectedFrequency( evt.target.value as 'once' | 'month' | 'year' ) }
79
82
  />
80
- <label
81
- htmlFor={ 'newspack-donate-' + frequencySlug + '-' + uid }
82
- className="wpbnbd__button freq-label"
83
- >
83
+ <label htmlFor={ 'newspack-donate-' + frequencySlug + '-' + uid }>
84
84
  { FREQUENCIES[ frequencySlug ] }
85
85
  </label>
86
86
  </>
87
87
  );
88
88
 
89
+ const renderTab = ( frequencySlug: DonationFrequencySlug ) => (
90
+ <button
91
+ key={ frequencySlug }
92
+ role="tab"
93
+ className={ classNames( 'wpbnbd__button freq-label', {
94
+ 'wpbnbd__button--active': frequencySlug === selectedFrequency,
95
+ } ) }
96
+ id={ `tab-newspack-donate-${ frequencySlug }-${ uid }` }
97
+ onClick={ evt => {
98
+ evt.preventDefault();
99
+ setSelectedFrequency( frequencySlug );
100
+ } }
101
+ >
102
+ { FREQUENCIES[ frequencySlug ] }
103
+ </button>
104
+ );
105
+
106
+ // This code is fired on tab select and updates aria elements, tabindex states, and radio buttons
89
107
  const displayAmount = ( amount: number ) => amount.toFixed( 2 ).replace( /\.?0*$/, '' );
90
108
 
91
109
  const renderUntieredForm = () => (
92
110
  <div className="wp-block-newspack-blocks-donate__options">
93
111
  <div className="wp-block-newspack-blocks-donate__frequencies frequencies">
112
+ <div className="tab-container">{ availableFrequencies.map( renderTab ) }</div>
94
113
  { availableFrequencies.map( frequencySlug => (
95
114
  <div
96
115
  className="wp-block-newspack-blocks-donate__frequency frequency"
@@ -123,6 +142,7 @@ const FrequencyBasedLayout = ( props: { isTiered: boolean } & ComponentProps ) =
123
142
  const renderTieredForm = () => (
124
143
  <div className="wp-block-newspack-blocks-donate__options">
125
144
  <div className="wp-block-newspack-blocks-donate__frequencies frequencies">
145
+ <div className="tab-container">{ availableFrequencies.map( renderTab ) }</div>
126
146
  { availableFrequencies.map( frequencySlug => (
127
147
  <div
128
148
  className="wp-block-newspack-blocks-donate__frequency frequency"
@@ -166,12 +186,7 @@ const FrequencyBasedLayout = ( props: { isTiered: boolean } & ComponentProps ) =
166
186
  </label>
167
187
  <div className="wp-block-newspack-blocks-donate__money-input money-input">
168
188
  <span className="currency">{ settings.currencySymbol }</span>
169
- <AmountValueInput
170
- { ...props }
171
- frequencySlug={ frequencySlug }
172
- tierIndex={ index }
173
- id={ `${ id }-other-input` }
174
- />
189
+ <input type="number" readOnly />
175
190
  </div>
176
191
  </>
177
192
  ) : null }
@@ -51,7 +51,6 @@ const TIER_LABELS = [
51
51
  __( 'Low-tier', 'newspack-blocks' ),
52
52
  __( 'Mid-tier', 'newspack-blocks' ),
53
53
  __( 'High-tier', 'newspack-blocks' ),
54
- __( 'Other', 'newspack-blocks' ),
55
54
  ];
56
55
 
57
56
  const Edit = ( { attributes, setAttributes, className }: EditProps ) => {
@@ -302,21 +301,27 @@ const Edit = ( { attributes, setAttributes, className }: EditProps ) => {
302
301
  false
303
302
  ) && renderMinAmountWarning() }
304
303
 
305
- { amounts[ frequency ].map( ( suggestedAmount, tierIndex ) => (
306
- <AmountValueInput
307
- ignoreMinimumAmount
308
- { ...componentProps }
309
- key={ `amount-${ frequency }-${ tierIndex }` }
310
- frequencySlug={ frequency }
311
- tierIndex={ tierIndex }
312
- label={ TIER_LABELS[ tierIndex ] }
313
- id={ `${ frequency }-${ tierIndex }-amount` }
314
- disabled={
315
- isTierBasedLayoutEnabled &&
316
- tierIndex === DISABLED_IN_TIERS_BASED_LAYOUT_TIER_INDEX
317
- }
318
- />
319
- ) ) }
304
+ { amounts[ frequency ].map( ( suggestedAmount, tierIndex ) => {
305
+ // The "Other" tier is no longer customizable and should always render empty for tiered layout.
306
+ if ( tierIndex === 3 ) {
307
+ return null;
308
+ }
309
+ return (
310
+ <AmountValueInput
311
+ ignoreMinimumAmount
312
+ { ...componentProps }
313
+ key={ `amount-${ frequency }-${ tierIndex }` }
314
+ frequencySlug={ frequency }
315
+ tierIndex={ tierIndex }
316
+ label={ TIER_LABELS[ tierIndex ] }
317
+ id={ `${ frequency }-${ tierIndex }-amount` }
318
+ disabled={
319
+ isTierBasedLayoutEnabled &&
320
+ tierIndex === DISABLED_IN_TIERS_BASED_LAYOUT_TIER_INDEX
321
+ }
322
+ />
323
+ );
324
+ } ) }
320
325
  </div>
321
326
  ) }
322
327
  </Fragment>
@@ -25,12 +25,13 @@ function domReady( callback: () => void ): void {
25
25
  document.addEventListener( 'DOMContentLoaded', callback );
26
26
  }
27
27
 
28
- const resetOtherValue = ( container: HTMLElement ) => {
28
+ const handleOtherValue = ( container: HTMLElement ) => {
29
29
  const frequencies = container.querySelectorAll( '.tiers' );
30
30
  if ( ! frequencies?.length ) {
31
31
  return;
32
32
  }
33
33
  const frequencyInputs = container.querySelectorAll( 'input[name="donation_frequency"]' );
34
+ const submitButton = container.querySelector( 'button[type="submit"]' );
34
35
  frequencies.forEach( frequency => {
35
36
  const tiers = frequency.querySelectorAll( 'input[type="radio"]' );
36
37
  const input = <HTMLInputElement>frequency.querySelector( '.money-input input' );
@@ -41,21 +42,100 @@ const resetOtherValue = ( container: HTMLElement ) => {
41
42
  const reset = () => {
42
43
  input.value = originalValue || '';
43
44
  };
45
+ const toggleSubmit = () => {
46
+ const checkedTier = <HTMLInputElement>(
47
+ frequency.querySelector( 'input[type="radio"]:checked' )
48
+ );
49
+ if ( ! checkedTier ) {
50
+ return;
51
+ }
52
+ if ( checkedTier.value === 'other' && ! input.value ) {
53
+ submitButton?.setAttribute( 'disabled', 'disabled' );
54
+ } else {
55
+ submitButton?.removeAttribute( 'disabled' );
56
+ }
57
+ };
58
+ input.addEventListener( 'keyup', toggleSubmit );
59
+ toggleSubmit();
44
60
  tiers.forEach( tierInput => {
45
61
  tierInput.addEventListener( 'change', reset );
62
+ tierInput.addEventListener( 'change', toggleSubmit );
46
63
  } );
47
64
  frequencyInputs.forEach( frequencyInput => {
48
65
  frequencyInput.addEventListener( 'change', reset );
66
+ frequencyInput.addEventListener( 'change', toggleSubmit );
67
+ } );
68
+ } );
69
+ };
70
+
71
+ const addAccessibleTabs = ( container: HTMLElement ) => {
72
+ // Get the block's tabs, panels, and radio buttons associated with donation frequency.
73
+ const tabList = container.querySelectorAll(
74
+ 'div[role="tablist"] [role="tab"]'
75
+ ) as NodeListOf< HTMLElement >;
76
+ const panels = container.querySelectorAll( 'div[role="tabpanel"]' ) as NodeListOf< HTMLElement >;
77
+ const radioButtons = container.querySelectorAll(
78
+ 'input[type="radio"][name="donation_frequency"]'
79
+ ) as NodeListOf< HTMLInputElement >;
80
+ // Figure out which radio button is currently selected.
81
+ const checkedRadioId =
82
+ Array.from( radioButtons ).find( ( radio: HTMLInputElement ) => radio.checked )?.id || null;
83
+
84
+ // Set the tab associated to the radio button to selected.
85
+ if ( checkedRadioId ) {
86
+ const selectedTabId = `tab-${ checkedRadioId }`;
87
+ document.getElementById( selectedTabId )?.setAttribute( 'aria-selected', 'true' );
88
+ }
89
+
90
+ // Add a click event listener to each tab.
91
+ tabList.forEach( ( tab: HTMLElement ) => {
92
+ tab.addEventListener( 'click', function () {
93
+ selectTab( tab, tabList, radioButtons, panels );
49
94
  } );
50
95
  } );
51
96
  };
52
97
 
98
+ const selectTab = (
99
+ tab: HTMLElement,
100
+ tabList: NodeListOf< HTMLElement >,
101
+ radioButtons: NodeListOf< HTMLInputElement >,
102
+ panels: NodeListOf< HTMLElement >
103
+ ) => {
104
+ // Loop through tabs and set them as selected or not selected:
105
+ tabList.forEach( ( thisTab: HTMLElement ) => {
106
+ if ( tab === thisTab ) {
107
+ thisTab.setAttribute( 'aria-selected', 'true' );
108
+ thisTab.classList.add( 'wpbnbd__button--active' );
109
+ } else {
110
+ thisTab.setAttribute( 'aria-selected', 'false' );
111
+ thisTab.classList.remove( 'wpbnbd__button--active' );
112
+ }
113
+ } );
114
+
115
+ // Update the underlying radio button.
116
+ const tabId = tab.id || '';
117
+ const frequencyId = tabId.replace( 'tab-', '' );
118
+ radioButtons.forEach( ( radio: HTMLInputElement ) => {
119
+ radio.checked = frequencyId === radio.id;
120
+ } );
121
+
122
+ // Loop through the panels and set tabindex 0 on the selected panel; remove it from others.
123
+ panels.forEach( ( panel: HTMLElement ) => {
124
+ if ( tab.getAttribute( 'aria-controls' ) === panel.id ) {
125
+ panel.setAttribute( 'tabindex', '0' );
126
+ } else {
127
+ panel.removeAttribute( 'tabindex' );
128
+ }
129
+ } );
130
+ };
131
+
53
132
  export const processFrequencyBasedElements = ( parentEl = document ) => {
54
133
  const elements = parentEl.querySelectorAll(
55
134
  '.wpbnbd--frequency-based'
56
135
  ) as NodeListOf< HTMLElement >;
57
136
  elements.forEach( container => {
58
- resetOtherValue( container );
137
+ handleOtherValue( container );
138
+ addAccessibleTabs( container );
59
139
  } );
60
140
  };
61
141
 
@@ -9,9 +9,16 @@
9
9
  position: relative;
10
10
  width: 100%;
11
11
 
12
+ // Hide some radio buttons absolutely.
12
13
  input[type='radio'] {
13
- left: -99999em;
14
14
  position: absolute;
15
+ left: -99999em;
16
+
17
+ // And hide the ones being replaced by tabs completely.
18
+ &[name='donation_frequency'],
19
+ &[name='donation_frequency'] + label {
20
+ display: none;
21
+ }
15
22
  }
16
23
 
17
24
  input[readonly] {
@@ -42,9 +49,13 @@
42
49
  @include mixins.media( tablet ) {
43
50
  margin: 0 1.5rem 1.5rem;
44
51
  }
52
+ &:disabled {
53
+ opacity: 0.5;
54
+ }
45
55
  }
46
- label.wpbnbd {
56
+ .wpbnbd {
47
57
  &__button {
58
+ font-size: 16px;
48
59
  text-transform: uppercase;
49
60
  }
50
61
  }
@@ -188,76 +199,35 @@
188
199
  }
189
200
  }
190
201
 
191
- .wpbnbd .frequencies {
192
- position: relative;
193
- font-size: variables.$font__size-xs;
194
- @include mixins.media( mobile ) {
195
- font-size: variables.$font__size-sm;
202
+ .wpbnbd {
203
+ .frequencies {
204
+ position: relative;
205
+ font-size: variables.$font__size-xs;
206
+ @include mixins.media( mobile ) {
207
+ font-size: variables.$font__size-sm;
208
+ }
196
209
  }
197
210
 
198
- padding-top: 2.65em;
199
- }
200
-
201
- .wpbnbd .frequency {
202
- .freq-label {
203
- position: absolute;
204
- top: 0;
205
- left: 0;
206
- border-width: 0 0 1px;
211
+ .frequency input[type='radio']:checked ~ .tiers {
212
+ display: flex;
207
213
  }
208
214
 
209
- input[type='radio'] {
210
- &:checked {
211
- + .freq-label {
212
- color: inherit;
213
- border-bottom-color: transparent;
214
-
215
- &:hover {
216
- background: colors.$color__background-body;
217
- }
218
- }
215
+ .tab-container {
216
+ display: flex;
217
+ .freq-label {
218
+ border-radius: 0;
219
+ margin: 0;
219
220
 
220
- ~ .tiers {
221
- display: flex;
221
+ &.wpbnbd__button--active {
222
+ color: colors.$color__text-main;
222
223
  }
223
- }
224
-
225
- &:focus + .freq-label {
226
- text-decoration: underline;
227
- text-decoration-style: dotted;
228
- text-decoration-thickness: 1px;
229
- }
230
- }
231
224
 
232
- &:nth-of-type( 3 ) .freq-label {
233
- left: 66.66%;
234
- }
235
- }
236
-
237
- .wpbnbd-frequencies {
238
- &--2 {
239
- &.wpbnbd .frequency {
240
- .freq-label {
241
- width: 50%;
242
- }
243
- &:nth-of-type( 2 ) .freq-label {
244
- border-left-width: 1px;
245
- left: 50%;
246
- top: 0;
225
+ &:focus {
226
+ outline: 0;
227
+ text-decoration: underline;
228
+ text-decoration-style: dotted;
229
+ text-decoration-thickness: 1px;
247
230
  }
248
231
  }
249
232
  }
250
- &--3 {
251
- &.wpbnbd .frequency {
252
- .freq-label {
253
- width: 33.33%;
254
- }
255
- &:nth-of-type( 2 ) .freq-label {
256
- border-left-width: 1px;
257
- border-right-width: 1px;
258
- left: 33.33%;
259
- top: 0;
260
- }
261
- }
262
- }
263
- }
233
+ }
@@ -38,16 +38,41 @@ class Newspack_Blocks_Donate_Renderer_Frequency_Based extends Newspack_Blocks_Do
38
38
  );
39
39
  ?>
40
40
  />
41
- <label
42
- for='newspack-donate-<?php echo esc_attr( $frequency_slug . '-' . $uid ); ?>'
43
- class='wpbnbd__button freq-label'
44
- >
41
+ <label for='newspack-donate-<?php echo esc_attr( $frequency_slug . '-' . $uid ); ?>'>
45
42
  <?php echo esc_html( $frequency_name ); ?>
46
43
  </label>
47
44
  <?php
48
45
  return ob_get_clean();
49
46
  }
50
47
 
48
+ /**
49
+ * Renders the frequency selection of the donation form in accessible tabs.
50
+ *
51
+ * @param string $frequency_slug Frequency slug.
52
+ * @param string $frequency_name Frequency name.
53
+ * @param number $uid Unique ID.
54
+ * @param array $configuration The donations settings.
55
+ *
56
+ * @return string
57
+ */
58
+ private static function render_frequency_tab( $frequency_slug, $frequency_name, $uid, $configuration ) {
59
+ ob_start();
60
+ ?>
61
+ <button
62
+ role='tab'
63
+ type='button'
64
+ aria-controls='tab-panel-<?php echo esc_attr( $frequency_slug . '-' . $uid ); ?>'
65
+ class="wpbnbd__button freq-label<?php echo esc_attr( $frequency_slug === $configuration['defaultFrequency'] ? ' wpbnbd__button--active' : '' ); ?>"
66
+ data-tab-id="<?php echo esc_attr( $frequency_slug . '-' . $uid ); ?>"
67
+ id="tab-newspack-donate-<?php echo esc_attr( $frequency_slug . '-' . $uid ); ?>"
68
+ <?php echo "aria-selected='" . ( $frequency_slug === $configuration['defaultFrequency'] ? 'true' : 'false' ) . "'"; ?>
69
+ >
70
+ <?php echo esc_html( $frequency_name ); ?>
71
+ </button>
72
+ <?php
73
+ return ob_get_clean();
74
+ }
75
+
51
76
  /**
52
77
  * Renders the footer of the donation form.
53
78
  *
@@ -108,12 +133,25 @@ class Newspack_Blocks_Donate_Renderer_Frequency_Based extends Newspack_Blocks_Do
108
133
  <?php echo self::render_hidden_form_inputs( $attributes ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>
109
134
  <div class='wp-block-newspack-blocks-donate__options'>
110
135
  <div class='wp-block-newspack-blocks-donate__frequencies frequencies'>
136
+
137
+ <div role='tablist' class='tab-container'>
138
+ <?php foreach ( $configuration['frequencies'] as $frequency_slug => $frequency_name ) : ?>
139
+ <?php echo self::render_frequency_tab( $frequency_slug, $frequency_name, $uid, $configuration ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>
140
+ <?php endforeach; ?>
141
+ </div>
142
+
111
143
  <?php foreach ( $configuration['frequencies'] as $frequency_slug => $frequency_name ) : ?>
112
144
  <?php
113
145
  $formatted_amount = $configuration['amounts'][ $frequency_slug ][3];
114
146
  ?>
115
147
 
116
- <div class='wp-block-newspack-blocks-donate__frequency frequency'>
148
+ <div
149
+ class='wp-block-newspack-blocks-donate__frequency frequency'
150
+ id='tab-panel-<?php echo esc_attr( $frequency_slug . '-' . $uid ); ?>'
151
+ role='tabpanel'
152
+ aria-labelledby='tab-newspack-donate-<?php echo esc_attr( $frequency_slug . '-' . $uid ); ?>'
153
+ <?php ( $frequency_slug === $configuration['defaultFrequency'] ? 'tabindex="0"' : '' ); ?>
154
+ >
117
155
  <?php echo self::render_frequency_selection( $frequency_slug, $frequency_name, $uid, $configuration ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>
118
156
  <div class='input-container'>
119
157
  <label
@@ -157,9 +195,21 @@ class Newspack_Blocks_Donate_Renderer_Frequency_Based extends Newspack_Blocks_Do
157
195
  <?php echo self::render_hidden_form_inputs( $attributes ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>
158
196
  <div class='wp-block-newspack-blocks-donate__options'>
159
197
  <div class='wp-block-newspack-blocks-donate__frequencies frequencies'>
198
+ <div role='tablist' class='tab-container'>
199
+ <?php foreach ( $configuration['frequencies'] as $frequency_slug => $frequency_name ) : ?>
200
+ <?php echo self::render_frequency_tab( $frequency_slug, $frequency_name, $uid, $configuration ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>
201
+ <?php endforeach; ?>
202
+ </div>
203
+
160
204
  <?php foreach ( $configuration['frequencies'] as $frequency_slug => $frequency_name ) : ?>
161
205
 
162
- <div class='wp-block-newspack-blocks-donate__frequency frequency'>
206
+ <div
207
+ class='wp-block-newspack-blocks-donate__frequency frequency'
208
+ id='tab-panel-<?php echo esc_attr( $frequency_slug . '-' . $uid ); ?>'
209
+ role='tabpanel'
210
+ aria-labelledby='tab-newspack-donate-<?php echo esc_attr( $frequency_slug . '-' . $uid ); ?>'
211
+ <?php ( $frequency_slug === $configuration['defaultFrequency'] ? 'tabindex="0"' : '' ); ?>
212
+ >
163
213
  <?php echo self::render_frequency_selection( $frequency_slug, $frequency_name, $uid, $configuration ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>
164
214
  <div class='wp-block-newspack-blocks-donate__tiers tiers'>
165
215
  <?php foreach ( $suggested_amounts[ $frequency_slug ] as $index => $amount ) : ?>
@@ -194,7 +244,6 @@ class Newspack_Blocks_Donate_Renderer_Frequency_Based extends Newspack_Blocks_Do
194
244
  type='number'
195
245
  min='<?php echo esc_attr( $configuration['minimumDonation'] ); ?>'
196
246
  name='donation_value_<?php echo esc_attr( $frequency_slug ); ?>_other'
197
- value='<?php echo esc_attr( $amount ); ?>'
198
247
  id='newspack-tier-<?php echo esc_attr( $frequency_slug . '-' . $uid ); ?>-other-input'
199
248
  />
200
249
  </div>
@@ -23,7 +23,7 @@
23
23
  span {
24
24
  margin-bottom: 7px;
25
25
  display: inline-block;
26
- width: 48%;
26
+ width: 32%;
27
27
  }
28
28
  input {
29
29
  max-width: 100%;