material-inspired-component-library 3.0.0 → 3.0.2
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/README.md +2 -2
- package/components/appbar/index.scss +2 -2
- package/components/badge/index.scss +22 -7
- package/components/button/index.scss +2 -2
- package/components/card/README.md +9 -5
- package/components/card/index.scss +49 -22
- package/components/checkbox/README.md +9 -0
- package/components/dialog/index.scss +3 -3
- package/components/divider/README.md +3 -3
- package/components/divider/index.scss +20 -29
- package/components/iconbutton/index.scss +2 -2
- package/components/list/README.md +4 -4
- package/components/list/index.scss +5 -5
- package/components/navigationrail/index.scss +5 -3
- package/components/radio/README.md +13 -4
- package/components/radio/index.scss +6 -4
- package/components/select/README.md +28 -6
- package/components/select/index.scss +60 -11
- package/components/slider/index.scss +4 -4
- package/components/stepper/index.scss +85 -0
- package/components/stepper/index.ts +163 -0
- package/components/switch/README.md +26 -4
- package/components/switch/index.scss +24 -23
- package/components/textfield/index.scss +4 -9
- package/components/textfield/index.ts +71 -30
- package/dist/appbar.css +1 -1
- 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/components/stepper/index.d.ts +5 -0
- package/dist/components/textfield/index.d.ts +3 -2
- package/dist/dialog.css +1 -1
- package/dist/divider.css +1 -1
- package/dist/iconbutton.css +1 -1
- package/dist/layout.css +1 -0
- package/dist/layout.js +1 -0
- package/dist/list.css +1 -1
- package/dist/menu.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/stepper.css +1 -0
- package/dist/stepper.js +1 -0
- package/dist/switch.css +1 -1
- package/dist/textfield.css +1 -1
- package/docs/card.html +25 -7
- package/docs/checkbox.html +12 -16
- package/docs/divider.html +7 -1
- package/docs/index.html +14 -15
- package/docs/list.html +6 -6
- package/docs/micl.css +1 -1
- package/docs/micl.js +1 -1
- package/docs/navigationrail.html +2 -3
- package/docs/radio.html +13 -17
- package/docs/select.html +46 -6
- package/docs/switch.html +41 -26
- package/layout/index.scss +37 -29
- package/micl.ts +23 -27
- package/package.json +5 -1
- package/styles/shapes.scss +0 -2
- package/styles.scss +1 -0
- package/webpack.config.js +1 -1
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 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})());
|
|
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:()=>L});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,r=e(t);return r.filter(e=>e>i+4)[0]||r[n?r.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:r=>{if(!r.matches(n)||r.dataset.miclinitialized)return;r.dataset.miclinitialized="1";const l=r.querySelector(".micl-bottomsheet__headline");if(!l)return;const o=l.querySelector(".micl-bottomsheet__draghandle");o?.addEventListener("click",()=>{i(r,t(r,!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,r.classList.add("micl-bottomsheet--resizing")),m&&i(r,s+a-t)}function p(n){c=!1,r.classList.remove("micl-bottomsheet--resizing"),m&&(m=!1,n.clientY<a?i(r,t(r,!0)):r.getBoundingClientRect().height<48?i(r,0):i(r,(t=>{let n=t.getBoundingClientRect().height,i=e(t),r=i.filter(e=>e<n-4);return r[r.length-1]||i[0]})(r)),document.removeEventListener("mousemove",d),document.removeEventListener("mouseup",p))}l.addEventListener("mousedown",e=>{e.eventPhase===Event.AT_TARGET&&(c=!0,e.preventDefault(),a=e.clientY,s=r.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)}}})(),r="button[popovertarget],button.micl-button--toggle",l=(()=>{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)}}})(),o=".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 r=i.findIndex(e=>(e=>!!e&&e.matches(":has(input[type=checkbox]:checked)"))(e)),l=i.findIndex(e=>0===e.tabIndex),o=l;switch(t.key){case"ArrowDown":o=(l+1)%i.length,t.preventDefault();break;case"ArrowUp":o=(l-1+i.length)%i.length,t.preventDefault();break;case"Tab":-1===r?0!==l&&(i[l].tabIndex=-1,i[0].tabIndex=0):r!==l&&(i[l].tabIndex=-1,i[r].tabIndex=0);break;case"Enter":case" ":const e=t.target.querySelector("input[type=checkbox]");e instanceof HTMLInputElement&&(e.checked=!e.checked)}if(o!==l){i[l].tabIndex=-1,i[o].tabIndex=0,i[o].focus();const e=i[o].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},r=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:l=>{if(!l.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)})(l),(e=>{let t=e.min||"0";n(e)?.style.setProperty("--md-sys-slider-min",t),e.style.setProperty("--md-sys-slider-min",t)})(l),r(l),(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))})}})(l);const o=parseFloat(l.max),a=parseFloat(l.min),s=l.getBoundingClientRect(),c=((e,t,n)=>{const i=[];return e.list&&t>n&&e.list.querySelectorAll("option[value]").forEach(e=>{let r=parseFloat(e.value);!isNaN(r)&&r>=n&&r<=t&&i.push(r)}),i})(l,o,a).sort((e,t)=>e-t).map(e=>Math.round(100*(e-a)/(o-a)));if(c.length>0){const n=document.createElement("canvas"),r=n.getContext("2d");if(r){r.font=window.getComputedStyle(l).getPropertyValue("font");let n=r.measureText(t).width,o=r.measureText(e).width,a=s.width-10,m=0,d="";c.forEach(i=>{let r=a*i/100,l=Math.round((r-m)/n)-1;for(let e=0;e<l;e++)d+=t,m+=n;d+=e,m+=o}),i(l,d)}n.remove()}else i(l,e)},input:e=>{e.target.matches(p)&&e.target instanceof HTMLInputElement&&!e.target.disabled&&r(e.target)}}})(),g=".micl-stepper",f=(()=>{const e=e=>{let t=e.querySelector(".micl-stepper__step--current");return t||(t=e.querySelector(".micl-stepper__step"),t?(t.classList.add("micl-stepper__step--current"),t):null)},t=e=>{e.currentTarget&&"transform"===e.propertyName&&(e.currentTarget.classList.remove("micl-stepper__step--fromcurrent","micl-stepper__step--tocurrent"),e.currentTarget.removeEventListener("transitionend",t))},n=(e,t)=>{t&&e.forEach(e=>{e.classList.toggle("micl-hidden",!t[e.classList.contains("micl-stepper--gonext")?"nextElementSibling":"previousElementSibling"]?.classList.contains("micl-stepper__step"))})},i=(e,t)=>{e.querySelectorAll("[data-step]").forEach(e=>{e.classList.toggle("micl-hidden",e.dataset.step!==t.dataset.miclstep)})};return{initialize:r=>{if(!r.matches(g)||r.dataset.miclinitialized)return;r.dataset.miclinitialized="1",r.querySelectorAll(".micl-stepper__step").forEach((e,t)=>{e.dataset.miclstep=`${t+1}`});const l=e(r),o=r.querySelectorAll("button.micl-stepper--goback,button.micl-stepper--gonext");n([...o],l),l&&i(r,l),o.forEach(l=>{l.addEventListener("click",()=>{const a=(t=>{let n=e(t);return n&&(n.querySelectorAll("input:required,select:required,textarea:required").forEach(e=>{e.checkValidity()||(n=null)}),n?.querySelectorAll("fieldset.micl-checkbox-group[data-miclname]").forEach(e=>{let t=0;e.querySelectorAll(`.micl-checkbox[name="${e.dataset.miclname}"]`).forEach(e=>{e.checked&&t++}),0===t&&console.log("NOT ENGOUGH CHECKS")})),n})(r);if(!a)return;const s=a[l.classList.contains("micl-stepper--gonext")?"nextElementSibling":"previousElementSibling"];s?.classList.contains("micl-stepper__step")&&(a.addEventListener("transitionend",t),a.classList.add("micl-stepper__step--fromcurrent"),a.offsetHeight,s.addEventListener("transitionend",t),s.classList.add("micl-stepper__step--tocurrent"),s.offsetHeight,s.classList.add("micl-stepper__step--current"),a.classList.remove("micl-stepper__step--current"),a.offsetHeight,n([...o],s),i(r,s))})})}}})(),h=".micl-textfield-outlined > input,.micl-textfield-filled > input",y=".micl-textfield-outlined > textarea,.micl-textfield-filled > textarea",v=".micl-textfield-filled > select,.micl-textfield-outlined > select",E=(()=>{const e=e=>e instanceof HTMLInputElement||e instanceof HTMLSelectElement||e instanceof HTMLTextAreaElement,t=e=>{if(!e.parentElement||e instanceof HTMLSelectElement||!e.maxLength)return;const t=e.parentElement.querySelector(".micl-textfield__character-counter");t&&(t.textContent=`${e.value.length}/${e.maxLength}`)},n=(e,t)=>{if(e.required){e.parentElement?.classList.toggle("micl-textfield--error",!t);const n=e.parentElement?.querySelector(".micl-textfield__supporting-text");n&&(t||"micltext"in n.dataset||(n.dataset.micltext=n.textContent),n.textContent=e.validationMessage||n.dataset.micltext||"")}};return{initialize:e=>{e.dataset.miclinitialized||(e.dataset.miclinitialized="1",e.value&&(e.dataset.miclvalue="1"),e instanceof HTMLSelectElement&&e.addEventListener("mousedown",()=>{const t=e.getBoundingClientRect(),n=t.top,i=window.innerHeight-t.bottom;!e.matches(":open")&&e.style.setProperty("--md-sys-select-picker-origin",n>i?"left bottom":"left top")}),t(e))},input:i=>{e(i.target)&&i.target.matches(`${h},${v},${y}`)&&i.target.dataset.miclinitialized&&!i.target.disabled&&(i.target.value?i.target.dataset.miclvalue="1":delete i.target.dataset.miclvalue,n(i.target,!0),t(i.target))},invalid:t=>{e(t.target)&&n(t.target)}}})(),L=(()=>{const e={[n]:{component:i,type:HTMLDialogElement},[r]:{component:l,type:HTMLButtonElement},[o]:{component:a,type:HTMLElement},[s]:{component:c,type:HTMLElement},[m]:{component:d,type:HTMLLabelElement},[v]:{component:E,type:HTMLSelectElement},[p]:{component:u,type:HTMLInputElement},[g]:{component:f,type:HTMLElement},[y]:{component:E,type:HTMLTextAreaElement},[h]:{component:E,type:HTMLInputElement}},t=Object.keys(e).join(","),L=t=>{for(const[n,{component:i,type:r}]of Object.entries(e))if(t.matches(n)&&t instanceof r&&"function"==typeof i.initialize)return void i.initialize(t)},b=e=>{e.querySelectorAll(t).forEach(L),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")})})},T=t=>{for(const[n,{component:i,type:r}]of Object.entries(e))if(t.matches(n)&&t instanceof r&&"function"==typeof i.cleanup)return void i.cleanup(t)},x=e=>{e.querySelectorAll(t).forEach(T)},S=t=>{for(const[n,{component:i,type:r}]of Object.entries(e))if(t.target.matches(n)&&t.target instanceof r&&["input","invalid","keydown"].includes(t.type)&&"function"==typeof i[t.type])return void i[t.type]?.(t)},M=()=>{new MutationObserver(e=>{e.forEach(e=>{"childList"===e.type&&(e.addedNodes.forEach(e=>{e instanceof HTMLElement&&(e.matches(t)&&L(e),e.querySelectorAll(t).forEach(L))}),e.removedNodes.forEach(e=>{e instanceof HTMLElement&&(e.matches(t)&&T(e),x(e))}))})}).observe(document.body,{childList:!0,subtree:!0}),b(document),document.addEventListener("input",S),document.addEventListener("keydown",S),document.addEventListener("invalid",S,!0)},_=()=>{document.removeEventListener("DOMContentLoaded",_),M()};return"loading"!==document.readyState?M():document.addEventListener("DOMContentLoaded",_),{initialize:()=>b(document),cleanup:()=>x(document)}})()})(),t})());
|
package/docs/navigationrail.html
CHANGED
|
@@ -28,6 +28,7 @@
|
|
|
28
28
|
<label for="item1" class="micl-navigationrail__item" tabindex="0">
|
|
29
29
|
<span class="micl-navigationrail__icon material-symbols-outlined" style="anchor-name:--inbox" aria-hidden="true">inbox</span>
|
|
30
30
|
<span class="micl-navigationrail__text">Inbox</span>
|
|
31
|
+
<span class="micl-badge" style="position-anchor:--inbox">97</span>
|
|
31
32
|
</label>
|
|
32
33
|
<input type="radio" id="item2" name="navitem" value="email_outbox">
|
|
33
34
|
<label for="item2" class="micl-navigationrail__item" tabindex="0">
|
|
@@ -38,6 +39,7 @@
|
|
|
38
39
|
<label for="item3" class="micl-navigationrail__item" tabindex="0">
|
|
39
40
|
<span class="micl-navigationrail__icon material-symbols-outlined" style="anchor-name:--favorites" aria-hidden="true">favorite</span>
|
|
40
41
|
<span class="micl-navigationrail__text">Favorites</span>
|
|
42
|
+
<span class="micl-badge micl-badge--small" style="position-anchor:--favorites"></span>
|
|
41
43
|
</label>
|
|
42
44
|
<input type="radio" id="item4" name="navitem" value="email_trash">
|
|
43
45
|
<label for="item4" class="micl-navigationrail__item" tabindex="0">
|
|
@@ -45,9 +47,6 @@
|
|
|
45
47
|
<span class="micl-navigationrail__text">Trash</span>
|
|
46
48
|
</label>
|
|
47
49
|
</div>
|
|
48
|
-
|
|
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
50
|
<!-- </nav> -->
|
|
52
51
|
</dialog>
|
|
53
52
|
<main class="micl-body">
|
package/docs/radio.html
CHANGED
|
@@ -16,10 +16,6 @@
|
|
|
16
16
|
flex-direction: column;
|
|
17
17
|
align-items: flex-end;
|
|
18
18
|
}
|
|
19
|
-
.radio {
|
|
20
|
-
display: flex;
|
|
21
|
-
align-items: center;
|
|
22
|
-
}
|
|
23
19
|
</style>
|
|
24
20
|
</head>
|
|
25
21
|
<body class="micl-window light">
|
|
@@ -40,19 +36,19 @@
|
|
|
40
36
|
<div class="micl-pane__column">
|
|
41
37
|
<div class="micl-card-elevated">
|
|
42
38
|
<div class="micl-card__content">
|
|
43
|
-
<div class="
|
|
39
|
+
<div class="micl-flex--vcenter">
|
|
44
40
|
<input type="radio" class="micl-radio" id="myradio1" name="choices" checked value="c1">
|
|
45
41
|
<label for="myradio1" class="md-sys-typescale-body-medium">First Choice</label>
|
|
46
42
|
</div>
|
|
47
|
-
<div class="
|
|
43
|
+
<div class="micl-flex--vcenter">
|
|
48
44
|
<input type="radio" class="micl-radio" id="myradio2" name="choices" value="c2">
|
|
49
45
|
<label for="myradio2" class="md-sys-typescale-body-medium">Second Choice</label>
|
|
50
46
|
</div>
|
|
51
|
-
<div class="
|
|
47
|
+
<div class="micl-flex--vcenter">
|
|
52
48
|
<input type="radio" class="micl-radio" id="myradio3" name="choices" value="c3">
|
|
53
49
|
<label for="myradio3" class="md-sys-typescale-body-medium">Third Choice</label>
|
|
54
50
|
</div>
|
|
55
|
-
<div class="
|
|
51
|
+
<div class="micl-flex--vcenter">
|
|
56
52
|
<input type="radio" class="micl-radio" id="myradio4" name="choices" value="c4" disabled>
|
|
57
53
|
<label for="myradio4" class="md-sys-typescale-body-medium">Fourth Choice (disabled)</label>
|
|
58
54
|
</div>
|
|
@@ -60,19 +56,19 @@
|
|
|
60
56
|
</div>
|
|
61
57
|
<div class="micl-card-filled">
|
|
62
58
|
<div class="micl-card__content">
|
|
63
|
-
<div class="
|
|
59
|
+
<div class="micl-flex--vcenter">
|
|
64
60
|
<input type="radio" class="micl-radio" id="myradio11" name="alternatives" checked value="c1">
|
|
65
61
|
<label for="myradio11" class="md-sys-typescale-body-medium">First Choice</label>
|
|
66
62
|
</div>
|
|
67
|
-
<div class="
|
|
63
|
+
<div class="micl-flex--vcenter">
|
|
68
64
|
<input type="radio" class="micl-radio" id="myradio12" name="alternatives" value="c2">
|
|
69
65
|
<label for="myradio12" class="md-sys-typescale-body-medium">Second Choice</label>
|
|
70
66
|
</div>
|
|
71
|
-
<div class="
|
|
67
|
+
<div class="micl-flex--vcenter">
|
|
72
68
|
<input type="radio" class="micl-radio" id="myradio13" name="alternatives" value="c3">
|
|
73
69
|
<label for="myradio13" class="md-sys-typescale-body-medium">Third Choice</label>
|
|
74
70
|
</div>
|
|
75
|
-
<div class="
|
|
71
|
+
<div class="micl-flex--vcenter">
|
|
76
72
|
<input type="radio" class="micl-radio" id="myradio14" name="alternatives" value="c4" disabled>
|
|
77
73
|
<label for="myradio14" class="md-sys-typescale-body-medium">Fourth Choice (disabled)</label>
|
|
78
74
|
</div>
|
|
@@ -82,19 +78,19 @@
|
|
|
82
78
|
<div class="micl-pane__column">
|
|
83
79
|
<div class="micl-card-outlined">
|
|
84
80
|
<div class="micl-card__content">
|
|
85
|
-
<div class="
|
|
81
|
+
<div class="micl-flex--vcenter">
|
|
86
82
|
<label for="myradio21" class="md-sys-typescale-body-medium">First Choice</label>
|
|
87
83
|
<input type="radio" class="micl-radio" id="myradio21" name="selection" checked value="c1">
|
|
88
84
|
</div>
|
|
89
|
-
<div class="
|
|
85
|
+
<div class="micl-flex--vcenter">
|
|
90
86
|
<label for="myradio22" class="md-sys-typescale-body-medium">Second Choice</label>
|
|
91
87
|
<input type="radio" class="micl-radio" id="myradio22" name="selection" value="c2">
|
|
92
88
|
</div>
|
|
93
|
-
<div class="
|
|
89
|
+
<div class="micl-flex--vcenter">
|
|
94
90
|
<label for="myradio23" class="md-sys-typescale-body-medium">Third Choice</label>
|
|
95
91
|
<input type="radio" class="micl-radio" id="myradio23" name="selection" value="c3">
|
|
96
92
|
</div>
|
|
97
|
-
<div class="
|
|
93
|
+
<div class="micl-flex--vcenter">
|
|
98
94
|
<label for="myradio24" class="md-sys-typescale-body-medium">Fourth Choice (disabled)</label>
|
|
99
95
|
<input type="radio" class="micl-radio" id="myradio24" name="selection" value="c4" disabled>
|
|
100
96
|
</div>
|
|
@@ -110,7 +106,7 @@
|
|
|
110
106
|
</div>
|
|
111
107
|
<div class="micl-card__content docs-code">
|
|
112
108
|
<pre><code>
|
|
113
|
-
<div
|
|
109
|
+
<div class="micl-flex--vcenter">
|
|
114
110
|
<input type="radio" class="micl-radio" id="id0" name="choices" checked value="v0">
|
|
115
111
|
<label for="id0" class="md-sys-typescale-body-medium">First Choice</label>
|
|
116
112
|
</div>
|
package/docs/select.html
CHANGED
|
@@ -20,6 +20,12 @@
|
|
|
20
20
|
.micl-list-item__thumbnail {
|
|
21
21
|
height: 56px;
|
|
22
22
|
}
|
|
23
|
+
.bigdot {
|
|
24
|
+
width: 24px;
|
|
25
|
+
min-width: 24px;
|
|
26
|
+
height: 24px;
|
|
27
|
+
border-radius: 100%;
|
|
28
|
+
}
|
|
23
29
|
</style>
|
|
24
30
|
</head>
|
|
25
31
|
<body class="micl-window light">
|
|
@@ -136,7 +142,8 @@
|
|
|
136
142
|
<option class="micl-list-item-one" value="BR" disabled>
|
|
137
143
|
<span class="micl-list-item__text">Brazil</span>
|
|
138
144
|
</option>
|
|
139
|
-
<
|
|
145
|
+
<hr class="micl-divider">
|
|
146
|
+
<option class="micl-list-item-one" selected value="CL">
|
|
140
147
|
<span class="micl-list-item__text">Chile</span>
|
|
141
148
|
</option>
|
|
142
149
|
<option class="micl-list-item-one" value="CO">
|
|
@@ -149,7 +156,39 @@
|
|
|
149
156
|
</div>
|
|
150
157
|
<div class="micl-textfield-filled">
|
|
151
158
|
<label for="myselect5">Country</label>
|
|
152
|
-
<select id="myselect5"
|
|
159
|
+
<select id="myselect5">
|
|
160
|
+
<option class="micl-list-item-one" value=""></option>
|
|
161
|
+
<option class="micl-list-item-one" value="AR">
|
|
162
|
+
<span class="micl-list-item__text">Argentina</span>
|
|
163
|
+
<span class="bigdot" style="background-color:teal"></span>
|
|
164
|
+
</option>
|
|
165
|
+
<option class="micl-list-item-one" value="BO">
|
|
166
|
+
<span class="micl-list-item__text">Bolivia</span>
|
|
167
|
+
<span class="bigdot" style="background-color:yellow"></span>
|
|
168
|
+
</option>
|
|
169
|
+
<option class="micl-list-item-one" value="BR">
|
|
170
|
+
<span class="micl-list-item__text">Brazil</span>
|
|
171
|
+
<span class="bigdot" style="background-color:burlywood"></span>
|
|
172
|
+
</option>
|
|
173
|
+
<hr class="micl-divider">
|
|
174
|
+
<option class="micl-list-item-one" value="CL">
|
|
175
|
+
<span class="micl-list-item__text">Chile</span>
|
|
176
|
+
<span class="bigdot" style="background-color:coral"></span>
|
|
177
|
+
</option>
|
|
178
|
+
<option class="micl-list-item-one" value="CO">
|
|
179
|
+
<span class="micl-list-item__text">Colombia</span>
|
|
180
|
+
<span class="bigdot" style="background-color:darkkhaki"></span>
|
|
181
|
+
</option>
|
|
182
|
+
<hr class="micl-divider">
|
|
183
|
+
<option class="micl-list-item-one" value="EC">
|
|
184
|
+
<span class="micl-list-item__text">Ecuador</span>
|
|
185
|
+
<span class="bigdot" style="background-color:darkviolet"></span>
|
|
186
|
+
</option>
|
|
187
|
+
</select>
|
|
188
|
+
</div>
|
|
189
|
+
<div class="micl-textfield-filled">
|
|
190
|
+
<label for="myselect6">Country</label>
|
|
191
|
+
<select id="myselect6" disabled>
|
|
153
192
|
<option class="micl-list-item-one" value=""></option>
|
|
154
193
|
<option class="micl-list-item-one" value="AR">
|
|
155
194
|
<span class="micl-list-item__text">Argentina</span>
|
|
@@ -179,8 +218,8 @@
|
|
|
179
218
|
</div>
|
|
180
219
|
<div class="micl-dialog__content">
|
|
181
220
|
<div class="micl-textfield-outlined" style="margin:8px">
|
|
182
|
-
<label for="
|
|
183
|
-
<select id="
|
|
221
|
+
<label for="myselect7">Country</label>
|
|
222
|
+
<select id="myselect7">
|
|
184
223
|
<option class="micl-list-item-two" value="AR">
|
|
185
224
|
<span class="micl-list-item__text" aria-description="Country code: AR">Argentina</span>
|
|
186
225
|
</option>
|
|
@@ -221,8 +260,8 @@
|
|
|
221
260
|
<div class="micl-card__content docs-code">
|
|
222
261
|
<pre><code>
|
|
223
262
|
<div class="micl-textfield-outlined">
|
|
224
|
-
<label for="
|
|
225
|
-
<select id="
|
|
263
|
+
<label for="myselect">Country</label>
|
|
264
|
+
<select id="myselect">
|
|
226
265
|
<option class="micl-list-item-one" value=""></option>
|
|
227
266
|
<option class="micl-list-item-one" value="AR">
|
|
228
267
|
<span class="micl-list-item__text">Argentina</span>
|
|
@@ -230,6 +269,7 @@
|
|
|
230
269
|
<option class="micl-list-item-one" value="BO">
|
|
231
270
|
<span class="micl-list-item__text">Bolivia</span>
|
|
232
271
|
</option>
|
|
272
|
+
<hr class="micl-divider">
|
|
233
273
|
<option class="micl-list-item-one" value="BR" disabled>
|
|
234
274
|
<span class="micl-list-item__text">Brazil</span>
|
|
235
275
|
</option>
|
package/docs/switch.html
CHANGED
|
@@ -17,16 +17,19 @@
|
|
|
17
17
|
flex-direction: column;
|
|
18
18
|
align-items: flex-end;
|
|
19
19
|
}
|
|
20
|
-
.
|
|
21
|
-
display: flex;
|
|
22
|
-
align-items: center;
|
|
20
|
+
.micl-flex--vcenter {
|
|
23
21
|
column-gap: 16px;
|
|
24
|
-
height: 48px;
|
|
25
22
|
}
|
|
26
|
-
.micl-card-outlined.unselectedicon .
|
|
23
|
+
.micl-card-outlined.unselectedicon .micl-flex--vcenter {
|
|
27
24
|
width: 100%;
|
|
28
25
|
justify-content: space-between;
|
|
29
26
|
}
|
|
27
|
+
.micl-card-outlined.unselectedicon label {
|
|
28
|
+
display: flex;
|
|
29
|
+
flex-direction: column;
|
|
30
|
+
flex-basis: 100%;
|
|
31
|
+
margin-block: 12px;
|
|
32
|
+
}
|
|
30
33
|
.noicons input[type=checkbox].micl-switch {
|
|
31
34
|
--md-sys-switch-selected-icon: "";
|
|
32
35
|
--md-sys-switch-unselected-icon: "";
|
|
@@ -60,19 +63,19 @@
|
|
|
60
63
|
<h2>Switches with icons</h2>
|
|
61
64
|
</div>
|
|
62
65
|
<div class="micl-card__content">
|
|
63
|
-
<div class="
|
|
66
|
+
<div class="micl-flex--vcenter">
|
|
64
67
|
<input type="checkbox" class="micl-switch" id="myswitch1" checked value="c1" role="switch">
|
|
65
68
|
<label for="myswitch1" class="md-sys-typescale-body-medium">First Choice</label>
|
|
66
69
|
</div>
|
|
67
|
-
<div class="
|
|
70
|
+
<div class="micl-flex--vcenter">
|
|
68
71
|
<input type="checkbox" class="micl-switch" id="myswitch2" value="c2" role="switch">
|
|
69
72
|
<label for="myswitch2" class="md-sys-typescale-body-medium">Second Choice</label>
|
|
70
73
|
</div>
|
|
71
|
-
<div class="
|
|
74
|
+
<div class="micl-flex--vcenter">
|
|
72
75
|
<input type="checkbox" class="micl-switch" id="myswitch3" value="c3" disabled role="switch">
|
|
73
76
|
<label for="myswitch3" class="md-sys-typescale-body-medium">Third Choice (disabled)</label>
|
|
74
77
|
</div>
|
|
75
|
-
<div class="
|
|
78
|
+
<div class="micl-flex--vcenter">
|
|
76
79
|
<input type="checkbox" class="micl-switch" id="myswitch4" value="c4" checked disabled role="switch">
|
|
77
80
|
<label for="myswitch4" class="md-sys-typescale-body-medium">Fourth Choice (disabled)</label>
|
|
78
81
|
</div>
|
|
@@ -83,19 +86,19 @@
|
|
|
83
86
|
<h2>Switches without icons</h2>
|
|
84
87
|
</div>
|
|
85
88
|
<div class="micl-card__content">
|
|
86
|
-
<div class="
|
|
89
|
+
<div class="micl-flex--vcenter">
|
|
87
90
|
<label for="myswitch5" class="md-sys-typescale-body-medium">First Choice</label>
|
|
88
91
|
<input type="checkbox" class="micl-switch" id="myswitch5" checked value="c1" role="switch">
|
|
89
92
|
</div>
|
|
90
|
-
<div class="
|
|
93
|
+
<div class="micl-flex--vcenter">
|
|
91
94
|
<label for="myswitch6" class="md-sys-typescale-body-medium">Second Choice</label>
|
|
92
95
|
<input type="checkbox" class="micl-switch" id="myswitch6" value="c2" role="switch">
|
|
93
96
|
</div>
|
|
94
|
-
<div class="
|
|
97
|
+
<div class="micl-flex--vcenter">
|
|
95
98
|
<label for="myswitch7" class="md-sys-typescale-body-medium">Third Choice (disabled)</label>
|
|
96
99
|
<input type="checkbox" class="micl-switch" id="myswitch7" value="c3" disabled role="switch">
|
|
97
100
|
</div>
|
|
98
|
-
<div class="
|
|
101
|
+
<div class="micl-flex--vcenter">
|
|
99
102
|
<label for="myswitch8" class="md-sys-typescale-body-medium">Fourth Choice (disabled)</label>
|
|
100
103
|
<input type="checkbox" class="micl-switch" id="myswitch8" value="c4" checked disabled role="switch">
|
|
101
104
|
</div>
|
|
@@ -108,19 +111,19 @@
|
|
|
108
111
|
<h2>Switches with selected icon</h2>
|
|
109
112
|
</div>
|
|
110
113
|
<div class="micl-card__content">
|
|
111
|
-
<div class="
|
|
114
|
+
<div class="micl-flex--vcenter">
|
|
112
115
|
<input type="checkbox" class="micl-switch" id="myswitch9" checked value="c1" role="switch">
|
|
113
116
|
<label for="myswitch9" class="md-sys-typescale-body-medium">First Choice</label>
|
|
114
117
|
</div>
|
|
115
|
-
<div class="
|
|
118
|
+
<div class="micl-flex--vcenter">
|
|
116
119
|
<input type="checkbox" class="micl-switch" id="myswitch10" value="c2" role="switch">
|
|
117
120
|
<label for="myswitch10" class="md-sys-typescale-body-medium">Second Choice</label>
|
|
118
121
|
</div>
|
|
119
|
-
<div class="
|
|
122
|
+
<div class="micl-flex--vcenter">
|
|
120
123
|
<input type="checkbox" class="micl-switch" id="myswitch11" value="c3" disabled role="switch">
|
|
121
124
|
<label for="myswitch11" class="md-sys-typescale-body-medium">Third Choice (disabled)</label>
|
|
122
125
|
</div>
|
|
123
|
-
<div class="
|
|
126
|
+
<div class="micl-flex--vcenter">
|
|
124
127
|
<input type="checkbox" class="micl-switch" id="myswitch12" value="c4" checked disabled role="switch">
|
|
125
128
|
<label for="myswitch12" class="md-sys-typescale-body-medium">Fourth Choice (disabled)</label>
|
|
126
129
|
</div>
|
|
@@ -132,20 +135,32 @@
|
|
|
132
135
|
<h2>Switches with unselected icon</h2>
|
|
133
136
|
</div>
|
|
134
137
|
<div class="micl-card__content">
|
|
135
|
-
<div class="
|
|
136
|
-
<label for="myswitch13"
|
|
138
|
+
<div class="micl-flex--vcenter">
|
|
139
|
+
<label for="myswitch13">
|
|
140
|
+
<span class="md-sys-typescale-body-large">First Choice</span>
|
|
141
|
+
<span class="md-sys-typescale-body-small">This is the first choice</span>
|
|
142
|
+
</label>
|
|
137
143
|
<input type="checkbox" class="micl-switch" id="myswitch13" checked value="c1" role="switch">
|
|
138
144
|
</div>
|
|
139
|
-
<div class="
|
|
140
|
-
<label for="myswitch14"
|
|
145
|
+
<div class="micl-flex--vcenter">
|
|
146
|
+
<label for="myswitch14">
|
|
147
|
+
<span class="md-sys-typescale-body-large">Second Choice</span>
|
|
148
|
+
<span class="md-sys-typescale-body-small">This is the second choice</span>
|
|
149
|
+
</label>
|
|
141
150
|
<input type="checkbox" class="micl-switch" id="myswitch14" value="c2" role="switch">
|
|
142
151
|
</div>
|
|
143
|
-
<div class="
|
|
144
|
-
<label for="myswitch15"
|
|
152
|
+
<div class="micl-flex--vcenter">
|
|
153
|
+
<label for="myswitch15">
|
|
154
|
+
<span class="md-sys-typescale-body-large">Third Choice</span>
|
|
155
|
+
<span class="md-sys-typescale-body-small">This is the third choice</span>
|
|
156
|
+
</label>
|
|
145
157
|
<input type="checkbox" class="micl-switch" id="myswitch15" value="c3" disabled role="switch">
|
|
146
158
|
</div>
|
|
147
|
-
<div class="
|
|
148
|
-
<label for="myswitch16"
|
|
159
|
+
<div class="micl-flex--vcenter">
|
|
160
|
+
<label for="myswitch16">
|
|
161
|
+
<span class="md-sys-typescale-body-large">Fourth Choice</span>
|
|
162
|
+
<span class="md-sys-typescale-body-small">This is the fourth choice</span>
|
|
163
|
+
</label>
|
|
149
164
|
<input type="checkbox" class="micl-switch" id="myswitch16" value="c4" checked disabled role="switch">
|
|
150
165
|
</div>
|
|
151
166
|
</div>
|
|
@@ -160,7 +175,7 @@
|
|
|
160
175
|
</div>
|
|
161
176
|
<div class="micl-card__content docs-code">
|
|
162
177
|
<pre><code>
|
|
163
|
-
<div style="
|
|
178
|
+
<div class="micl-flex--vcenter" style="column-gap:16px">
|
|
164
179
|
<input type="checkbox" class="micl-switch" id="id0" checked value="v0" role="switch">
|
|
165
180
|
<label for="id0" class="md-sys-typescale-body-medium">First Choice</label>
|
|
166
181
|
</div>
|
package/layout/index.scss
CHANGED
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
20
20
|
// SOFTWARE.
|
|
21
21
|
|
|
22
|
-
@use '../
|
|
22
|
+
@use '../styles/shapes';
|
|
23
23
|
|
|
24
24
|
$md-sys-window-compact-max: 599px;
|
|
25
25
|
$md-sys-window-medium-min: 600px;
|
|
@@ -46,6 +46,8 @@ $md-sys-padding-l: 20px;
|
|
|
46
46
|
$md-sys-padding-xl: 24px;
|
|
47
47
|
$md-sys-padding-xxl: 28px;
|
|
48
48
|
|
|
49
|
+
$md-sys-icon-size: 24px;
|
|
50
|
+
|
|
49
51
|
:root {
|
|
50
52
|
--md-sys-layout-pane-spacer: #{$md-sys-pane-spacer};
|
|
51
53
|
|
|
@@ -57,6 +59,8 @@ $md-sys-padding-xxl: 28px;
|
|
|
57
59
|
--md-sys-layout-padding-xl: #{$md-sys-padding-xl};
|
|
58
60
|
--md-sys-layout-padding-xxl: #{$md-sys-padding-xxl};
|
|
59
61
|
|
|
62
|
+
--md-sys-layout-icon-size: #{$md-sys-icon-size};
|
|
63
|
+
|
|
60
64
|
@media (max-width: $md-sys-window-compact-max) {
|
|
61
65
|
--md-sys-layout-window-margin: #{$md-sys-window-margin-compact};
|
|
62
66
|
}
|
|
@@ -98,7 +102,7 @@ $md-sys-padding-xxl: 28px;
|
|
|
98
102
|
block-size: inherit;
|
|
99
103
|
min-block-size: inherit;
|
|
100
104
|
margin: 0;
|
|
101
|
-
padding-block-end: var(--md-sys-navigationrail-top-space);
|
|
105
|
+
padding-block-end: var(--md-sys-navigationrail-top-space, 0px);
|
|
102
106
|
border-radius: var(--md-sys-layout-spatial-radius);
|
|
103
107
|
}
|
|
104
108
|
.micl-body {
|
|
@@ -166,18 +170,7 @@ $md-sys-padding-xxl: 28px;
|
|
|
166
170
|
}
|
|
167
171
|
}
|
|
168
172
|
|
|
169
|
-
.micl-link {
|
|
170
|
-
display: flex;
|
|
171
|
-
align-items: center;
|
|
172
|
-
justify-content: center;
|
|
173
|
-
text-decoration: none;
|
|
174
|
-
}
|
|
175
|
-
|
|
176
173
|
@media (max-width: $md-sys-window-compact-max) {
|
|
177
|
-
:root {
|
|
178
|
-
--md-sys-layout-window-margin: #{$md-sys-window-margin-compact};
|
|
179
|
-
}
|
|
180
|
-
|
|
181
174
|
.micl-body.micl-body--stacked-to-medium,
|
|
182
175
|
.micl-body.micl-body--stacked-to-expanded,
|
|
183
176
|
.micl-body.micl-body--stacked-to-large,
|
|
@@ -198,10 +191,6 @@ $md-sys-padding-xxl: 28px;
|
|
|
198
191
|
}
|
|
199
192
|
}
|
|
200
193
|
@media (min-width: $md-sys-window-medium-min) and (max-width: $md-sys-window-medium-max) {
|
|
201
|
-
:root {
|
|
202
|
-
--md-sys-layout-window-margin: #{$md-sys-window-margin-medium};
|
|
203
|
-
}
|
|
204
|
-
|
|
205
194
|
.micl-body.micl-body--stacked-to-expanded,
|
|
206
195
|
.micl-body.micl-body--stacked-to-large,
|
|
207
196
|
.micl-body.micl-body--stacked-to-extralarge {
|
|
@@ -219,10 +208,6 @@ $md-sys-padding-xxl: 28px;
|
|
|
219
208
|
}
|
|
220
209
|
}
|
|
221
210
|
@media (min-width: $md-sys-window-expanded-min) and (max-width: $md-sys-window-expanded-max) {
|
|
222
|
-
:root {
|
|
223
|
-
--md-sys-layout-window-margin: #{$md-sys-window-margin-expanded};
|
|
224
|
-
}
|
|
225
|
-
|
|
226
211
|
.micl-body.micl-body--stacked-to-large,
|
|
227
212
|
.micl-body.micl-body--stacked-to-extralarge {
|
|
228
213
|
flex-direction: column;
|
|
@@ -237,10 +222,6 @@ $md-sys-padding-xxl: 28px;
|
|
|
237
222
|
}
|
|
238
223
|
}
|
|
239
224
|
@media (min-width: $md-sys-window-large-min) and (max-width: $md-sys-window-large-max) {
|
|
240
|
-
:root {
|
|
241
|
-
--md-sys-layout-window-margin: #{$md-sys-window-margin-large};
|
|
242
|
-
}
|
|
243
|
-
|
|
244
225
|
.micl-body.micl-body--stacked-to-extralarge {
|
|
245
226
|
flex-direction: column;
|
|
246
227
|
}
|
|
@@ -251,8 +232,35 @@ $md-sys-padding-xxl: 28px;
|
|
|
251
232
|
flex-direction: column;
|
|
252
233
|
}
|
|
253
234
|
}
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
235
|
+
|
|
236
|
+
.micl-hidden {
|
|
237
|
+
display: none !important;
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
.micl-flex--vcenter {
|
|
241
|
+
display: flex;
|
|
242
|
+
flex-direction: row;
|
|
243
|
+
align-items: center;
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
.micl-grid-iconfield {
|
|
247
|
+
box-sizing: border-box;
|
|
248
|
+
display: grid;
|
|
249
|
+
grid-template-columns: 48px 1fr;
|
|
250
|
+
row-gap: var(--md-sys-layout-padding-xl, 24px);
|
|
251
|
+
background-color: inherit;
|
|
252
|
+
}
|
|
253
|
+
.micl-grid-iconfield__icon {
|
|
254
|
+
grid-column: 1;
|
|
255
|
+
margin-block-start: 0.6rem;
|
|
256
|
+
}
|
|
257
|
+
.micl-grid-iconfield__field {
|
|
258
|
+
grid-column: 2;
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
.micl-link {
|
|
262
|
+
display: flex;
|
|
263
|
+
align-items: center;
|
|
264
|
+
justify-content: center;
|
|
265
|
+
text-decoration: none;
|
|
258
266
|
}
|