@vaadin/tooltip 25.0.0-alpha3 → 25.0.0-alpha5
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 +12 -10
- package/src/styles/vaadin-tooltip-overlay-base-styles.js +56 -0
- package/src/styles/vaadin-tooltip-overlay-core-styles.d.ts +8 -0
- package/src/{vaadin-tooltip-overlay-styles.js → styles/vaadin-tooltip-overlay-core-styles.js} +1 -1
- package/src/vaadin-tooltip-mixin.js +3 -0
- package/src/vaadin-tooltip-overlay.js +4 -3
- package/src/vaadin-tooltip.js +2 -1
- package/web-types.json +2 -2
- package/web-types.lit.json +2 -2
- /package/src/{vaadin-tooltip-overlay-styles.d.ts → styles/vaadin-tooltip-overlay-base-styles.d.ts} +0 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vaadin/tooltip",
|
|
3
|
-
"version": "25.0.0-
|
|
3
|
+
"version": "25.0.0-alpha5",
|
|
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",
|
|
@@ -35,17 +37,17 @@
|
|
|
35
37
|
],
|
|
36
38
|
"dependencies": {
|
|
37
39
|
"@open-wc/dedupe-mixin": "^1.3.0",
|
|
38
|
-
"@vaadin/a11y-base": "25.0.0-
|
|
39
|
-
"@vaadin/component-base": "25.0.0-
|
|
40
|
-
"@vaadin/overlay": "25.0.0-
|
|
41
|
-
"@vaadin/popover": "25.0.0-
|
|
42
|
-
"@vaadin/vaadin-lumo-styles": "25.0.0-
|
|
43
|
-
"@vaadin/vaadin-themable-mixin": "25.0.0-
|
|
40
|
+
"@vaadin/a11y-base": "25.0.0-alpha5",
|
|
41
|
+
"@vaadin/component-base": "25.0.0-alpha5",
|
|
42
|
+
"@vaadin/overlay": "25.0.0-alpha5",
|
|
43
|
+
"@vaadin/popover": "25.0.0-alpha5",
|
|
44
|
+
"@vaadin/vaadin-lumo-styles": "25.0.0-alpha5",
|
|
45
|
+
"@vaadin/vaadin-themable-mixin": "25.0.0-alpha5",
|
|
44
46
|
"lit": "^3.0.0"
|
|
45
47
|
},
|
|
46
48
|
"devDependencies": {
|
|
47
|
-
"@vaadin/chai-plugins": "25.0.0-
|
|
48
|
-
"@vaadin/test-runner-commands": "25.0.0-
|
|
49
|
+
"@vaadin/chai-plugins": "25.0.0-alpha5",
|
|
50
|
+
"@vaadin/test-runner-commands": "25.0.0-alpha5",
|
|
49
51
|
"@vaadin/testing-helpers": "^2.0.0",
|
|
50
52
|
"sinon": "^18.0.0"
|
|
51
53
|
},
|
|
@@ -53,5 +55,5 @@
|
|
|
53
55
|
"web-types.json",
|
|
54
56
|
"web-types.lit.json"
|
|
55
57
|
],
|
|
56
|
-
"gitHead": "
|
|
58
|
+
"gitHead": "7dc87bb2a3cae81ed53259fa10b58f990d50c6fd"
|
|
57
59
|
}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright (c) 2022 - 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 tooltipOverlayStyles = css`
|
|
10
|
+
@layer base {
|
|
11
|
+
[part='overlay'] {
|
|
12
|
+
max-width: var(--vaadin-tooltip-max-width, 40ch);
|
|
13
|
+
padding: var(--vaadin-tooltip-padding, var(--_vaadin-padding-container));
|
|
14
|
+
border-radius: var(--vaadin-tooltip-border-radius, var(--_vaadin-radius-m));
|
|
15
|
+
background: var(--vaadin-tooltip-background, var(--_vaadin-background));
|
|
16
|
+
color: var(--vaadin-tooltip-color, inherit);
|
|
17
|
+
font-size: var(--vaadin-tooltip-font-size, 0.9em);
|
|
18
|
+
font-weight: var(--vaadin-tooltip-font-weight, inherit);
|
|
19
|
+
line-height: var(--vaadin-tooltip-line-height, inherit);
|
|
20
|
+
border: 0;
|
|
21
|
+
box-shadow:
|
|
22
|
+
0 0 0 var(--vaadin-tooltip-border-width, 1px) var(--vaadin-tooltip-border-color, var(--_vaadin-border-color)),
|
|
23
|
+
var(--vaadin-tooltip-box-shadow, 0 3px 8px -1px rgba(0, 0, 0, 0.2));
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
[part='content'] {
|
|
27
|
+
white-space: pre-wrap;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
:host([position^='top'][top-aligned]) [part='overlay'],
|
|
31
|
+
:host([position^='bottom'][top-aligned]) [part='overlay'] {
|
|
32
|
+
margin-top: var(--vaadin-tooltip-offset-top, 0.25rem);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
:host([position^='top'][bottom-aligned]) [part='overlay'],
|
|
36
|
+
:host([position^='bottom'][bottom-aligned]) [part='overlay'] {
|
|
37
|
+
margin-bottom: var(--vaadin-tooltip-offset-bottom, 0.25rem);
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
:host([position^='start'][start-aligned]) [part='overlay'],
|
|
41
|
+
:host([position^='end'][start-aligned]) [part='overlay'] {
|
|
42
|
+
margin-inline-start: var(--vaadin-tooltip-offset-start, 0.25rem);
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
:host([position^='start'][end-aligned]) [part='overlay'],
|
|
46
|
+
:host([position^='end'][end-aligned]) [part='overlay'] {
|
|
47
|
+
margin-inline-end: var(--vaadin-tooltip-offset-end, 0.25rem);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
@media (forced-colors: active) {
|
|
51
|
+
[part='overlay'] {
|
|
52
|
+
border: 1px dashed;
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
`;
|
package/src/{vaadin-tooltip-overlay-styles.js → styles/vaadin-tooltip-overlay-core-styles.js}
RENAMED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* Copyright (c) 2022 - 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 { css } from '
|
|
6
|
+
import { css } from 'lit';
|
|
7
7
|
|
|
8
8
|
export const tooltipOverlayStyles = css`
|
|
9
9
|
[part='overlay'] {
|
|
@@ -617,6 +617,9 @@ export const TooltipMixin = (superClass) =>
|
|
|
617
617
|
|
|
618
618
|
/** @protected */
|
|
619
619
|
__onOverlayMouseEnter() {
|
|
620
|
+
if (this.manual) {
|
|
621
|
+
return;
|
|
622
|
+
}
|
|
620
623
|
// Retain opened state when moving pointer over the overlay.
|
|
621
624
|
// Closing can start due to an offset between the target and
|
|
622
625
|
// the overlay itself. If that's the case, re-open overlay.
|
|
@@ -7,10 +7,11 @@ 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 { overlayStyles } from '@vaadin/overlay/src/vaadin-overlay-styles.js';
|
|
10
|
+
import { overlayStyles } from '@vaadin/overlay/src/styles/vaadin-overlay-core-styles.js';
|
|
11
11
|
import { PopoverOverlayMixin } from '@vaadin/popover/src/vaadin-popover-overlay-mixin.js';
|
|
12
|
+
import { CSSInjectionMixin } from '@vaadin/vaadin-themable-mixin/css-injection-mixin.js';
|
|
12
13
|
import { ThemableMixin } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
|
|
13
|
-
import { tooltipOverlayStyles } from './vaadin-tooltip-overlay-styles.js';
|
|
14
|
+
import { tooltipOverlayStyles } from './styles/vaadin-tooltip-overlay-core-styles.js';
|
|
14
15
|
|
|
15
16
|
/**
|
|
16
17
|
* An element used internally by `<vaadin-tooltip>`. Not intended to be used separately.
|
|
@@ -22,7 +23,7 @@ import { tooltipOverlayStyles } from './vaadin-tooltip-overlay-styles.js';
|
|
|
22
23
|
* @mixes PopoverOverlayMixin
|
|
23
24
|
* @private
|
|
24
25
|
*/
|
|
25
|
-
class TooltipOverlay extends PopoverOverlayMixin(DirMixin(ThemableMixin(PolylitMixin(LitElement)))) {
|
|
26
|
+
class TooltipOverlay extends PopoverOverlayMixin(DirMixin(ThemableMixin(CSSInjectionMixin(PolylitMixin(LitElement))))) {
|
|
26
27
|
static get is() {
|
|
27
28
|
return 'vaadin-tooltip-overlay';
|
|
28
29
|
}
|
package/src/vaadin-tooltip.js
CHANGED
|
@@ -9,6 +9,7 @@ import { ifDefined } from 'lit/directives/if-defined.js';
|
|
|
9
9
|
import { defineCustomElement } from '@vaadin/component-base/src/define.js';
|
|
10
10
|
import { ElementMixin } from '@vaadin/component-base/src/element-mixin.js';
|
|
11
11
|
import { PolylitMixin } from '@vaadin/component-base/src/polylit-mixin.js';
|
|
12
|
+
import { CSSInjectionMixin } from '@vaadin/vaadin-themable-mixin/css-injection-mixin.js';
|
|
12
13
|
import { ThemePropertyMixin } from '@vaadin/vaadin-themable-mixin/vaadin-theme-property-mixin.js';
|
|
13
14
|
import { TooltipMixin } from './vaadin-tooltip-mixin.js';
|
|
14
15
|
|
|
@@ -56,7 +57,7 @@ import { TooltipMixin } from './vaadin-tooltip-mixin.js';
|
|
|
56
57
|
* @mixes ThemePropertyMixin
|
|
57
58
|
* @mixes TooltipMixin
|
|
58
59
|
*/
|
|
59
|
-
class Tooltip extends TooltipMixin(ThemePropertyMixin(ElementMixin(PolylitMixin(LitElement)))) {
|
|
60
|
+
class Tooltip extends TooltipMixin(ThemePropertyMixin(ElementMixin(CSSInjectionMixin(PolylitMixin(LitElement))))) {
|
|
60
61
|
static get is() {
|
|
61
62
|
return 'vaadin-tooltip';
|
|
62
63
|
}
|
package/web-types.json
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://json.schemastore.org/web-types",
|
|
3
3
|
"name": "@vaadin/tooltip",
|
|
4
|
-
"version": "25.0.0-
|
|
4
|
+
"version": "25.0.0-alpha5",
|
|
5
5
|
"description-markup": "markdown",
|
|
6
6
|
"contributions": {
|
|
7
7
|
"html": {
|
|
8
8
|
"elements": [
|
|
9
9
|
{
|
|
10
10
|
"name": "vaadin-tooltip",
|
|
11
|
-
"description": "`<vaadin-tooltip>` is a Web Component for creating tooltips.\n\n```html\n<button id=\"confirm\">Confirm</button>\n<vaadin-tooltip text=\"Click to save changes\" for=\"confirm\"></vaadin-tooltip>\n```\n\n### Styling\n\n`<vaadin-tooltip>` uses `<vaadin-tooltip-overlay>` internal\nthemable component as the actual visible overlay.\n\nSee [`<vaadin-overlay>`](https://cdn.vaadin.com/vaadin-web-components/25.0.0-
|
|
11
|
+
"description": "`<vaadin-tooltip>` is a Web Component for creating tooltips.\n\n```html\n<button id=\"confirm\">Confirm</button>\n<vaadin-tooltip text=\"Click to save changes\" for=\"confirm\"></vaadin-tooltip>\n```\n\n### Styling\n\n`<vaadin-tooltip>` uses `<vaadin-tooltip-overlay>` internal\nthemable component as the actual visible overlay.\n\nSee [`<vaadin-overlay>`](https://cdn.vaadin.com/vaadin-web-components/25.0.0-alpha5/#/elements/vaadin-overlay) documentation\nfor `<vaadin-tooltip-overlay>` parts.\n\nThe following state attributes are available for styling:\n\nAttribute | Description\n-----------------|----------------------------------------\n`position` | Reflects the `position` property value.\n\nNote: the `theme` attribute value set on `<vaadin-tooltip>` is\npropagated to the internal `<vaadin-tooltip-overlay>` component.\n\n### Custom CSS Properties\n\nThe following custom CSS properties are available on the `<vaadin-tooltip>` element:\n\nCustom CSS property | Description\n---------------------------------|-------------\n`--vaadin-tooltip-offset-top` | Used as an offset when the tooltip is aligned vertically below the target\n`--vaadin-tooltip-offset-bottom` | Used as an offset when the tooltip is aligned vertically above the target\n`--vaadin-tooltip-offset-start` | Used as an offset when the tooltip is aligned horizontally after the target\n`--vaadin-tooltip-offset-end` | Used as an offset when the tooltip is aligned horizontally before the target\n\nSee [Styling Components](https://vaadin.com/docs/latest/styling/styling-components) documentation.",
|
|
12
12
|
"attributes": [
|
|
13
13
|
{
|
|
14
14
|
"name": "overlay-class",
|
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/tooltip",
|
|
4
|
-
"version": "25.0.0-
|
|
4
|
+
"version": "25.0.0-alpha5",
|
|
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-tooltip",
|
|
19
|
-
"description": "`<vaadin-tooltip>` is a Web Component for creating tooltips.\n\n```html\n<button id=\"confirm\">Confirm</button>\n<vaadin-tooltip text=\"Click to save changes\" for=\"confirm\"></vaadin-tooltip>\n```\n\n### Styling\n\n`<vaadin-tooltip>` uses `<vaadin-tooltip-overlay>` internal\nthemable component as the actual visible overlay.\n\nSee [`<vaadin-overlay>`](https://cdn.vaadin.com/vaadin-web-components/25.0.0-
|
|
19
|
+
"description": "`<vaadin-tooltip>` is a Web Component for creating tooltips.\n\n```html\n<button id=\"confirm\">Confirm</button>\n<vaadin-tooltip text=\"Click to save changes\" for=\"confirm\"></vaadin-tooltip>\n```\n\n### Styling\n\n`<vaadin-tooltip>` uses `<vaadin-tooltip-overlay>` internal\nthemable component as the actual visible overlay.\n\nSee [`<vaadin-overlay>`](https://cdn.vaadin.com/vaadin-web-components/25.0.0-alpha5/#/elements/vaadin-overlay) documentation\nfor `<vaadin-tooltip-overlay>` parts.\n\nThe following state attributes are available for styling:\n\nAttribute | Description\n-----------------|----------------------------------------\n`position` | Reflects the `position` property value.\n\nNote: the `theme` attribute value set on `<vaadin-tooltip>` is\npropagated to the internal `<vaadin-tooltip-overlay>` component.\n\n### Custom CSS Properties\n\nThe following custom CSS properties are available on the `<vaadin-tooltip>` element:\n\nCustom CSS property | Description\n---------------------------------|-------------\n`--vaadin-tooltip-offset-top` | Used as an offset when the tooltip is aligned vertically below the target\n`--vaadin-tooltip-offset-bottom` | Used as an offset when the tooltip is aligned vertically above the target\n`--vaadin-tooltip-offset-start` | Used as an offset when the tooltip is aligned horizontally after the target\n`--vaadin-tooltip-offset-end` | Used as an offset when the tooltip is aligned horizontally before the target\n\nSee [Styling Components](https://vaadin.com/docs/latest/styling/styling-components) documentation.",
|
|
20
20
|
"extension": true,
|
|
21
21
|
"attributes": [
|
|
22
22
|
{
|
/package/src/{vaadin-tooltip-overlay-styles.d.ts → styles/vaadin-tooltip-overlay-base-styles.d.ts}
RENAMED
|
File without changes
|