@maggioli-design-system/mds-accordion-timer-item 2.2.0 → 3.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (88) hide show
  1. package/dist/cjs/{index-fcad7907.js → index-6fcb2864.js} +56 -1
  2. package/dist/cjs/loader.cjs.js +3 -3
  3. package/dist/cjs/mds-accordion-timer-item.cjs.entry.js +17 -24
  4. package/dist/cjs/mds-accordion-timer-item.cjs.js +3 -3
  5. package/dist/collection/collection-manifest.json +1 -1
  6. package/dist/collection/common/keyboard-manager.js +40 -0
  7. package/dist/collection/components/mds-accordion-timer-item/mds-accordion-timer-item.css +104 -53
  8. package/dist/collection/components/mds-accordion-timer-item/mds-accordion-timer-item.js +21 -29
  9. package/dist/collection/components/mds-accordion-timer-item/test/mds-accordion-timer-item.stories.js +7 -7
  10. package/dist/collection/dictionary/icon.js +3 -1
  11. package/dist/collection/dictionary/typography.js +5 -1
  12. package/dist/components/mds-accordion-timer-item.js +17 -24
  13. package/dist/esm/{index-2ecea194.js → index-5d57a2db.js} +56 -1
  14. package/dist/esm/loader.js +4 -4
  15. package/dist/esm/mds-accordion-timer-item.entry.js +17 -24
  16. package/dist/esm/mds-accordion-timer-item.js +4 -4
  17. package/dist/esm-es5/loader.js +1 -1
  18. package/dist/esm-es5/mds-accordion-timer-item.entry.js +1 -1
  19. package/dist/esm-es5/mds-accordion-timer-item.js +1 -1
  20. package/dist/mds-accordion-timer-item/mds-accordion-timer-item.esm.js +1 -1
  21. package/dist/mds-accordion-timer-item/mds-accordion-timer-item.js +1 -1
  22. package/dist/mds-accordion-timer-item/p-09486400.system.js +1 -0
  23. package/dist/mds-accordion-timer-item/p-98fadc92.system.entry.js +1 -0
  24. package/dist/mds-accordion-timer-item/p-d9d46207.entry.js +1 -0
  25. package/dist/stats.json +75 -72
  26. package/dist/types/common/keyboard-manager.d.ts +11 -0
  27. package/dist/types/components/mds-accordion-timer-item/mds-accordion-timer-item.d.ts +9 -5
  28. package/dist/types/components/mds-accordion-timer-item/test/mds-accordion-timer-item.stories.d.ts +2 -2
  29. package/dist/types/components.d.ts +12 -12
  30. package/dist/types/dictionary/icon.d.ts +2 -1
  31. package/dist/types/dictionary/typography.d.ts +2 -1
  32. package/dist/types/stencil-public-runtime.d.ts +11 -0
  33. package/dist/types/{types → type}/typography.d.ts +1 -0
  34. package/package.json +5 -5
  35. package/readme.md +12 -12
  36. package/src/common/keyboard-manager.ts +46 -0
  37. package/src/components/mds-accordion-timer-item/mds-accordion-timer-item.css +17 -13
  38. package/src/components/mds-accordion-timer-item/mds-accordion-timer-item.tsx +17 -32
  39. package/src/components/mds-accordion-timer-item/readme.md +12 -12
  40. package/src/components/mds-accordion-timer-item/test/mds-accordion-timer-item.stories.tsx +7 -7
  41. package/src/components.d.ts +12 -12
  42. package/src/dictionary/icon.ts +4 -0
  43. package/src/dictionary/typography.ts +9 -3
  44. package/src/fixtures/icons.json +174 -0
  45. package/src/fixtures/iconsauce.json +175 -0
  46. package/src/tailwind/components.css +1 -0
  47. package/src/{types → type}/typography.ts +4 -0
  48. package/www/build/mds-accordion-timer-item.esm.js +1 -1
  49. package/www/build/mds-accordion-timer-item.js +1 -1
  50. package/www/build/p-09486400.system.js +1 -0
  51. package/www/build/p-98fadc92.system.entry.js +1 -0
  52. package/www/build/p-d9d46207.entry.js +1 -0
  53. package/dist/mds-accordion-timer-item/p-3f67e42d.entry.js +0 -1
  54. package/dist/mds-accordion-timer-item/p-93520008.system.js +0 -1
  55. package/dist/mds-accordion-timer-item/p-e10df150.system.entry.js +0 -1
  56. package/www/build/p-3f67e42d.entry.js +0 -1
  57. package/www/build/p-93520008.system.js +0 -1
  58. package/www/build/p-e10df150.system.entry.js +0 -1
  59. /package/dist/collection/{types → type}/autocomplete.js +0 -0
  60. /package/dist/collection/{types → type}/button.js +0 -0
  61. /package/dist/collection/{types → type}/floating-ui.js +0 -0
  62. /package/dist/collection/{types → type}/form-rel.js +0 -0
  63. /package/dist/collection/{types → type}/input-text-type.js +0 -0
  64. /package/dist/collection/{types → type}/input-value-type.js +0 -0
  65. /package/dist/collection/{types → type}/loading.js +0 -0
  66. /package/dist/collection/{types → type}/typography.js +0 -0
  67. /package/dist/collection/{types → type}/variant.js +0 -0
  68. /package/dist/esm-es5/{index-2ecea194.js → index-5d57a2db.js} +0 -0
  69. /package/dist/mds-accordion-timer-item/{p-886a1dba.system.js → p-0df2a96d.system.js} +0 -0
  70. /package/dist/mds-accordion-timer-item/{p-870ea4fa.js → p-96e23db0.js} +0 -0
  71. /package/dist/types/{types → type}/autocomplete.d.ts +0 -0
  72. /package/dist/types/{types → type}/button.d.ts +0 -0
  73. /package/dist/types/{types → type}/floating-ui.d.ts +0 -0
  74. /package/dist/types/{types → type}/form-rel.d.ts +0 -0
  75. /package/dist/types/{types → type}/input-text-type.d.ts +0 -0
  76. /package/dist/types/{types → type}/input-value-type.d.ts +0 -0
  77. /package/dist/types/{types → type}/loading.d.ts +0 -0
  78. /package/dist/types/{types → type}/variant.d.ts +0 -0
  79. /package/src/{types → type}/autocomplete.ts +0 -0
  80. /package/src/{types → type}/button.ts +0 -0
  81. /package/src/{types → type}/floating-ui.ts +0 -0
  82. /package/src/{types → type}/form-rel.ts +0 -0
  83. /package/src/{types → type}/input-text-type.ts +0 -0
  84. /package/src/{types → type}/input-value-type.ts +0 -0
  85. /package/src/{types → type}/loading.ts +0 -0
  86. /package/src/{types → type}/variant.ts +0 -0
  87. /package/www/build/{p-886a1dba.system.js → p-0df2a96d.system.js} +0 -0
  88. /package/www/build/{p-870ea4fa.js → p-96e23db0.js} +0 -0
@@ -133,6 +133,14 @@ const h = (nodeName, vnodeData, ...children) => {
133
133
  }
134
134
  return vnode;
135
135
  };
136
+ /**
137
+ * A utility function for creating a virtual DOM node from a tag and some
138
+ * possible text content.
139
+ *
140
+ * @param tag the tag for this element
141
+ * @param text possible text content for the node
142
+ * @returns a newly-minted virtual DOM node
143
+ */
136
144
  const newVNode = (tag, text) => {
137
145
  const vnode = {
138
146
  $flags$: 0,
@@ -147,6 +155,12 @@ const newVNode = (tag, text) => {
147
155
  return vnode;
148
156
  };
149
157
  const Host = {};
158
+ /**
159
+ * Check whether a given node is a Host node or not
160
+ *
161
+ * @param node the virtual DOM node to check
162
+ * @returns whether it's a Host node or not
163
+ */
150
164
  const isHost = (node) => node && node.$tag$ === Host;
151
165
  /**
152
166
  * Parse a new property value for a given property type.
@@ -462,6 +476,21 @@ const createElm = (oldParentVNode, newParentVNode, childIndex, parentElm) => {
462
476
  }
463
477
  return elm;
464
478
  };
479
+ /**
480
+ * Create DOM nodes corresponding to a list of {@link d.Vnode} objects and
481
+ * add them to the DOM in the appropriate place.
482
+ *
483
+ * @param parentElm the DOM node which should be used as a parent for the new
484
+ * DOM nodes
485
+ * @param before a child of the `parentElm` which the new children should be
486
+ * inserted before (optional)
487
+ * @param parentVNode the parent virtual DOM node
488
+ * @param vnodes the new child virtual DOM nodes to produce DOM nodes for
489
+ * @param startIdx the index in the child virtual DOM nodes at which to start
490
+ * creating DOM nodes (inclusive)
491
+ * @param endIdx the index in the child virtual DOM nodes at which to stop
492
+ * creating DOM nodes (inclusive)
493
+ */
465
494
  const addVnodes = (parentElm, before, parentVNode, vnodes, startIdx, endIdx) => {
466
495
  let containerElm = (parentElm);
467
496
  let childNode;
@@ -478,6 +507,19 @@ const addVnodes = (parentElm, before, parentVNode, vnodes, startIdx, endIdx) =>
478
507
  }
479
508
  }
480
509
  };
510
+ /**
511
+ * Remove the DOM elements corresponding to a list of {@link d.VNode} objects.
512
+ * This can be used to, for instance, clean up after a list of children which
513
+ * should no longer be shown.
514
+ *
515
+ * This function also handles some of Stencil's slot relocation logic.
516
+ *
517
+ * @param vnodes a list of virtual DOM nodes to remove
518
+ * @param startIdx the index at which to start removing nodes (inclusive)
519
+ * @param endIdx the index at which to stop removing nodes (inclusive)
520
+ * @param vnode a VNode
521
+ * @param elm an element
522
+ */
481
523
  const removeVnodes = (vnodes, startIdx, endIdx, vnode, elm) => {
482
524
  for (; startIdx <= endIdx; ++startIdx) {
483
525
  if ((vnode = vnodes[startIdx])) {
@@ -669,7 +711,8 @@ const updateChildren = (parentElm, oldCh, newVNode, newCh) => {
669
711
  *
670
712
  * So, in other words, if `key` attrs are not set on VNodes which may be
671
713
  * changing order within a `children` array or something along those lines then
672
- * we could obtain a false positive and then have to do needless re-rendering.
714
+ * we could obtain a false negative and then have to do needless re-rendering
715
+ * (i.e. we'd say two VNodes aren't equal when in fact they should be).
673
716
  *
674
717
  * @param leftVNode the first VNode to check
675
718
  * @param rightVNode the second VNode to check
@@ -733,6 +776,18 @@ const patch = (oldVNode, newVNode) => {
733
776
  elm.data = text;
734
777
  }
735
778
  };
779
+ /**
780
+ * The main entry point for Stencil's virtual DOM-based rendering engine
781
+ *
782
+ * Given a {@link d.HostRef} container and some virtual DOM nodes, this
783
+ * function will handle creating a virtual DOM tree with a single root, patching
784
+ * the current virtual DOM tree onto an old one (if any), dealing with slot
785
+ * relocation, and reflecting attributes.
786
+ *
787
+ * @param hostRef data needed to root and render the virtual DOM tree, such as
788
+ * the DOM node into which it should be rendered.
789
+ * @param renderFnResults the virtual DOM nodes to be rendered
790
+ */
736
791
  const renderVdom = (hostRef, renderFnResults) => {
737
792
  const hostElm = hostRef.$hostElement$;
738
793
  const cmpMeta = hostRef.$cmpMeta$;
@@ -2,10 +2,10 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- const index = require('./index-fcad7907.js');
5
+ const index = require('./index-6fcb2864.js');
6
6
 
7
7
  /*
8
- Stencil Client Patch Esm v2.22.1 | MIT Licensed | https://stenciljs.com
8
+ Stencil Client Patch Esm v2.22.2 | MIT Licensed | https://stenciljs.com
9
9
  */
10
10
  const patchEsm = () => {
11
11
  return index.promiseResolve();
@@ -14,7 +14,7 @@ const patchEsm = () => {
14
14
  const defineCustomElements = (win, options) => {
15
15
  if (typeof window === 'undefined') return Promise.resolve();
16
16
  return patchEsm().then(() => {
17
- return index.bootstrapLazy([["mds-accordion-timer-item.cjs",[[1,"mds-accordion-timer-item",{"typography":[1],"active":[516],"description":[1],"progress":[2],"uuid":[2]}]]]], options);
17
+ return index.bootstrapLazy([["mds-accordion-timer-item.cjs",[[1,"mds-accordion-timer-item",{"typography":[1],"selected":[516],"description":[1],"progress":[2],"uuid":[2]}]]]], options);
18
18
  });
19
19
  };
20
20
 
@@ -2,50 +2,43 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- const index = require('./index-fcad7907.js');
5
+ const index = require('./index-6fcb2864.js');
6
6
 
7
- const mdsAccordionTimerItemCss = ".fixed{position:fixed}.absolute{position:absolute}.contents{display:contents}.border{border-width:1px}.shadow{--tw-shadow:0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);--tw-shadow-colored:0 1px 3px 0 var(--tw-shadow-color), 0 1px 2px -1px var(--tw-shadow-color);-webkit-box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow)}:host{--progress-bar-color:rgb(var(--tone-neutral-03));--progress-bar-background:rgb(var(--tone-neutral-08));--progress-bar-thickness:0.25rem;position:relative;display:grid;padding-top:1rem;padding-bottom:1rem;-webkit-transition-property:background-color, border-color, color, fill, height, margin, opacity, padding, width, -webkit-box-shadow, -webkit-transform;transition-property:background-color, border-color, color, fill, height, margin, opacity, padding, width, -webkit-box-shadow, -webkit-transform;transition-property:background-color, border-color, box-shadow, color, fill, height, margin, opacity, padding, transform, width;transition-property:background-color, border-color, box-shadow, color, fill, height, margin, opacity, padding, transform, width, -webkit-box-shadow, -webkit-transform;-webkit-transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);-webkit-transition-duration:500ms;transition-duration:500ms;-webkit-transition-timing-function:cubic-bezier(0.19, 1, 0.22, 1);transition-timing-function:cubic-bezier(0.19, 1, 0.22, 1);color:var(--color, rgb(var(--tone-neutral-02)))}.row{display:-ms-flexbox;display:flex;gap:1rem}.accordion{display:grid}.progress-bar{-ms-flex-negative:0;flex-shrink:0;--color:var(--progress-bar-color);--background:var(--progress-bar-background);--thickness:var(--progress-bar-thickness)}.action{cursor:pointer;border-style:none;background-color:transparent;padding:0px;text-align:left}:host([active]) .action{cursor:auto}.contents{display:grid;height:0px;gap:1rem;overflow:hidden;padding-top:0px;opacity:0;-webkit-transition-property:background-color, border-color, color, fill, height, margin, opacity, padding, width, -webkit-box-shadow, -webkit-transform;transition-property:background-color, border-color, color, fill, height, margin, opacity, padding, width, -webkit-box-shadow, -webkit-transform;transition-property:background-color, border-color, box-shadow, color, fill, height, margin, opacity, padding, transform, width;transition-property:background-color, border-color, box-shadow, color, fill, height, margin, opacity, padding, transform, width, -webkit-box-shadow, -webkit-transform;-webkit-transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);-webkit-transition-duration:300ms;transition-duration:300ms;-webkit-transition-timing-function:cubic-bezier(0.25, 0.46, 0.45, 0.94);transition-timing-function:cubic-bezier(0.25, 0.46, 0.45, 0.94)}:host([active]) .contents{height:auto;padding-top:1rem;opacity:1}";
7
+ const mdsAccordionTimerItemCss = "@tailwind components; .focus-off,.focusable,.focusable-light,.focusable-light-off{-webkit-transition-duration:200ms;transition-duration:200ms;-webkit-transition-timing-function:cubic-bezier(0, 0, 0.2, 1);transition-timing-function:cubic-bezier(0, 0, 0.2, 1);outline-offset:var(--magma-outline-blur-offset);outline:var(--magma-outline-blur);-webkit-transition-property:background-color, border-color, color, fill, outline, outline-offset, -webkit-box-shadow, -webkit-transform;transition-property:background-color, border-color, color, fill, outline, outline-offset, -webkit-box-shadow, -webkit-transform;transition-property:background-color, border-color, box-shadow, color, fill, outline, outline-offset, transform;transition-property:background-color, border-color, box-shadow, color, fill, outline, outline-offset, transform, -webkit-box-shadow, -webkit-transform}.focus-on,.focusable-light:focus-visible,.focusable:focus-visible{--magma-outline-blur-offset:var(--magma-outline-focus-offset);--magma-outline-blur:var(--magma-outline-focus)}.fixed{position:fixed}.absolute{position:absolute}.contents{display:contents}.border{border-width:1px}.shadow{--tw-shadow:0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);--tw-shadow-colored:0 1px 3px 0 var(--tw-shadow-color), 0 1px 2px -1px var(--tw-shadow-color);-webkit-box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow)}:host{--mds-accordion-timer-item-progress-bar-color:rgb(var(--tone-neutral-03));--mds-accordion-timer-item-progress-bar-background:rgb(var(--tone-neutral-08));--mds-accordion-timer-item-progress-bar-thickness:0.25rem;position:relative;display:grid;padding-top:1rem;padding-bottom:1rem;-webkit-transition-property:background-color, border-color, color, fill, height, margin, opacity, padding, width, -webkit-box-shadow, -webkit-transform;transition-property:background-color, border-color, color, fill, height, margin, opacity, padding, width, -webkit-box-shadow, -webkit-transform;transition-property:background-color, border-color, box-shadow, color, fill, height, margin, opacity, padding, transform, width;transition-property:background-color, border-color, box-shadow, color, fill, height, margin, opacity, padding, transform, width, -webkit-box-shadow, -webkit-transform;-webkit-transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);-webkit-transition-duration:500ms;transition-duration:500ms;-webkit-transition-timing-function:cubic-bezier(0.19, 1, 0.22, 1);transition-timing-function:cubic-bezier(0.19, 1, 0.22, 1);color:var(--mds-accordion-timer-item-color, rgb(var(--tone-neutral-02)))}.row{display:-ms-flexbox;display:flex;gap:1rem}.accordion{display:grid}.progress-bar{-ms-flex-negative:0;flex-shrink:0;--mds-progress-color:var(--mds-accordion-timer-item-progress-bar-color);--mds-progress-background:var(--mds-accordion-timer-item-progress-bar-background);--mds-progress-thickness:var(--mds-accordion-timer-item-progress-bar-thickness)}.action{cursor:pointer;border-radius:0.75rem;border-style:none;background-color:transparent;padding:0px;text-align:left}:host([selected]) .action{cursor:auto}.contents{display:grid;height:0px;gap:1rem;overflow:hidden;padding-top:0px;opacity:0;-webkit-transition-property:background-color, border-color, color, fill, height, margin, opacity, padding, width, -webkit-box-shadow, -webkit-transform;transition-property:background-color, border-color, color, fill, height, margin, opacity, padding, width, -webkit-box-shadow, -webkit-transform;transition-property:background-color, border-color, box-shadow, color, fill, height, margin, opacity, padding, transform, width;transition-property:background-color, border-color, box-shadow, color, fill, height, margin, opacity, padding, transform, width, -webkit-box-shadow, -webkit-transform;-webkit-transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);-webkit-transition-duration:300ms;transition-duration:300ms;-webkit-transition-timing-function:cubic-bezier(0.25, 0.46, 0.45, 0.94);transition-timing-function:cubic-bezier(0.25, 0.46, 0.45, 0.94)}:host([selected]) .contents{height:auto;padding-top:1rem;opacity:1}";
8
8
 
9
9
  const MdsAccordionTimerItem = class {
10
10
  constructor(hostRef) {
11
11
  index.registerInstance(this, hostRef);
12
- this.clickActive = index.createEvent(this, "clickActive", 7);
13
- this.mouseEnterActive = index.createEvent(this, "mouseEnterActive", 7);
14
- this.mouseLeaveActive = index.createEvent(this, "mouseLeaveActive", 7);
15
- // componentWillLoad (): void {
16
- // this.isActive = this.active
17
- // }
18
- // componentDidLoad (): void {
19
- // this.element.shadowRoot.querySelector<HTMLMdsProgressElement>('mds-progress').setAttribute('direction', 'vertical')
20
- // }
12
+ this.clickSelectEvent = index.createEvent(this, "mdsAccordionTimerItemClickSelect", 7);
13
+ this.selectedMouseEnterEvent = index.createEvent(this, "mdsAccordionTimerItemMouseEnterSelect", 7);
14
+ this.selectedMouseLeaveEvent = index.createEvent(this, "mdsAccordionTimerItemMouseLeaveSelect", 7);
15
+ /**
16
+ * Event throws only once the element is active,
17
+ * to fire it again it need to be a different item
18
+ */
21
19
  this.toggle = () => {
22
- if (!this.active) {
23
- // this.isActive = true
24
- this.clickActive.emit(this.description);
20
+ if (!this.selected) {
21
+ this.clickSelectEvent.emit(this.description);
25
22
  }
26
23
  };
27
24
  this.mouseEnter = () => {
28
- if (this.active) {
29
- this.mouseEnterActive.emit(this.description);
25
+ if (this.selected) {
26
+ this.selectedMouseEnterEvent.emit(this.description);
30
27
  }
31
28
  };
32
29
  this.mouseLeave = () => {
33
- if (this.active) {
34
- this.mouseLeaveActive.emit(this.description);
30
+ if (this.selected) {
31
+ this.selectedMouseLeaveEvent.emit(this.description);
35
32
  }
36
33
  };
37
34
  this.typography = 'h5';
38
- this.active = undefined;
35
+ this.selected = undefined;
39
36
  this.description = undefined;
40
37
  this.progress = 0;
41
38
  this.uuid = 0;
42
39
  }
43
- // @Watch('active')
44
- // activeChanged (newValue: boolean): void {
45
- // this.isActive = newValue
46
- // }
47
40
  render() {
48
- return (index.h(index.Host, { onMouseEnter: this.mouseEnter, onMouseLeave: this.mouseLeave }, index.h("div", { class: "row" }, index.h("mds-progress", { class: "progress-bar", progress: Number(this.progress.toFixed(2)), direction: "vertical" }), index.h("div", { class: "accordion" }, index.h("button", { "aria-controls": "contents", "aria-expanded": this.active ? 'true' : 'false', class: "action", id: "action", onClick: this.toggle, role: "button", tabindex: "0" }, index.h("mds-text", { typography: this.typography }, this.description)), index.h("div", { class: "contents", id: "contents" }, index.h("slot", null))))));
41
+ return (index.h(index.Host, { onMouseEnter: this.mouseEnter, onMouseLeave: this.mouseLeave }, index.h("div", { class: "row" }, index.h("mds-progress", { class: "progress-bar", progress: Number(this.progress.toFixed(2)), direction: "vertical" }), index.h("div", { class: "accordion" }, index.h("button", { "aria-controls": "contents", "aria-expanded": this.selected ? 'true' : 'false', class: "action focusable", id: "action", onClick: this.toggle, role: "button", tabindex: "0" }, index.h("mds-text", { typography: this.typography }, this.description)), index.h("div", { class: "contents", id: "contents" }, index.h("slot", null))))));
49
42
  }
50
43
  };
51
44
  MdsAccordionTimerItem.style = mdsAccordionTimerItemCss;
@@ -2,10 +2,10 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- const index = require('./index-fcad7907.js');
5
+ const index = require('./index-6fcb2864.js');
6
6
 
7
7
  /*
8
- Stencil Client Patch Browser v2.22.1 | MIT Licensed | https://stenciljs.com
8
+ Stencil Client Patch Browser v2.22.2 | MIT Licensed | https://stenciljs.com
9
9
  */
10
10
  const patchBrowser = () => {
11
11
  const importMeta = (typeof document === 'undefined' ? new (require('u' + 'rl').URL)('file:' + __filename).href : (document.currentScript && document.currentScript.src || new URL('mds-accordion-timer-item.cjs.js', document.baseURI).href));
@@ -17,7 +17,7 @@ const patchBrowser = () => {
17
17
  };
18
18
 
19
19
  patchBrowser().then(options => {
20
- return index.bootstrapLazy([["mds-accordion-timer-item.cjs",[[1,"mds-accordion-timer-item",{"typography":[1],"active":[516],"description":[1],"progress":[2],"uuid":[2]}]]]], options);
20
+ return index.bootstrapLazy([["mds-accordion-timer-item.cjs",[[1,"mds-accordion-timer-item",{"typography":[1],"selected":[516],"description":[1],"progress":[2],"uuid":[2]}]]]], options);
21
21
  });
22
22
 
23
23
  exports.setNonce = index.setNonce;
@@ -4,7 +4,7 @@
4
4
  ],
5
5
  "compiler": {
6
6
  "name": "@stencil/core",
7
- "version": "2.22.1",
7
+ "version": "2.22.2",
8
8
  "typescriptVersion": "4.9.4"
9
9
  },
10
10
  "collections": [],
@@ -0,0 +1,40 @@
1
+ export class KeyboardManager {
2
+ constructor() {
3
+ this.elements = [];
4
+ this.handleClickBehaviorDispatchEvent = (event) => {
5
+ if (event.code === 'Space' || event.code === 'Enter' || event.code === 'NumpadEnter') {
6
+ event.target.click();
7
+ }
8
+ };
9
+ this.handleEscapeBehaviorDispatchEvent = (event) => {
10
+ if (event.code === 'Escape' && this.escapeCallback) {
11
+ this.escapeCallback();
12
+ }
13
+ };
14
+ this.addElement = (el, name = 'element') => {
15
+ this.elements[name] = el;
16
+ };
17
+ this.attachClickBehavior = (name = 'element') => {
18
+ if (this.elements[name]) {
19
+ this.elements[name].addEventListener('keydown', this.handleClickBehaviorDispatchEvent);
20
+ }
21
+ };
22
+ this.detachClickBehavior = (name = 'element') => {
23
+ if (this.elements[name]) {
24
+ this.elements[name].removeEventListener('keydown', this.handleClickBehaviorDispatchEvent);
25
+ }
26
+ };
27
+ this.attachEscapeBehavior = (callBack) => {
28
+ this.escapeCallback = callBack;
29
+ if (typeof window !== undefined) {
30
+ window.addEventListener('keydown', this.handleEscapeBehaviorDispatchEvent.bind(this));
31
+ }
32
+ };
33
+ this.detachEscapeBehavior = () => {
34
+ this.escapeCallback = null;
35
+ if (typeof window !== undefined) {
36
+ window.removeEventListener('keydown', this.handleEscapeBehaviorDispatchEvent.bind(this));
37
+ }
38
+ };
39
+ }
40
+ }
@@ -1,36 +1,62 @@
1
- .fixed {
2
- position: fixed;
1
+ @tailwind components;
2
+
3
+ .focus-off,
4
+ .focusable,
5
+ .focusable-light,
6
+ .focusable-light-off{
7
+
8
+ transition-duration: 200ms;
9
+
10
+ transition-timing-function: cubic-bezier(0, 0, 0.2, 1);
11
+
12
+ outline-offset: var(--magma-outline-blur-offset);
13
+ outline: var(--magma-outline-blur);
14
+ transition-property: background-color, border-color, box-shadow, color, fill, outline, outline-offset, transform;
15
+ }
16
+
17
+ .focus-on,
18
+ .focusable-light:focus-visible,
19
+ .focusable:focus-visible {
20
+ --magma-outline-blur-offset: var(--magma-outline-focus-offset);
21
+ --magma-outline-blur: var(--magma-outline-focus);
22
+ }
23
+ .fixed{
24
+
25
+ position: fixed;
3
26
  }
27
+ .absolute{
4
28
 
5
- .absolute {
6
- position: absolute;
29
+ position: absolute;
7
30
  }
31
+ .contents{
8
32
 
9
- .contents {
10
- display: contents;
33
+ display: contents;
11
34
  }
35
+ .border{
12
36
 
13
- .border {
14
- border-width: 1px;
37
+ border-width: 1px;
15
38
  }
39
+ .shadow{
40
+
41
+ --tw-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
16
42
 
17
- .shadow {
18
- --tw-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
19
- --tw-shadow-colored: 0 1px 3px 0 var(--tw-shadow-color), 0 1px 2px -1px var(--tw-shadow-color);
20
- box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow);
43
+ --tw-shadow-colored: 0 1px 3px 0 var(--tw-shadow-color), 0 1px 2px -1px var(--tw-shadow-color);
44
+
45
+ box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow);
21
46
  }
22
47
 
23
48
  /**
24
- * @prop --progress-bar-color: Sets the color of the progress bar when the item is selected
25
- * @prop --progress-bar-background: Sets the background-color of the progress bar when the item is selected
26
- * @prop --color: Sets the text color of the component
27
- * @prop --progress-bar-thickness: Sets thickness of the progress bar
49
+ * @prop --mds-accordion-timer-item-progress-bar-color: Sets the color of the progress bar when the item is selected
50
+ * @prop --mds-accordion-timer-item-progress-bar-background: Sets the background-color of the progress bar when the item is selected
51
+ * @prop --mds-accordion-timer-item-color: Sets the text color of the component
52
+ * @prop --mds-accordion-timer-item-progress-bar-thickness: Sets thickness of the progress bar
28
53
  */
29
54
 
30
55
  :host {
31
- --progress-bar-color: rgb(var(--tone-neutral-03));
32
- --progress-bar-background: rgb(var(--tone-neutral-08));
33
- --progress-bar-thickness: 0.25rem;
56
+
57
+ --mds-accordion-timer-item-progress-bar-color: rgb(var(--tone-neutral-03));
58
+ --mds-accordion-timer-item-progress-bar-background: rgb(var(--tone-neutral-08));
59
+ --mds-accordion-timer-item-progress-bar-thickness: 0.25rem;
34
60
  position: relative;
35
61
  display: grid;
36
62
  padding-top: 1rem;
@@ -40,53 +66,78 @@
40
66
  transition-duration: 500ms;
41
67
  transition-timing-function: cubic-bezier(0.19, 1, 0.22, 1);
42
68
 
43
- color: var(--color, rgb(var(--tone-neutral-02)));
69
+ color: var(--mds-accordion-timer-item-color, rgb(var(--tone-neutral-02)));
44
70
  }
45
71
 
46
- .row {
47
- display: flex;
48
- gap: 1rem;
72
+ .row{
73
+
74
+ display: flex;
75
+
76
+ gap: 1rem;
49
77
  }
50
78
 
51
- .accordion {
52
- display: grid;
79
+ .accordion{
80
+
81
+ display: grid;
53
82
  }
54
83
 
55
- .progress-bar {
56
- flex-shrink: 0;
84
+ .progress-bar{
85
+
86
+ flex-shrink: 0;
57
87
 
58
- --color: var(--progress-bar-color);
59
- --background: var(--progress-bar-background);
60
- --thickness: var(--progress-bar-thickness);
88
+ --mds-progress-color: var(--mds-accordion-timer-item-progress-bar-color);
89
+ --mds-progress-background: var(--mds-accordion-timer-item-progress-bar-background);
90
+ --mds-progress-thickness: var(--mds-accordion-timer-item-progress-bar-thickness);
61
91
  }
62
92
 
63
- .action {
64
- cursor: pointer;
65
- border-style: none;
66
- background-color: transparent;
67
- padding: 0px;
68
- text-align: left;
93
+ .action{
94
+
95
+ cursor: pointer;
96
+
97
+ border-radius: 0.75rem;
98
+
99
+ border-style: none;
100
+
101
+ background-color: transparent;
102
+
103
+ padding: 0px;
104
+
105
+ text-align: left;
69
106
  }
70
107
 
71
- :host ( [active] ) .action {
72
- cursor: auto;
108
+ :host ( [selected] ) .action{
109
+
110
+ cursor: auto;
73
111
  }
74
112
 
75
- .contents {
76
- display: grid;
77
- height: 0px;
78
- gap: 1rem;
79
- overflow: hidden;
80
- padding-top: 0px;
81
- opacity: 0;
82
- transition-property: background-color, border-color, box-shadow, color, fill, height, margin, opacity, padding, transform, width;
83
- transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
84
- transition-duration: 300ms;
85
- transition-timing-function: cubic-bezier(0.25, 0.46, 0.45, 0.94);
113
+ .contents{
114
+
115
+ display: grid;
116
+
117
+ height: 0px;
118
+
119
+ gap: 1rem;
120
+
121
+ overflow: hidden;
122
+
123
+ padding-top: 0px;
124
+
125
+ opacity: 0;
126
+
127
+ transition-property: background-color, border-color, box-shadow, color, fill, height, margin, opacity, padding, transform, width;
128
+
129
+ transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
130
+
131
+ transition-duration: 300ms;
132
+
133
+ transition-timing-function: cubic-bezier(0.25, 0.46, 0.45, 0.94);
86
134
  }
87
135
 
88
- :host ( [active] ) .contents {
89
- height: auto;
90
- padding-top: 1rem;
91
- opacity: 1;
136
+ :host ( [selected] ) .contents{
137
+
138
+ height: auto;
139
+
140
+ padding-top: 1rem;
141
+
142
+ opacity: 1;
92
143
  }
@@ -1,41 +1,33 @@
1
1
  import { Host, h } from '@stencil/core';
2
- // import { DirectionType } from '../mds-progress/meta/types'
3
2
  export class MdsAccordionTimerItem {
4
3
  constructor() {
5
- // componentWillLoad (): void {
6
- // this.isActive = this.active
7
- // }
8
- // componentDidLoad (): void {
9
- // this.element.shadowRoot.querySelector<HTMLMdsProgressElement>('mds-progress').setAttribute('direction', 'vertical')
10
- // }
4
+ /**
5
+ * Event throws only once the element is active,
6
+ * to fire it again it need to be a different item
7
+ */
11
8
  this.toggle = () => {
12
- if (!this.active) {
13
- // this.isActive = true
14
- this.clickActive.emit(this.description);
9
+ if (!this.selected) {
10
+ this.clickSelectEvent.emit(this.description);
15
11
  }
16
12
  };
17
13
  this.mouseEnter = () => {
18
- if (this.active) {
19
- this.mouseEnterActive.emit(this.description);
14
+ if (this.selected) {
15
+ this.selectedMouseEnterEvent.emit(this.description);
20
16
  }
21
17
  };
22
18
  this.mouseLeave = () => {
23
- if (this.active) {
24
- this.mouseLeaveActive.emit(this.description);
19
+ if (this.selected) {
20
+ this.selectedMouseLeaveEvent.emit(this.description);
25
21
  }
26
22
  };
27
23
  this.typography = 'h5';
28
- this.active = undefined;
24
+ this.selected = undefined;
29
25
  this.description = undefined;
30
26
  this.progress = 0;
31
27
  this.uuid = 0;
32
28
  }
33
- // @Watch('active')
34
- // activeChanged (newValue: boolean): void {
35
- // this.isActive = newValue
36
- // }
37
29
  render() {
38
- return (h(Host, { onMouseEnter: this.mouseEnter, onMouseLeave: this.mouseLeave }, h("div", { class: "row" }, h("mds-progress", { class: "progress-bar", progress: Number(this.progress.toFixed(2)), direction: "vertical" }), h("div", { class: "accordion" }, h("button", { "aria-controls": "contents", "aria-expanded": this.active ? 'true' : 'false', class: "action", id: "action", onClick: this.toggle, role: "button", tabindex: "0" }, h("mds-text", { typography: this.typography }, this.description)), h("div", { class: "contents", id: "contents" }, h("slot", null))))));
30
+ return (h(Host, { onMouseEnter: this.mouseEnter, onMouseLeave: this.mouseLeave }, h("div", { class: "row" }, h("mds-progress", { class: "progress-bar", progress: Number(this.progress.toFixed(2)), direction: "vertical" }), h("div", { class: "accordion" }, h("button", { "aria-controls": "contents", "aria-expanded": this.selected ? 'true' : 'false', class: "action focusable", id: "action", onClick: this.toggle, role: "button", tabindex: "0" }, h("mds-text", { typography: this.typography }, this.description)), h("div", { class: "contents", id: "contents" }, h("slot", null))))));
39
31
  }
40
32
  static get is() { return "mds-accordion-timer-item"; }
41
33
  static get encapsulation() { return "shadow"; }
@@ -60,7 +52,7 @@ export class MdsAccordionTimerItem {
60
52
  "references": {
61
53
  "TypographyTitleType": {
62
54
  "location": "import",
63
- "path": "../../types/typography"
55
+ "path": "@type/typography"
64
56
  }
65
57
  }
66
58
  },
@@ -74,7 +66,7 @@ export class MdsAccordionTimerItem {
74
66
  "reflect": false,
75
67
  "defaultValue": "'h5'"
76
68
  },
77
- "active": {
69
+ "selected": {
78
70
  "type": "boolean",
79
71
  "mutable": false,
80
72
  "complexType": {
@@ -88,7 +80,7 @@ export class MdsAccordionTimerItem {
88
80
  "tags": [],
89
81
  "text": "Specifies if the accordion item is opened or not"
90
82
  },
91
- "attribute": "active",
83
+ "attribute": "selected",
92
84
  "reflect": true
93
85
  },
94
86
  "description": {
@@ -148,8 +140,8 @@ export class MdsAccordionTimerItem {
148
140
  }
149
141
  static get events() {
150
142
  return [{
151
- "method": "clickActive",
152
- "name": "clickActive",
143
+ "method": "clickSelectEvent",
144
+ "name": "mdsAccordionTimerItemClickSelect",
153
145
  "bubbles": true,
154
146
  "cancelable": true,
155
147
  "composed": true,
@@ -163,8 +155,8 @@ export class MdsAccordionTimerItem {
163
155
  "references": {}
164
156
  }
165
157
  }, {
166
- "method": "mouseEnterActive",
167
- "name": "mouseEnterActive",
158
+ "method": "selectedMouseEnterEvent",
159
+ "name": "mdsAccordionTimerItemMouseEnterSelect",
168
160
  "bubbles": true,
169
161
  "cancelable": true,
170
162
  "composed": true,
@@ -178,8 +170,8 @@ export class MdsAccordionTimerItem {
178
170
  "references": {}
179
171
  }
180
172
  }, {
181
- "method": "mouseLeaveActive",
182
- "name": "mouseLeaveActive",
173
+ "method": "selectedMouseLeaveEvent",
174
+ "name": "mdsAccordionTimerItemMouseLeaveSelect",
183
175
  "bubbles": true,
184
176
  "cancelable": true,
185
177
  "composed": true,
@@ -8,9 +8,9 @@ export default {
8
8
  type: { name: 'string' },
9
9
  description: 'Specifies the title shown when the accordion is closed or opened',
10
10
  },
11
- active: {
11
+ selected: {
12
12
  type: { name: 'boolean' },
13
- description: 'Specifies if the accordion item is opened or not',
13
+ description: 'Specifies if the accordion item is selected or not',
14
14
  },
15
15
  progress: {
16
16
  control: { type: 'range', step: 0.01, min: 0, max: 1 },
@@ -30,17 +30,17 @@ export const Default = Template.bind({});
30
30
  Default.args = {
31
31
  description: 'Blipbug',
32
32
  };
33
- export const Active = Template.bind({});
34
- Active.args = {
35
- active: true,
33
+ export const selected = Template.bind({});
34
+ selected.args = {
35
+ selected: true,
36
36
  description: 'Blipbug',
37
37
  };
38
38
  export const Progress = Template.bind({});
39
39
  Progress.args = {
40
- active: true,
40
+ selected: true,
41
41
  description: 'Blipbug',
42
42
  progress: 0.5,
43
43
  };
44
44
  Default.story = lokiDisabled;
45
- Active.story = lokiDisabled;
45
+ selected.story = lokiDisabled;
46
46
  Progress.story = lokiDisabled;
@@ -1,3 +1,5 @@
1
1
  import jsonIconsDictionary from '../fixtures/icons.json';
2
+ import jsonMggIconsDictionary from '../fixtures/iconsauce.json';
2
3
  const iconsDictionary = jsonIconsDictionary;
3
- export { iconsDictionary, };
4
+ const mggIconsDictionary = jsonMggIconsDictionary;
5
+ export { iconsDictionary, mggIconsDictionary, };
@@ -21,6 +21,10 @@ const typographyVariationsDictionary = [
21
21
  'read',
22
22
  'code',
23
23
  ];
24
+ const typographyReadingVariationsDictionary = [
25
+ 'info',
26
+ 'read',
27
+ ];
24
28
  const typographyMonoDictionary = [
25
29
  'snippet',
26
30
  'hack',
@@ -56,4 +60,4 @@ const typographyTooltipDictionary = [
56
60
  'detail',
57
61
  'tip',
58
62
  ];
59
- export { typographyDictionary, typographyVariationsDictionary, typographyMonoDictionary, typographyTitleDictionary, typographyInfoDictionary, typographyReadDictionary, typographySmallerDictionary, typographyTooltipDictionary, };
63
+ export { typographyDictionary, typographyInfoDictionary, typographyReadingVariationsDictionary, typographyMonoDictionary, typographyReadDictionary, typographySmallerDictionary, typographyTitleDictionary, typographyTooltipDictionary, typographyVariationsDictionary, };