@maggioli-design-system/mds-accordion-timer 2.2.0 → 3.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (87) hide show
  1. package/dist/cjs/{index-6821dfbc.js → index-b99075ba.js} +56 -9
  2. package/dist/cjs/loader.cjs.js +3 -3
  3. package/dist/cjs/mds-accordion-timer.cjs.entry.js +24 -24
  4. package/dist/cjs/mds-accordion-timer.cjs.js +3 -3
  5. package/dist/collection/collection-manifest.json +1 -1
  6. package/dist/collection/common/keyboard-manager.js +40 -0
  7. package/dist/collection/components/mds-accordion-timer/mds-accordion-timer.js +29 -29
  8. package/dist/collection/components/mds-accordion-timer/test/mds-accordion-timer.stories.js +1 -1
  9. package/dist/collection/dictionary/icon.js +3 -1
  10. package/dist/collection/dictionary/typography.js +5 -1
  11. package/dist/components/mds-accordion-timer.js +24 -24
  12. package/dist/esm/{index-5ca2b649.js → index-bd689d6a.js} +56 -9
  13. package/dist/esm/loader.js +4 -4
  14. package/dist/esm/mds-accordion-timer.entry.js +24 -24
  15. package/dist/esm/mds-accordion-timer.js +4 -4
  16. package/dist/esm-es5/{index-5ca2b649.js → index-bd689d6a.js} +1 -1
  17. package/dist/esm-es5/loader.js +1 -1
  18. package/dist/esm-es5/mds-accordion-timer.entry.js +1 -1
  19. package/dist/esm-es5/mds-accordion-timer.js +1 -1
  20. package/dist/mds-accordion-timer/mds-accordion-timer.esm.js +1 -1
  21. package/dist/mds-accordion-timer/mds-accordion-timer.js +1 -1
  22. package/dist/mds-accordion-timer/p-4620ac30.system.js +1 -0
  23. package/dist/mds-accordion-timer/{p-59116e2a.system.js → p-5029b85d.system.js} +2 -2
  24. package/dist/mds-accordion-timer/p-7df47654.system.entry.js +1 -0
  25. package/dist/mds-accordion-timer/p-a7b74010.js +2 -0
  26. package/dist/mds-accordion-timer/p-aae0027a.entry.js +1 -0
  27. package/dist/stats.json +68 -65
  28. package/dist/types/common/keyboard-manager.d.ts +11 -0
  29. package/dist/types/components/mds-accordion-timer/mds-accordion-timer.d.ts +6 -7
  30. package/dist/types/components.d.ts +1 -1
  31. package/dist/types/dictionary/icon.d.ts +2 -1
  32. package/dist/types/dictionary/typography.d.ts +2 -1
  33. package/dist/types/stencil-public-runtime.d.ts +11 -0
  34. package/dist/types/{types → type}/typography.d.ts +1 -0
  35. package/package.json +4 -4
  36. package/readme.md +3 -3
  37. package/src/common/keyboard-manager.ts +46 -0
  38. package/src/components/mds-accordion-timer/mds-accordion-timer.tsx +29 -29
  39. package/src/components/mds-accordion-timer/readme.md +3 -3
  40. package/src/components/mds-accordion-timer/test/mds-accordion-timer.stories.tsx +1 -1
  41. package/src/components.d.ts +1 -1
  42. package/src/dictionary/icon.ts +4 -0
  43. package/src/dictionary/typography.ts +9 -3
  44. package/src/fixtures/icons.json +174 -0
  45. package/src/fixtures/iconsauce.json +175 -0
  46. package/src/tailwind/components.css +1 -0
  47. package/src/{types → type}/typography.ts +4 -0
  48. package/www/build/mds-accordion-timer.esm.js +1 -1
  49. package/www/build/mds-accordion-timer.js +1 -1
  50. package/www/build/p-4620ac30.system.js +1 -0
  51. package/www/build/{p-59116e2a.system.js → p-5029b85d.system.js} +2 -2
  52. package/www/build/p-7df47654.system.entry.js +1 -0
  53. package/www/build/p-a7b74010.js +2 -0
  54. package/www/build/p-aae0027a.entry.js +1 -0
  55. package/dist/mds-accordion-timer/p-5d8e384d.js +0 -2
  56. package/dist/mds-accordion-timer/p-c4b2aa5c.system.js +0 -1
  57. package/dist/mds-accordion-timer/p-e66497f2.system.entry.js +0 -1
  58. package/dist/mds-accordion-timer/p-f0c71bfc.entry.js +0 -1
  59. package/www/build/p-5d8e384d.js +0 -2
  60. package/www/build/p-c4b2aa5c.system.js +0 -1
  61. package/www/build/p-e66497f2.system.entry.js +0 -1
  62. package/www/build/p-f0c71bfc.entry.js +0 -1
  63. /package/dist/collection/{types → type}/autocomplete.js +0 -0
  64. /package/dist/collection/{types → type}/button.js +0 -0
  65. /package/dist/collection/{types → type}/floating-ui.js +0 -0
  66. /package/dist/collection/{types → type}/form-rel.js +0 -0
  67. /package/dist/collection/{types → type}/input-text-type.js +0 -0
  68. /package/dist/collection/{types → type}/input-value-type.js +0 -0
  69. /package/dist/collection/{types → type}/loading.js +0 -0
  70. /package/dist/collection/{types → type}/typography.js +0 -0
  71. /package/dist/collection/{types → type}/variant.js +0 -0
  72. /package/dist/types/{types → type}/autocomplete.d.ts +0 -0
  73. /package/dist/types/{types → type}/button.d.ts +0 -0
  74. /package/dist/types/{types → type}/floating-ui.d.ts +0 -0
  75. /package/dist/types/{types → type}/form-rel.d.ts +0 -0
  76. /package/dist/types/{types → type}/input-text-type.d.ts +0 -0
  77. /package/dist/types/{types → type}/input-value-type.d.ts +0 -0
  78. /package/dist/types/{types → type}/loading.d.ts +0 -0
  79. /package/dist/types/{types → type}/variant.d.ts +0 -0
  80. /package/src/{types → type}/autocomplete.ts +0 -0
  81. /package/src/{types → type}/button.ts +0 -0
  82. /package/src/{types → type}/floating-ui.ts +0 -0
  83. /package/src/{types → type}/form-rel.ts +0 -0
  84. /package/src/{types → type}/input-text-type.ts +0 -0
  85. /package/src/{types → type}/input-value-type.ts +0 -0
  86. /package/src/{types → type}/loading.ts +0 -0
  87. /package/src/{types → type}/variant.ts +0 -0
@@ -0,0 +1,2 @@
1
+ let e,t,n=!1;const l=e=>"object"==(e=typeof e)||"function"===e;function o(e){var t,n,l;return null!==(l=null===(n=null===(t=e.head)||void 0===t?void 0:t.querySelector('meta[name="csp-nonce"]'))||void 0===n?void 0:n.getAttribute("content"))&&void 0!==l?l:void 0}const s=(e,t,...n)=>{let o=null,s=!1,r=!1;const i=[],a=t=>{for(let n=0;n<t.length;n++)o=t[n],Array.isArray(o)?a(o):null!=o&&"boolean"!=typeof o&&((s="function"!=typeof e&&!l(o))&&(o+=""),s&&r?i[i.length-1].t+=o:i.push(s?c(null,o):o),r=s)};a(n);const u=c(e,null);return u.l=t,i.length>0&&(u.o=i),u},c=(e,t)=>({i:0,u:e,t,m:null,o:null}),r={},i=e=>F(e).h,a=(e,t,n)=>{const l=i(e);return{emit:e=>u(l,t,{bubbles:!!(4&n),composed:!!(2&n),cancelable:!!(1&n),detail:e})}},u=(e,t,n)=>{const l=z.ce(t,n);return e.dispatchEvent(l),l},f=new WeakMap,d=e=>"sc-"+e.p,m=(t,n,l)=>{const o=n.o[l];let s,c,r=0;if(s=o.m=_.createElement(o.u),null!=e&&s["s-si"]!==e&&s.classList.add(s["s-si"]=e),o.o)for(r=0;r<o.o.length;++r)c=m(t,o,r),c&&s.appendChild(c);return s},h=(e,n,l,o,s,c)=>{let r,i=e;for(i.shadowRoot&&i.tagName===t&&(i=i.shadowRoot);s<=c;++s)o[s]&&(r=m(null,l,s),r&&(o[s].m=r,i.insertBefore(r,n)))},p=(e,t,n,l)=>{for(;t<=n;++t)(l=e[t])&&l.m.remove()},$=(e,t)=>e.u===t.u,y=(e,t)=>{const n=t.m=e.m,l=e.o,o=t.o;null!==l&&null!==o?((e,t,n,l)=>{let o,s=0,c=0,r=t.length-1,i=t[0],a=t[r],u=l.length-1,f=l[0],d=l[u];for(;s<=r&&c<=u;)null==i?i=t[++s]:null==a?a=t[--r]:null==f?f=l[++c]:null==d?d=l[--u]:$(i,f)?(y(i,f),i=t[++s],f=l[++c]):$(a,d)?(y(a,d),a=t[--r],d=l[--u]):$(i,d)?(y(i,d),e.insertBefore(i.m,a.m.nextSibling),i=t[++s],d=l[--u]):$(a,f)?(y(a,f),e.insertBefore(a.m,i.m),a=t[--r],f=l[++c]):(o=m(t&&t[c],n,c),f=l[++c],o&&i.m.parentNode.insertBefore(o,i.m));s>r?h(e,null==l[u+1]?null:l[u+1].m,n,l,c,u):c>u&&p(t,s,r)})(n,l,t,o):null!==o?h(n,null,t,o,0,o.length-1):null!==l&&p(l,0,l.length-1)},b=(e,t)=>{t&&!e.$&&t["s-p"]&&t["s-p"].push(new Promise((t=>e.$=t)))},w=(e,t)=>{if(e.i|=16,!(4&e.i))return b(e,e.v),Z((()=>v(e,t)));e.i|=512},v=(e,t)=>{const n=e.S;return t&&(e.i|=256,e.g&&(e.g.map((([e,t])=>k(n,e,t))),e.g=null)),C(void 0,(()=>S(e,n,t)))},S=async(e,t,n)=>{const l=e.h,s=l["s-rc"];n&&(e=>{const t=e.M,n=e.h,l=t.i,s=((e,t)=>{var n;let l=d(t);const s=D.get(l);if(e=11===e.nodeType?e:_,s)if("string"==typeof s){let t,c=f.get(e=e.head||e);if(c||f.set(e,c=new Set),!c.has(l)){{t=_.createElement("style"),t.innerHTML=s;const l=null!==(n=z.j)&&void 0!==n?n:o(_);null!=l&&t.setAttribute("nonce",l),e.insertBefore(t,e.querySelector("link"))}c&&c.add(l)}}else e.adoptedStyleSheets.includes(s)||(e.adoptedStyleSheets=[...e.adoptedStyleSheets,s]);return l})(n.shadowRoot?n.shadowRoot:n.getRootNode(),t);10&l&&(n["s-sc"]=s,n.classList.add(s+"-h"))})(e);g(e,t),s&&(s.map((e=>e())),l["s-rc"]=void 0);{const t=l["s-p"],n=()=>M(e);0===t.length?n():(Promise.all(t).then(n),e.i|=4,t.length=0)}},g=(n,l)=>{try{l=l.render(),n.i&=-17,n.i|=2,((n,l)=>{const o=n.h,i=n.k||c(null,null),a=(e=>e&&e.u===r)(l)?l:s(null,null,l);t=o.tagName,a.u=null,a.i|=4,n.k=a,a.m=i.m=o.shadowRoot||o,e=o["s-sc"],y(i,a)})(n,l)}catch(e){U(e,n.h)}return null},M=e=>{const t=e.h,n=e.S,l=e.v;64&e.i||(e.i|=64,O(t),k(n,"componentDidLoad"),e.C(t),l||j()),e.$&&(e.$(),e.$=void 0),512&e.i&&Y((()=>w(e,!1))),e.i&=-517},j=()=>{O(_.documentElement),Y((()=>u(V,"appload",{detail:{namespace:"mds-accordion-timer"}})))},k=(e,t,n)=>{if(e&&e[t])try{return e[t](n)}catch(e){U(e)}},C=(e,t)=>e&&e.then?e.then(t):t(),O=e=>e.setAttribute("hydrated",""),P=(e,t,n)=>{if(t.O){const o=Object.entries(t.O),s=e.prototype;if(o.map((([e,[o]])=>{(31&o||2&n&&32&o)&&Object.defineProperty(s,e,{get(){return((e,t)=>F(this).P.get(t))(0,e)},set(n){((e,t,n,o)=>{const s=F(e),c=s.P.get(t),r=s.i,i=s.S;n=((e,t)=>null==e||l(e)?e:2&t?parseFloat(e):e)(n,o.O[t][0]),8&r&&void 0!==c||n===c||Number.isNaN(c)&&Number.isNaN(n)||(s.P.set(t,n),i&&2==(18&r)&&w(s,!1))})(this,e,n,t)},configurable:!0,enumerable:!0})})),1&n){const t=new Map;s.attributeChangedCallback=function(e,n,l){z.jmp((()=>{const n=t.get(e);if(this.hasOwnProperty(n))l=this[n],delete this[n];else if(s.hasOwnProperty(n)&&"number"==typeof this[n]&&this[n]==l)return;this[n]=(null!==l||"boolean"!=typeof this[n])&&l}))},e.observedAttributes=o.filter((([e,t])=>15&t[0])).map((([e,n])=>{const l=n[1]||e;return t.set(l,e),l}))}}return e},x=(e,t={})=>{var n;const l=[],s=t.exclude||[],c=V.customElements,r=_.head,i=r.querySelector("meta[charset]"),a=_.createElement("style"),u=[];let f,m=!0;Object.assign(z,t),z.L=new URL(t.resourcesUrl||"./",_.baseURI).href,e.map((e=>{e[1].map((t=>{const n={i:t[0],p:t[1],O:t[2],N:t[3]};n.O=t[2],n.N=t[3];const o=n.p,r=class extends HTMLElement{constructor(e){super(e),R(e=this,n),1&n.i&&e.attachShadow({mode:"open"})}connectedCallback(){f&&(clearTimeout(f),f=null),m?u.push(this):z.jmp((()=>(e=>{if(0==(1&z.i)){const t=F(e),n=t.M,l=()=>{};if(1&t.i)E(e,t,n.N);else{t.i|=1;{let n=e;for(;n=n.parentNode||n.host;)if(n["s-p"]){b(t,t.v=n);break}}n.O&&Object.entries(n.O).map((([t,[n]])=>{if(31&n&&e.hasOwnProperty(t)){const n=e[t];delete e[t],e[t]=n}})),(async(e,t,n,l,o)=>{if(0==(32&t.i)){{if(t.i|=32,(o=q(n)).then){const e=()=>{};o=await o,e()}o.isProxied||(P(o,n,2),o.isProxied=!0);const e=()=>{};t.i|=8;try{new o(t)}catch(e){U(e)}t.i&=-9,e()}if(o.style){let e=o.style;const t=d(n);if(!D.has(t)){const l=()=>{};((e,t,n)=>{let l=D.get(e);G&&n?(l=l||new CSSStyleSheet,"string"==typeof l?l=t:l.replaceSync(t)):l=t,D.set(e,l)})(t,e,!!(1&n.i)),l()}}}const s=t.v,c=()=>w(t,!0);s&&s["s-rc"]?s["s-rc"].push(c):c()})(0,t,n)}l()}})(this)))}disconnectedCallback(){z.jmp((()=>(()=>{if(0==(1&z.i)){const e=F(this),t=e.S;e.T&&(e.T.map((e=>e())),e.T=void 0),k(t,"disconnectedCallback")}})()))}componentOnReady(){return F(this).A}};n.F=e[0],s.includes(o)||c.get(o)||(l.push(o),c.define(o,P(r,n,1)))}))}));{a.innerHTML=l+"{visibility:hidden}[hydrated]{visibility:inherit}",a.setAttribute("data-styles","");const e=null!==(n=z.j)&&void 0!==n?n:o(_);null!=e&&a.setAttribute("nonce",e),r.insertBefore(a,i?i.nextSibling:r.firstChild)}m=!1,u.length?u.map((e=>e.connectedCallback())):z.jmp((()=>f=setTimeout(j,30)))},E=(e,t,n)=>{n&&n.map((([n,l,o])=>{const s=e,c=L(t,o),r=N(n);z.ael(s,l,c,r),(t.T=t.T||[]).push((()=>z.rel(s,l,c,r)))}))},L=(e,t)=>n=>{try{256&e.i?e.S[t](n):(e.g=e.g||[]).push([t,n])}catch(e){U(e)}},N=e=>0!=(2&e),T=e=>z.j=e,A=new WeakMap,F=e=>A.get(e),H=(e,t)=>A.set(t.S=e,t),R=(e,t)=>{const n={i:0,h:e,M:t,P:new Map};return n.A=new Promise((e=>n.C=e)),e["s-p"]=[],e["s-rc"]=[],E(e,n,t.N),A.set(e,n)},U=(e,t)=>(0,console.error)(e,t),W=new Map,q=e=>{const t=e.p.replace(/-/g,"_"),n=e.F,l=W.get(n);return l?l[t]:import(`./${n}.entry.js`).then((e=>(W.set(n,e),e[t])),U)
2
+ /*!__STENCIL_STATIC_IMPORT_SWITCH__*/},D=new Map,V="undefined"!=typeof window?window:{},_=V.document||{head:{}},z={i:0,L:"",jmp:e=>e(),raf:e=>requestAnimationFrame(e),ael:(e,t,n,l)=>e.addEventListener(t,n,l),rel:(e,t,n,l)=>e.removeEventListener(t,n,l),ce:(e,t)=>new CustomEvent(e,t)},B=e=>Promise.resolve(e),G=(()=>{try{return new CSSStyleSheet,"function"==typeof(new CSSStyleSheet).replaceSync}catch(e){}return!1})(),I=[],J=[],K=(e,t)=>l=>{e.push(l),n||(n=!0,t&&4&z.i?Y(X):z.raf(X))},Q=e=>{for(let t=0;t<e.length;t++)try{e[t](performance.now())}catch(e){U(e)}e.length=0},X=()=>{Q(I),Q(J),(n=I.length>0)&&z.raf(X)},Y=e=>B().then(e),Z=K(J,!0);export{r as H,x as b,a as c,i as g,s as h,B as p,H as r,T as s}
@@ -0,0 +1 @@
1
+ import{r as t,c as s,h as i,H as h,g as e}from"./p-a7b74010.js";const n=class{constructor(i){t(this,i),this.changeEvent=s(this,"mdsAccordionTimerChange",7),this.clearIntervals=()=>{window.clearInterval(this.timer),window.clearInterval(this.timeChecker),this.timer=null,this.timeChecker=null},this.progress=()=>Math.abs(this.remainingTime()/this.duration-1),this.addTimeListener=()=>{this.timeChecker=window.setInterval((()=>{const t=this.progress();void 0!==this.selectedItem&&(this.selectedItem.progress=t),1===t&&(this.selectedItem.progress=0,this.startNext())}),100)},this.beginningTime=()=>(this.timeStarted=(new Date).getTime(),this.timeStarted),this.remainingTime=()=>{const t=this.selectedItemDurationTime-((new Date).getTime()-this.timeStarted);return t>=0?t:0},this.setSelectedItem=t=>{this.children.forEach(((s,i)=>{i===t?(s.selected=!0,this.selectedItem=s,this.changeEvent.emit(t)):s.selected=!1}))},this.startNext=()=>{this.setSelectedItem(this.selectedItem.uuid+1>this.children.length-1?0:this.selectedItem.uuid+1),this.startTimer()},this.startTimer=()=>{this.clearIntervals(),this.time=this.beginningTime(),this.selectedItemDurationTime=this.duration,this.addTimeListener()},this.playTimer=()=>{this.beginningTime(),this.addTimeListener()},this.pauseTimer=()=>{this.clearIntervals(),this.selectedItemDurationTime=this.remainingTime()},this.stopTimer=()=>{this.clearIntervals(),this.time=null},this.time=0,this.duration=1e4}componentDidLoad(){this.children=this.element.querySelectorAll("mds-accordion-timer-item"),this.children.forEach(((t,s)=>{t.uuid=s,t.selected&&(this.selectedItem=t)})),void 0!==this.selectedItem&&this.startTimer()}disconnectedCallback(){this.stopTimer(),this.clearIntervals()}onClickActive(t){if(this.selectedItem&&t.detail===this.selectedItem.description)return;let s;this.children.forEach((i=>{i.progress=0,i.description===t.detail&&(s=i.uuid)})),this.setSelectedItem(s),this.startTimer(),this.pauseTimer()}onMouseEnterSelect(){this.pauseTimer()}onMouseLeaveSelect(){null===this.timeChecker&&this.playTimer()}render(){return i(h,null,i("slot",null))}get element(){return e(this)}};n.style=":host{display:block}";export{n as mds_accordion_timer}
package/dist/stats.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "timestamp": "2023-01-20T18:15:56",
2
+ "timestamp": "2023-03-09T10:43:18",
3
3
  "compiler": {
4
4
  "name": "node",
5
5
  "version": "18.3.0"
@@ -9,13 +9,14 @@
9
9
  "fsNamespace": "mds-accordion-timer",
10
10
  "components": 1,
11
11
  "entries": 1,
12
- "bundles": 64,
12
+ "bundles": 65,
13
13
  "outputs": [
14
14
  {
15
15
  "name": "dist-collection",
16
- "files": 23,
16
+ "files": 24,
17
17
  "generatedFiles": [
18
18
  "./dist/collection/common/aria.js",
19
+ "./dist/collection/common/keyboard-manager.js",
19
20
  "./dist/collection/components/mds-accordion-timer/mds-accordion-timer.js",
20
21
  "./dist/collection/components/mds-accordion-timer/test/mds-accordion-timer.stories.js",
21
22
  "./dist/collection/dictionary/autocomplete.js",
@@ -29,15 +30,15 @@
29
30
  "./dist/collection/dictionary/variant.js",
30
31
  "./dist/collection/fixtures/cities.js",
31
32
  "./dist/collection/interface/input-value.js",
32
- "./dist/collection/types/autocomplete.js",
33
- "./dist/collection/types/button.js",
34
- "./dist/collection/types/floating-ui.js",
35
- "./dist/collection/types/form-rel.js",
36
- "./dist/collection/types/input-text-type.js",
37
- "./dist/collection/types/input-value-type.js",
38
- "./dist/collection/types/loading.js",
39
- "./dist/collection/types/typography.js",
40
- "./dist/collection/types/variant.js"
33
+ "./dist/collection/type/autocomplete.js",
34
+ "./dist/collection/type/button.js",
35
+ "./dist/collection/type/floating-ui.js",
36
+ "./dist/collection/type/form-rel.js",
37
+ "./dist/collection/type/input-text-type.js",
38
+ "./dist/collection/type/input-value-type.js",
39
+ "./dist/collection/type/loading.js",
40
+ "./dist/collection/type/typography.js",
41
+ "./dist/collection/type/variant.js"
41
42
  ]
42
43
  },
43
44
  {
@@ -54,17 +55,17 @@
54
55
  "name": "dist-lazy",
55
56
  "files": 35,
56
57
  "generatedFiles": [
57
- "./dist/cjs/index-6821dfbc.js",
58
+ "./dist/cjs/index-b99075ba.js",
58
59
  "./dist/cjs/index.cjs.js",
59
60
  "./dist/cjs/loader.cjs.js",
60
61
  "./dist/cjs/mds-accordion-timer.cjs.entry.js",
61
62
  "./dist/cjs/mds-accordion-timer.cjs.js",
62
- "./dist/esm-es5/index-5ca2b649.js",
63
+ "./dist/esm-es5/index-bd689d6a.js",
63
64
  "./dist/esm-es5/index.js",
64
65
  "./dist/esm-es5/loader.js",
65
66
  "./dist/esm-es5/mds-accordion-timer.entry.js",
66
67
  "./dist/esm-es5/mds-accordion-timer.js",
67
- "./dist/esm/index-5ca2b649.js",
68
+ "./dist/esm/index-bd689d6a.js",
68
69
  "./dist/esm/index.js",
69
70
  "./dist/esm/loader.js",
70
71
  "./dist/esm/mds-accordion-timer.entry.js",
@@ -74,21 +75,21 @@
74
75
  "./dist/mds-accordion-timer/index.esm.js",
75
76
  "./dist/mds-accordion-timer/mds-accordion-timer.esm.js",
76
77
  "./dist/mds-accordion-timer/mds-accordion-timer.js",
78
+ "./dist/mds-accordion-timer/p-4620ac30.system.js",
79
+ "./dist/mds-accordion-timer/p-5029b85d.system.js",
77
80
  "./dist/mds-accordion-timer/p-50ea2036.system.js",
78
- "./dist/mds-accordion-timer/p-59116e2a.system.js",
79
- "./dist/mds-accordion-timer/p-5d8e384d.js",
80
- "./dist/mds-accordion-timer/p-c4b2aa5c.system.js",
81
- "./dist/mds-accordion-timer/p-e66497f2.system.entry.js",
82
- "./dist/mds-accordion-timer/p-f0c71bfc.entry.js",
81
+ "./dist/mds-accordion-timer/p-7df47654.system.entry.js",
82
+ "./dist/mds-accordion-timer/p-a7b74010.js",
83
+ "./dist/mds-accordion-timer/p-aae0027a.entry.js",
83
84
  "./www/build/index.esm.js",
84
85
  "./www/build/mds-accordion-timer.esm.js",
85
86
  "./www/build/mds-accordion-timer.js",
87
+ "./www/build/p-4620ac30.system.js",
88
+ "./www/build/p-5029b85d.system.js",
86
89
  "./www/build/p-50ea2036.system.js",
87
- "./www/build/p-59116e2a.system.js",
88
- "./www/build/p-5d8e384d.js",
89
- "./www/build/p-c4b2aa5c.system.js",
90
- "./www/build/p-e66497f2.system.entry.js",
91
- "./www/build/p-f0c71bfc.entry.js"
90
+ "./www/build/p-7df47654.system.entry.js",
91
+ "./www/build/p-a7b74010.js",
92
+ "./www/build/p-aae0027a.entry.js"
92
93
  ]
93
94
  },
94
95
  {
@@ -121,12 +122,12 @@
121
122
  "components": [
122
123
  "mds-accordion-timer"
123
124
  ],
124
- "bundleId": "p-f0c71bfc",
125
- "fileName": "p-f0c71bfc.entry.js",
125
+ "bundleId": "p-aae0027a",
126
+ "fileName": "p-aae0027a.entry.js",
126
127
  "imports": [
127
- "p-5d8e384d.js"
128
+ "p-a7b74010.js"
128
129
  ],
129
- "originalByteSize": 3432
130
+ "originalByteSize": 3516
130
131
  }
131
132
  ],
132
133
  "esm": [
@@ -138,9 +139,9 @@
138
139
  "bundleId": "mds-accordion-timer",
139
140
  "fileName": "mds-accordion-timer.entry.js",
140
141
  "imports": [
141
- "index-5ca2b649.js"
142
+ "index-bd689d6a.js"
142
143
  ],
143
- "originalByteSize": 3436
144
+ "originalByteSize": 3520
144
145
  }
145
146
  ],
146
147
  "es5": [
@@ -152,9 +153,9 @@
152
153
  "bundleId": "mds-accordion-timer",
153
154
  "fileName": "mds-accordion-timer.entry.js",
154
155
  "imports": [
155
- "index-5ca2b649.js"
156
+ "index-bd689d6a.js"
156
157
  ],
157
- "originalByteSize": 3436
158
+ "originalByteSize": 3520
158
159
  }
159
160
  ],
160
161
  "system": [
@@ -163,12 +164,12 @@
163
164
  "components": [
164
165
  "mds-accordion-timer"
165
166
  ],
166
- "bundleId": "p-e66497f2.system",
167
- "fileName": "p-e66497f2.system.entry.js",
167
+ "bundleId": "p-7df47654.system",
168
+ "fileName": "p-7df47654.system.entry.js",
168
169
  "imports": [
169
- "p-59116e2a.system.js"
170
+ "p-5029b85d.system.js"
170
171
  ],
171
- "originalByteSize": 4378
172
+ "originalByteSize": 4462
172
173
  }
173
174
  ],
174
175
  "commonjs": [
@@ -180,9 +181,9 @@
180
181
  "bundleId": "mds-accordion-timer.cjs",
181
182
  "fileName": "mds-accordion-timer.cjs.entry.js",
182
183
  "imports": [
183
- "index-6821dfbc.js"
184
+ "index-b99075ba.js"
184
185
  ],
185
- "originalByteSize": 3483
186
+ "originalByteSize": 3567
186
187
  }
187
188
  ]
188
189
  },
@@ -206,8 +207,8 @@
206
207
  "excludeFromCollection": false,
207
208
  "events": [
208
209
  {
209
- "name": "itemActivated",
210
- "method": "itemActivated",
210
+ "name": "mdsAccordionTimerChange",
211
+ "method": "changeEvent",
211
212
  "bubbles": true,
212
213
  "cancelable": true,
213
214
  "composed": true,
@@ -228,20 +229,20 @@
228
229
  "legacyContext": [],
229
230
  "listeners": [
230
231
  {
231
- "name": "clickActive",
232
+ "name": "mdsAccordionTimerItemClickSelect",
232
233
  "method": "onClickActive",
233
234
  "capture": false,
234
235
  "passive": false
235
236
  },
236
237
  {
237
- "name": "mouseEnterActive",
238
- "method": "onMouseEnterActive",
238
+ "name": "mdsAccordionTimerItemMouseEnterSelect",
239
+ "method": "onMouseEnterSelect",
239
240
  "capture": false,
240
241
  "passive": false
241
242
  },
242
243
  {
243
- "name": "mouseLeaveActive",
244
- "method": "onMouseLeaveActive",
244
+ "name": "mdsAccordionTimerItemMouseLeaveSelect",
245
+ "method": "onMouseLeaveSelect",
245
246
  "capture": false,
246
247
  "passive": false
247
248
  }
@@ -320,28 +321,28 @@
320
321
  "methods": [],
321
322
  "listeners": [
322
323
  {
323
- "name": "clickActive",
324
+ "name": "mdsAccordionTimerItemClickSelect",
324
325
  "method": "onClickActive",
325
326
  "capture": false,
326
327
  "passive": false
327
328
  },
328
329
  {
329
- "name": "mouseEnterActive",
330
- "method": "onMouseEnterActive",
330
+ "name": "mdsAccordionTimerItemMouseEnterSelect",
331
+ "method": "onMouseEnterSelect",
331
332
  "capture": false,
332
333
  "passive": false
333
334
  },
334
335
  {
335
- "name": "mouseLeaveActive",
336
- "method": "onMouseLeaveActive",
336
+ "name": "mdsAccordionTimerItemMouseLeaveSelect",
337
+ "method": "onMouseLeaveSelect",
337
338
  "capture": false,
338
339
  "passive": false
339
340
  }
340
341
  ],
341
342
  "events": [
342
343
  {
343
- "name": "itemActivated",
344
- "method": "itemActivated",
344
+ "name": "mdsAccordionTimerChange",
345
+ "method": "changeEvent",
345
346
  "bubbles": true,
346
347
  "cancelable": true,
347
348
  "composed": true,
@@ -394,7 +395,7 @@
394
395
  "hasComponentWillRenderFn": false,
395
396
  "hasComponentDidRenderFn": false,
396
397
  "hasComponentDidUnloadFn": false,
397
- "hasConnectedCallbackFn": true,
398
+ "hasConnectedCallbackFn": false,
398
399
  "hasDisconnectedCallbackFn": true,
399
400
  "hasElement": false,
400
401
  "hasEvent": true,
@@ -449,11 +450,12 @@
449
450
  ],
450
451
  "componentGraph": {
451
452
  "sc-mds-accordion-timer": [
452
- "p-5d8e384d.js"
453
+ "p-a7b74010.js"
453
454
  ]
454
455
  },
455
456
  "sourceGraph": {
456
457
  "./src/common/aria.ts": [],
458
+ "./src/common/keyboard-manager.ts": [],
457
459
  "./src/components/mds-accordion-timer/mds-accordion-timer.tsx": [],
458
460
  "./src/components/mds-accordion-timer/test/mds-accordion-timer.stories.tsx": [],
459
461
  "./src/dictionary/autocomplete.ts": [],
@@ -461,7 +463,8 @@
461
463
  "./src/dictionary/color.ts": [],
462
464
  "./src/dictionary/floating-ui.ts": [],
463
465
  "./src/dictionary/icon.ts": [
464
- "./src/fixtures/icons.json"
466
+ "./src/fixtures/icons.json",
467
+ "./src/fixtures/iconsauce.json"
465
468
  ],
466
469
  "./src/dictionary/input-text-type.ts": [],
467
470
  "./src/dictionary/loading.ts": [],
@@ -469,15 +472,15 @@
469
472
  "./src/dictionary/variant.ts": [],
470
473
  "./src/fixtures/cities.ts": [],
471
474
  "./src/interface/input-value.ts": [],
472
- "./src/types/autocomplete.ts": [],
473
- "./src/types/button.ts": [],
474
- "./src/types/floating-ui.ts": [],
475
- "./src/types/form-rel.ts": [],
476
- "./src/types/input-text-type.ts": [],
477
- "./src/types/input-value-type.ts": [],
478
- "./src/types/loading.ts": [],
479
- "./src/types/typography.ts": [],
480
- "./src/types/variant.ts": []
475
+ "./src/type/autocomplete.ts": [],
476
+ "./src/type/button.ts": [],
477
+ "./src/type/floating-ui.ts": [],
478
+ "./src/type/form-rel.ts": [],
479
+ "./src/type/input-text-type.ts": [],
480
+ "./src/type/input-value-type.ts": [],
481
+ "./src/type/loading.ts": [],
482
+ "./src/type/typography.ts": [],
483
+ "./src/type/variant.ts": []
481
484
  },
482
485
  "collections": []
483
486
  }
@@ -0,0 +1,11 @@
1
+ export declare class KeyboardManager {
2
+ private escapeCallback;
3
+ private elements;
4
+ private handleClickBehaviorDispatchEvent;
5
+ private handleEscapeBehaviorDispatchEvent;
6
+ addElement: (el: HTMLElement, name?: string) => void;
7
+ attachClickBehavior: (name?: string) => void;
8
+ detachClickBehavior: (name?: string) => void;
9
+ attachEscapeBehavior: (callBack: () => void) => void;
10
+ detachEscapeBehavior: () => void;
11
+ }
@@ -3,9 +3,9 @@ export declare class MdsAccordionTimer {
3
3
  private timer;
4
4
  private timeChecker;
5
5
  private timeStarted;
6
- private activeItemDurationTime;
6
+ private selectedItemDurationTime;
7
7
  private children;
8
- private activeItem;
8
+ private selectedItem;
9
9
  private element;
10
10
  time: number;
11
11
  /**
@@ -15,23 +15,22 @@ export declare class MdsAccordionTimer {
15
15
  /**
16
16
  * Emits when the accordion changes it's item
17
17
  */
18
- itemActivated: EventEmitter<number>;
18
+ changeEvent: EventEmitter<number>;
19
19
  componentDidLoad(): void;
20
20
  private clearIntervals;
21
- connectedCallback(): void;
22
21
  disconnectedCallback(): void;
23
22
  private progress;
24
23
  private addTimeListener;
25
24
  private beginningTime;
26
25
  private remainingTime;
27
- private setActiveItem;
26
+ private setSelectedItem;
28
27
  private startNext;
29
28
  private startTimer;
30
29
  private playTimer;
31
30
  private pauseTimer;
32
31
  private stopTimer;
33
32
  onClickActive(event: CustomEvent<string>): void;
34
- onMouseEnterActive(): void;
35
- onMouseLeaveActive(): void;
33
+ onMouseEnterSelect(): void;
34
+ onMouseLeaveSelect(): void;
36
35
  render(): any;
37
36
  }
@@ -37,7 +37,7 @@ declare namespace LocalJSX {
37
37
  /**
38
38
  * Emits when the accordion changes it's item
39
39
  */
40
- "onItemActivated"?: (event: MdsAccordionTimerCustomEvent<number>) => void;
40
+ "onMdsAccordionTimerChange"?: (event: MdsAccordionTimerCustomEvent<number>) => void;
41
41
  }
42
42
  interface IntrinsicElements {
43
43
  "mds-accordion-timer": MdsAccordionTimer;
@@ -1,2 +1,3 @@
1
1
  declare const iconsDictionary: string[];
2
- export { iconsDictionary, };
2
+ declare const mggIconsDictionary: string[];
3
+ export { iconsDictionary, mggIconsDictionary, };
@@ -1,9 +1,10 @@
1
1
  declare const typographyDictionary: string[];
2
2
  declare const typographyVariationsDictionary: string[];
3
+ declare const typographyReadingVariationsDictionary: string[];
3
4
  declare const typographyMonoDictionary: string[];
4
5
  declare const typographyTitleDictionary: string[];
5
6
  declare const typographyInfoDictionary: string[];
6
7
  declare const typographyReadDictionary: string[];
7
8
  declare const typographySmallerDictionary: string[];
8
9
  declare const typographyTooltipDictionary: string[];
9
- export { typographyDictionary, typographyVariationsDictionary, typographyMonoDictionary, typographyTitleDictionary, typographyInfoDictionary, typographyReadDictionary, typographySmallerDictionary, typographyTooltipDictionary, };
10
+ export { typographyDictionary, typographyInfoDictionary, typographyReadingVariationsDictionary, typographyMonoDictionary, typographyReadDictionary, typographySmallerDictionary, typographyTitleDictionary, typographyTooltipDictionary, typographyVariationsDictionary, };
@@ -485,6 +485,14 @@ export interface FunctionalUtilities {
485
485
  export interface FunctionalComponent<T = {}> {
486
486
  (props: T, children: VNode[], utils: FunctionalUtilities): VNode | VNode[];
487
487
  }
488
+ /**
489
+ * A Child VDOM node
490
+ *
491
+ * This has most of the same properties as {@link VNode} but friendlier names
492
+ * (i.e. `vtag` instead of `$tag$`, `vchildren` instead of `$children$`) in
493
+ * order to provide a friendlier public interface for users of the
494
+ * {@link FunctionalUtilities}).
495
+ */
488
496
  export interface ChildNode {
489
497
  vtag?: string | number | Function;
490
498
  vkey?: string | number;
@@ -531,6 +539,9 @@ export declare function h(sel: any, children: Array<VNode | undefined | null>):
531
539
  export declare function h(sel: any, data: VNodeData | null, text: string): VNode;
532
540
  export declare function h(sel: any, data: VNodeData | null, children: Array<VNode | undefined | null>): VNode;
533
541
  export declare function h(sel: any, data: VNodeData | null, children: VNode): VNode;
542
+ /**
543
+ * A virtual DOM node
544
+ */
534
545
  export interface VNode {
535
546
  $flags$: number;
536
547
  $tag$: string | number | Function;
@@ -1,5 +1,6 @@
1
1
  export type TypographyType = 'action' | 'caption' | 'snippet' | 'detail' | 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6' | 'hack' | 'label' | 'option' | 'paragraph' | 'tip';
2
2
  export type TypographyVariants = 'title' | 'info' | 'read' | 'code';
3
+ export type TypographyReadingVariants = 'info' | 'read';
3
4
  export type TypographyTitleType = 'action' | 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6';
4
5
  export type TypographyInfoType = 'caption' | 'detail' | 'label' | 'option' | 'paragraph' | 'tip';
5
6
  export type TypographyReadType = 'caption' | 'detail' | 'paragraph';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@maggioli-design-system/mds-accordion-timer",
3
- "version": "2.2.0",
3
+ "version": "3.1.0",
4
4
  "description": "mds-accordion-timer is a web-component from Maggioli Design System Magma, built with StencilJS, TypeScript, Storybook. It's based on the web-component standard and it's designed to be agnostic from the JavaScirpt framework you are using.",
5
5
  "main": "dist/index.cjs.js",
6
6
  "module": "dist/index.js",
@@ -23,9 +23,9 @@
23
23
  "test": "stencil test --spec --e2e"
24
24
  },
25
25
  "dependencies": {
26
- "@maggioli-design-system/mds-accordion-timer-item": "^2.1.1",
27
- "@maggioli-design-system/styles": "^10.0.1",
28
- "@stencil/core": "^2.22.1"
26
+ "@maggioli-design-system/mds-accordion-timer-item": "^3.0.1",
27
+ "@maggioli-design-system/styles": "^11.2.1",
28
+ "@stencil/core": "^2.22.2"
29
29
  },
30
30
  "license": "MIT",
31
31
  "author": {
package/readme.md CHANGED
@@ -14,9 +14,9 @@
14
14
 
15
15
  ## Events
16
16
 
17
- | Event | Description | Type |
18
- | --------------- | ------------------------------------------ | --------------------- |
19
- | `itemActivated` | Emits when the accordion changes it's item | `CustomEvent<number>` |
17
+ | Event | Description | Type |
18
+ | ------------------------- | ------------------------------------------ | --------------------- |
19
+ | `mdsAccordionTimerChange` | Emits when the accordion changes it's item | `CustomEvent<number>` |
20
20
 
21
21
 
22
22
  ----------------------------------------------
@@ -0,0 +1,46 @@
1
+ export class KeyboardManager {
2
+ private escapeCallback: () => void
3
+ private elements = []
4
+
5
+ private handleClickBehaviorDispatchEvent = (event: KeyboardEvent): void => {
6
+ if (event.code === 'Space' || event.code === 'Enter' || event.code === 'NumpadEnter') {
7
+ (event.target as HTMLElement).click()
8
+ }
9
+ }
10
+
11
+ private handleEscapeBehaviorDispatchEvent = (event: KeyboardEvent): void => {
12
+ if (event.code === 'Escape' && this.escapeCallback) {
13
+ this.escapeCallback()
14
+ }
15
+ }
16
+
17
+ addElement = (el: HTMLElement, name = 'element'): void => {
18
+ this.elements[name] = el
19
+ }
20
+
21
+ attachClickBehavior = (name = 'element'): void => {
22
+ if (this.elements[name]) {
23
+ this.elements[name].addEventListener('keydown', this.handleClickBehaviorDispatchEvent)
24
+ }
25
+ }
26
+
27
+ detachClickBehavior = (name = 'element'): void => {
28
+ if (this.elements[name]) {
29
+ this.elements[name].removeEventListener('keydown', this.handleClickBehaviorDispatchEvent)
30
+ }
31
+ }
32
+
33
+ attachEscapeBehavior = (callBack: () => void): void => {
34
+ this.escapeCallback = callBack
35
+ if (typeof window !== undefined) {
36
+ window.addEventListener('keydown', this.handleEscapeBehaviorDispatchEvent.bind(this))
37
+ }
38
+ }
39
+
40
+ detachEscapeBehavior = (): void => {
41
+ this.escapeCallback = null
42
+ if (typeof window !== undefined) {
43
+ window.removeEventListener('keydown', this.handleEscapeBehaviorDispatchEvent.bind(this))
44
+ }
45
+ }
46
+ }