@italia/thumbnav 1.0.0-alpha.10

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.
@@ -0,0 +1,238 @@
1
+ import { _ as __decorate, B as BaseComponent } from '../index-Cxqk6BEN.js';
2
+ import { css, html } from 'lit';
3
+ import { customElement } from 'lit/decorators.js';
4
+ import 'lit/directive.js';
5
+
6
+ var styles = css`/***************************** 1 ****************************************/
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
+ .thumb-nav {
20
+ --bsi-thumb-nav-gap: var(--bsi-spacing-xxs);
21
+ --bsi-thumb-nav-auto-basis-offset: var(--bsi-spacing-s);
22
+ --bsi-thumb-nav-overlay-offset: var(--bsi-spacing-s);
23
+ --bsi-thumb-nav-item-width: 240px;
24
+ --bsi-thumb-nav-item-width-small: 120px;
25
+ --bsi-thumb-nav-item-height-small-vertical: 80px;
26
+ --bsi-thumb-nav-overlay-bg-primary: var(--bsi-overlay-background-primary);
27
+ --bsi-thumb-nav-overlay-bg-black: var(--bsi-overlay-background-light);
28
+ --bsi-thumb-nav-hover-scale: 1.05;
29
+ --bsi-thumb-nav-transition-duration: 0.4s;
30
+ --bsi-thumb-nav-transition-duration-hover: 1s;
31
+ --bsi-thumb-nav-transition-easing: cubic-bezier(0.15, 0.7, 0.36, 0.99);
32
+ display: flex;
33
+ justify-content: center;
34
+ margin: 0 calc(var(--bsi-thumb-nav-gap) * -1);
35
+ padding: 0;
36
+ }
37
+ .thumb-nav.thumb-nav-vertical {
38
+ flex-direction: column;
39
+ align-items: baseline;
40
+ }
41
+ .thumb-nav.thumb-nav-vertical .thumb-nav-resizer {
42
+ width: auto;
43
+ height: 100%;
44
+ }
45
+ .thumb-nav.thumb-nav-vertical.thumb-nav-small li {
46
+ height: var(--bsi-thumb-nav-item-height-small-vertical);
47
+ }
48
+ .thumb-nav.thumb-nav-fixed {
49
+ flex-wrap: wrap;
50
+ justify-content: flex-start;
51
+ }
52
+ .thumb-nav.thumb-nav-fixed li {
53
+ flex-basis: var(--bsi-thumb-nav-item-width);
54
+ }
55
+ .thumb-nav.thumb-nav-fixed.thumb-nav-small li {
56
+ flex-basis: var(--bsi-thumb-nav-item-width-small);
57
+ }
58
+ .thumb-nav.thumb-nav-auto {
59
+ flex-wrap: wrap;
60
+ justify-content: flex-start;
61
+ }
62
+ .thumb-nav.thumb-nav-auto li .thumb-nav-resizer {
63
+ max-width: 100%;
64
+ max-height: 100%;
65
+ }
66
+ .thumb-nav.thumb-nav-auto.thumb-nav-auto-2 li {
67
+ flex-basis: calc(50% - var(--bsi-thumb-nav-auto-basis-offset));
68
+ }
69
+ .thumb-nav.thumb-nav-auto.thumb-nav-auto-3 li {
70
+ flex-basis: calc(33.3333% - var(--bsi-thumb-nav-auto-basis-offset));
71
+ }
72
+ .thumb-nav.thumb-nav-auto.thumb-nav-auto-4 li {
73
+ flex-basis: calc(25% - var(--bsi-thumb-nav-auto-basis-offset));
74
+ }
75
+ .thumb-nav.thumb-nav-auto.thumb-nav-auto-5 li {
76
+ flex-basis: calc(20% - var(--bsi-thumb-nav-auto-basis-offset));
77
+ }
78
+ .thumb-nav.thumb-nav-nozoom a:hover img {
79
+ transform: none;
80
+ }
81
+ .thumb-nav.thumb-nav-black a:hover:after, .thumb-nav.thumb-nav-primary a:hover:after {
82
+ opacity: 1;
83
+ }
84
+ .thumb-nav.thumb-nav-black a:after {
85
+ background: var(--bsi-thumb-nav-overlay-bg-black);
86
+ }
87
+ .thumb-nav.thumb-nav-primary a:after {
88
+ background: var(--bsi-thumb-nav-overlay-bg-primary);
89
+ }
90
+ .thumb-nav.thumb-nav-bottom, .thumb-nav.thumb-nav-top {
91
+ position: absolute;
92
+ left: 50%;
93
+ width: 90%;
94
+ transform: translateX(-50%);
95
+ }
96
+ .thumb-nav.thumb-nav-bottom {
97
+ bottom: 0;
98
+ margin-bottom: var(--bsi-thumb-nav-overlay-offset);
99
+ }
100
+ .thumb-nav.thumb-nav-top {
101
+ top: 0;
102
+ margin-top: var(--bsi-thumb-nav-overlay-offset);
103
+ }
104
+ .thumb-nav.thumb-nav-left, .thumb-nav.thumb-nav-right {
105
+ position: absolute;
106
+ top: 50%;
107
+ height: 90%;
108
+ transform: translateY(-50%);
109
+ }
110
+ .thumb-nav.thumb-nav-left {
111
+ left: 0;
112
+ margin-left: var(--bsi-thumb-nav-overlay-offset);
113
+ }
114
+ .thumb-nav.thumb-nav-right {
115
+ right: 0;
116
+ margin-right: var(--bsi-thumb-nav-overlay-offset);
117
+ }
118
+ .thumb-nav li {
119
+ position: relative;
120
+ flex: 0 1 auto;
121
+ width: var(--bsi-thumb-nav-item-width);
122
+ margin: var(--bsi-thumb-nav-gap);
123
+ list-style-type: none;
124
+ }
125
+ .thumb-nav .thumb-nav-resizer {
126
+ visibility: hidden;
127
+ width: 100%;
128
+ height: auto;
129
+ }
130
+ .thumb-nav.thumb-nav-small li {
131
+ width: var(--bsi-thumb-nav-item-width-small);
132
+ }
133
+ .thumb-nav a {
134
+ position: relative;
135
+ display: block;
136
+ overflow: hidden;
137
+ }
138
+ .thumb-nav a:after {
139
+ position: absolute;
140
+ top: 0;
141
+ right: 0;
142
+ bottom: 0;
143
+ left: 0;
144
+ content: "";
145
+ opacity: 0;
146
+ transition: opacity var(--bsi-thumb-nav-transition-duration) var(--bsi-thumb-nav-transition-easing);
147
+ }
148
+ .thumb-nav a.active {
149
+ pointer-events: none;
150
+ }
151
+ .thumb-nav a.active:after {
152
+ opacity: 1;
153
+ background: var(--bsi-thumb-nav-overlay-bg);
154
+ }
155
+ .thumb-nav a:hover img {
156
+ transform: scale(var(--bsi-thumb-nav-hover-scale));
157
+ transition-duration: var(--bsi-thumb-nav-transition-duration-hover);
158
+ }
159
+ .thumb-nav a:hover:after {
160
+ transition-duration: var(--bsi-thumb-nav-transition-duration-hover);
161
+ }
162
+ .thumb-nav a img {
163
+ position: absolute;
164
+ top: 0;
165
+ left: 0;
166
+ width: 100%;
167
+ height: 100%;
168
+ transition: transform var(--bsi-thumb-nav-transition-duration) var(--bsi-thumb-nav-transition-easing);
169
+ object-fit: cover;
170
+ }
171
+
172
+ :host {
173
+ display: block;
174
+ }
175
+
176
+ li {
177
+ position: relative;
178
+ width: 100%;
179
+ height: 100%;
180
+ padding: 0;
181
+ margin: 0;
182
+ }
183
+
184
+ @supports (font: -apple-system-body) and (-webkit-appearance: none) {
185
+ li::marker {
186
+ font-size: 0;
187
+ }
188
+ }
189
+ ::slotted(a) {
190
+ position: relative;
191
+ display: block;
192
+ overflow: hidden;
193
+ }
194
+
195
+ ::slotted(a)::after {
196
+ position: absolute;
197
+ top: 0;
198
+ right: 0;
199
+ bottom: 0;
200
+ left: 0;
201
+ background: var(--it-thumbnav-overlay-bg, transparent);
202
+ content: "";
203
+ opacity: 0;
204
+ transition: opacity 0.4s cubic-bezier(0.15, 0.7, 0.36, 0.99);
205
+ }
206
+
207
+ ::slotted(a:hover)::after {
208
+ opacity: var(--it-thumbnav-overlay-hover-opacity, 0);
209
+ transition-duration: 1s;
210
+ }
211
+
212
+ ::slotted(a.active) {
213
+ pointer-events: none;
214
+ }
215
+
216
+ ::slotted(a.active)::after {
217
+ background: var(--bsi-color-background-primary);
218
+ opacity: 0.6;
219
+ }`;
220
+
221
+ /**
222
+ * Singolo elemento della Thumbnav.
223
+ * Inserisce il contenuto (tipicamente un anchor con immagine) in un elemento `<li>`.
224
+ * Lo stato attivo si gestisce aggiungendo la classe `active` all'anchor nello slot:
225
+ * `<a href="#" class="ratio ratio-3x2 active"><img …></a>`
226
+ */
227
+ let ItThumbnavItem = class ItThumbnavItem extends BaseComponent {
228
+ render() {
229
+ return html `<li><slot></slot></li>`;
230
+ }
231
+ };
232
+ ItThumbnavItem.styles = styles;
233
+ ItThumbnavItem = __decorate([
234
+ customElement('it-thumbnav-item')
235
+ ], ItThumbnavItem);
236
+
237
+ export { ItThumbnavItem };
238
+ //# sourceMappingURL=it-thumbnav-item.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"it-thumbnav-item.js","sources":["../../../src/it-thumbnav-item.ts"],"sourcesContent":["import { BaseComponent } from '@italia/globals';\nimport { html } from 'lit';\nimport { customElement } from 'lit/decorators.js';\nimport styles from './thumbnav-item.scss';\n\n/**\n * Singolo elemento della Thumbnav.\n * Inserisce il contenuto (tipicamente un anchor con immagine) in un elemento `<li>`.\n * Lo stato attivo si gestisce aggiungendo la classe `active` all'anchor nello slot:\n * `<a href=\"#\" class=\"ratio ratio-3x2 active\"><img …></a>`\n */\n@customElement('it-thumbnav-item')\nexport class ItThumbnavItem extends BaseComponent {\n static styles = styles;\n\n override render() {\n return html`<li><slot></slot></li>`;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'it-thumbnav-item': ItThumbnavItem;\n }\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAKA;;;;;AAKG;AAEI,IAAM,cAAc,GAApB,MAAM,cAAe,SAAQ,aAAa,CAAA;IAGtC,MAAM,GAAA;QACb,OAAO,IAAI,CAAA,CAAA,sBAAA,CAAwB;IACrC;;AAJO,cAAA,CAAA,MAAM,GAAG,MAAH;AADF,cAAc,GAAA,UAAA,CAAA;IAD1B,aAAa,CAAC,kBAAkB;AACpB,CAAA,EAAA,cAAc,CAM1B;;;;"}
@@ -0,0 +1,50 @@
1
+ import { BaseComponent } from '@italia/globals';
2
+ import type { ThumbnnavHoverEffect, ThumbnnavPosition, ThumbnnavAutoColumns } from './types.js';
3
+ /**
4
+ * Contenitore Thumbnav: lista di link con immagini thumbnail.
5
+ * I singoli elementi vanno inseriti tramite `it-thumbnav-item`.
6
+ *
7
+ * ```html
8
+ * <it-thumbnav>
9
+ * <it-thumbnav-item>
10
+ * <a href="#" class="ratio ratio-3x2"><img src="…" alt="…"></a>
11
+ * </it-thumbnav-item>
12
+ * </it-thumbnav>
13
+ * ```
14
+ */
15
+ export declare class ItThumbnav extends BaseComponent {
16
+ static styles: import("lit").CSSResultGroup;
17
+ /** Usa thumbnail di dimensione ridotta (120px invece di 240px). */
18
+ small: boolean;
19
+ /**
20
+ * Dispone le thumbnail in colonna verticale.
21
+ * Viene applicato automaticamente quando `position` è `left` o `right`.
22
+ */
23
+ vertical: boolean;
24
+ /** Larghezza fissa per ogni thumbnail (240px o 120px se `small`). */
25
+ fixed: boolean;
26
+ /**
27
+ * Effetto hover sull'immagine.
28
+ * - `nozoom`: disabilita lo zoom al passaggio del mouse.
29
+ * - `black`: overlay nero semitrasparente.
30
+ * - `primary`: overlay di colore primary semitrasparente.
31
+ */
32
+ hover?: ThumbnnavHoverEffect;
33
+ /**
34
+ * Griglia a larghezza automatica: numero di thumbnail per riga (2–5).
35
+ * Equivale alle classi `.thumb-nav-auto.thumb-nav-auto-N`.
36
+ */
37
+ auto?: ThumbnnavAutoColumns;
38
+ /**
39
+ * Posizione in overlay all'interno di un contenitore `.position-relative`.
40
+ * Valori: `bottom`, `top`, `left`, `right`.
41
+ */
42
+ position?: ThumbnnavPosition;
43
+ render(): import("lit").TemplateResult<1>;
44
+ }
45
+ declare global {
46
+ interface HTMLElementTagNameMap {
47
+ 'it-thumbnav': ItThumbnav;
48
+ }
49
+ }
50
+ //# sourceMappingURL=it-thumbnav.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"it-thumbnav.d.ts","sourceRoot":"","sources":["../../src/it-thumbnav.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAIhD,OAAO,KAAK,EAAE,oBAAoB,EAAE,iBAAiB,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAC;AAGhG;;;;;;;;;;;GAWG;AACH,qBACa,UAAW,SAAQ,aAAa;IAC3C,MAAM,CAAC,MAAM,+BAAU;IAEvB,mEAAmE;IAEnE,KAAK,UAAS;IAEd;;;OAGG;IAEH,QAAQ,UAAS;IAEjB,qEAAqE;IAErE,KAAK,UAAS;IAEd;;;;;OAKG;IAEH,KAAK,CAAC,EAAE,oBAAoB,CAAC;IAE7B;;;OAGG;IAEH,IAAI,CAAC,EAAE,oBAAoB,CAAC;IAE5B;;;OAGG;IAEH,QAAQ,CAAC,EAAE,iBAAiB,CAAC;IAEpB,MAAM;CAsBhB;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,aAAa,EAAE,UAAU,CAAC;KAC3B;CACF"}
@@ -0,0 +1,317 @@
1
+ import { _ as __decorate, a as __metadata, B as BaseComponent } from '../index-Cxqk6BEN.js';
2
+ import { css, html } from 'lit';
3
+ import { property, customElement } from 'lit/decorators.js';
4
+ import { classMap } from 'lit/directives/class-map.js';
5
+ import 'lit/directive.js';
6
+
7
+ var styles = css`/***************************** 1 ****************************************/
8
+ /***************************** 2 ****************************************/
9
+ /***************************** 1 ****************************************/
10
+ /***************************** 2 ****************************************/
11
+ /***************************** 1 ****************************************/
12
+ /***************************** 2 ****************************************/
13
+ /***************************** 3 ****************************************/
14
+ /***************************** 1 ****************************************/
15
+ /***************************** 2 ****************************************/
16
+ /***************************** 3 ****************************************/
17
+ /***************************** NEUTRAL 1 ****************************************/
18
+ /***************************** NEUTRAL 2 ****************************************/
19
+ /***************************** NEUTRAL 2 / 3 ****************************************/
20
+ .thumb-nav {
21
+ --bsi-thumb-nav-gap: var(--bsi-spacing-xxs);
22
+ --bsi-thumb-nav-auto-basis-offset: var(--bsi-spacing-s);
23
+ --bsi-thumb-nav-overlay-offset: var(--bsi-spacing-s);
24
+ --bsi-thumb-nav-item-width: 240px;
25
+ --bsi-thumb-nav-item-width-small: 120px;
26
+ --bsi-thumb-nav-item-height-small-vertical: 80px;
27
+ --bsi-thumb-nav-overlay-bg-primary: var(--bsi-overlay-background-primary);
28
+ --bsi-thumb-nav-overlay-bg-black: var(--bsi-overlay-background-light);
29
+ --bsi-thumb-nav-hover-scale: 1.05;
30
+ --bsi-thumb-nav-transition-duration: 0.4s;
31
+ --bsi-thumb-nav-transition-duration-hover: 1s;
32
+ --bsi-thumb-nav-transition-easing: cubic-bezier(0.15, 0.7, 0.36, 0.99);
33
+ display: flex;
34
+ justify-content: center;
35
+ margin: 0 calc(var(--bsi-thumb-nav-gap) * -1);
36
+ padding: 0;
37
+ }
38
+ .thumb-nav.thumb-nav-vertical {
39
+ flex-direction: column;
40
+ align-items: baseline;
41
+ }
42
+ .thumb-nav.thumb-nav-vertical .thumb-nav-resizer {
43
+ width: auto;
44
+ height: 100%;
45
+ }
46
+ .thumb-nav.thumb-nav-vertical.thumb-nav-small li {
47
+ height: var(--bsi-thumb-nav-item-height-small-vertical);
48
+ }
49
+ .thumb-nav.thumb-nav-fixed {
50
+ flex-wrap: wrap;
51
+ justify-content: flex-start;
52
+ }
53
+ .thumb-nav.thumb-nav-fixed li {
54
+ flex-basis: var(--bsi-thumb-nav-item-width);
55
+ }
56
+ .thumb-nav.thumb-nav-fixed.thumb-nav-small li {
57
+ flex-basis: var(--bsi-thumb-nav-item-width-small);
58
+ }
59
+ .thumb-nav.thumb-nav-auto {
60
+ flex-wrap: wrap;
61
+ justify-content: flex-start;
62
+ }
63
+ .thumb-nav.thumb-nav-auto li .thumb-nav-resizer {
64
+ max-width: 100%;
65
+ max-height: 100%;
66
+ }
67
+ .thumb-nav.thumb-nav-auto.thumb-nav-auto-2 li {
68
+ flex-basis: calc(50% - var(--bsi-thumb-nav-auto-basis-offset));
69
+ }
70
+ .thumb-nav.thumb-nav-auto.thumb-nav-auto-3 li {
71
+ flex-basis: calc(33.3333% - var(--bsi-thumb-nav-auto-basis-offset));
72
+ }
73
+ .thumb-nav.thumb-nav-auto.thumb-nav-auto-4 li {
74
+ flex-basis: calc(25% - var(--bsi-thumb-nav-auto-basis-offset));
75
+ }
76
+ .thumb-nav.thumb-nav-auto.thumb-nav-auto-5 li {
77
+ flex-basis: calc(20% - var(--bsi-thumb-nav-auto-basis-offset));
78
+ }
79
+ .thumb-nav.thumb-nav-nozoom a:hover img {
80
+ transform: none;
81
+ }
82
+ .thumb-nav.thumb-nav-black a:hover:after, .thumb-nav.thumb-nav-primary a:hover:after {
83
+ opacity: 1;
84
+ }
85
+ .thumb-nav.thumb-nav-black a:after {
86
+ background: var(--bsi-thumb-nav-overlay-bg-black);
87
+ }
88
+ .thumb-nav.thumb-nav-primary a:after {
89
+ background: var(--bsi-thumb-nav-overlay-bg-primary);
90
+ }
91
+ .thumb-nav.thumb-nav-bottom, .thumb-nav.thumb-nav-top {
92
+ position: absolute;
93
+ left: 50%;
94
+ width: 90%;
95
+ transform: translateX(-50%);
96
+ }
97
+ .thumb-nav.thumb-nav-bottom {
98
+ bottom: 0;
99
+ margin-bottom: var(--bsi-thumb-nav-overlay-offset);
100
+ }
101
+ .thumb-nav.thumb-nav-top {
102
+ top: 0;
103
+ margin-top: var(--bsi-thumb-nav-overlay-offset);
104
+ }
105
+ .thumb-nav.thumb-nav-left, .thumb-nav.thumb-nav-right {
106
+ position: absolute;
107
+ top: 50%;
108
+ height: 90%;
109
+ transform: translateY(-50%);
110
+ }
111
+ .thumb-nav.thumb-nav-left {
112
+ left: 0;
113
+ margin-left: var(--bsi-thumb-nav-overlay-offset);
114
+ }
115
+ .thumb-nav.thumb-nav-right {
116
+ right: 0;
117
+ margin-right: var(--bsi-thumb-nav-overlay-offset);
118
+ }
119
+ .thumb-nav li {
120
+ position: relative;
121
+ flex: 0 1 auto;
122
+ width: var(--bsi-thumb-nav-item-width);
123
+ margin: var(--bsi-thumb-nav-gap);
124
+ list-style-type: none;
125
+ }
126
+ .thumb-nav .thumb-nav-resizer {
127
+ visibility: hidden;
128
+ width: 100%;
129
+ height: auto;
130
+ }
131
+ .thumb-nav.thumb-nav-small li {
132
+ width: var(--bsi-thumb-nav-item-width-small);
133
+ }
134
+ .thumb-nav a {
135
+ position: relative;
136
+ display: block;
137
+ overflow: hidden;
138
+ }
139
+ .thumb-nav a:after {
140
+ position: absolute;
141
+ top: 0;
142
+ right: 0;
143
+ bottom: 0;
144
+ left: 0;
145
+ content: "";
146
+ opacity: 0;
147
+ transition: opacity var(--bsi-thumb-nav-transition-duration) var(--bsi-thumb-nav-transition-easing);
148
+ }
149
+ .thumb-nav a.active {
150
+ pointer-events: none;
151
+ }
152
+ .thumb-nav a.active:after {
153
+ opacity: 1;
154
+ background: var(--bsi-thumb-nav-overlay-bg);
155
+ }
156
+ .thumb-nav a:hover img {
157
+ transform: scale(var(--bsi-thumb-nav-hover-scale));
158
+ transition-duration: var(--bsi-thumb-nav-transition-duration-hover);
159
+ }
160
+ .thumb-nav a:hover:after {
161
+ transition-duration: var(--bsi-thumb-nav-transition-duration-hover);
162
+ }
163
+ .thumb-nav a img {
164
+ position: absolute;
165
+ top: 0;
166
+ left: 0;
167
+ width: 100%;
168
+ height: 100%;
169
+ transition: transform var(--bsi-thumb-nav-transition-duration) var(--bsi-thumb-nav-transition-easing);
170
+ object-fit: cover;
171
+ }
172
+
173
+ :host {
174
+ display: block;
175
+ }
176
+
177
+ ul {
178
+ list-style: none;
179
+ }
180
+ @supports (font: -apple-system-body) and (-webkit-appearance: none) {
181
+ ul {
182
+ list-style: disc;
183
+ }
184
+ }
185
+
186
+ .thumb-nav ::slotted(it-thumbnav-item) {
187
+ position: relative;
188
+ width: 240px;
189
+ flex: 0 1 auto;
190
+ margin: 8px;
191
+ }
192
+
193
+ .thumb-nav.thumb-nav-small ::slotted(it-thumbnav-item) {
194
+ width: 120px;
195
+ }
196
+
197
+ .thumb-nav.thumb-nav-vertical.thumb-nav-small ::slotted(it-thumbnav-item) {
198
+ height: 80px;
199
+ }
200
+
201
+ .thumb-nav.thumb-nav-fixed ::slotted(it-thumbnav-item) {
202
+ width: auto;
203
+ flex-basis: 240px;
204
+ }
205
+
206
+ .thumb-nav.thumb-nav-fixed.thumb-nav-small ::slotted(it-thumbnav-item) {
207
+ flex-basis: 120px;
208
+ }
209
+
210
+ .thumb-nav.thumb-nav-auto ::slotted(it-thumbnav-item) {
211
+ width: auto;
212
+ }
213
+
214
+ .thumb-nav.thumb-nav-auto.thumb-nav-auto-2 ::slotted(it-thumbnav-item) {
215
+ flex-basis: calc(50% - 16px);
216
+ }
217
+
218
+ .thumb-nav.thumb-nav-auto.thumb-nav-auto-3 ::slotted(it-thumbnav-item) {
219
+ flex-basis: calc(33.3333% - 16px);
220
+ }
221
+
222
+ .thumb-nav.thumb-nav-auto.thumb-nav-auto-4 ::slotted(it-thumbnav-item) {
223
+ flex-basis: calc(25% - 16px);
224
+ }
225
+
226
+ .thumb-nav.thumb-nav-auto.thumb-nav-auto-5 ::slotted(it-thumbnav-item) {
227
+ flex-basis: calc(20% - 16px);
228
+ }
229
+
230
+ :host([hover=black]) {
231
+ --it-thumbnav-overlay-bg: rgb(0, 0, 0);
232
+ --it-thumbnav-overlay-hover-opacity: 0.8;
233
+ }
234
+
235
+ :host([hover=primary]) {
236
+ --it-thumbnav-overlay-bg: var(--bsi-color-background-primary);
237
+ --it-thumbnav-overlay-hover-opacity: 0.8;
238
+ }`;
239
+
240
+ /**
241
+ * Contenitore Thumbnav: lista di link con immagini thumbnail.
242
+ * I singoli elementi vanno inseriti tramite `it-thumbnav-item`.
243
+ *
244
+ * ```html
245
+ * <it-thumbnav>
246
+ * <it-thumbnav-item>
247
+ * <a href="#" class="ratio ratio-3x2"><img src="…" alt="…"></a>
248
+ * </it-thumbnav-item>
249
+ * </it-thumbnav>
250
+ * ```
251
+ */
252
+ let ItThumbnav = class ItThumbnav extends BaseComponent {
253
+ constructor() {
254
+ super(...arguments);
255
+ /** Usa thumbnail di dimensione ridotta (120px invece di 240px). */
256
+ this.small = false;
257
+ /**
258
+ * Dispone le thumbnail in colonna verticale.
259
+ * Viene applicato automaticamente quando `position` è `left` o `right`.
260
+ */
261
+ this.vertical = false;
262
+ /** Larghezza fissa per ogni thumbnail (240px o 120px se `small`). */
263
+ this.fixed = false;
264
+ }
265
+ render() {
266
+ const effectiveVertical = this.vertical || this.position === 'left' || this.position === 'right';
267
+ const classes = classMap({
268
+ 'thumb-nav': true,
269
+ 'thumb-nav-small': this.small,
270
+ 'thumb-nav-vertical': effectiveVertical,
271
+ 'thumb-nav-fixed': this.fixed,
272
+ 'thumb-nav-nozoom': this.hover === 'nozoom',
273
+ 'thumb-nav-black': this.hover === 'black',
274
+ 'thumb-nav-primary': this.hover === 'primary',
275
+ 'thumb-nav-auto': this.auto != null,
276
+ [`thumb-nav-auto-${this.auto}`]: this.auto != null,
277
+ 'thumb-nav-bottom': this.position === 'bottom',
278
+ 'thumb-nav-top': this.position === 'top',
279
+ 'thumb-nav-left': this.position === 'left',
280
+ 'thumb-nav-right': this.position === 'right',
281
+ });
282
+ return html `<ul class="${classes}" part="thumbnav" role="list">
283
+ <slot></slot>
284
+ </ul>`;
285
+ }
286
+ };
287
+ ItThumbnav.styles = styles;
288
+ __decorate([
289
+ property({ type: Boolean, reflect: true }),
290
+ __metadata("design:type", Object)
291
+ ], ItThumbnav.prototype, "small", void 0);
292
+ __decorate([
293
+ property({ type: Boolean, reflect: true }),
294
+ __metadata("design:type", Object)
295
+ ], ItThumbnav.prototype, "vertical", void 0);
296
+ __decorate([
297
+ property({ type: Boolean, reflect: true }),
298
+ __metadata("design:type", Object)
299
+ ], ItThumbnav.prototype, "fixed", void 0);
300
+ __decorate([
301
+ property({ type: String, reflect: true }),
302
+ __metadata("design:type", String)
303
+ ], ItThumbnav.prototype, "hover", void 0);
304
+ __decorate([
305
+ property({ type: Number, reflect: true }),
306
+ __metadata("design:type", Number)
307
+ ], ItThumbnav.prototype, "auto", void 0);
308
+ __decorate([
309
+ property({ type: String, reflect: true }),
310
+ __metadata("design:type", String)
311
+ ], ItThumbnav.prototype, "position", void 0);
312
+ ItThumbnav = __decorate([
313
+ customElement('it-thumbnav')
314
+ ], ItThumbnav);
315
+
316
+ export { ItThumbnav };
317
+ //# sourceMappingURL=it-thumbnav.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"it-thumbnav.js","sources":["../../../src/it-thumbnav.ts"],"sourcesContent":["/* eslint-disable lit-a11y/no-redundant-role */\n/* eslint-disable lit-a11y/list */\nimport { BaseComponent } from '@italia/globals';\nimport { html } from 'lit';\nimport { customElement, property } from 'lit/decorators.js';\nimport { classMap } from 'lit/directives/class-map.js';\nimport type { ThumbnnavHoverEffect, ThumbnnavPosition, ThumbnnavAutoColumns } from './types.js';\nimport styles from './thumbnav.scss';\n\n/**\n * Contenitore Thumbnav: lista di link con immagini thumbnail.\n * I singoli elementi vanno inseriti tramite `it-thumbnav-item`.\n *\n * ```html\n * <it-thumbnav>\n * <it-thumbnav-item>\n * <a href=\"#\" class=\"ratio ratio-3x2\"><img src=\"…\" alt=\"…\"></a>\n * </it-thumbnav-item>\n * </it-thumbnav>\n * ```\n */\n@customElement('it-thumbnav')\nexport class ItThumbnav extends BaseComponent {\n static styles = styles;\n\n /** Usa thumbnail di dimensione ridotta (120px invece di 240px). */\n @property({ type: Boolean, reflect: true })\n small = false;\n\n /**\n * Dispone le thumbnail in colonna verticale.\n * Viene applicato automaticamente quando `position` è `left` o `right`.\n */\n @property({ type: Boolean, reflect: true })\n vertical = false;\n\n /** Larghezza fissa per ogni thumbnail (240px o 120px se `small`). */\n @property({ type: Boolean, reflect: true })\n fixed = false;\n\n /**\n * Effetto hover sull'immagine.\n * - `nozoom`: disabilita lo zoom al passaggio del mouse.\n * - `black`: overlay nero semitrasparente.\n * - `primary`: overlay di colore primary semitrasparente.\n */\n @property({ type: String, reflect: true })\n hover?: ThumbnnavHoverEffect;\n\n /**\n * Griglia a larghezza automatica: numero di thumbnail per riga (2–5).\n * Equivale alle classi `.thumb-nav-auto.thumb-nav-auto-N`.\n */\n @property({ type: Number, reflect: true })\n auto?: ThumbnnavAutoColumns;\n\n /**\n * Posizione in overlay all'interno di un contenitore `.position-relative`.\n * Valori: `bottom`, `top`, `left`, `right`.\n */\n @property({ type: String, reflect: true })\n position?: ThumbnnavPosition;\n\n override render() {\n const effectiveVertical = this.vertical || this.position === 'left' || this.position === 'right';\n const classes = classMap({\n 'thumb-nav': true,\n 'thumb-nav-small': this.small,\n 'thumb-nav-vertical': effectiveVertical,\n 'thumb-nav-fixed': this.fixed,\n 'thumb-nav-nozoom': this.hover === 'nozoom',\n 'thumb-nav-black': this.hover === 'black',\n 'thumb-nav-primary': this.hover === 'primary',\n 'thumb-nav-auto': this.auto != null,\n [`thumb-nav-auto-${this.auto}`]: this.auto != null,\n 'thumb-nav-bottom': this.position === 'bottom',\n 'thumb-nav-top': this.position === 'top',\n 'thumb-nav-left': this.position === 'left',\n 'thumb-nav-right': this.position === 'right',\n });\n\n return html`<ul class=\"${classes}\" part=\"thumbnav\" role=\"list\">\n <slot></slot>\n </ul>`;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'it-thumbnav': ItThumbnav;\n }\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AASA;;;;;;;;;;;AAWG;AAEI,IAAM,UAAU,GAAhB,MAAM,UAAW,SAAQ,aAAa,CAAA;AAAtC,IAAA,WAAA,GAAA;;;QAKL,IAAA,CAAA,KAAK,GAAG,KAAK;AAEb;;;AAGG;QAEH,IAAA,CAAA,QAAQ,GAAG,KAAK;;QAIhB,IAAA,CAAA,KAAK,GAAG,KAAK;IA+Cf;IAtBW,MAAM,GAAA;AACb,QAAA,MAAM,iBAAiB,GAAG,IAAI,CAAC,QAAQ,IAAI,IAAI,CAAC,QAAQ,KAAK,MAAM,IAAI,IAAI,CAAC,QAAQ,KAAK,OAAO;QAChG,MAAM,OAAO,GAAG,QAAQ,CAAC;AACvB,YAAA,WAAW,EAAE,IAAI;YACjB,iBAAiB,EAAE,IAAI,CAAC,KAAK;AAC7B,YAAA,oBAAoB,EAAE,iBAAiB;YACvC,iBAAiB,EAAE,IAAI,CAAC,KAAK;AAC7B,YAAA,kBAAkB,EAAE,IAAI,CAAC,KAAK,KAAK,QAAQ;AAC3C,YAAA,iBAAiB,EAAE,IAAI,CAAC,KAAK,KAAK,OAAO;AACzC,YAAA,mBAAmB,EAAE,IAAI,CAAC,KAAK,KAAK,SAAS;AAC7C,YAAA,gBAAgB,EAAE,IAAI,CAAC,IAAI,IAAI,IAAI;YACnC,CAAC,CAAA,eAAA,EAAkB,IAAI,CAAC,IAAI,CAAA,CAAE,GAAG,IAAI,CAAC,IAAI,IAAI,IAAI;AAClD,YAAA,kBAAkB,EAAE,IAAI,CAAC,QAAQ,KAAK,QAAQ;AAC9C,YAAA,eAAe,EAAE,IAAI,CAAC,QAAQ,KAAK,KAAK;AACxC,YAAA,gBAAgB,EAAE,IAAI,CAAC,QAAQ,KAAK,MAAM;AAC1C,YAAA,iBAAiB,EAAE,IAAI,CAAC,QAAQ,KAAK,OAAO;AAC7C,SAAA,CAAC;QAEF,OAAO,IAAI,CAAA,CAAA,WAAA,EAAc,OAAO,CAAA;;UAE1B;IACR;;AA7DO,UAAA,CAAA,MAAM,GAAG,MAAH;AAIb,UAAA,CAAA;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;;AAC7B,CAAA,EAAA,UAAA,CAAA,SAAA,EAAA,OAAA,EAAA,MAAA,CAAA;AAOd,UAAA,CAAA;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;;AAC1B,CAAA,EAAA,UAAA,CAAA,SAAA,EAAA,UAAA,EAAA,MAAA,CAAA;AAIjB,UAAA,CAAA;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;;AAC7B,CAAA,EAAA,UAAA,CAAA,SAAA,EAAA,OAAA,EAAA,MAAA,CAAA;AASd,UAAA,CAAA;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;;AACb,CAAA,EAAA,UAAA,CAAA,SAAA,EAAA,OAAA,EAAA,MAAA,CAAA;AAO7B,UAAA,CAAA;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;;AACd,CAAA,EAAA,UAAA,CAAA,SAAA,EAAA,MAAA,EAAA,MAAA,CAAA;AAO5B,UAAA,CAAA;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;;AACb,CAAA,EAAA,UAAA,CAAA,SAAA,EAAA,UAAA,EAAA,MAAA,CAAA;AAvClB,UAAU,GAAA,UAAA,CAAA;IADtB,aAAa,CAAC,aAAa;AACf,CAAA,EAAA,UAAU,CA+DtB;;;;"}
@@ -0,0 +1,7 @@
1
+ export declare const THUMBNAV_HOVER_EFFECTS: readonly ["nozoom", "black", "primary"];
2
+ export declare const THUMBNAV_POSITIONS: readonly ["bottom", "top", "left", "right"];
3
+ export declare const THUMBNAV_AUTO_COLUMNS: readonly [2, 3, 4, 5];
4
+ export type ThumbnnavHoverEffect = (typeof THUMBNAV_HOVER_EFFECTS)[number];
5
+ export type ThumbnnavPosition = (typeof THUMBNAV_POSITIONS)[number];
6
+ export type ThumbnnavAutoColumns = (typeof THUMBNAV_AUTO_COLUMNS)[number];
7
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/types.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,sBAAsB,yCAA0C,CAAC;AAC9E,eAAO,MAAM,kBAAkB,6CAA8C,CAAC;AAC9E,eAAO,MAAM,qBAAqB,uBAAwB,CAAC;AAE3D,MAAM,MAAM,oBAAoB,GAAG,CAAC,OAAO,sBAAsB,CAAC,CAAC,MAAM,CAAC,CAAC;AAC3E,MAAM,MAAM,iBAAiB,GAAG,CAAC,OAAO,kBAAkB,CAAC,CAAC,MAAM,CAAC,CAAC;AACpE,MAAM,MAAM,oBAAoB,GAAG,CAAC,OAAO,qBAAqB,CAAC,CAAC,MAAM,CAAC,CAAC"}