@italia/timeline 1.0.0-alpha.9 → 1.0.0-beta.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.
- package/README.md +6 -57
- package/custom-elements.json +213 -213
- package/dist/src/index.js +1 -1
- package/dist/src/it-timeline-element.js +296 -16
- package/dist/src/it-timeline-element.js.map +1 -1
- package/dist/src/it-timeline-point.d.ts.map +1 -1
- package/dist/src/it-timeline-point.js +47 -83
- package/dist/src/it-timeline-point.js.map +1 -1
- package/dist/src/it-timeline.js +5 -20
- package/dist/src/it-timeline.js.map +1 -1
- package/package.json +23 -23
- package/styles/globals.scss +7 -1
|
@@ -1,23 +1,10 @@
|
|
|
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-ePm6EPQB.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';
|
|
5
5
|
import 'lit/directive.js';
|
|
6
6
|
|
|
7
7
|
var styles = css`@charset "UTF-8";
|
|
8
|
-
/***************************** 1 ****************************************/
|
|
9
|
-
/***************************** 2 ****************************************/
|
|
10
|
-
/***************************** 1 ****************************************/
|
|
11
|
-
/***************************** 2 ****************************************/
|
|
12
|
-
/***************************** 1 ****************************************/
|
|
13
|
-
/***************************** 2 ****************************************/
|
|
14
|
-
/***************************** 3 ****************************************/
|
|
15
|
-
/***************************** 1 ****************************************/
|
|
16
|
-
/***************************** 2 ****************************************/
|
|
17
|
-
/***************************** 3 ****************************************/
|
|
18
|
-
/***************************** NEUTRAL 1 ****************************************/
|
|
19
|
-
/***************************** NEUTRAL 2 ****************************************/
|
|
20
|
-
/***************************** NEUTRAL 2 / 3 ****************************************/
|
|
21
8
|
.row {
|
|
22
9
|
--bsi-gutter-x: 24px;
|
|
23
10
|
--bsi-gutter-y: 0;
|
|
@@ -1362,6 +1349,299 @@ var styles = css`@charset "UTF-8";
|
|
|
1362
1349
|
bottom: auto;
|
|
1363
1350
|
}
|
|
1364
1351
|
|
|
1352
|
+
*,
|
|
1353
|
+
*::before,
|
|
1354
|
+
*::after {
|
|
1355
|
+
box-sizing: border-box;
|
|
1356
|
+
}
|
|
1357
|
+
|
|
1358
|
+
@media (prefers-reduced-motion: no-preference) {
|
|
1359
|
+
:root {
|
|
1360
|
+
scroll-behavior: smooth;
|
|
1361
|
+
}
|
|
1362
|
+
}
|
|
1363
|
+
|
|
1364
|
+
body {
|
|
1365
|
+
margin: 0;
|
|
1366
|
+
-webkit-text-size-adjust: 100%;
|
|
1367
|
+
-webkit-tap-highlight-color: hsla(0, 0%, 0%, 0);
|
|
1368
|
+
}
|
|
1369
|
+
|
|
1370
|
+
hr {
|
|
1371
|
+
margin: 1rem 0;
|
|
1372
|
+
color: inherit;
|
|
1373
|
+
border: 0;
|
|
1374
|
+
border-top: 1px solid;
|
|
1375
|
+
opacity: 0.25;
|
|
1376
|
+
}
|
|
1377
|
+
|
|
1378
|
+
p {
|
|
1379
|
+
margin-top: 0;
|
|
1380
|
+
margin-bottom: var(--bsi-paragraph-spacing);
|
|
1381
|
+
}
|
|
1382
|
+
|
|
1383
|
+
abbr[title] {
|
|
1384
|
+
text-decoration: underline dotted;
|
|
1385
|
+
cursor: help;
|
|
1386
|
+
text-decoration-skip-ink: none;
|
|
1387
|
+
}
|
|
1388
|
+
|
|
1389
|
+
address {
|
|
1390
|
+
margin-bottom: var(--bsi-spacing-s);
|
|
1391
|
+
font-style: normal;
|
|
1392
|
+
line-height: inherit;
|
|
1393
|
+
}
|
|
1394
|
+
|
|
1395
|
+
ol,
|
|
1396
|
+
ul {
|
|
1397
|
+
padding-left: var(--bsi-spacing-l);
|
|
1398
|
+
}
|
|
1399
|
+
|
|
1400
|
+
ol,
|
|
1401
|
+
ul,
|
|
1402
|
+
dl {
|
|
1403
|
+
margin-top: 0;
|
|
1404
|
+
margin-bottom: var(--bsi-spacing-s);
|
|
1405
|
+
}
|
|
1406
|
+
|
|
1407
|
+
ol ol,
|
|
1408
|
+
ul ul,
|
|
1409
|
+
ol ul,
|
|
1410
|
+
ul ol {
|
|
1411
|
+
margin-bottom: 0;
|
|
1412
|
+
}
|
|
1413
|
+
|
|
1414
|
+
dt {
|
|
1415
|
+
font-weight: var(--bsi-font-weight-strong);
|
|
1416
|
+
}
|
|
1417
|
+
|
|
1418
|
+
dd {
|
|
1419
|
+
margin-bottom: var(--bsi-spacing-xxs);
|
|
1420
|
+
margin-left: 0;
|
|
1421
|
+
}
|
|
1422
|
+
|
|
1423
|
+
blockquote {
|
|
1424
|
+
margin: 0 0 var(--bsi-spacing-s);
|
|
1425
|
+
}
|
|
1426
|
+
|
|
1427
|
+
sub,
|
|
1428
|
+
sup {
|
|
1429
|
+
position: relative;
|
|
1430
|
+
font-size: var(--bsi-font-size-1);
|
|
1431
|
+
line-height: 0;
|
|
1432
|
+
vertical-align: baseline;
|
|
1433
|
+
}
|
|
1434
|
+
|
|
1435
|
+
sub {
|
|
1436
|
+
bottom: -0.25em;
|
|
1437
|
+
}
|
|
1438
|
+
|
|
1439
|
+
sup {
|
|
1440
|
+
top: -0.5em;
|
|
1441
|
+
}
|
|
1442
|
+
|
|
1443
|
+
a {
|
|
1444
|
+
color: var(--bsi-color-link);
|
|
1445
|
+
text-decoration: underline;
|
|
1446
|
+
text-decoration-skip-ink: auto;
|
|
1447
|
+
text-underline-offset: 2px;
|
|
1448
|
+
}
|
|
1449
|
+
a:hover {
|
|
1450
|
+
color: var(--bsi-color-link-hover);
|
|
1451
|
+
cursor: pointer;
|
|
1452
|
+
}
|
|
1453
|
+
|
|
1454
|
+
pre,
|
|
1455
|
+
code,
|
|
1456
|
+
kbd,
|
|
1457
|
+
samp {
|
|
1458
|
+
font-size: 1em;
|
|
1459
|
+
}
|
|
1460
|
+
|
|
1461
|
+
pre {
|
|
1462
|
+
display: block;
|
|
1463
|
+
margin-top: 0;
|
|
1464
|
+
margin-bottom: var(--bsi-paragraph-spacing);
|
|
1465
|
+
overflow: auto;
|
|
1466
|
+
}
|
|
1467
|
+
pre code {
|
|
1468
|
+
word-break: normal;
|
|
1469
|
+
}
|
|
1470
|
+
|
|
1471
|
+
a > code {
|
|
1472
|
+
color: inherit;
|
|
1473
|
+
}
|
|
1474
|
+
|
|
1475
|
+
figure {
|
|
1476
|
+
margin: 0 0 1rem;
|
|
1477
|
+
}
|
|
1478
|
+
|
|
1479
|
+
img,
|
|
1480
|
+
svg {
|
|
1481
|
+
vertical-align: middle;
|
|
1482
|
+
}
|
|
1483
|
+
|
|
1484
|
+
table {
|
|
1485
|
+
caption-side: bottom;
|
|
1486
|
+
border-collapse: collapse;
|
|
1487
|
+
}
|
|
1488
|
+
|
|
1489
|
+
caption {
|
|
1490
|
+
padding-top: 0.5rem;
|
|
1491
|
+
padding-bottom: 0.5rem;
|
|
1492
|
+
color: hsl(210, 17%, 44%);
|
|
1493
|
+
text-align: left;
|
|
1494
|
+
}
|
|
1495
|
+
|
|
1496
|
+
th {
|
|
1497
|
+
text-align: inherit;
|
|
1498
|
+
text-align: -webkit-match-parent;
|
|
1499
|
+
}
|
|
1500
|
+
|
|
1501
|
+
thead,
|
|
1502
|
+
tbody,
|
|
1503
|
+
tfoot,
|
|
1504
|
+
tr,
|
|
1505
|
+
td,
|
|
1506
|
+
th {
|
|
1507
|
+
border-color: inherit;
|
|
1508
|
+
border-style: solid;
|
|
1509
|
+
border-width: 0;
|
|
1510
|
+
}
|
|
1511
|
+
|
|
1512
|
+
label {
|
|
1513
|
+
display: inline-block;
|
|
1514
|
+
}
|
|
1515
|
+
|
|
1516
|
+
button {
|
|
1517
|
+
border-radius: 0;
|
|
1518
|
+
}
|
|
1519
|
+
|
|
1520
|
+
button:focus:not(:focus-visible) {
|
|
1521
|
+
outline: 0;
|
|
1522
|
+
}
|
|
1523
|
+
|
|
1524
|
+
input,
|
|
1525
|
+
button,
|
|
1526
|
+
select,
|
|
1527
|
+
optgroup,
|
|
1528
|
+
textarea {
|
|
1529
|
+
margin: 0;
|
|
1530
|
+
font-family: inherit;
|
|
1531
|
+
font-size: inherit;
|
|
1532
|
+
line-height: inherit;
|
|
1533
|
+
}
|
|
1534
|
+
|
|
1535
|
+
button,
|
|
1536
|
+
select {
|
|
1537
|
+
text-transform: none;
|
|
1538
|
+
}
|
|
1539
|
+
|
|
1540
|
+
[role=button] {
|
|
1541
|
+
cursor: pointer;
|
|
1542
|
+
}
|
|
1543
|
+
|
|
1544
|
+
select {
|
|
1545
|
+
word-wrap: normal;
|
|
1546
|
+
}
|
|
1547
|
+
select:disabled {
|
|
1548
|
+
opacity: 1;
|
|
1549
|
+
}
|
|
1550
|
+
|
|
1551
|
+
[list]:not([type=date]):not([type=datetime-local]):not([type=month]):not([type=week]):not([type=time])::-webkit-calendar-picker-indicator {
|
|
1552
|
+
display: none !important;
|
|
1553
|
+
}
|
|
1554
|
+
|
|
1555
|
+
button,
|
|
1556
|
+
[type=button],
|
|
1557
|
+
[type=reset],
|
|
1558
|
+
[type=submit] {
|
|
1559
|
+
-webkit-appearance: button;
|
|
1560
|
+
}
|
|
1561
|
+
button:not(:disabled),
|
|
1562
|
+
[type=button]:not(:disabled),
|
|
1563
|
+
[type=reset]:not(:disabled),
|
|
1564
|
+
[type=submit]:not(:disabled) {
|
|
1565
|
+
cursor: pointer;
|
|
1566
|
+
}
|
|
1567
|
+
|
|
1568
|
+
::-moz-focus-inner {
|
|
1569
|
+
padding: 0;
|
|
1570
|
+
border-style: none;
|
|
1571
|
+
}
|
|
1572
|
+
|
|
1573
|
+
textarea {
|
|
1574
|
+
resize: vertical;
|
|
1575
|
+
}
|
|
1576
|
+
|
|
1577
|
+
fieldset {
|
|
1578
|
+
min-width: 0;
|
|
1579
|
+
padding: 0;
|
|
1580
|
+
margin: 0;
|
|
1581
|
+
border: 0;
|
|
1582
|
+
}
|
|
1583
|
+
|
|
1584
|
+
::-webkit-datetime-edit-fields-wrapper,
|
|
1585
|
+
::-webkit-datetime-edit-text,
|
|
1586
|
+
::-webkit-datetime-edit-minute,
|
|
1587
|
+
::-webkit-datetime-edit-hour-field,
|
|
1588
|
+
::-webkit-datetime-edit-day-field,
|
|
1589
|
+
::-webkit-datetime-edit-month-field,
|
|
1590
|
+
::-webkit-datetime-edit-year-field {
|
|
1591
|
+
padding: 0;
|
|
1592
|
+
}
|
|
1593
|
+
|
|
1594
|
+
::-webkit-inner-spin-button {
|
|
1595
|
+
height: auto;
|
|
1596
|
+
}
|
|
1597
|
+
|
|
1598
|
+
[type=search] {
|
|
1599
|
+
outline-offset: -2px;
|
|
1600
|
+
-webkit-appearance: textfield;
|
|
1601
|
+
}
|
|
1602
|
+
|
|
1603
|
+
/* rtl:raw:
|
|
1604
|
+
[type="tel"],
|
|
1605
|
+
[type="url"],
|
|
1606
|
+
[type="email"],
|
|
1607
|
+
[type="number"] {
|
|
1608
|
+
direction: ltr;
|
|
1609
|
+
}
|
|
1610
|
+
*/
|
|
1611
|
+
::-webkit-search-decoration {
|
|
1612
|
+
-webkit-appearance: none;
|
|
1613
|
+
}
|
|
1614
|
+
|
|
1615
|
+
::-webkit-color-swatch-wrapper {
|
|
1616
|
+
padding: 0;
|
|
1617
|
+
}
|
|
1618
|
+
|
|
1619
|
+
::file-selector-button {
|
|
1620
|
+
font: inherit;
|
|
1621
|
+
-webkit-appearance: button;
|
|
1622
|
+
}
|
|
1623
|
+
|
|
1624
|
+
output {
|
|
1625
|
+
display: inline-block;
|
|
1626
|
+
}
|
|
1627
|
+
|
|
1628
|
+
iframe {
|
|
1629
|
+
border: 0;
|
|
1630
|
+
}
|
|
1631
|
+
|
|
1632
|
+
summary {
|
|
1633
|
+
display: list-item;
|
|
1634
|
+
cursor: pointer;
|
|
1635
|
+
}
|
|
1636
|
+
|
|
1637
|
+
progress {
|
|
1638
|
+
vertical-align: baseline;
|
|
1639
|
+
}
|
|
1640
|
+
|
|
1641
|
+
[hidden] {
|
|
1642
|
+
display: none !important;
|
|
1643
|
+
}
|
|
1644
|
+
|
|
1365
1645
|
body {
|
|
1366
1646
|
font-family: var(--bsi-font-sans);
|
|
1367
1647
|
}
|
|
@@ -1716,10 +1996,10 @@ blockquote.blockquote-card.dark .blockquote-footer,
|
|
|
1716
1996
|
height: 24px;
|
|
1717
1997
|
}
|
|
1718
1998
|
.it-pin-wrapper .pin-text {
|
|
1719
|
-
border-radius:
|
|
1999
|
+
border-radius: 40px;
|
|
1720
2000
|
background: var(--bsi-color-background-primary-deep);
|
|
1721
2001
|
color: var(--bsi-color-white, #fff);
|
|
1722
|
-
font-family:
|
|
2002
|
+
font-family: var(--bsi-font-mono);
|
|
1723
2003
|
font-size: var(--bsi-body-font-size);
|
|
1724
2004
|
font-weight: 600;
|
|
1725
2005
|
line-height: var(--bsi-body-leading);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"it-timeline-element.js","sources":["../../../src/it-timeline-element.ts"],"sourcesContent":["/* eslint-disable class-methods-use-this */\nimport { BaseComponent } from '@italia/globals';\nimport { html, nothing } from 'lit';\nimport { customElement, property } from 'lit/decorators.js';\nimport { html as staticHtml, unsafeStatic } from 'lit/static-html.js';\nimport {\n TIMELINE_ELEMENT_DARK_VARIANTS,\n TIMELINE_ELEMENT_VARIANTS,\n TIMELINE_HEADING_LEVELS,\n type TimelineElementVariant,\n type TimelineHeadingLevel,\n} from './types.js';\nimport styles from './timeline-element.scss';\n\n/** Mappa da nome API semantico → classe CSS BSI per il pin wrapper. */\nconst BSI_VARIANT_CLASS: Record<string, string> = {\n current: 'it-now',\n past: 'it-evidence',\n};\n\n/**\n * Singolo elemento della timeline classica di Bootstrap Italia.\n *\n * Usa **shadow DOM** con slot reali: l'utente mette il contenuto\n * direttamente come figli senza classi aggiuntive.\n *\n * @slot pin-icon - Icona del pin (es. `<it-icon>`). Se omessa viene mostrata un'icona segnaposto.\n * @slot - Contenuto dell'elemento (es. `<it-card>`).\n *\n * @attr {string} variant - Variante colore del pin: `''` (futuro), `current` (presente, azzurro), `past` (passato, blu scuro).\n * @attr {string} date - Etichetta testuale del periodo (es. `MAGGIO 2026`).\n * @attr {string} heading-level - Livello heading (`h2`–`h6`). Default: `h3`.\n *\n * @example\n * ```html\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 del contenuto</a>\n * <span slot=\"text\">Descrizione breve.</span>\n * </it-card>\n * </it-timeline-element>\n * ```\n */\n@customElement('it-timeline-element')\nexport class ItTimelineElement extends BaseComponent {\n static styles = styles;\n\n @property({ type: String })\n variant: TimelineElementVariant = '';\n\n @property({ type: String })\n date = '';\n\n @property({ type: String, attribute: 'heading-level' })\n headingLevel: TimelineHeadingLevel = 'h3';\n\n protected getHeadingLevel(): TimelineHeadingLevel {\n return TIMELINE_HEADING_LEVELS.includes(this.headingLevel) ? this.headingLevel : 'h3';\n }\n\n protected getVariant(): TimelineElementVariant {\n return TIMELINE_ELEMENT_VARIANTS.includes(this.variant) ? this.variant : '';\n }\n\n override render() {\n if (this.variant && !TIMELINE_ELEMENT_VARIANTS.includes(this.variant)) {\n this.logger.warn(\n `Invalid variant value, falling back to default. Expected one of: ${TIMELINE_ELEMENT_VARIANTS.join(', ')}`,\n );\n }\n if (this.headingLevel && !TIMELINE_HEADING_LEVELS.includes(this.headingLevel)) {\n this.logger.warn(\n `Invalid heading-level value, falling back to default. Expected one of: ${TIMELINE_HEADING_LEVELS.join(', ')}`,\n );\n }\n\n const headingTag = unsafeStatic(this.getHeadingLevel());\n const bsiVariantClass = BSI_VARIANT_CLASS[this.getVariant()] ?? undefined;\n const pinWrapperClasses = this.composeClass('it-pin-wrapper', bsiVariantClass);\n const variant = this.getVariant();\n // Decide whether the slotted icon needs white color (dark-background variants)\n const needsInverseIcon = (TIMELINE_ELEMENT_DARK_VARIANTS as ReadonlyArray<string>).includes(this.getVariant());\n\n return staticHtml`\n <div class=\"col-12\">\n <div class=\"timeline-element\">\n ${\n variant === 'current'\n ? html`<span class=\"it-now-label\">Oggi</span>` // <-- SOSTITUISCI CON IL TUO METODO/CHIAVE i18n E.g. this.t('today') o msg('Oggi')\n : nothing\n }\n <${headingTag} class=\"${pinWrapperClasses}\">\n <div class=\"pin-icon\">\n <slot\n name=\"pin-icon\"\n @slotchange=${(e: Event) => this._onPinIconSlotChange(e, needsInverseIcon)}\n >\n </slot>\n </div>\n ${this.date ? html`<div class=\"pin-text\"><span>${this.date}</span></div>` : nothing}\n </${headingTag}>\n <slot></slot>\n </div>\n </div>\n `;\n }\n\n /**\n * When the pin-icon slot changes, auto-set `color=\"white\"` on any `<it-icon>`\n * that doesn't already have an explicit color attribute.\n */\n private _onPinIconSlotChange(e: Event, needsInverse: boolean) {\n const slot = e.target as HTMLSlotElement;\n for (const node of slot.assignedElements()) {\n if (node.tagName.toLowerCase() === 'it-icon') {\n node.setAttribute('size', 'sm');\n if (!node.hasAttribute('color')) {\n if (needsInverse) node.setAttribute('color', 'white');\n else node.removeAttribute('color');\n }\n }\n }\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'it-timeline-element': ItTimelineElement;\n }\n}\n"],"names":["staticHtml"],"mappings":"
|
|
1
|
+
{"version":3,"file":"it-timeline-element.js","sources":["../../../src/it-timeline-element.ts"],"sourcesContent":["/* eslint-disable class-methods-use-this */\nimport { BaseComponent } from '@italia/globals';\nimport { html, nothing } from 'lit';\nimport { customElement, property } from 'lit/decorators.js';\nimport { html as staticHtml, unsafeStatic } from 'lit/static-html.js';\nimport {\n TIMELINE_ELEMENT_DARK_VARIANTS,\n TIMELINE_ELEMENT_VARIANTS,\n TIMELINE_HEADING_LEVELS,\n type TimelineElementVariant,\n type TimelineHeadingLevel,\n} from './types.js';\nimport styles from './timeline-element.scss';\n\n/** Mappa da nome API semantico → classe CSS BSI per il pin wrapper. */\nconst BSI_VARIANT_CLASS: Record<string, string> = {\n current: 'it-now',\n past: 'it-evidence',\n};\n\n/**\n * Singolo elemento della timeline classica di Bootstrap Italia.\n *\n * Usa **shadow DOM** con slot reali: l'utente mette il contenuto\n * direttamente come figli senza classi aggiuntive.\n *\n * @slot pin-icon - Icona del pin (es. `<it-icon>`). Se omessa viene mostrata un'icona segnaposto.\n * @slot - Contenuto dell'elemento (es. `<it-card>`).\n *\n * @attr {string} variant - Variante colore del pin: `''` (futuro), `current` (presente, azzurro), `past` (passato, blu scuro).\n * @attr {string} date - Etichetta testuale del periodo (es. `MAGGIO 2026`).\n * @attr {string} heading-level - Livello heading (`h2`–`h6`). Default: `h3`.\n *\n * @example\n * ```html\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 del contenuto</a>\n * <span slot=\"text\">Descrizione breve.</span>\n * </it-card>\n * </it-timeline-element>\n * ```\n */\n@customElement('it-timeline-element')\nexport class ItTimelineElement extends BaseComponent {\n static styles = styles;\n\n @property({ type: String })\n variant: TimelineElementVariant = '';\n\n @property({ type: String })\n date = '';\n\n @property({ type: String, attribute: 'heading-level' })\n headingLevel: TimelineHeadingLevel = 'h3';\n\n protected getHeadingLevel(): TimelineHeadingLevel {\n return TIMELINE_HEADING_LEVELS.includes(this.headingLevel) ? this.headingLevel : 'h3';\n }\n\n protected getVariant(): TimelineElementVariant {\n return TIMELINE_ELEMENT_VARIANTS.includes(this.variant) ? this.variant : '';\n }\n\n override render() {\n if (this.variant && !TIMELINE_ELEMENT_VARIANTS.includes(this.variant)) {\n this.logger.warn(\n `Invalid variant value, falling back to default. Expected one of: ${TIMELINE_ELEMENT_VARIANTS.join(', ')}`,\n );\n }\n if (this.headingLevel && !TIMELINE_HEADING_LEVELS.includes(this.headingLevel)) {\n this.logger.warn(\n `Invalid heading-level value, falling back to default. Expected one of: ${TIMELINE_HEADING_LEVELS.join(', ')}`,\n );\n }\n\n const headingTag = unsafeStatic(this.getHeadingLevel());\n const bsiVariantClass = BSI_VARIANT_CLASS[this.getVariant()] ?? undefined;\n const pinWrapperClasses = this.composeClass('it-pin-wrapper', bsiVariantClass);\n const variant = this.getVariant();\n // Decide whether the slotted icon needs white color (dark-background variants)\n const needsInverseIcon = (TIMELINE_ELEMENT_DARK_VARIANTS as ReadonlyArray<string>).includes(this.getVariant());\n\n return staticHtml`\n <div class=\"col-12\">\n <div class=\"timeline-element\">\n ${\n variant === 'current'\n ? html`<span class=\"it-now-label\">Oggi</span>` // <-- SOSTITUISCI CON IL TUO METODO/CHIAVE i18n E.g. this.t('today') o msg('Oggi')\n : nothing\n }\n <${headingTag} class=\"${pinWrapperClasses}\">\n <div class=\"pin-icon\">\n <slot\n name=\"pin-icon\"\n @slotchange=${(e: Event) => this._onPinIconSlotChange(e, needsInverseIcon)}\n >\n </slot>\n </div>\n ${this.date ? html`<div class=\"pin-text\"><span>${this.date}</span></div>` : nothing}\n </${headingTag}>\n <slot></slot>\n </div>\n </div>\n `;\n }\n\n /**\n * When the pin-icon slot changes, auto-set `color=\"white\"` on any `<it-icon>`\n * that doesn't already have an explicit color attribute.\n */\n private _onPinIconSlotChange(e: Event, needsInverse: boolean) {\n const slot = e.target as HTMLSlotElement;\n for (const node of slot.assignedElements()) {\n if (node.tagName.toLowerCase() === 'it-icon') {\n node.setAttribute('size', 'sm');\n if (!node.hasAttribute('color')) {\n if (needsInverse) node.setAttribute('color', 'white');\n else node.removeAttribute('color');\n }\n }\n }\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'it-timeline-element': ItTimelineElement;\n }\n}\n"],"names":["staticHtml"],"mappings":";;;;;;;;;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Q,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,22 +1,9 @@
|
|
|
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-ePm6EPQB.js';
|
|
2
2
|
import { css, html } from 'lit';
|
|
3
3
|
import { property, customElement } from 'lit/decorators.js';
|
|
4
4
|
import 'lit/directive.js';
|
|
5
5
|
|
|
6
|
-
var styles = css
|
|
7
|
-
/***************************** 2 ****************************************/
|
|
8
|
-
/***************************** 1 ****************************************/
|
|
9
|
-
/***************************** 2 ****************************************/
|
|
10
|
-
/***************************** 1 ****************************************/
|
|
11
|
-
/***************************** 2 ****************************************/
|
|
12
|
-
/***************************** 3 ****************************************/
|
|
13
|
-
/***************************** 1 ****************************************/
|
|
14
|
-
/***************************** 2 ****************************************/
|
|
15
|
-
/***************************** 3 ****************************************/
|
|
16
|
-
/***************************** NEUTRAL 1 ****************************************/
|
|
17
|
-
/***************************** NEUTRAL 2 ****************************************/
|
|
18
|
-
/***************************** NEUTRAL 2 / 3 ****************************************/
|
|
19
|
-
*,
|
|
6
|
+
var styles = css`*,
|
|
20
7
|
*::before,
|
|
21
8
|
*::after {
|
|
22
9
|
box-sizing: border-box;
|
|
@@ -25,107 +12,96 @@ var styles = css`/***************************** 1 ******************************
|
|
|
25
12
|
}
|
|
26
13
|
|
|
27
14
|
:host {
|
|
28
|
-
|
|
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);
|
|
29
20
|
font-family: "Titillium Web", "Titillium Sans Pro", Geneva, Tahoma, sans-serif;
|
|
30
21
|
font-size: var(--bsi-body-font-size);
|
|
31
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);
|
|
32
34
|
}
|
|
33
35
|
|
|
34
|
-
|
|
35
|
-
.timeline-point-primary {
|
|
36
|
+
:host([color=primary]) {
|
|
36
37
|
--point-color: var(--bsi-color-text-primary);
|
|
37
38
|
}
|
|
38
39
|
|
|
39
|
-
|
|
40
|
-
.timeline-point-secondary {
|
|
40
|
+
:host([color=secondary]) {
|
|
41
41
|
--point-color: var(--bsi-color-text-secondary);
|
|
42
42
|
}
|
|
43
43
|
|
|
44
|
-
|
|
45
|
-
.timeline-point-success {
|
|
44
|
+
:host([color=success]) {
|
|
46
45
|
--point-color: var(--bsi-color-text-success);
|
|
47
46
|
}
|
|
48
47
|
|
|
49
|
-
|
|
50
|
-
.timeline-point-info {
|
|
48
|
+
:host([color=info]) {
|
|
51
49
|
--point-color: var(--bsi-color-text-info);
|
|
52
50
|
}
|
|
53
51
|
|
|
54
|
-
|
|
55
|
-
.timeline-point-warning {
|
|
52
|
+
:host([color=warning]) {
|
|
56
53
|
--point-color: var(--bsi-color-text-warning);
|
|
57
54
|
}
|
|
58
55
|
|
|
59
|
-
|
|
60
|
-
.timeline-point-danger {
|
|
56
|
+
:host([color=danger]) {
|
|
61
57
|
--point-color: var(--bsi-color-text-danger);
|
|
62
58
|
}
|
|
63
59
|
|
|
64
|
-
|
|
65
|
-
.timeline-point-light {
|
|
60
|
+
:host([color=light]) {
|
|
66
61
|
--point-color: var(--bsi-color-text-light);
|
|
67
62
|
}
|
|
68
63
|
|
|
69
|
-
|
|
70
|
-
.timeline-point-dark {
|
|
64
|
+
:host([color=dark]) {
|
|
71
65
|
--point-color: var(--bsi-color-text-dark);
|
|
72
66
|
}
|
|
73
67
|
|
|
74
|
-
|
|
75
|
-
.timeline-point-black {
|
|
68
|
+
:host([color=black]) {
|
|
76
69
|
--point-color: var(--bsi-color-text-black);
|
|
77
70
|
}
|
|
78
71
|
|
|
79
|
-
|
|
80
|
-
.timeline-point-white {
|
|
72
|
+
:host([color=white]) {
|
|
81
73
|
--point-color: var(--bsi-color-text-white);
|
|
82
74
|
}
|
|
83
75
|
|
|
84
|
-
|
|
85
|
-
position: relative;
|
|
86
|
-
display: flex;
|
|
87
|
-
flex-wrap: var(--it-timeline-point-content-flex-wrap, nowrap);
|
|
88
|
-
align-items: center;
|
|
89
|
-
margin-bottom: var(--it-timeline-point-margin-bottom, 24px);
|
|
90
|
-
}
|
|
91
|
-
.timeline-point::before {
|
|
92
|
-
position: absolute;
|
|
93
|
-
z-index: 1;
|
|
94
|
-
top: var(--it-timeline-point-stack-mobile-after-top, 0);
|
|
95
|
-
left: 2rem;
|
|
96
|
-
width: 2px;
|
|
97
|
-
height: calc(100% + 24px);
|
|
98
|
-
background-color: var(--point-color, var(--bsi-color-text-primary));
|
|
99
|
-
content: var(--it-timeline-point-stack-mobile-after-content, none);
|
|
100
|
-
}
|
|
101
|
-
.timeline-point.timeline-point-align-top {
|
|
76
|
+
:host([align-top]) {
|
|
102
77
|
align-items: flex-start;
|
|
103
78
|
}
|
|
104
|
-
|
|
79
|
+
:host([align-top]) .point-aside {
|
|
105
80
|
align-self: stretch;
|
|
106
81
|
justify-content: flex-start;
|
|
107
82
|
padding-top: 0.5rem;
|
|
108
83
|
}
|
|
109
|
-
|
|
84
|
+
:host([align-top]) .point-aside::after {
|
|
110
85
|
top: 2.6rem;
|
|
111
86
|
transform: translateY(-5px);
|
|
112
87
|
}
|
|
113
|
-
|
|
88
|
+
|
|
89
|
+
:host([compact]) .point-aside {
|
|
114
90
|
width: 3.5rem;
|
|
115
91
|
padding: 0.5rem 0.75rem 0.5rem 0;
|
|
116
92
|
}
|
|
117
93
|
@media (max-width: 767.98px) {
|
|
118
|
-
|
|
94
|
+
:host([compact]) .point-aside {
|
|
119
95
|
width: 3rem;
|
|
120
96
|
padding: 0.5rem 0.5rem 0.5rem 0;
|
|
121
97
|
}
|
|
122
98
|
}
|
|
123
99
|
|
|
124
|
-
:host([has-point-top]
|
|
100
|
+
:host([has-point-top][align-top]) .point-aside::after {
|
|
125
101
|
top: 3.5rem;
|
|
126
102
|
}
|
|
127
103
|
@media (max-width: 767.98px) {
|
|
128
|
-
:host([has-point-top]
|
|
104
|
+
:host([has-point-top][align-top]) .point-aside::after {
|
|
129
105
|
top: 2.7rem;
|
|
130
106
|
}
|
|
131
107
|
}
|
|
@@ -176,27 +152,27 @@ var styles = css`/***************************** 1 ******************************
|
|
|
176
152
|
}
|
|
177
153
|
|
|
178
154
|
@media (max-width: 767.98px) {
|
|
179
|
-
:host([stack-mobile]) .
|
|
155
|
+
:host([stack-mobile]) .point-aside {
|
|
180
156
|
width: auto;
|
|
181
157
|
flex-direction: row-reverse;
|
|
182
158
|
padding-right: 0.5rem;
|
|
183
159
|
padding-left: 2.5rem;
|
|
184
160
|
}
|
|
185
|
-
:host([stack-mobile]) .
|
|
161
|
+
:host([stack-mobile]) .point-aside::before {
|
|
186
162
|
display: none;
|
|
187
163
|
}
|
|
188
|
-
:host([stack-mobile]) .
|
|
164
|
+
:host([stack-mobile]) .point-aside::after {
|
|
189
165
|
top: 50%;
|
|
190
166
|
right: auto;
|
|
191
167
|
left: 1.75rem;
|
|
192
168
|
transform: translateY(-50%);
|
|
193
169
|
}
|
|
194
|
-
:host([stack-mobile]) .
|
|
170
|
+
:host([stack-mobile]) .point-content {
|
|
195
171
|
flex: 1 1 100%;
|
|
196
172
|
margin-top: 16px;
|
|
197
173
|
margin-left: 0;
|
|
198
174
|
}
|
|
199
|
-
:host([stack-mobile]
|
|
175
|
+
:host([stack-mobile][align-top]) .point-aside::after {
|
|
200
176
|
top: 2.6rem;
|
|
201
177
|
right: auto;
|
|
202
178
|
left: 1.75rem;
|
|
@@ -222,10 +198,6 @@ var styles = css`/***************************** 1 ******************************
|
|
|
222
198
|
|
|
223
199
|
::slotted([slot=content]) *:last-child {
|
|
224
200
|
margin-bottom: 0 !important;
|
|
225
|
-
}
|
|
226
|
-
|
|
227
|
-
.it-timeline-point-list .timeline-point .point-content > *:last-child {
|
|
228
|
-
margin-bottom: 0;
|
|
229
201
|
}`;
|
|
230
202
|
|
|
231
203
|
/**
|
|
@@ -348,21 +320,13 @@ let ItTimelinePoint = class ItTimelinePoint extends BaseComponent {
|
|
|
348
320
|
this._updatePointVisualAriaHidden();
|
|
349
321
|
}
|
|
350
322
|
render() {
|
|
351
|
-
const itemClasses = this.composeClass('timeline-point', {
|
|
352
|
-
'timeline-point-align-top': this.alignTop,
|
|
353
|
-
'timeline-point-xs': this.compact,
|
|
354
|
-
[`timeline-point-${this.getColor()}`]: true,
|
|
355
|
-
});
|
|
356
|
-
const asideClasses = this.composeClass('point-aside', `point-aside-${this.getColor()}`);
|
|
357
323
|
return html `
|
|
358
|
-
<div class="
|
|
359
|
-
<
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
<
|
|
364
|
-
<slot name="content"></slot>
|
|
365
|
-
</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>
|
|
366
330
|
</div>
|
|
367
331
|
`;
|
|
368
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":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAMA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA0CG;AAEI,IAAM,eAAe,GAArB,MAAM,eAAgB,SAAQ,aAAa,CAAA;AAA3C,IAAA,WAAA,GAAA;;QAIL,IAAA,CAAA,KAAK,GAAuB,SAAS;QAGrC,IAAA,CAAA,QAAQ,GAAG,KAAK;QAGhB,IAAA,CAAA,OAAO,GAAG,KAAK;AAEf;;;AAGG;QACH,IAAA,CAAA,iBAAiB,GAAG,KAAK;AAEzB;;;AAGG;QACH,IAAA,CAAA,mBAAmB,GAAG,KAAK;IAgF7B;IA9EW,iBAAiB,GAAA;QACxB,IAAI,CAAC,IAAI,CAAC,YAAY,CAAC,MAAM,CAAC,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