@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.
package/package.json ADDED
@@ -0,0 +1,70 @@
1
+ {
2
+ "name": "@italia/thumbnav",
3
+ "description": "Web component it-thumbnav del Design system .italia",
4
+ "version": "1.0.0-alpha.10",
5
+ "publishConfig": {
6
+ "access": "public"
7
+ },
8
+ "license": "BSD-3-Clause",
9
+ "repository": {
10
+ "type": "git",
11
+ "url": "https://github.com/italia/dev-kit-italia.git",
12
+ "directory": "packages/thumbnav"
13
+ },
14
+ "author": "Presidenza del Consiglio dei Ministri",
15
+ "homepage": "https://italia.github.io/dev-kit-italia",
16
+ "bugs": {
17
+ "url": "https://github.com/italia/dev-kit-italia/issues"
18
+ },
19
+ "type": "module",
20
+ "main": "./dist/src/index.js",
21
+ "module": "./dist/src/index.js",
22
+ "types": "./dist/src/it-thumbnav.d.ts",
23
+ "exports": {
24
+ ".": "./dist/src/index.js",
25
+ "./it-thumbnav.js": "./dist/src/it-thumbnav.js",
26
+ "./it-thumbnav-item.js": "./dist/src/it-thumbnav-item.js",
27
+ "./styles/*": "./styles/*"
28
+ },
29
+ "files": [
30
+ "dist/src",
31
+ "styles",
32
+ "README.md",
33
+ "AUTHORS",
34
+ "LICENSE",
35
+ "custom-elements.json"
36
+ ],
37
+ "dependencies": {
38
+ "bootstrap-italia": "3.0.0-alpha.9",
39
+ "lit": "^3.3.0",
40
+ "@italia/globals": "^1.0.0-alpha.10"
41
+ },
42
+ "devDependencies": {
43
+ "@custom-elements-manifest/analyzer": "^0.10.3",
44
+ "@open-wc/testing": "^4.0.0",
45
+ "@rollup/plugin-node-resolve": "^16.0.1",
46
+ "@rollup/plugin-typescript": "^12.1.2",
47
+ "@types/mocha": "^10.0.10",
48
+ "@web/test-runner": "^0.18.2",
49
+ "rimraf": "^6.0.1",
50
+ "rollup": "^4.31.0",
51
+ "rollup-plugin-scss-lit": "^2.1.0",
52
+ "sass": "^1.89.0",
53
+ "stylelint": "^16.19.1",
54
+ "tslib": "^2.8.1",
55
+ "typescript": "^5.5.3",
56
+ "@italia/test-config": "^0.0.0",
57
+ "@italia/typescript-config": "^0.0.0"
58
+ },
59
+ "customElements": "custom-elements.json",
60
+ "scripts": {
61
+ "analyze": "cem analyze --litelement --exclude dist",
62
+ "build": "rollup --config rollup.config.js",
63
+ "clean": "rimraf node_modules .turbo .rollup.cache dist coverage",
64
+ "prepublish": "pnpm build",
65
+ "lint": "eslint --ext .ts \"src/**/*.ts\" \"stories/**/*.ts\" \"test/**/*.ts\" && stylelint \"styles/**/*.scss\" \"src/**/*.scss\" && prettier \"src/**/*.ts\" \"stories/**/*.ts\" \"test/**/*.ts\" --check",
66
+ "format": "eslint --fix --ext .ts \"src/**/*.ts\" \"stories/**/*.ts\" \"test/**/*.ts\" && stylelint --fix \"styles/**/*.scss\" \"src/**/*.scss\" && prettier --write \"src/**/*.ts\" \"stories/**/*.ts\" \"test/**/*.ts\"",
67
+ "test": "wtr --coverage --node-resolve --config web-test-runner.config.js",
68
+ "test:watch": "wtr --coverage --node-resolve --config web-test-runner.config.js --watch"
69
+ }
70
+ }
@@ -0,0 +1,107 @@
1
+ @import 'bootstrap-italia/src/scss/components/thumbnav';
2
+
3
+ // Zoom immagine al passaggio del mouse:
4
+ // non è gestibile da shadow DOM perché richiede di stilizzare
5
+ // un elemento discendente di un elemento slottato (a img).
6
+ it-thumbnav-item a:hover {
7
+ img {
8
+ transform: scale(1.05);
9
+ transition-duration: 1s;
10
+ }
11
+
12
+ &:after {
13
+ transition-duration: 1s;
14
+ }
15
+ }
16
+
17
+ // Disabilita lo zoom quando hover="nozoom" è impostato sul contenitore.
18
+ it-thumbnav[hover='nozoom'] it-thumbnav-item a:hover {
19
+ img {
20
+ transform: none;
21
+ }
22
+ }
23
+
24
+ it-thumbnav-item a img {
25
+ transition: transform 0.4s cubic-bezier(0.15, 0.7, 0.36, 0.99);
26
+ }
27
+
28
+ // Progressive enhancement: nasconde il contenuto non ancora definito
29
+ it-thumbnav:not(:defined) {
30
+ display: flex;
31
+ align-items: center;
32
+ justify-content: center;
33
+
34
+ &[small] it-thumbnav-item:not(:defined) {
35
+ width: 120px;
36
+ }
37
+
38
+ &[position='bottom'] {
39
+ position: absolute;
40
+ bottom: 0;
41
+ left: 50%;
42
+ width: 90%;
43
+ margin-bottom: 16px;
44
+ transform: translateX(-50%);
45
+ }
46
+
47
+ &[position='top'] {
48
+ position: absolute;
49
+ top: 0;
50
+ left: 50%;
51
+ width: 90%;
52
+ margin-top: 16px;
53
+ transform: translateX(-50%);
54
+ }
55
+
56
+ &[position='left'] {
57
+ position: absolute;
58
+ top: 50%;
59
+ left: 0px;
60
+ display: flex;
61
+ height: 90%;
62
+ flex-direction: column;
63
+ align-items: baseline;
64
+ margin-left: 16px;
65
+ transform: translateY(-50%);
66
+ }
67
+
68
+ &[position='right'] {
69
+ position: absolute;
70
+ top: 50%;
71
+ right: 0px;
72
+ display: flex;
73
+ height: 90%;
74
+ flex-direction: column;
75
+ align-items: baseline;
76
+ margin-right: 16px;
77
+ transform: translateY(-50%);
78
+ }
79
+ }
80
+
81
+ it-thumbnav-item:not(:defined) {
82
+ position: relative;
83
+ width: 240px;
84
+ flex: 0 1 auto;
85
+ margin: 8px;
86
+
87
+ a {
88
+ display: block;
89
+
90
+ &::after {
91
+ position: absolute;
92
+ top: 0;
93
+ right: 0;
94
+ bottom: 0;
95
+ left: 0;
96
+ background: var(--it-thumbnav-overlay-bg, transparent);
97
+ content: '';
98
+ opacity: 0;
99
+ transition: opacity 0.4s cubic-bezier(0.15, 0.7, 0.36, 0.99);
100
+ }
101
+
102
+ &.active::after {
103
+ background: var(--#{$prefix}color-background-primary);
104
+ opacity: 0.6;
105
+ }
106
+ }
107
+ }