@vaadin/item 25.0.0-alpha1 → 25.0.0-alpha10

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,6 +1,6 @@
1
1
  {
2
2
  "name": "@vaadin/item",
3
- "version": "25.0.0-alpha1",
3
+ "version": "25.0.0-alpha10",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -21,8 +21,8 @@
21
21
  "type": "module",
22
22
  "files": [
23
23
  "src",
24
- "!src/*-base-styles.d.ts",
25
- "!src/*-base-styles.js",
24
+ "!src/styles/*-base-styles.d.ts",
25
+ "!src/styles/*-base-styles.js",
26
26
  "theme",
27
27
  "vaadin-*.d.ts",
28
28
  "vaadin-*.js",
@@ -37,21 +37,21 @@
37
37
  ],
38
38
  "dependencies": {
39
39
  "@open-wc/dedupe-mixin": "^1.3.0",
40
- "@vaadin/a11y-base": "25.0.0-alpha1",
41
- "@vaadin/component-base": "25.0.0-alpha1",
42
- "@vaadin/vaadin-lumo-styles": "25.0.0-alpha1",
43
- "@vaadin/vaadin-themable-mixin": "25.0.0-alpha1",
40
+ "@vaadin/a11y-base": "25.0.0-alpha10",
41
+ "@vaadin/component-base": "25.0.0-alpha10",
42
+ "@vaadin/vaadin-lumo-styles": "25.0.0-alpha10",
43
+ "@vaadin/vaadin-themable-mixin": "25.0.0-alpha10",
44
44
  "lit": "^3.0.0"
45
45
  },
46
46
  "devDependencies": {
47
- "@vaadin/chai-plugins": "25.0.0-alpha1",
48
- "@vaadin/test-runner-commands": "25.0.0-alpha1",
49
- "@vaadin/testing-helpers": "^1.1.0",
47
+ "@vaadin/chai-plugins": "25.0.0-alpha10",
48
+ "@vaadin/test-runner-commands": "25.0.0-alpha10",
49
+ "@vaadin/testing-helpers": "^2.0.0",
50
50
  "sinon": "^18.0.0"
51
51
  },
52
52
  "web-types": [
53
53
  "web-types.json",
54
54
  "web-types.lit.json"
55
55
  ],
56
- "gitHead": "b8c22a4a0c64156210d0daac96b43ae4e5526d49"
56
+ "gitHead": "6cc6c94079e805fa5b2f0af4dbf3b2a7485e57d0"
57
57
  }
@@ -0,0 +1,57 @@
1
+ /**
2
+ * @license
3
+ * Copyright (c) 2017 - 2025 Vaadin Ltd.
4
+ * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
5
+ */
6
+ import '@vaadin/component-base/src/style-props.js';
7
+ import { css } from 'lit';
8
+
9
+ export const itemStyles = css`
10
+ :host {
11
+ align-items: center;
12
+ border-radius: var(--vaadin-item-border-radius, var(--vaadin-radius-m));
13
+ box-sizing: border-box;
14
+ cursor: var(--vaadin-clickable-cursor);
15
+ display: flex;
16
+ gap: var(--vaadin-item-gap, 0 var(--vaadin-gap-container-inline));
17
+ height: var(--vaadin-item-height, auto);
18
+ padding: var(--vaadin-item-padding, var(--vaadin-padding-container));
19
+ }
20
+
21
+ :host([focused]) {
22
+ outline: var(--vaadin-focus-ring-width) solid var(--vaadin-focus-ring-color);
23
+ outline-offset: calc(var(--vaadin-focus-ring-width) / -1);
24
+ }
25
+
26
+ :host([disabled]) {
27
+ cursor: var(--vaadin-disabled-cursor);
28
+ opacity: 0.5;
29
+ }
30
+
31
+ :host([hidden]) {
32
+ display: none !important;
33
+ }
34
+
35
+ [part='checkmark'] {
36
+ color: var(--vaadin-item-checkmark-color, inherit);
37
+ display: var(--vaadin-item-checkmark-display, none);
38
+ visibility: hidden;
39
+ }
40
+
41
+ [part='checkmark']::before {
42
+ content: '';
43
+ display: block;
44
+ background: currentColor;
45
+ height: var(--vaadin-icon-size, 1lh);
46
+ mask-image: var(--_vaadin-icon-checkmark);
47
+ width: var(--vaadin-icon-size, 1lh);
48
+ }
49
+
50
+ :host([selected]) [part='checkmark'] {
51
+ visibility: visible;
52
+ }
53
+
54
+ [part='content'] {
55
+ flex: 1;
56
+ }
57
+ `;
@@ -10,10 +10,8 @@ import { ItemMixin } from './vaadin-item-mixin.js';
10
10
  /**
11
11
  * `<vaadin-item>` is a Web Component providing layout for items in tabs and menus.
12
12
  *
13
- * ```
14
- * <vaadin-item>
15
- * Item content
16
- * </vaadin-item>
13
+ * ```html
14
+ * <vaadin-item>Item content</vaadin-item>
17
15
  * ```
18
16
  *
19
17
  * ### Selectable
@@ -7,17 +7,16 @@ import { html, LitElement } from 'lit';
7
7
  import { defineCustomElement } from '@vaadin/component-base/src/define.js';
8
8
  import { DirMixin } from '@vaadin/component-base/src/dir-mixin.js';
9
9
  import { PolylitMixin } from '@vaadin/component-base/src/polylit-mixin.js';
10
+ import { LumoInjectionMixin } from '@vaadin/vaadin-themable-mixin/lumo-injection-mixin.js';
10
11
  import { ThemableMixin } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
11
- import { itemStyles } from './vaadin-item-core-styles.js';
12
+ import { itemStyles } from './styles/vaadin-item-core-styles.js';
12
13
  import { ItemMixin } from './vaadin-item-mixin.js';
13
14
 
14
15
  /**
15
16
  * `<vaadin-item>` is a Web Component providing layout for items in tabs and menus.
16
17
  *
17
- * ```
18
- * <vaadin-item>
19
- * Item content
20
- * </vaadin-item>
18
+ * ```html
19
+ * <vaadin-item>Item content</vaadin-item>
21
20
  * ```
22
21
  *
23
22
  * ### Selectable
@@ -55,7 +54,7 @@ import { ItemMixin } from './vaadin-item-mixin.js';
55
54
  * @mixes ThemableMixin
56
55
  * @mixes DirMixin
57
56
  */
58
- class Item extends ItemMixin(ThemableMixin(DirMixin(PolylitMixin(LitElement)))) {
57
+ class Item extends ItemMixin(ThemableMixin(DirMixin(PolylitMixin(LumoInjectionMixin(LitElement))))) {
59
58
  static get is() {
60
59
  return 'vaadin-item';
61
60
  }
@@ -2,6 +2,7 @@ import '@vaadin/vaadin-lumo-styles/font-icons.js';
2
2
  import '@vaadin/vaadin-lumo-styles/sizing.js';
3
3
  import '@vaadin/vaadin-lumo-styles/spacing.js';
4
4
  import '@vaadin/vaadin-lumo-styles/style.js';
5
+ import '@vaadin/vaadin-lumo-styles/color.js';
5
6
  import '@vaadin/vaadin-lumo-styles/typography.js';
6
7
  declare const item: import("lit").CSSResult;
7
8
  export { item };
@@ -2,6 +2,7 @@ import '@vaadin/vaadin-lumo-styles/font-icons.js';
2
2
  import '@vaadin/vaadin-lumo-styles/sizing.js';
3
3
  import '@vaadin/vaadin-lumo-styles/spacing.js';
4
4
  import '@vaadin/vaadin-lumo-styles/style.js';
5
+ import '@vaadin/vaadin-lumo-styles/color.js';
5
6
  import '@vaadin/vaadin-lumo-styles/typography.js';
6
7
  import { css, registerStyles } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
7
8
 
package/web-types.json CHANGED
@@ -1,14 +1,14 @@
1
1
  {
2
2
  "$schema": "https://json.schemastore.org/web-types",
3
3
  "name": "@vaadin/item",
4
- "version": "25.0.0-alpha1",
4
+ "version": "25.0.0-alpha10",
5
5
  "description-markup": "markdown",
6
6
  "contributions": {
7
7
  "html": {
8
8
  "elements": [
9
9
  {
10
10
  "name": "vaadin-item",
11
- "description": "`<vaadin-item>` is a Web Component providing layout for items in tabs and menus.\n\n```\n <vaadin-item>\n Item content\n </vaadin-item>\n```\n\n### Selectable\n\n`<vaadin-item>` has the `selected` property and the corresponding state attribute.\nCurrently, the component sets the `selected` to false, when `disabled` property is set to true.\nBut other than that, the `<vaadin-item>` does not switch selection by itself.\nIn general, it is the wrapper component, like `<vaadin-list-box>`, which should update\nthe `selected` property on the items, e. g. on mousedown or when Enter / Spacebar is pressed.\n\n### Styling\n\nThe following shadow DOM parts are available for styling:\n\nPart name | Description\n-------------|----------------\n`checkmark` | The graphical checkmark shown for a selected item\n`content` | The element that wraps the slot\n\nThe following state attributes are available for styling:\n\nAttribute | Description\n-------------|-------------\n`active` | Set when the item is pressed down, either with mouse, touch or the keyboard.\n`disabled` | Set when the item is disabled.\n`focus-ring` | Set when the item is focused using the keyboard.\n`focused` | Set when the item is focused.\n`selected` | Set when the item is selected\n\nSee [Styling Components](https://vaadin.com/docs/latest/styling/styling-components) documentation.",
11
+ "description": "`<vaadin-item>` is a Web Component providing layout for items in tabs and menus.\n\n```html\n<vaadin-item>Item content</vaadin-item>\n```\n\n### Selectable\n\n`<vaadin-item>` has the `selected` property and the corresponding state attribute.\nCurrently, the component sets the `selected` to false, when `disabled` property is set to true.\nBut other than that, the `<vaadin-item>` does not switch selection by itself.\nIn general, it is the wrapper component, like `<vaadin-list-box>`, which should update\nthe `selected` property on the items, e. g. on mousedown or when Enter / Spacebar is pressed.\n\n### Styling\n\nThe following shadow DOM parts are available for styling:\n\nPart name | Description\n-------------|----------------\n`checkmark` | The graphical checkmark shown for a selected item\n`content` | The element that wraps the slot\n\nThe following state attributes are available for styling:\n\nAttribute | Description\n-------------|-------------\n`active` | Set when the item is pressed down, either with mouse, touch or the keyboard.\n`disabled` | Set when the item is disabled.\n`focus-ring` | Set when the item is focused using the keyboard.\n`focused` | Set when the item is focused.\n`selected` | Set when the item is selected\n\nSee [Styling Components](https://vaadin.com/docs/latest/styling/styling-components) documentation.",
12
12
  "attributes": [
13
13
  {
14
14
  "name": "disabled",
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "https://json.schemastore.org/web-types",
3
3
  "name": "@vaadin/item",
4
- "version": "25.0.0-alpha1",
4
+ "version": "25.0.0-alpha10",
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-item",
19
- "description": "`<vaadin-item>` is a Web Component providing layout for items in tabs and menus.\n\n```\n <vaadin-item>\n Item content\n </vaadin-item>\n```\n\n### Selectable\n\n`<vaadin-item>` has the `selected` property and the corresponding state attribute.\nCurrently, the component sets the `selected` to false, when `disabled` property is set to true.\nBut other than that, the `<vaadin-item>` does not switch selection by itself.\nIn general, it is the wrapper component, like `<vaadin-list-box>`, which should update\nthe `selected` property on the items, e. g. on mousedown or when Enter / Spacebar is pressed.\n\n### Styling\n\nThe following shadow DOM parts are available for styling:\n\nPart name | Description\n-------------|----------------\n`checkmark` | The graphical checkmark shown for a selected item\n`content` | The element that wraps the slot\n\nThe following state attributes are available for styling:\n\nAttribute | Description\n-------------|-------------\n`active` | Set when the item is pressed down, either with mouse, touch or the keyboard.\n`disabled` | Set when the item is disabled.\n`focus-ring` | Set when the item is focused using the keyboard.\n`focused` | Set when the item is focused.\n`selected` | Set when the item is selected\n\nSee [Styling Components](https://vaadin.com/docs/latest/styling/styling-components) documentation.",
19
+ "description": "`<vaadin-item>` is a Web Component providing layout for items in tabs and menus.\n\n```html\n<vaadin-item>Item content</vaadin-item>\n```\n\n### Selectable\n\n`<vaadin-item>` has the `selected` property and the corresponding state attribute.\nCurrently, the component sets the `selected` to false, when `disabled` property is set to true.\nBut other than that, the `<vaadin-item>` does not switch selection by itself.\nIn general, it is the wrapper component, like `<vaadin-list-box>`, which should update\nthe `selected` property on the items, e. g. on mousedown or when Enter / Spacebar is pressed.\n\n### Styling\n\nThe following shadow DOM parts are available for styling:\n\nPart name | Description\n-------------|----------------\n`checkmark` | The graphical checkmark shown for a selected item\n`content` | The element that wraps the slot\n\nThe following state attributes are available for styling:\n\nAttribute | Description\n-------------|-------------\n`active` | Set when the item is pressed down, either with mouse, touch or the keyboard.\n`disabled` | Set when the item is disabled.\n`focus-ring` | Set when the item is focused using the keyboard.\n`focused` | Set when the item is focused.\n`selected` | Set when the item is selected\n\nSee [Styling Components](https://vaadin.com/docs/latest/styling/styling-components) documentation.",
20
20
  "extension": true,
21
21
  "attributes": [
22
22
  {
@@ -1,59 +0,0 @@
1
- /**
2
- * @license
3
- * Copyright (c) 2017 - 2025 Vaadin Ltd.
4
- * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
5
- */
6
- import '@vaadin/component-base/src/style-props.js';
7
- import { css } from 'lit';
8
-
9
- export const itemStyles = css`
10
- @layer base {
11
- :host {
12
- align-items: center;
13
- border-radius: var(--vaadin-item-border-radius, var(--_vaadin-radius-m));
14
- box-sizing: border-box;
15
- cursor: var(--vaadin-clickable-cursor);
16
- display: flex;
17
- gap: var(--vaadin-item-gap, 0 var(--_vaadin-gap-container-inline));
18
- height: var(--vaadin-item-height, auto);
19
- padding: var(--vaadin-item-padding, var(--_vaadin-padding-container));
20
- }
21
-
22
- :host([focused]) {
23
- outline: var(--vaadin-focus-ring-width) solid var(--vaadin-focus-ring-color);
24
- outline-offset: calc(var(--vaadin-focus-ring-width) / -1);
25
- }
26
-
27
- :host([disabled]) {
28
- cursor: var(--vaadin-disabled-cursor);
29
- opacity: 0.5;
30
- }
31
-
32
- :host([hidden]) {
33
- display: none !important;
34
- }
35
-
36
- [part='checkmark'] {
37
- color: var(--vaadin-item-checkmark-color, inherit);
38
- display: var(--vaadin-item-checkmark-display, none);
39
- visibility: hidden;
40
- }
41
-
42
- [part='checkmark']::before {
43
- content: '';
44
- display: block;
45
- background: currentColor;
46
- height: var(--vaadin-icon-size, 1lh);
47
- mask-image: var(--_vaadin-icon-checkmark);
48
- width: var(--vaadin-icon-size, 1lh);
49
- }
50
-
51
- :host([selected]) [part='checkmark'] {
52
- visibility: visible;
53
- }
54
-
55
- [part='content'] {
56
- flex: 1;
57
- }
58
- }
59
- `;