material-inspired-component-library 1.1.0 → 1.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (97) hide show
  1. package/README.md +22 -21
  2. package/components/accordion/README.md +7 -9
  3. package/components/bottomsheet/README.md +7 -9
  4. package/components/bottomsheet/index.scss +3 -0
  5. package/components/button/README.md +7 -9
  6. package/components/button/index.scss +3 -0
  7. package/components/card/README.md +3 -3
  8. package/components/card/index.scss +3 -0
  9. package/components/checkbox/README.md +7 -9
  10. package/components/checkbox/index.scss +2 -0
  11. package/components/dialog/README.md +3 -3
  12. package/components/dialog/index.scss +3 -0
  13. package/components/divider/README.md +3 -3
  14. package/components/iconbutton/README.md +7 -9
  15. package/components/iconbutton/index.scss +3 -0
  16. package/components/list/README.md +58 -30
  17. package/components/list/index.scss +117 -53
  18. package/components/list/index.ts +1 -1
  19. package/components/menu/README.md +8 -10
  20. package/components/menu/index.scss +5 -2
  21. package/components/radio/README.md +3 -3
  22. package/components/radio/index.scss +2 -0
  23. package/components/select/README.md +9 -11
  24. package/components/select/index.scss +3 -1
  25. package/components/sidesheet/README.md +3 -3
  26. package/components/sidesheet/index.scss +2 -0
  27. package/components/slider/README.md +15 -9
  28. package/components/slider/index.scss +142 -51
  29. package/components/slider/index.ts +67 -31
  30. package/components/switch/README.md +3 -3
  31. package/components/switch/index.scss +3 -0
  32. package/components/textfield/README.md +7 -11
  33. package/components/textfield/index.scss +2 -0
  34. package/dist/bottomsheet.css +1 -1
  35. package/dist/bottomsheet.js +1 -0
  36. package/dist/button.css +1 -1
  37. package/dist/button.js +1 -0
  38. package/dist/card.css +1 -1
  39. package/dist/card.js +1 -0
  40. package/dist/checkbox.css +1 -1
  41. package/dist/checkbox.js +1 -0
  42. package/dist/components/bottomsheet/index.d.ts +6 -0
  43. package/dist/components/button/index.d.ts +6 -0
  44. package/dist/components/checkbox/index.d.ts +5 -0
  45. package/dist/components/iconbutton/index.d.ts +6 -0
  46. package/dist/components/list/index.d.ts +5 -0
  47. package/dist/components/menu/index.d.ts +16 -0
  48. package/dist/components/slider/index.d.ts +6 -0
  49. package/dist/components/textfield/index.d.ts +8 -0
  50. package/dist/dialog.css +1 -1
  51. package/dist/dialog.js +1 -0
  52. package/dist/divider.js +1 -0
  53. package/dist/iconbutton.css +1 -1
  54. package/dist/iconbutton.js +1 -0
  55. package/dist/list.css +1 -1
  56. package/dist/list.js +1 -0
  57. package/dist/menu.css +1 -1
  58. package/dist/menu.js +1 -0
  59. package/dist/micl.css +1 -1
  60. package/dist/micl.d.ts +5 -0
  61. package/dist/micl.js +1 -1
  62. package/dist/radio.css +1 -1
  63. package/dist/radio.js +1 -0
  64. package/dist/select.css +1 -1
  65. package/dist/select.js +1 -0
  66. package/dist/sidesheet.css +1 -1
  67. package/dist/sidesheet.js +1 -0
  68. package/dist/slider.css +1 -1
  69. package/dist/slider.js +1 -0
  70. package/dist/switch.css +1 -1
  71. package/dist/switch.js +1 -0
  72. package/dist/textfield.css +1 -1
  73. package/dist/textfield.js +1 -0
  74. package/docs/accordion.html +1 -1
  75. package/docs/bottomsheet.html +2 -2
  76. package/docs/button.html +1 -1
  77. package/docs/card.html +1 -1
  78. package/docs/checkbox.html +1 -1
  79. package/docs/dialog.html +2 -2
  80. package/docs/divider.html +1 -1
  81. package/docs/iconbutton.html +1 -1
  82. package/docs/index.html +2 -2
  83. package/docs/list.html +51 -34
  84. package/docs/menu.html +15 -11
  85. package/docs/micl.css +1 -1
  86. package/docs/micl.js +1 -1
  87. package/docs/radio.html +1 -1
  88. package/docs/select.html +11 -9
  89. package/docs/sidesheet.html +1 -1
  90. package/docs/slider.html +57 -21
  91. package/docs/switch.html +1 -1
  92. package/docs/textfield.html +1 -1
  93. package/{components.ts → micl.ts} +78 -53
  94. package/package.json +4 -2
  95. package/styles/layout.scss +74 -0
  96. package/tsconfig.json +11 -5
  97. package/webpack.config.js +7 -4
package/docs/micl.js CHANGED
@@ -1 +1 @@
1
- (()=>{"use strict";(()=>{const e="dialog.micl-bottomsheet",t=(()=>{var e=0;const t=t=>{let n=parseInt(window.getComputedStyle(t).getPropertyValue("max-height")),i=(t.dataset.snapheights||"").split(",").map(Number).filter(e=>!isNaN(e)&&e>0&&e<=n);return e||(e=t.getBoundingClientRect().height),[...new Set(i.concat([e,n]).sort())]},n=(e,n)=>{let i=e.getBoundingClientRect().height,o=t(e);return o.filter(e=>e>i+4)[0]||o[n?o.length-1:0]},i=(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 o=e.querySelector(".micl-bottomsheet__headline");if(!o)return;const l=o.querySelector(".micl-bottomsheet__draghandle");l?.addEventListener("click",()=>{const t=n(e,!1);t>4&&i(e,t)});let r,a,c=!1,s=!1;function m(t){const n=t.clientY;c&&Math.abs(r-n)>4&&(c=!1,s=!0,e.classList.add("micl-bottomsheet--resizing")),s&&i(e,a+r-n)}function d(o){c=!1,e.classList.remove("micl-bottomsheet--resizing"),s&&(s=!1,o.clientY<r?i(e,n(e,!0)):e.getBoundingClientRect().height<48?(e.popover&&e.hidePopover(),i(e,a)):i(e,(e=>{let n=e.getBoundingClientRect().height,i=t(e),o=i.filter(e=>e<n-4);return o[o.length-1]||i[0]})(e)),document.removeEventListener("mousemove",m),document.removeEventListener("mouseup",d))}o.addEventListener("mousedown",t=>{t.eventPhase===Event.AT_TARGET&&(c=!0,t.preventDefault(),r=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}}})(),n="button[popovertarget],button.micl-button--toggle",i=(()=>{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.toggle("micl-button--selected"))};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-checkbox",l={keydown:e=>{if(e.target.matches(o)&&e instanceof KeyboardEvent&&e.target instanceof HTMLInputElement&&!e.target.disabled)switch(e.key){case"Enter":case" ":e.target.checked=!e.target.checked,e.preventDefault()}}},r=".micl-list-item-one,.micl-list-item-two,.micl-list-item-three",a=(()=>{const e=e=>!!e&&e.classList.contains("micl-list-item--disabled"),t=e=>!!e&&e.matches(":has(input[type=checkbox]:checked)");return{keydown:n=>{if(!(n instanceof KeyboardEvent&&n.target instanceof Element&&n.target.matches(".micl-list-item-one,.micl-list-item-two,.micl-list-item-three")))return;const i=n.target.parentElement;if(!i)return;let o=[];if(i instanceof HTMLDetailsElement?o=Array.from(i.parentElement?.children||[]).map(t=>{let n=t.querySelector(":scope > summary");return e(n)?null:n}).filter(e=>!!e):i instanceof HTMLUListElement&&(o=Array.from(i.children).map(t=>t instanceof HTMLLIElement&&!e(t)?t:null).filter(e=>!!e)),0===o.length)return;let l=o.findIndex(e=>t(e));-1===l&&(l=o.findIndex(e=>0===e.tabIndex)),-1===l&&(l=0);let r=l;switch(n.key){case"ArrowDown":r=(l+1)%o.length,n.preventDefault();break;case"ArrowUp":r=(l-1+o.length)%o.length,n.preventDefault();break;case"Tab":let e=o.findIndex(e=>t(e));-1===e?0!==l&&(o[l].tabIndex=-1,o[0].tabIndex=0):e!==l&&(o[l].tabIndex=-1,o[e].tabIndex=0);break;case"Enter":case" ":const i=n.target.querySelector("input[type=checkbox].micl-checkbox");i instanceof HTMLInputElement&&(i.checked=!i.checked)}r!==l&&(o[l].tabIndex=-1,o[r].tabIndex=0,o[r].focus())}}})(),c=".micl-menu[popover]",s=(()=>{const e=(e,t)=>{const n=e.getBoundingClientRect().y,i=t.getBoundingClientRect().y,o=window.getComputedStyle(t).getPropertyValue("transform-origin");return(n>i?"bottom ":"top ")+(parseInt(o)>0?"right":"left")};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))})}}})(),m="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",d=(()=>{const e=String.fromCharCode(8226),t=String.fromCharCode(8201);return{initialize:n=>{n.style.setProperty("--md-sys-slider-max",n.max||"100"),n.style.setProperty("--md-sys-slider-min",n.min||"0"),n.style.setProperty("--md-sys-slider-value",n.value),n.style.setProperty("--md-sys-slider-tip",JSON.stringify(n.value+""));const i=n.getBoundingClientRect(),o=document.elementFromPoint(Math.max(i.x-1,0),Math.max(i.y-1,0));o&&(n.style.color=window.getComputedStyle(o).getPropertyValue("background-color"));const l=parseFloat(n.max),r=parseFloat(n.min),a=(e=>{const t=[],n=parseFloat(e.max),i=parseFloat(e.min);return e.list&&!isNaN(n)&&!isNaN(i)&&n>i&&e.list.querySelectorAll("option[value]").forEach(e=>{let o=parseFloat(e.value);!isNaN(o)&&o>=i&&o<=n&&t.push(o)}),t})(n).sort((e,t)=>e-t).map(e=>Math.round(100*(e-r)/(l-r)));if(a.length>0){const o=document.createElement("canvas"),l=o.getContext("2d");if(l){l.font=window.getComputedStyle(n).getPropertyValue("font");let o=l.measureText(t).width,r=l.measureText(e).width,c=i.width-10,s=0,m="";a.forEach(n=>{let i=c*n/100,l=Math.round((i-s)/o)-1;for(let e=0;e<l;e++)m+=t,s+=o;m+=e,s+=r}),n.dataset.miclsliderticks=m}o.remove()}else n.dataset.miclsliderticks=e},input:e=>{e.target.matches(".micl-slider-xs,.micl-slider-s,.micl-slider-m,.micl-slider-l,.micl-slider-xl")&&e.target instanceof HTMLInputElement&&!e.target.disabled&&(e.target.style.setProperty("--md-sys-slider-value",e.target.value),e.target.style.setProperty("--md-sys-slider-tip",JSON.stringify(e.target.value+"")))}}})(),u=".micl-textfield-outlined > input,.micl-textfield-filled > input",p=".micl-textfield-outlined > select,.micl-textfield-filled > select",g=".micl-textfield-outlined > textarea,.micl-textfield-filled > textarea",f=(()=>{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(`${u},${p},${g}`)||!(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}`)}}})();(()=>{const h={[e]:{component:t,type:HTMLDialogElement},[n]:{component:i,type:HTMLButtonElement},[o]:{component:l,type:HTMLInputElement},[r]:{component:a,type:HTMLElement},[c]:{component:s,type:HTMLElement},[p]:{component:f,type:HTMLSelectElement},[m]:{component:d,type:HTMLInputElement},[g]:{component:f,type:HTMLTextAreaElement},[u]:{component:f,type:HTMLInputElement}},y=Object.keys(h).join(","),v=e=>{for(const[t,{component:n,type:i}]of Object.entries(h))if(e.matches(t)&&e instanceof i&&"function"==typeof n.initialize)return void n.initialize(e)},E=e=>{for(const[t,{component:n,type:i}]of Object.entries(h))if(e.matches(t)&&e instanceof i&&"function"==typeof n.cleanup)return void n.cleanup(e)};new MutationObserver(e=>{e.forEach(e=>{"childList"===e.type&&(e.addedNodes.forEach(e=>{e instanceof HTMLElement&&(e.matches(y)&&v(e),e.querySelectorAll(y).forEach(v))}),e.removedNodes.forEach(e=>{e instanceof HTMLElement&&(e.matches(y)&&E(e),e.querySelectorAll(y).forEach(E))}))})}).observe(document.body,{childList:!0,subtree:!0}),document.querySelectorAll(y).forEach(v),document.querySelectorAll('[class*="micl-"]').forEach(e=>{window.getComputedStyle(e).getPropertyValue("--miclripple")&&e.addEventListener("pointerdown",t=>{if(t.currentTarget.classList.contains("micl-card--nonactionable"))return;const n=t.clientX,i=t.clientY,o=e.getBoundingClientRect(),l=2*Math.sqrt(Math.pow(o.width,2)+Math.pow(o.height,2));e.style.cssText="--s:0;--o:1;",e.offsetTop,e.style.cssText=`--t:1;--o:0;--d:${l};--x:${n-o.left};--y:${i-o.top}`})}),document.addEventListener("input",e=>{for(const[t,{component:n,type:i}]of Object.entries(h))if(e.target.matches(t)&&e.target instanceof i&&"function"==typeof n.input)return void n.input(e)}),document.addEventListener("keydown",e=>{for(const[t,{component:n,type:i}]of Object.entries(h))if(e.target.matches(t)&&e.target instanceof i&&"function"==typeof n.keydown)return void n.keydown(e)})})()})()})();
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=(()=>{var e=0;const t=t=>{let n=parseInt(window.getComputedStyle(t).getPropertyValue("max-height")),i=(t.dataset.snapheights||"").split(",").map(Number).filter(e=>!isNaN(e)&&e>0&&e<=n);return e||(e=t.getBoundingClientRect().height),[...new Set(i.concat([e,n]).sort())]},n=(e,n)=>{let i=e.getBoundingClientRect().height,o=t(e);return o.filter(e=>e>i+4)[0]||o[n?o.length-1:0]},i=(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 o=e.querySelector(".micl-bottomsheet__headline");if(!o)return;const r=o.querySelector(".micl-bottomsheet__draghandle");r?.addEventListener("click",()=>{const t=n(e,!1);t>4&&i(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&&i(e,a+l-n)}function d(o){s=!1,e.classList.remove("micl-bottomsheet--resizing"),c&&(c=!1,o.clientY<l?i(e,n(e,!0)):e.getBoundingClientRect().height<48?(e.popover&&e.hidePopover(),i(e,a)):i(e,(e=>{let n=e.getBoundingClientRect().height,i=t(e),o=i.filter(e=>e<n-4);return o[o.length-1]||i[0]})(e)),document.removeEventListener("mousemove",m),document.removeEventListener("mouseup",d))}o.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}}})(),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.toggle("micl-button--selected"))};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-checkbox",a={keydown:e=>{if(e.target.matches(l)&&e instanceof KeyboardEvent&&e.target instanceof HTMLInputElement&&!e.target.disabled)switch(e.key){case"Enter":case" ":e.target.checked=!e.target.checked,e.preventDefault()}}},s=".micl-list-item-one,.micl-list-item-two,.micl-list-item-three",c=(()=>{const e=e=>!!e&&e.classList.contains("micl-list-item--disabled"),t=e=>!!e&&e.matches(":has(input[type=checkbox]:checked)");return{keydown:n=>{if(!(n instanceof KeyboardEvent&&n.target instanceof Element&&n.target.matches(".micl-list-item-one,.micl-list-item-two,.micl-list-item-three")))return;const i=n.target.parentElement;if(!i)return;let o=[];if(i instanceof HTMLDetailsElement?o=Array.from(i.parentElement?.children||[]).map(t=>{let n=t.querySelector(":scope > summary");return e(n)?null:n}).filter(e=>!!e):i instanceof HTMLUListElement&&(o=Array.from(i.children).map(t=>t instanceof HTMLLIElement&&!e(t)?t:null).filter(e=>!!e)),0===o.length)return;let r=o.findIndex(e=>t(e));-1===r&&(r=o.findIndex(e=>0===e.tabIndex)),-1===r&&(r=0);let l=r;switch(n.key){case"ArrowDown":l=(r+1)%o.length,n.preventDefault();break;case"ArrowUp":l=(r-1+o.length)%o.length,n.preventDefault();break;case"Tab":let e=o.findIndex(e=>t(e));-1===e?0!==r&&(o[r].tabIndex=-1,o[0].tabIndex=0):e!==r&&(o[r].tabIndex=-1,o[e].tabIndex=0);break;case"Enter":case" ":const i=n.target.querySelector("input[type=checkbox]");i instanceof HTMLInputElement&&(i.checked=!i.checked)}l!==r&&(o[r].tabIndex=-1,o[l].tabIndex=0,o[l].focus())}}})(),m=".micl-menu[popover]",d=(()=>{const e=(e,t)=>{const n=e.getBoundingClientRect().y,i=t.getBoundingClientRect().y,o=window.getComputedStyle(t).getPropertyValue("transform-origin");return(n>i?"bottom ":"top ")+(parseInt(o)>0?"right":"left")};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))})}}})(),u="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",p=(()=>{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(u))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(u)&&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",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:i,type:HTMLDialogElement},[o]:{component:r,type:HTMLButtonElement},[l]:{component:a,type:HTMLInputElement},[s]:{component:c,type:HTMLElement},[m]:{component:d,type:HTMLElement},[f]:{component:h,type:HTMLSelectElement},[u]:{component:p,type:HTMLInputElement},[y]:{component:h,type:HTMLTextAreaElement},[g]:{component:h,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=>{e.parentElement&&!window.getComputedStyle(e.parentElement).getPropertyValue("--miclripple")&&window.getComputedStyle(e).getPropertyValue("--miclripple")&&e.addEventListener("pointerdown",t=>{if(t.currentTarget.classList.contains("micl-card--nonactionable"))return;const n=t.clientX,i=t.clientY,o=e.getBoundingClientRect(),r=2*Math.sqrt(Math.pow(o.width,2)+Math.pow(o.height,2));e.style.cssText="--s:0;--o:1;",e.offsetTop,e.style.cssText=`--t:1;--o:0;--d:${r};--x:${n-o.left};--y:${i-o.top}`})})},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)},x=()=>{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)})},T=()=>{document.removeEventListener("DOMContentLoaded",T),x()};return"loading"!==document.readyState?x():document.addEventListener("DOMContentLoaded",T),{initialize:()=>E(document),cleanup:()=>L(document)}})()})(),t})());
package/docs/radio.html CHANGED
@@ -5,7 +5,7 @@
5
5
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
6
  <title>MICL Radio Buttons</title>
7
7
  <link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:FILL@0..1&icon_names=arrow_back,close,dark_mode&display=block">
8
- <link rel="stylesheet" href="themes/citrine/theme.css" id="theme-link">
8
+ <link rel="stylesheet" href="themes/airblue/theme.css" id="theme-link">
9
9
  <link rel="stylesheet" href="micl.css">
10
10
  <link rel="stylesheet" href="docs.css">
11
11
  <style>
package/docs/select.html CHANGED
@@ -6,16 +6,18 @@
6
6
  <title>MICL Selects</title>
7
7
  <link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Roboto:ital,wght@0,100..900;1,100..900&display=swap">
8
8
  <link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:FILL@0..1&icon_names=check,confirmation_number,dark_mode,group,home,newspaper,person,settings&display=block">
9
- <link rel="stylesheet" href="themes/citrine/theme.css" id="theme-link">
9
+ <link rel="stylesheet" href="themes/airblue/theme.css" id="theme-link">
10
10
  <link rel="stylesheet" href="micl.css">
11
11
  <link rel="stylesheet" href="docs.css">
12
12
  <style>
13
13
  .micl-card__content > .micl-textfield-outlined, .micl-card__content > .micl-textfield-filled {
14
14
  margin: 32px 0;
15
15
  }
16
+ #myselect3 option::checkmark {
17
+ display: none;
18
+ }
16
19
  .micl-list-item__thumbnail {
17
- height: 32px;
18
- min-height: 32px;
20
+ height: 56px;
19
21
  }
20
22
  </style>
21
23
  </head>
@@ -79,27 +81,27 @@
79
81
  <label for="myselect3">Country</label>
80
82
  <select id="myselect3">
81
83
  <option class="micl-list-item-two" value=""></option>
82
- <option class="micl-list-item-two" value="AR">
84
+ <option class="micl-list-item-two" style="--md-sys-list-item-thumbnail-aspect-ratio:1.594" value="AR">
83
85
  <span class="micl-list-item__thumbnail" style="background-image:url(https://upload.wikimedia.org/wikipedia/commons/thumb/1/1a/Flag_of_Argentina.svg/330px-Flag_of_Argentina.svg.png)"></span>
84
86
  <span class="micl-list-item__text" aria-description="Country code: AR">Argentina</span>
85
87
  </option>
86
- <option class="micl-list-item-two" value="BO">
88
+ <option class="micl-list-item-two" style="--md-sys-list-item-thumbnail-aspect-ratio:1.594" value="BO">
87
89
  <span class="micl-list-item__thumbnail" style="background-image:url(https://upload.wikimedia.org/wikipedia/commons/thumb/b/b3/Bandera_de_Bolivia_%28Estado%29.svg/330px-Bandera_de_Bolivia_%28Estado%29.svg.png)"></span>
88
90
  <span class="micl-list-item__text" aria-description="Country code: BO">Bolivia</span>
89
91
  </option>
90
- <option class="micl-list-item-two" value="BR">
92
+ <option class="micl-list-item-two" style="--md-sys-list-item-thumbnail-aspect-ratio:1.594" value="BR">
91
93
  <span class="micl-list-item__thumbnail" style="background-image:url(https://upload.wikimedia.org/wikipedia/en/thumb/0/05/Flag_of_Brazil.svg/330px-Flag_of_Brazil.svg.png)"></span>
92
94
  <span class="micl-list-item__text" aria-description="Country code: BR">Brazil</span>
93
95
  </option>
94
- <option class="micl-list-item-two" value="CL">
96
+ <option class="micl-list-item-two" style="--md-sys-list-item-thumbnail-aspect-ratio:1.594" value="CL">
95
97
  <span class="micl-list-item__thumbnail" style="background-image:url(https://upload.wikimedia.org/wikipedia/commons/thumb/7/78/Flag_of_Chile.svg/330px-Flag_of_Chile.svg.png)"></span>
96
98
  <span class="micl-list-item__text" aria-description="Country code: CL">Chile</span>
97
99
  </option>
98
- <option class="micl-list-item-two" value="CO" disabled>
100
+ <option class="micl-list-item-two" style="--md-sys-list-item-thumbnail-aspect-ratio:1.594" value="CO" disabled>
99
101
  <span class="micl-list-item__thumbnail" style="background-image:url(https://upload.wikimedia.org/wikipedia/commons/thumb/2/21/Flag_of_Colombia.svg/330px-Flag_of_Colombia.svg.png)"></span>
100
102
  <span class="micl-list-item__text" aria-description="Country code: CO">Colombia</span>
101
103
  </option>
102
- <option class="micl-list-item-two" value="EC">
104
+ <option class="micl-list-item-two" style="--md-sys-list-item-thumbnail-aspect-ratio:1.594" value="EC">
103
105
  <span class="micl-list-item__thumbnail" style="background-image:url(https://upload.wikimedia.org/wikipedia/commons/thumb/e/e8/Flag_of_Ecuador.svg/330px-Flag_of_Ecuador.svg.png)"></span>
104
106
  <span class="micl-list-item__text" aria-description="Country code: EC">Ecuador</span>
105
107
  </option>
@@ -6,7 +6,7 @@
6
6
  <title>MICL Side Sheets</title>
7
7
  <link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Roboto:ital,wght@0,100..900;1,100..900&display=swap">
8
8
  <link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:FILL@0..1&icon_names=arrow_back,close,dark_mode&display=block">
9
- <link rel="stylesheet" href="themes/citrine/theme.css" id="theme-link">
9
+ <link rel="stylesheet" href="themes/airblue/theme.css" id="theme-link">
10
10
  <link rel="stylesheet" href="micl.css">
11
11
  <link rel="stylesheet" href="docs.css">
12
12
  <style>
package/docs/slider.html CHANGED
@@ -8,18 +8,20 @@
8
8
  <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
9
9
  <link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Roboto:ital,wght@0,100..900;1,100..900&display=swap">
10
10
  <link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:FILL@0..1&icon_names=dark_mode,volume_up&display=block">
11
- <link rel="stylesheet" href="themes/citrine/theme.css" id="theme-link">
11
+ <link rel="stylesheet" href="themes/airblue/theme.css" id="theme-link">
12
12
  <link rel="stylesheet" href="micl.css">
13
13
  <link rel="stylesheet" href="docs.css">
14
14
  <style>
15
- .micl-card-elevated, .micl-card-filled, .micl-card-outlined {
16
- padding: 0 16px;
17
- text-align: center;
18
- }
19
- .range {
20
- margin: 64px 8px;
15
+ .micl-card__content {
16
+ display: flex;
17
+ flex-direction: column;
18
+ row-gap: 64px;
19
+ padding-block: 64px;
21
20
  background-color: inherit;
22
21
  }
22
+ .micl-card-filled .micl-card__content {
23
+ align-items: center;
24
+ }
23
25
  .micl-card-elevated input[type=range] {
24
26
  width: 100%;
25
27
  }
@@ -36,35 +38,69 @@
36
38
 
37
39
  <div class="cards">
38
40
  <div class="micl-card-elevated">
39
- <div class="range">
41
+ <div class="micl-card__content">
40
42
  <input type="range" class="micl-slider-xs" min="1" max="10" value="6">
41
- </div>
42
- <div class="range">
43
- <input type="range" class="micl-slider-s" min="0" max="100" value="25" step="25" list="markers">
44
- <datalist id="markers">
43
+ <input type="range" class="micl-slider-s" min="0" max="100" value="25" step="25" list="markers1">
44
+ <datalist id="markers1">
45
45
  <option value="0"></option>
46
46
  <option value="25"></option>
47
47
  <option value="50"></option>
48
48
  <option value="75"></option>
49
49
  <option value="100"></option>
50
50
  </datalist>
51
- </div>
52
- <div class="range micl-slider__container">
53
- <span class="micl-slider__icon material-symbols-outlined">volume_up</span>
54
- <input type="range" class="micl-slider-m" min="3.5" max="12.5" value="9.5" step="0.5">
55
- </div>
56
- <div class="range">
51
+ <div class="range micl-slider__container">
52
+ <span class="micl-slider__icon material-symbols-outlined">volume_up</span>
53
+ <input type="range" class="micl-slider-m" min="3.5" max="12.5" value="9.5" step="0.5">
54
+ </div>
57
55
  <input type="range" class="micl-slider-l" value="0">
58
- </div>
59
- <div class="range">
60
56
  <input type="range" class="micl-slider-xl" disabled>
61
57
  </div>
62
58
  </div>
63
59
  <div class="micl-card-filled">
64
- <div class="range">
60
+ <div class="micl-card__content">
65
61
  <input type="range" class="micl-slider-xl micl-slider--vertical">
66
62
  </div>
67
63
  </div>
64
+ <div class="micl-card-elevated">
65
+ <div class="micl-card__headline-s">
66
+ <h2>Gecko browsers</h2>
67
+ </div>
68
+ <div class="micl-card__content">
69
+ <div class="micl-slider__container">
70
+ <input type="range" class="micl-slider-xs" min="1" max="10" value="6">
71
+ </div>
72
+ <div class="micl-slider__container">
73
+ <input type="range" class="micl-slider-s" min="0" max="100" value="25" step="25" list="markers2">
74
+ </div>
75
+ <datalist id="markers2">
76
+ <option value="0"></option>
77
+ <option value="25"></option>
78
+ <option value="50"></option>
79
+ <option value="75"></option>
80
+ <option value="100"></option>
81
+ </datalist>
82
+ <div class="micl-slider__container">
83
+ <span class="micl-slider__icon material-symbols-outlined">volume_up</span>
84
+ <input type="range" class="micl-slider-m" min="3.5" max="12.5" value="9.5" step="0.5">
85
+ </div>
86
+ <div class="micl-slider__container">
87
+ <input type="range" class="micl-slider-l" value="0">
88
+ </div>
89
+ <div class="micl-slider__container">
90
+ <input type="range" class="micl-slider-xl" disabled>
91
+ </div>
92
+ </div>
93
+ </div>
94
+ <div class="micl-card-filled">
95
+ <div class="micl-card__headline-s">
96
+ <h2>Gecko browsers</h2>
97
+ </div>
98
+ <div class="micl-card__content">
99
+ <div class="micl-slider__container">
100
+ <input type="range" class="micl-slider-xl micl-slider--vertical">
101
+ </div>
102
+ </div>
103
+ </div>
68
104
  </div>
69
105
 
70
106
  <script src="micl.js"></script>
package/docs/switch.html CHANGED
@@ -6,7 +6,7 @@
6
6
  <title>MICL Switches</title>
7
7
  <link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Roboto:ital,wght@0,100..900;1,100..900&display=swap">
8
8
  <link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:FILL@0..1&icon_names=dark_mode&display=block">
9
- <link rel="stylesheet" href="themes/citrine/theme.css" id="theme-link">
9
+ <link rel="stylesheet" href="themes/airblue/theme.css" id="theme-link">
10
10
  <link rel="stylesheet" href="micl.css">
11
11
  <link rel="stylesheet" href="docs.css">
12
12
  <style>
@@ -6,7 +6,7 @@
6
6
  <title>MICL Text Fields</title>
7
7
  <link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Roboto:ital,wght@0,100..900;1,100..900&display=swap">
8
8
  <link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:FILL@0..1&icon_names=cancel,credit_card,dark_mode,error,search&display=block">
9
- <link rel="stylesheet" href="themes/citrine/theme.css" id="theme-link">
9
+ <link rel="stylesheet" href="themes/airblue/theme.css" id="theme-link">
10
10
  <link rel="stylesheet" href="micl.css">
11
11
  <link rel="stylesheet" href="docs.css">
12
12
  <style>
@@ -67,12 +67,16 @@ export default (() =>
67
67
  }
68
68
  };
69
69
 
70
- const initializeComponents = () =>
70
+ const initializeComponents = (parent: HTMLDocument | HTMLElement): void =>
71
71
  {
72
- document.querySelectorAll<HTMLElement>(selector).forEach(initializeComponent);
72
+ parent.querySelectorAll<HTMLElement>(selector).forEach(initializeComponent);
73
73
 
74
- document.querySelectorAll<HTMLElement>('[class*="micl-"]').forEach(element => {
75
- if (window.getComputedStyle(element).getPropertyValue('--miclripple')) {
74
+ parent.querySelectorAll<HTMLElement>('[class*="micl-"]').forEach(element => {
75
+ if (
76
+ element.parentElement
77
+ && !window.getComputedStyle(element.parentElement).getPropertyValue('--miclripple')
78
+ && window.getComputedStyle(element).getPropertyValue('--miclripple')
79
+ ) {
76
80
  element.addEventListener('pointerdown', e => {
77
81
  if ((e.currentTarget as Element).classList.contains('micl-card--nonactionable')) {
78
82
  return;
@@ -104,67 +108,88 @@ export default (() =>
104
108
  }
105
109
  };
106
110
 
107
- const observer = new MutationObserver(mutations =>
111
+ const cleanupComponents = (parent: HTMLDocument | HTMLElement): void =>
112
+ {
113
+ parent.querySelectorAll<HTMLElement>(selector).forEach(cleanupComponent);
114
+ };
115
+
116
+ const activate = () =>
108
117
  {
109
- mutations.forEach(mutation =>
118
+ const observer = new MutationObserver(mutations =>
110
119
  {
111
- if (mutation.type !== 'childList') {
112
- return;
113
- }
114
- mutation.addedNodes.forEach(node =>
120
+ mutations.forEach(mutation =>
115
121
  {
116
- if (node instanceof HTMLElement) {
117
- if (node.matches(selector)) {
118
- initializeComponent(node);
119
- }
120
- node.querySelectorAll<HTMLElement>(selector).forEach(initializeComponent);
122
+ if (mutation.type !== 'childList') {
123
+ return;
121
124
  }
122
- });
123
- mutation.removedNodes.forEach(node =>
124
- {
125
- if (node instanceof HTMLElement) {
126
- if (node.matches(selector)) {
127
- cleanupComponent(node);
125
+ mutation.addedNodes.forEach(node =>
126
+ {
127
+ if (node instanceof HTMLElement) {
128
+ if (node.matches(selector)) {
129
+ initializeComponent(node);
130
+ }
131
+ node.querySelectorAll<HTMLElement>(selector).forEach(initializeComponent);
128
132
  }
129
- node.querySelectorAll<HTMLElement>(selector).forEach(cleanupComponent);
130
- }
133
+ });
134
+ mutation.removedNodes.forEach(node =>
135
+ {
136
+ if (node instanceof HTMLElement) {
137
+ if (node.matches(selector)) {
138
+ cleanupComponent(node);
139
+ }
140
+ cleanupComponents(node);
141
+ }
142
+ });
131
143
  });
132
144
  });
133
- });
134
- observer.observe(document.body, { childList: true, subtree: true });
145
+ observer.observe(document.body, { childList: true, subtree: true });
135
146
 
136
- initializeComponents();
147
+ initializeComponents(document);
137
148
 
138
- // Delegated Event Handlers
139
- document.addEventListener('input', event =>
140
- {
141
- for (const [selector, { component, type }] of Object.entries(componentMap)) {
142
- if (
143
- (event.target as Element).matches(selector)
144
- && event.target instanceof type
145
- && typeof component.input === 'function'
146
- ) {
147
- component.input(event);
148
- return;
149
+ // Delegated Event Handlers
150
+ document.addEventListener('input', event =>
151
+ {
152
+ for (const [selector, { component, type }] of Object.entries(componentMap)) {
153
+ if (
154
+ (event.target as Element).matches(selector)
155
+ && event.target instanceof type
156
+ && typeof component.input === 'function'
157
+ ) {
158
+ component.input(event);
159
+ return;
160
+ }
149
161
  }
150
- }
151
- });
152
- document.addEventListener('keydown', event =>
153
- {
154
- for (const [selector, { component, type }] of Object.entries(componentMap)) {
155
- if (
156
- (event.target as Element).matches(selector)
157
- && event.target instanceof type
158
- && typeof component.keydown === 'function'
159
- ) {
160
- component.keydown(event);
161
- return;
162
+ });
163
+ document.addEventListener('keydown', event =>
164
+ {
165
+ for (const [selector, { component, type }] of Object.entries(componentMap)) {
166
+ if (
167
+ (event.target as Element).matches(selector)
168
+ && event.target instanceof type
169
+ && typeof component.keydown === 'function'
170
+ ) {
171
+ component.keydown(event);
172
+ return;
173
+ }
162
174
  }
163
- }
164
- });
175
+ });
176
+ };
177
+
178
+ const loaded = () =>
179
+ {
180
+ document.removeEventListener('DOMContentLoaded', loaded);
181
+ activate();
182
+ };
183
+
184
+ if (document.readyState !== 'loading') {
185
+ activate();
186
+ }
187
+ else {
188
+ document.addEventListener('DOMContentLoaded', loaded);
189
+ }
165
190
 
166
191
  return {
167
- initialize: () => initializeComponents(),
168
- cleanup : () => document.querySelectorAll<HTMLElement>(selector).forEach(cleanupComponent)
192
+ initialize: () => initializeComponents(document),
193
+ cleanup : () => cleanupComponents(document)
169
194
  };
170
195
  })();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "material-inspired-component-library",
3
- "version": "1.1.0",
3
+ "version": "1.2.1",
4
4
  "description": "The Material-Inspired Component Library (MICL) offers a collection of beautifully crafted components leveraging native HTML markup, designed to align with the Material Design 3 guidelines.",
5
5
  "author": "MICL Hermana <micl.hermana@proton.me> (https://github.com/henkpb/micl)",
6
6
  "license": "MIT",
@@ -35,12 +35,14 @@
35
35
  "bugs": {
36
36
  "url": "https://github.com/henkpb/micl/issues"
37
37
  },
38
- "main": "index.js",
38
+ "main": "dist/micl.js",
39
+ "types": "dist/micl.d.ts",
39
40
  "scripts": {
40
41
  "build": "webpack",
41
42
  "start": "echo 'No start script yet'",
42
43
  "test": "echo \"Error: no test specified\" && exit 1"
43
44
  },
45
+ "sideEffects": false,
44
46
  "devDependencies": {
45
47
  "autoprefixer": "^10.4.19",
46
48
  "css-loader": "^7.1.2",
@@ -0,0 +1,74 @@
1
+ //
2
+ // Copyright © 2025 Hermana AS
3
+ //
4
+ // Permission is hereby granted, free of charge, to any person obtaining a copy
5
+ // of this software and associated documentation files (the "Software"), to deal
6
+ // in the Software without restriction, including without limitation the rights
7
+ // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8
+ // copies of the Software, and to permit persons to whom the Software is
9
+ // furnished to do so, subject to the following conditions:
10
+ //
11
+ // The above copyright notice and this permission notice shall be included in all
12
+ // copies or substantial portions of the Software.
13
+ //
14
+ // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15
+ // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16
+ // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17
+ // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18
+ // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19
+ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20
+ // SOFTWARE.
21
+
22
+ $md-sys-margin-compact: 0px;
23
+ $md-sys-margin-medium: 0px;
24
+ $md-sys-margin-expanded: 0px;
25
+ $md-sys-margin-large: 0px;
26
+ $md-sys-margin-extra-large: 0px;
27
+
28
+ $md-sys-spacer: 24px;
29
+
30
+ $md-sys-padding-xxs: 4px;
31
+ $md-sys-padding-xs: 8px;
32
+ $md-sys-padding-s: 12px;
33
+ $md-sys-padding-m: 16px;
34
+ $md-sys-padding-l: 20px;
35
+ $md-sys-padding-xl: 24px;
36
+ $md-sys-padding-xxl: 28px;
37
+
38
+ $md-sys-target-size: 48px;
39
+
40
+ :root {
41
+ --md-sys-margin-compact: $md-sys-margin-compact;
42
+ --md-sys-margin-medium: $md-sys-margin-medium;
43
+ --md-sys-margin-expanded: $md-sys-margin-expanded;
44
+ --md-sys-margin-large: $md-sys-margin-large;
45
+ --md-sys-margin-extra-large: $md-sys-margin-extra-large;
46
+
47
+ --md-sys-spacer: $md-sys-spacer;
48
+
49
+ --md-sys-padding-xxs: $md-sys-padding-xxs;
50
+ --md-sys-padding-xs: $md-sys-padding-xs;
51
+ --md-sys-padding-s: $md-sys-padding-s;
52
+ --md-sys-padding-m: $md-sys-padding-m;
53
+ --md-sys-padding-l: $md-sys-padding-l;
54
+ --md-sys-padding-xl: $md-sys-padding-xl;
55
+ --md-sys-padding-xxl: $md-sys-padding-xxl;
56
+
57
+ --md-sys-target-size: $md-sys-target-size;
58
+ }
59
+
60
+ .micl-pane-fixed {
61
+ display: flex;
62
+ flex: 0 0 auto;
63
+ flex-direction: row;
64
+ }
65
+
66
+ .micl-pane-flexible {
67
+ display: flex;
68
+ flex: 1 1 auto;
69
+ flex-direction: row;
70
+ }
71
+
72
+ .micl-pane__column {
73
+ display: flex;
74
+ }
package/tsconfig.json CHANGED
@@ -26,7 +26,7 @@
26
26
 
27
27
  /* Modules */
28
28
  "module": "es2022", /* Specify what module code is generated. */
29
- // "rootDir": "./", /* Specify the root folder within your source files. */
29
+ "rootDir": "./", /* Specify the root folder within your source files. */
30
30
  "moduleResolution": "node10", /* Specify how TypeScript looks up a file from a given module specifier. */
31
31
  // "baseUrl": "./", /* Specify the base directory to resolve non-relative module names. */
32
32
  // "paths": {}, /* Specify a set of entries that re-map imports to additional lookup locations. */
@@ -50,14 +50,14 @@
50
50
  // "maxNodeModuleJsDepth": 1, /* Specify the maximum folder depth used for checking JavaScript files from 'node_modules'. Only applicable with 'allowJs'. */
51
51
 
52
52
  /* Emit */
53
- // "declaration": true, /* Generate .d.ts files from TypeScript and JavaScript files in your project. */
53
+ "declaration": true, /* Generate .d.ts files from TypeScript and JavaScript files in your project. */
54
54
  // "declarationMap": true, /* Create sourcemaps for d.ts files. */
55
55
  // "emitDeclarationOnly": true, /* Only output d.ts files and not JavaScript files. */
56
56
  // "sourceMap": true, /* Create source map files for emitted JavaScript files. */
57
57
  // "inlineSourceMap": true, /* Include sourcemap files inside the emitted JavaScript. */
58
58
  // "noEmit": true, /* Disable emitting files from a compilation. */
59
59
  // "outFile": "./", /* Specify a file that bundles all outputs into one JavaScript file. If 'declaration' is true, also designates a file that bundles all .d.ts output. */
60
- // "outDir": "./", /* Specify an output folder for all emitted files. */
60
+ "outDir": "./dist", /* Specify an output folder for all emitted files. */
61
61
  // "removeComments": true, /* Disable emitting comments. */
62
62
  // "importHelpers": true, /* Allow importing helper functions from tslib once per project, instead of including them per-file. */
63
63
  // "downlevelIteration": true, /* Emit more compliant, but verbose and less performant JavaScript for iteration. */
@@ -70,7 +70,7 @@
70
70
  // "noEmitHelpers": true, /* Disable generating custom helper functions like '__extends' in compiled output. */
71
71
  // "noEmitOnError": true, /* Disable emitting files if any type checking errors are reported. */
72
72
  // "preserveConstEnums": true, /* Disable erasing 'const enum' declarations in generated code. */
73
- // "declarationDir": "./", /* Specify the output directory for generated declaration files. */
73
+ "declarationDir": "./dist", /* Specify the output directory for generated declaration files. */
74
74
 
75
75
  /* Interop Constraints */
76
76
  // "isolatedModules": true, /* Ensure that each file can be safely transpiled without relying on other imports. */
@@ -106,5 +106,11 @@
106
106
  /* Completeness */
107
107
  // "skipDefaultLibCheck": true, /* Skip type checking .d.ts files that are included with TypeScript. */
108
108
  "skipLibCheck": true /* Skip type checking all .d.ts files. */
109
- }
109
+ },
110
+ "include": [
111
+ "./**/*"
112
+ ],
113
+ "exclude": [
114
+ "node_modules"
115
+ ]
110
116
  }
package/webpack.config.js CHANGED
@@ -15,7 +15,7 @@ module.exports = [{
15
15
  mode: 'production',
16
16
  entry: {
17
17
  ...scssEntries,
18
- micl: ['./styles.scss', './components.ts']
18
+ micl: ['./styles.scss', './micl.ts']
19
19
  },
20
20
  resolve: {
21
21
  extensions: ['.ts', '.tsx', '.js']
@@ -23,7 +23,11 @@ module.exports = [{
23
23
  output: {
24
24
  path: distDir,
25
25
  filename: '[name].js',
26
- clean: true
26
+ clean: true,
27
+ library: {
28
+ name: 'micl',
29
+ type: 'umd'
30
+ }
27
31
  },
28
32
  module: {
29
33
  rules: [{
@@ -34,8 +38,7 @@ module.exports = [{
34
38
  'postcss-loader',
35
39
  'sass-loader'
36
40
  ]
37
- },
38
- {
41
+ }, {
39
42
  test: /\.tsx?$/,
40
43
  use: 'ts-loader',
41
44
  exclude: /node_modules/