maverick-wave 4.11.0 → 4.13.0
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.
- package/.claude/skills/maverick-wave/SKILL.md +17 -4
- package/.claude/skills/maverick-wave/examples/angular-services.md +8 -4
- package/.claude/skills/maverick-wave/examples/static-landing-page.md +18 -8
- package/.claude/skills/maverick-wave/references/components.md +47 -8
- package/.claude/skills/maverick-wave/references/javascript.md +1 -1
- package/CHANGELOG.md +12 -0
- package/maverick-wave.min.css +3 -3
- package/maverick-wave.min.js +1 -1
- package/package.json +2 -2
- package/src/js/main.js +8 -0
- package/src/partials/accordions-container.html +37 -17
- package/src/partials/buttons-container.html +24 -1
- package/src/partials/code-container.html +2 -8
- package/src/partials/footer-container.html +1 -7
- package/src/partials/tabs-container.html +1 -1
- package/src/scss/abstracts/_functions.scss +18 -0
- package/src/scss/abstracts/_mixins.scss +17 -0
- package/src/scss/base/_base.scss +4 -4
- package/src/scss/base/_reset.scss +1 -8
- package/src/scss/components/_accordions.scss +26 -6
- package/src/scss/components/_buttons.scss +6 -10
- package/src/scss/components/_index.scss +1 -0
- package/src/scss/components/_links.scss +35 -0
package/maverick-wave.min.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
!function(){"use strict";function e(e,t){e&&(e.classList.toggle("mw-active",t),t||e.classList.remove("active"))}function t(){document.querySelectorAll(".color-swatch").forEach(e=>{const t=function(e){if(!e||"transparent"===e)return"#000000";const t=e=>Math.max(0,Math.min(255,Math.round(e))).toString(16).padStart(2,"0"),n=e.match(/color\(srgb\s+([\d.]+)\s+([\d.]+)\s+([\d.]+)(?:\s*\/\s*([\d.]+))?\)/);if(n){const e="#"+t(255*n[1])+t(255*n[2])+t(255*n[3]),a=void 0===n[4]?1:parseFloat(n[4]);return(a<1?`${e} / ${a}`:e).toUpperCase()}const a=e.match(/rgba?\((\d+),\s*(\d+),\s*(\d+)(?:,\s*([\d.]+))?\)/);if(!a)return e;const c="#"+t(a[1])+t(a[2])+t(a[3]),o=void 0===a[4]?1:parseFloat(a[4]);return(o<1?`${c} / ${o}`:c).toUpperCase()}(window.getComputedStyle(e).backgroundColor),n=e.parentElement.querySelector(".mw-text-muted");n&&(n.textContent=t)})}function n(e){const t=Array.from(e.querySelectorAll(".mw-kanban-column")),n=e.querySelector(".mw-kanban-composer"),a=e.querySelector(".mw-kanban-card-template"),c=e.dataset.kanbanPrefix||"MW",o=n.querySelector(".mw-kanban-composer-title"),r=n.querySelector(".mw-kanban-composer-text"),s=n.querySelector(".mw-kanban-composer-priority"),l=n.querySelector(".mw-kanban-composer-assignee");let i=null;function d(){t.forEach(function(e,n){const a=e.querySelectorAll(".mw-kanban-card"),c=e.querySelector(".mw-kanban-count");c&&(c.textContent=a.length),e.querySelectorAll("[data-kanban-move]").forEach(function(e){const a=n+parseInt(e.dataset.kanbanMove,10);e.disabled=a<0||a>=t.length})})}function u(e,t){const n=e.querySelector(t);return n?n.textContent.replace(/\s+/g," ").trim():""}function m(e,t){f(),i=t||null,o.value=t?u(t,".mw-kanban-card-title"):"",r.value=t?u(t,".mw-kanban-card-text"):"",s.value=t?function(e){const t=e.querySelector(".mw-card-ribbon");if(!t)return"";const n=Array.from(t.classList).find(function(e){return 0===e.indexOf("mw-card-addon-")});return n?n.replace("mw-card-addon-",""):""}(t):"",l.value=t?function(e){const t=e.querySelector(".mw-avatar-initials");return t?t.textContent.trim():""}(t):"",t?(t.classList.add("mw-kanban-editing"),t.before(n)):e.querySelector(".mw-kanban-column-body").prepend(n),n.classList.add("mw-active"),o.focus()}function f(){n.classList.remove("mw-active"),i&&i.classList.remove("mw-kanban-editing"),i=null}function w(){const t=o.value.trim();if(!t)return void o.focus();const u=i||a.content.firstElementChild.cloneNode(!0);if(u.querySelector(".mw-kanban-card-title").textContent=t,u.querySelector(".mw-kanban-card-text").textContent=r.value.trim(),function(e,t){const n=e.querySelector(".mw-card-ribbon");if(n&&n.remove(),!t||!t.value)return;const a=document.createElement("div");a.className="mw-card-ribbon mw-card-addon-"+t.value,a.textContent=t.textContent,e.prepend(a)}(u,s.selectedOptions[0]),function(e,t){const n=e.querySelector(".mw-kanban-card-actions"),a=n.querySelector(".mw-avatar");if(!t)return void(a&&a.remove());const c=a||document.createElement("div");c.className="mw-avatar mw-avatar-xs mw-avatar-initials",c.textContent=t,a||n.prepend(c)}(u,l.value),!i){const t=function(){const t=Array.from(e.querySelectorAll(".mw-kanban-card-id")).map(function(e){return parseInt(e.textContent.split("-").pop(),10)||0});return c+"-"+(Math.max(0,...t)+1)}();u.classList.add("mw-kanban-card-in"),u.querySelector(".mw-kanban-card-id").textContent=t,u.querySelectorAll("[aria-label]").forEach(function(e){e.setAttribute("aria-label",e.getAttribute("aria-label").replace(/[A-Z]+-\d+/,t))}),n.before(u)}f(),d()}const h=["mw-kanban-card-moved-forward","mw-kanban-card-moved-back"];e.addEventListener("click",function(e){const n=e.target.closest("[data-kanban-move]");if(n){if(function(e,n){const a=e.closest(".mw-kanban-column"),c=t[t.indexOf(a)+n];c&&(c.querySelector(".mw-kanban-column-body").appendChild(e),e.classList.remove.apply(e.classList,h),e.offsetWidth,e.classList.add(n>0?h[0]:h[1]),d())}(n.closest(".mw-kanban-card"),parseInt(n.dataset.kanbanMove,10)),n.disabled){const e=n.parentElement.querySelector("[data-kanban-move]:not(:disabled)");e&&e.focus()}return}const a=e.target.closest(".mw-kanban-edit");if(a){const e=a.closest(".mw-kanban-card");return void m(e.closest(".mw-kanban-column"),e)}const c=e.target.closest(".mw-kanban-delete");if(c){const e=c.closest(".mw-kanban-card");return e===i&&f(),e.remove(),void d()}const o=e.target.closest(".mw-kanban-add");o?m(o.closest(".mw-kanban-column"),null):e.target.closest(".mw-kanban-composer-cancel")&&f()}),n.addEventListener("submit",function(e){e.preventDefault(),w()}),n.addEventListener("keydown",function(e){"Escape"===e.key&&f()}),d()}function a(e){const t=e.querySelector(".mw-calendar-grid"),n=e.querySelector(".mw-calendar-title");if(!t)return;const a="week"===e.dataset.calendar,c=function(e){if(!e)return{};try{return JSON.parse(e)}catch(e){return{}}}(e.dataset.calendarMarkers),o=e.dataset.calendarLocale||document.documentElement.lang||void 0,r=new Date;r.setHours(0,0,0,0);let s=e.dataset.calendarDate?new Date(e.dataset.calendarDate+"T00:00:00"):new Date(r),l=e.dataset.calendarSelected||"";function i(e){const t=new Date(e);return t.setDate(t.getDate()-(t.getDay()+6)%7),t}function d(e){return e.getFullYear()+"-"+String(e.getMonth()+1).padStart(2,"0")+"-"+String(e.getDate()).padStart(2,"0")}function u(){if(!a)return s.toLocaleDateString(o,{month:"long",year:"numeric"});const e=i(s),t=new Date(e);t.setDate(t.getDate()+6);const n=e.toLocaleDateString(o,{day:"numeric",month:e.getMonth()===t.getMonth()?void 0:"short"}),c=t.toLocaleDateString(o,{day:"numeric",month:"short",year:"numeric"});return"Week "+function(e){const t=i(e);t.setDate(t.getDate()+3);const n=i(new Date(t.getFullYear(),0,4));return n.setDate(n.getDate()+3),1+Math.round((t-n)/6048e5)}(e)+" · "+n+" - "+c}function m(e){const t=e.getDay();return 0===t||6===t}function f(e,t){const n=d(e),s=document.createElement("button");s.type="button",s.className="mw-calendar-day",s.tabIndex=-1,s.dataset.calendarDay=n,s.setAttribute("aria-pressed",n===l?"true":"false"),s.setAttribute("aria-label",e.toLocaleDateString(o,{weekday:"long",day:"numeric",month:"long",year:"numeric"})),m(e)&&s.classList.add("mw-calendar-weekend"),a||e.getMonth()===t||s.classList.add("mw-calendar-adjacent"),n===d(r)&&(s.classList.add("mw-calendar-today"),s.setAttribute("aria-current","date")),n===l&&s.classList.add("mw-selected");const i=document.createElement("span");i.className="mw-calendar-date",i.textContent=e.getDate(),s.appendChild(i);const u=[].concat(c[n]||[]);if(u.length){const e=document.createElement("span");e.className="mw-calendar-dots",u.forEach(function(t){const n=document.createElement("span");n.className=t?"mw-calendar-dot mw-calendar-dot-"+t:"mw-calendar-dot",e.appendChild(n)}),s.appendChild(e)}return s}function w(){const e=s.getMonth(),c=a?7:42,r=i(a?s:new Date(s.getFullYear(),e,1));t.innerHTML="",function(){const e=i(new Date);for(let n=0;n<7;n++){const n=document.createElement("div");n.className="mw-calendar-weekday",m(e)&&n.classList.add("mw-calendar-weekend"),n.setAttribute("aria-hidden","true"),n.textContent=e.toLocaleDateString(o,{weekday:"short"}),t.appendChild(n),e.setDate(e.getDate()+1)}}();for(let n=0;n<c;n++)t.appendChild(f(r,e)),r.setDate(r.getDate()+1);n&&(n.textContent=u()),function(){const e=t.querySelector(".mw-selected")||t.querySelector(".mw-calendar-today")||t.querySelector(".mw-calendar-day:not(.mw-calendar-adjacent)")||t.querySelector(".mw-calendar-day");e&&(e.tabIndex=0)}()}e.addEventListener("click",function(n){const c=n.target.closest("[data-calendar-nav]");if(c)return o=parseInt(c.dataset.calendarNav,10),a?s.setDate(s.getDate()+7*o):s=new Date(s.getFullYear(),s.getMonth()+o,1),void w();var o;const r=n.target.closest(".mw-calendar-day");var i;r&&!r.disabled&&(i=r.dataset.calendarDay,l=i===l?"":i,t.querySelectorAll(".mw-calendar-day").forEach(function(e){const t=e.dataset.calendarDay===l;e.classList.toggle("mw-selected",t),e.setAttribute("aria-pressed",t?"true":"false")}),e.dispatchEvent(new CustomEvent("mw-calendar-select",{bubbles:!0,detail:{date:l}})))}),t.addEventListener("keydown",function(e){const n={ArrowLeft:-1,ArrowRight:1,ArrowUp:-7,ArrowDown:7}[e.key];if(!n)return;const a=e.target.closest(".mw-calendar-day");if(!a)return;e.preventDefault();const c=new Date(a.dataset.calendarDay+"T00:00:00");c.setDate(c.getDate()+n),function(e){const n=d(e);let a=t.querySelector('[data-calendar-day="'+n+'"]');a||(s=new Date(e),w(),a=t.querySelector('[data-calendar-day="'+n+'"]')),a&&(t.querySelectorAll(".mw-calendar-day").forEach(function(e){e.tabIndex=-1}),a.tabIndex=0,a.focus())}(c)}),w()}document.addEventListener("DOMContentLoaded",function(){document.querySelectorAll(".mw-gallery").forEach(e=>{const t=e.closest(".mw-gallery-container")||e.parentElement;t&&function(e,t){const n=t.querySelector(".mw-gallery-track");if(!n||!n.children.length)return;const a=n.children,c=e.querySelector(".mw-gallery-dots"),o=e.querySelector(".mw-gallery-desc"),r=t.querySelector(".mw-gallery-navi-prev"),s=t.querySelector(".mw-gallery-navi-next");let l=0;function i(e){const t=a.length;l=(e+t)%t,n.style.transform=`translateX(-${100*l}%)`,c&&c.querySelectorAll(".mw-gallery-dot").forEach((e,t)=>{e.classList.toggle("mw-active",t===l)}),o&&(o.textContent=a[l].dataset.desc||"")}if(c)for(let e=0;e<a.length;e++){const t=document.createElement("button");t.type="button",t.className="mw-gallery-dot"+(0===e?" mw-active":""),t.setAttribute("aria-label","Go to slide "+(e+1)),t.addEventListener("click",()=>i(e)),c.appendChild(t)}r&&r.addEventListener("click",()=>i(l-1)),s&&s.addEventListener("click",()=>i(l+1));let d=0;n.addEventListener("touchstart",e=>d=e.touches[0].clientX),n.addEventListener("touchend",e=>{const t=e.changedTouches[0].clientX-d;t>50&&i(l-1),t<-50&&i(l+1)}),i(0)}(t,e)}),function(){const n=document.querySelector(".mw-theme-toggle");if(!n)return;const a=document.body,c=n.querySelector(".mw-theme-toggle-slider i"),o=getComputedStyle(document.documentElement).getPropertyValue("--mw-internal-theme-mode").trim()||"switchable";if("switchable"!==o)return console.log(`Theme mode fixed to: ${o}. Disabling toggle.`),c&&(c.className="light"===o?"fas fa-sun":"fas fa-moon"),e(n,"light"===o),n.style.opacity="0.4",n.style.pointerEvents="none",n.style.cursor="default",n.setAttribute("aria-disabled","true"),localStorage.removeItem("mw-theme"),void("dark"===o&&a.classList.remove("mw-theme-light"));let r="light"===localStorage.getItem("mw-theme");const s=t=>{a.classList.toggle("mw-theme-light",t),e(n,t),c&&(c.className=t?"fas fa-sun":"fas fa-moon")};s(r),n.addEventListener("click",()=>{r=!r,s(r),localStorage.setItem("mw-theme",r?"light":"dark"),setTimeout(t,400)})}(),t(),document.querySelectorAll(".mw-accordion-header").forEach(t=>{t.addEventListener("click",function(){const t=!((n=this)&&(n.classList.contains("mw-active")||n.classList.contains("active")));var n;e(this,t),e(this.nextElementSibling,t)})}),function(){const e=document.querySelector(".mw-menu-btn"),t=document.querySelector(".mw-navbar");if(!e||!t)return;function n(){e.classList.remove("open"),t.classList.remove("open")}function a(n){n.preventDefault(),n.stopPropagation(),e.classList.toggle("open"),t.classList.toggle("open")}e.addEventListener("click",a),e.addEventListener("touchstart",a,{passive:!1}),document.addEventListener("click",function(a){t.classList.contains("open")&&(t.contains(a.target)||e.contains(a.target)||n())}),document.addEventListener("keydown",function(e){"Escape"===e.key&&n()})}(),function(){const e=document.querySelectorAll(".mw-progress-fill");if(!e.length)return;const t=new IntersectionObserver((e,t)=>{e.forEach(e=>{if(!e.isIntersecting)return;const n=e.target,a=n.dataset.value||0;n.style.width=a+"%",t.unobserve(n)})},{root:null,threshold:.2});e.forEach(e=>t.observe(e))}(),document.querySelectorAll('a[href^="#"]').forEach(e=>{e.addEventListener("click",function(e){const t=this.getAttribute("href");if("#"===t)return;if(!document.querySelector(t))return;const n=document.querySelector(".mw-menu-btn"),a=document.querySelector(".mw-navbar");n&&a&&(n.classList.remove("open"),a.classList.remove("open"))})}),function(){const t=document.querySelectorAll("section[id]"),n=document.querySelectorAll(".mw-navbar-link");if(0===t.length||0===n.length)return;window.addEventListener("scroll",function(e,t){let n;return function(){const a=this,c=arguments;clearTimeout(n),n=setTimeout(()=>e.apply(a,c),t)}}(function(){let a="";t.forEach(e=>{const t=e.offsetTop-100,n=e.clientHeight;scrollY>=t&&scrollY<t+n&&(a=e.getAttribute("id"))}),n.forEach(t=>{e(t,!1);const n=t.getAttribute("href");if(n){const c=n.indexOf("#");if(-1!==c){n.substring(c+1)===a&&e(t,!0)}}})},100))}(),document.querySelectorAll(".mw-tabs-nav-item").forEach(t=>{t.addEventListener("click",function(){const t=this.closest(".mw-tabs");if(!t)return;t.querySelectorAll(".mw-tabs-nav-item").forEach(t=>{e(t,!1)}),e(this,!0);const n=this.getAttribute("data-tab");n&&(t.querySelectorAll(".mw-tabs-panel").forEach(t=>{e(t,!1)}),e(document.getElementById(n),!0))})}),document.querySelectorAll(".mw-alert-close").forEach(e=>{e.addEventListener("click",function(){const e=this.closest(".mw-alert");e&&(e.classList.add("mw-alert-closing"),setTimeout(()=>{e.classList.add("mw-alert-closed")},300))})}),function(){const e=document.querySelector(".mw-localhost-indicator-activated"),t=document.querySelector(".mw-header");if(e){if("localhost"===window.location.hostname||"127.0.0.1"===window.location.hostname||window.location.hostname.includes("192.168.")){const e=document.createElement("div");e.className="mw-localhost-indicator-pulse",t.prepend(e)}}}(),document.querySelectorAll(".mw-slider-container").forEach(e=>{const t=e.querySelector(".mw-slider"),n=e.querySelector(".mw-slider-value");if(!t||!n)return;const a=()=>{const e=Number(t.value),a=Number(t.max)||100,c=Math.round(e/a*100);t.style.setProperty("--value",c+"%"),n.classList.contains("mw-slider-numeric")?n.setAttribute("data-value",e):n.setAttribute("data-value",c)};t.addEventListener("input",a),a()}),document.querySelectorAll(".mw-modal-close").forEach(e=>{e.addEventListener("click",function(){const e=this.closest(".mw-modal-overlay");e&&e.classList.remove("mw-modal-open")})}),function(){const e=document.getElementById("login-button");e&&e.addEventListener("click",function(){const e=this.querySelector("i");e.classList.contains("fa-lock")?(e.classList.remove("fa-lock"),e.classList.add("fa-lock-open")):(e.classList.remove("fa-lock-open"),e.classList.add("fa-lock"))})}(),document.querySelectorAll(".mw-image-slider").forEach(t=>{const n=t.querySelectorAll(".mw-image-slider-overlay-image"),a=t.querySelectorAll("button[data-index]");if(!n.length||!a.length)return;let c=0;function o(){n.forEach(t=>{e(t,parseInt(t.dataset.index)===c)}),a.forEach(t=>{e(t,parseInt(t.dataset.index)===c)})}function r(e){c=e,o()}a.forEach(e=>{e.addEventListener("click",()=>{r(parseInt(e.dataset.index))})}),o()}),document.querySelectorAll(".mw-item-list-checkbox, .mw-item-list-checkbox-scroll").forEach(e=>{e.querySelectorAll("li").forEach(e=>{const t=e.querySelector('input[type="checkbox"]'),n=e.querySelector(".mw-checkbox");t&&n&&(t.checked&&e.classList.add("mw-selected"),e.addEventListener("click",function(e){e.target!==t&&e.target.closest(".mw-checkbox")!==n&&toggleCheckbox(this)}),t.addEventListener("change",function(){const e=this.closest("li");this.checked?e.classList.add("mw-selected"):e.classList.remove("mw-selected"),e.dispatchEvent(new CustomEvent("checkboxToggle",{detail:{checked:this.checked,item:e}}))}),n.addEventListener("click",function(e){setTimeout(()=>{const e=this.closest("li");this.querySelector('input[type="checkbox"]').checked?e.classList.add("mw-selected"):e.classList.remove("mw-selected")},0)}))})}),document.addEventListener("checkboxToggle",function(e){console.log("Checkbox toggled:",e.detail.checked,e.detail.item)}),document.querySelectorAll(".mw-kanban").forEach(n),document.querySelectorAll("[data-calendar]").forEach(a),function(){function e(e){document.querySelectorAll(".mw-dropdown[open]").forEach(t=>{t!==e&&t.removeAttribute("open")})}document.addEventListener("click",function(t){const n=t.target.closest(".mw-dropdown");e(n),n&&t.target.closest(".mw-dropdown-item")&&n.removeAttribute("open")}),document.addEventListener("keydown",function(e){if("Escape"!==e.key)return;const t=document.querySelector(".mw-dropdown[open]");if(!t)return;t.removeAttribute("open");const n=t.querySelector("summary");n&&n.focus()})}()}),window.toggleCheckbox=function(e){const t=e.querySelector('input[type="checkbox"]');if(!t)return;const n=t.checked;t.checked=!n,t.checked?e.classList.add("mw-selected"):e.classList.remove("mw-selected"),e.dispatchEvent(new CustomEvent("checkboxToggle",{detail:{checked:t.checked,item:e}}))}}();
|
|
1
|
+
!function(){"use strict";function e(e,t){e&&(e.classList.toggle("mw-active",t),t||e.classList.remove("active"))}function t(e){return!!e&&(e.classList.contains("mw-active")||e.classList.contains("active"))}function n(){document.querySelectorAll(".color-swatch").forEach(e=>{const t=function(e){if(!e||"transparent"===e)return"#000000";const t=e=>Math.max(0,Math.min(255,Math.round(e))).toString(16).padStart(2,"0"),n=e.match(/color\(srgb\s+([\d.]+)\s+([\d.]+)\s+([\d.]+)(?:\s*\/\s*([\d.]+))?\)/);if(n){const e="#"+t(255*n[1])+t(255*n[2])+t(255*n[3]),a=void 0===n[4]?1:parseFloat(n[4]);return(a<1?`${e} / ${a}`:e).toUpperCase()}const a=e.match(/rgba?\((\d+),\s*(\d+),\s*(\d+)(?:,\s*([\d.]+))?\)/);if(!a)return e;const c="#"+t(a[1])+t(a[2])+t(a[3]),o=void 0===a[4]?1:parseFloat(a[4]);return(o<1?`${c} / ${o}`:c).toUpperCase()}(window.getComputedStyle(e).backgroundColor),n=e.parentElement.querySelector(".mw-text-muted");n&&(n.textContent=t)})}function a(e){const t=Array.from(e.querySelectorAll(".mw-kanban-column")),n=e.querySelector(".mw-kanban-composer"),a=e.querySelector(".mw-kanban-card-template"),c=e.dataset.kanbanPrefix||"MW",o=n.querySelector(".mw-kanban-composer-title"),r=n.querySelector(".mw-kanban-composer-text"),s=n.querySelector(".mw-kanban-composer-priority"),l=n.querySelector(".mw-kanban-composer-assignee");let i=null;function d(){t.forEach(function(e,n){const a=e.querySelectorAll(".mw-kanban-card"),c=e.querySelector(".mw-kanban-count");c&&(c.textContent=a.length),e.querySelectorAll("[data-kanban-move]").forEach(function(e){const a=n+parseInt(e.dataset.kanbanMove,10);e.disabled=a<0||a>=t.length})})}function u(e,t){const n=e.querySelector(t);return n?n.textContent.replace(/\s+/g," ").trim():""}function m(e,t){f(),i=t||null,o.value=t?u(t,".mw-kanban-card-title"):"",r.value=t?u(t,".mw-kanban-card-text"):"",s.value=t?function(e){const t=e.querySelector(".mw-card-ribbon");if(!t)return"";const n=Array.from(t.classList).find(function(e){return 0===e.indexOf("mw-card-addon-")});return n?n.replace("mw-card-addon-",""):""}(t):"",l.value=t?function(e){const t=e.querySelector(".mw-avatar-initials");return t?t.textContent.trim():""}(t):"",t?(t.classList.add("mw-kanban-editing"),t.before(n)):e.querySelector(".mw-kanban-column-body").prepend(n),n.classList.add("mw-active"),o.focus()}function f(){n.classList.remove("mw-active"),i&&i.classList.remove("mw-kanban-editing"),i=null}function w(){const t=o.value.trim();if(!t)return void o.focus();const u=i||a.content.firstElementChild.cloneNode(!0);if(u.querySelector(".mw-kanban-card-title").textContent=t,u.querySelector(".mw-kanban-card-text").textContent=r.value.trim(),function(e,t){const n=e.querySelector(".mw-card-ribbon");if(n&&n.remove(),!t||!t.value)return;const a=document.createElement("div");a.className="mw-card-ribbon mw-card-addon-"+t.value,a.textContent=t.textContent,e.prepend(a)}(u,s.selectedOptions[0]),function(e,t){const n=e.querySelector(".mw-kanban-card-actions"),a=n.querySelector(".mw-avatar");if(!t)return void(a&&a.remove());const c=a||document.createElement("div");c.className="mw-avatar mw-avatar-xs mw-avatar-initials",c.textContent=t,a||n.prepend(c)}(u,l.value),!i){const t=function(){const t=Array.from(e.querySelectorAll(".mw-kanban-card-id")).map(function(e){return parseInt(e.textContent.split("-").pop(),10)||0});return c+"-"+(Math.max(0,...t)+1)}();u.classList.add("mw-kanban-card-in"),u.querySelector(".mw-kanban-card-id").textContent=t,u.querySelectorAll("[aria-label]").forEach(function(e){e.setAttribute("aria-label",e.getAttribute("aria-label").replace(/[A-Z]+-\d+/,t))}),n.before(u)}f(),d()}const h=["mw-kanban-card-moved-forward","mw-kanban-card-moved-back"];e.addEventListener("click",function(e){const n=e.target.closest("[data-kanban-move]");if(n){if(function(e,n){const a=e.closest(".mw-kanban-column"),c=t[t.indexOf(a)+n];c&&(c.querySelector(".mw-kanban-column-body").appendChild(e),e.classList.remove.apply(e.classList,h),e.offsetWidth,e.classList.add(n>0?h[0]:h[1]),d())}(n.closest(".mw-kanban-card"),parseInt(n.dataset.kanbanMove,10)),n.disabled){const e=n.parentElement.querySelector("[data-kanban-move]:not(:disabled)");e&&e.focus()}return}const a=e.target.closest(".mw-kanban-edit");if(a){const e=a.closest(".mw-kanban-card");return void m(e.closest(".mw-kanban-column"),e)}const c=e.target.closest(".mw-kanban-delete");if(c){const e=c.closest(".mw-kanban-card");return e===i&&f(),e.remove(),void d()}const o=e.target.closest(".mw-kanban-add");o?m(o.closest(".mw-kanban-column"),null):e.target.closest(".mw-kanban-composer-cancel")&&f()}),n.addEventListener("submit",function(e){e.preventDefault(),w()}),n.addEventListener("keydown",function(e){"Escape"===e.key&&f()}),d()}function c(e){const t=e.querySelector(".mw-calendar-grid"),n=e.querySelector(".mw-calendar-title");if(!t)return;const a="week"===e.dataset.calendar,c=function(e){if(!e)return{};try{return JSON.parse(e)}catch(e){return{}}}(e.dataset.calendarMarkers),o=e.dataset.calendarLocale||document.documentElement.lang||void 0,r=new Date;r.setHours(0,0,0,0);let s=e.dataset.calendarDate?new Date(e.dataset.calendarDate+"T00:00:00"):new Date(r),l=e.dataset.calendarSelected||"";function i(e){const t=new Date(e);return t.setDate(t.getDate()-(t.getDay()+6)%7),t}function d(e){return e.getFullYear()+"-"+String(e.getMonth()+1).padStart(2,"0")+"-"+String(e.getDate()).padStart(2,"0")}function u(){if(!a)return s.toLocaleDateString(o,{month:"long",year:"numeric"});const e=i(s),t=new Date(e);t.setDate(t.getDate()+6);const n=e.toLocaleDateString(o,{day:"numeric",month:e.getMonth()===t.getMonth()?void 0:"short"}),c=t.toLocaleDateString(o,{day:"numeric",month:"short",year:"numeric"});return"Week "+function(e){const t=i(e);t.setDate(t.getDate()+3);const n=i(new Date(t.getFullYear(),0,4));return n.setDate(n.getDate()+3),1+Math.round((t-n)/6048e5)}(e)+" · "+n+" - "+c}function m(e){const t=e.getDay();return 0===t||6===t}function f(e,t){const n=d(e),s=document.createElement("button");s.type="button",s.className="mw-calendar-day",s.tabIndex=-1,s.dataset.calendarDay=n,s.setAttribute("aria-pressed",n===l?"true":"false"),s.setAttribute("aria-label",e.toLocaleDateString(o,{weekday:"long",day:"numeric",month:"long",year:"numeric"})),m(e)&&s.classList.add("mw-calendar-weekend"),a||e.getMonth()===t||s.classList.add("mw-calendar-adjacent"),n===d(r)&&(s.classList.add("mw-calendar-today"),s.setAttribute("aria-current","date")),n===l&&s.classList.add("mw-selected");const i=document.createElement("span");i.className="mw-calendar-date",i.textContent=e.getDate(),s.appendChild(i);const u=[].concat(c[n]||[]);if(u.length){const e=document.createElement("span");e.className="mw-calendar-dots",u.forEach(function(t){const n=document.createElement("span");n.className=t?"mw-calendar-dot mw-calendar-dot-"+t:"mw-calendar-dot",e.appendChild(n)}),s.appendChild(e)}return s}function w(){const e=s.getMonth(),c=a?7:42,r=i(a?s:new Date(s.getFullYear(),e,1));t.innerHTML="",function(){const e=i(new Date);for(let n=0;n<7;n++){const n=document.createElement("div");n.className="mw-calendar-weekday",m(e)&&n.classList.add("mw-calendar-weekend"),n.setAttribute("aria-hidden","true"),n.textContent=e.toLocaleDateString(o,{weekday:"short"}),t.appendChild(n),e.setDate(e.getDate()+1)}}();for(let n=0;n<c;n++)t.appendChild(f(r,e)),r.setDate(r.getDate()+1);n&&(n.textContent=u()),function(){const e=t.querySelector(".mw-selected")||t.querySelector(".mw-calendar-today")||t.querySelector(".mw-calendar-day:not(.mw-calendar-adjacent)")||t.querySelector(".mw-calendar-day");e&&(e.tabIndex=0)}()}e.addEventListener("click",function(n){const c=n.target.closest("[data-calendar-nav]");if(c)return o=parseInt(c.dataset.calendarNav,10),a?s.setDate(s.getDate()+7*o):s=new Date(s.getFullYear(),s.getMonth()+o,1),void w();var o;const r=n.target.closest(".mw-calendar-day");var i;r&&!r.disabled&&(i=r.dataset.calendarDay,l=i===l?"":i,t.querySelectorAll(".mw-calendar-day").forEach(function(e){const t=e.dataset.calendarDay===l;e.classList.toggle("mw-selected",t),e.setAttribute("aria-pressed",t?"true":"false")}),e.dispatchEvent(new CustomEvent("mw-calendar-select",{bubbles:!0,detail:{date:l}})))}),t.addEventListener("keydown",function(e){const n={ArrowLeft:-1,ArrowRight:1,ArrowUp:-7,ArrowDown:7}[e.key];if(!n)return;const a=e.target.closest(".mw-calendar-day");if(!a)return;e.preventDefault();const c=new Date(a.dataset.calendarDay+"T00:00:00");c.setDate(c.getDate()+n),function(e){const n=d(e);let a=t.querySelector('[data-calendar-day="'+n+'"]');a||(s=new Date(e),w(),a=t.querySelector('[data-calendar-day="'+n+'"]')),a&&(t.querySelectorAll(".mw-calendar-day").forEach(function(e){e.tabIndex=-1}),a.tabIndex=0,a.focus())}(c)}),w()}document.addEventListener("DOMContentLoaded",function(){document.querySelectorAll(".mw-gallery").forEach(e=>{const t=e.closest(".mw-gallery-container")||e.parentElement;t&&function(e,t){const n=t.querySelector(".mw-gallery-track");if(!n||!n.children.length)return;const a=n.children,c=e.querySelector(".mw-gallery-dots"),o=e.querySelector(".mw-gallery-desc"),r=t.querySelector(".mw-gallery-navi-prev"),s=t.querySelector(".mw-gallery-navi-next");let l=0;function i(e){const t=a.length;l=(e+t)%t,n.style.transform=`translateX(-${100*l}%)`,c&&c.querySelectorAll(".mw-gallery-dot").forEach((e,t)=>{e.classList.toggle("mw-active",t===l)}),o&&(o.textContent=a[l].dataset.desc||"")}if(c)for(let e=0;e<a.length;e++){const t=document.createElement("button");t.type="button",t.className="mw-gallery-dot"+(0===e?" mw-active":""),t.setAttribute("aria-label","Go to slide "+(e+1)),t.addEventListener("click",()=>i(e)),c.appendChild(t)}r&&r.addEventListener("click",()=>i(l-1)),s&&s.addEventListener("click",()=>i(l+1));let d=0;n.addEventListener("touchstart",e=>d=e.touches[0].clientX),n.addEventListener("touchend",e=>{const t=e.changedTouches[0].clientX-d;t>50&&i(l-1),t<-50&&i(l+1)}),i(0)}(t,e)}),function(){const t=document.querySelector(".mw-theme-toggle");if(!t)return;const a=document.body,c=t.querySelector(".mw-theme-toggle-slider i"),o=getComputedStyle(document.documentElement).getPropertyValue("--mw-internal-theme-mode").trim()||"switchable";if("switchable"!==o)return console.log(`Theme mode fixed to: ${o}. Disabling toggle.`),c&&(c.className="light"===o?"fas fa-sun":"fas fa-moon"),e(t,"light"===o),t.style.opacity="0.4",t.style.pointerEvents="none",t.style.cursor="default",t.setAttribute("aria-disabled","true"),localStorage.removeItem("mw-theme"),void("dark"===o&&a.classList.remove("mw-theme-light"));let r="light"===localStorage.getItem("mw-theme");const s=n=>{a.classList.toggle("mw-theme-light",n),e(t,n),c&&(c.className=n?"fas fa-sun":"fas fa-moon")};s(r),t.addEventListener("click",()=>{r=!r,s(r),localStorage.setItem("mw-theme",r?"light":"dark"),setTimeout(n,400)})}(),n(),document.querySelectorAll(".mw-accordion-header").forEach(n=>{const a="BUTTON"===n.tagName;a&&n.setAttribute("aria-expanded",String(t(n))),n.addEventListener("click",function(){const n=!t(this);e(this,n),e(this.nextElementSibling,n),a&&this.setAttribute("aria-expanded",String(n))})}),function(){const e=document.querySelector(".mw-menu-btn"),t=document.querySelector(".mw-navbar");if(!e||!t)return;function n(){e.classList.remove("open"),t.classList.remove("open")}function a(n){n.preventDefault(),n.stopPropagation(),e.classList.toggle("open"),t.classList.toggle("open")}e.addEventListener("click",a),e.addEventListener("touchstart",a,{passive:!1}),document.addEventListener("click",function(a){t.classList.contains("open")&&(t.contains(a.target)||e.contains(a.target)||n())}),document.addEventListener("keydown",function(e){"Escape"===e.key&&n()})}(),function(){const e=document.querySelectorAll(".mw-progress-fill");if(!e.length)return;const t=new IntersectionObserver((e,t)=>{e.forEach(e=>{if(!e.isIntersecting)return;const n=e.target,a=n.dataset.value||0;n.style.width=a+"%",t.unobserve(n)})},{root:null,threshold:.2});e.forEach(e=>t.observe(e))}(),document.querySelectorAll('a[href^="#"]').forEach(e=>{e.addEventListener("click",function(e){const t=this.getAttribute("href");if("#"===t)return;if(!document.querySelector(t))return;const n=document.querySelector(".mw-menu-btn"),a=document.querySelector(".mw-navbar");n&&a&&(n.classList.remove("open"),a.classList.remove("open"))})}),function(){const t=document.querySelectorAll("section[id]"),n=document.querySelectorAll(".mw-navbar-link");if(0===t.length||0===n.length)return;window.addEventListener("scroll",function(e,t){let n;return function(){const a=this,c=arguments;clearTimeout(n),n=setTimeout(()=>e.apply(a,c),t)}}(function(){let a="";t.forEach(e=>{const t=e.offsetTop-100,n=e.clientHeight;scrollY>=t&&scrollY<t+n&&(a=e.getAttribute("id"))}),n.forEach(t=>{e(t,!1);const n=t.getAttribute("href");if(n){const c=n.indexOf("#");if(-1!==c){n.substring(c+1)===a&&e(t,!0)}}})},100))}(),document.querySelectorAll(".mw-tabs-nav-item").forEach(t=>{t.addEventListener("click",function(){const t=this.closest(".mw-tabs");if(!t)return;t.querySelectorAll(".mw-tabs-nav-item").forEach(t=>{e(t,!1)}),e(this,!0);const n=this.getAttribute("data-tab");n&&(t.querySelectorAll(".mw-tabs-panel").forEach(t=>{e(t,!1)}),e(document.getElementById(n),!0))})}),document.querySelectorAll(".mw-alert-close").forEach(e=>{e.addEventListener("click",function(){const e=this.closest(".mw-alert");e&&(e.classList.add("mw-alert-closing"),setTimeout(()=>{e.classList.add("mw-alert-closed")},300))})}),function(){const e=document.querySelector(".mw-localhost-indicator-activated"),t=document.querySelector(".mw-header");if(e){if("localhost"===window.location.hostname||"127.0.0.1"===window.location.hostname||window.location.hostname.includes("192.168.")){const e=document.createElement("div");e.className="mw-localhost-indicator-pulse",t.prepend(e)}}}(),document.querySelectorAll(".mw-slider-container").forEach(e=>{const t=e.querySelector(".mw-slider"),n=e.querySelector(".mw-slider-value");if(!t||!n)return;const a=()=>{const e=Number(t.value),a=Number(t.max)||100,c=Math.round(e/a*100);t.style.setProperty("--value",c+"%"),n.classList.contains("mw-slider-numeric")?n.setAttribute("data-value",e):n.setAttribute("data-value",c)};t.addEventListener("input",a),a()}),document.querySelectorAll(".mw-modal-close").forEach(e=>{e.addEventListener("click",function(){const e=this.closest(".mw-modal-overlay");e&&e.classList.remove("mw-modal-open")})}),function(){const e=document.getElementById("login-button");e&&e.addEventListener("click",function(){const e=this.querySelector("i");e.classList.contains("fa-lock")?(e.classList.remove("fa-lock"),e.classList.add("fa-lock-open")):(e.classList.remove("fa-lock-open"),e.classList.add("fa-lock"))})}(),document.querySelectorAll(".mw-image-slider").forEach(t=>{const n=t.querySelectorAll(".mw-image-slider-overlay-image"),a=t.querySelectorAll("button[data-index]");if(!n.length||!a.length)return;let c=0;function o(){n.forEach(t=>{e(t,parseInt(t.dataset.index)===c)}),a.forEach(t=>{e(t,parseInt(t.dataset.index)===c)})}function r(e){c=e,o()}a.forEach(e=>{e.addEventListener("click",()=>{r(parseInt(e.dataset.index))})}),o()}),document.querySelectorAll(".mw-item-list-checkbox, .mw-item-list-checkbox-scroll").forEach(e=>{e.querySelectorAll("li").forEach(e=>{const t=e.querySelector('input[type="checkbox"]'),n=e.querySelector(".mw-checkbox");t&&n&&(t.checked&&e.classList.add("mw-selected"),e.addEventListener("click",function(e){e.target!==t&&e.target.closest(".mw-checkbox")!==n&&toggleCheckbox(this)}),t.addEventListener("change",function(){const e=this.closest("li");this.checked?e.classList.add("mw-selected"):e.classList.remove("mw-selected"),e.dispatchEvent(new CustomEvent("checkboxToggle",{detail:{checked:this.checked,item:e}}))}),n.addEventListener("click",function(e){setTimeout(()=>{const e=this.closest("li");this.querySelector('input[type="checkbox"]').checked?e.classList.add("mw-selected"):e.classList.remove("mw-selected")},0)}))})}),document.addEventListener("checkboxToggle",function(e){console.log("Checkbox toggled:",e.detail.checked,e.detail.item)}),document.querySelectorAll(".mw-kanban").forEach(a),document.querySelectorAll("[data-calendar]").forEach(c),function(){function e(e){document.querySelectorAll(".mw-dropdown[open]").forEach(t=>{t!==e&&t.removeAttribute("open")})}document.addEventListener("click",function(t){const n=t.target.closest(".mw-dropdown");e(n),n&&t.target.closest(".mw-dropdown-item")&&n.removeAttribute("open")}),document.addEventListener("keydown",function(e){if("Escape"!==e.key)return;const t=document.querySelector(".mw-dropdown[open]");if(!t)return;t.removeAttribute("open");const n=t.querySelector("summary");n&&n.focus()})}()}),window.toggleCheckbox=function(e){const t=e.querySelector('input[type="checkbox"]');if(!t)return;const n=t.checked;t.checked=!n,t.checked?e.classList.add("mw-selected"):e.classList.remove("mw-selected"),e.dispatchEvent(new CustomEvent("checkboxToggle",{detail:{checked:t.checked,item:e}}))}}();
|
package/package.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "maverick-wave",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.13.0",
|
|
4
4
|
"config": {
|
|
5
|
-
"version_short": "4.
|
|
5
|
+
"version_short": "4.13"
|
|
6
6
|
},
|
|
7
7
|
"description": "A lightweight, modern CSS framework for building responsive websites with elegance and speed.",
|
|
8
8
|
"main": "src/js/main.js",
|
package/src/js/main.js
CHANGED
|
@@ -383,10 +383,18 @@
|
|
|
383
383
|
function initAccordions() {
|
|
384
384
|
const accordionHeaders = document.querySelectorAll('.mw-accordion-header');
|
|
385
385
|
accordionHeaders.forEach((header) => {
|
|
386
|
+
// A header written as a <button> announces whether its panel is open.
|
|
387
|
+
// Only when the markup says so - setting it on a <div> without a role
|
|
388
|
+
// would claim a state for something that is not a control.
|
|
389
|
+
const announces = header.tagName === 'BUTTON';
|
|
390
|
+
if (announces) {
|
|
391
|
+
header.setAttribute('aria-expanded', String(isActive(header)));
|
|
392
|
+
}
|
|
386
393
|
header.addEventListener('click', function () {
|
|
387
394
|
const open = !isActive(this);
|
|
388
395
|
setActive(this, open);
|
|
389
396
|
setActive(this.nextElementSibling, open);
|
|
397
|
+
if (announces) this.setAttribute('aria-expanded', String(open));
|
|
390
398
|
});
|
|
391
399
|
});
|
|
392
400
|
}
|
|
@@ -7,11 +7,16 @@
|
|
|
7
7
|
|
|
8
8
|
<div class="mw-accordion">
|
|
9
9
|
<div class="mw-accordion-item">
|
|
10
|
-
<
|
|
11
|
-
|
|
10
|
+
<button
|
|
11
|
+
type="button"
|
|
12
|
+
class="mw-accordion-header mw-active"
|
|
13
|
+
aria-expanded="true"
|
|
14
|
+
aria-controls="mw-accordion-panel-1"
|
|
15
|
+
>
|
|
16
|
+
<span>What is MaverickWave?</span>
|
|
12
17
|
<i class="fas fa-chevron-down mw-accordion-icon"></i>
|
|
13
|
-
</
|
|
14
|
-
<div class="mw-accordion-content mw-active">
|
|
18
|
+
</button>
|
|
19
|
+
<div class="mw-accordion-content mw-active" id="mw-accordion-panel-1">
|
|
15
20
|
<div class="mw-accordion-content-inner">
|
|
16
21
|
<p>
|
|
17
22
|
MaverickWave is a lightweight, responsive CSS framework designed for
|
|
@@ -24,11 +29,16 @@
|
|
|
24
29
|
</div>
|
|
25
30
|
|
|
26
31
|
<div class="mw-accordion-item">
|
|
27
|
-
<
|
|
28
|
-
|
|
32
|
+
<button
|
|
33
|
+
type="button"
|
|
34
|
+
class="mw-accordion-header"
|
|
35
|
+
aria-expanded="false"
|
|
36
|
+
aria-controls="mw-accordion-panel-2"
|
|
37
|
+
>
|
|
38
|
+
<span>How do I customize MaverickWave?</span>
|
|
29
39
|
<i class="fas fa-chevron-down mw-accordion-icon"></i>
|
|
30
|
-
</
|
|
31
|
-
<div class="mw-accordion-content">
|
|
40
|
+
</button>
|
|
41
|
+
<div class="mw-accordion-content" id="mw-accordion-panel-2">
|
|
32
42
|
<div class="mw-accordion-content-inner">
|
|
33
43
|
<p>
|
|
34
44
|
MaverickWave offers two main ways to customize its appearance to match
|
|
@@ -84,7 +94,7 @@
|
|
|
84
94
|
<button
|
|
85
95
|
type="button"
|
|
86
96
|
onclick="location.href = '#get-started'"
|
|
87
|
-
class="mw-
|
|
97
|
+
class="mw-link"
|
|
88
98
|
>
|
|
89
99
|
See the "Get Started" section
|
|
90
100
|
</button>
|
|
@@ -95,11 +105,16 @@
|
|
|
95
105
|
</div>
|
|
96
106
|
|
|
97
107
|
<div class="mw-accordion-item">
|
|
98
|
-
<
|
|
99
|
-
|
|
108
|
+
<button
|
|
109
|
+
type="button"
|
|
110
|
+
class="mw-accordion-header"
|
|
111
|
+
aria-expanded="false"
|
|
112
|
+
aria-controls="mw-accordion-panel-3"
|
|
113
|
+
>
|
|
114
|
+
<span>Is MaverickWave responsive?</span>
|
|
100
115
|
<i class="fas fa-chevron-down mw-accordion-icon"></i>
|
|
101
|
-
</
|
|
102
|
-
<div class="mw-accordion-content">
|
|
116
|
+
</button>
|
|
117
|
+
<div class="mw-accordion-content" id="mw-accordion-panel-3">
|
|
103
118
|
<div class="mw-accordion-content-inner">
|
|
104
119
|
<p>
|
|
105
120
|
Yes, MaverickWave CSS framework is fully responsive and works on all
|
|
@@ -112,11 +127,16 @@
|
|
|
112
127
|
</div>
|
|
113
128
|
|
|
114
129
|
<div class="mw-accordion-item">
|
|
115
|
-
<
|
|
116
|
-
|
|
130
|
+
<button
|
|
131
|
+
type="button"
|
|
132
|
+
class="mw-accordion-header"
|
|
133
|
+
aria-expanded="false"
|
|
134
|
+
aria-controls="mw-accordion-panel-4"
|
|
135
|
+
>
|
|
136
|
+
<span>Scrollable Content Example</span>
|
|
117
137
|
<i class="fas fa-chevron-down mw-accordion-icon"></i>
|
|
118
|
-
</
|
|
119
|
-
<div class="mw-accordion-content">
|
|
138
|
+
</button>
|
|
139
|
+
<div class="mw-accordion-content" id="mw-accordion-panel-4">
|
|
120
140
|
<div class="mw-accordion-content-inner">
|
|
121
141
|
<p>
|
|
122
142
|
This accordion panel demonstrates scrollable content when the content
|
|
@@ -219,7 +219,8 @@
|
|
|
219
219
|
request row, a modal backdrop. It brings nothing but the focus ring and the
|
|
220
220
|
pointer; everything else it inherits. Not the same as
|
|
221
221
|
<code>mw-btn-link</code>, which is a button dressed as a link with a colour
|
|
222
|
-
and a
|
|
222
|
+
and a control height of its own, nor the same as <code>mw-link</code>, which
|
|
223
|
+
is the link inside a sentence.
|
|
223
224
|
</p>
|
|
224
225
|
<div class="mw-card mw-card-simple">
|
|
225
226
|
<p class="mw-mb-4">
|
|
@@ -236,6 +237,28 @@
|
|
|
236
237
|
</div>
|
|
237
238
|
</div>
|
|
238
239
|
|
|
240
|
+
<h3 class="mw-mb-4 mw-mt-6">Text Links</h3>
|
|
241
|
+
<p class="mw-text-muted">
|
|
242
|
+
<code>mw-link</code> is the link inside a sentence,
|
|
243
|
+
<code>mw-link-muted</code> the quieter one. Same look as
|
|
244
|
+
<code>mw-btn-link</code>, without the button: <code>mw-btn</code> carries a
|
|
245
|
+
control height, and in running text that lifts the one line the link sits on
|
|
246
|
+
above every line around it - glaring in a footer disclaimer, where the text is
|
|
247
|
+
a size smaller to begin with. So <code>mw-link</code> in a paragraph,
|
|
248
|
+
<code>mw-btn mw-btn-link</code> where the link really is one of several
|
|
249
|
+
buttons and has to line up with them. Both work on an
|
|
250
|
+
<code><a></code> and on a <code><button></code>.
|
|
251
|
+
</p>
|
|
252
|
+
<div class="mw-card mw-card-simple">
|
|
253
|
+
<p class="mw-mb-0">
|
|
254
|
+
Built with
|
|
255
|
+
<a href="https://astro.build" target="_blank" class="mw-link">Astro</a>
|
|
256
|
+
and written up in the
|
|
257
|
+
<a href="#get-started" class="mw-link-muted">Get Started</a> section - both
|
|
258
|
+
sit on the line, not above it.
|
|
259
|
+
</p>
|
|
260
|
+
</div>
|
|
261
|
+
|
|
239
262
|
<h3 class="mw-mb-4 mw-mt-6">Touch Targets</h3>
|
|
240
263
|
<p class="mw-text-muted">
|
|
241
264
|
On a coarse pointer or below 768px the compact controls grow to a size a thumb
|
|
@@ -117,17 +117,11 @@ function Counter() {
|
|
|
117
117
|
<p>
|
|
118
118
|
For automatic highlighting of various languages, integrate a dedicated
|
|
119
119
|
JavaScript library like
|
|
120
|
-
<a
|
|
121
|
-
href="https://prismjs.com/"
|
|
122
|
-
target="_blank"
|
|
123
|
-
class="mw-btn mw-btn-link mw-p-0"
|
|
120
|
+
<a href="https://prismjs.com/" target="_blank" class="mw-link"
|
|
124
121
|
>Prism.js</a
|
|
125
122
|
>
|
|
126
123
|
or
|
|
127
|
-
<a
|
|
128
|
-
href="https://highlightjs.org/"
|
|
129
|
-
target="_blank"
|
|
130
|
-
class="mw-btn mw-btn-link mw-p-0"
|
|
124
|
+
<a href="https://highlightjs.org/" target="_blank" class="mw-link"
|
|
131
125
|
>Highlight.js</a
|
|
132
126
|
>.
|
|
133
127
|
</p>
|
|
@@ -101,13 +101,7 @@
|
|
|
101
101
|
|
|
102
102
|
<p class="mw-copyright">
|
|
103
103
|
© <span>{{LAST_BUILD_YEAR}}</span> MaverickWave v{{VERSION}} - by
|
|
104
|
-
<a
|
|
105
|
-
href="https://m1well.com"
|
|
106
|
-
target="_blank"
|
|
107
|
-
class="mw-btn mw-btn-link mw-px-0 mw-py-0"
|
|
108
|
-
>
|
|
109
|
-
m1well
|
|
110
|
-
</a>
|
|
104
|
+
<a href="https://m1well.com" target="_blank" class="mw-link"> m1well </a>
|
|
111
105
|
</p>
|
|
112
106
|
|
|
113
107
|
<p class="mw-last-updated">Last updated: <span>{{LAST_BUILD_DATE}}</span></p>
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
@use 'sass:list';
|
|
1
2
|
@use 'sass:map';
|
|
2
3
|
@use 'variables' as v;
|
|
3
4
|
|
|
@@ -35,3 +36,20 @@
|
|
|
35
36
|
@function z-index($key) {
|
|
36
37
|
@return map.get(v.$z-index, $key);
|
|
37
38
|
}
|
|
39
|
+
|
|
40
|
+
// The value behind --mw-transition and --mw-transition-fast. A shorthand list
|
|
41
|
+
// carries duration and easing per entry, not once for the whole list: written
|
|
42
|
+
// as `color, background-color, transform 300ms ease` only transform animates
|
|
43
|
+
// and the two before it fall back to 0s. So the duration is appended to every
|
|
44
|
+
// property here instead of to the tail of the list.
|
|
45
|
+
@function transition-list($duration) {
|
|
46
|
+
$result: ();
|
|
47
|
+
@each $property in v.$transition-properties {
|
|
48
|
+
$result: list.append(
|
|
49
|
+
$result,
|
|
50
|
+
#{$property} var(#{$duration}) var(--mw-ease-out),
|
|
51
|
+
comma
|
|
52
|
+
);
|
|
53
|
+
}
|
|
54
|
+
@return $result;
|
|
55
|
+
}
|
|
@@ -253,3 +253,20 @@
|
|
|
253
253
|
box-shadow: none;
|
|
254
254
|
}
|
|
255
255
|
}
|
|
256
|
+
|
|
257
|
+
// The look a link has: no box of its own, the underline only on hover, and it
|
|
258
|
+
// sits a little lower than the browser's default so a descender does not cross
|
|
259
|
+
// it. Shared by `mw-link` in running text and `mw-btn-link` in a row of
|
|
260
|
+
// buttons - the two differ in whether they carry a control height, not in how
|
|
261
|
+
// they look.
|
|
262
|
+
@mixin link-look {
|
|
263
|
+
background: transparent;
|
|
264
|
+
border: none;
|
|
265
|
+
padding: 0;
|
|
266
|
+
text-underline-offset: 0.22em;
|
|
267
|
+
text-decoration-thickness: 1.5px;
|
|
268
|
+
|
|
269
|
+
&:hover:not(:disabled) {
|
|
270
|
+
text-decoration: underline;
|
|
271
|
+
}
|
|
272
|
+
}
|
package/src/scss/base/_base.scss
CHANGED
|
@@ -50,12 +50,12 @@ $_active-prefix: 'dark';
|
|
|
50
50
|
|
|
51
51
|
// The workhorse: every hover, focus and active state in the framework. An
|
|
52
52
|
// explicit property list rather than `all` - see $transition-properties.
|
|
53
|
-
|
|
54
|
-
|
|
53
|
+
// Built through transition-list(), which repeats the duration on every
|
|
54
|
+
// property: a shorthand list only reads it on the entry it stands behind.
|
|
55
|
+
--mw-transition: #{transition-list('--mw-duration-base')};
|
|
55
56
|
// Same list, for a state change that should feel instant under the pointer
|
|
56
57
|
// rather than animated - a button label, a tag, a table row.
|
|
57
|
-
--mw-transition-fast: #{
|
|
58
|
-
var(--mw-ease-out);
|
|
58
|
+
--mw-transition-fast: #{transition-list('--mw-duration-fast')};
|
|
59
59
|
|
|
60
60
|
// Control sizes - see the note in the variables file. Custom properties
|
|
61
61
|
// rather than compile-time only, so an application can tighten its forms
|
|
@@ -11,8 +11,7 @@
|
|
|
11
11
|
html {
|
|
12
12
|
scroll-behavior: smooth;
|
|
13
13
|
min-width: 320px;
|
|
14
|
-
|
|
15
|
-
scroll-padding-top: calc(var(--mw-header-height) + #{spacing('4')});
|
|
14
|
+
scroll-padding-top: var(--mw-header-height);
|
|
16
15
|
-webkit-text-size-adjust: 100%;
|
|
17
16
|
text-size-adjust: 100%;
|
|
18
17
|
@include scrollbar(var(--mw-border), transparent);
|
|
@@ -95,12 +94,6 @@ canvas {
|
|
|
95
94
|
max-width: 100%;
|
|
96
95
|
}
|
|
97
96
|
|
|
98
|
-
// Anchored headings clear the fixed bar the same way html's scroll-padding does,
|
|
99
|
-
// for the case where a script scrolls an element into view itself.
|
|
100
|
-
:target {
|
|
101
|
-
scroll-margin-top: calc(var(--mw-header-height) + #{spacing('4')});
|
|
102
|
-
}
|
|
103
|
-
|
|
104
97
|
table {
|
|
105
98
|
border-collapse: collapse;
|
|
106
99
|
width: 100%;
|
|
@@ -14,7 +14,29 @@
|
|
|
14
14
|
}
|
|
15
15
|
}
|
|
16
16
|
|
|
17
|
+
// Written for a <button>. The header is the control that opens the panel, and
|
|
18
|
+
// as a <div> it is not focusable and not reachable by keyboard - on a page of
|
|
19
|
+
// questions that is every answer on it. The declarations below clear what
|
|
20
|
+
// comes with a <button>; on a <div> they change nothing, so old markup keeps
|
|
21
|
+
// working.
|
|
17
22
|
&-header {
|
|
23
|
+
appearance: none;
|
|
24
|
+
border: none;
|
|
25
|
+
width: 100%;
|
|
26
|
+
font: inherit;
|
|
27
|
+
color: inherit;
|
|
28
|
+
text-align: left;
|
|
29
|
+
|
|
30
|
+
// A heading is flow content and not allowed inside a button, so the
|
|
31
|
+
// question carries its own type here rather than through a nested h3. The
|
|
32
|
+
// h3 rule further down keeps older markup looking the same.
|
|
33
|
+
font-size: font-size('md');
|
|
34
|
+
font-weight: font-weight('medium');
|
|
35
|
+
|
|
36
|
+
@include media-down('sm') {
|
|
37
|
+
font-size: font-size('sm');
|
|
38
|
+
}
|
|
39
|
+
|
|
18
40
|
padding: spacing('4');
|
|
19
41
|
background: var(--mw-card-background);
|
|
20
42
|
cursor: pointer;
|
|
@@ -37,14 +59,12 @@
|
|
|
37
59
|
background: var(--mw-primary-background-hover);
|
|
38
60
|
}
|
|
39
61
|
|
|
62
|
+
// Markup from before the button: the header carries the type now, the
|
|
63
|
+
// heading only has to stop bringing its own.
|
|
40
64
|
h3 {
|
|
41
65
|
margin: spacing('0');
|
|
42
|
-
font-size:
|
|
43
|
-
font-weight:
|
|
44
|
-
|
|
45
|
-
@include media-down('sm') {
|
|
46
|
-
font-size: font-size('sm');
|
|
47
|
-
}
|
|
66
|
+
font-size: inherit;
|
|
67
|
+
font-weight: inherit;
|
|
48
68
|
}
|
|
49
69
|
|
|
50
70
|
.mw-accordion-icon {
|
|
@@ -111,17 +111,12 @@
|
|
|
111
111
|
}
|
|
112
112
|
}
|
|
113
113
|
|
|
114
|
+
// A button that looks like a link but is still a button: it keeps the control
|
|
115
|
+
// height, so it lines up with the Save next to it in a card's actions or a
|
|
116
|
+
// button bar. A link inside a sentence is `mw-link` instead - see _links.scss.
|
|
114
117
|
.mw-btn-link,
|
|
115
118
|
.mw-btn-link-muted {
|
|
116
|
-
|
|
117
|
-
border: none;
|
|
118
|
-
padding: 0;
|
|
119
|
-
text-underline-offset: 0.22em;
|
|
120
|
-
text-decoration-thickness: 1.5px;
|
|
121
|
-
|
|
122
|
-
&:hover:not(:disabled) {
|
|
123
|
-
text-decoration: underline;
|
|
124
|
-
}
|
|
119
|
+
@include link-look;
|
|
125
120
|
}
|
|
126
121
|
|
|
127
122
|
.mw-btn-link {
|
|
@@ -220,7 +215,8 @@
|
|
|
220
215
|
// the right element and a button is the wrong look.
|
|
221
216
|
//
|
|
222
217
|
// Not the same as `mw-btn-link`: that one is a button dressed as a link, with
|
|
223
|
-
// its own colour and a
|
|
218
|
+
// its own colour and a control height. Nor `mw-link`, which is the link inside
|
|
219
|
+
// a sentence. This one has no look at all.
|
|
224
220
|
.mw-btn-plain {
|
|
225
221
|
display: inline-flex;
|
|
226
222
|
align-items: center;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
@use '../abstracts' as *;
|
|
2
|
+
|
|
3
|
+
// A link inside a sentence. Same look as `mw-btn-link`, but none of the button:
|
|
4
|
+
// no `inline-flex`, no control height. That difference is the whole point -
|
|
5
|
+
// `mw-btn` lifts its line to 2.25rem, which is barely visible in a heading and
|
|
6
|
+
// glaring in a footer disclaimer, where the line around it is half that.
|
|
7
|
+
//
|
|
8
|
+
// So: `mw-link` in running text, `mw-btn mw-btn-link` where the link really is
|
|
9
|
+
// one of several buttons and has to line up with them.
|
|
10
|
+
//
|
|
11
|
+
// `font` and the focus ring are spelled out because this also has to work on a
|
|
12
|
+
// `<button>` - a "show more" in the middle of a paragraph is a button, and the
|
|
13
|
+
// reset hands it the family but not the size. The shorthand carries the line
|
|
14
|
+
// height along, which is what makes the button box come out exactly as tall as
|
|
15
|
+
// the line it sits in. It stays one unbreakable box either way, since no
|
|
16
|
+
// browser lets a `<button>` wrap - use an `<a>` where the label is long enough
|
|
17
|
+
// to need it.
|
|
18
|
+
.mw-link,
|
|
19
|
+
.mw-link-muted {
|
|
20
|
+
font: inherit;
|
|
21
|
+
|
|
22
|
+
@include link-look;
|
|
23
|
+
@include focus-ring;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
.mw-link {
|
|
27
|
+
color: var(--mw-primary-text-color);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
.mw-link-muted {
|
|
31
|
+
color: var(--mw-text-muted-color);
|
|
32
|
+
&:hover {
|
|
33
|
+
color: var(--mw-primary-text-color);
|
|
34
|
+
}
|
|
35
|
+
}
|