@proximus/lavender-timeline 2.0.0-alpha.63 → 2.0.0-alpha.64

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.
@@ -1,4 +1,5 @@
1
1
  export declare class Timeline extends HTMLElement {
2
+ #private;
2
3
  private template;
3
4
  constructor();
4
5
  static get observedAttributes(): string[];
@@ -1,6 +1,8 @@
1
+ export declare const TIMELINE_ITEM_CONNECTED_EVENT = "px-timeline-item-connected";
1
2
  export declare class TimelineItem extends HTMLElement {
2
3
  private template;
3
4
  constructor();
5
+ connectedCallback(): void;
4
6
  static get observedAttributes(): string[];
5
7
  attributeChangedCallback(attrName: string, oldValue: string, newValue: string): void;
6
8
  updateItem(oldValue: string, newValue: string): void;
package/dist/index.es.js CHANGED
@@ -1,55 +1,14 @@
1
- const s = ".timeline{list-style:none;margin:0;padding:0}", o = new CSSStyleSheet();
2
- o.replaceSync(s);
3
- class d extends HTMLElement {
4
- template() {
5
- return `
6
- <ol class="timeline" role="list">
7
- <slot></slot>
8
- </ol>
9
- `;
10
- }
11
- constructor() {
12
- super(), this.attachShadow({ mode: "open" }), this.shadowRoot.innerHTML = this.template(), this.shadowRoot.adoptedStyleSheets = [o];
13
- }
14
- static get observedAttributes() {
15
- return ["inverted"];
16
- }
17
- connectedCallback() {
18
- this.configureChildren();
19
- }
20
- attributeChangedCallback(t, e, i) {
21
- if (e !== i)
22
- switch (t) {
23
- case "inverted":
24
- for (let a = 0; a < this.$children.length; a++)
25
- this.$children[a].toggleAttribute("inverted");
26
- break;
27
- }
28
- }
29
- configureChildren() {
30
- const t = this.$children[this.$children.length - 1];
31
- t && !t.hasAttribute("lastchild") && t.setAttribute("lastchild", "");
32
- for (let e = 0; e < this.$children.length; e++)
33
- this.$children[e].setAttribute("item", `${e + 1}`);
34
- }
35
- get $el() {
36
- return this.shadowRoot.querySelector(".timeline");
37
- }
38
- get $children() {
39
- return this.querySelectorAll("px-timeline-item");
40
- }
41
- get inverted() {
42
- return this.getAttribute("inverted");
43
- }
44
- set inverted(t) {
45
- this.setAttribute("inverted", t);
46
- }
47
- }
48
- customElements.get("px-timeline") || customElements.define("px-timeline", d);
49
- const c = '.timeline-item{display:flex;gap:var(--px-spacing-default-mobile);font-family:var(--px-font-family);line-height:var(--px-line-height-ratio-l)}.indicator-area{position:relative}.indicator-area:before{display:block;content:"";position:absolute;top:26px;left:12px;width:var(--px-size-border-m);height:calc(100% - 26px);background:var(--px-color-border-main-default)}.indicator-area .indicator{display:flex;align-items:center;justify-content:center;text-align:center;width:26px;height:26px;font-weight:var(--px-font-weight-title);font-size:var(--px-text-size-label-m-mobile);color:var(--px-color-text-neutral-default);border-radius:var(--px-radius-pill);background:var(--px-color-background-container-default-default)}.content-area{display:flex;flex-direction:column;margin-bottom:var(--px-padding-m-mobile);gap:var(--px-spacing-xs-mobile)}.content-area ::slotted([slot="title"]){font-weight:var(--px-font-weight-title);font-size:var(--px-text-size-label-l-mobile);color:var(--px-color-text-neutral-default)}.content-area ::slotted([slot="content"]){font-weight:var(--px-font-weight-body);font-size:var(--px-text-size-body-m-mobile);color:var(--px-color-text-dimmed-default)}:host([lastchild]) .indicator-area:before{display:none}:host([lastchild]) .content-area{margin-bottom:0}:host([inverted]) .indicator-area:before{background:var(--px-color-border-main-inverted)}:host([inverted]) .indicator{color:var(--px-color-text-neutral-inverted);background:var(--px-color-background-container-default-inverted)}:host([inverted]) .content-area ::slotted([slot="title"]){color:var(--px-color-text-neutral-inverted)}:host([inverted]) .content-area ::slotted([slot="content"]){color:var(--px-color-text-dimmed-inverted)}@media only screen and (min-width: 768px){.timeline-item{gap:var(--px-spacing-default-tablet)}.indicator-area .indicator{font-size:var(--px-text-size-label-m-tablet)}.content-area{margin-bottom:var(--px-padding-m-tablet);gap:var(--px-spacing-xs-tablet)}.content-area ::slotted([slot="title"]){font-size:var(--px-text-size-label-l-tablet)}.content-area ::slotted([slot="content"]){font-size:var(--px-text-size-body-m-tablet)}}@media only screen and (min-width: 1025px){.timeline-item{gap:var(--px-spacing-default-laptop)}.indicator-area .indicator{font-size:var(--px-text-size-label-m-laptop)}.content-area{margin-bottom:var(--px-padding-m-laptop)}.content-area ::slotted([slot="title"]){font-size:var(--px-text-size-label-l-laptop)}.content-area ::slotted([slot="content"]){font-size:var(--px-text-size-body-m-laptop)}}@media only screen and (min-width: 90.0625em){.timeline-item{gap:var(--px-spacing-default-desktop)}.indicator-area .indicator{font-size:var(--px-text-size-label-m-desktop)}.content-area{margin-bottom:var(--px-padding-m-desktop)}.content-area ::slotted([slot="title"]){font-size:var(--px-text-size-label-l-desktop)}.content-area ::slotted([slot="content"]){font-size:var(--px-text-size-body-m-desktop)}}', r = new CSSStyleSheet();
50
- r.replaceSync(c);
51
- let n = "1";
52
- class p extends HTMLElement {
1
+ var s = (n) => {
2
+ throw TypeError(n);
3
+ };
4
+ var x = (n, e, t) => e.has(n) || s("Cannot " + t);
5
+ var d = (n, e, t) => e.has(n) ? s("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(n) : e.set(n, t);
6
+ var o = (n, e, t) => (x(n, e, "access private method"), t);
7
+ const v = ".timeline{list-style:none;margin:0;padding:0}", b = '.timeline-item{display:flex;gap:var(--px-spacing-default-mobile);font-family:var(--px-font-family);line-height:var(--px-line-height-ratio-l)}.indicator-area{position:relative}.indicator-area:before{display:block;content:"";position:absolute;top:26px;left:12px;width:var(--px-size-border-m);height:calc(100% - 26px);background:var(--px-color-border-main-default)}.indicator-area .indicator{display:flex;align-items:center;justify-content:center;text-align:center;width:26px;height:26px;font-weight:var(--px-font-weight-title);font-size:var(--px-text-size-label-m-mobile);color:var(--px-color-text-neutral-default);border-radius:var(--px-radius-pill);background:var(--px-color-background-container-default-default)}.content-area{display:flex;flex-direction:column;margin-bottom:var(--px-padding-m-mobile);gap:var(--px-spacing-xs-mobile)}.content-area ::slotted([slot="title"]){font-weight:var(--px-font-weight-title);font-size:var(--px-text-size-label-l-mobile);color:var(--px-color-text-neutral-default)}.content-area ::slotted([slot="content"]){font-weight:var(--px-font-weight-body);font-size:var(--px-text-size-body-m-mobile);color:var(--px-color-text-dimmed-default)}:host([lastchild]) .indicator-area:before{display:none}:host([lastchild]) .content-area{margin-bottom:0}:host([inverted]) .indicator-area:before{background:var(--px-color-border-main-inverted)}:host([inverted]) .indicator{color:var(--px-color-text-neutral-inverted);background:var(--px-color-background-container-default-inverted)}:host([inverted]) .content-area ::slotted([slot="title"]){color:var(--px-color-text-neutral-inverted)}:host([inverted]) .content-area ::slotted([slot="content"]){color:var(--px-color-text-dimmed-inverted)}@media only screen and (min-width: 768px){.timeline-item{gap:var(--px-spacing-default-tablet)}.indicator-area .indicator{font-size:var(--px-text-size-label-m-tablet)}.content-area{margin-bottom:var(--px-padding-m-tablet);gap:var(--px-spacing-xs-tablet)}.content-area ::slotted([slot="title"]){font-size:var(--px-text-size-label-l-tablet)}.content-area ::slotted([slot="content"]){font-size:var(--px-text-size-body-m-tablet)}}@media only screen and (min-width: 1025px){.timeline-item{gap:var(--px-spacing-default-laptop)}.indicator-area .indicator{font-size:var(--px-text-size-label-m-laptop)}.content-area{margin-bottom:var(--px-padding-m-laptop)}.content-area ::slotted([slot="title"]){font-size:var(--px-text-size-label-l-laptop)}.content-area ::slotted([slot="content"]){font-size:var(--px-text-size-body-m-laptop)}}@media only screen and (min-width: 90.0625em){.timeline-item{gap:var(--px-spacing-default-desktop)}.indicator-area .indicator{font-size:var(--px-text-size-label-m-desktop)}.content-area{margin-bottom:var(--px-padding-m-desktop)}.content-area ::slotted([slot="title"]){font-size:var(--px-text-size-label-l-desktop)}.content-area ::slotted([slot="content"]){font-size:var(--px-text-size-body-m-desktop)}}', c = new CSSStyleSheet();
8
+ c.replaceSync(b);
9
+ const p = "px-timeline-item-connected";
10
+ let l = "1";
11
+ class u extends HTMLElement {
53
12
  template() {
54
13
  return `
55
14
  <li class="timeline-item" role="listitem">
@@ -64,25 +23,33 @@ class p extends HTMLElement {
64
23
  `;
65
24
  }
66
25
  constructor() {
67
- super(), this.attachShadow({ mode: "open" }), this.shadowRoot.innerHTML = this.template(), this.shadowRoot.adoptedStyleSheets = [r];
26
+ super(), this.attachShadow({ mode: "open" }), this.shadowRoot.innerHTML = this.template(), this.shadowRoot.adoptedStyleSheets = [c];
27
+ }
28
+ connectedCallback() {
29
+ this.dispatchEvent(
30
+ new CustomEvent(p, {
31
+ bubbles: !0,
32
+ composed: !0
33
+ })
34
+ );
68
35
  }
69
36
  static get observedAttributes() {
70
37
  return ["inverted", "lastchild", "item"];
71
38
  }
72
- attributeChangedCallback(t, e, i) {
73
- if (e !== i)
74
- switch (t) {
39
+ attributeChangedCallback(e, t, i) {
40
+ if (t !== i)
41
+ switch (e) {
75
42
  case "item":
76
- this.updateItem(e, i), this.updateIndicator(n);
43
+ this.updateItem(t, i), this.updateIndicator(l);
77
44
  break;
78
45
  }
79
46
  }
80
- updateItem(t, e) {
81
- t !== null && t !== "" && (n = t), e !== null && e !== "" && (n = e);
47
+ updateItem(e, t) {
48
+ e !== null && e !== "" && (l = e), t !== null && t !== "" && (l = t);
82
49
  }
83
- updateIndicator(t) {
84
- const e = this.$el.querySelector(".indicator");
85
- e.innerHTML = t;
50
+ updateIndicator(e) {
51
+ const t = this.$el.querySelector(".indicator");
52
+ t.innerHTML = e;
86
53
  }
87
54
  get $el() {
88
55
  return this.shadowRoot.querySelector(".timeline-item");
@@ -90,24 +57,82 @@ class p extends HTMLElement {
90
57
  get inverted() {
91
58
  return this.getAttribute("inverted");
92
59
  }
93
- set inverted(t) {
94
- this.setAttribute("inverted", t);
60
+ set inverted(e) {
61
+ this.setAttribute("inverted", e);
95
62
  }
96
63
  get lastchild() {
97
64
  return this.getAttribute("lastchild");
98
65
  }
99
- set lastchild(t) {
100
- this.setAttribute("lastchild", t);
66
+ set lastchild(e) {
67
+ this.setAttribute("lastchild", e);
101
68
  }
102
69
  get item() {
103
70
  return this.getAttribute("item");
104
71
  }
105
- set item(t) {
106
- this.setAttribute("item", t);
72
+ set item(e) {
73
+ this.setAttribute("item", e);
107
74
  }
108
75
  }
109
- customElements.get("px-timeline-item") || customElements.define("px-timeline-item", p);
76
+ customElements.get("px-timeline-item") || customElements.define("px-timeline-item", u);
77
+ const h = new CSSStyleSheet();
78
+ h.replaceSync(v);
79
+ var a, r;
80
+ class g extends HTMLElement {
81
+ constructor() {
82
+ super();
83
+ d(this, a);
84
+ this.attachShadow({ mode: "open" }), this.shadowRoot.innerHTML = this.template(), this.shadowRoot.adoptedStyleSheets = [h];
85
+ }
86
+ template() {
87
+ return `
88
+ <ol class="timeline" role="list">
89
+ <slot></slot>
90
+ </ol>
91
+ `;
92
+ }
93
+ static get observedAttributes() {
94
+ return ["inverted"];
95
+ }
96
+ connectedCallback() {
97
+ this.addEventListener(p, () => {
98
+ this.configureChildren(), o(this, a, r).call(this);
99
+ }), this.configureChildren(), o(this, a, r).call(this);
100
+ }
101
+ attributeChangedCallback(t, i, m) {
102
+ if (i !== m)
103
+ switch (t) {
104
+ case "inverted":
105
+ this.isConnected && o(this, a, r).call(this);
106
+ break;
107
+ }
108
+ }
109
+ configureChildren() {
110
+ const t = this.$children[this.$children.length - 1];
111
+ t && !t.hasAttribute("lastchild") && t.setAttribute("lastchild", "");
112
+ for (let i = 0; i < this.$children.length; i++)
113
+ this.$children[i].setAttribute("item", `${i + 1}`);
114
+ }
115
+ get $el() {
116
+ return this.shadowRoot.querySelector(".timeline");
117
+ }
118
+ get $children() {
119
+ return this.querySelectorAll("px-timeline-item");
120
+ }
121
+ get inverted() {
122
+ return this.getAttribute("inverted");
123
+ }
124
+ set inverted(t) {
125
+ this.setAttribute("inverted", t);
126
+ }
127
+ }
128
+ a = new WeakSet(), r = function() {
129
+ const t = this.hasAttribute("inverted");
130
+ for (let i = 0; i < this.$children.length; i++)
131
+ this.$children[i].toggleAttribute("inverted", t);
132
+ };
133
+ customElements.get("px-timeline") || customElements.define("px-timeline", g);
110
134
  export {
111
- d as Timeline,
112
- p as TimelineItem
135
+ p as TIMELINE_ITEM_CONNECTED_EVENT,
136
+ g as Timeline,
137
+ u as TimelineItem
113
138
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@proximus/lavender-timeline",
3
- "version": "2.0.0-alpha.63",
3
+ "version": "2.0.0-alpha.64",
4
4
  "description": "",
5
5
  "main": "dist/index.es.js",
6
6
  "types": "dist/index.d.ts",