@maggioli-design-system/mds-accordion-timer 3.2.1 → 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 (40) hide show
  1. package/dist/cjs/mds-accordion-timer.cjs.entry.js +1 -1
  2. package/dist/collection/common/unit.js +10 -0
  3. package/dist/collection/components/mds-accordion-timer/mds-accordion-timer.css +14 -0
  4. package/dist/collection/components/mds-accordion-timer/test/mds-accordion-timer.stories.js +1 -1
  5. package/dist/collection/dictionary/button.js +5 -1
  6. package/dist/collection/dictionary/variant.js +9 -1
  7. package/dist/components/mds-accordion-timer.js +1 -1
  8. package/dist/documentation.json +28 -2
  9. package/dist/esm/mds-accordion-timer.entry.js +1 -1
  10. package/dist/esm-es5/mds-accordion-timer.entry.js +1 -1
  11. package/dist/mds-accordion-timer/mds-accordion-timer.esm.js +1 -1
  12. package/dist/mds-accordion-timer/p-2a65b768.system.entry.js +1 -0
  13. package/dist/mds-accordion-timer/p-5e09eed0.system.js +1 -1
  14. package/dist/mds-accordion-timer/{p-1442acbc.entry.js → p-778834a9.entry.js} +1 -1
  15. package/dist/stats.json +45 -17
  16. package/dist/types/common/unit.d.ts +2 -0
  17. package/dist/types/dictionary/button.d.ts +2 -1
  18. package/dist/types/dictionary/variant.d.ts +2 -1
  19. package/dist/types/type/button.d.ts +1 -0
  20. package/dist/types/type/variant.d.ts +1 -0
  21. package/documentation.json +28 -2
  22. package/package.json +3 -3
  23. package/readme.md +11 -0
  24. package/src/common/unit.ts +14 -0
  25. package/src/components/mds-accordion-timer/mds-accordion-timer.css +14 -0
  26. package/src/components/mds-accordion-timer/readme.md +11 -0
  27. package/src/components/mds-accordion-timer/test/mds-accordion-timer.stories.tsx +1 -1
  28. package/src/dictionary/button.ts +7 -1
  29. package/src/dictionary/variant.ts +10 -0
  30. package/src/fixtures/icons.json +19 -0
  31. package/src/fixtures/iconsauce.json +19 -0
  32. package/src/type/button.ts +4 -0
  33. package/src/type/variant.ts +9 -0
  34. package/www/build/mds-accordion-timer.esm.js +1 -1
  35. package/www/build/p-2a65b768.system.entry.js +1 -0
  36. package/www/build/p-5e09eed0.system.js +1 -1
  37. package/www/build/{p-1442acbc.entry.js → p-778834a9.entry.js} +1 -1
  38. package/dist/mds-accordion-timer/p-53e5fa07.system.entry.js +0 -1
  39. package/src/components/mds-accordion-timer/test/mds-accordion-timer.spec.tsx +0 -19
  40. package/www/build/p-53e5fa07.system.entry.js +0 -1
@@ -4,7 +4,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  const index = require('./index-b99075ba.js');
6
6
 
7
- const mdsAccordionTimerCss = ":host{display:block}";
7
+ const mdsAccordionTimerCss = ":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}";
8
8
 
9
9
  const MdsAccordionTimer = class {
10
10
  constructor(hostRef) {
@@ -0,0 +1,10 @@
1
+ const cssDurationToMilliseconds = (duration, defaultValue = 1000) => {
2
+ if (duration.includes('s')) {
3
+ return Number(duration.replace('s', '')) * 1000;
4
+ }
5
+ if (duration.includes('ms')) {
6
+ return Number(duration.replace('s', ''));
7
+ }
8
+ return defaultValue;
9
+ };
10
+ export { cssDurationToMilliseconds, };
@@ -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: rgb(var(--tone-neutral-03));
12
+ --mds-accordion-timer-progress-bar-background: rgb(var(--tone-neutral-08));
13
+ --mds-accordion-timer-progress-bar-thickness: 0.25rem;
14
+ --mds-accordion-timer-duration: 500ms;
15
+
2
16
  display: block;
3
17
  }
@@ -9,7 +9,7 @@ export default {
9
9
  },
10
10
  },
11
11
  };
12
- const Template = args => h("div", null, h("mds-accordion-timer", Object.assign({}, args), h("mds-accordion-timer-item", { description: "Blipbug" }, h("mds-text", null, "Blipbug presenta delle fattezze riconducibili agli insetti nello stadio pre-crisalide. Il suo corpo si sviluppa in lunghezza, ed \u00E8 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 \u00E8 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 \u00E8 bianco e ospita delle zampe anteriori color crema, ed infine, la parte finale, o la \"coda\", \u00E8 color denim e finisce con un'appendice a \"V\" un po' pi\u00FA grossa.")), h("mds-accordion-timer-item", { description: "Drednaw" }, h("mds-text", null, "Drednaw \u00E8 un Pok\u00E9mon quadrupede simile ad una tartaruga alligatore. Il corpo \u00E8 principalmente di colore turchese cos\u00EC come le zampe cilindriche e tozze, le quali terminano con tre unghie allungate e bianche. Sulle zampe anteriori, circa sulla loro met\u00E0, spuntanto delle protuberanze simili a scaglie di roccia color marroncino, ricorrenti anche nel resto del corpo: ad esempio, sul muso c'\u00E8 una protuberanza a zig-zag che ospita le sue narici; sulla coda sono alternate delle scaglie e attorno al guscio c'\u00E8 una cornice dello stesso colore; anche le placche superiori sembrano essere fatte di roccia, ma sono di un colore marrone scuro, invece che chiaro. Queste parti rocciose sembrano essere frastagliate, per niente levigate. Il suo volto presenta occhi bassi e imbronciati, con delle guance arancioni e sporgenti ed una bocca a zig-zag, la cui parte inferiore \u00E8 simile al beige, colore presente anche nelle placche del guscio inferiori, che stavolta fanno vedere la pelle a volte grinzosa del Pok\u00E9mon (in particolare attorno al collo e sulle zampe). Le sue scaglie di roccia sono spesso rivolte verso di dietro, dando l'idea di una roccia grezza e non liscia e lavorata.")), h("mds-accordion-timer-item", { description: "Orbeetle" }, h("mds-text", null, "Orbeetle presenta aspetti comuni ad una coccinella ormai matura. Il suo corpo si sviluppa attorno al guscio che \u00E8 di forma semisferica ed \u00E8 metallizzato in grigio (lo si pu\u00F2 vedere in particolare dalla parte inferiore di esso): la sua scocca \u00E8 rossa, con dei pois denim sopra di essa; \u00E8 bisezionata per permettere di aprirsi e attaccare con degli strani poteri. All'estremit\u00E0 del taglio intermedio \u00E8 incastonato il volto di Orbeetle, il quale presenta delle guance bianche con occhi imbronciati celesti, aventi sclere concentriche; sopra di essi ci sono due lunghe sopracciglia dorate a forma di \"V\" e ad incorniciare la faccia del Pok\u00E9mon \u00E8 una cornice grigia, che finisce, con delle striature, sul naso dello stesso. La bocca, assieme alle ginocchia e alla pancia, \u00E8 rossa. Il suo corpo \u00E8 piccolo ed \u00E8 costituito da una vita stretta con una bacino largo, da dove si sviluppano due cosce secche ed esili per poi finire con appuntiti gambali dorati; le sue braccia sono magre e biforcute, come se avessero artigli.")), h("mds-accordion-timer-item", { description: "Dottler" }, h("mds-text", null, "Dottler pu\u00F2 essere considerato la \"crisalide\" della linea evolutiva di Blipbug, vista la sua forma e il suo comportamento. Presenta un guscio di forma poligonale (molto simile a quella di un radar Doppler o di un radome) di color giallo sabbia, con dei pois blu scuro sugli spigoli; leggermente in basso \u00E8 presente la sua faccia di color arancione chiaro, sulla quale ci sono degli occhi celesti attorniati da un contorno arancione, da linee sottili e nere e da delle appendici blu simili a quelle dei Blipbug. Il Pok\u00E9mon non sembra essere dedito a muoversi se non fosse per le quattro zampette blu scuro su cui cammina.")), h("mds-accordion-timer-item", { description: "Centiskorch" }, h("mds-text", null, "Con l'evoluzione Sizzlipede diventa pi\u00F9 aggressivo, soprattutto grazie alla sua stazza pi\u00F9 grande e al suo enorme potenziale. Il corpo diventa pi\u00F9 lungo e si \"seziona\" in dodici parti, anche qui un'estremit\u00E0 \u00E8 la \"coda\" e l'altra \u00E8 la testa, queste due parti, assieme all'intera parte inferiore del corpo sono del rosso mattone presente nella sua pre-evo, mentre le \"parti\" comprese tra la coda e la testa restano marroni/bordeaux; questa volte, dello stesso colore della \"schiena\" sono le zampe, le quali son diventate pi\u00F9 minacciose e uncinate, questa volta sono dieci per ogni lato; marrone/bordeaux sono anche delle tenaglie. presenti in paia, sulla coda e sulla testa; su queste estremit\u00E0 son presenti quattro sbuffi o \"baffi\" di fuoco. Sulla testa \u00E8 presente un simbolo arancione chiaro a forma di punto esclamativo; stessa gamma cromatica \u00E8 presente nei segni circolari situati nella zona inferiore del corpo, i quali son formati, per\u00F2, anche da un anello e da un cerchio, pi\u00F9 interno, di colore giallo sabbia; non sono altro che i punti che Sizzlipede riscalda per attaccare e scottare le prede. I suoi occhi sono giallo elettrico con pupille triangolari color marrone e rovesciati."))));
12
+ const Template = args => h("div", null, h("mds-accordion-timer", Object.assign({}, args), h("mds-accordion-timer-item", { selected: true, description: "Blipbug" }, h("mds-text", null, "Blipbug presenta delle fattezze riconducibili agli insetti nello stadio pre-crisalide. Il suo corpo si sviluppa in lunghezza, ed \u00E8 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 \u00E8 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 \u00E8 bianco e ospita delle zampe anteriori color crema, ed infine, la parte finale, o la \"coda\", \u00E8 color denim e finisce con un'appendice a \"V\" un po' pi\u00FA grossa.")), h("mds-accordion-timer-item", { description: "Drednaw" }, h("mds-text", null, "Drednaw \u00E8 un Pok\u00E9mon quadrupede simile ad una tartaruga alligatore. Il corpo \u00E8 principalmente di colore turchese cos\u00EC come le zampe cilindriche e tozze, le quali terminano con tre unghie allungate e bianche. Sulle zampe anteriori, circa sulla loro met\u00E0, spuntanto delle protuberanze simili a scaglie di roccia color marroncino, ricorrenti anche nel resto del corpo: ad esempio, sul muso c'\u00E8 una protuberanza a zig-zag che ospita le sue narici; sulla coda sono alternate delle scaglie e attorno al guscio c'\u00E8 una cornice dello stesso colore; anche le placche superiori sembrano essere fatte di roccia, ma sono di un colore marrone scuro, invece che chiaro. Queste parti rocciose sembrano essere frastagliate, per niente levigate. Il suo volto presenta occhi bassi e imbronciati, con delle guance arancioni e sporgenti ed una bocca a zig-zag, la cui parte inferiore \u00E8 simile al beige, colore presente anche nelle placche del guscio inferiori, che stavolta fanno vedere la pelle a volte grinzosa del Pok\u00E9mon (in particolare attorno al collo e sulle zampe). Le sue scaglie di roccia sono spesso rivolte verso di dietro, dando l'idea di una roccia grezza e non liscia e lavorata.")), h("mds-accordion-timer-item", { description: "Orbeetle" }, h("mds-text", null, "Orbeetle presenta aspetti comuni ad una coccinella ormai matura. Il suo corpo si sviluppa attorno al guscio che \u00E8 di forma semisferica ed \u00E8 metallizzato in grigio (lo si pu\u00F2 vedere in particolare dalla parte inferiore di esso): la sua scocca \u00E8 rossa, con dei pois denim sopra di essa; \u00E8 bisezionata per permettere di aprirsi e attaccare con degli strani poteri. All'estremit\u00E0 del taglio intermedio \u00E8 incastonato il volto di Orbeetle, il quale presenta delle guance bianche con occhi imbronciati celesti, aventi sclere concentriche; sopra di essi ci sono due lunghe sopracciglia dorate a forma di \"V\" e ad incorniciare la faccia del Pok\u00E9mon \u00E8 una cornice grigia, che finisce, con delle striature, sul naso dello stesso. La bocca, assieme alle ginocchia e alla pancia, \u00E8 rossa. Il suo corpo \u00E8 piccolo ed \u00E8 costituito da una vita stretta con una bacino largo, da dove si sviluppano due cosce secche ed esili per poi finire con appuntiti gambali dorati; le sue braccia sono magre e biforcute, come se avessero artigli.")), h("mds-accordion-timer-item", { description: "Dottler" }, h("mds-text", null, "Dottler pu\u00F2 essere considerato la \"crisalide\" della linea evolutiva di Blipbug, vista la sua forma e il suo comportamento. Presenta un guscio di forma poligonale (molto simile a quella di un radar Doppler o di un radome) di color giallo sabbia, con dei pois blu scuro sugli spigoli; leggermente in basso \u00E8 presente la sua faccia di color arancione chiaro, sulla quale ci sono degli occhi celesti attorniati da un contorno arancione, da linee sottili e nere e da delle appendici blu simili a quelle dei Blipbug. Il Pok\u00E9mon non sembra essere dedito a muoversi se non fosse per le quattro zampette blu scuro su cui cammina.")), h("mds-accordion-timer-item", { description: "Centiskorch" }, h("mds-text", null, "Con l'evoluzione Sizzlipede diventa pi\u00F9 aggressivo, soprattutto grazie alla sua stazza pi\u00F9 grande e al suo enorme potenziale. Il corpo diventa pi\u00F9 lungo e si \"seziona\" in dodici parti, anche qui un'estremit\u00E0 \u00E8 la \"coda\" e l'altra \u00E8 la testa, queste due parti, assieme all'intera parte inferiore del corpo sono del rosso mattone presente nella sua pre-evo, mentre le \"parti\" comprese tra la coda e la testa restano marroni/bordeaux; questa volte, dello stesso colore della \"schiena\" sono le zampe, le quali son diventate pi\u00F9 minacciose e uncinate, questa volta sono dieci per ogni lato; marrone/bordeaux sono anche delle tenaglie. presenti in paia, sulla coda e sulla testa; su queste estremit\u00E0 son presenti quattro sbuffi o \"baffi\" di fuoco. Sulla testa \u00E8 presente un simbolo arancione chiaro a forma di punto esclamativo; stessa gamma cromatica \u00E8 presente nei segni circolari situati nella zona inferiore del corpo, i quali son formati, per\u00F2, anche da un anello e da un cerchio, pi\u00F9 interno, di colore giallo sabbia; non sono altro che i punti che Sizzlipede riscalda per attaccare e scottare le prede. I suoi occhi sono giallo elettrico con pupille triangolari color marrone e rovesciati."))));
13
13
  export const Default = Template.bind({});
14
14
  Default.story = lokiDisabled;
15
15
  export const Duration = Template.bind({});
@@ -13,6 +13,10 @@ const buttonToneVariantDictionary = [
13
13
  'ghost',
14
14
  'quiet',
15
15
  ];
16
+ const buttonTargetDictionary = [
17
+ 'blank',
18
+ 'self',
19
+ ];
16
20
  const buttonSizeDictionary = [
17
21
  'sm',
18
22
  'md',
@@ -23,4 +27,4 @@ const buttonIconPositionDictionary = [
23
27
  'left',
24
28
  'right',
25
29
  ];
26
- export { buttonSizeDictionary, buttonToneVariantDictionary, buttonVariantDictionary, buttonIconPositionDictionary, };
30
+ export { buttonIconPositionDictionary, buttonSizeDictionary, buttonTargetDictionary, buttonToneVariantDictionary, buttonVariantDictionary, };
@@ -53,6 +53,14 @@ const toneVariantDictionary = [
53
53
  'ghost',
54
54
  'quiet',
55
55
  ];
56
+ const toneActionVariantDictionary = [
57
+ 'primary',
58
+ 'secondary',
59
+ 'tertiary',
60
+ 'strong',
61
+ 'weak',
62
+ 'quiet',
63
+ ];
56
64
  const toneSimpleVariantDictionary = [
57
65
  'strong',
58
66
  'weak',
@@ -62,4 +70,4 @@ const toneMinimalVariantDictionary = [
62
70
  'strong',
63
71
  'weak',
64
72
  ];
65
- export { themeFullVariantDictionary, themeLabelVariantDictionary, themeLuminanceVariantDictionary, themeStatusVariantDictionary, themeVariantDictionary, toneMinimalVariantDictionary, toneSimpleVariantDictionary, toneVariantDictionary, };
73
+ export { themeFullVariantDictionary, themeLabelVariantDictionary, themeLuminanceVariantDictionary, themeStatusVariantDictionary, themeVariantDictionary, toneActionVariantDictionary, toneMinimalVariantDictionary, toneSimpleVariantDictionary, toneVariantDictionary, };
@@ -1,6 +1,6 @@
1
1
  import { proxyCustomElement, HTMLElement, createEvent, h, Host } from '@stencil/core/internal/client';
2
2
 
3
- const mdsAccordionTimerCss = ":host{display:block}";
3
+ const mdsAccordionTimerCss = ":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}";
4
4
 
5
5
  const MdsAccordionTimer$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
6
6
  constructor() {
@@ -1,5 +1,5 @@
1
1
  {
2
- "timestamp": "2023-04-14T10:13:48",
2
+ "timestamp": "2023-06-23T10:11:40",
3
3
  "compiler": {
4
4
  "name": "@stencil/core",
5
5
  "version": "2.22.3",
@@ -61,7 +61,33 @@
61
61
  "passive": false
62
62
  }
63
63
  ],
64
- "styles": [],
64
+ "styles": [
65
+ {
66
+ "name": "--mds-accordion-timer-color",
67
+ "annotation": "prop",
68
+ "docs": "Sets the text color of the component mds-accordion-timer-item"
69
+ },
70
+ {
71
+ "name": "--mds-accordion-timer-duration",
72
+ "annotation": "prop",
73
+ "docs": "Sets the transition duration of open/close animation of the mds-accordion-timer-item"
74
+ },
75
+ {
76
+ "name": "--mds-accordion-timer-progress-bar-background",
77
+ "annotation": "prop",
78
+ "docs": "Sets the background-color of the progress bar when the mds-accordion-timer-item is selected"
79
+ },
80
+ {
81
+ "name": "--mds-accordion-timer-progress-bar-color",
82
+ "annotation": "prop",
83
+ "docs": "Sets the color of the progress bar when the mds-accordion-timer-item is selected"
84
+ },
85
+ {
86
+ "name": "--mds-accordion-timer-progress-bar-thickness",
87
+ "annotation": "prop",
88
+ "docs": "Sets thickness of the progress bar of the mds-accordion-timer-item"
89
+ }
90
+ ],
65
91
  "slots": [],
66
92
  "parts": [],
67
93
  "dependents": [],
@@ -1,6 +1,6 @@
1
1
  import { r as registerInstance, c as createEvent, h, H as Host, g as getElement } from './index-bd689d6a.js';
2
2
 
3
- const mdsAccordionTimerCss = ":host{display:block}";
3
+ const mdsAccordionTimerCss = ":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}";
4
4
 
5
5
  const MdsAccordionTimer = class {
6
6
  constructor(hostRef) {
@@ -1 +1 @@
1
- import{r as registerInstance,c as createEvent,h,H as Host,g as getElement}from"./index-bd689d6a.js";var mdsAccordionTimerCss=":host{display:block}";var MdsAccordionTimer=function(){function e(e){var t=this;registerInstance(this,e);this.changeEvent=createEvent(this,"mdsAccordionTimerChange",7);this.clearIntervals=function(){window.clearInterval(t.timer);window.clearInterval(t.timeChecker);t.timeChecker=0};this.progress=function(){return Math.abs(t.remainingTime()/t.duration-1)};this.addTimeListener=function(){t.timeChecker=window.setInterval((function(){var e=t.progress();if(t.selectedItem!==undefined){t.selectedItem.progress=e}if(e===1){t.selectedItem.progress=0;t.startNext()}}),100)};this.beginningTime=function(){t.timeStarted=(new Date).getTime();return t.timeStarted};this.remainingTime=function(){var e=t.selectedItemDurationTime-((new Date).getTime()-t.timeStarted);return e>=0?e:0};this.setSelectedItem=function(e){t.children.forEach((function(i,n){if(n===e){i.selected=true;t.selectedItem=i;t.changeEvent.emit()}else{i.selected=false}}))};this.startNext=function(){var e=t.selectedItem.uuid+1>t.children.length-1?0:t.selectedItem.uuid+1;t.setSelectedItem(e);t.startTimer()};this.startTimer=function(){t.clearIntervals();t.time=t.beginningTime();t.selectedItemDurationTime=t.duration;t.addTimeListener()};this.playTimer=function(){t.beginningTime();t.addTimeListener()};this.pauseTimer=function(){t.clearIntervals();t.selectedItemDurationTime=t.remainingTime()};this.stopTimer=function(){t.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 h(Host,null,h("slot",null))};Object.defineProperty(e.prototype,"element",{get:function(){return getElement(this)},enumerable:false,configurable:true});return e}();MdsAccordionTimer.style=mdsAccordionTimerCss;export{MdsAccordionTimer as mds_accordion_timer};
1
+ import{r as registerInstance,c as createEvent,h,H as Host,g as getElement}from"./index-bd689d6a.js";var mdsAccordionTimerCss=":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 MdsAccordionTimer=function(){function e(e){var t=this;registerInstance(this,e);this.changeEvent=createEvent(this,"mdsAccordionTimerChange",7);this.clearIntervals=function(){window.clearInterval(t.timer);window.clearInterval(t.timeChecker);t.timeChecker=0};this.progress=function(){return Math.abs(t.remainingTime()/t.duration-1)};this.addTimeListener=function(){t.timeChecker=window.setInterval((function(){var e=t.progress();if(t.selectedItem!==undefined){t.selectedItem.progress=e}if(e===1){t.selectedItem.progress=0;t.startNext()}}),100)};this.beginningTime=function(){t.timeStarted=(new Date).getTime();return t.timeStarted};this.remainingTime=function(){var e=t.selectedItemDurationTime-((new Date).getTime()-t.timeStarted);return e>=0?e:0};this.setSelectedItem=function(e){t.children.forEach((function(i,r){if(r===e){i.selected=true;t.selectedItem=i;t.changeEvent.emit()}else{i.selected=false}}))};this.startNext=function(){var e=t.selectedItem.uuid+1>t.children.length-1?0:t.selectedItem.uuid+1;t.setSelectedItem(e);t.startTimer()};this.startTimer=function(){t.clearIntervals();t.time=t.beginningTime();t.selectedItemDurationTime=t.duration;t.addTimeListener()};this.playTimer=function(){t.beginningTime();t.addTimeListener()};this.pauseTimer=function(){t.clearIntervals();t.selectedItemDurationTime=t.remainingTime()};this.stopTimer=function(){t.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 h(Host,null,h("slot",null))};Object.defineProperty(e.prototype,"element",{get:function(){return getElement(this)},enumerable:false,configurable:true});return e}();MdsAccordionTimer.style=mdsAccordionTimerCss;export{MdsAccordionTimer as mds_accordion_timer};
@@ -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,c={};return""!==o&&(c.resourcesUrl=new URL(".",o).href),e(c)})().then((e=>o([["p-1442acbc",[[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)));
@@ -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-53e5fa07.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)}))}}}));
@@ -1 +1 @@
1
- import{r as t,c as s,h as i,H as h,g as e}from"./p-a7b74010.js";const o=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 e(this)}};o.style=":host{display:block}";export{o as mds_accordion_timer}
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-04-14T10:13:48",
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-1442acbc.entry.js",
79
+ "./dist/mds-accordion-timer/p-2a65b768.system.entry.js",
79
80
  "./dist/mds-accordion-timer/p-5029b85d.system.js",
80
81
  "./dist/mds-accordion-timer/p-50ea2036.system.js",
81
- "./dist/mds-accordion-timer/p-53e5fa07.system.entry.js",
82
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-1442acbc.entry.js",
88
+ "./www/build/p-2a65b768.system.entry.js",
88
89
  "./www/build/p-5029b85d.system.js",
89
90
  "./www/build/p-50ea2036.system.js",
90
- "./www/build/p-53e5fa07.system.entry.js",
91
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-1442acbc",
126
- "fileName": "p-1442acbc.entry.js",
126
+ "bundleId": "p-778834a9",
127
+ "fileName": "p-778834a9.entry.js",
127
128
  "imports": [
128
129
  "p-a7b74010.js"
129
130
  ],
130
- "originalByteSize": 3256
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": 3260
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": 3260
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-53e5fa07.system",
168
- "fileName": "p-53e5fa07.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": 4148
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": 3307
187
+ "originalByteSize": 3540
187
188
  }
188
189
  ]
189
190
  },
@@ -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,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,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';
@@ -1,5 +1,5 @@
1
1
  {
2
- "timestamp": "2023-04-14T09:57:39",
2
+ "timestamp": "2023-06-23T10:05:29",
3
3
  "compiler": {
4
4
  "name": "@stencil/core",
5
5
  "version": "2.22.3",
@@ -62,7 +62,33 @@
62
62
  "passive": false
63
63
  }
64
64
  ],
65
- "styles": [],
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
+ ],
66
92
  "slots": [],
67
93
  "parts": [],
68
94
  "dependents": [],
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@maggioli-design-system/mds-accordion-timer",
3
- "version": "3.2.1",
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",
@@ -24,8 +24,8 @@
24
24
  "test": "stencil test --spec --e2e"
25
25
  },
26
26
  "dependencies": {
27
- "@maggioli-design-system/mds-accordion-timer-item": "^3.1.1",
28
- "@maggioli-design-system/styles": "^11.4.0",
27
+ "@maggioli-design-system/mds-accordion-timer-item": "^3.2.0",
28
+ "@maggioli-design-system/styles": "^11.5.2",
29
29
  "@stencil/core": "^2.22.3"
30
30
  },
31
31
  "license": "MIT",
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**
@@ -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
  }
@@ -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">
@@ -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
  }
@@ -59,6 +59,15 @@ const toneVariantDictionary = [
59
59
  'quiet',
60
60
  ]
61
61
 
62
+ const toneActionVariantDictionary = [
63
+ 'primary',
64
+ 'secondary',
65
+ 'tertiary',
66
+ 'strong',
67
+ 'weak',
68
+ 'quiet',
69
+ ]
70
+
62
71
  const toneSimpleVariantDictionary = [
63
72
  'strong',
64
73
  'weak',
@@ -76,6 +85,7 @@ export {
76
85
  themeLuminanceVariantDictionary,
77
86
  themeStatusVariantDictionary,
78
87
  themeVariantDictionary,
88
+ toneActionVariantDictionary,
79
89
  toneMinimalVariantDictionary,
80
90
  toneSimpleVariantDictionary,
81
91
  toneVariantDictionary,
@@ -28,18 +28,22 @@
28
28
  "mgg/adv-denied",
29
29
  "mgg/area-edificabile",
30
30
  "mgg/area-weather",
31
+ "mgg/bill",
31
32
  "mgg/box-multiple",
32
33
  "mgg/breadcrumb",
33
34
  "mgg/calendar-euro",
34
35
  "mgg/calendar-multiple",
35
36
  "mgg/calendar-schedule",
37
+ "mgg/cancelled-sheet",
36
38
  "mgg/car-license",
37
39
  "mgg/card-stamping",
38
40
  "mgg/checklist",
39
41
  "mgg/checklist-settings",
40
42
  "mgg/citizenship",
41
43
  "mgg/city-bin",
44
+ "mgg/classic-permission",
42
45
  "mgg/copy-paste",
46
+ "mgg/d-instrumental-buildings",
43
47
  "mgg/data-analytics-alt",
44
48
  "mgg/data-analytics-search",
45
49
  "mgg/data-analytics-time",
@@ -50,6 +54,7 @@
50
54
  "mgg/data-end-civil-union",
51
55
  "mgg/data-end-marriage",
52
56
  "mgg/dataset",
57
+ "mgg/delivered-to-the-recipient",
53
58
  "mgg/document-magic",
54
59
  "mgg/document-rename",
55
60
  "mgg/electronic-document",
@@ -78,9 +83,13 @@
78
83
  "mgg/finance-euro-cashback",
79
84
  "mgg/fit-horizontal",
80
85
  "mgg/fit-vertical",
86
+ "mgg/forwarded-with-a-single-sending",
81
87
  "mgg/fullscreen-on-alt",
82
88
  "mgg/google-check-small",
83
89
  "mgg/google-place-item",
90
+ "mgg/group-assigned-automatically-system",
91
+ "mgg/group-ceased",
92
+ "mgg/group-inherited",
84
93
  "mgg/heart",
85
94
  "mgg/heart-outline",
86
95
  "mgg/historic-building",
@@ -91,6 +100,7 @@
91
100
  "mgg/input-calendar-costs",
92
101
  "mgg/input-calendar-period",
93
102
  "mgg/input-calendar-time",
103
+ "mgg/instrumental-buildings",
94
104
  "mgg/isbn",
95
105
  "mgg/judge-hammer",
96
106
  "mgg/land-registry",
@@ -112,6 +122,8 @@
112
122
  "mgg/multiple-payments",
113
123
  "mgg/national-document",
114
124
  "mgg/national-document-off",
125
+ "mgg/not-instrumental-d-buildings",
126
+ "mgg/not-sent-yet",
115
127
  "mgg/order-return-down-left-to-right",
116
128
  "mgg/order-return-down-left-to-up",
117
129
  "mgg/order-return-down-right-to-left",
@@ -130,8 +142,10 @@
130
142
  "mgg/order-zigzag-up-right-to-left",
131
143
  "mgg/other-properties",
132
144
  "mgg/other-properties-off",
145
+ "mgg/other-residential-buildings",
133
146
  "mgg/partial-wall",
134
147
  "mgg/payment-settings",
148
+ "mgg/pec-sent-to-the-not-pec-recipient",
135
149
  "mgg/places-green",
136
150
  "mgg/places-green-doc",
137
151
  "mgg/places-green-history",
@@ -145,10 +159,12 @@
145
159
  "mgg/relevance",
146
160
  "mgg/reporting-abuse",
147
161
  "mgg/residency-permit",
162
+ "mgg/roles-permission",
148
163
  "mgg/rubber-stamp",
149
164
  "mgg/rurale",
150
165
  "mgg/search-maggioli",
151
166
  "mgg/send-progress",
167
+ "mgg/sending-error",
152
168
  "mgg/settings-attachment",
153
169
  "mgg/sign-shop",
154
170
  "mgg/square-viewfinder",
@@ -158,6 +174,7 @@
158
174
  "mgg/status-progress-half",
159
175
  "mgg/status-progress-three-quarter",
160
176
  "mgg/stuck-codes",
177
+ "mgg/subtractive-permission",
161
178
  "mgg/tea-light",
162
179
  "mgg/terminal",
163
180
  "mgg/todo",
@@ -174,12 +191,14 @@
174
191
  "mgg/todo-suspended",
175
192
  "mgg/traffic-cone",
176
193
  "mgg/trending-down",
194
+ "mgg/tribute",
177
195
  "mgg/tributes",
178
196
  "mgg/urban-city",
179
197
  "mgg/user-dead",
180
198
  "mgg/user-family",
181
199
  "mgg/user-location",
182
200
  "mgg/user-location-off",
201
+ "mgg/user-signed-out",
183
202
  "mgg/view-chart-gantt",
184
203
  "mgg/view-side-by-side",
185
204
  "mgg/work-book",
@@ -17,18 +17,22 @@
17
17
  "mgg/adv-denied",
18
18
  "mgg/area-edificabile",
19
19
  "mgg/area-weather",
20
+ "mgg/bill",
20
21
  "mgg/box-multiple",
21
22
  "mgg/breadcrumb",
22
23
  "mgg/calendar-euro",
23
24
  "mgg/calendar-multiple",
24
25
  "mgg/calendar-schedule",
26
+ "mgg/cancelled-sheet",
25
27
  "mgg/car-license",
26
28
  "mgg/card-stamping",
27
29
  "mgg/checklist-settings",
28
30
  "mgg/checklist",
29
31
  "mgg/citizenship",
30
32
  "mgg/city-bin",
33
+ "mgg/classic-permission",
31
34
  "mgg/copy-paste",
35
+ "mgg/d-instrumental-buildings",
32
36
  "mgg/data-analytics-alt",
33
37
  "mgg/data-analytics-search",
34
38
  "mgg/data-analytics-time",
@@ -39,6 +43,7 @@
39
43
  "mgg/data-end-civil-union",
40
44
  "mgg/data-end-marriage",
41
45
  "mgg/dataset",
46
+ "mgg/delivered-to-the-recipient",
42
47
  "mgg/document-magic",
43
48
  "mgg/document-rename",
44
49
  "mgg/electronic-document",
@@ -67,9 +72,13 @@
67
72
  "mgg/finance-euro-cashback",
68
73
  "mgg/fit-horizontal",
69
74
  "mgg/fit-vertical",
75
+ "mgg/forwarded-with-a-single-sending",
70
76
  "mgg/fullscreen-on-alt",
71
77
  "mgg/google-check-small",
72
78
  "mgg/google-place-item",
79
+ "mgg/group-assigned-automatically-system",
80
+ "mgg/group-ceased",
81
+ "mgg/group-inherited",
73
82
  "mgg/heart-outline",
74
83
  "mgg/heart",
75
84
  "mgg/historic-building-unusable",
@@ -80,6 +89,7 @@
80
89
  "mgg/input-calendar-costs",
81
90
  "mgg/input-calendar-period",
82
91
  "mgg/input-calendar-time",
92
+ "mgg/instrumental-buildings",
83
93
  "mgg/isbn",
84
94
  "mgg/judge-hammer",
85
95
  "mgg/land-registry",
@@ -101,6 +111,8 @@
101
111
  "mgg/multiple-payments",
102
112
  "mgg/national-document-off",
103
113
  "mgg/national-document",
114
+ "mgg/not-instrumental-d-buildings",
115
+ "mgg/not-sent-yet",
104
116
  "mgg/order-return-down-left-to-right",
105
117
  "mgg/order-return-down-left-to-up",
106
118
  "mgg/order-return-down-right-to-left",
@@ -119,8 +131,10 @@
119
131
  "mgg/order-zigzag-up-right-to-left",
120
132
  "mgg/other-properties-off",
121
133
  "mgg/other-properties",
134
+ "mgg/other-residential-buildings",
122
135
  "mgg/partial-wall",
123
136
  "mgg/payment-settings",
137
+ "mgg/pec-sent-to-the-not-pec-recipient",
124
138
  "mgg/places-green-doc",
125
139
  "mgg/places-green-history",
126
140
  "mgg/places-green-info",
@@ -134,10 +148,12 @@
134
148
  "mgg/relevance",
135
149
  "mgg/reporting-abuse",
136
150
  "mgg/residency-permit",
151
+ "mgg/roles-permission",
137
152
  "mgg/rubber-stamp",
138
153
  "mgg/rurale",
139
154
  "mgg/search-maggioli",
140
155
  "mgg/send-progress",
156
+ "mgg/sending-error",
141
157
  "mgg/settings-attachment",
142
158
  "mgg/sign-shop",
143
159
  "mgg/square-viewfinder",
@@ -147,6 +163,7 @@
147
163
  "mgg/status-progress-half",
148
164
  "mgg/status-progress-three-quarter",
149
165
  "mgg/stuck-codes",
166
+ "mgg/subtractive-permission",
150
167
  "mgg/tea-light",
151
168
  "mgg/terminal",
152
169
  "mgg/todo-completed-re-executable",
@@ -163,12 +180,14 @@
163
180
  "mgg/todo",
164
181
  "mgg/traffic-cone",
165
182
  "mgg/trending-down",
183
+ "mgg/tribute",
166
184
  "mgg/tributes",
167
185
  "mgg/urban-city",
168
186
  "mgg/user-dead",
169
187
  "mgg/user-family",
170
188
  "mgg/user-location-off",
171
189
  "mgg/user-location",
190
+ "mgg/user-signed-out",
172
191
  "mgg/view-chart-gantt",
173
192
  "mgg/view-side-by-side",
174
193
  "mgg/work-book"
@@ -4,6 +4,10 @@ export type ButtonType =
4
4
  | 'reset'
5
5
  | 'submit'
6
6
 
7
+ export type ButtonTargetType =
8
+ |'self'
9
+ |'blank'
10
+
7
11
  export type ButtonSizeType =
8
12
  | 'sm'
9
13
  | 'md'
@@ -57,6 +57,15 @@ export type StateVariantType =
57
57
  | 'focused'
58
58
  | 'readonly'
59
59
 
60
+ export type ToneActionVariantType =
61
+ | 'primary' // background strong
62
+ | 'secondary' // background weak
63
+ | 'tertiary' // no background, no border
64
+ | 'strong' // background strong
65
+ | 'weak' // background weak
66
+ | 'ghost' // bordered
67
+ | 'quiet' // no background, no border
68
+
60
69
  export type ToneVariantType =
61
70
  | 'strong' // background strong
62
71
  | 'weak' // background weak
@@ -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,c={};return""!==o&&(c.resourcesUrl=new URL(".",o).href),e(c)})().then((e=>o([["p-1442acbc",[[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)));
@@ -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-53e5fa07.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)}))}}}));
@@ -1 +1 @@
1
- import{r as t,c as s,h as i,H as h,g as e}from"./p-a7b74010.js";const o=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 e(this)}};o.style=":host{display:block}";export{o as mds_accordion_timer}
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}
@@ -1 +0,0 @@
1
- System.register(["./p-5029b85d.system.js"],(function(e){"use strict";var t,i,n,r,s;return{setters:[function(e){t=e.r;i=e.c;n=e.h;r=e.H;s=e.g}],execute:function(){var c=":host{display:block}";var o=e("mds_accordion_timer",function(){function e(e){var n=this;t(this,e);this.changeEvent=i(this,"mdsAccordionTimerChange",7);this.clearIntervals=function(){window.clearInterval(n.timer);window.clearInterval(n.timeChecker);n.timeChecker=0};this.progress=function(){return Math.abs(n.remainingTime()/n.duration-1)};this.addTimeListener=function(){n.timeChecker=window.setInterval((function(){var e=n.progress();if(n.selectedItem!==undefined){n.selectedItem.progress=e}if(e===1){n.selectedItem.progress=0;n.startNext()}}),100)};this.beginningTime=function(){n.timeStarted=(new Date).getTime();return n.timeStarted};this.remainingTime=function(){var e=n.selectedItemDurationTime-((new Date).getTime()-n.timeStarted);return e>=0?e:0};this.setSelectedItem=function(e){n.children.forEach((function(t,i){if(i===e){t.selected=true;n.selectedItem=t;n.changeEvent.emit()}else{t.selected=false}}))};this.startNext=function(){var e=n.selectedItem.uuid+1>n.children.length-1?0:n.selectedItem.uuid+1;n.setSelectedItem(e);n.startTimer()};this.startTimer=function(){n.clearIntervals();n.time=n.beginningTime();n.selectedItemDurationTime=n.duration;n.addTimeListener()};this.playTimer=function(){n.beginningTime();n.addTimeListener()};this.pauseTimer=function(){n.clearIntervals();n.selectedItemDurationTime=n.remainingTime()};this.stopTimer=function(){n.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 n(r,null,n("slot",null))};Object.defineProperty(e.prototype,"element",{get:function(){return s(this)},enumerable:false,configurable:true});return e}());o.style=c}}}));
@@ -1,19 +0,0 @@
1
- import { newSpecPage } from '@stencil/core/testing'
2
- import { MdsAccordionTimer } from '../mds-accordion-timer'
3
-
4
- describe('mds-accordion-timer', () => {
5
- it('renders', async () => {
6
- const page = await newSpecPage({
7
- components: [MdsAccordionTimer],
8
- html: '<mds-accordion-timer></mds-accordion-timer>',
9
- })
10
- // expect(page.root).toEqualHtml(`
11
- // <mds-accordion-timer>
12
- // <mock:shadow-root>
13
- // <slot></slot>
14
- // </mock:shadow-root>
15
- // </mds-accordion-timer>
16
- // `)
17
- expect(true).toBe(true)
18
- })
19
- })
@@ -1 +0,0 @@
1
- System.register(["./p-5029b85d.system.js"],(function(e){"use strict";var t,i,n,r,s;return{setters:[function(e){t=e.r;i=e.c;n=e.h;r=e.H;s=e.g}],execute:function(){var c=":host{display:block}";var o=e("mds_accordion_timer",function(){function e(e){var n=this;t(this,e);this.changeEvent=i(this,"mdsAccordionTimerChange",7);this.clearIntervals=function(){window.clearInterval(n.timer);window.clearInterval(n.timeChecker);n.timeChecker=0};this.progress=function(){return Math.abs(n.remainingTime()/n.duration-1)};this.addTimeListener=function(){n.timeChecker=window.setInterval((function(){var e=n.progress();if(n.selectedItem!==undefined){n.selectedItem.progress=e}if(e===1){n.selectedItem.progress=0;n.startNext()}}),100)};this.beginningTime=function(){n.timeStarted=(new Date).getTime();return n.timeStarted};this.remainingTime=function(){var e=n.selectedItemDurationTime-((new Date).getTime()-n.timeStarted);return e>=0?e:0};this.setSelectedItem=function(e){n.children.forEach((function(t,i){if(i===e){t.selected=true;n.selectedItem=t;n.changeEvent.emit()}else{t.selected=false}}))};this.startNext=function(){var e=n.selectedItem.uuid+1>n.children.length-1?0:n.selectedItem.uuid+1;n.setSelectedItem(e);n.startTimer()};this.startTimer=function(){n.clearIntervals();n.time=n.beginningTime();n.selectedItemDurationTime=n.duration;n.addTimeListener()};this.playTimer=function(){n.beginningTime();n.addTimeListener()};this.pauseTimer=function(){n.clearIntervals();n.selectedItemDurationTime=n.remainingTime()};this.stopTimer=function(){n.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 n(r,null,n("slot",null))};Object.defineProperty(e.prototype,"element",{get:function(){return s(this)},enumerable:false,configurable:true});return e}());o.style=c}}}));