@italia/timeline 1.0.0-alpha.18 → 1.0.0-alpha.19
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.
- package/custom-elements.json +1 -1
- package/dist/src/index.js +1 -1
- package/dist/src/it-timeline-element.js +3 -3
- package/dist/src/it-timeline-point.d.ts.map +1 -1
- package/dist/src/it-timeline-point.js +46 -69
- package/dist/src/it-timeline-point.js.map +1 -1
- package/dist/src/it-timeline.js +4 -6
- package/dist/src/it-timeline.js.map +1 -1
- package/package.json +2 -2
package/custom-elements.json
CHANGED
|
@@ -635,7 +635,7 @@
|
|
|
635
635
|
"type": {
|
|
636
636
|
"text": "Story"
|
|
637
637
|
},
|
|
638
|
-
"default": "{ name: 'Timeline classica', parameters: { docs: { description: { story: 'Il componente timeline classica mostra eventi passati, presenti e futuri lungo un asse verticale (mobile) o centrale (desktop). Il pin ha tre varianti di colore: `past` (blu scuro, passato), `current` (azzurro, presente) e senza classe (bianco, futuro).', }, }, }, render: () => html` <it-timeline> <it-timeline-element variant=\"past\" date=\"MAGGIO 2026\" heading-level=\"h3\"> <it-icon slot=\"pin-icon\" name=\"it-file\"></it-icon> <it-card> <a slot=\"title\" href=\"#\">Titolo del contenuto</a> <figure slot=\"image\" class=\"figure img-full\"> <img src=\"https://picsum.photos/seed/city/800/600\" alt=\"Breve descrizione immagine se ha senso nel contesto, marcare altrimenti come decorativa lasciando l'alt applicato ma vuoto.\" /> </figure> <span slot=\"text\"> Questo è un testo breve che riassume il contenuto della pagina di destinazione in massimo tre o quattro righe, senza troncamento. </span> <time slot=\"footer\" class=\"it-card-date\" datetime=\"2026-04-22\">22 aprile 2026</time> </it-card> </it-timeline-element> <it-timeline-element variant=\"past\" date=\"GIUGNO 2026\" heading-level=\"h3\"> <it-icon slot=\"pin-icon\" name=\"it-calendar\"></it-icon> <it-card> <a slot=\"title\" href=\"#\">Titolo del contenuto</a> <span slot=\"text\"> Questo è un testo breve che riassume il contenuto della pagina di destinazione in massimo tre o quattro righe, senza troncamento. </span> <time slot=\"footer\" class=\"it-card-date\" datetime=\"2026-04-22\">22 aprile 2026</time> </it-card> </it-timeline-element> <it-timeline-element variant=\"current\" date=\"LUGLIO 2026\" heading-level=\"h3\"> <it-icon slot=\"pin-icon\" name=\"it-check-circle\"></it-icon> <it-card> <a slot=\"title\" href=\"#\">Titolo del contenuto</a> <span slot=\"text\"> Questo è un testo breve che riassume il contenuto della pagina di destinazione in massimo tre o quattro righe, senza troncamento. </span> <time slot=\"footer\" class=\"it-card-date\" datetime=\"2026-04-22\">22 aprile 2026</time> </it-card> </it-timeline-element> <it-timeline-element variant=\"current\" date=\"LUGLIO 2026\" heading-level=\"h3\"> <it-icon slot=\"pin-icon\" name=\"it-check-circle\"></it-icon> <it-card> <a slot=\"title\" href=\"#\">Titolo del contenuto</a> <span slot=\"text\"> Questo è un testo breve che riassume il contenuto della pagina di destinazione in massimo tre o quattro righe, senza troncamento. </span> <time slot=\"footer\" class=\"it-card-date\" datetime=\"2026-04-22\">22 aprile 2026</time> </it-card> </it-timeline-element> <it-timeline-element date=\"AGOSTO 2026\" heading-level=\"h3\"> <it-icon slot=\"pin-icon\" name=\"it-star-outline\"></it-icon> <it-card> <a slot=\"title\" href=\"#\">Titolo del contenuto</a> <span slot=\"text\"> Questo è un testo breve che riassume il contenuto della pagina di destinazione in massimo tre o quattro righe, senza troncamento. </span> <time slot=\"footer\" class=\"it-card-date\" datetime=\"2026-04-22\">22 aprile 2026</time> </it-card> </it-timeline-element> </it-timeline> `, }"
|
|
638
|
+
"default": "{ name: 'Timeline classica', parameters: { docs: { description: { story: 'Il componente timeline classica mostra eventi passati, presenti e futuri lungo un asse verticale (mobile) o centrale (desktop). Il pin ha tre varianti di colore: `past` (blu scuro, passato), `current` (azzurro, presente) e senza classe (bianco, futuro).', }, }, }, render: () => html` <it-timeline> <it-timeline-element variant=\"past\" date=\"MAGGIO 2026\" heading-level=\"h3\"> <it-icon slot=\"pin-icon\" name=\"it-file\"></it-icon> <it-card heading-level=\"h4\"> <a slot=\"title\" href=\"#\">Titolo del contenuto</a> <figure slot=\"image\" class=\"figure img-full\"> <img src=\"https://picsum.photos/seed/city/800/600\" alt=\"Breve descrizione immagine se ha senso nel contesto, marcare altrimenti come decorativa lasciando l'alt applicato ma vuoto.\" /> </figure> <span slot=\"text\"> Questo è un testo breve che riassume il contenuto della pagina di destinazione in massimo tre o quattro righe, senza troncamento. </span> <time slot=\"footer\" class=\"it-card-date\" datetime=\"2026-04-22\">22 aprile 2026</time> </it-card> </it-timeline-element> <it-timeline-element variant=\"past\" date=\"GIUGNO 2026\" heading-level=\"h3\"> <it-icon slot=\"pin-icon\" name=\"it-calendar\"></it-icon> <it-card heading-level=\"h4\"> <a slot=\"title\" href=\"#\">Titolo del contenuto</a> <span slot=\"text\"> Questo è un testo breve che riassume il contenuto della pagina di destinazione in massimo tre o quattro righe, senza troncamento. </span> <time slot=\"footer\" class=\"it-card-date\" datetime=\"2026-04-22\">22 aprile 2026</time> </it-card> </it-timeline-element> <it-timeline-element variant=\"current\" date=\"LUGLIO 2026\" heading-level=\"h3\"> <it-icon slot=\"pin-icon\" name=\"it-check-circle\"></it-icon> <it-card heading-level=\"h4\"> <a slot=\"title\" href=\"#\">Titolo del contenuto</a> <span slot=\"text\"> Questo è un testo breve che riassume il contenuto della pagina di destinazione in massimo tre o quattro righe, senza troncamento. </span> <time slot=\"footer\" class=\"it-card-date\" datetime=\"2026-04-22\">22 aprile 2026</time> </it-card> </it-timeline-element> <it-timeline-element variant=\"current\" date=\"LUGLIO 2026\" heading-level=\"h3\"> <it-icon slot=\"pin-icon\" name=\"it-check-circle\"></it-icon> <it-card heading-level=\"h4\"> <a slot=\"title\" href=\"#\">Titolo del contenuto</a> <span slot=\"text\"> Questo è un testo breve che riassume il contenuto della pagina di destinazione in massimo tre o quattro righe, senza troncamento. </span> <time slot=\"footer\" class=\"it-card-date\" datetime=\"2026-04-22\">22 aprile 2026</time> </it-card> </it-timeline-element> <it-timeline-element date=\"AGOSTO 2026\" heading-level=\"h3\"> <it-icon slot=\"pin-icon\" name=\"it-star-outline\"></it-icon> <it-card heading-level=\"h4\"> <a slot=\"title\" href=\"#\">Titolo del contenuto</a> <span slot=\"text\"> Questo è un testo breve che riassume il contenuto della pagina di destinazione in massimo tre o quattro righe, senza troncamento. </span> <time slot=\"footer\" class=\"it-card-date\" datetime=\"2026-04-22\">22 aprile 2026</time> </it-card> </it-timeline-element> </it-timeline> `, }"
|
|
639
639
|
},
|
|
640
640
|
{
|
|
641
641
|
"kind": "variable",
|
package/dist/src/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export { ItTimeline } from './it-timeline.js';
|
|
2
2
|
export { ItTimelineElement } from './it-timeline-element.js';
|
|
3
3
|
export { ItTimelinePoint } from './it-timeline-point.js';
|
|
4
|
-
export { T as TIMELINE_ELEMENT_DARK_VARIANTS, a as TIMELINE_ELEMENT_VARIANTS, b as TIMELINE_HEADING_LEVELS, c as TIMELINE_POINT_COLORS, d as TIMELINE_POINT_LIST_TAGS, e as TIMELINE_VARIANTS } from '../types-
|
|
4
|
+
export { T as TIMELINE_ELEMENT_DARK_VARIANTS, a as TIMELINE_ELEMENT_VARIANTS, b as TIMELINE_HEADING_LEVELS, c as TIMELINE_POINT_COLORS, d as TIMELINE_POINT_LIST_TAGS, e as TIMELINE_VARIANTS } from '../types-BINffz1b.js';
|
|
5
5
|
import 'lit';
|
|
6
6
|
import 'lit/decorators.js';
|
|
7
7
|
import 'lit/static-html.js';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { _ as __decorate, f as __metadata, B as BaseComponent, b as TIMELINE_HEADING_LEVELS, a as TIMELINE_ELEMENT_VARIANTS, T as TIMELINE_ELEMENT_DARK_VARIANTS } from '../types-
|
|
1
|
+
import { _ as __decorate, f as __metadata, B as BaseComponent, b as TIMELINE_HEADING_LEVELS, a as TIMELINE_ELEMENT_VARIANTS, T as TIMELINE_ELEMENT_DARK_VARIANTS } from '../types-BINffz1b.js';
|
|
2
2
|
import { css, nothing, html } from 'lit';
|
|
3
3
|
import { property, customElement } from 'lit/decorators.js';
|
|
4
4
|
import { unsafeStatic, html as html$1 } from 'lit/static-html.js';
|
|
@@ -1996,10 +1996,10 @@ blockquote.blockquote-card.dark .blockquote-footer,
|
|
|
1996
1996
|
height: 24px;
|
|
1997
1997
|
}
|
|
1998
1998
|
.it-pin-wrapper .pin-text {
|
|
1999
|
-
border-radius:
|
|
1999
|
+
border-radius: 40px;
|
|
2000
2000
|
background: var(--bsi-color-background-primary-deep);
|
|
2001
2001
|
color: var(--bsi-color-white, #fff);
|
|
2002
|
-
font-family:
|
|
2002
|
+
font-family: var(--bsi-font-mono);
|
|
2003
2003
|
font-size: var(--bsi-body-font-size);
|
|
2004
2004
|
font-weight: 600;
|
|
2005
2005
|
line-height: var(--bsi-body-leading);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"it-timeline-point.d.ts","sourceRoot":"","sources":["../../src/it-timeline-point.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAQ,cAAc,EAAE,MAAM,KAAK,CAAC;AAE3C,OAAO,EAAyB,KAAK,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAG5E;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0CG;AACH,qBACa,eAAgB,SAAQ,aAAa;IAChD,MAAM,CAAC,MAAM,+BAAU;IAGvB,KAAK,EAAE,kBAAkB,CAAa;IAGtC,QAAQ,UAAS;IAGjB,OAAO,UAAS;IAEhB;;;OAGG;IACH,iBAAiB,UAAS;IAE1B;;;OAGG;IACH,mBAAmB,UAAS;IAEnB,iBAAiB;cAeP,OAAO,CAAC,kBAAkB,EAAE,cAAc,GAAG,IAAI;IAmBpE,SAAS,CAAC,QAAQ,IAAI,kBAAkB;IAIxC;;;;;OAKG;IACH,OAAO,CAAC,qBAAqB;IAO7B;;;;OAIG;IACH,OAAO,CAAC,4BAA4B;IAMpC,OAAO,CAAC,kBAAkB;IAKjB,MAAM;
|
|
1
|
+
{"version":3,"file":"it-timeline-point.d.ts","sourceRoot":"","sources":["../../src/it-timeline-point.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAQ,cAAc,EAAE,MAAM,KAAK,CAAC;AAE3C,OAAO,EAAyB,KAAK,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAG5E;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0CG;AACH,qBACa,eAAgB,SAAQ,aAAa;IAChD,MAAM,CAAC,MAAM,+BAAU;IAGvB,KAAK,EAAE,kBAAkB,CAAa;IAGtC,QAAQ,UAAS;IAGjB,OAAO,UAAS;IAEhB;;;OAGG;IACH,iBAAiB,UAAS;IAE1B;;;OAGG;IACH,mBAAmB,UAAS;IAEnB,iBAAiB;cAeP,OAAO,CAAC,kBAAkB,EAAE,cAAc,GAAG,IAAI;IAmBpE,SAAS,CAAC,QAAQ,IAAI,kBAAkB;IAIxC;;;;;OAKG;IACH,OAAO,CAAC,qBAAqB;IAO7B;;;;OAIG;IACH,OAAO,CAAC,4BAA4B;IAMpC,OAAO,CAAC,kBAAkB;IAKjB,MAAM;CAWhB;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,mBAAmB,EAAE,eAAe,CAAC;KACtC;CACF"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { _ as __decorate, f as __metadata, B as BaseComponent, c as TIMELINE_POINT_COLORS } from '../types-
|
|
1
|
+
import { _ as __decorate, f as __metadata, B as BaseComponent, c as TIMELINE_POINT_COLORS } from '../types-BINffz1b.js';
|
|
2
2
|
import { css, html } from 'lit';
|
|
3
3
|
import { property, customElement } from 'lit/decorators.js';
|
|
4
4
|
import 'lit/directive.js';
|
|
@@ -12,107 +12,96 @@ var styles = css`*,
|
|
|
12
12
|
}
|
|
13
13
|
|
|
14
14
|
:host {
|
|
15
|
-
|
|
15
|
+
position: relative;
|
|
16
|
+
display: flex;
|
|
17
|
+
flex-wrap: var(--it-timeline-point-content-flex-wrap, nowrap);
|
|
18
|
+
align-items: center;
|
|
19
|
+
margin-bottom: var(--it-timeline-point-margin-bottom, 24px);
|
|
16
20
|
font-family: "Titillium Web", "Titillium Sans Pro", Geneva, Tahoma, sans-serif;
|
|
17
21
|
font-size: var(--bsi-body-font-size);
|
|
18
22
|
line-height: var(--bsi-body-leading);
|
|
23
|
+
list-style: none;
|
|
24
|
+
}
|
|
25
|
+
:host::before {
|
|
26
|
+
position: absolute;
|
|
27
|
+
z-index: 1;
|
|
28
|
+
top: var(--it-timeline-point-stack-mobile-after-top, 0);
|
|
29
|
+
left: 2rem;
|
|
30
|
+
width: 2px;
|
|
31
|
+
height: calc(100% + 24px);
|
|
32
|
+
background-color: var(--point-color, var(--bsi-color-text-primary));
|
|
33
|
+
content: var(--it-timeline-point-stack-mobile-after-content, none);
|
|
19
34
|
}
|
|
20
35
|
|
|
21
|
-
|
|
22
|
-
.timeline-point-primary {
|
|
36
|
+
:host([color=primary]) {
|
|
23
37
|
--point-color: var(--bsi-color-text-primary);
|
|
24
38
|
}
|
|
25
39
|
|
|
26
|
-
|
|
27
|
-
.timeline-point-secondary {
|
|
40
|
+
:host([color=secondary]) {
|
|
28
41
|
--point-color: var(--bsi-color-text-secondary);
|
|
29
42
|
}
|
|
30
43
|
|
|
31
|
-
|
|
32
|
-
.timeline-point-success {
|
|
44
|
+
:host([color=success]) {
|
|
33
45
|
--point-color: var(--bsi-color-text-success);
|
|
34
46
|
}
|
|
35
47
|
|
|
36
|
-
|
|
37
|
-
.timeline-point-info {
|
|
48
|
+
:host([color=info]) {
|
|
38
49
|
--point-color: var(--bsi-color-text-info);
|
|
39
50
|
}
|
|
40
51
|
|
|
41
|
-
|
|
42
|
-
.timeline-point-warning {
|
|
52
|
+
:host([color=warning]) {
|
|
43
53
|
--point-color: var(--bsi-color-text-warning);
|
|
44
54
|
}
|
|
45
55
|
|
|
46
|
-
|
|
47
|
-
.timeline-point-danger {
|
|
56
|
+
:host([color=danger]) {
|
|
48
57
|
--point-color: var(--bsi-color-text-danger);
|
|
49
58
|
}
|
|
50
59
|
|
|
51
|
-
|
|
52
|
-
.timeline-point-light {
|
|
60
|
+
:host([color=light]) {
|
|
53
61
|
--point-color: var(--bsi-color-text-light);
|
|
54
62
|
}
|
|
55
63
|
|
|
56
|
-
|
|
57
|
-
.timeline-point-dark {
|
|
64
|
+
:host([color=dark]) {
|
|
58
65
|
--point-color: var(--bsi-color-text-dark);
|
|
59
66
|
}
|
|
60
67
|
|
|
61
|
-
|
|
62
|
-
.timeline-point-black {
|
|
68
|
+
:host([color=black]) {
|
|
63
69
|
--point-color: var(--bsi-color-text-black);
|
|
64
70
|
}
|
|
65
71
|
|
|
66
|
-
|
|
67
|
-
.timeline-point-white {
|
|
72
|
+
:host([color=white]) {
|
|
68
73
|
--point-color: var(--bsi-color-text-white);
|
|
69
74
|
}
|
|
70
75
|
|
|
71
|
-
|
|
72
|
-
position: relative;
|
|
73
|
-
display: flex;
|
|
74
|
-
flex-wrap: var(--it-timeline-point-content-flex-wrap, nowrap);
|
|
75
|
-
align-items: center;
|
|
76
|
-
margin-bottom: var(--it-timeline-point-margin-bottom, 24px);
|
|
77
|
-
}
|
|
78
|
-
.timeline-point::before {
|
|
79
|
-
position: absolute;
|
|
80
|
-
z-index: 1;
|
|
81
|
-
top: var(--it-timeline-point-stack-mobile-after-top, 0);
|
|
82
|
-
left: 2rem;
|
|
83
|
-
width: 2px;
|
|
84
|
-
height: calc(100% + 24px);
|
|
85
|
-
background-color: var(--point-color, var(--bsi-color-text-primary));
|
|
86
|
-
content: var(--it-timeline-point-stack-mobile-after-content, none);
|
|
87
|
-
}
|
|
88
|
-
.timeline-point.timeline-point-align-top {
|
|
76
|
+
:host([align-top]) {
|
|
89
77
|
align-items: flex-start;
|
|
90
78
|
}
|
|
91
|
-
|
|
79
|
+
:host([align-top]) .point-aside {
|
|
92
80
|
align-self: stretch;
|
|
93
81
|
justify-content: flex-start;
|
|
94
82
|
padding-top: 0.5rem;
|
|
95
83
|
}
|
|
96
|
-
|
|
84
|
+
:host([align-top]) .point-aside::after {
|
|
97
85
|
top: 2.6rem;
|
|
98
86
|
transform: translateY(-5px);
|
|
99
87
|
}
|
|
100
|
-
|
|
88
|
+
|
|
89
|
+
:host([compact]) .point-aside {
|
|
101
90
|
width: 3.5rem;
|
|
102
91
|
padding: 0.5rem 0.75rem 0.5rem 0;
|
|
103
92
|
}
|
|
104
93
|
@media (max-width: 767.98px) {
|
|
105
|
-
|
|
94
|
+
:host([compact]) .point-aside {
|
|
106
95
|
width: 3rem;
|
|
107
96
|
padding: 0.5rem 0.5rem 0.5rem 0;
|
|
108
97
|
}
|
|
109
98
|
}
|
|
110
99
|
|
|
111
|
-
:host([has-point-top]
|
|
100
|
+
:host([has-point-top][align-top]) .point-aside::after {
|
|
112
101
|
top: 3.5rem;
|
|
113
102
|
}
|
|
114
103
|
@media (max-width: 767.98px) {
|
|
115
|
-
:host([has-point-top]
|
|
104
|
+
:host([has-point-top][align-top]) .point-aside::after {
|
|
116
105
|
top: 2.7rem;
|
|
117
106
|
}
|
|
118
107
|
}
|
|
@@ -163,27 +152,27 @@ var styles = css`*,
|
|
|
163
152
|
}
|
|
164
153
|
|
|
165
154
|
@media (max-width: 767.98px) {
|
|
166
|
-
:host([stack-mobile]) .
|
|
155
|
+
:host([stack-mobile]) .point-aside {
|
|
167
156
|
width: auto;
|
|
168
157
|
flex-direction: row-reverse;
|
|
169
158
|
padding-right: 0.5rem;
|
|
170
159
|
padding-left: 2.5rem;
|
|
171
160
|
}
|
|
172
|
-
:host([stack-mobile]) .
|
|
161
|
+
:host([stack-mobile]) .point-aside::before {
|
|
173
162
|
display: none;
|
|
174
163
|
}
|
|
175
|
-
:host([stack-mobile]) .
|
|
164
|
+
:host([stack-mobile]) .point-aside::after {
|
|
176
165
|
top: 50%;
|
|
177
166
|
right: auto;
|
|
178
167
|
left: 1.75rem;
|
|
179
168
|
transform: translateY(-50%);
|
|
180
169
|
}
|
|
181
|
-
:host([stack-mobile]) .
|
|
170
|
+
:host([stack-mobile]) .point-content {
|
|
182
171
|
flex: 1 1 100%;
|
|
183
172
|
margin-top: 16px;
|
|
184
173
|
margin-left: 0;
|
|
185
174
|
}
|
|
186
|
-
:host([stack-mobile]
|
|
175
|
+
:host([stack-mobile][align-top]) .point-aside::after {
|
|
187
176
|
top: 2.6rem;
|
|
188
177
|
right: auto;
|
|
189
178
|
left: 1.75rem;
|
|
@@ -209,10 +198,6 @@ var styles = css`*,
|
|
|
209
198
|
|
|
210
199
|
::slotted([slot=content]) *:last-child {
|
|
211
200
|
margin-bottom: 0 !important;
|
|
212
|
-
}
|
|
213
|
-
|
|
214
|
-
.it-timeline-point-list .timeline-point .point-content > *:last-child {
|
|
215
|
-
margin-bottom: 0;
|
|
216
201
|
}`;
|
|
217
202
|
|
|
218
203
|
/**
|
|
@@ -335,21 +320,13 @@ let ItTimelinePoint = class ItTimelinePoint extends BaseComponent {
|
|
|
335
320
|
this._updatePointVisualAriaHidden();
|
|
336
321
|
}
|
|
337
322
|
render() {
|
|
338
|
-
const itemClasses = this.composeClass('timeline-point', {
|
|
339
|
-
'timeline-point-align-top': this.alignTop,
|
|
340
|
-
'timeline-point-xs': this.compact,
|
|
341
|
-
[`timeline-point-${this.getColor()}`]: true,
|
|
342
|
-
});
|
|
343
|
-
const asideClasses = this.composeClass('point-aside', `point-aside-${this.getColor()}`);
|
|
344
323
|
return html `
|
|
345
|
-
<div class="
|
|
346
|
-
<
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
<
|
|
351
|
-
<slot name="content"></slot>
|
|
352
|
-
</div>
|
|
324
|
+
<div class="point-aside">
|
|
325
|
+
<slot name="date" @slotchange=${this._onAsideSlotChange}></slot>
|
|
326
|
+
<slot name="milestone" @slotchange=${this._onAsideSlotChange}></slot>
|
|
327
|
+
</div>
|
|
328
|
+
<div class="point-content">
|
|
329
|
+
<slot name="content"></slot>
|
|
353
330
|
</div>
|
|
354
331
|
`;
|
|
355
332
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"it-timeline-point.js","sources":["../../../src/it-timeline-point.ts"],"sourcesContent":["import { BaseComponent } from '@italia/globals';\nimport { html, PropertyValues } from 'lit';\nimport { customElement, property } from 'lit/decorators.js';\nimport { TIMELINE_POINT_COLORS, type TimelinePointColor } from './types.js';\nimport styles from './timeline-point.scss';\n\n/**\n * Singolo punto della timeline point list di Bootstrap Italia.\n *\n * Usa **shadow DOM** con slot reali.\n *\n * @slot date - Contenuto laterale per date: usa `<time datetime=\"...\">`.\n * Al suo interno puoi usare `<span class=\"point-visual\">`, `<span class=\"point-top\">`,\n * `<span class=\"point-main\">`, `<span class=\"point-bottom\">`.\n * @slot milestone - Contenuto laterale alternativo per milestone/step.\n * @slot content - Contenuto principale del punto.\n *\n * @attr {string} color - Colore: `primary` (default), `secondary`, `success`, `danger`, `warning`, `info`, `light`, `dark`.\n * @attr {boolean} align-top - Fissa verticalmente il punto all'inizio del contenuto.\n * @attr {boolean} compact - Sezione laterale più compatta.\n *\n * @example Date con giorno e mese\n * ```html\n * <it-timeline-point>\n * <time slot=\"date\" datetime=\"2025-10-14\">\n * <span class=\"point-visual\" aria-hidden=\"true\">\n * <span class=\"point-main\">14</span>\n * <span class=\"point-bottom\">ott</span>\n * </span>\n * </time>\n * <p slot=\"content\">Lorem ipsum dolor sit amet.</p>\n * </it-timeline-point>\n * ```\n *\n * @example Milestone con icona\n * ```html\n * <it-timeline-point color=\"success\">\n * <div slot=\"milestone\">\n * <span class=\"visually-hidden\">Milestone completata</span>\n * <span class=\"point-visual\" aria-hidden=\"true\">\n * <span class=\"point-main\">\n * <it-icon name=\"it-check-circle\" aria-hidden=\"true\"></it-icon>\n * </span>\n * </span>\n * </div>\n * <p slot=\"content\">Lorem ipsum dolor sit amet.</p>\n * </it-timeline-point>\n * ```\n */\n@customElement('it-timeline-point')\nexport class ItTimelinePoint extends BaseComponent {\n static styles = styles;\n\n @property({ type: String, reflect: true })\n color: TimelinePointColor = 'primary';\n\n @property({ type: Boolean, attribute: 'align-top', reflect: true })\n alignTop = false;\n\n @property({ type: Boolean, reflect: true })\n compact = false;\n\n /**\n * `true` se l'utente ha impostato esplicitamente l'attributo `color` in HTML.\n * Usato da `<it-timeline>` per decidere se propagare il colore del contenitore.\n */\n _hasExplicitColor = false;\n\n /**\n * `true` se l'utente ha impostato esplicitamente l'attributo `compact` in HTML.\n * Usato da `<it-timeline>` per decidere se propagare il compact del contenitore.\n */\n _hasExplicitCompact = false;\n\n override connectedCallback() {\n if (!this.hasAttribute('role')) {\n this.setAttribute('role', 'listitem');\n }\n // Detect explicit color BEFORE Lit reflects the default value\n this._hasExplicitColor = this.hasAttribute('color');\n this._hasExplicitCompact = this.hasAttribute('compact');\n // Get all icons slotted in slot pin-icon and set their size to \"sm\" (BSI default for timeline icons)\n const icons = document.querySelectorAll('it-icon');\n icons.forEach((icon) => {\n icon.setAttribute('size', 'sm');\n });\n super.connectedCallback?.();\n }\n\n protected override updated(_changedProperties: PropertyValues): void {\n super.updated(_changedProperties);\n\n if (this.color && !TIMELINE_POINT_COLORS.includes(this.color)) {\n this.logger.warn(\n `Invalid color value, falling back to \"primary\". Expected one of: ${TIMELINE_POINT_COLORS.join(', ')}`,\n );\n } else {\n // Recupera eventuali icone figlie slottate e aggiorna il loro colore per riflettere il colore di questo elemento\n const color = this.getColor();\n const icons = this.querySelectorAll('it-icon');\n icons.forEach((icon) => {\n if (icon.getAttribute('color') === 'inherit' || !icon.hasAttribute('color')) {\n icon.setAttribute('color', color);\n }\n });\n }\n }\n\n protected getColor(): TimelinePointColor {\n return TIMELINE_POINT_COLORS.includes(this.color) ? this.color : 'primary';\n }\n\n /**\n * Inspect the light DOM inside the slotted date/milestone elements and\n * set boolean host attributes `has-point-top` / `has-point-bottom` so that\n * shadow-DOM CSS can use reliable attribute selectors instead of the\n * browser-inconsistent `:host(:has(.point-top))` slotted-descendant form.\n */\n private _updatePointSpanAttrs() {\n const hasTop = !!this.querySelector('.point-top, .point-year');\n const hasBottom = !!this.querySelector('.point-bottom, .point-month');\n this.toggleAttribute('has-point-top', hasTop);\n this.toggleAttribute('has-point-bottom', hasBottom);\n }\n\n /**\n * Ensure every `.point-visual` element inside slotted content carries\n * `aria-hidden=\"true\"` automatically — the accessible label should come\n * from a sibling `<span class=\"visually-hidden\">`.\n */\n private _updatePointVisualAriaHidden() {\n this.querySelectorAll<HTMLElement>('.point-visual').forEach((el) => {\n el.setAttribute('aria-hidden', 'true');\n });\n }\n\n private _onAsideSlotChange() {\n this._updatePointSpanAttrs();\n this._updatePointVisualAriaHidden();\n }\n\n override render() {\n
|
|
1
|
+
{"version":3,"file":"it-timeline-point.js","sources":["../../../src/it-timeline-point.ts"],"sourcesContent":["import { BaseComponent } from '@italia/globals';\nimport { html, PropertyValues } from 'lit';\nimport { customElement, property } from 'lit/decorators.js';\nimport { TIMELINE_POINT_COLORS, type TimelinePointColor } from './types.js';\nimport styles from './timeline-point.scss';\n\n/**\n * Singolo punto della timeline point list di Bootstrap Italia.\n *\n * Usa **shadow DOM** con slot reali.\n *\n * @slot date - Contenuto laterale per date: usa `<time datetime=\"...\">`.\n * Al suo interno puoi usare `<span class=\"point-visual\">`, `<span class=\"point-top\">`,\n * `<span class=\"point-main\">`, `<span class=\"point-bottom\">`.\n * @slot milestone - Contenuto laterale alternativo per milestone/step.\n * @slot content - Contenuto principale del punto.\n *\n * @attr {string} color - Colore: `primary` (default), `secondary`, `success`, `danger`, `warning`, `info`, `light`, `dark`.\n * @attr {boolean} align-top - Fissa verticalmente il punto all'inizio del contenuto.\n * @attr {boolean} compact - Sezione laterale più compatta.\n *\n * @example Date con giorno e mese\n * ```html\n * <it-timeline-point>\n * <time slot=\"date\" datetime=\"2025-10-14\">\n * <span class=\"point-visual\" aria-hidden=\"true\">\n * <span class=\"point-main\">14</span>\n * <span class=\"point-bottom\">ott</span>\n * </span>\n * </time>\n * <p slot=\"content\">Lorem ipsum dolor sit amet.</p>\n * </it-timeline-point>\n * ```\n *\n * @example Milestone con icona\n * ```html\n * <it-timeline-point color=\"success\">\n * <div slot=\"milestone\">\n * <span class=\"visually-hidden\">Milestone completata</span>\n * <span class=\"point-visual\" aria-hidden=\"true\">\n * <span class=\"point-main\">\n * <it-icon name=\"it-check-circle\" aria-hidden=\"true\"></it-icon>\n * </span>\n * </span>\n * </div>\n * <p slot=\"content\">Lorem ipsum dolor sit amet.</p>\n * </it-timeline-point>\n * ```\n */\n@customElement('it-timeline-point')\nexport class ItTimelinePoint extends BaseComponent {\n static styles = styles;\n\n @property({ type: String, reflect: true })\n color: TimelinePointColor = 'primary';\n\n @property({ type: Boolean, attribute: 'align-top', reflect: true })\n alignTop = false;\n\n @property({ type: Boolean, reflect: true })\n compact = false;\n\n /**\n * `true` se l'utente ha impostato esplicitamente l'attributo `color` in HTML.\n * Usato da `<it-timeline>` per decidere se propagare il colore del contenitore.\n */\n _hasExplicitColor = false;\n\n /**\n * `true` se l'utente ha impostato esplicitamente l'attributo `compact` in HTML.\n * Usato da `<it-timeline>` per decidere se propagare il compact del contenitore.\n */\n _hasExplicitCompact = false;\n\n override connectedCallback() {\n if (!this.hasAttribute('role')) {\n this.setAttribute('role', 'listitem');\n }\n // Detect explicit color BEFORE Lit reflects the default value\n this._hasExplicitColor = this.hasAttribute('color');\n this._hasExplicitCompact = this.hasAttribute('compact');\n // Get all icons slotted in slot pin-icon and set their size to \"sm\" (BSI default for timeline icons)\n const icons = document.querySelectorAll('it-icon');\n icons.forEach((icon) => {\n icon.setAttribute('size', 'sm');\n });\n super.connectedCallback?.();\n }\n\n protected override updated(_changedProperties: PropertyValues): void {\n super.updated(_changedProperties);\n\n if (this.color && !TIMELINE_POINT_COLORS.includes(this.color)) {\n this.logger.warn(\n `Invalid color value, falling back to \"primary\". Expected one of: ${TIMELINE_POINT_COLORS.join(', ')}`,\n );\n } else {\n // Recupera eventuali icone figlie slottate e aggiorna il loro colore per riflettere il colore di questo elemento\n const color = this.getColor();\n const icons = this.querySelectorAll('it-icon');\n icons.forEach((icon) => {\n if (icon.getAttribute('color') === 'inherit' || !icon.hasAttribute('color')) {\n icon.setAttribute('color', color);\n }\n });\n }\n }\n\n protected getColor(): TimelinePointColor {\n return TIMELINE_POINT_COLORS.includes(this.color) ? this.color : 'primary';\n }\n\n /**\n * Inspect the light DOM inside the slotted date/milestone elements and\n * set boolean host attributes `has-point-top` / `has-point-bottom` so that\n * shadow-DOM CSS can use reliable attribute selectors instead of the\n * browser-inconsistent `:host(:has(.point-top))` slotted-descendant form.\n */\n private _updatePointSpanAttrs() {\n const hasTop = !!this.querySelector('.point-top, .point-year');\n const hasBottom = !!this.querySelector('.point-bottom, .point-month');\n this.toggleAttribute('has-point-top', hasTop);\n this.toggleAttribute('has-point-bottom', hasBottom);\n }\n\n /**\n * Ensure every `.point-visual` element inside slotted content carries\n * `aria-hidden=\"true\"` automatically — the accessible label should come\n * from a sibling `<span class=\"visually-hidden\">`.\n */\n private _updatePointVisualAriaHidden() {\n this.querySelectorAll<HTMLElement>('.point-visual').forEach((el) => {\n el.setAttribute('aria-hidden', 'true');\n });\n }\n\n private _onAsideSlotChange() {\n this._updatePointSpanAttrs();\n this._updatePointVisualAriaHidden();\n }\n\n override render() {\n return html`\n <div class=\"point-aside\">\n <slot name=\"date\" @slotchange=${this._onAsideSlotChange}></slot>\n <slot name=\"milestone\" @slotchange=${this._onAsideSlotChange}></slot>\n </div>\n <div class=\"point-content\">\n <slot name=\"content\"></slot>\n </div>\n `;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'it-timeline-point': ItTimelinePoint;\n }\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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;IAEQ,kBAAkB,GAAA;QACxB,IAAI,CAAC,qBAAqB,EAAE;QAC5B,IAAI,CAAC,4BAA4B,EAAE;IACrC;IAES,MAAM,GAAA;AACb,QAAA,OAAO,IAAI,CAAA;;AAEyB,sCAAA,EAAA,IAAI,CAAC,kBAAkB,CAAA;AAClB,2CAAA,EAAA,IAAI,CAAC,kBAAkB,CAAA;;;;;KAK/D;IACH;;AApGO,eAAA,CAAA,MAAM,GAAG,MAAH;AAGb,UAAA,CAAA;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;;AACJ,CAAA,EAAA,eAAA,CAAA,SAAA,EAAA,OAAA,EAAA,MAAA,CAAA;AAGtC,UAAA,CAAA;AADC,IAAA,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,SAAS,EAAE,WAAW,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;;AAClD,CAAA,EAAA,eAAA,CAAA,SAAA,EAAA,UAAA,EAAA,MAAA,CAAA;AAGjB,UAAA,CAAA;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;;AAC3B,CAAA,EAAA,eAAA,CAAA,SAAA,EAAA,SAAA,EAAA,MAAA,CAAA;AAVL,eAAe,GAAA,UAAA,CAAA;IAD3B,aAAa,CAAC,mBAAmB;AACrB,CAAA,EAAA,eAAe,CAsG3B;;;;"}
|
package/dist/src/it-timeline.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { _ as __decorate, f as __metadata, B as BaseComponent, c as TIMELINE_POINT_COLORS, e as TIMELINE_VARIANTS, d as TIMELINE_POINT_LIST_TAGS } from '../types-
|
|
1
|
+
import { _ as __decorate, f as __metadata, B as BaseComponent, c as TIMELINE_POINT_COLORS, e as TIMELINE_VARIANTS, d as TIMELINE_POINT_LIST_TAGS } from '../types-BINffz1b.js';
|
|
2
2
|
import { css, html } from 'lit';
|
|
3
3
|
import { property, customElement } from 'lit/decorators.js';
|
|
4
4
|
import { unsafeStatic, html as html$1 } from 'lit/static-html.js';
|
|
@@ -101,13 +101,11 @@ var styles = css`*,
|
|
|
101
101
|
}
|
|
102
102
|
.it-timeline-point-list {
|
|
103
103
|
padding-left: 0;
|
|
104
|
-
|
|
105
|
-
.it-timeline-point-list::marker {
|
|
106
|
-
font-size: 0px;
|
|
104
|
+
list-style: none;
|
|
107
105
|
}
|
|
108
106
|
|
|
109
107
|
::slotted(it-timeline-point) {
|
|
110
|
-
display:
|
|
108
|
+
display: flex;
|
|
111
109
|
width: 100%;
|
|
112
110
|
}`;
|
|
113
111
|
|
|
@@ -226,7 +224,7 @@ let ItTimeline = class ItTimeline extends BaseComponent {
|
|
|
226
224
|
return html$1 `
|
|
227
225
|
<div class="it-timeline-wrapper">
|
|
228
226
|
<div class="row">
|
|
229
|
-
<${tag} class="${classes}">
|
|
227
|
+
<${tag} class="${classes}" role="list">
|
|
230
228
|
<slot @slotchange=${this._onSlotChange}></slot>
|
|
231
229
|
</${tag}>
|
|
232
230
|
</div>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"it-timeline.js","sources":["../../../src/it-timeline.ts"],"sourcesContent":["import { BaseComponent } from '@italia/globals';\nimport { html } from 'lit';\nimport { customElement, property } from 'lit/decorators.js';\nimport { html as staticHtml, unsafeStatic } from 'lit/static-html.js';\nimport {\n TIMELINE_POINT_COLORS,\n TIMELINE_POINT_LIST_TAGS,\n TIMELINE_VARIANTS,\n type TimelinePointColor,\n type TimelinePointListTag,\n type TimelineVariant,\n} from './types.js';\nimport styles from './timeline.scss';\nimport { ItTimelinePoint } from './it-timeline-point.js';\n\n/**\n * Contenitore universale per entrambe le varianti di timeline di Bootstrap Italia.\n *\n * La variante è determinata dall'attributo `variant`:\n * - `classic` (default) — timeline classica con pin e card, layout `.row > .col-12`.\n * - `point-list` — lista compatta temporale, layout `ol/ul.it-timeline-point-list`.\n *\n * Usa **shadow DOM** con slot reali.\n *\n * @attr {string} variant - `classic` (default) o `point-list`.\n * @attr {string} color - Solo per `point-list`: colore predefinito per tutti i punti figlio che non ne specificano uno. Default: `primary`.\n * @attr {string} as - Solo per `point-list`: `ol` (default) o `ul`.\n * @attr {boolean} stack-mobile - Solo per `point-list`: laterale sopra il contenuto su mobile.\n *\n * @slot - Per `classic`: `<it-timeline-element>`. Per `point-list`: `<it-timeline-point>`.\n *\n * @example Timeline classica\n * ```html\n * <it-timeline>\n * <it-timeline-element variant=\"past\" date=\"MAGGIO 2026\">\n * <it-icon slot=\"pin-icon\" name=\"it-file\" aria-hidden=\"true\"></it-icon>\n * <it-card>\n * <a slot=\"title\" href=\"#\">Titolo</a>\n * <span slot=\"text\">Descrizione.</span>\n * </it-card>\n * </it-timeline-element>\n * </it-timeline>\n * ```\n *\n * @example Timeline point list\n * ```html\n * <it-timeline variant=\"point-list\">\n * <it-timeline-point>\n * <time slot=\"date\" datetime=\"2025-10-14\">\n * <span class=\"visually-hidden\">14 ottobre 2025</span>\n * <span class=\"point-visual\" aria-hidden=\"true\">\n * <span class=\"point-main\">14</span>\n * <span class=\"point-bottom\">ott</span>\n * </span>\n * </time>\n * <p slot=\"content\">Lorem ipsum dolor sit amet.</p>\n * </it-timeline-point>\n * </it-timeline>\n * ```\n */\n@customElement('it-timeline')\nexport class ItTimeline extends BaseComponent {\n static styles = styles;\n\n /** Variante: `classic` (default) o `point-list`. */\n @property({ type: String })\n variant: TimelineVariant = 'classic';\n\n /**\n * Colore predefinito per i punti figlio — solo per `variant=\"point-list\"`.\n * Viene propagato a tutti gli `<it-timeline-point>` che non hanno un attributo\n * `color` esplicito. Default: `primary`.\n */\n @property({ type: String })\n color: TimelinePointColor = 'primary';\n\n /** Tag della lista — solo per `variant=\"point-list\"`. Default: `ol`. */\n @property({ type: String })\n as: TimelinePointListTag = 'ol';\n\n /** Layout mobile verticale — solo per `variant=\"point-list\"`. */\n @property({ type: Boolean, attribute: 'stack-mobile', reflect: true })\n stackMobile = false;\n\n /**\n * Compatta ogni elemento it-timeline-point figlio se `true` e non ha un compact esplicito. Solo per `variant=\"point-list\"`.\n */\n @property({ type: Boolean, attribute: 'compact', reflect: true })\n compact = false;\n\n override updated() {\n // Re-propagate color when the color property changes\n this._onSlotChange();\n }\n\n private _getVariant(): TimelineVariant {\n return TIMELINE_VARIANTS.includes(this.variant) ? this.variant : 'classic';\n }\n\n override render() {\n return this._getVariant() === 'point-list' ? this._renderPointList() : this._renderClassic();\n }\n\n private _renderClassic() {\n return html`\n <div class=\"it-timeline-wrapper it-timeline-wrapper--classic\">\n <div class=\"row\">\n <slot @slotchange=${this._onSlotChange}></slot>\n </div>\n </div>\n `;\n }\n\n private _renderPointList() {\n const tag = unsafeStatic(TIMELINE_POINT_LIST_TAGS.includes(this.as) ? this.as : 'ol');\n const classes = this.composeClass('it-timeline-point-list', {\n 'it-timeline-point-list-stack-mobile': this.stackMobile,\n });\n return staticHtml`\n <div class=\"it-timeline-wrapper\">\n <div class=\"row\">\n <${tag} class=\"${classes}\">\n <slot @slotchange=${this._onSlotChange}></slot>\n </${tag}>\n </div>\n </div>\n `;\n }\n\n /** Propagates container color to child points and sets position on elements. */\n private _onSlotChange = () => {\n const slot = this.shadowRoot?.querySelector('slot') as HTMLSlotElement | null;\n if (!slot) return;\n const nodes = slot.assignedElements();\n\n if (this._getVariant() !== 'point-list') return;\n const defaultColor = TIMELINE_POINT_COLORS.includes(this.color) ? this.color : 'primary';\n for (const node of nodes) {\n if (node.tagName.toLowerCase() === 'it-timeline-point') {\n const point = node as unknown as ItTimelinePoint;\n if (!point._hasExplicitColor) {\n point.color = defaultColor;\n }\n if (this.compact && !point._hasExplicitCompact) {\n point.compact = this.compact;\n }\n // Propagate stack-mobile so timeline-point.scss can use :host([stack-mobile])\n point.toggleAttribute('stack-mobile', this.stackMobile);\n }\n }\n };\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'it-timeline': ItTimeline;\n }\n}\n"],"names":["staticHtml"],"mappings":"
|
|
1
|
+
{"version":3,"file":"it-timeline.js","sources":["../../../src/it-timeline.ts"],"sourcesContent":["import { BaseComponent } from '@italia/globals';\nimport { html } from 'lit';\nimport { customElement, property } from 'lit/decorators.js';\nimport { html as staticHtml, unsafeStatic } from 'lit/static-html.js';\nimport {\n TIMELINE_POINT_COLORS,\n TIMELINE_POINT_LIST_TAGS,\n TIMELINE_VARIANTS,\n type TimelinePointColor,\n type TimelinePointListTag,\n type TimelineVariant,\n} from './types.js';\nimport styles from './timeline.scss';\nimport { ItTimelinePoint } from './it-timeline-point.js';\n\n/**\n * Contenitore universale per entrambe le varianti di timeline di Bootstrap Italia.\n *\n * La variante è determinata dall'attributo `variant`:\n * - `classic` (default) — timeline classica con pin e card, layout `.row > .col-12`.\n * - `point-list` — lista compatta temporale, layout `ol/ul.it-timeline-point-list`.\n *\n * Usa **shadow DOM** con slot reali.\n *\n * @attr {string} variant - `classic` (default) o `point-list`.\n * @attr {string} color - Solo per `point-list`: colore predefinito per tutti i punti figlio che non ne specificano uno. Default: `primary`.\n * @attr {string} as - Solo per `point-list`: `ol` (default) o `ul`.\n * @attr {boolean} stack-mobile - Solo per `point-list`: laterale sopra il contenuto su mobile.\n *\n * @slot - Per `classic`: `<it-timeline-element>`. Per `point-list`: `<it-timeline-point>`.\n *\n * @example Timeline classica\n * ```html\n * <it-timeline>\n * <it-timeline-element variant=\"past\" date=\"MAGGIO 2026\">\n * <it-icon slot=\"pin-icon\" name=\"it-file\" aria-hidden=\"true\"></it-icon>\n * <it-card>\n * <a slot=\"title\" href=\"#\">Titolo</a>\n * <span slot=\"text\">Descrizione.</span>\n * </it-card>\n * </it-timeline-element>\n * </it-timeline>\n * ```\n *\n * @example Timeline point list\n * ```html\n * <it-timeline variant=\"point-list\">\n * <it-timeline-point>\n * <time slot=\"date\" datetime=\"2025-10-14\">\n * <span class=\"visually-hidden\">14 ottobre 2025</span>\n * <span class=\"point-visual\" aria-hidden=\"true\">\n * <span class=\"point-main\">14</span>\n * <span class=\"point-bottom\">ott</span>\n * </span>\n * </time>\n * <p slot=\"content\">Lorem ipsum dolor sit amet.</p>\n * </it-timeline-point>\n * </it-timeline>\n * ```\n */\n@customElement('it-timeline')\nexport class ItTimeline extends BaseComponent {\n static styles = styles;\n\n /** Variante: `classic` (default) o `point-list`. */\n @property({ type: String })\n variant: TimelineVariant = 'classic';\n\n /**\n * Colore predefinito per i punti figlio — solo per `variant=\"point-list\"`.\n * Viene propagato a tutti gli `<it-timeline-point>` che non hanno un attributo\n * `color` esplicito. Default: `primary`.\n */\n @property({ type: String })\n color: TimelinePointColor = 'primary';\n\n /** Tag della lista — solo per `variant=\"point-list\"`. Default: `ol`. */\n @property({ type: String })\n as: TimelinePointListTag = 'ol';\n\n /** Layout mobile verticale — solo per `variant=\"point-list\"`. */\n @property({ type: Boolean, attribute: 'stack-mobile', reflect: true })\n stackMobile = false;\n\n /**\n * Compatta ogni elemento it-timeline-point figlio se `true` e non ha un compact esplicito. Solo per `variant=\"point-list\"`.\n */\n @property({ type: Boolean, attribute: 'compact', reflect: true })\n compact = false;\n\n override updated() {\n // Re-propagate color when the color property changes\n this._onSlotChange();\n }\n\n private _getVariant(): TimelineVariant {\n return TIMELINE_VARIANTS.includes(this.variant) ? this.variant : 'classic';\n }\n\n override render() {\n return this._getVariant() === 'point-list' ? this._renderPointList() : this._renderClassic();\n }\n\n private _renderClassic() {\n return html`\n <div class=\"it-timeline-wrapper it-timeline-wrapper--classic\">\n <div class=\"row\">\n <slot @slotchange=${this._onSlotChange}></slot>\n </div>\n </div>\n `;\n }\n\n private _renderPointList() {\n const tag = unsafeStatic(TIMELINE_POINT_LIST_TAGS.includes(this.as) ? this.as : 'ol');\n const classes = this.composeClass('it-timeline-point-list', {\n 'it-timeline-point-list-stack-mobile': this.stackMobile,\n });\n return staticHtml`\n <div class=\"it-timeline-wrapper\">\n <div class=\"row\">\n <${tag} class=\"${classes}\" role=\"list\">\n <slot @slotchange=${this._onSlotChange}></slot>\n </${tag}>\n </div>\n </div>\n `;\n }\n\n /** Propagates container color to child points and sets position on elements. */\n private _onSlotChange = () => {\n const slot = this.shadowRoot?.querySelector('slot') as HTMLSlotElement | null;\n if (!slot) return;\n const nodes = slot.assignedElements();\n\n if (this._getVariant() !== 'point-list') return;\n const defaultColor = TIMELINE_POINT_COLORS.includes(this.color) ? this.color : 'primary';\n for (const node of nodes) {\n if (node.tagName.toLowerCase() === 'it-timeline-point') {\n const point = node as unknown as ItTimelinePoint;\n if (!point._hasExplicitColor) {\n point.color = defaultColor;\n }\n if (this.compact && !point._hasExplicitCompact) {\n point.compact = this.compact;\n }\n // Propagate stack-mobile so timeline-point.scss can use :host([stack-mobile])\n point.toggleAttribute('stack-mobile', this.stackMobile);\n }\n }\n };\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'it-timeline': ItTimeline;\n }\n}\n"],"names":["staticHtml"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAeA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA4CG;AAEI,IAAM,UAAU,GAAhB,MAAM,UAAW,SAAQ,aAAa,CAAA;AAAtC,IAAA,WAAA,GAAA;;;QAKL,IAAA,CAAA,OAAO,GAAoB,SAAS;AAEpC;;;;AAIG;QAEH,IAAA,CAAA,KAAK,GAAuB,SAAS;;QAIrC,IAAA,CAAA,EAAE,GAAyB,IAAI;;QAI/B,IAAA,CAAA,WAAW,GAAG,KAAK;AAEnB;;AAEG;QAEH,IAAA,CAAA,OAAO,GAAG,KAAK;;QA0CP,IAAA,CAAA,aAAa,GAAG,MAAK;YAC3B,MAAM,IAAI,GAAG,IAAI,CAAC,UAAU,EAAE,aAAa,CAAC,MAAM,CAA2B;AAC7E,YAAA,IAAI,CAAC,IAAI;gBAAE;AACX,YAAA,MAAM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AAa,CAAC,aAAa;AACf,CAAA,EAAA,UAAU,CA0FtB;;;;"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@italia/timeline",
|
|
3
3
|
"description": "Web components it-timeline e it-timeline-point-list del Design system .italia",
|
|
4
|
-
"version": "1.0.0-alpha.
|
|
4
|
+
"version": "1.0.0-alpha.19",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
7
7
|
},
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
"dependencies": {
|
|
39
39
|
"bootstrap-italia": "3.0.0-beta.1",
|
|
40
40
|
"lit": "^3.3.0",
|
|
41
|
-
"@italia/globals": "^1.0.0-alpha.
|
|
41
|
+
"@italia/globals": "^1.0.0-alpha.19"
|
|
42
42
|
},
|
|
43
43
|
"devDependencies": {
|
|
44
44
|
"@custom-elements-manifest/analyzer": "^0.10.3",
|