@vaadin/details 24.8.4 → 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.
Files changed (33) hide show
  1. package/README.md +0 -23
  2. package/package.json +13 -14
  3. package/src/styles/vaadin-details-summary-base-styles.js +99 -0
  4. package/src/styles/vaadin-details-summary-core-styles.d.ts +8 -0
  5. package/src/vaadin-details-summary.js +16 -11
  6. package/src/vaadin-details.d.ts +2 -3
  7. package/src/vaadin-details.js +34 -25
  8. package/web-types.json +2 -2
  9. package/web-types.lit.json +2 -2
  10. package/src/vaadin-lit-details-summary.js +0 -55
  11. package/src/vaadin-lit-details.js +0 -64
  12. package/theme/lumo/vaadin-lit-details-summary.d.ts +0 -2
  13. package/theme/lumo/vaadin-lit-details-summary.js +0 -2
  14. package/theme/lumo/vaadin-lit-details.d.ts +0 -3
  15. package/theme/lumo/vaadin-lit-details.js +0 -3
  16. package/theme/material/vaadin-details-styles.d.ts +0 -5
  17. package/theme/material/vaadin-details-styles.js +0 -24
  18. package/theme/material/vaadin-details-summary-styles.d.ts +0 -5
  19. package/theme/material/vaadin-details-summary-styles.js +0 -106
  20. package/theme/material/vaadin-details-summary.d.ts +0 -2
  21. package/theme/material/vaadin-details-summary.js +0 -2
  22. package/theme/material/vaadin-details.d.ts +0 -3
  23. package/theme/material/vaadin-details.js +0 -3
  24. package/theme/material/vaadin-lit-details-summary.d.ts +0 -2
  25. package/theme/material/vaadin-lit-details-summary.js +0 -2
  26. package/theme/material/vaadin-lit-details.d.ts +0 -3
  27. package/theme/material/vaadin-lit-details.js +0 -3
  28. package/vaadin-lit-details-summary.d.ts +0 -1
  29. package/vaadin-lit-details-summary.js +0 -2
  30. package/vaadin-lit-details.d.ts +0 -1
  31. package/vaadin-lit-details.js +0 -2
  32. /package/src/{vaadin-details-summary-core-styles.d.ts → styles/vaadin-details-summary-base-styles.d.ts} +0 -0
  33. /package/src/{vaadin-details-summary-core-styles.js → styles/vaadin-details-summary-core-styles.js} +0 -0
package/README.md CHANGED
@@ -29,29 +29,6 @@ Once installed, import the component in your application:
29
29
  import '@vaadin/details';
30
30
  ```
31
31
 
32
- ## Themes
33
-
34
- Vaadin components come with two built-in [themes](https://vaadin.com/docs/latest/styling), Lumo and Material.
35
- The [main entrypoint](https://github.com/vaadin/web-components/blob/main/packages/details/vaadin-details.js) of the package uses the Lumo theme.
36
-
37
- To use the Material theme, import the component from the `theme/material` folder:
38
-
39
- ```js
40
- import '@vaadin/details/theme/material/vaadin-details.js';
41
- ```
42
-
43
- You can also import the Lumo version of the component explicitly:
44
-
45
- ```js
46
- import '@vaadin/details/theme/lumo/vaadin-details.js';
47
- ```
48
-
49
- Finally, you can import the un-themed component from the `src` folder to get a minimal starting point:
50
-
51
- ```js
52
- import '@vaadin/details/src/vaadin-details.js';
53
- ```
54
-
55
32
  ## Contributing
56
33
 
57
34
  Read the [contributing guide](https://vaadin.com/docs/latest/contributing) to learn about our development process, how to propose bugfixes and improvements, and how to test your changes to Vaadin components.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vaadin/details",
3
- "version": "24.8.4",
3
+ "version": "25.0.0-alpha10",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -21,6 +21,8 @@
21
21
  "type": "module",
22
22
  "files": [
23
23
  "src",
24
+ "!src/styles/*-base-styles.d.ts",
25
+ "!src/styles/*-base-styles.js",
24
26
  "theme",
25
27
  "vaadin-*.d.ts",
26
28
  "vaadin-*.js",
@@ -31,29 +33,26 @@
31
33
  "Vaadin",
32
34
  "vaadin-details",
33
35
  "web-components",
34
- "web-component",
35
- "polymer"
36
+ "web-component"
36
37
  ],
37
38
  "dependencies": {
38
39
  "@open-wc/dedupe-mixin": "^1.3.0",
39
- "@polymer/polymer": "^3.0.0",
40
- "@vaadin/a11y-base": "~24.8.4",
41
- "@vaadin/button": "~24.8.4",
42
- "@vaadin/component-base": "~24.8.4",
43
- "@vaadin/vaadin-lumo-styles": "~24.8.4",
44
- "@vaadin/vaadin-material-styles": "~24.8.4",
45
- "@vaadin/vaadin-themable-mixin": "~24.8.4",
40
+ "@vaadin/a11y-base": "25.0.0-alpha10",
41
+ "@vaadin/button": "25.0.0-alpha10",
42
+ "@vaadin/component-base": "25.0.0-alpha10",
43
+ "@vaadin/vaadin-lumo-styles": "25.0.0-alpha10",
44
+ "@vaadin/vaadin-themable-mixin": "25.0.0-alpha10",
46
45
  "lit": "^3.0.0"
47
46
  },
48
47
  "devDependencies": {
49
- "@vaadin/chai-plugins": "~24.8.4",
50
- "@vaadin/test-runner-commands": "~24.8.4",
51
- "@vaadin/testing-helpers": "^1.1.0",
48
+ "@vaadin/chai-plugins": "25.0.0-alpha10",
49
+ "@vaadin/test-runner-commands": "25.0.0-alpha10",
50
+ "@vaadin/testing-helpers": "^2.0.0",
52
51
  "sinon": "^18.0.0"
53
52
  },
54
53
  "web-types": [
55
54
  "web-types.json",
56
55
  "web-types.lit.json"
57
56
  ],
58
- "gitHead": "849e54e967563080a685965e2dced02060b3ab23"
57
+ "gitHead": "6cc6c94079e805fa5b2f0af4dbf3b2a7485e57d0"
59
58
  }
@@ -0,0 +1,99 @@
1
+ /**
2
+ * @license
3
+ * Copyright (c) 2025 - 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, unsafeCSS } from 'lit';
8
+
9
+ export const detailsSummary = (partName = 'vaadin-details-summary') => css`
10
+ :host {
11
+ align-items: center;
12
+ background: var(--${unsafeCSS(partName)}-background, transparent);
13
+ background-origin: border-box;
14
+ border: var(--${unsafeCSS(partName)}-border, none);
15
+ border-radius: var(--${unsafeCSS(partName)}-border-radius, var(--vaadin-radius-m));
16
+ box-sizing: border-box;
17
+ color: var(--${unsafeCSS(partName)}-text-color, var(--vaadin-color));
18
+ cursor: var(--vaadin-clickable-cursor);
19
+ display: flex;
20
+ font-size: var(--${unsafeCSS(partName)}-font-size, inherit);
21
+ font-weight: var(--${unsafeCSS(partName)}-font-weight, 500);
22
+ gap: var(--${unsafeCSS(partName)}-gap, 0 var(--vaadin-gap-container-inline));
23
+ height: var(--${unsafeCSS(partName)}-height, auto);
24
+ outline: calc(var(--vaadin-focus-ring-width) * var(--_focus-ring, 0)) solid var(--vaadin-focus-ring-color);
25
+ outline-offset: 1px;
26
+ padding: var(--${unsafeCSS(partName)}-padding, var(--vaadin-padding-container));
27
+ -webkit-tap-highlight-color: transparent;
28
+ -webkit-user-select: none;
29
+ user-select: none;
30
+ }
31
+
32
+ :host([focus-ring]) {
33
+ --_focus-ring: 1;
34
+ }
35
+
36
+ :host([hidden]) {
37
+ display: none !important;
38
+ }
39
+
40
+ [part='toggle'] {
41
+ color: var(--vaadin-color-subtle);
42
+ }
43
+
44
+ @media (prefers-reduced-motion: no-preference) {
45
+ [part='toggle'] {
46
+ transition-property: rotate;
47
+ transition-duration: 150ms;
48
+ animation: delay-initial-transition 1ms;
49
+ }
50
+
51
+ @keyframes delay-initial-transition {
52
+ 0% {
53
+ rotate: 0deg;
54
+ }
55
+ }
56
+ }
57
+
58
+ [part='toggle']::before {
59
+ background: currentColor;
60
+ content: '';
61
+ display: block;
62
+ height: var(--vaadin-icon-size, 1lh);
63
+ mask-image: var(--_vaadin-icon-chevron-down);
64
+ width: var(--vaadin-icon-size, 1lh);
65
+ rotate: -90deg;
66
+ }
67
+
68
+ :host([disabled]) {
69
+ opacity: 0.5;
70
+ cursor: var(--vaadin-disabled-cursor);
71
+ }
72
+
73
+ :host([dir='rtl']) [part='toggle']::before {
74
+ scale: -1;
75
+ }
76
+
77
+ :host([opened]) [part='toggle'] {
78
+ rotate: 90deg;
79
+ }
80
+
81
+ :host([dir='rtl'][opened]) [part='toggle'] {
82
+ rotate: -90deg;
83
+ }
84
+
85
+ @media (forced-colors: active) {
86
+ [part='toggle']::before {
87
+ background: CanvasText;
88
+ }
89
+
90
+ :host([disabled]) {
91
+ color: GrayText;
92
+ opacity: 1;
93
+ }
94
+
95
+ :host([disabled]) [part='toggle']::before {
96
+ background: GrayText;
97
+ }
98
+ }
99
+ `;
@@ -0,0 +1,8 @@
1
+ /**
2
+ * @license
3
+ * Copyright (c) 2025 - 2025 Vaadin Ltd.
4
+ * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
5
+ */
6
+ import type { CSSResult } from 'lit';
7
+
8
+ export const detailsSummary: (partName?: string) => CSSResult;
@@ -3,14 +3,14 @@
3
3
  * Copyright (c) 2019 - 2025 Vaadin Ltd.
4
4
  * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
5
5
  */
6
- import { html, PolymerElement } from '@polymer/polymer/polymer-element.js';
6
+ import { html, LitElement } from 'lit';
7
7
  import { ButtonMixin } from '@vaadin/button/src/vaadin-button-mixin.js';
8
8
  import { defineCustomElement } from '@vaadin/component-base/src/define.js';
9
9
  import { DirMixin } from '@vaadin/component-base/src/dir-mixin.js';
10
- import { registerStyles, ThemableMixin } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
11
- import { detailsSummary } from './vaadin-details-summary-core-styles.js';
12
-
13
- registerStyles('vaadin-details-summary', detailsSummary(), { moduleId: 'vaadin-details-summary-styles' });
10
+ import { PolylitMixin } from '@vaadin/component-base/src/polylit-mixin.js';
11
+ import { LumoInjectionMixin } from '@vaadin/vaadin-themable-mixin/lumo-injection-mixin.js';
12
+ import { ThemableMixin } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
13
+ import { detailsSummary } from './styles/vaadin-details-summary-core-styles.js';
14
14
 
15
15
  /**
16
16
  * The details summary element.
@@ -42,16 +42,13 @@ registerStyles('vaadin-details-summary', detailsSummary(), { moduleId: 'vaadin-d
42
42
  * @mixes DirMixin
43
43
  * @mixes ThemableMixin
44
44
  */
45
- class DetailsSummary extends ButtonMixin(DirMixin(ThemableMixin(PolymerElement))) {
45
+ class DetailsSummary extends ButtonMixin(DirMixin(ThemableMixin(PolylitMixin(LumoInjectionMixin(LitElement))))) {
46
46
  static get is() {
47
47
  return 'vaadin-details-summary';
48
48
  }
49
49
 
50
- static get template() {
51
- return html`
52
- <span part="toggle" aria-hidden="true"></span>
53
- <div part="content"><slot></slot></div>
54
- `;
50
+ static get styles() {
51
+ return detailsSummary();
55
52
  }
56
53
 
57
54
  static get properties() {
@@ -65,6 +62,14 @@ class DetailsSummary extends ButtonMixin(DirMixin(ThemableMixin(PolymerElement))
65
62
  },
66
63
  };
67
64
  }
65
+
66
+ /** @protected */
67
+ render() {
68
+ return html`
69
+ <span part="toggle" aria-hidden="true"></span>
70
+ <div part="content"><slot></slot></div>
71
+ `;
72
+ }
68
73
  }
69
74
 
70
75
  defineCustomElement(DetailsSummary);
@@ -3,7 +3,6 @@
3
3
  * Copyright (c) 2019 - 2025 Vaadin Ltd.
4
4
  * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
5
5
  */
6
- import { ControllerMixin } from '@vaadin/component-base/src/controller-mixin.js';
7
6
  import { ElementMixin } from '@vaadin/component-base/src/element-mixin.js';
8
7
  import { ThemableMixin } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
9
8
  import { DetailsBaseMixin } from './vaadin-details-base-mixin.js';
@@ -23,7 +22,7 @@ export type DetailsEventMap = DetailsCustomEventMap & HTMLElementEventMap;
23
22
  * `<vaadin-details>` is a Web Component which the creates an
24
23
  * expandable panel similar to `<details>` HTML element.
25
24
  *
26
- * ```
25
+ * ```html
27
26
  * <vaadin-details>
28
27
  * <vaadin-details-summary slot="summary">Expandable Details</vaadin-details-summary>
29
28
  * <div>
@@ -53,7 +52,7 @@ export type DetailsEventMap = DetailsCustomEventMap & HTMLElementEventMap;
53
52
  *
54
53
  * @fires {CustomEvent} opened-changed - Fired when the `opened` property changes.
55
54
  */
56
- declare class Details extends DetailsBaseMixin(ElementMixin(ThemableMixin(ControllerMixin(HTMLElement)))) {
55
+ declare class Details extends DetailsBaseMixin(ElementMixin(ThemableMixin(HTMLElement))) {
57
56
  addEventListener<K extends keyof DetailsEventMap>(
58
57
  type: K,
59
58
  listener: (this: Details, ev: DetailsEventMap[K]) => void,
@@ -4,10 +4,11 @@
4
4
  * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
5
5
  */
6
6
  import './vaadin-details-summary.js';
7
- import { html, PolymerElement } from '@polymer/polymer/polymer-element.js';
8
- import { ControllerMixin } from '@vaadin/component-base/src/controller-mixin.js';
7
+ import { css, html, LitElement } from 'lit';
9
8
  import { defineCustomElement } from '@vaadin/component-base/src/define.js';
10
9
  import { ElementMixin } from '@vaadin/component-base/src/element-mixin.js';
10
+ import { PolylitMixin } from '@vaadin/component-base/src/polylit-mixin.js';
11
+ import { LumoInjectionMixin } from '@vaadin/vaadin-themable-mixin/lumo-injection-mixin.js';
11
12
  import { ThemableMixin } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
12
13
  import { DetailsBaseMixin } from './vaadin-details-base-mixin.js';
13
14
 
@@ -15,7 +16,7 @@ import { DetailsBaseMixin } from './vaadin-details-base-mixin.js';
15
16
  * `<vaadin-details>` is a Web Component which the creates an
16
17
  * expandable panel similar to `<details>` HTML element.
17
18
  *
18
- * ```
19
+ * ```html
19
20
  * <vaadin-details>
20
21
  * <vaadin-details-summary slot="summary">Expandable Details</vaadin-details-summary>
21
22
  * <div>
@@ -47,32 +48,44 @@ import { DetailsBaseMixin } from './vaadin-details-base-mixin.js';
47
48
  *
48
49
  * @customElement
49
50
  * @extends HTMLElement
50
- * @mixes ControllerMixin
51
51
  * @mixes DetailsBaseMixin
52
52
  * @mixes ElementMixin
53
53
  * @mixes ThemableMixin
54
54
  */
55
- class Details extends DetailsBaseMixin(ElementMixin(ThemableMixin(ControllerMixin(PolymerElement)))) {
56
- static get template() {
57
- return html`
58
- <style>
59
- :host {
60
- display: block;
61
- }
55
+ class Details extends DetailsBaseMixin(ElementMixin(ThemableMixin(PolylitMixin(LumoInjectionMixin(LitElement))))) {
56
+ static get is() {
57
+ return 'vaadin-details';
58
+ }
59
+
60
+ static get styles() {
61
+ return css`
62
+ :host {
63
+ display: block;
64
+ }
62
65
 
63
- :host([hidden]) {
64
- display: none !important;
65
- }
66
+ :host([hidden]) {
67
+ display: none !important;
68
+ }
66
69
 
67
- [part='content'] {
68
- display: none;
69
- }
70
+ [part='content'] {
71
+ display: none;
72
+ }
70
73
 
71
- :host([opened]) [part='content'] {
72
- display: block;
73
- }
74
- </style>
74
+ :host([opened]) [part='content'] {
75
+ display: block;
76
+ }
77
+ `;
78
+ }
75
79
 
80
+ static get lumoInjector() {
81
+ return {
82
+ includeBaseStyles: true,
83
+ };
84
+ }
85
+
86
+ /** @protected */
87
+ render() {
88
+ return html`
76
89
  <slot name="summary"></slot>
77
90
 
78
91
  <div part="content">
@@ -82,10 +95,6 @@ class Details extends DetailsBaseMixin(ElementMixin(ThemableMixin(ControllerMixi
82
95
  <slot name="tooltip"></slot>
83
96
  `;
84
97
  }
85
-
86
- static get is() {
87
- return 'vaadin-details';
88
- }
89
98
  }
90
99
 
91
100
  defineCustomElement(Details);
package/web-types.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "https://json.schemastore.org/web-types",
3
3
  "name": "@vaadin/details",
4
- "version": "24.8.4",
4
+ "version": "25.0.0-alpha10",
5
5
  "description-markup": "markdown",
6
6
  "contributions": {
7
7
  "html": {
@@ -74,7 +74,7 @@
74
74
  },
75
75
  {
76
76
  "name": "vaadin-details",
77
- "description": "`<vaadin-details>` is a Web Component which the creates an\nexpandable panel similar to `<details>` HTML element.\n\n```\n<vaadin-details>\n <vaadin-details-summary slot=\"summary\">Expandable Details</vaadin-details-summary>\n <div>\n Toggle using mouse, Enter and Space keys.\n </div>\n</vaadin-details>\n```\n\n### Styling\n\nThe following shadow DOM parts are exposed for styling:\n\nPart name | Description\n-----------------|----------------\n`content` | The wrapper for the collapsible details content.\n\nThe following attributes are exposed for styling:\n\nAttribute | Description\n-------------| -----------\n`opened` | Set when the collapsible content is expanded and visible.\n`disabled` | Set when the element is disabled.\n`focus-ring` | Set when the element is focused using the keyboard.\n`focused` | Set when the element is focused.\n\nSee [Styling Components](https://vaadin.com/docs/latest/styling/styling-components) documentation.",
77
+ "description": "`<vaadin-details>` is a Web Component which the creates an\nexpandable panel similar to `<details>` HTML element.\n\n```html\n<vaadin-details>\n <vaadin-details-summary slot=\"summary\">Expandable Details</vaadin-details-summary>\n <div>\n Toggle using mouse, Enter and Space keys.\n </div>\n</vaadin-details>\n```\n\n### Styling\n\nThe following shadow DOM parts are exposed for styling:\n\nPart name | Description\n-----------------|----------------\n`content` | The wrapper for the collapsible details content.\n\nThe following attributes are exposed for styling:\n\nAttribute | Description\n-------------| -----------\n`opened` | Set when the collapsible content is expanded and visible.\n`disabled` | Set when the element is disabled.\n`focus-ring` | Set when the element is focused using the keyboard.\n`focused` | Set when the element is focused.\n\nSee [Styling Components](https://vaadin.com/docs/latest/styling/styling-components) documentation.",
78
78
  "attributes": [
79
79
  {
80
80
  "name": "disabled",
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "https://json.schemastore.org/web-types",
3
3
  "name": "@vaadin/details",
4
- "version": "24.8.4",
4
+ "version": "25.0.0-alpha10",
5
5
  "description-markup": "markdown",
6
6
  "framework": "lit",
7
7
  "framework-config": {
@@ -37,7 +37,7 @@
37
37
  },
38
38
  {
39
39
  "name": "vaadin-details",
40
- "description": "`<vaadin-details>` is a Web Component which the creates an\nexpandable panel similar to `<details>` HTML element.\n\n```\n<vaadin-details>\n <vaadin-details-summary slot=\"summary\">Expandable Details</vaadin-details-summary>\n <div>\n Toggle using mouse, Enter and Space keys.\n </div>\n</vaadin-details>\n```\n\n### Styling\n\nThe following shadow DOM parts are exposed for styling:\n\nPart name | Description\n-----------------|----------------\n`content` | The wrapper for the collapsible details content.\n\nThe following attributes are exposed for styling:\n\nAttribute | Description\n-------------| -----------\n`opened` | Set when the collapsible content is expanded and visible.\n`disabled` | Set when the element is disabled.\n`focus-ring` | Set when the element is focused using the keyboard.\n`focused` | Set when the element is focused.\n\nSee [Styling Components](https://vaadin.com/docs/latest/styling/styling-components) documentation.",
40
+ "description": "`<vaadin-details>` is a Web Component which the creates an\nexpandable panel similar to `<details>` HTML element.\n\n```html\n<vaadin-details>\n <vaadin-details-summary slot=\"summary\">Expandable Details</vaadin-details-summary>\n <div>\n Toggle using mouse, Enter and Space keys.\n </div>\n</vaadin-details>\n```\n\n### Styling\n\nThe following shadow DOM parts are exposed for styling:\n\nPart name | Description\n-----------------|----------------\n`content` | The wrapper for the collapsible details content.\n\nThe following attributes are exposed for styling:\n\nAttribute | Description\n-------------| -----------\n`opened` | Set when the collapsible content is expanded and visible.\n`disabled` | Set when the element is disabled.\n`focus-ring` | Set when the element is focused using the keyboard.\n`focused` | Set when the element is focused.\n\nSee [Styling Components](https://vaadin.com/docs/latest/styling/styling-components) documentation.",
41
41
  "extension": true,
42
42
  "attributes": [
43
43
  {
@@ -1,55 +0,0 @@
1
- /**
2
- * @license
3
- * Copyright (c) 2019 - 2025 Vaadin Ltd.
4
- * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
5
- */
6
- import { html, LitElement } from 'lit';
7
- import { ButtonMixin } from '@vaadin/button/src/vaadin-button-mixin.js';
8
- import { defineCustomElement } from '@vaadin/component-base/src/define.js';
9
- import { DirMixin } from '@vaadin/component-base/src/dir-mixin.js';
10
- import { PolylitMixin } from '@vaadin/component-base/src/polylit-mixin.js';
11
- import { ThemableMixin } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
12
- import { detailsSummary } from './vaadin-details-summary-core-styles.js';
13
-
14
- /**
15
- * LitElement based version of `<vaadin-details-summary>` web component.
16
- *
17
- * ## Disclaimer
18
- *
19
- * This component is an experiment and not yet a part of Vaadin platform.
20
- * There is no ETA regarding specific Vaadin version where it'll land.
21
- * Feel free to try this code in your apps as per Apache 2.0 license.
22
- */
23
- class DetailsSummary extends ButtonMixin(DirMixin(ThemableMixin(PolylitMixin(LitElement)))) {
24
- static get is() {
25
- return 'vaadin-details-summary';
26
- }
27
-
28
- static get styles() {
29
- return detailsSummary();
30
- }
31
-
32
- static get properties() {
33
- return {
34
- /**
35
- * When true, the element is opened.
36
- */
37
- opened: {
38
- type: Boolean,
39
- reflectToAttribute: true,
40
- },
41
- };
42
- }
43
-
44
- /** @protected */
45
- render() {
46
- return html`
47
- <span part="toggle" aria-hidden="true"></span>
48
- <div part="content"><slot></slot></div>
49
- `;
50
- }
51
- }
52
-
53
- defineCustomElement(DetailsSummary);
54
-
55
- export { DetailsSummary };
@@ -1,64 +0,0 @@
1
- /**
2
- * @license
3
- * Copyright (c) 2019 - 2025 Vaadin Ltd.
4
- * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
5
- */
6
- import './vaadin-lit-details-summary.js';
7
- import { css, html, LitElement } from 'lit';
8
- import { defineCustomElement } from '@vaadin/component-base/src/define.js';
9
- import { ElementMixin } from '@vaadin/component-base/src/element-mixin.js';
10
- import { PolylitMixin } from '@vaadin/component-base/src/polylit-mixin.js';
11
- import { ThemableMixin } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
12
- import { DetailsBaseMixin } from './vaadin-details-base-mixin.js';
13
-
14
- /**
15
- * LitElement based version of `<vaadin-details>` web component.
16
- *
17
- * ## Disclaimer
18
- *
19
- * This component is an experiment and not yet a part of Vaadin platform.
20
- * There is no ETA regarding specific Vaadin version where it'll land.
21
- * Feel free to try this code in your apps as per Apache 2.0 license.
22
- */
23
- class Details extends DetailsBaseMixin(ElementMixin(ThemableMixin(PolylitMixin(LitElement)))) {
24
- static get is() {
25
- return 'vaadin-details';
26
- }
27
-
28
- static get styles() {
29
- return css`
30
- :host {
31
- display: block;
32
- }
33
-
34
- :host([hidden]) {
35
- display: none !important;
36
- }
37
-
38
- [part='content'] {
39
- display: none;
40
- }
41
-
42
- :host([opened]) [part='content'] {
43
- display: block;
44
- }
45
- `;
46
- }
47
-
48
- /** @protected */
49
- render() {
50
- return html`
51
- <slot name="summary"></slot>
52
-
53
- <div part="content">
54
- <slot></slot>
55
- </div>
56
-
57
- <slot name="tooltip"></slot>
58
- `;
59
- }
60
- }
61
-
62
- defineCustomElement(Details);
63
-
64
- export { Details };
@@ -1,2 +0,0 @@
1
- import './vaadin-details-summary-styles.js';
2
- import '../../src/vaadin-lit-details-summary.js';
@@ -1,2 +0,0 @@
1
- import './vaadin-details-summary-styles.js';
2
- import '../../src/vaadin-lit-details-summary.js';
@@ -1,3 +0,0 @@
1
- import './vaadin-lit-details-summary.js';
2
- import './vaadin-details-styles.js';
3
- import '../../src/vaadin-lit-details.js';
@@ -1,3 +0,0 @@
1
- import './vaadin-lit-details-summary.js';
2
- import './vaadin-details-styles.js';
3
- import '../../src/vaadin-lit-details.js';
@@ -1,5 +0,0 @@
1
- import '@vaadin/vaadin-material-styles/color.js';
2
- import '@vaadin/vaadin-material-styles/shadow.js';
3
- import '@vaadin/vaadin-material-styles/typography.js';
4
- declare const details: import("lit").CSSResult;
5
- export { details };
@@ -1,24 +0,0 @@
1
- import '@vaadin/vaadin-material-styles/color.js';
2
- import '@vaadin/vaadin-material-styles/shadow.js';
3
- import '@vaadin/vaadin-material-styles/typography.js';
4
- import { css, registerStyles } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
5
-
6
- const details = css`
7
- :host {
8
- font-family: var(--material-font-family);
9
- box-shadow: var(--material-shadow-elevation-2dp);
10
- outline: none;
11
- }
12
-
13
- :host([focus-ring]) ::slotted([slot='summary']) {
14
- background-color: var(--material-secondary-background-color);
15
- }
16
-
17
- [part='content'] {
18
- padding: 8px 24px 24px;
19
- }
20
- `;
21
-
22
- registerStyles('vaadin-details', details, { moduleId: 'material-details' });
23
-
24
- export { details };
@@ -1,5 +0,0 @@
1
- import '@vaadin/vaadin-material-styles/color.js';
2
- import '@vaadin/vaadin-material-styles/font-icons.js';
3
- import '@vaadin/vaadin-material-styles/typography.js';
4
- declare const detailsSummary: import("lit").CSSResult;
5
- export { detailsSummary };
@@ -1,106 +0,0 @@
1
- import '@vaadin/vaadin-material-styles/color.js';
2
- import '@vaadin/vaadin-material-styles/font-icons.js';
3
- import '@vaadin/vaadin-material-styles/typography.js';
4
- import { css, registerStyles } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
5
-
6
- const detailsSummary = css`
7
- :host {
8
- display: flex;
9
- align-items: center;
10
- justify-content: space-between;
11
- width: 100%;
12
- position: relative;
13
- outline: none;
14
- min-height: 48px;
15
- padding: 0 24px;
16
- box-sizing: border-box;
17
- font-weight: 500;
18
- font-size: var(--material-small-font-size);
19
- background-color: var(--material-background-color);
20
- color: var(--material-body-text-color);
21
- cursor: default;
22
- -webkit-tap-highlight-color: transparent;
23
- -webkit-font-smoothing: antialiased;
24
- -moz-osx-font-smoothing: grayscale;
25
- }
26
-
27
- :host([disabled]) {
28
- color: var(--material-disabled-text-color);
29
- background-color: var(--material-disabled-color);
30
- }
31
-
32
- [part='content'] {
33
- margin: 0;
34
- position: relative;
35
- }
36
-
37
- [part='toggle'] {
38
- position: relative;
39
- order: 1;
40
- margin-inline-start: auto;
41
- right: -8px;
42
- width: 24px;
43
- height: 24px;
44
- padding: 4px;
45
- color: var(--material-secondary-text-color);
46
- line-height: 24px;
47
- text-align: center;
48
- transform: rotate(90deg);
49
- transition: transform 0.1s cubic-bezier(0.4, 0, 0.2, 0.1);
50
- }
51
-
52
- [part='toggle']::before {
53
- font-family: 'material-icons';
54
- font-size: 24px;
55
- width: 24px;
56
- display: inline-block;
57
- content: var(--material-icons-chevron-right);
58
- }
59
-
60
- [part='toggle']::after {
61
- display: inline-block;
62
- content: '';
63
- position: absolute;
64
- top: 0;
65
- left: 0;
66
- width: 100%;
67
- height: 100%;
68
- border-radius: 50%;
69
- background-color: var(--material-disabled-text-color);
70
- transform: scale(0);
71
- opacity: 0;
72
- transition:
73
- transform 0s 0.8s,
74
- opacity 0.8s;
75
- will-change: transform, opacity;
76
- }
77
-
78
- :host([disabled]) [part='toggle'] {
79
- color: var(--material-disabled-color);
80
- }
81
-
82
- :host([active]:not([disabled])) [part='toggle']::after {
83
- transition-duration: 0.08s, 0.01s;
84
- transition-delay: 0s, 0s;
85
- transform: scale(1.25);
86
- opacity: 0.15;
87
- }
88
-
89
- :host([opened]) [part='toggle'] {
90
- transform: rotate(270deg);
91
- }
92
-
93
- /* RTL specific styles */
94
- :host([dir='rtl']) [part='toggle'] {
95
- right: 8px;
96
- }
97
-
98
- :host([dir='rtl']) [part='toggle']::after {
99
- left: auto;
100
- right: 0;
101
- }
102
- `;
103
-
104
- registerStyles('vaadin-details-summary', detailsSummary, { moduleId: 'material-details-summary' });
105
-
106
- export { detailsSummary };
@@ -1,2 +0,0 @@
1
- import './vaadin-details-summary-styles.js';
2
- import '../../src/vaadin-details-summary.js';
@@ -1,2 +0,0 @@
1
- import './vaadin-details-summary-styles.js';
2
- import '../../src/vaadin-details-summary.js';
@@ -1,3 +0,0 @@
1
- import './vaadin-details-summary.js';
2
- import './vaadin-details-styles.js';
3
- import '../../src/vaadin-details.js';
@@ -1,3 +0,0 @@
1
- import './vaadin-details-summary.js';
2
- import './vaadin-details-styles.js';
3
- import '../../src/vaadin-details.js';
@@ -1,2 +0,0 @@
1
- import './vaadin-details-summary-styles.js';
2
- import '../../src/vaadin-lit-details-summary.js';
@@ -1,2 +0,0 @@
1
- import './vaadin-details-summary-styles.js';
2
- import '../../src/vaadin-lit-details-summary.js';
@@ -1,3 +0,0 @@
1
- import './vaadin-lit-details-summary.js';
2
- import './vaadin-details-styles.js';
3
- import '../../src/vaadin-lit-details.js';
@@ -1,3 +0,0 @@
1
- import './vaadin-lit-details-summary.js';
2
- import './vaadin-details-styles.js';
3
- import '../../src/vaadin-lit-details.js';
@@ -1 +0,0 @@
1
- export * from './src/vaadin-details-summary.js';
@@ -1,2 +0,0 @@
1
- import './theme/lumo/vaadin-lit-details-summary.js';
2
- export * from './src/vaadin-lit-details-summary.js';
@@ -1 +0,0 @@
1
- export * from './src/vaadin-details.js';
@@ -1,2 +0,0 @@
1
- import './theme/lumo/vaadin-lit-details.js';
2
- export * from './src/vaadin-lit-details.js';