@italia/icon 0.1.0-alpha.1 → 1.0.0-alpha.4

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 CHANGED
@@ -1,20 +1,20 @@
1
1
  {
2
2
  "name": "@italia/icon",
3
3
  "description": "Web component it-icon del Design system .italia",
4
- "version": "0.1.0-alpha.1",
4
+ "version": "1.0.0-alpha.4",
5
5
  "publishConfig": {
6
6
  "access": "public"
7
7
  },
8
8
  "license": "BSD-3-Clause",
9
9
  "repository": {
10
10
  "type": "git",
11
- "url": "https://github.com/italia/design-web-components.git",
11
+ "url": "https://github.com/italia/dev-kit-italia.git",
12
12
  "directory": "packages/icon"
13
13
  },
14
14
  "author": "Presidenza del Consiglio dei Ministri",
15
- "homepage": "https://italia.github.io/design-web-components",
15
+ "homepage": "https://italia.github.io/dev-kit-italia",
16
16
  "bugs": {
17
- "url": "https://github.com/italia/design-web-components/issues"
17
+ "url": "https://github.com/italia/dev-kit-italia/issues"
18
18
  },
19
19
  "type": "module",
20
20
  "main": "./dist/src/index.js",
@@ -28,16 +28,16 @@
28
28
  },
29
29
  "files": [
30
30
  "dist/src",
31
+ "styles",
31
32
  "README.md",
32
33
  "AUTHORS",
33
34
  "LICENSE",
34
- "custom-elements.json",
35
- "styles"
35
+ "custom-elements.json"
36
36
  ],
37
37
  "dependencies": {
38
- "bootstrap-italia": "github:italia/bootstrap-italia#3f5dafbd16d608fe706780952aeb1f5ae20e447e",
38
+ "bootstrap-italia": "github:italia/bootstrap-italia#ba6eddb24194f44d1080deb24701e0603457d176",
39
39
  "lit": "^3.3.0",
40
- "@italia/globals": "^0.1.0-alpha.1"
40
+ "@italia/globals": "^1.0.0-alpha.4"
41
41
  },
42
42
  "devDependencies": {
43
43
  "@custom-elements-manifest/analyzer": "^0.10.3",
@@ -49,6 +49,7 @@
49
49
  "@web/test-runner-commands": "^0.9.0",
50
50
  "rimraf": "^6.0.1",
51
51
  "rollup": "^4.42.0",
52
+ "rollup-plugin-copy": "^3.5.0",
52
53
  "rollup-plugin-scss-lit": "^2.1.0",
53
54
  "sass": "^1.89.0",
54
55
  "tslib": "^2.6.3",
@@ -62,8 +63,10 @@
62
63
  "build:iconset": "node generate-icon-registry.js",
63
64
  "build": "pnpm build:iconset && rollup --config rollup.config.js",
64
65
  "clean": "rimraf node_modules .turbo .rollup.cache dist coverage",
65
- "lint": "eslint --ext .ts \"src/**/*.ts\" \"stories/**/*.ts\" \"test/**/*.ts\" && prettier \"src/**/*.ts\" \"stories/**/*.ts\" \"test/**/*.ts\" --check",
66
- "format": "eslint --ext .ts \"src/**/*.ts\" \"stories/**/*.ts\" \"test/**/*.ts\" --fix && prettier \"src/**/*.ts\" \"stories/**/*.ts\" \"test/**/*.ts\" --write",
67
- "test": "wtr --coverage --node-resolve --config web-test-runner.config.js"
66
+ "prepublish": "pnpm build",
67
+ "lint": "eslint --ext .ts \"src/**/*.ts\" \"stories/**/*.ts\" \"test/**/*.ts\" && stylelint \"styles/**/*.scss\" \"src/**/*.scss\" && prettier \"src/**/*.ts\" \"stories/**/*.ts\" \"test/**/*.ts\" --check",
68
+ "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\"",
69
+ "test": "wtr --coverage --node-resolve --config web-test-runner.config.js",
70
+ "test:watch": "wtr --coverage --node-resolve --config web-test-runner.config.js --watch"
68
71
  }
69
72
  }
@@ -2,6 +2,74 @@ it-icon {
2
2
  line-height: 0;
3
3
  }
4
4
 
5
+ // FOUC prevention: apply styles even when component is not yet defined
6
+ it-icon:not(:defined) {
7
+ display: inline-block;
8
+ line-height: 0;
9
+
10
+ // Size variants
11
+ &[size='xs'] {
12
+ width: var(--#{$prefix}icon-size-xs);
13
+ height: var(--#{$prefix}icon-size-xs);
14
+
15
+ &[padded] {
16
+ margin: 4px;
17
+ }
18
+ }
19
+
20
+ &[size='sm'] {
21
+ width: var(--#{$prefix}icon-size-s);
22
+ height: var(--#{$prefix}icon-size-s);
23
+
24
+ &[padded] {
25
+ margin: 6px;
26
+ }
27
+ }
28
+
29
+ &:not([size]),
30
+ &[size=''] {
31
+ width: var(--#{$prefix}icon-size-m);
32
+ height: var(--#{$prefix}icon-size-m);
33
+
34
+ &[padded] {
35
+ margin: 8px;
36
+ }
37
+ }
38
+
39
+ &[size='lg'] {
40
+ width: var(--#{$prefix}icon-size-l);
41
+ height: var(--#{$prefix}icon-size-l);
42
+
43
+ &[padded] {
44
+ margin: 12px;
45
+ }
46
+ }
47
+
48
+ &[size='xl'] {
49
+ width: var(--#{$prefix}icon-size-xl);
50
+ height: var(--#{$prefix}icon-size-xl);
51
+
52
+ &[padded] {
53
+ margin: 16px;
54
+ }
55
+ }
56
+
57
+ // Alignment variants - default is middle when no align attribute
58
+ &:not([align]),
59
+ &[align=''],
60
+ &[align='middle'] {
61
+ vertical-align: middle;
62
+ }
63
+
64
+ &[align='top'] {
65
+ vertical-align: top;
66
+ }
67
+
68
+ &[align='bottom'] {
69
+ vertical-align: bottom;
70
+ }
71
+ }
72
+
5
73
  .bg-dark {
6
74
  it-icon::part(icon) {
7
75
  --#{$prefix}icon-default: var(--#{$prefix}color-text-inverse);