@vaadin/icon 25.2.0-alpha10 → 25.2.0-alpha11
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 +8 -8
- package/src/vaadin-icon-font-size-mixin.js +0 -2
- package/src/vaadin-icon-mixin.d.ts +1 -1
- package/src/vaadin-icon-mixin.js +0 -8
- package/src/vaadin-icon.js +0 -3
- package/src/vaadin-iconset-mixin.d.ts +1 -1
- package/src/vaadin-iconset-mixin.js +1 -4
- package/src/vaadin-iconset.js +0 -1
- package/web-types.json +5 -5
- package/web-types.lit.json +4 -4
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vaadin/icon",
|
|
3
|
-
"version": "25.2.0-
|
|
3
|
+
"version": "25.2.0-alpha11",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -35,16 +35,16 @@
|
|
|
35
35
|
],
|
|
36
36
|
"dependencies": {
|
|
37
37
|
"@open-wc/dedupe-mixin": "^1.3.0",
|
|
38
|
-
"@vaadin/component-base": "25.2.0-
|
|
39
|
-
"@vaadin/vaadin-themable-mixin": "25.2.0-
|
|
38
|
+
"@vaadin/component-base": "25.2.0-alpha11",
|
|
39
|
+
"@vaadin/vaadin-themable-mixin": "25.2.0-alpha11",
|
|
40
40
|
"lit": "^3.0.0"
|
|
41
41
|
},
|
|
42
42
|
"devDependencies": {
|
|
43
|
-
"@vaadin/aura": "25.2.0-
|
|
44
|
-
"@vaadin/chai-plugins": "25.2.0-
|
|
45
|
-
"@vaadin/test-runner-commands": "25.2.0-
|
|
43
|
+
"@vaadin/aura": "25.2.0-alpha11",
|
|
44
|
+
"@vaadin/chai-plugins": "25.2.0-alpha11",
|
|
45
|
+
"@vaadin/test-runner-commands": "25.2.0-alpha11",
|
|
46
46
|
"@vaadin/testing-helpers": "^2.0.0",
|
|
47
|
-
"@vaadin/vaadin-lumo-styles": "25.2.0-
|
|
47
|
+
"@vaadin/vaadin-lumo-styles": "25.2.0-alpha11",
|
|
48
48
|
"sinon": "^21.0.2"
|
|
49
49
|
},
|
|
50
50
|
"customElements": "custom-elements.json",
|
|
@@ -52,5 +52,5 @@
|
|
|
52
52
|
"web-types.json",
|
|
53
53
|
"web-types.lit.json"
|
|
54
54
|
],
|
|
55
|
-
"gitHead": "
|
|
55
|
+
"gitHead": "fdc37e932709f95491a027aeb2090911cb7528c6"
|
|
56
56
|
}
|
|
@@ -15,8 +15,6 @@ const usesFontIconSizingFallback = needsFontIconSizingFallback();
|
|
|
15
15
|
* recent versions, but there's an regression in Safari 26, which caused the same issue to happen when the icon is
|
|
16
16
|
* attached to an element with shadow root.
|
|
17
17
|
* The mixin does nothing if the browser supports CSS Container Query units for pseudo elements.
|
|
18
|
-
*
|
|
19
|
-
* @polymerMixin
|
|
20
18
|
*/
|
|
21
19
|
export const IconFontSizeMixin = (superclass) =>
|
|
22
20
|
!usesFontIconSizingFallback
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @license
|
|
3
|
-
* Copyright (c)
|
|
3
|
+
* Copyright (c) 2021 - 2026 Vaadin Ltd.
|
|
4
4
|
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
5
5
|
*/
|
|
6
6
|
import type { Constructor } from '@open-wc/dedupe-mixin';
|
package/src/vaadin-icon-mixin.js
CHANGED
|
@@ -11,10 +11,6 @@ const srcCache = new Map();
|
|
|
11
11
|
|
|
12
12
|
const Iconset = customElements.get('vaadin-iconset');
|
|
13
13
|
|
|
14
|
-
/**
|
|
15
|
-
* @polymerMixin
|
|
16
|
-
* @mixes IconFontSizeMixin
|
|
17
|
-
*/
|
|
18
14
|
export const IconMixin = (superClass) =>
|
|
19
15
|
class extends IconFontSizeMixin(superClass) {
|
|
20
16
|
static get properties() {
|
|
@@ -53,7 +49,6 @@ export const IconMixin = (superClass) =>
|
|
|
53
49
|
* inside the SVG referenced by the path. Note that the file needs to follow the same-origin policy.
|
|
54
50
|
* - a string in the format `data:image/svg+xml,<svg>...</svg>`. You may need to use the `encodeURIComponent`
|
|
55
51
|
* function for the SVG content passed
|
|
56
|
-
*
|
|
57
52
|
*/
|
|
58
53
|
src: {
|
|
59
54
|
type: String,
|
|
@@ -63,7 +58,6 @@ export const IconMixin = (superClass) =>
|
|
|
63
58
|
/**
|
|
64
59
|
* The symbol identifier that references an ID of an element contained in the SVG element assigned to the
|
|
65
60
|
* `src` property
|
|
66
|
-
*
|
|
67
61
|
*/
|
|
68
62
|
symbol: {
|
|
69
63
|
type: String,
|
|
@@ -87,7 +81,6 @@ export const IconMixin = (superClass) =>
|
|
|
87
81
|
* A hexadecimal code point that specifies a glyph from an icon font.
|
|
88
82
|
*
|
|
89
83
|
* Example: "e001"
|
|
90
|
-
*
|
|
91
84
|
*/
|
|
92
85
|
char: {
|
|
93
86
|
type: String,
|
|
@@ -98,7 +91,6 @@ export const IconMixin = (superClass) =>
|
|
|
98
91
|
* A ligature name that specifies an icon from an icon font with support for ligatures.
|
|
99
92
|
*
|
|
100
93
|
* Example: "home".
|
|
101
|
-
*
|
|
102
94
|
*/
|
|
103
95
|
ligature: {
|
|
104
96
|
type: String,
|
package/src/vaadin-icon.js
CHANGED
|
@@ -74,9 +74,6 @@ import { ensureSvgLiteral } from './vaadin-icon-svg.js';
|
|
|
74
74
|
*
|
|
75
75
|
* @customElement vaadin-icon
|
|
76
76
|
* @extends HTMLElement
|
|
77
|
-
* @mixes IconMixin
|
|
78
|
-
* @mixes ThemableMixin
|
|
79
|
-
* @mixes ElementMixin
|
|
80
77
|
*/
|
|
81
78
|
class Icon extends IconMixin(ElementMixin(ThemableMixin(PolylitMixin(LumoInjectionMixin(LitElement))))) {
|
|
82
79
|
static get is() {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @license
|
|
3
|
-
* Copyright (c)
|
|
3
|
+
* Copyright (c) 2021 - 2026 Vaadin Ltd.
|
|
4
4
|
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
5
5
|
*/
|
|
6
6
|
import type { Constructor } from '@open-wc/dedupe-mixin';
|
|
@@ -31,9 +31,6 @@ function initIconsMap(iconset, name) {
|
|
|
31
31
|
}, {});
|
|
32
32
|
}
|
|
33
33
|
|
|
34
|
-
/**
|
|
35
|
-
* @polymerMixin
|
|
36
|
-
*/
|
|
37
34
|
export const IconsetMixin = (superClass) =>
|
|
38
35
|
class extends superClass {
|
|
39
36
|
static get observedAttributes() {
|
|
@@ -135,7 +132,7 @@ export const IconsetMixin = (superClass) =>
|
|
|
135
132
|
get size() {
|
|
136
133
|
// Use default property value as a fallback here instead of the constructor
|
|
137
134
|
// to not override an instance property in the lazy upgrade scenario below.
|
|
138
|
-
return this.__size
|
|
135
|
+
return this.__size ?? 24;
|
|
139
136
|
}
|
|
140
137
|
|
|
141
138
|
/**
|
package/src/vaadin-iconset.js
CHANGED
package/web-types.json
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://json.schemastore.org/web-types",
|
|
3
3
|
"name": "@vaadin/icon",
|
|
4
|
-
"version": "25.2.0-
|
|
4
|
+
"version": "25.2.0-alpha11",
|
|
5
5
|
"description-markup": "markdown",
|
|
6
6
|
"contributions": {
|
|
7
7
|
"html": {
|
|
8
8
|
"elements": [
|
|
9
9
|
{
|
|
10
10
|
"name": "vaadin-icon",
|
|
11
|
-
"description": "`<vaadin-icon>` is a Web Component for displaying SVG icons.\n\n### Icon property\n\nThe `<vaadin-icon>` component is designed to be used as a drop-in replacement for `<iron-icon>`.\nFor example, you can use it with `vaadin-icons` like this:\n\n```html\n<vaadin-icon icon=\"vaadin:angle-down\"></vaadin-icon>\n```\n\nAlternatively, you can also pick one of the Lumo icons:\n\n```html\n<vaadin-icon icon=\"lumo:user\"></vaadin-icon>\n```\n\n### Custom SVG icon\n\nAlternatively, instead of selecting an icon from an iconset by name, you can pass any custom `svg`\nliteral using the [`svg`](https://cdn.vaadin.com/vaadin-web-components/25.2.0-
|
|
11
|
+
"description": "`<vaadin-icon>` is a Web Component for displaying SVG icons.\n\n### Icon property\n\nThe `<vaadin-icon>` component is designed to be used as a drop-in replacement for `<iron-icon>`.\nFor example, you can use it with `vaadin-icons` like this:\n\n```html\n<vaadin-icon icon=\"vaadin:angle-down\"></vaadin-icon>\n```\n\nAlternatively, you can also pick one of the Lumo icons:\n\n```html\n<vaadin-icon icon=\"lumo:user\"></vaadin-icon>\n```\n\n### Custom SVG icon\n\nAlternatively, instead of selecting an icon from an iconset by name, you can pass any custom `svg`\nliteral using the [`svg`](https://cdn.vaadin.com/vaadin-web-components/25.2.0-alpha11/#/elements/vaadin-icon#property-svg) property. In this case you can also\ndefine the size of the SVG `viewBox` using the [`size`](https://cdn.vaadin.com/vaadin-web-components/25.2.0-alpha11/#/elements/vaadin-icon#property-size) property:\n\n```js\nimport { html, svg } from 'lit';\n\n// in your component\nrender() {\n const svgIcon = svg`<path d=\"M13 4v2l-5 5-5-5v-2l5 5z\"></path>`;\n return html`\n <vaadin-icon\n .svg=\"${svgIcon}\"\n size=\"16\"\n ></vaadin-icon>\n `;\n}\n```\n\n### Styling\n\nThe following custom CSS properties are available for styling:\n\nCustom CSS property | Description\n-----------------------------|-------------\n`--vaadin-icon-size` | Size (width and height) of the icon\n`--vaadin-icon-stroke-width` | Stroke width of the SVG icon\n`--vaadin-icon-visual-size` | Visual size of the icon\n\nThe following state attributes are available for styling:\n\nAttribute | Description\n---------------|-------------\n`has-tooltip` | Set when the icon has a slotted tooltip\n\nSee [Styling Components](https://vaadin.com/docs/latest/styling/styling-components) documentation.",
|
|
12
12
|
"attributes": [
|
|
13
13
|
{
|
|
14
14
|
"name": "char",
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
},
|
|
31
31
|
{
|
|
32
32
|
"name": "icon",
|
|
33
|
-
"description": "The name of the icon to use. The name should be of the form:\n`iconset_name:icon_name`. When using `vaadin-icons` it is possible\nto omit the first part and only use `icon_name` as a value.\n\nSetting the `icon` property updates the `svg` and `size` based on the\nvalues provided by the corresponding `vaadin-iconset` element.\n\nSee also [`name`](https://cdn.vaadin.com/vaadin-web-components/25.2.0-
|
|
33
|
+
"description": "The name of the icon to use. The name should be of the form:\n`iconset_name:icon_name`. When using `vaadin-icons` it is possible\nto omit the first part and only use `icon_name` as a value.\n\nSetting the `icon` property updates the `svg` and `size` based on the\nvalues provided by the corresponding `vaadin-iconset` element.\n\nSee also [`name`](https://cdn.vaadin.com/vaadin-web-components/25.2.0-alpha11/#/elements/vaadin-iconset#property-name) property of `vaadin-iconset`.",
|
|
34
34
|
"value": {
|
|
35
35
|
"type": [
|
|
36
36
|
"string"
|
|
@@ -116,7 +116,7 @@
|
|
|
116
116
|
},
|
|
117
117
|
{
|
|
118
118
|
"name": "icon",
|
|
119
|
-
"description": "The name of the icon to use. The name should be of the form:\n`iconset_name:icon_name`. When using `vaadin-icons` it is possible\nto omit the first part and only use `icon_name` as a value.\n\nSetting the `icon` property updates the `svg` and `size` based on the\nvalues provided by the corresponding `vaadin-iconset` element.\n\nSee also [`name`](https://cdn.vaadin.com/vaadin-web-components/25.2.0-
|
|
119
|
+
"description": "The name of the icon to use. The name should be of the form:\n`iconset_name:icon_name`. When using `vaadin-icons` it is possible\nto omit the first part and only use `icon_name` as a value.\n\nSetting the `icon` property updates the `svg` and `size` based on the\nvalues provided by the corresponding `vaadin-iconset` element.\n\nSee also [`name`](https://cdn.vaadin.com/vaadin-web-components/25.2.0-alpha11/#/elements/vaadin-iconset#property-name) property of `vaadin-iconset`.",
|
|
120
120
|
"value": {
|
|
121
121
|
"type": [
|
|
122
122
|
"string"
|
|
@@ -201,7 +201,7 @@
|
|
|
201
201
|
"properties": [
|
|
202
202
|
{
|
|
203
203
|
"name": "name",
|
|
204
|
-
"description": "The name of the iconset. Every iconset is required to have its own unique name.\nAll the SVG icons in the iconset must have IDs conforming to its name.\n\nSee also [`name`](https://cdn.vaadin.com/vaadin-web-components/25.2.0-
|
|
204
|
+
"description": "The name of the iconset. Every iconset is required to have its own unique name.\nAll the SVG icons in the iconset must have IDs conforming to its name.\n\nSee also [`name`](https://cdn.vaadin.com/vaadin-web-components/25.2.0-alpha11/#/elements/vaadin-icon#property-name) property of `vaadin-icon`.",
|
|
205
205
|
"value": {
|
|
206
206
|
"type": [
|
|
207
207
|
"string"
|
package/web-types.lit.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://json.schemastore.org/web-types",
|
|
3
3
|
"name": "@vaadin/icon",
|
|
4
|
-
"version": "25.2.0-
|
|
4
|
+
"version": "25.2.0-alpha11",
|
|
5
5
|
"description-markup": "markdown",
|
|
6
6
|
"framework": "lit",
|
|
7
7
|
"framework-config": {
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
"elements": [
|
|
17
17
|
{
|
|
18
18
|
"name": "vaadin-icon",
|
|
19
|
-
"description": "`<vaadin-icon>` is a Web Component for displaying SVG icons.\n\n### Icon property\n\nThe `<vaadin-icon>` component is designed to be used as a drop-in replacement for `<iron-icon>`.\nFor example, you can use it with `vaadin-icons` like this:\n\n```html\n<vaadin-icon icon=\"vaadin:angle-down\"></vaadin-icon>\n```\n\nAlternatively, you can also pick one of the Lumo icons:\n\n```html\n<vaadin-icon icon=\"lumo:user\"></vaadin-icon>\n```\n\n### Custom SVG icon\n\nAlternatively, instead of selecting an icon from an iconset by name, you can pass any custom `svg`\nliteral using the [`svg`](https://cdn.vaadin.com/vaadin-web-components/25.2.0-
|
|
19
|
+
"description": "`<vaadin-icon>` is a Web Component for displaying SVG icons.\n\n### Icon property\n\nThe `<vaadin-icon>` component is designed to be used as a drop-in replacement for `<iron-icon>`.\nFor example, you can use it with `vaadin-icons` like this:\n\n```html\n<vaadin-icon icon=\"vaadin:angle-down\"></vaadin-icon>\n```\n\nAlternatively, you can also pick one of the Lumo icons:\n\n```html\n<vaadin-icon icon=\"lumo:user\"></vaadin-icon>\n```\n\n### Custom SVG icon\n\nAlternatively, instead of selecting an icon from an iconset by name, you can pass any custom `svg`\nliteral using the [`svg`](https://cdn.vaadin.com/vaadin-web-components/25.2.0-alpha11/#/elements/vaadin-icon#property-svg) property. In this case you can also\ndefine the size of the SVG `viewBox` using the [`size`](https://cdn.vaadin.com/vaadin-web-components/25.2.0-alpha11/#/elements/vaadin-icon#property-size) property:\n\n```js\nimport { html, svg } from 'lit';\n\n// in your component\nrender() {\n const svgIcon = svg`<path d=\"M13 4v2l-5 5-5-5v-2l5 5z\"></path>`;\n return html`\n <vaadin-icon\n .svg=\"${svgIcon}\"\n size=\"16\"\n ></vaadin-icon>\n `;\n}\n```\n\n### Styling\n\nThe following custom CSS properties are available for styling:\n\nCustom CSS property | Description\n-----------------------------|-------------\n`--vaadin-icon-size` | Size (width and height) of the icon\n`--vaadin-icon-stroke-width` | Stroke width of the SVG icon\n`--vaadin-icon-visual-size` | Visual size of the icon\n\nThe following state attributes are available for styling:\n\nAttribute | Description\n---------------|-------------\n`has-tooltip` | Set when the icon has a slotted tooltip\n\nSee [Styling Components](https://vaadin.com/docs/latest/styling/styling-components) documentation.",
|
|
20
20
|
"extension": true,
|
|
21
21
|
"attributes": [
|
|
22
22
|
{
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
},
|
|
36
36
|
{
|
|
37
37
|
"name": ".icon",
|
|
38
|
-
"description": "The name of the icon to use. The name should be of the form:\n`iconset_name:icon_name`. When using `vaadin-icons` it is possible\nto omit the first part and only use `icon_name` as a value.\n\nSetting the `icon` property updates the `svg` and `size` based on the\nvalues provided by the corresponding `vaadin-iconset` element.\n\nSee also [`name`](https://cdn.vaadin.com/vaadin-web-components/25.2.0-
|
|
38
|
+
"description": "The name of the icon to use. The name should be of the form:\n`iconset_name:icon_name`. When using `vaadin-icons` it is possible\nto omit the first part and only use `icon_name` as a value.\n\nSetting the `icon` property updates the `svg` and `size` based on the\nvalues provided by the corresponding `vaadin-iconset` element.\n\nSee also [`name`](https://cdn.vaadin.com/vaadin-web-components/25.2.0-alpha11/#/elements/vaadin-iconset#property-name) property of `vaadin-iconset`.",
|
|
39
39
|
"value": {
|
|
40
40
|
"kind": "expression"
|
|
41
41
|
}
|
|
@@ -91,7 +91,7 @@
|
|
|
91
91
|
"attributes": [
|
|
92
92
|
{
|
|
93
93
|
"name": ".name",
|
|
94
|
-
"description": "The name of the iconset. Every iconset is required to have its own unique name.\nAll the SVG icons in the iconset must have IDs conforming to its name.\n\nSee also [`name`](https://cdn.vaadin.com/vaadin-web-components/25.2.0-
|
|
94
|
+
"description": "The name of the iconset. Every iconset is required to have its own unique name.\nAll the SVG icons in the iconset must have IDs conforming to its name.\n\nSee also [`name`](https://cdn.vaadin.com/vaadin-web-components/25.2.0-alpha11/#/elements/vaadin-icon#property-name) property of `vaadin-icon`.",
|
|
95
95
|
"value": {
|
|
96
96
|
"kind": "expression"
|
|
97
97
|
}
|