material-inspired-component-library 2.0.0 → 3.0.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/CODE_OF_CONDUCT.md +128 -0
- package/README.md +14 -0
- package/components/README.md +2 -0
- package/components/appbar/README.md +94 -0
- package/components/appbar/index.scss +216 -0
- package/components/badge/README.md +5 -5
- package/components/badge/index.scss +20 -27
- package/components/bottomsheet/README.md +29 -17
- package/components/bottomsheet/index.scss +23 -23
- package/components/bottomsheet/index.ts +25 -24
- package/components/button/README.md +1 -1
- package/components/button/index.scss +70 -65
- package/components/button/index.ts +1 -1
- package/components/card/index.scss +1 -1
- package/components/checkbox/index.scss +4 -0
- package/components/dialog/README.md +9 -9
- package/components/iconbutton/index.scss +111 -111
- package/components/iconbutton/index.ts +1 -1
- package/components/navigationrail/README.md +16 -16
- package/components/navigationrail/index.scss +20 -12
- package/components/radio/index.scss +1 -1
- package/components/sidesheet/README.md +32 -17
- package/components/sidesheet/index.scss +43 -47
- package/components/slider/README.md +5 -5
- package/dist/appbar.css +1 -0
- package/dist/appbar.js +1 -0
- package/dist/badge.css +1 -1
- package/dist/bottomsheet.css +1 -1
- package/dist/button.css +1 -1
- package/dist/card.css +1 -1
- package/dist/checkbox.css +1 -1
- package/dist/dialog.css +1 -1
- package/dist/iconbutton.css +1 -1
- package/dist/list.css +1 -1
- package/dist/micl.css +1 -1
- package/dist/micl.js +1 -1
- package/dist/navigationrail.css +1 -1
- package/dist/radio.css +1 -1
- package/dist/select.css +1 -1
- package/dist/sidesheet.css +1 -1
- package/dist/slider.css +1 -1
- package/dist/switch.css +1 -1
- package/dist/textfield.css +1 -1
- package/docs/accordion.html +298 -254
- package/docs/bottomsheet.html +194 -114
- package/docs/button.html +210 -182
- package/docs/card.html +107 -72
- package/docs/checkbox.html +92 -65
- package/docs/dialog.html +154 -123
- package/docs/divider.html +96 -67
- package/docs/docs.css +14 -24
- package/docs/docs.js +4 -2
- package/docs/iconbutton.html +196 -171
- package/docs/index.html +298 -288
- package/docs/list.html +260 -216
- package/docs/menu.html +260 -220
- package/docs/micl.css +1 -1
- package/docs/micl.js +1 -1
- package/docs/navigationrail.html +38 -36
- package/docs/radio.html +93 -68
- package/docs/select.html +213 -173
- package/docs/sidesheet.html +105 -73
- package/docs/slider.html +105 -72
- package/docs/switch.html +126 -101
- package/docs/textfield.html +181 -138
- package/layout/README.md +122 -0
- package/layout/index.scss +258 -0
- package/package.json +1 -1
- package/styles/statelayer.scss +2 -0
- package/styles.scss +13 -0
- package/styles/layout.scss +0 -74
package/docs/micl.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.micl=t():e.micl=t()}(self,()=>(()=>{"use strict";var e={d:(t,n)=>{for(var o in n)e.o(n,o)&&!e.o(t,o)&&Object.defineProperty(t,o,{enumerable:!0,get:n[o]})},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={};return(()=>{e.r(t),e.d(t,{default:()=>v});const n="dialog.micl-bottomsheet",o=(()=>{var e=0;const t=t=>{let n=parseInt(window.getComputedStyle(t).getPropertyValue("max-height")),o=(t.dataset.snapheights||"").split(",").map(Number).filter(e=>!isNaN(e)&&e>0&&e<=n);return e||(e=t.getBoundingClientRect().height),[...new Set(o.concat([e,n]).sort())]},n=(e,n)=>{let o=e.getBoundingClientRect().height,i=t(e);return i.filter(e=>e>o+4)[0]||i[n?i.length-1:0]},o=(e,t)=>{e.style.setProperty("--md-sys-bottomsheet-height",`${t}px`)};return{initialize:e=>{if(!e.matches("dialog.micl-bottomsheet")||e.dataset.miclinitialized)return;e.dataset.miclinitialized="1";const i=e.querySelector(".micl-bottomsheet__headline");if(!i)return;const r=i.querySelector(".micl-bottomsheet__draghandle");r?.addEventListener("click",()=>{const t=n(e,!1);t>4&&o(e,t)});let l,a,s=!1,c=!1;function m(t){const n=t.clientY;s&&Math.abs(l-n)>4&&(s=!1,c=!0,e.classList.add("micl-bottomsheet--resizing")),c&&o(e,a+l-n)}function d(i){s=!1,e.classList.remove("micl-bottomsheet--resizing"),c&&(c=!1,i.clientY<l?o(e,n(e,!0)):e.getBoundingClientRect().height<48?(e.popover&&e.hidePopover(),o(e,a)):o(e,(e=>{let n=e.getBoundingClientRect().height,o=t(e),i=o.filter(e=>e<n-4);return i[i.length-1]||o[0]})(e)),document.removeEventListener("mousemove",m),document.removeEventListener("mouseup",d))}i.addEventListener("mousedown",t=>{t.eventPhase===Event.AT_TARGET&&(s=!0,t.preventDefault(),l=t.clientY,a=e.getBoundingClientRect().height,document.addEventListener("mousemove",m),document.addEventListener("mouseup",d))})},cleanup:e=>{e.matches("dialog.micl-bottomsheet")&&delete e.dataset.miclinitialized}}})(),i="button[popovertarget],button.micl-button--toggle",r=(()=>{const e=e=>{e.target&&e.target instanceof HTMLButtonElement&&(e.target.popoverTargetElement instanceof HTMLDialogElement&&(e.target.popoverTargetElement.open?e.target.popoverTargetElement.close():e.target.popoverTargetElement.showModal()),e.target.classList.contains("micl-button--toggle")&&(e.target.classList.add("micl-button--toggled"),e.target.classList.toggle("micl-button--selected"),e.target.dataset.miclalt&&([e.target.textContent,e.target.dataset.miclalt]=[e.target.dataset.miclalt,e.target.textContent])))};return{initialize:t=>{t.matches("button[popovertarget],button.micl-button--toggle")&&!t.dataset.miclinitialized&&(t.dataset.miclinitialized="1",(t.popoverTargetElement instanceof HTMLDialogElement&&!t.popoverTargetElement.hasAttribute("popover")||t.classList.contains("micl-button--toggle"))&&t.addEventListener("click",e))},cleanup:t=>{t.matches("button[popovertarget],button.micl-button--toggle")&&(document.removeEventListener("click",e),delete t.dataset.miclinitialized)}}})(),l=".micl-list-item-one,.micl-list-item-two,.micl-list-item-three",a=(()=>{const e=e=>!!e&&e.classList.contains("micl-list-item--disabled");return{keydown:t=>{if(!(t instanceof KeyboardEvent&&t.target instanceof Element&&t.target.matches(".micl-list-item-one,.micl-list-item-two,.micl-list-item-three")))return;const n=t.target.parentElement;if(!n)return;let o=[];if(n instanceof HTMLDetailsElement?o=Array.from(n.parentElement?.children||[]).map(t=>{let n=t.querySelector(":scope > summary");return e(n)?null:n}).filter(e=>!!e):n instanceof HTMLUListElement&&(o=Array.from(n.children).map(t=>t instanceof HTMLLIElement&&!e(t)?t:null).filter(e=>!!e)),0===o.length)return;let i=o.findIndex(e=>(e=>!!e&&e.matches(":has(input[type=checkbox]:checked)"))(e)),r=o.findIndex(e=>0===e.tabIndex),l=r;switch(t.key){case"ArrowDown":l=(r+1)%o.length,t.preventDefault();break;case"ArrowUp":l=(r-1+o.length)%o.length,t.preventDefault();break;case"Tab":-1===i?0!==r&&(o[r].tabIndex=-1,o[0].tabIndex=0):i!==r&&(o[r].tabIndex=-1,o[i].tabIndex=0);break;case"Enter":case" ":const e=t.target.querySelector("input[type=checkbox]");e instanceof HTMLInputElement&&(e.checked=!e.checked)}if(l!==r){o[r].tabIndex=-1,o[l].tabIndex=0,o[l].focus();const e=o[l].querySelector(":scope > button");e?.dispatchEvent(new MouseEvent("mouseenter",{bubbles:!0,cancelable:!0,view:window}))}}}})(),s=".micl-menu[popover]",c=(()=>{const e=(e,t)=>{const n=e.getBoundingClientRect(),o=t.getBoundingClientRect();return(n.x>o.x?"right ":"left ")+(n.y>o.y?"bottom":"top")};return{initialize:t=>{if(!t.matches(".micl-menu[popover]")||t.dataset.miclinitialized)return;t.dataset.miclinitialized="1";const n=document.querySelector(`[popovertarget="${t.id}"]`);n&&t.addEventListener("beforetoggle",o=>{"open"===o.oldState&&(t.style.transformOrigin=e(n,t))}),n&&t.addEventListener("toggle",o=>{"closed"===o.oldState&&(t.style.transformOrigin=e(n,t))}),t.querySelectorAll(":scope > ul.micl-list > li > button[popovertarget]").forEach(e=>{if(e.popoverTargetElement?.matches(".micl-menu[popover]")){let t,n=`--${e.popoverTargetElement.id}`;e.popoverTargetElement instanceof HTMLElement&&(e.style.setProperty("anchor-name",n),e.popoverTargetElement.style.insetBlockStart=`anchor(${n} start)`,e.popoverTargetElement.style.insetInlineStart=`anchor(${n} end)`),e.addEventListener("mouseenter",()=>{e.popoverTargetElement instanceof HTMLElement&&e.popoverTargetElement.showPopover()}),e.addEventListener("mouseleave",()=>{t=setTimeout(()=>{e.popoverTargetElement instanceof HTMLElement&&!e.popoverTargetElement.matches(":hover")&&e.popoverTargetElement.hidePopover()},100)}),e.popoverTargetElement.addEventListener("mouseenter",()=>{clearTimeout(t)}),e.popoverTargetElement.addEventListener("mouseleave",()=>{e.popoverTargetElement instanceof HTMLElement&&e.popoverTargetElement.hidePopover()})}})}}})(),m=".micl-navigationrail__item[for]:not(.micl-navigationrail__item--disabled)",d={keydown:e=>{if(!(e instanceof KeyboardEvent&&e.target instanceof HTMLLabelElement&&e.target.matches(m)))return;const t=document.getElementById(e.target.htmlFor);if(t)switch(e.key){case"Enter":case" ":e.preventDefault(),t.checked||(t.checked=!t.checked)}}},p="input[type=range].micl-slider-xs,input[type=range].micl-slider-s,input[type=range].micl-slider-m,input[type=range].micl-slider-l,input[type=range].micl-slider-xl",u=(()=>{const e=String.fromCharCode(8226),t=String.fromCharCode(8201),n=e=>e.parentElement?.classList.contains("micl-slider__container")?e.parentElement:null,o=(e,t)=>{e.dataset.miclsliderticks=t},i=e=>{let t=JSON.stringify(e.value+""),o=n(e);o&&(o.style.setProperty("--md-sys-slider-value",e.value),o.style.setProperty("--md-sys-slider-tip",t)),e.style.setProperty("--md-sys-slider-value",e.value),e.style.setProperty("--md-sys-slider-tip",t)};return{initialize:r=>{if(!r.matches(p))return;(e=>{let t=e.max||"100";n(e)?.style.setProperty("--md-sys-slider-max",t),e.style.setProperty("--md-sys-slider-max",t)})(r),(e=>{let t=e.min||"0";n(e)?.style.setProperty("--md-sys-slider-min",t),e.style.setProperty("--md-sys-slider-min",t)})(r),i(r),(e=>{let t=n(e);if(t){const n=window.getComputedStyle(e);["--md-sys-slider-handle-height","--md-sys-slider-track-height"].forEach(e=>{t.style.setProperty(e,n.getPropertyValue(e))})}})(r);const l=parseFloat(r.max),a=parseFloat(r.min),s=r.getBoundingClientRect(),c=((e,t,n)=>{const o=[];return e.list&&t>n&&e.list.querySelectorAll("option[value]").forEach(e=>{let i=parseFloat(e.value);!isNaN(i)&&i>=n&&i<=t&&o.push(i)}),o})(r,l,a).sort((e,t)=>e-t).map(e=>Math.round(100*(e-a)/(l-a)));if(c.length>0){const n=document.createElement("canvas"),i=n.getContext("2d");if(i){i.font=window.getComputedStyle(r).getPropertyValue("font");let n=i.measureText(t).width,l=i.measureText(e).width,a=s.width-10,m=0,d="";c.forEach(o=>{let i=a*o/100,r=Math.round((i-m)/n)-1;for(let e=0;e<r;e++)d+=t,m+=n;d+=e,m+=l}),o(r,d)}n.remove()}else o(r,e)},input:e=>{e.target.matches(p)&&e.target instanceof HTMLInputElement&&!e.target.disabled&&i(e.target)}}})(),g=".micl-textfield-outlined > input,.micl-textfield-filled > input",f=".micl-textfield-outlined > select,.micl-textfield-filled > select",y=".micl-textfield-outlined > textarea,.micl-textfield-filled > textarea",h=(()=>{const e=".micl-textfield__character-counter";return{initialize:t=>{if(t.dataset.miclinitialized)return;if(t.dataset.miclinitialized="1",t.value&&(t.dataset.miclvalue="1"),t instanceof HTMLSelectElement||!t.maxLength)return;const n=t.parentElement?.querySelector(e);n&&(n.textContent=`${t.value.length}/${t.maxLength}`)},input:t=>{if(!t.target.matches(`${g},${f},${y}`)||!(t.target instanceof HTMLInputElement||t.target instanceof HTMLSelectElement||t.target instanceof HTMLTextAreaElement)||!t.target.dataset.miclinitialized||t.target.disabled)return;if(t.target.value?t.target.dataset.miclvalue="1":delete t.target.dataset.miclvalue,t.target instanceof HTMLSelectElement||!t.target.maxLength)return;const n=t.target.parentElement?.querySelector(e);n&&(n.textContent=`${t.target.value.length}/${t.target.maxLength}`)}}})(),v=(()=>{const e={[n]:{component:o,type:HTMLDialogElement},[i]:{component:r,type:HTMLButtonElement},[l]:{component:a,type:HTMLElement},[s]:{component:c,type:HTMLElement},[m]:{component:d,type:HTMLLabelElement},[f]:{component:h,type:HTMLSelectElement},[p]:{component:u,type:HTMLInputElement},[y]:{component:h,type:HTMLTextAreaElement},[g]:{component:h,type:HTMLInputElement}},t=Object.keys(e).join(","),v=t=>{for(const[n,{component:o,type:i}]of Object.entries(e))if(t.matches(n)&&t instanceof i&&"function"==typeof o.initialize)return void o.initialize(t)},E=e=>{e.querySelectorAll(t).forEach(v),e.querySelectorAll('[class*="micl-"]').forEach(e=>{"1"===window.getComputedStyle(e).getPropertyValue("--micl-ripple")&&e.addEventListener("pointerdown",t=>{if(t.currentTarget.classList.contains("micl-card--nonactionable"))return;t.stopPropagation();let n=e.getBoundingClientRect();e.style.setProperty("--micl-x",t.clientX-n.left+"px"),e.style.setProperty("--micl-y",t.clientY-n.top+"px")})})},b=t=>{for(const[n,{component:o,type:i}]of Object.entries(e))if(t.matches(n)&&t instanceof i&&"function"==typeof o.cleanup)return void o.cleanup(t)},L=e=>{e.querySelectorAll(t).forEach(b)},T=()=>{new MutationObserver(e=>{e.forEach(e=>{"childList"===e.type&&(e.addedNodes.forEach(e=>{e instanceof HTMLElement&&(e.matches(t)&&v(e),e.querySelectorAll(t).forEach(v))}),e.removedNodes.forEach(e=>{e instanceof HTMLElement&&(e.matches(t)&&b(e),L(e))}))})}).observe(document.body,{childList:!0,subtree:!0}),E(document),document.addEventListener("input",t=>{for(const[n,{component:o,type:i}]of Object.entries(e))if(t.target.matches(n)&&t.target instanceof i&&"function"==typeof o.input)return void o.input(t)}),document.addEventListener("keydown",t=>{for(const[n,{component:o,type:i}]of Object.entries(e))if(t.target.matches(n)&&t.target instanceof i&&"function"==typeof o.keydown)return void o.keydown(t)})},x=()=>{document.removeEventListener("DOMContentLoaded",x),T()};return"loading"!==document.readyState?T():document.addEventListener("DOMContentLoaded",x),{initialize:()=>E(document),cleanup:()=>L(document)}})()})(),t})());
|
|
1
|
+
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.micl=t():e.micl=t()}(self,()=>(()=>{"use strict";var e={d:(t,n)=>{for(var i in n)e.o(n,i)&&!e.o(t,i)&&Object.defineProperty(t,i,{enumerable:!0,get:n[i]})},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={};return(()=>{e.r(t),e.d(t,{default:()=>v});const n="dialog.micl-bottomsheet",i=(()=>{const e=e=>{let t=parseInt(e.dataset.miclfitheight||"0",10),n=parseInt(window.getComputedStyle(e).getPropertyValue("max-block-size"),10),i=(e.dataset.miclsnapheights||"").split(",").map(Number).filter(e=>!isNaN(e)&&e>=0&&e<=n);return t<1&&(t=Math.min(e.getBoundingClientRect().height,n),e.dataset.miclfitheight=`${t}`),[...new Set(i.concat([t]).sort())]},t=(t,n)=>{let i=t.getBoundingClientRect().height,o=e(t);return o.filter(e=>e>i+4)[0]||o[n?o.length-1:0]},i=(e,t)=>{t<1?(delete e.dataset.miclfitheight,e.style.removeProperty("--md-sys-bottomsheet-height"),e[e.popover?"hidePopover":"close"]()):e.style.setProperty("--md-sys-bottomsheet-height",`${t}px`)};return{initialize:o=>{if(!o.matches(n)||o.dataset.miclinitialized)return;o.dataset.miclinitialized="1";const r=o.querySelector(".micl-bottomsheet__headline");if(!r)return;const l=r.querySelector(".micl-bottomsheet__draghandle");l?.addEventListener("click",()=>{i(o,t(o,!1))});let a,s,c=!1,m=!1;function d(e){const t=e.clientY;c&&Math.abs(a-t)>4&&(c=!1,m=!0,o.classList.add("micl-bottomsheet--resizing")),m&&i(o,s+a-t)}function p(n){c=!1,o.classList.remove("micl-bottomsheet--resizing"),m&&(m=!1,n.clientY<a?i(o,t(o,!0)):o.getBoundingClientRect().height<48?i(o,0):i(o,(t=>{let n=t.getBoundingClientRect().height,i=e(t),o=i.filter(e=>e<n-4);return o[o.length-1]||i[0]})(o)),document.removeEventListener("mousemove",d),document.removeEventListener("mouseup",p))}r.addEventListener("mousedown",e=>{e.eventPhase===Event.AT_TARGET&&(c=!0,e.preventDefault(),a=e.clientY,s=o.getBoundingClientRect().height,document.addEventListener("mousemove",d),document.addEventListener("mouseup",p))})},cleanup:e=>{e.matches(n)&&(e.classList.remove("micl-bottomsheet--resizing"),delete e.dataset.miclinitialized,delete e.dataset.miclfitheight)}}})(),o="button[popovertarget],button.micl-button--toggle",r=(()=>{const e=e=>{e.target&&e.target instanceof HTMLButtonElement&&(e.target.popoverTargetElement instanceof HTMLDialogElement&&(e.target.popoverTargetElement.open?e.target.popoverTargetElement.close():e.target.popoverTargetElement.showModal()),e.target.classList.contains("micl-button--toggle")&&(e.target.classList.add("micl-button--toggled"),e.target.classList.toggle("micl-button--selected"),e.target.dataset.miclalt&&([e.target.textContent,e.target.dataset.miclalt]=[e.target.dataset.miclalt,e.target.textContent])))};return{initialize:t=>{t.matches("button[popovertarget],button.micl-button--toggle")&&!t.dataset.miclinitialized&&(t.dataset.miclinitialized="1",(t.popoverTargetElement instanceof HTMLDialogElement&&!t.popoverTargetElement.hasAttribute("popover")||t.classList.contains("micl-button--toggle"))&&t.addEventListener("click",e))},cleanup:t=>{t.matches("button[popovertarget],button.micl-button--toggle")&&(document.removeEventListener("click",e),delete t.dataset.miclinitialized)}}})(),l=".micl-list-item-one,.micl-list-item-two,.micl-list-item-three",a=(()=>{const e=e=>!!e&&e.classList.contains("micl-list-item--disabled");return{keydown:t=>{if(!(t instanceof KeyboardEvent&&t.target instanceof Element&&t.target.matches(".micl-list-item-one,.micl-list-item-two,.micl-list-item-three")))return;const n=t.target.parentElement;if(!n)return;let i=[];if(n instanceof HTMLDetailsElement?i=Array.from(n.parentElement?.children||[]).map(t=>{let n=t.querySelector(":scope > summary");return e(n)?null:n}).filter(e=>!!e):n instanceof HTMLUListElement&&(i=Array.from(n.children).map(t=>t instanceof HTMLLIElement&&!e(t)?t:null).filter(e=>!!e)),0===i.length)return;let o=i.findIndex(e=>(e=>!!e&&e.matches(":has(input[type=checkbox]:checked)"))(e)),r=i.findIndex(e=>0===e.tabIndex),l=r;switch(t.key){case"ArrowDown":l=(r+1)%i.length,t.preventDefault();break;case"ArrowUp":l=(r-1+i.length)%i.length,t.preventDefault();break;case"Tab":-1===o?0!==r&&(i[r].tabIndex=-1,i[0].tabIndex=0):o!==r&&(i[r].tabIndex=-1,i[o].tabIndex=0);break;case"Enter":case" ":const e=t.target.querySelector("input[type=checkbox]");e instanceof HTMLInputElement&&(e.checked=!e.checked)}if(l!==r){i[r].tabIndex=-1,i[l].tabIndex=0,i[l].focus();const e=i[l].querySelector(":scope > button");e?.dispatchEvent(new MouseEvent("mouseenter",{bubbles:!0,cancelable:!0,view:window}))}}}})(),s=".micl-menu[popover]",c=(()=>{const e=(e,t)=>{const n=e.getBoundingClientRect(),i=t.getBoundingClientRect();return(n.x>i.x?"right ":"left ")+(n.y>i.y?"bottom":"top")};return{initialize:t=>{if(!t.matches(".micl-menu[popover]")||t.dataset.miclinitialized)return;t.dataset.miclinitialized="1";const n=document.querySelector(`[popovertarget="${t.id}"]`);n&&t.addEventListener("beforetoggle",i=>{"open"===i.oldState&&(t.style.transformOrigin=e(n,t))}),n&&t.addEventListener("toggle",i=>{"closed"===i.oldState&&(t.style.transformOrigin=e(n,t))}),t.querySelectorAll(":scope > ul.micl-list > li > button[popovertarget]").forEach(e=>{if(e.popoverTargetElement?.matches(".micl-menu[popover]")){let t,n=`--${e.popoverTargetElement.id}`;e.popoverTargetElement instanceof HTMLElement&&(e.style.setProperty("anchor-name",n),e.popoverTargetElement.style.insetBlockStart=`anchor(${n} start)`,e.popoverTargetElement.style.insetInlineStart=`anchor(${n} end)`),e.addEventListener("mouseenter",()=>{e.popoverTargetElement instanceof HTMLElement&&e.popoverTargetElement.showPopover()}),e.addEventListener("mouseleave",()=>{t=setTimeout(()=>{e.popoverTargetElement instanceof HTMLElement&&!e.popoverTargetElement.matches(":hover")&&e.popoverTargetElement.hidePopover()},100)}),e.popoverTargetElement.addEventListener("mouseenter",()=>{clearTimeout(t)}),e.popoverTargetElement.addEventListener("mouseleave",()=>{e.popoverTargetElement instanceof HTMLElement&&e.popoverTargetElement.hidePopover()})}})}}})(),m=".micl-navigationrail__item[for]:not(.micl-navigationrail__item--disabled)",d={keydown:e=>{if(!(e instanceof KeyboardEvent&&e.target instanceof HTMLLabelElement&&e.target.matches(m)))return;const t=document.getElementById(e.target.htmlFor);if(t)switch(e.key){case"Enter":case" ":e.preventDefault(),t.checked||(t.checked=!t.checked)}}},p="input[type=range].micl-slider-xs,input[type=range].micl-slider-s,input[type=range].micl-slider-m,input[type=range].micl-slider-l,input[type=range].micl-slider-xl",u=(()=>{const e=String.fromCharCode(8226),t=String.fromCharCode(8201),n=e=>e.parentElement?.classList.contains("micl-slider__container")?e.parentElement:null,i=(e,t)=>{e.dataset.miclsliderticks=t},o=e=>{let t=JSON.stringify(e.value+""),i=n(e);i&&(i.style.setProperty("--md-sys-slider-value",e.value),i.style.setProperty("--md-sys-slider-tip",t)),e.style.setProperty("--md-sys-slider-value",e.value),e.style.setProperty("--md-sys-slider-tip",t)};return{initialize:r=>{if(!r.matches(p))return;(e=>{let t=e.max||"100";n(e)?.style.setProperty("--md-sys-slider-max",t),e.style.setProperty("--md-sys-slider-max",t)})(r),(e=>{let t=e.min||"0";n(e)?.style.setProperty("--md-sys-slider-min",t),e.style.setProperty("--md-sys-slider-min",t)})(r),o(r),(e=>{let t=n(e);if(t){const n=window.getComputedStyle(e);["--md-sys-slider-handle-height","--md-sys-slider-track-height"].forEach(e=>{t.style.setProperty(e,n.getPropertyValue(e))})}})(r);const l=parseFloat(r.max),a=parseFloat(r.min),s=r.getBoundingClientRect(),c=((e,t,n)=>{const i=[];return e.list&&t>n&&e.list.querySelectorAll("option[value]").forEach(e=>{let o=parseFloat(e.value);!isNaN(o)&&o>=n&&o<=t&&i.push(o)}),i})(r,l,a).sort((e,t)=>e-t).map(e=>Math.round(100*(e-a)/(l-a)));if(c.length>0){const n=document.createElement("canvas"),o=n.getContext("2d");if(o){o.font=window.getComputedStyle(r).getPropertyValue("font");let n=o.measureText(t).width,l=o.measureText(e).width,a=s.width-10,m=0,d="";c.forEach(i=>{let o=a*i/100,r=Math.round((o-m)/n)-1;for(let e=0;e<r;e++)d+=t,m+=n;d+=e,m+=l}),i(r,d)}n.remove()}else i(r,e)},input:e=>{e.target.matches(p)&&e.target instanceof HTMLInputElement&&!e.target.disabled&&o(e.target)}}})(),g=".micl-textfield-outlined > input,.micl-textfield-filled > input",f=".micl-textfield-outlined > select,.micl-textfield-filled > select",h=".micl-textfield-outlined > textarea,.micl-textfield-filled > textarea",y=(()=>{const e=".micl-textfield__character-counter";return{initialize:t=>{if(t.dataset.miclinitialized)return;if(t.dataset.miclinitialized="1",t.value&&(t.dataset.miclvalue="1"),t instanceof HTMLSelectElement||!t.maxLength)return;const n=t.parentElement?.querySelector(e);n&&(n.textContent=`${t.value.length}/${t.maxLength}`)},input:t=>{if(!t.target.matches(`${g},${f},${h}`)||!(t.target instanceof HTMLInputElement||t.target instanceof HTMLSelectElement||t.target instanceof HTMLTextAreaElement)||!t.target.dataset.miclinitialized||t.target.disabled)return;if(t.target.value?t.target.dataset.miclvalue="1":delete t.target.dataset.miclvalue,t.target instanceof HTMLSelectElement||!t.target.maxLength)return;const n=t.target.parentElement?.querySelector(e);n&&(n.textContent=`${t.target.value.length}/${t.target.maxLength}`)}}})(),v=(()=>{const e={[n]:{component:i,type:HTMLDialogElement},[o]:{component:r,type:HTMLButtonElement},[l]:{component:a,type:HTMLElement},[s]:{component:c,type:HTMLElement},[m]:{component:d,type:HTMLLabelElement},[f]:{component:y,type:HTMLSelectElement},[p]:{component:u,type:HTMLInputElement},[h]:{component:y,type:HTMLTextAreaElement},[g]:{component:y,type:HTMLInputElement}},t=Object.keys(e).join(","),v=t=>{for(const[n,{component:i,type:o}]of Object.entries(e))if(t.matches(n)&&t instanceof o&&"function"==typeof i.initialize)return void i.initialize(t)},E=e=>{e.querySelectorAll(t).forEach(v),e.querySelectorAll('[class*="micl-"]').forEach(e=>{"1"===window.getComputedStyle(e).getPropertyValue("--micl-ripple")&&e.addEventListener("pointerdown",t=>{if(t.currentTarget.classList.contains("micl-card--nonactionable"))return;t.stopPropagation();let n=e.getBoundingClientRect();e.style.setProperty("--micl-x",t.clientX-n.left+"px"),e.style.setProperty("--micl-y",t.clientY-n.top+"px")})})},b=t=>{for(const[n,{component:i,type:o}]of Object.entries(e))if(t.matches(n)&&t instanceof o&&"function"==typeof i.cleanup)return void i.cleanup(t)},L=e=>{e.querySelectorAll(t).forEach(b)},T=()=>{new MutationObserver(e=>{e.forEach(e=>{"childList"===e.type&&(e.addedNodes.forEach(e=>{e instanceof HTMLElement&&(e.matches(t)&&v(e),e.querySelectorAll(t).forEach(v))}),e.removedNodes.forEach(e=>{e instanceof HTMLElement&&(e.matches(t)&&b(e),L(e))}))})}).observe(document.body,{childList:!0,subtree:!0}),E(document),document.addEventListener("input",t=>{for(const[n,{component:i,type:o}]of Object.entries(e))if(t.target.matches(n)&&t.target instanceof o&&"function"==typeof i.input)return void i.input(t)}),document.addEventListener("keydown",t=>{for(const[n,{component:i,type:o}]of Object.entries(e))if(t.target.matches(n)&&t.target instanceof o&&"function"==typeof i.keydown)return void i.keydown(t)})},x=()=>{document.removeEventListener("DOMContentLoaded",x),T()};return"loading"!==document.readyState?T():document.addEventListener("DOMContentLoaded",x),{initialize:()=>E(document),cleanup:()=>L(document)}})()})(),t})());
|
package/docs/navigationrail.html
CHANGED
|
@@ -3,26 +3,23 @@
|
|
|
3
3
|
<head>
|
|
4
4
|
<meta charset="UTF-8">
|
|
5
5
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
6
|
+
<meta name="description" content="Demonstrating MICL Navigation Rails">
|
|
6
7
|
<title>MICL Navigation Rail</title>
|
|
7
8
|
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Roboto:ital,wght@0,100..900;1,100..900&display=swap">
|
|
8
|
-
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:FILL@0..1&icon_names=dark_mode,delete,favorite,inbox,menu,menu_open,outbox&display=block">
|
|
9
|
+
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:FILL@0..1&icon_names=dark_mode,delete,favorite,home,inbox,menu,menu_open,outbox&display=block">
|
|
9
10
|
<link rel="stylesheet" href="themes/airblue/theme.css" id="theme-link">
|
|
10
11
|
<link rel="stylesheet" href="micl.css">
|
|
11
12
|
<link rel="stylesheet" href="docs.css">
|
|
12
13
|
<style>
|
|
13
|
-
.micl-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
align-items: flex-start;
|
|
17
|
-
padding-block: 32px;
|
|
18
|
-
row-gap: 32px;
|
|
14
|
+
.micl-card-filled {
|
|
15
|
+
height: 420px;
|
|
16
|
+
width: 360px;
|
|
19
17
|
}
|
|
20
18
|
</style>
|
|
21
19
|
</head>
|
|
22
|
-
<body class="light">
|
|
23
|
-
|
|
24
|
-
<!-- <
|
|
25
|
-
<div id="mynavigationrail1" class="micl-navigationrail">
|
|
20
|
+
<body class="micl-window light">
|
|
21
|
+
<dialog id="mynavigationrail1" class="micl-navigationrail" closedby="closerequest">
|
|
22
|
+
<!-- <nav id="mynavigationrail1" class="micl-navigationrail" popover="manual"> -->
|
|
26
23
|
<div class="micl-navigationrail__headline">
|
|
27
24
|
<button type="button" class="micl-iconbutton-standard-s micl-button--toggle material-symbols-outlined" popovertarget="mynavigationrail1" data-miclalt="menu_open" aria-label="Toggle navigation rail">menu</button>
|
|
28
25
|
</div>
|
|
@@ -49,31 +46,36 @@
|
|
|
49
46
|
</label>
|
|
50
47
|
</div>
|
|
51
48
|
|
|
52
|
-
<span class="micl-badge
|
|
53
|
-
<span class="micl-badge-small" style="position-anchor:--favorites;--md-sys-badge-block-offset:4px;--md-sys-badge-inline-offset:16px"></span>
|
|
54
|
-
</
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
49
|
+
<span class="micl-badge" style="position-anchor:--inbox;--md-sys-badge-block-offset:4px;--md-sys-badge-inline-offset:16px">97</span>
|
|
50
|
+
<span class="micl-badge micl-badge--small" style="position-anchor:--favorites;--md-sys-badge-block-offset:4px;--md-sys-badge-inline-offset:16px"></span>
|
|
51
|
+
<!-- </nav> -->
|
|
52
|
+
</dialog>
|
|
53
|
+
<main class="micl-body">
|
|
54
|
+
<section class="micl-pane">
|
|
55
|
+
<header class="micl-appbar micl-appbar--large">
|
|
56
|
+
<button type="button" class="micl-iconbutton-standard-m micl-button--toggle material-symbols-outlined" style="margin:8px 0 0 8px" popovertarget="mynavigationrail1" aria-label="Toggle navigation rail">menu</button>
|
|
57
|
+
<div class="micl-appbar__headline">
|
|
58
|
+
<h1>Navigation rails</h1>
|
|
59
|
+
<p class="micl-appbar__subtitle">Showcasing MICL navigation rails</p>
|
|
60
|
+
</div>
|
|
61
|
+
<div id="settings-placeholder" class="micl-appbar__trailing"></div>
|
|
62
|
+
</header>
|
|
63
|
+
<div style="display:flex;flex-wrap:wrap">
|
|
64
|
+
<div class="micl-card-filled"></div>
|
|
65
|
+
<div class="micl-card-filled"></div>
|
|
66
|
+
<div class="micl-card-filled"></div>
|
|
67
|
+
<div class="micl-card-filled"></div>
|
|
68
|
+
<div class="micl-card-filled"></div>
|
|
69
|
+
<div class="micl-card-filled"></div>
|
|
70
|
+
<div class="micl-card-filled"></div>
|
|
71
|
+
<div class="micl-card-filled"></div>
|
|
72
|
+
<div class="micl-card-filled"></div>
|
|
73
|
+
<div class="micl-card-filled"></div>
|
|
74
|
+
<div class="micl-card-filled"></div>
|
|
75
|
+
<div class="micl-card-filled"></div>
|
|
76
|
+
</div>
|
|
77
|
+
</section>
|
|
78
|
+
</main>
|
|
77
79
|
|
|
78
80
|
<script src="micl.js"></script>
|
|
79
81
|
<script src="docs.js"></script>
|
package/docs/radio.html
CHANGED
|
@@ -3,18 +3,14 @@
|
|
|
3
3
|
<head>
|
|
4
4
|
<meta charset="UTF-8">
|
|
5
5
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
6
|
+
<meta name="description" content="Demonstrating MICL Radio Buttons">
|
|
6
7
|
<title>MICL Radio Buttons</title>
|
|
7
|
-
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=
|
|
8
|
+
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Roboto:ital,wght@0,100..900;1,100..900&display=swap">
|
|
9
|
+
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:FILL@0..1&icon_names=dark_mode,home&display=block">
|
|
8
10
|
<link rel="stylesheet" href="themes/airblue/theme.css" id="theme-link">
|
|
9
11
|
<link rel="stylesheet" href="micl.css">
|
|
10
12
|
<link rel="stylesheet" href="docs.css">
|
|
11
13
|
<style>
|
|
12
|
-
label {
|
|
13
|
-
color: var(--md-sys-color-on-surface);
|
|
14
|
-
}
|
|
15
|
-
.micl-card-filled .micl-card__content {
|
|
16
|
-
padding-inline: 0;
|
|
17
|
-
}
|
|
18
14
|
.micl-card-outlined .micl-card__content {
|
|
19
15
|
display: flex;
|
|
20
16
|
flex-direction: column;
|
|
@@ -26,74 +22,103 @@
|
|
|
26
22
|
}
|
|
27
23
|
</style>
|
|
28
24
|
</head>
|
|
29
|
-
<body class="light">
|
|
30
|
-
<
|
|
31
|
-
<
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
<input type="radio" class="micl-radio" id="myradio1" name="choices" checked value="c1">
|
|
40
|
-
<label for="myradio1" class="md-sys-typescale-body-medium">First Choice</label>
|
|
41
|
-
</div>
|
|
42
|
-
<div class="radio">
|
|
43
|
-
<input type="radio" class="micl-radio" id="myradio2" name="choices" value="c2">
|
|
44
|
-
<label for="myradio2" class="md-sys-typescale-body-medium">Second Choice</label>
|
|
45
|
-
</div>
|
|
46
|
-
<div class="radio">
|
|
47
|
-
<input type="radio" class="micl-radio" id="myradio3" name="choices" value="c3">
|
|
48
|
-
<label for="myradio3" class="md-sys-typescale-body-medium">Third Choice</label>
|
|
49
|
-
</div>
|
|
50
|
-
<div class="radio">
|
|
51
|
-
<input type="radio" class="micl-radio" id="myradio4" name="choices" value="c4" disabled>
|
|
52
|
-
<label for="myradio4" class="md-sys-typescale-body-medium">Fourth Choice (disabled)</label>
|
|
25
|
+
<body class="micl-window light">
|
|
26
|
+
<main class="micl-body micl-body--stacked-to-large">
|
|
27
|
+
<section class="micl-pane">
|
|
28
|
+
<header class="micl-appbar">
|
|
29
|
+
<a href="index.html" class="micl-appbar__leading-icon micl-link micl-iconbutton-standard-m" aria-label="Navigate to the main MICL Showcase page">
|
|
30
|
+
<span class="material-symbols-outlined" aria-hidden="true">home</span>
|
|
31
|
+
</a>
|
|
32
|
+
<div class="micl-appbar__headline micl-appbar__headline--center">
|
|
33
|
+
<h1>Radio buttons</h1>
|
|
34
|
+
<p class="micl-appbar__subtitle">Showcasing MICL radio buttons</p>
|
|
53
35
|
</div>
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
<div class="micl-
|
|
58
|
-
<div class="
|
|
59
|
-
<
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
36
|
+
<div id="settings-placeholder" class="micl-appbar__trailing"></div>
|
|
37
|
+
</header>
|
|
38
|
+
|
|
39
|
+
<div class="micl-pane__columns micl-pane__columns--stacked-to-expanded">
|
|
40
|
+
<div class="micl-pane__column">
|
|
41
|
+
<div class="micl-card-elevated">
|
|
42
|
+
<div class="micl-card__content">
|
|
43
|
+
<div class="radio">
|
|
44
|
+
<input type="radio" class="micl-radio" id="myradio1" name="choices" checked value="c1">
|
|
45
|
+
<label for="myradio1" class="md-sys-typescale-body-medium">First Choice</label>
|
|
46
|
+
</div>
|
|
47
|
+
<div class="radio">
|
|
48
|
+
<input type="radio" class="micl-radio" id="myradio2" name="choices" value="c2">
|
|
49
|
+
<label for="myradio2" class="md-sys-typescale-body-medium">Second Choice</label>
|
|
50
|
+
</div>
|
|
51
|
+
<div class="radio">
|
|
52
|
+
<input type="radio" class="micl-radio" id="myradio3" name="choices" value="c3">
|
|
53
|
+
<label for="myradio3" class="md-sys-typescale-body-medium">Third Choice</label>
|
|
54
|
+
</div>
|
|
55
|
+
<div class="radio">
|
|
56
|
+
<input type="radio" class="micl-radio" id="myradio4" name="choices" value="c4" disabled>
|
|
57
|
+
<label for="myradio4" class="md-sys-typescale-body-medium">Fourth Choice (disabled)</label>
|
|
58
|
+
</div>
|
|
59
|
+
</div>
|
|
60
|
+
</div>
|
|
61
|
+
<div class="micl-card-filled">
|
|
62
|
+
<div class="micl-card__content">
|
|
63
|
+
<div class="radio">
|
|
64
|
+
<input type="radio" class="micl-radio" id="myradio11" name="alternatives" checked value="c1">
|
|
65
|
+
<label for="myradio11" class="md-sys-typescale-body-medium">First Choice</label>
|
|
66
|
+
</div>
|
|
67
|
+
<div class="radio">
|
|
68
|
+
<input type="radio" class="micl-radio" id="myradio12" name="alternatives" value="c2">
|
|
69
|
+
<label for="myradio12" class="md-sys-typescale-body-medium">Second Choice</label>
|
|
70
|
+
</div>
|
|
71
|
+
<div class="radio">
|
|
72
|
+
<input type="radio" class="micl-radio" id="myradio13" name="alternatives" value="c3">
|
|
73
|
+
<label for="myradio13" class="md-sys-typescale-body-medium">Third Choice</label>
|
|
74
|
+
</div>
|
|
75
|
+
<div class="radio">
|
|
76
|
+
<input type="radio" class="micl-radio" id="myradio14" name="alternatives" value="c4" disabled>
|
|
77
|
+
<label for="myradio14" class="md-sys-typescale-body-medium">Fourth Choice (disabled)</label>
|
|
78
|
+
</div>
|
|
79
|
+
</div>
|
|
80
|
+
</div>
|
|
69
81
|
</div>
|
|
70
|
-
<div class="
|
|
71
|
-
<
|
|
72
|
-
|
|
82
|
+
<div class="micl-pane__column">
|
|
83
|
+
<div class="micl-card-outlined">
|
|
84
|
+
<div class="micl-card__content">
|
|
85
|
+
<div class="radio">
|
|
86
|
+
<label for="myradio21" class="md-sys-typescale-body-medium">First Choice</label>
|
|
87
|
+
<input type="radio" class="micl-radio" id="myradio21" name="selection" checked value="c1">
|
|
88
|
+
</div>
|
|
89
|
+
<div class="radio">
|
|
90
|
+
<label for="myradio22" class="md-sys-typescale-body-medium">Second Choice</label>
|
|
91
|
+
<input type="radio" class="micl-radio" id="myradio22" name="selection" value="c2">
|
|
92
|
+
</div>
|
|
93
|
+
<div class="radio">
|
|
94
|
+
<label for="myradio23" class="md-sys-typescale-body-medium">Third Choice</label>
|
|
95
|
+
<input type="radio" class="micl-radio" id="myradio23" name="selection" value="c3">
|
|
96
|
+
</div>
|
|
97
|
+
<div class="radio">
|
|
98
|
+
<label for="myradio24" class="md-sys-typescale-body-medium">Fourth Choice (disabled)</label>
|
|
99
|
+
<input type="radio" class="micl-radio" id="myradio24" name="selection" value="c4" disabled>
|
|
100
|
+
</div>
|
|
101
|
+
</div>
|
|
102
|
+
</div>
|
|
73
103
|
</div>
|
|
74
104
|
</div>
|
|
75
|
-
</
|
|
76
|
-
<
|
|
77
|
-
<div class="micl-
|
|
78
|
-
<div class="
|
|
79
|
-
<
|
|
80
|
-
<input type="radio" class="micl-radio" id="myradio21" name="selection" checked value="c1">
|
|
81
|
-
</div>
|
|
82
|
-
<div class="radio">
|
|
83
|
-
<label for="myradio22" class="md-sys-typescale-body-medium">Second Choice</label>
|
|
84
|
-
<input type="radio" class="micl-radio" id="myradio22" name="selection" value="c2">
|
|
85
|
-
</div>
|
|
86
|
-
<div class="radio">
|
|
87
|
-
<label for="myradio23" class="md-sys-typescale-body-medium">Third Choice</label>
|
|
88
|
-
<input type="radio" class="micl-radio" id="myradio23" name="selection" value="c3">
|
|
105
|
+
</section>
|
|
106
|
+
<section class="micl-pane">
|
|
107
|
+
<div class="micl-card-filled">
|
|
108
|
+
<div class="micl-card__headline-s">
|
|
109
|
+
<h2>Code example</h2>
|
|
89
110
|
</div>
|
|
90
|
-
<div class="
|
|
91
|
-
<
|
|
92
|
-
|
|
111
|
+
<div class="micl-card__content docs-code">
|
|
112
|
+
<pre><code>
|
|
113
|
+
<div style="display:flex;align-items:center">
|
|
114
|
+
<input type="radio" class="micl-radio" id="id0" name="choices" checked value="v0">
|
|
115
|
+
<label for="id0" class="md-sys-typescale-body-medium">First Choice</label>
|
|
116
|
+
</div>
|
|
117
|
+
</code></pre>
|
|
93
118
|
</div>
|
|
94
119
|
</div>
|
|
95
|
-
</
|
|
96
|
-
</
|
|
120
|
+
</section>
|
|
121
|
+
</main>
|
|
97
122
|
|
|
98
123
|
<script src="micl.js"></script>
|
|
99
124
|
<script src="docs.js"></script>
|