@maggioli-design-system/mds-accordion-timer 3.2.0 → 3.3.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 (61) hide show
  1. package/dist/cjs/loader.cjs.js +1 -1
  2. package/dist/cjs/mds-accordion-timer.cjs.entry.js +6 -15
  3. package/dist/cjs/mds-accordion-timer.cjs.js +1 -1
  4. package/dist/collection/collection-manifest.json +1 -1
  5. package/dist/collection/common/aria.js +4 -2
  6. package/dist/collection/common/keyboard-manager.js +1 -1
  7. package/dist/collection/common/unit.js +10 -0
  8. package/dist/collection/components/mds-accordion-timer/mds-accordion-timer.css +14 -0
  9. package/dist/collection/components/mds-accordion-timer/mds-accordion-timer.js +6 -15
  10. package/dist/collection/components/mds-accordion-timer/test/mds-accordion-timer.stories.js +1 -1
  11. package/dist/collection/dictionary/button.js +5 -1
  12. package/dist/collection/dictionary/variant.js +9 -1
  13. package/dist/components/mds-accordion-timer.js +6 -15
  14. package/dist/documentation.d.ts +148 -0
  15. package/dist/documentation.json +98 -0
  16. package/dist/esm/loader.js +1 -1
  17. package/dist/esm/mds-accordion-timer.entry.js +6 -15
  18. package/dist/esm/mds-accordion-timer.js +1 -1
  19. package/dist/esm-es5/mds-accordion-timer.entry.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-2a65b768.system.entry.js +1 -0
  23. package/{www/build/p-4620ac30.system.js → dist/mds-accordion-timer/p-5e09eed0.system.js} +1 -1
  24. package/dist/mds-accordion-timer/p-778834a9.entry.js +1 -0
  25. package/dist/stats.json +49 -21
  26. package/dist/types/common/unit.d.ts +2 -0
  27. package/dist/types/components/mds-accordion-timer/mds-accordion-timer.d.ts +3 -2
  28. package/dist/types/components.d.ts +1 -1
  29. package/dist/types/dictionary/button.d.ts +2 -1
  30. package/dist/types/dictionary/variant.d.ts +2 -1
  31. package/dist/types/interface/input-value.d.ts +1 -1
  32. package/dist/types/type/button.d.ts +1 -0
  33. package/dist/types/type/variant.d.ts +1 -0
  34. package/documentation.json +99 -0
  35. package/package.json +11 -5
  36. package/readme.md +11 -0
  37. package/src/common/aria.ts +2 -2
  38. package/src/common/keyboard-manager.ts +1 -1
  39. package/src/common/unit.ts +14 -0
  40. package/src/components/mds-accordion-timer/mds-accordion-timer.css +14 -0
  41. package/src/components/mds-accordion-timer/mds-accordion-timer.tsx +8 -16
  42. package/src/components/mds-accordion-timer/readme.md +11 -0
  43. package/src/components/mds-accordion-timer/test/mds-accordion-timer.stories.tsx +1 -1
  44. package/src/components.d.ts +1 -1
  45. package/src/dictionary/button.ts +7 -1
  46. package/src/dictionary/variant.ts +10 -0
  47. package/src/fixtures/icons.json +20 -0
  48. package/src/fixtures/iconsauce.json +19 -0
  49. package/src/interface/input-value.ts +1 -1
  50. package/src/type/button.ts +4 -0
  51. package/src/type/variant.ts +9 -0
  52. package/www/build/mds-accordion-timer.esm.js +1 -1
  53. package/www/build/mds-accordion-timer.js +1 -1
  54. package/www/build/p-2a65b768.system.entry.js +1 -0
  55. package/{dist/mds-accordion-timer/p-4620ac30.system.js → www/build/p-5e09eed0.system.js} +1 -1
  56. package/www/build/p-778834a9.entry.js +1 -0
  57. package/dist/mds-accordion-timer/p-2bfbd758.system.entry.js +0 -1
  58. package/dist/mds-accordion-timer/p-8d875f1d.entry.js +0 -1
  59. package/src/components/mds-accordion-timer/test/mds-accordion-timer.spec.tsx +0 -19
  60. package/www/build/p-2bfbd758.system.entry.js +0 -1
  61. package/www/build/p-8d875f1d.entry.js +0 -1
@@ -1 +1 @@
1
- import{p as e,b as o}from"./p-a7b74010.js";export{s as setNonce}from"./p-a7b74010.js";(()=>{const o=import.meta.url,t={};return""!==o&&(t.resourcesUrl=new URL(".",o).href),e(t)})().then((e=>o([["p-8d875f1d",[[1,"mds-accordion-timer",{duration:[2],time:[32]},[[0,"mdsAccordionTimerItemClickSelect","onClickActive"],[0,"mdsAccordionTimerItemMouseEnterSelect","onMouseEnterSelect"],[0,"mdsAccordionTimerItemMouseLeaveSelect","onMouseLeaveSelect"]]]]]],e)));
1
+ import{p as e,b as o}from"./p-a7b74010.js";export{s as setNonce}from"./p-a7b74010.js";(()=>{const o=import.meta.url,t={};return""!==o&&(t.resourcesUrl=new URL(".",o).href),e(t)})().then((e=>o([["p-778834a9",[[1,"mds-accordion-timer",{duration:[2],time:[32]},[[0,"mdsAccordionTimerItemClickSelect","onClickActive"],[0,"mdsAccordionTimerItemMouseEnterSelect","onMouseEnterSelect"],[0,"mdsAccordionTimerItemMouseLeaveSelect","onMouseLeaveSelect"]]]]]],e)));
@@ -115,7 +115,7 @@ DOMTokenList
115
115
  var resourcesUrl = scriptElm ? scriptElm.getAttribute('data-resources-url') || scriptElm.src : '';
116
116
  var start = function() {
117
117
  // if src is not present then origin is "null", and new URL() throws TypeError: Failed to construct 'URL': Invalid base URL
118
- var url = new URL('./p-4620ac30.system.js', new URL(resourcesUrl, window.location.origin !== 'null' ? window.location.origin : undefined));
118
+ var url = new URL('./p-5e09eed0.system.js', new URL(resourcesUrl, window.location.origin !== 'null' ? window.location.origin : undefined));
119
119
  System.import(url.href);
120
120
  };
121
121
 
@@ -0,0 +1 @@
1
+ System.register(["./p-5029b85d.system.js"],(function(e){"use strict";var t,i,r,n,s;return{setters:[function(e){t=e.r;i=e.c;r=e.h;n=e.H;s=e.g}],execute:function(){var c=":host{--mds-accordion-timer-progress-bar-color:rgb(var(--tone-neutral-03));--mds-accordion-timer-progress-bar-background:rgb(var(--tone-neutral-08));--mds-accordion-timer-progress-bar-thickness:0.25rem;--mds-accordion-timer-duration:500ms;display:block}";var o=e("mds_accordion_timer",function(){function e(e){var r=this;t(this,e);this.changeEvent=i(this,"mdsAccordionTimerChange",7);this.clearIntervals=function(){window.clearInterval(r.timer);window.clearInterval(r.timeChecker);r.timeChecker=0};this.progress=function(){return Math.abs(r.remainingTime()/r.duration-1)};this.addTimeListener=function(){r.timeChecker=window.setInterval((function(){var e=r.progress();if(r.selectedItem!==undefined){r.selectedItem.progress=e}if(e===1){r.selectedItem.progress=0;r.startNext()}}),100)};this.beginningTime=function(){r.timeStarted=(new Date).getTime();return r.timeStarted};this.remainingTime=function(){var e=r.selectedItemDurationTime-((new Date).getTime()-r.timeStarted);return e>=0?e:0};this.setSelectedItem=function(e){r.children.forEach((function(t,i){if(i===e){t.selected=true;r.selectedItem=t;r.changeEvent.emit()}else{t.selected=false}}))};this.startNext=function(){var e=r.selectedItem.uuid+1>r.children.length-1?0:r.selectedItem.uuid+1;r.setSelectedItem(e);r.startTimer()};this.startTimer=function(){r.clearIntervals();r.time=r.beginningTime();r.selectedItemDurationTime=r.duration;r.addTimeListener()};this.playTimer=function(){r.beginningTime();r.addTimeListener()};this.pauseTimer=function(){r.clearIntervals();r.selectedItemDurationTime=r.remainingTime()};this.stopTimer=function(){r.clearIntervals()};this.time=0;this.duration=1e4}e.prototype.componentDidLoad=function(){var e=this;this.children=this.element.querySelectorAll("mds-accordion-timer-item");this.children.forEach((function(t,i){t.uuid=i;if(t.selected){e.selectedItem=t}}));if(this.selectedItem!==undefined){this.startTimer()}};e.prototype.disconnectedCallback=function(){this.stopTimer();this.clearIntervals()};e.prototype.onClickActive=function(e){if(this.selectedItem){this.selectedItem.progress=0}this.setSelectedItem(e.detail.uuid);this.startTimer();this.pauseTimer()};e.prototype.onMouseEnterSelect=function(){this.pauseTimer()};e.prototype.onMouseLeaveSelect=function(){if(this.timeChecker===0){this.playTimer()}};e.prototype.render=function(){return r(n,null,r("slot",null))};Object.defineProperty(e.prototype,"element",{get:function(){return s(this)},enumerable:false,configurable:true});return e}());o.style=c}}}));
@@ -1 +1 @@
1
- System.register(["./p-5029b85d.system.js"],(function(e,t){"use strict";var r,n;return{setters:[function(t){r=t.p;n=t.b;e("setNonce",t.s)}],execute:function(){var e=function(){var e=t.meta.url;var n={};if(e!==""){n.resourcesUrl=new URL(".",e).href}return r(n)};e().then((function(e){return n([["p-2bfbd758.system",[[1,"mds-accordion-timer",{duration:[2],time:[32]},[[0,"mdsAccordionTimerItemClickSelect","onClickActive"],[0,"mdsAccordionTimerItemMouseEnterSelect","onMouseEnterSelect"],[0,"mdsAccordionTimerItemMouseLeaveSelect","onMouseLeaveSelect"]]]]]],e)}))}}}));
1
+ System.register(["./p-5029b85d.system.js"],(function(e,t){"use strict";var r,n;return{setters:[function(t){r=t.p;n=t.b;e("setNonce",t.s)}],execute:function(){var e=function(){var e=t.meta.url;var n={};if(e!==""){n.resourcesUrl=new URL(".",e).href}return r(n)};e().then((function(e){return n([["p-2a65b768.system",[[1,"mds-accordion-timer",{duration:[2],time:[32]},[[0,"mdsAccordionTimerItemClickSelect","onClickActive"],[0,"mdsAccordionTimerItemMouseEnterSelect","onMouseEnterSelect"],[0,"mdsAccordionTimerItemMouseLeaveSelect","onMouseLeaveSelect"]]]]]],e)}))}}}));
@@ -0,0 +1 @@
1
+ import{r as t,c as s,h as i,H as h,g as o}from"./p-a7b74010.js";const r=class{constructor(i){t(this,i),this.changeEvent=s(this,"mdsAccordionTimerChange",7),this.clearIntervals=()=>{window.clearInterval(this.timer),window.clearInterval(this.timeChecker),this.timeChecker=0},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()):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=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){this.selectedItem&&(this.selectedItem.progress=0),this.setSelectedItem(t.detail.uuid),this.startTimer(),this.pauseTimer()}onMouseEnterSelect(){this.pauseTimer()}onMouseLeaveSelect(){0===this.timeChecker&&this.playTimer()}render(){return i(h,null,i("slot",null))}get element(){return o(this)}};r.style=":host{--mds-accordion-timer-progress-bar-color:rgb(var(--tone-neutral-03));--mds-accordion-timer-progress-bar-background:rgb(var(--tone-neutral-08));--mds-accordion-timer-progress-bar-thickness:0.25rem;--mds-accordion-timer-duration:500ms;display:block}";export{r as mds_accordion_timer}
package/dist/stats.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "timestamp": "2023-03-14T14:54:29",
2
+ "timestamp": "2023-06-23T10:11:40",
3
3
  "compiler": {
4
4
  "name": "node",
5
5
  "version": "18.3.0"
@@ -9,14 +9,15 @@
9
9
  "fsNamespace": "mds-accordion-timer",
10
10
  "components": 1,
11
11
  "entries": 1,
12
- "bundles": 65,
12
+ "bundles": 66,
13
13
  "outputs": [
14
14
  {
15
15
  "name": "dist-collection",
16
- "files": 24,
16
+ "files": 25,
17
17
  "generatedFiles": [
18
18
  "./dist/collection/common/aria.js",
19
19
  "./dist/collection/common/keyboard-manager.js",
20
+ "./dist/collection/common/unit.js",
20
21
  "./dist/collection/components/mds-accordion-timer/mds-accordion-timer.js",
21
22
  "./dist/collection/components/mds-accordion-timer/test/mds-accordion-timer.stories.js",
22
23
  "./dist/collection/dictionary/autocomplete.js",
@@ -75,20 +76,20 @@
75
76
  "./dist/mds-accordion-timer/index.esm.js",
76
77
  "./dist/mds-accordion-timer/mds-accordion-timer.esm.js",
77
78
  "./dist/mds-accordion-timer/mds-accordion-timer.js",
78
- "./dist/mds-accordion-timer/p-2bfbd758.system.entry.js",
79
- "./dist/mds-accordion-timer/p-4620ac30.system.js",
79
+ "./dist/mds-accordion-timer/p-2a65b768.system.entry.js",
80
80
  "./dist/mds-accordion-timer/p-5029b85d.system.js",
81
81
  "./dist/mds-accordion-timer/p-50ea2036.system.js",
82
- "./dist/mds-accordion-timer/p-8d875f1d.entry.js",
82
+ "./dist/mds-accordion-timer/p-5e09eed0.system.js",
83
+ "./dist/mds-accordion-timer/p-778834a9.entry.js",
83
84
  "./dist/mds-accordion-timer/p-a7b74010.js",
84
85
  "./www/build/index.esm.js",
85
86
  "./www/build/mds-accordion-timer.esm.js",
86
87
  "./www/build/mds-accordion-timer.js",
87
- "./www/build/p-2bfbd758.system.entry.js",
88
- "./www/build/p-4620ac30.system.js",
88
+ "./www/build/p-2a65b768.system.entry.js",
89
89
  "./www/build/p-5029b85d.system.js",
90
90
  "./www/build/p-50ea2036.system.js",
91
- "./www/build/p-8d875f1d.entry.js",
91
+ "./www/build/p-5e09eed0.system.js",
92
+ "./www/build/p-778834a9.entry.js",
92
93
  "./www/build/p-a7b74010.js"
93
94
  ]
94
95
  },
@@ -122,12 +123,12 @@
122
123
  "components": [
123
124
  "mds-accordion-timer"
124
125
  ],
125
- "bundleId": "p-8d875f1d",
126
- "fileName": "p-8d875f1d.entry.js",
126
+ "bundleId": "p-778834a9",
127
+ "fileName": "p-778834a9.entry.js",
127
128
  "imports": [
128
129
  "p-a7b74010.js"
129
130
  ],
130
- "originalByteSize": 3512
131
+ "originalByteSize": 3489
131
132
  }
132
133
  ],
133
134
  "esm": [
@@ -141,7 +142,7 @@
141
142
  "imports": [
142
143
  "index-bd689d6a.js"
143
144
  ],
144
- "originalByteSize": 3516
145
+ "originalByteSize": 3493
145
146
  }
146
147
  ],
147
148
  "es5": [
@@ -155,7 +156,7 @@
155
156
  "imports": [
156
157
  "index-bd689d6a.js"
157
158
  ],
158
- "originalByteSize": 3516
159
+ "originalByteSize": 3493
159
160
  }
160
161
  ],
161
162
  "system": [
@@ -164,12 +165,12 @@
164
165
  "components": [
165
166
  "mds-accordion-timer"
166
167
  ],
167
- "bundleId": "p-2bfbd758.system",
168
- "fileName": "p-2bfbd758.system.entry.js",
168
+ "bundleId": "p-2a65b768.system",
169
+ "fileName": "p-2a65b768.system.entry.js",
169
170
  "imports": [
170
171
  "p-5029b85d.system.js"
171
172
  ],
172
- "originalByteSize": 4458
173
+ "originalByteSize": 4381
173
174
  }
174
175
  ],
175
176
  "commonjs": [
@@ -183,7 +184,7 @@
183
184
  "imports": [
184
185
  "index-b99075ba.js"
185
186
  ],
186
- "originalByteSize": 3563
187
+ "originalByteSize": 3540
187
188
  }
188
189
  ]
189
190
  },
@@ -257,7 +258,7 @@
257
258
  "reflect": false,
258
259
  "mutable": false,
259
260
  "required": false,
260
- "optional": true,
261
+ "optional": false,
261
262
  "defaultValue": "10000",
262
263
  "complexType": {
263
264
  "original": "number",
@@ -298,7 +299,7 @@
298
299
  "reflect": false,
299
300
  "mutable": false,
300
301
  "required": false,
301
- "optional": true,
302
+ "optional": false,
302
303
  "defaultValue": "10000",
303
304
  "complexType": {
304
305
  "original": "number",
@@ -378,7 +379,33 @@
378
379
  "legacyContext": [],
379
380
  "internal": false,
380
381
  "assetsDirs": [],
381
- "styleDocs": [],
382
+ "styleDocs": [
383
+ {
384
+ "name": "--mds-accordion-timer-progress-bar-color",
385
+ "docs": "Sets the color of the progress bar when the mds-accordion-timer-item is selected",
386
+ "annotation": "prop"
387
+ },
388
+ {
389
+ "name": "--mds-accordion-timer-progress-bar-background",
390
+ "docs": "Sets the background-color of the progress bar when the mds-accordion-timer-item is selected",
391
+ "annotation": "prop"
392
+ },
393
+ {
394
+ "name": "--mds-accordion-timer-color",
395
+ "docs": "Sets the text color of the component mds-accordion-timer-item",
396
+ "annotation": "prop"
397
+ },
398
+ {
399
+ "name": "--mds-accordion-timer-progress-bar-thickness",
400
+ "docs": "Sets thickness of the progress bar of the mds-accordion-timer-item",
401
+ "annotation": "prop"
402
+ },
403
+ {
404
+ "name": "--mds-accordion-timer-duration",
405
+ "docs": "Sets the transition duration of open/close animation of the mds-accordion-timer-item",
406
+ "annotation": "prop"
407
+ }
408
+ ],
382
409
  "docs": {
383
410
  "tags": [],
384
411
  "text": ""
@@ -456,6 +483,7 @@
456
483
  "sourceGraph": {
457
484
  "./src/common/aria.ts": [],
458
485
  "./src/common/keyboard-manager.ts": [],
486
+ "./src/common/unit.ts": [],
459
487
  "./src/components/mds-accordion-timer/mds-accordion-timer.tsx": [],
460
488
  "./src/components/mds-accordion-timer/test/mds-accordion-timer.stories.tsx": [],
461
489
  "./src/dictionary/autocomplete.ts": [],
@@ -0,0 +1,2 @@
1
+ declare const cssDurationToMilliseconds: (duration: string, defaultValue?: number) => number;
2
+ export { cssDurationToMilliseconds, };
@@ -1,3 +1,4 @@
1
+ import { MdsAccordionTimerItemEventDetail } from '@component/mds-accordion-timer-item/meta/event-detail';
1
2
  import { EventEmitter } from '../../stencil-public-runtime';
2
3
  export declare class MdsAccordionTimer {
3
4
  private timer;
@@ -11,7 +12,7 @@ export declare class MdsAccordionTimer {
11
12
  /**
12
13
  * Sets the duration of the single accordion item
13
14
  */
14
- duration?: number;
15
+ duration: number;
15
16
  /**
16
17
  * Emits when the accordion changes it's item
17
18
  */
@@ -29,7 +30,7 @@ export declare class MdsAccordionTimer {
29
30
  private playTimer;
30
31
  private pauseTimer;
31
32
  private stopTimer;
32
- onClickActive(event: CustomEvent<string>): void;
33
+ onClickActive(event: CustomEvent<MdsAccordionTimerItemEventDetail>): void;
33
34
  onMouseEnterSelect(): void;
34
35
  onMouseLeaveSelect(): void;
35
36
  render(): any;
@@ -10,7 +10,7 @@ export namespace Components {
10
10
  /**
11
11
  * Sets the duration of the single accordion item
12
12
  */
13
- "duration"?: number;
13
+ "duration": number;
14
14
  }
15
15
  }
16
16
  export interface MdsAccordionTimerCustomEvent<T> extends CustomEvent<T> {
@@ -1,5 +1,6 @@
1
1
  declare const buttonVariantDictionary: string[];
2
2
  declare const buttonToneVariantDictionary: string[];
3
+ declare const buttonTargetDictionary: string[];
3
4
  declare const buttonSizeDictionary: string[];
4
5
  declare const buttonIconPositionDictionary: string[];
5
- export { buttonSizeDictionary, buttonToneVariantDictionary, buttonVariantDictionary, buttonIconPositionDictionary, };
6
+ export { buttonIconPositionDictionary, buttonSizeDictionary, buttonTargetDictionary, buttonToneVariantDictionary, buttonVariantDictionary, };
@@ -4,6 +4,7 @@ declare const themeStatusVariantDictionary: string[];
4
4
  declare const themeFullVariantDictionary: string[];
5
5
  declare const themeLabelVariantDictionary: string[];
6
6
  declare const toneVariantDictionary: string[];
7
+ declare const toneActionVariantDictionary: string[];
7
8
  declare const toneSimpleVariantDictionary: string[];
8
9
  declare const toneMinimalVariantDictionary: string[];
9
- export { themeFullVariantDictionary, themeLabelVariantDictionary, themeLuminanceVariantDictionary, themeStatusVariantDictionary, themeVariantDictionary, toneMinimalVariantDictionary, toneSimpleVariantDictionary, toneVariantDictionary, };
10
+ export { themeFullVariantDictionary, themeLabelVariantDictionary, themeLuminanceVariantDictionary, themeStatusVariantDictionary, themeVariantDictionary, toneActionVariantDictionary, toneMinimalVariantDictionary, toneSimpleVariantDictionary, toneVariantDictionary, };
@@ -1,4 +1,4 @@
1
- import { InputValueType } from '../types/input-value-type';
1
+ import { InputValueType } from '@type/input-value-type';
2
2
  export interface InputValue {
3
3
  value: InputValueType;
4
4
  }
@@ -1,4 +1,5 @@
1
1
  export type ButtonType = 'a' | 'button' | 'reset' | 'submit';
2
+ export type ButtonTargetType = 'self' | 'blank';
2
3
  export type ButtonSizeType = 'sm' | 'md' | 'lg' | 'xl';
3
4
  export type ButtonIconPositionType = 'left' | 'right';
4
5
  export type ButtonVariantType = 'primary' | 'dark' | 'light' | 'error' | 'info' | 'success' | 'warning';
@@ -5,6 +5,7 @@ export type ThemeLuminanceVariantType = 'dark' | 'light';
5
5
  export type LabelVariantType = 'amaranth' | 'aqua' | 'blue' | 'green' | 'lime' | 'orange' | 'orchid' | 'sky' | 'violet' | 'yellow';
6
6
  export type ActionVariantType = 'primary' | 'dark' | 'light';
7
7
  export type StateVariantType = 'disabled' | 'focused' | 'readonly';
8
+ export type ToneActionVariantType = 'primary' | 'secondary' | 'tertiary' | 'strong' | 'weak' | 'ghost' | 'quiet';
8
9
  export type ToneVariantType = 'strong' | 'weak' | 'ghost' | 'quiet';
9
10
  export type ToneSimpleVariantType = 'strong' | 'weak' | 'quiet';
10
11
  export type ToneMinimalVariantType = 'strong' | 'weak';
@@ -0,0 +1,99 @@
1
+ {
2
+ "timestamp": "2023-06-23T10:05:29",
3
+ "compiler": {
4
+ "name": "@stencil/core",
5
+ "version": "2.22.3",
6
+ "typescriptVersion": "4.9.4"
7
+ },
8
+ "components": [
9
+ {
10
+ "filePath": "./src/components/mds-accordion-timer/mds-accordion-timer.tsx",
11
+ "encapsulation": "shadow",
12
+ "tag": "mds-accordion-timer",
13
+ "readme": "# mds-accordion-timer\n\n\n",
14
+ "docs": "",
15
+ "docsTags": [],
16
+ "usage": {},
17
+ "props": [
18
+ {
19
+ "name": "duration",
20
+ "type": "number",
21
+ "mutable": false,
22
+ "attr": "duration",
23
+ "reflectToAttr": false,
24
+ "docs": "Sets the duration of the single accordion item",
25
+ "docsTags": [],
26
+ "default": "10000",
27
+ "values": [
28
+ {
29
+ "type": "number"
30
+ }
31
+ ],
32
+ "optional": false,
33
+ "required": false
34
+ }
35
+ ],
36
+ "methods": [],
37
+ "events": [
38
+ {
39
+ "event": "mdsAccordionTimerChange",
40
+ "detail": "void",
41
+ "bubbles": true,
42
+ "cancelable": true,
43
+ "composed": true,
44
+ "docs": "Emits when the accordion changes it's item",
45
+ "docsTags": []
46
+ }
47
+ ],
48
+ "listeners": [
49
+ {
50
+ "event": "mdsAccordionTimerItemClickSelect",
51
+ "capture": false,
52
+ "passive": false
53
+ },
54
+ {
55
+ "event": "mdsAccordionTimerItemMouseEnterSelect",
56
+ "capture": false,
57
+ "passive": false
58
+ },
59
+ {
60
+ "event": "mdsAccordionTimerItemMouseLeaveSelect",
61
+ "capture": false,
62
+ "passive": false
63
+ }
64
+ ],
65
+ "styles": [
66
+ {
67
+ "name": "--mds-accordion-timer-color",
68
+ "annotation": "prop",
69
+ "docs": "Sets the text color of the component mds-accordion-timer-item"
70
+ },
71
+ {
72
+ "name": "--mds-accordion-timer-duration",
73
+ "annotation": "prop",
74
+ "docs": "Sets the transition duration of open/close animation of the mds-accordion-timer-item"
75
+ },
76
+ {
77
+ "name": "--mds-accordion-timer-progress-bar-background",
78
+ "annotation": "prop",
79
+ "docs": "Sets the background-color of the progress bar when the mds-accordion-timer-item is selected"
80
+ },
81
+ {
82
+ "name": "--mds-accordion-timer-progress-bar-color",
83
+ "annotation": "prop",
84
+ "docs": "Sets the color of the progress bar when the mds-accordion-timer-item is selected"
85
+ },
86
+ {
87
+ "name": "--mds-accordion-timer-progress-bar-thickness",
88
+ "annotation": "prop",
89
+ "docs": "Sets thickness of the progress bar of the mds-accordion-timer-item"
90
+ }
91
+ ],
92
+ "slots": [],
93
+ "parts": [],
94
+ "dependents": [],
95
+ "dependencies": [],
96
+ "dependencyGraph": {}
97
+ }
98
+ ]
99
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@maggioli-design-system/mds-accordion-timer",
3
- "version": "3.2.0",
3
+ "version": "3.3.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",
@@ -12,6 +12,7 @@
12
12
  "unpkg": "dist/mds-accordion-timer/mds-accordion-timer.esm.js",
13
13
  "files": [
14
14
  "dist/",
15
+ "documentation.json",
15
16
  "loader/",
16
17
  "readme.md",
17
18
  "src/",
@@ -23,9 +24,9 @@
23
24
  "test": "stencil test --spec --e2e"
24
25
  },
25
26
  "dependencies": {
26
- "@maggioli-design-system/mds-accordion-timer-item": "^3.1.0",
27
- "@maggioli-design-system/styles": "^11.2.1",
28
- "@stencil/core": "^2.22.2"
27
+ "@maggioli-design-system/mds-accordion-timer-item": "^3.2.0",
28
+ "@maggioli-design-system/styles": "^11.5.2",
29
+ "@stencil/core": "^2.22.3"
29
30
  },
30
31
  "license": "MIT",
31
32
  "author": {
@@ -39,10 +40,15 @@
39
40
  "email": "andrea.pruccoli@maggioli.it",
40
41
  "role": "Software Engineer"
41
42
  },
43
+ {
44
+ "name": "Nicola Tamburini",
45
+ "email": "nicola.tamburini@maggioli.it",
46
+ "role": "Software Engineer"
47
+ },
42
48
  {
43
49
  "name": "Vittorio Vittori",
44
50
  "email": "vittorio.vittori@maggioli.it",
45
- "role": "UX UI Designer"
51
+ "role": "Product Designer"
46
52
  }
47
53
  ]
48
54
  }
package/readme.md CHANGED
@@ -19,6 +19,17 @@
19
19
  | `mdsAccordionTimerChange` | Emits when the accordion changes it's item | `CustomEvent<void>` |
20
20
 
21
21
 
22
+ ## CSS Custom Properties
23
+
24
+ | Name | Description |
25
+ | ----------------------------------------------- | ------------------------------------------------------------------------------------------- |
26
+ | `--mds-accordion-timer-color` | Sets the text color of the component mds-accordion-timer-item |
27
+ | `--mds-accordion-timer-duration` | Sets the transition duration of open/close animation of the mds-accordion-timer-item |
28
+ | `--mds-accordion-timer-progress-bar-background` | Sets the background-color of the progress bar when the mds-accordion-timer-item is selected |
29
+ | `--mds-accordion-timer-progress-bar-color` | Sets the color of the progress bar when the mds-accordion-timer-item is selected |
30
+ | `--mds-accordion-timer-progress-bar-thickness` | Sets thickness of the progress bar of the mds-accordion-timer-item |
31
+
32
+
22
33
  ----------------------------------------------
23
34
 
24
35
  Built with love @ **Maggioli Informatica / R&D Department**
@@ -7,12 +7,12 @@ const hash = (s: string): string => {
7
7
  }
8
8
 
9
9
  const unslugName = (name: string): string => {
10
- return name.split('/').slice(-1).pop().replace(/-/g, ' ')
10
+ return name.split('/')?.slice(-1).pop()?.replace(/-/g, ' ') ?? name
11
11
  }
12
12
 
13
13
  const setAttributeIfEmpty = (element: HTMLElement, attribute: string, value: string): string => {
14
14
  if (element.hasAttribute(attribute)) {
15
- return element.getAttribute(attribute)
15
+ return element.getAttribute(attribute) ?? ''
16
16
  }
17
17
  element.setAttribute(attribute, value)
18
18
  return value
@@ -38,7 +38,7 @@ export class KeyboardManager {
38
38
  }
39
39
 
40
40
  detachEscapeBehavior = (): void => {
41
- this.escapeCallback = null
41
+ this.escapeCallback = () => {return}
42
42
  if (typeof window !== undefined) {
43
43
  window.removeEventListener('keydown', this.handleEscapeBehaviorDispatchEvent.bind(this))
44
44
  }
@@ -0,0 +1,14 @@
1
+ const cssDurationToMilliseconds = (duration: string, defaultValue = 1000): number => {
2
+ if (duration.includes('s')) {
3
+ return Number(duration.replace('s', '')) * 1000
4
+ }
5
+
6
+ if (duration.includes('ms')) {
7
+ return Number(duration.replace('s', ''))
8
+ }
9
+
10
+ return defaultValue
11
+ }
12
+ export {
13
+ cssDurationToMilliseconds,
14
+ }
@@ -1,3 +1,17 @@
1
+ /**
2
+ * @prop --mds-accordion-timer-progress-bar-color: Sets the color of the progress bar when the mds-accordion-timer-item is selected
3
+ * @prop --mds-accordion-timer-progress-bar-background: Sets the background-color of the progress bar when the mds-accordion-timer-item is selected
4
+ * @prop --mds-accordion-timer-color: Sets the text color of the component mds-accordion-timer-item
5
+ * @prop --mds-accordion-timer-progress-bar-thickness: Sets thickness of the progress bar of the mds-accordion-timer-item
6
+ * @prop --mds-accordion-timer-duration: Sets the transition duration of open/close animation of the mds-accordion-timer-item
7
+ */
8
+
1
9
  :host {
10
+
11
+ --mds-accordion-timer-progress-bar-color: theme('colors.tone-neutral-03');
12
+ --mds-accordion-timer-progress-bar-background: theme('colors.tone-neutral-08');
13
+ --mds-accordion-timer-progress-bar-thickness: theme('width.1');
14
+ --mds-accordion-timer-duration: 500ms;
15
+
2
16
  display: block;
3
17
  }
@@ -1,3 +1,4 @@
1
+ import { MdsAccordionTimerItemEventDetail } from '@component/mds-accordion-timer-item/meta/event-detail'
1
2
  import { Component, Host, Element, Event, EventEmitter, h, Prop, Listen, State } from '@stencil/core'
2
3
 
3
4
  @Component({
@@ -20,7 +21,7 @@ export class MdsAccordionTimer {
20
21
  /**
21
22
  * Sets the duration of the single accordion item
22
23
  */
23
- @Prop() duration?: number = 10000
24
+ @Prop() duration = 10000
24
25
 
25
26
  /**
26
27
  * Emits when the accordion changes it's item
@@ -44,8 +45,7 @@ export class MdsAccordionTimer {
44
45
  private clearIntervals = (): void => {
45
46
  window.clearInterval(this.timer)
46
47
  window.clearInterval(this.timeChecker)
47
- this.timer = null
48
- this.timeChecker = null
48
+ this.timeChecker = 0
49
49
  }
50
50
 
51
51
  disconnectedCallback (): void {
@@ -117,22 +117,14 @@ export class MdsAccordionTimer {
117
117
 
118
118
  private stopTimer = (): void => {
119
119
  this.clearIntervals()
120
- this.time = null
121
120
  }
122
121
 
123
122
  @Listen('mdsAccordionTimerItemClickSelect')
124
- onClickActive (event: CustomEvent<string>): void {
125
- if (this.selectedItem && event.detail === this.selectedItem.description) {
126
- return
123
+ onClickActive (event: CustomEvent<MdsAccordionTimerItemEventDetail>): void {
124
+ if (this.selectedItem) {
125
+ this.selectedItem.progress = 0
127
126
  }
128
- let selectedUuid: number
129
- this.children.forEach(item => {
130
- item.progress = 0
131
- if (item.description === event.detail) {
132
- selectedUuid = item.uuid
133
- }
134
- })
135
- this.setSelectedItem(selectedUuid)
127
+ this.setSelectedItem(event.detail.uuid)
136
128
  this.startTimer()
137
129
  this.pauseTimer()
138
130
  }
@@ -144,7 +136,7 @@ export class MdsAccordionTimer {
144
136
 
145
137
  @Listen('mdsAccordionTimerItemMouseLeaveSelect')
146
138
  onMouseLeaveSelect (): void {
147
- if (this.timeChecker === null) {
139
+ if (this.timeChecker === 0) {
148
140
  this.playTimer()
149
141
  }
150
142
  }
@@ -19,6 +19,17 @@
19
19
  | `mdsAccordionTimerChange` | Emits when the accordion changes it's item | `CustomEvent<void>` |
20
20
 
21
21
 
22
+ ## CSS Custom Properties
23
+
24
+ | Name | Description |
25
+ | ----------------------------------------------- | ------------------------------------------------------------------------------------------- |
26
+ | `--mds-accordion-timer-color` | Sets the text color of the component mds-accordion-timer-item |
27
+ | `--mds-accordion-timer-duration` | Sets the transition duration of open/close animation of the mds-accordion-timer-item |
28
+ | `--mds-accordion-timer-progress-bar-background` | Sets the background-color of the progress bar when the mds-accordion-timer-item is selected |
29
+ | `--mds-accordion-timer-progress-bar-color` | Sets the color of the progress bar when the mds-accordion-timer-item is selected |
30
+ | `--mds-accordion-timer-progress-bar-thickness` | Sets thickness of the progress bar of the mds-accordion-timer-item |
31
+
32
+
22
33
  ----------------------------------------------
23
34
 
24
35
  Built with love @ **Maggioli Informatica / R&D Department**
@@ -14,7 +14,7 @@ export default {
14
14
  const Template = args =>
15
15
  <div>
16
16
  <mds-accordion-timer {...args}>
17
- <mds-accordion-timer-item description="Blipbug">
17
+ <mds-accordion-timer-item selected description="Blipbug">
18
18
  <mds-text>Blipbug presenta delle fattezze riconducibili agli insetti nello stadio pre-crisalide. Il suo corpo si sviluppa in lunghezza, ed è formato principalmente da tre parti: la sua grande testa, il suo collo (molto simile ad un collare), e il corpo vero e proprio. La prima di queste è suddivisa in una parte color crema e una parte color denim; dello stesso colore sono le appenidici a forma di "V" che si trovano sopra e ai lati della testa. I suoi occhi sono enormi e grigi, ed hanno delle sottilissime sopracciglia sopra di essi. Il suo "collare", anch'esso color denim, presenta delle "setole" giallo sabbia, con le quali percepisce i segnali esterni: stesso colore si presenta nel segmento centrale della sua parte inferiore, dove sono presenti un primo paio di zampe crema. Il segmento superiore del corpo è bianco e ospita delle zampe anteriori color crema, ed infine, la parte finale, o la "coda", è color denim e finisce con un'appendice a "V" un po' piú grossa.</mds-text>
19
19
  </mds-accordion-timer-item>
20
20
  <mds-accordion-timer-item description="Drednaw">
@@ -10,7 +10,7 @@ export namespace Components {
10
10
  /**
11
11
  * Sets the duration of the single accordion item
12
12
  */
13
- "duration"?: number;
13
+ "duration": number;
14
14
  }
15
15
  }
16
16
  export interface MdsAccordionTimerCustomEvent<T> extends CustomEvent<T> {
@@ -15,6 +15,11 @@ const buttonToneVariantDictionary = [
15
15
  'quiet',
16
16
  ]
17
17
 
18
+ const buttonTargetDictionary = [
19
+ 'blank',
20
+ 'self',
21
+ ]
22
+
18
23
  const buttonSizeDictionary = [
19
24
  'sm',
20
25
  'md',
@@ -28,8 +33,9 @@ const buttonIconPositionDictionary = [
28
33
  ]
29
34
 
30
35
  export {
36
+ buttonIconPositionDictionary,
31
37
  buttonSizeDictionary,
38
+ buttonTargetDictionary,
32
39
  buttonToneVariantDictionary,
33
40
  buttonVariantDictionary,
34
- buttonIconPositionDictionary,
35
41
  }