@fluid-topics/ft-tooltip 0.3.12 → 0.3.13
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/build/ft-tooltip.css.d.ts +10 -0
- package/build/ft-tooltip.css.js +45 -0
- package/build/ft-tooltip.d.ts +1 -16
- package/build/ft-tooltip.js +4 -44
- package/build/ft-tooltip.light.js +109 -109
- package/build/ft-tooltip.min.js +111 -111
- package/build/ft-tooltip.properties.d.ts +9 -0
- package/build/ft-tooltip.properties.js +2 -0
- package/build/index.d.ts +2 -0
- package/build/index.js +2 -0
- package/package.json +4 -4
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export declare const FtTooltipCssVariables: {
|
|
2
|
+
distance: import("@fluid-topics/ft-wc-utils").FtCssVariable;
|
|
3
|
+
color: import("@fluid-topics/ft-wc-utils").FtCssVariable;
|
|
4
|
+
backgroundColor: import("@fluid-topics/ft-wc-utils").FtCssVariable;
|
|
5
|
+
zIndex: import("@fluid-topics/ft-wc-utils").FtCssVariable;
|
|
6
|
+
borderRadiusS: import("@fluid-topics/ft-wc-utils").FtCssVariable;
|
|
7
|
+
maxWidth: import("@fluid-topics/ft-wc-utils").FtCssVariable;
|
|
8
|
+
};
|
|
9
|
+
export declare const styles: import("lit").CSSResult;
|
|
10
|
+
//# sourceMappingURL=ft-tooltip.css.d.ts.map
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { css } from "lit";
|
|
2
|
+
import { designSystemVariables, FtCssVariableFactory } from "@fluid-topics/ft-wc-utils";
|
|
3
|
+
export const FtTooltipCssVariables = {
|
|
4
|
+
distance: FtCssVariableFactory.create("--ft-tooltip-distance", "SIZE", "4px"),
|
|
5
|
+
color: FtCssVariableFactory.create("--ft-tooltip-color", "COLOR", "#FFFFFF"),
|
|
6
|
+
backgroundColor: FtCssVariableFactory.create("--ft-tooltip-background-color", "COLOR", "#666666"),
|
|
7
|
+
zIndex: FtCssVariableFactory.create("--ft-tooltip-z-index", "NUMBER", "1"),
|
|
8
|
+
borderRadiusS: FtCssVariableFactory.external(designSystemVariables.borderRadiusS, "Design system"),
|
|
9
|
+
maxWidth: FtCssVariableFactory.create("--ft-tooltip-max-width", "SIZE", "150px"),
|
|
10
|
+
};
|
|
11
|
+
// language=CSS
|
|
12
|
+
export const styles = css `
|
|
13
|
+
.ft-tooltip--container {
|
|
14
|
+
display: block;
|
|
15
|
+
position: relative;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
.ft-tooltip--inline {
|
|
19
|
+
display: inline-block;
|
|
20
|
+
max-width: 100%;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
.ft-tooltip {
|
|
24
|
+
position: absolute;
|
|
25
|
+
box-sizing: border-box;
|
|
26
|
+
overflow: hidden;
|
|
27
|
+
width: max-content;
|
|
28
|
+
max-width: ${FtTooltipCssVariables.maxWidth};
|
|
29
|
+
text-align: center;
|
|
30
|
+
padding: ${FtTooltipCssVariables.distance};
|
|
31
|
+
z-index: ${FtTooltipCssVariables.zIndex};
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
.ft-tooltip--content {
|
|
35
|
+
padding: 4px 8px;
|
|
36
|
+
border-radius: ${FtTooltipCssVariables.borderRadiusS};
|
|
37
|
+
background-color: ${FtTooltipCssVariables.backgroundColor};
|
|
38
|
+
color: ${FtTooltipCssVariables.color};
|
|
39
|
+
top: -500px;
|
|
40
|
+
left: -500px;
|
|
41
|
+
position: relative;
|
|
42
|
+
word-break: break-word;
|
|
43
|
+
}
|
|
44
|
+
`;
|
|
45
|
+
//# sourceMappingURL=ft-tooltip.css.js.map
|
package/build/ft-tooltip.d.ts
CHANGED
|
@@ -1,21 +1,6 @@
|
|
|
1
1
|
import { PropertyValues } from "lit";
|
|
2
2
|
import { ElementDefinitionsMap, FtLitElement } from "@fluid-topics/ft-wc-utils";
|
|
3
|
-
|
|
4
|
-
text: string;
|
|
5
|
-
inline: boolean;
|
|
6
|
-
manual: boolean;
|
|
7
|
-
delay: number;
|
|
8
|
-
position: Position;
|
|
9
|
-
}
|
|
10
|
-
export declare const FtTooltipCssVariables: {
|
|
11
|
-
distance: import("@fluid-topics/ft-wc-utils").FtCssVariable;
|
|
12
|
-
color: import("@fluid-topics/ft-wc-utils").FtCssVariable;
|
|
13
|
-
backgroundColor: import("@fluid-topics/ft-wc-utils").FtCssVariable;
|
|
14
|
-
zIndex: import("@fluid-topics/ft-wc-utils").FtCssVariable;
|
|
15
|
-
borderRadiusS: import("@fluid-topics/ft-wc-utils").FtCssVariable;
|
|
16
|
-
maxWidth: import("@fluid-topics/ft-wc-utils").FtCssVariable;
|
|
17
|
-
};
|
|
18
|
-
export declare type Position = "top" | "bottom" | "left" | "right";
|
|
3
|
+
import { FtTooltipProperties, Position } from "./ft-tooltip.properties";
|
|
19
4
|
export declare class FtTooltip extends FtLitElement implements FtTooltipProperties {
|
|
20
5
|
static elementDefinitions: ElementDefinitionsMap;
|
|
21
6
|
static styles: import("lit").CSSResult;
|
package/build/ft-tooltip.js
CHANGED
|
@@ -4,18 +4,11 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
4
4
|
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
5
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
6
|
};
|
|
7
|
-
import {
|
|
7
|
+
import { html } from "lit";
|
|
8
8
|
import { property, query, queryAssignedNodes, state } from "lit/decorators.js";
|
|
9
|
-
import { Debouncer,
|
|
9
|
+
import { Debouncer, FtLitElement } from "@fluid-topics/ft-wc-utils";
|
|
10
10
|
import { FtTypography } from "@fluid-topics/ft-typography";
|
|
11
|
-
|
|
12
|
-
distance: FtCssVariableFactory.create("--ft-tooltip-distance", "SIZE", "4px"),
|
|
13
|
-
color: FtCssVariableFactory.create("--ft-tooltip-color", "COLOR", "#FFFFFF"),
|
|
14
|
-
backgroundColor: FtCssVariableFactory.create("--ft-tooltip-background-color", "COLOR", "#666666"),
|
|
15
|
-
zIndex: FtCssVariableFactory.create("--ft-tooltip-z-index", "NUMBER", "1"),
|
|
16
|
-
borderRadiusS: FtCssVariableFactory.external(designSystemVariables.borderRadiusS, "Design system"),
|
|
17
|
-
maxWidth: FtCssVariableFactory.create("--ft-tooltip-max-width", "SIZE", "150px"),
|
|
18
|
-
};
|
|
11
|
+
import { FtTooltipCssVariables, styles } from "./ft-tooltip.css";
|
|
19
12
|
export class FtTooltip extends FtLitElement {
|
|
20
13
|
constructor() {
|
|
21
14
|
super(...arguments);
|
|
@@ -170,40 +163,7 @@ export class FtTooltip extends FtLitElement {
|
|
|
170
163
|
FtTooltip.elementDefinitions = {
|
|
171
164
|
"ft-typography": FtTypography,
|
|
172
165
|
};
|
|
173
|
-
|
|
174
|
-
FtTooltip.styles = css `
|
|
175
|
-
.ft-tooltip--container {
|
|
176
|
-
display: block;
|
|
177
|
-
position: relative;
|
|
178
|
-
}
|
|
179
|
-
|
|
180
|
-
.ft-tooltip--inline {
|
|
181
|
-
display: inline-block;
|
|
182
|
-
max-width: 100%;
|
|
183
|
-
}
|
|
184
|
-
|
|
185
|
-
.ft-tooltip {
|
|
186
|
-
position: absolute;
|
|
187
|
-
box-sizing: border-box;
|
|
188
|
-
overflow: hidden;
|
|
189
|
-
width: max-content;
|
|
190
|
-
max-width: ${FtTooltipCssVariables.maxWidth};
|
|
191
|
-
text-align: center;
|
|
192
|
-
padding: ${FtTooltipCssVariables.distance};
|
|
193
|
-
z-index: ${FtTooltipCssVariables.zIndex};
|
|
194
|
-
}
|
|
195
|
-
|
|
196
|
-
.ft-tooltip--content {
|
|
197
|
-
padding: 4px 8px;
|
|
198
|
-
border-radius: ${FtTooltipCssVariables.borderRadiusS};
|
|
199
|
-
background-color: ${FtTooltipCssVariables.backgroundColor};
|
|
200
|
-
color: ${FtTooltipCssVariables.color};
|
|
201
|
-
top: -500px;
|
|
202
|
-
left: -500px;
|
|
203
|
-
position: relative;
|
|
204
|
-
word-break: break-word;
|
|
205
|
-
}
|
|
206
|
-
`;
|
|
166
|
+
FtTooltip.styles = styles;
|
|
207
167
|
__decorate([
|
|
208
168
|
property()
|
|
209
169
|
], FtTooltip.prototype, "text", void 0);
|
|
@@ -10,109 +10,141 @@ var s;const n=globalThis.trustedTypes,r=n?n.createPolicy("lit-html",{createHTML:
|
|
|
10
10
|
* Copyright 2020 Google LLC
|
|
11
11
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
12
12
|
*/
|
|
13
|
-
const M=Symbol.for(""),Z=t=>{if((null==t?void 0:t.r)===M)return null==t?void 0:t._$litStatic$},W=t=>({_$litStatic$:t,r:M}),B=new Map,G=(t=>(i,...o)=>{const e=o.length;let s,n;const r=[],h=[];let l,a=0,p=!1;for(;a<e;){for(l=i[a];a<e&&void 0!==(n=o[a],s=Z(n));)l+=s+i[++a],p=!0;h.push(n),r.push(l),a++}if(a===e&&r.push(i[e]),p){const t=r.join("$$lit$$");void 0===(i=B.get(t))&&(r.raw=r,B.set(t,i=r)),o=h}return t(i,...o)})(x);var H
|
|
13
|
+
const M=Symbol.for(""),Z=t=>{if((null==t?void 0:t.r)===M)return null==t?void 0:t._$litStatic$},W=t=>({_$litStatic$:t,r:M}),B=new Map,G=(t=>(i,...o)=>{const e=o.length;let s,n;const r=[],h=[];let l,a=0,p=!1;for(;a<e;){for(l=i[a];a<e&&void 0!==(n=o[a],s=Z(n));)l+=s+i[++a],p=!0;h.push(n),r.push(l),a++}if(a===e&&r.push(i[e]),p){const t=r.join("$$lit$$");void 0===(i=B.get(t))&&(r.raw=r,B.set(t,i=r)),o=h}return t(i,...o)})(x);var H;!function(t){t.title="title",t.title_dense="title-dense",t.subtitle1="subtitle1",t.subtitle2="subtitle2",t.body1="body1",t.body2="body2",t.caption="caption",t.breadcrumb="breadcrumb",t.overline="overline",t.button="button"}(H||(H={}));const L=i.FtCssVariableFactory.extend("--ft-typography-font-family",i.designSystemVariables.titleFont),P=i.FtCssVariableFactory.extend("--ft-typography-font-family",i.designSystemVariables.contentFont),K={fontFamily:P,fontSize:i.FtCssVariableFactory.create("--ft-typography-font-size","SIZE","16px"),fontWeight:i.FtCssVariableFactory.create("--ft-typography-font-weight","UNKNOWN","normal"),letterSpacing:i.FtCssVariableFactory.create("--ft-typography-letter-spacing","SIZE","0.496px"),lineHeight:i.FtCssVariableFactory.create("--ft-typography-line-height","NUMBER","1.5"),textTransform:i.FtCssVariableFactory.create("--ft-typography-text-transform","UNKNOWN","inherit")},D=i.FtCssVariableFactory.extend("--ft-typography-title-font-family",L),q=i.FtCssVariableFactory.extend("--ft-typography-title-font-size",K.fontSize,"20px"),J=i.FtCssVariableFactory.extend("--ft-typography-title-font-weight",K.fontWeight,"normal"),Q=i.FtCssVariableFactory.extend("--ft-typography-title-letter-spacing",K.letterSpacing,"0.15px"),V=i.FtCssVariableFactory.extend("--ft-typography-title-line-height",K.lineHeight,"1.2"),X=i.FtCssVariableFactory.extend("--ft-typography-title-text-transform",K.textTransform,"inherit"),Y=i.FtCssVariableFactory.extend("--ft-typography-title-dense-font-family",L),tt=i.FtCssVariableFactory.extend("--ft-typography-title-dense-font-size",K.fontSize,"14px"),it=i.FtCssVariableFactory.extend("--ft-typography-title-dense-font-weight",K.fontWeight,"normal"),ot=i.FtCssVariableFactory.extend("--ft-typography-title-dense-letter-spacing",K.letterSpacing,"0.105px"),et=i.FtCssVariableFactory.extend("--ft-typography-title-dense-line-height",K.lineHeight,"1.7"),st=i.FtCssVariableFactory.extend("--ft-typography-title-dense-text-transform",K.textTransform,"inherit"),nt=i.FtCssVariableFactory.extend("--ft-typography-subtitle1-font-family",P),rt=i.FtCssVariableFactory.extend("--ft-typography-subtitle1-font-size",K.fontSize,"16px"),ht=i.FtCssVariableFactory.extend("--ft-typography-subtitle1-font-weight",K.fontWeight,"600"),lt=i.FtCssVariableFactory.extend("--ft-typography-subtitle1-letter-spacing",K.letterSpacing,"0.144px"),at=i.FtCssVariableFactory.extend("--ft-typography-subtitle1-line-height",K.lineHeight,"1.5"),pt=i.FtCssVariableFactory.extend("--ft-typography-subtitle1-text-transform",K.textTransform,"inherit"),ft=i.FtCssVariableFactory.extend("--ft-typography-subtitle2-font-family",P),yt=i.FtCssVariableFactory.extend("--ft-typography-subtitle2-font-size",K.fontSize,"14px"),gt=i.FtCssVariableFactory.extend("--ft-typography-subtitle2-font-weight",K.fontWeight,"normal"),ct=i.FtCssVariableFactory.extend("--ft-typography-subtitle2-letter-spacing",K.letterSpacing,"0.098px"),dt=i.FtCssVariableFactory.extend("--ft-typography-subtitle2-line-height",K.lineHeight,"1.7"),ut=i.FtCssVariableFactory.extend("--ft-typography-subtitle2-text-transform",K.textTransform,"inherit"),vt=i.FtCssVariableFactory.extend("--ft-typography-body1-font-family",P),$t=i.FtCssVariableFactory.extend("--ft-typography-body1-font-size",K.fontSize,"16px"),bt=i.FtCssVariableFactory.extend("--ft-typography-body1-font-weight",K.fontWeight,"normal"),mt=i.FtCssVariableFactory.extend("--ft-typography-body1-letter-spacing",K.letterSpacing,"0.496px"),xt=i.FtCssVariableFactory.extend("--ft-typography-body1-line-height",K.lineHeight,"1.5"),wt=i.FtCssVariableFactory.extend("--ft-typography-body1-text-transform",K.textTransform,"inherit"),zt=i.FtCssVariableFactory.extend("--ft-typography-body2-font-family",P),kt=i.FtCssVariableFactory.extend("--ft-typography-body2-font-size",K.fontSize,"14px"),At=i.FtCssVariableFactory.extend("--ft-typography-body2-font-weight",K.fontWeight,"normal"),Nt=i.FtCssVariableFactory.extend("--ft-typography-body2-letter-spacing",K.letterSpacing,"0.252px"),_t=i.FtCssVariableFactory.extend("--ft-typography-body2-line-height",K.lineHeight,"1.4"),St=i.FtCssVariableFactory.extend("--ft-typography-body2-text-transform",K.textTransform,"inherit"),Tt=i.FtCssVariableFactory.extend("--ft-typography-caption-font-family",P),Et=i.FtCssVariableFactory.extend("--ft-typography-caption-font-size",K.fontSize,"12px"),Ot=i.FtCssVariableFactory.extend("--ft-typography-caption-font-weight",K.fontWeight,"normal"),Ct=i.FtCssVariableFactory.extend("--ft-typography-caption-letter-spacing",K.letterSpacing,"0.396px"),It=i.FtCssVariableFactory.extend("--ft-typography-caption-line-height",K.lineHeight,"1.33"),Rt=i.FtCssVariableFactory.extend("--ft-typography-caption-text-transform",K.textTransform,"inherit"),Ut=i.FtCssVariableFactory.extend("--ft-typography-breadcrumb-font-family",P),jt=i.FtCssVariableFactory.extend("--ft-typography-breadcrumb-font-size",K.fontSize,"10px"),Ft=i.FtCssVariableFactory.extend("--ft-typography-breadcrumb-font-weight",K.fontWeight,"normal"),Mt=i.FtCssVariableFactory.extend("--ft-typography-breadcrumb-letter-spacing",K.letterSpacing,"0.33px"),Zt=i.FtCssVariableFactory.extend("--ft-typography-breadcrumb-line-height",K.lineHeight,"1.6"),Wt=i.FtCssVariableFactory.extend("--ft-typography-breadcrumb-text-transform",K.textTransform,"inherit"),Bt=i.FtCssVariableFactory.extend("--ft-typography-overline-font-family",P),Gt=i.FtCssVariableFactory.extend("--ft-typography-overline-font-size",K.fontSize,"10px"),Ht=i.FtCssVariableFactory.extend("--ft-typography-overline-font-weight",K.fontWeight,"normal"),Lt=i.FtCssVariableFactory.extend("--ft-typography-overline-letter-spacing",K.letterSpacing,"1.5px"),Pt=i.FtCssVariableFactory.extend("--ft-typography-overline-line-height",K.lineHeight,"1.6"),Kt=i.FtCssVariableFactory.extend("--ft-typography-overline-text-transform",K.textTransform,"uppercase"),Dt=i.FtCssVariableFactory.extend("--ft-typography-button-font-family",P),qt=i.FtCssVariableFactory.extend("--ft-typography-button-font-size",K.fontSize,"14px"),Jt=i.FtCssVariableFactory.extend("--ft-typography-button-font-weight",K.fontWeight,"600"),Qt=i.FtCssVariableFactory.extend("--ft-typography-button-letter-spacing",K.letterSpacing,"1.246px"),Vt=i.FtCssVariableFactory.extend("--ft-typography-button-line-height",K.lineHeight,"1.15"),Xt=i.FtCssVariableFactory.extend("--ft-typography-button-text-transform",K.textTransform,"uppercase"),Yt=o.css`
|
|
14
14
|
.ft-typography--title {
|
|
15
|
-
font-family: ${
|
|
16
|
-
font-size: ${
|
|
17
|
-
font-weight: ${
|
|
18
|
-
letter-spacing: ${
|
|
19
|
-
line-height: ${
|
|
20
|
-
text-transform: ${
|
|
15
|
+
font-family: ${D};
|
|
16
|
+
font-size: ${q};
|
|
17
|
+
font-weight: ${J};
|
|
18
|
+
letter-spacing: ${Q};
|
|
19
|
+
line-height: ${V};
|
|
20
|
+
text-transform: ${X};
|
|
21
21
|
}
|
|
22
|
-
`,
|
|
22
|
+
`,ti=o.css`
|
|
23
23
|
.ft-typography--title-dense {
|
|
24
|
-
font-family: ${
|
|
25
|
-
font-size: ${
|
|
26
|
-
font-weight: ${
|
|
27
|
-
letter-spacing: ${
|
|
28
|
-
line-height: ${
|
|
29
|
-
text-transform: ${
|
|
24
|
+
font-family: ${Y};
|
|
25
|
+
font-size: ${tt};
|
|
26
|
+
font-weight: ${it};
|
|
27
|
+
letter-spacing: ${ot};
|
|
28
|
+
line-height: ${et};
|
|
29
|
+
text-transform: ${st};
|
|
30
30
|
}
|
|
31
|
-
`,
|
|
31
|
+
`,ii=o.css`
|
|
32
32
|
.ft-typography--subtitle1 {
|
|
33
|
-
font-family: ${
|
|
34
|
-
font-size: ${
|
|
35
|
-
font-weight: ${
|
|
36
|
-
letter-spacing: ${
|
|
37
|
-
line-height: ${
|
|
38
|
-
text-transform: ${
|
|
33
|
+
font-family: ${nt};
|
|
34
|
+
font-size: ${rt};
|
|
35
|
+
font-weight: ${ht};
|
|
36
|
+
letter-spacing: ${lt};
|
|
37
|
+
line-height: ${at};
|
|
38
|
+
text-transform: ${pt};
|
|
39
39
|
}
|
|
40
|
-
`,
|
|
40
|
+
`,oi=o.css`
|
|
41
41
|
.ft-typography--subtitle2 {
|
|
42
|
-
font-family: ${
|
|
43
|
-
font-size: ${
|
|
44
|
-
font-weight: ${
|
|
45
|
-
letter-spacing: ${
|
|
46
|
-
line-height: ${
|
|
47
|
-
text-transform: ${
|
|
42
|
+
font-family: ${ft};
|
|
43
|
+
font-size: ${yt};
|
|
44
|
+
font-weight: ${gt};
|
|
45
|
+
letter-spacing: ${ct};
|
|
46
|
+
line-height: ${dt};
|
|
47
|
+
text-transform: ${ut};
|
|
48
48
|
}
|
|
49
49
|
|
|
50
|
-
`,
|
|
50
|
+
`,ei=o.css`
|
|
51
51
|
.ft-typography--body1 {
|
|
52
|
-
font-family: ${
|
|
53
|
-
font-size: ${
|
|
54
|
-
font-weight: ${
|
|
55
|
-
letter-spacing: ${
|
|
56
|
-
line-height: ${
|
|
57
|
-
text-transform: ${
|
|
52
|
+
font-family: ${vt};
|
|
53
|
+
font-size: ${$t};
|
|
54
|
+
font-weight: ${bt};
|
|
55
|
+
letter-spacing: ${mt};
|
|
56
|
+
line-height: ${xt};
|
|
57
|
+
text-transform: ${wt};
|
|
58
58
|
}
|
|
59
|
-
`,
|
|
59
|
+
`,si=o.css`
|
|
60
60
|
.ft-typography--body2 {
|
|
61
|
-
font-family: ${
|
|
62
|
-
font-size: ${
|
|
63
|
-
font-weight: ${
|
|
64
|
-
letter-spacing: ${
|
|
65
|
-
line-height: ${
|
|
66
|
-
text-transform: ${
|
|
61
|
+
font-family: ${zt};
|
|
62
|
+
font-size: ${kt};
|
|
63
|
+
font-weight: ${At};
|
|
64
|
+
letter-spacing: ${Nt};
|
|
65
|
+
line-height: ${_t};
|
|
66
|
+
text-transform: ${St};
|
|
67
67
|
}
|
|
68
|
-
`,
|
|
68
|
+
`,ni=o.css`
|
|
69
69
|
.ft-typography--caption {
|
|
70
|
-
font-family: ${
|
|
71
|
-
font-size: ${
|
|
72
|
-
font-weight: ${
|
|
73
|
-
letter-spacing: ${
|
|
74
|
-
line-height: ${
|
|
75
|
-
text-transform: ${
|
|
70
|
+
font-family: ${Tt};
|
|
71
|
+
font-size: ${Et};
|
|
72
|
+
font-weight: ${Ot};
|
|
73
|
+
letter-spacing: ${Ct};
|
|
74
|
+
line-height: ${It};
|
|
75
|
+
text-transform: ${Rt};
|
|
76
76
|
}
|
|
77
|
-
`,
|
|
77
|
+
`,ri=o.css`
|
|
78
78
|
.ft-typography--breadcrumb {
|
|
79
|
-
font-family: ${
|
|
80
|
-
font-size: ${
|
|
81
|
-
font-weight: ${
|
|
82
|
-
letter-spacing: ${
|
|
83
|
-
line-height: ${
|
|
84
|
-
text-transform: ${
|
|
79
|
+
font-family: ${Ut};
|
|
80
|
+
font-size: ${jt};
|
|
81
|
+
font-weight: ${Ft};
|
|
82
|
+
letter-spacing: ${Mt};
|
|
83
|
+
line-height: ${Zt};
|
|
84
|
+
text-transform: ${Wt};
|
|
85
85
|
}
|
|
86
|
-
`,
|
|
86
|
+
`,hi=o.css`
|
|
87
87
|
.ft-typography--overline {
|
|
88
|
-
font-family: ${
|
|
89
|
-
font-size: ${
|
|
90
|
-
font-weight: ${
|
|
91
|
-
letter-spacing: ${
|
|
92
|
-
line-height: ${
|
|
93
|
-
text-transform: ${
|
|
88
|
+
font-family: ${Bt};
|
|
89
|
+
font-size: ${Gt};
|
|
90
|
+
font-weight: ${Ht};
|
|
91
|
+
letter-spacing: ${Lt};
|
|
92
|
+
line-height: ${Pt};
|
|
93
|
+
text-transform: ${Kt};
|
|
94
94
|
}
|
|
95
|
-
`,
|
|
95
|
+
`,li=o.css`
|
|
96
96
|
.ft-typography--button {
|
|
97
|
-
font-family: ${
|
|
98
|
-
font-size: ${
|
|
99
|
-
font-weight: ${
|
|
100
|
-
letter-spacing: ${
|
|
101
|
-
line-height: ${
|
|
102
|
-
text-transform: ${
|
|
97
|
+
font-family: ${Dt};
|
|
98
|
+
font-size: ${qt};
|
|
99
|
+
font-weight: ${Jt};
|
|
100
|
+
letter-spacing: ${Qt};
|
|
101
|
+
line-height: ${Vt};
|
|
102
|
+
text-transform: ${Xt};
|
|
103
|
+
}
|
|
104
|
+
`,ai=o.css`
|
|
105
|
+
.ft-typography {
|
|
106
|
+
vertical-align: inherit;
|
|
103
107
|
}
|
|
104
|
-
`;
|
|
108
|
+
`;var pi=function(t,i,o,e){for(var s,n=arguments.length,r=n<3?i:null===e?e=Object.getOwnPropertyDescriptor(i,o):e,h=t.length-1;h>=0;h--)(s=t[h])&&(r=(n<3?s(r):n>3?s(i,o,r):s(i,o))||r);return n>3&&r&&Object.defineProperty(i,o,r),r};class fi extends i.FtLitElement{constructor(){super(...arguments),this.variant=H.body1}render(){return this.element?G`
|
|
105
109
|
<${W(this.element)}
|
|
106
110
|
class="ft-typography ft-typography--${this.variant}">
|
|
107
111
|
<slot></slot>
|
|
108
112
|
</${W(this.element)}>
|
|
109
113
|
`:G`
|
|
110
114
|
<slot class="ft-typography ft-typography--${this.variant}"></slot>
|
|
111
|
-
`}}
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
115
|
+
`}}fi.styles=[Yt,ti,ii,oi,ei,si,ni,ri,hi,li,ai],pi([e.property()],fi.prototype,"element",void 0),pi([e.property()],fi.prototype,"variant",void 0),i.customElement("ft-typography")(fi);const yi={distance:i.FtCssVariableFactory.create("--ft-tooltip-distance","SIZE","4px"),color:i.FtCssVariableFactory.create("--ft-tooltip-color","COLOR","#FFFFFF"),backgroundColor:i.FtCssVariableFactory.create("--ft-tooltip-background-color","COLOR","#666666"),zIndex:i.FtCssVariableFactory.create("--ft-tooltip-z-index","NUMBER","1"),borderRadiusS:i.FtCssVariableFactory.external(i.designSystemVariables.borderRadiusS,"Design system"),maxWidth:i.FtCssVariableFactory.create("--ft-tooltip-max-width","SIZE","150px")},gi=o.css`
|
|
116
|
+
.ft-tooltip--container {
|
|
117
|
+
display: block;
|
|
118
|
+
position: relative;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
.ft-tooltip--inline {
|
|
122
|
+
display: inline-block;
|
|
123
|
+
max-width: 100%;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
.ft-tooltip {
|
|
127
|
+
position: absolute;
|
|
128
|
+
box-sizing: border-box;
|
|
129
|
+
overflow: hidden;
|
|
130
|
+
width: max-content;
|
|
131
|
+
max-width: ${yi.maxWidth};
|
|
132
|
+
text-align: center;
|
|
133
|
+
padding: ${yi.distance};
|
|
134
|
+
z-index: ${yi.zIndex};
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
.ft-tooltip--content {
|
|
138
|
+
padding: 4px 8px;
|
|
139
|
+
border-radius: ${yi.borderRadiusS};
|
|
140
|
+
background-color: ${yi.backgroundColor};
|
|
141
|
+
color: ${yi.color};
|
|
142
|
+
top: -500px;
|
|
143
|
+
left: -500px;
|
|
144
|
+
position: relative;
|
|
145
|
+
word-break: break-word;
|
|
146
|
+
}
|
|
147
|
+
`;var ci=function(t,i,o,e){for(var s,n=arguments.length,r=n<3?i:null===e?e=Object.getOwnPropertyDescriptor(i,o):e,h=t.length-1;h>=0;h--)(s=t[h])&&(r=(n<3?s(r):n>3?s(i,o,r):s(i,o))||r);return n>3&&r&&Object.defineProperty(i,o,r),r};class di extends i.FtLitElement{constructor(){super(...arguments),this.text="",this.manual=!1,this.inline=!1,this.delay=500,this.position="bottom",this.visible=!1,this.hideDebounce=new i.Debouncer,this.revealDebouncer=new i.Debouncer}render(){return o.html`
|
|
116
148
|
<div part="container"
|
|
117
149
|
class="ft-tooltip--container ${this.inline?"ft-tooltip--inline":""}"
|
|
118
150
|
@mouseenter=${this.onHover}
|
|
@@ -128,36 +160,4 @@ const M=Symbol.for(""),Z=t=>{if((null==t?void 0:t.r)===M)return null==t?void 0:t
|
|
|
128
160
|
</div>
|
|
129
161
|
<slot></slot>
|
|
130
162
|
</div>
|
|
131
|
-
`}update(t){t.has("visible")&&!this.visible&&this.resetTooltipContent(),super.update(t)}contentAvailableCallback(t){t.has("visible")&&this.visible&&this.positionTooltip()}show(t){this.visible=!0,null!=t&&this.hideDebounce.run((()=>this.hide()),t)}hide(){this.visible=!1}toggle(){this.visible=!this.visible}get slottedElement(){var t;return(null!==(t=this.slotNodes)&&void 0!==t?t:[]).filter((t=>t.nodeType==Node.ELEMENT_NODE))[0]}resetTooltipContent(){if(this.tooltip&&this.tooltipContent){const t=this.tooltipContent.style;switch(t.transition="none",this.position){case"top":t.top=this.tooltip.clientHeight+"px",t.left="0";break;case"bottom":t.top=-this.tooltip.clientHeight+"px",t.left="0";break;case"left":t.top="0",t.left=this.tooltip.clientWidth+"px";break;case"right":t.top="0",t.left=-this.tooltip.clientWidth+"px"}}}positionTooltip(){this.resetTooltipContent();const t=this.slottedElement;if(this.tooltip&&t){const i=t.getBoundingClientRect(),o=(i.height-this.tooltip.clientHeight)/2,e=(i.width-this.tooltip.clientWidth)/2;let s=0,n=0;switch(this.position){case"top":n=-this.tooltip.clientHeight,s=e;break;case"bottom":n=i.height,s=e;break;case"left":n=o,s=-this.tooltip.clientWidth;break;case"right":n=o,s=i.width}i.left+s+this.tooltip.clientWidth>window.innerWidth&&(s=window.innerWidth-this.tooltip.clientWidth-i.left),i.left+s<0&&(s=0);const r=this.tooltip.style;r.left=s+"px",r.top=n+"px",r.maxWidth=`max(${i.width}px, ${yi.maxWidth})`}this.revealDebouncer.run((()=>{this.tooltipContent&&(this.tooltipContent.style.transition="top var(--ft-transition-duration, 250ms), left var(--ft-transition-duration, 250ms)",this.tooltipContent.style.top="0",this.tooltipContent.style.left="0")}),this.manual?0:this.delay)}onTouch(){this.manual||(this.show(),setTimeout((()=>window.addEventListener("touchstart",(t=>{t.composedPath().includes(this.container)||this.onOut()}),{once:!0})),100))}onHover(){this.manual||this.show()}onOut(){this.manual||(this.revealDebouncer.cancel(),this.hide())}}
|
|
132
|
-
.ft-tooltip--container {
|
|
133
|
-
display: block;
|
|
134
|
-
position: relative;
|
|
135
|
-
}
|
|
136
|
-
|
|
137
|
-
.ft-tooltip--inline {
|
|
138
|
-
display: inline-block;
|
|
139
|
-
max-width: 100%;
|
|
140
|
-
}
|
|
141
|
-
|
|
142
|
-
.ft-tooltip {
|
|
143
|
-
position: absolute;
|
|
144
|
-
box-sizing: border-box;
|
|
145
|
-
overflow: hidden;
|
|
146
|
-
width: max-content;
|
|
147
|
-
max-width: ${yi.maxWidth};
|
|
148
|
-
text-align: center;
|
|
149
|
-
padding: ${yi.distance};
|
|
150
|
-
z-index: ${yi.zIndex};
|
|
151
|
-
}
|
|
152
|
-
|
|
153
|
-
.ft-tooltip--content {
|
|
154
|
-
padding: 4px 8px;
|
|
155
|
-
border-radius: ${yi.borderRadiusS};
|
|
156
|
-
background-color: ${yi.backgroundColor};
|
|
157
|
-
color: ${yi.color};
|
|
158
|
-
top: -500px;
|
|
159
|
-
left: -500px;
|
|
160
|
-
position: relative;
|
|
161
|
-
word-break: break-word;
|
|
162
|
-
}
|
|
163
|
-
`,fi([e.property()],gi.prototype,"text",void 0),fi([e.property({type:Boolean})],gi.prototype,"manual",void 0),fi([e.property({type:Boolean})],gi.prototype,"inline",void 0),fi([e.property({type:Number})],gi.prototype,"delay",void 0),fi([e.property()],gi.prototype,"position",void 0),fi([e.queryAssignedNodes("",!0)],gi.prototype,"slotNodes",void 0),fi([e.query(".ft-tooltip--container")],gi.prototype,"container",void 0),fi([e.query("slot")],gi.prototype,"target",void 0),fi([e.query(".ft-tooltip")],gi.prototype,"tooltip",void 0),fi([e.query(".ft-tooltip--content")],gi.prototype,"tooltipContent",void 0),fi([e.state()],gi.prototype,"visible",void 0),i.customElement("ft-tooltip")(gi),t.FtTooltip=gi,t.FtTooltipCssVariables=yi,Object.defineProperty(t,"t",{value:!0})}({},ftGlobals.wcUtils,ftGlobals.lit,ftGlobals.litDecorators);
|
|
163
|
+
`}update(t){t.has("visible")&&!this.visible&&this.resetTooltipContent(),super.update(t)}contentAvailableCallback(t){t.has("visible")&&this.visible&&this.positionTooltip()}show(t){this.visible=!0,null!=t&&this.hideDebounce.run((()=>this.hide()),t)}hide(){this.visible=!1}toggle(){this.visible=!this.visible}get slottedElement(){var t;return(null!==(t=this.slotNodes)&&void 0!==t?t:[]).filter((t=>t.nodeType==Node.ELEMENT_NODE))[0]}resetTooltipContent(){if(this.tooltip&&this.tooltipContent){const t=this.tooltipContent.style;switch(t.transition="none",this.position){case"top":t.top=this.tooltip.clientHeight+"px",t.left="0";break;case"bottom":t.top=-this.tooltip.clientHeight+"px",t.left="0";break;case"left":t.top="0",t.left=this.tooltip.clientWidth+"px";break;case"right":t.top="0",t.left=-this.tooltip.clientWidth+"px"}}}positionTooltip(){this.resetTooltipContent();const t=this.slottedElement;if(this.tooltip&&t){const i=t.getBoundingClientRect(),o=(i.height-this.tooltip.clientHeight)/2,e=(i.width-this.tooltip.clientWidth)/2;let s=0,n=0;switch(this.position){case"top":n=-this.tooltip.clientHeight,s=e;break;case"bottom":n=i.height,s=e;break;case"left":n=o,s=-this.tooltip.clientWidth;break;case"right":n=o,s=i.width}i.left+s+this.tooltip.clientWidth>window.innerWidth&&(s=window.innerWidth-this.tooltip.clientWidth-i.left),i.left+s<0&&(s=0);const r=this.tooltip.style;r.left=s+"px",r.top=n+"px",r.maxWidth=`max(${i.width}px, ${yi.maxWidth})`}this.revealDebouncer.run((()=>{this.tooltipContent&&(this.tooltipContent.style.transition="top var(--ft-transition-duration, 250ms), left var(--ft-transition-duration, 250ms)",this.tooltipContent.style.top="0",this.tooltipContent.style.left="0")}),this.manual?0:this.delay)}onTouch(){this.manual||(this.show(),setTimeout((()=>window.addEventListener("touchstart",(t=>{t.composedPath().includes(this.container)||this.onOut()}),{once:!0})),100))}onHover(){this.manual||this.show()}onOut(){this.manual||(this.revealDebouncer.cancel(),this.hide())}}di.elementDefinitions={"ft-typography":fi},di.styles=gi,ci([e.property()],di.prototype,"text",void 0),ci([e.property({type:Boolean})],di.prototype,"manual",void 0),ci([e.property({type:Boolean})],di.prototype,"inline",void 0),ci([e.property({type:Number})],di.prototype,"delay",void 0),ci([e.property()],di.prototype,"position",void 0),ci([e.queryAssignedNodes("",!0)],di.prototype,"slotNodes",void 0),ci([e.query(".ft-tooltip--container")],di.prototype,"container",void 0),ci([e.query("slot")],di.prototype,"target",void 0),ci([e.query(".ft-tooltip")],di.prototype,"tooltip",void 0),ci([e.query(".ft-tooltip--content")],di.prototype,"tooltipContent",void 0),ci([e.state()],di.prototype,"visible",void 0),i.customElement("ft-tooltip")(di),t.FtTooltip=di,t.FtTooltipCssVariables=yi,t.styles=gi,Object.defineProperty(t,"t",{value:!0})}({},ftGlobals.wcUtils,ftGlobals.lit,ftGlobals.litDecorators);
|
package/build/ft-tooltip.min.js
CHANGED
|
@@ -88,109 +88,141 @@ var st,rt;null==nt||nt(J,G),(null!==(N=globalThis.litHtmlVersions)&&void 0!==N?N
|
|
|
88
88
|
* Copyright 2020 Google LLC
|
|
89
89
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
90
90
|
*/
|
|
91
|
-
const yt=Symbol.for(""),gt=t=>{if((null==t?void 0:t.r)===yt)return null==t?void 0:t._$litStatic$},vt=t=>({_$litStatic$:t,r:yt}),bt=new Map,mt=(t=>(i,...e)=>{const o=e.length;let n,s;const r=[],a=[];let l,h=0,c=!1;for(;h<o;){for(l=i[h];h<o&&void 0!==(s=e[h],n=gt(s));)l+=n+i[++h],c=!0;a.push(s),r.push(l),h++}if(h===o&&r.push(i[o]),c){const t=r.join("$$lit$$");void 0===(i=bt.get(t))&&(r.raw=r,bt.set(t,i=r)),e=a}return t(i,...e)})(D);var xt
|
|
91
|
+
const yt=Symbol.for(""),gt=t=>{if((null==t?void 0:t.r)===yt)return null==t?void 0:t._$litStatic$},vt=t=>({_$litStatic$:t,r:yt}),bt=new Map,mt=(t=>(i,...e)=>{const o=e.length;let n,s;const r=[],a=[];let l,h=0,c=!1;for(;h<o;){for(l=i[h];h<o&&void 0!==(s=e[h],n=gt(s));)l+=n+i[++h],c=!0;a.push(s),r.push(l),h++}if(h===o&&r.push(i[o]),c){const t=r.join("$$lit$$");void 0===(i=bt.get(t))&&(r.raw=r,bt.set(t,i=r)),e=a}return t(i,...e)})(D);var xt;!function(t){t.title="title",t.title_dense="title-dense",t.subtitle1="subtitle1",t.subtitle2="subtitle2",t.body1="body1",t.body2="body2",t.caption="caption",t.breadcrumb="breadcrumb",t.overline="overline",t.button="button"}(xt||(xt={}));const wt=ht.extend("--ft-typography-font-family",ct.titleFont),$t=ht.extend("--ft-typography-font-family",ct.contentFont),Ot={fontFamily:$t,fontSize:ht.create("--ft-typography-font-size","SIZE","16px"),fontWeight:ht.create("--ft-typography-font-weight","UNKNOWN","normal"),letterSpacing:ht.create("--ft-typography-letter-spacing","SIZE","0.496px"),lineHeight:ht.create("--ft-typography-line-height","NUMBER","1.5"),textTransform:ht.create("--ft-typography-text-transform","UNKNOWN","inherit")},St=ht.extend("--ft-typography-title-font-family",wt),Nt=ht.extend("--ft-typography-title-font-size",Ot.fontSize,"20px"),Ct=ht.extend("--ft-typography-title-font-weight",Ot.fontWeight,"normal"),Et=ht.extend("--ft-typography-title-letter-spacing",Ot.letterSpacing,"0.15px"),Rt=ht.extend("--ft-typography-title-line-height",Ot.lineHeight,"1.2"),Mt=ht.extend("--ft-typography-title-text-transform",Ot.textTransform,"inherit"),kt=ht.extend("--ft-typography-title-dense-font-family",wt),Ut=ht.extend("--ft-typography-title-dense-font-size",Ot.fontSize,"14px"),Ft=ht.extend("--ft-typography-title-dense-font-weight",Ot.fontWeight,"normal"),Lt=ht.extend("--ft-typography-title-dense-letter-spacing",Ot.letterSpacing,"0.105px"),At=ht.extend("--ft-typography-title-dense-line-height",Ot.lineHeight,"1.7"),Pt=ht.extend("--ft-typography-title-dense-text-transform",Ot.textTransform,"inherit"),Tt=ht.extend("--ft-typography-subtitle1-font-family",$t),zt=ht.extend("--ft-typography-subtitle1-font-size",Ot.fontSize,"16px"),jt=ht.extend("--ft-typography-subtitle1-font-weight",Ot.fontWeight,"600"),Bt=ht.extend("--ft-typography-subtitle1-letter-spacing",Ot.letterSpacing,"0.144px"),_t=ht.extend("--ft-typography-subtitle1-line-height",Ot.lineHeight,"1.5"),Wt=ht.extend("--ft-typography-subtitle1-text-transform",Ot.textTransform,"inherit"),Dt=ht.extend("--ft-typography-subtitle2-font-family",$t),Ht=ht.extend("--ft-typography-subtitle2-font-size",Ot.fontSize,"14px"),Kt=ht.extend("--ft-typography-subtitle2-font-weight",Ot.fontWeight,"normal"),It=ht.extend("--ft-typography-subtitle2-letter-spacing",Ot.letterSpacing,"0.098px"),Zt=ht.extend("--ft-typography-subtitle2-line-height",Ot.lineHeight,"1.7"),Vt=ht.extend("--ft-typography-subtitle2-text-transform",Ot.textTransform,"inherit"),Jt=ht.extend("--ft-typography-body1-font-family",$t),qt=ht.extend("--ft-typography-body1-font-size",Ot.fontSize,"16px"),Xt=ht.extend("--ft-typography-body1-font-weight",Ot.fontWeight,"normal"),Gt=ht.extend("--ft-typography-body1-letter-spacing",Ot.letterSpacing,"0.496px"),Qt=ht.extend("--ft-typography-body1-line-height",Ot.lineHeight,"1.5"),Yt=ht.extend("--ft-typography-body1-text-transform",Ot.textTransform,"inherit"),ti=ht.extend("--ft-typography-body2-font-family",$t),ii=ht.extend("--ft-typography-body2-font-size",Ot.fontSize,"14px"),ei=ht.extend("--ft-typography-body2-font-weight",Ot.fontWeight,"normal"),oi=ht.extend("--ft-typography-body2-letter-spacing",Ot.letterSpacing,"0.252px"),ni=ht.extend("--ft-typography-body2-line-height",Ot.lineHeight,"1.4"),si=ht.extend("--ft-typography-body2-text-transform",Ot.textTransform,"inherit"),ri=ht.extend("--ft-typography-caption-font-family",$t),ai=ht.extend("--ft-typography-caption-font-size",Ot.fontSize,"12px"),li=ht.extend("--ft-typography-caption-font-weight",Ot.fontWeight,"normal"),hi=ht.extend("--ft-typography-caption-letter-spacing",Ot.letterSpacing,"0.396px"),ci=ht.extend("--ft-typography-caption-line-height",Ot.lineHeight,"1.33"),pi=ht.extend("--ft-typography-caption-text-transform",Ot.textTransform,"inherit"),fi=ht.extend("--ft-typography-breadcrumb-font-family",$t),ui=ht.extend("--ft-typography-breadcrumb-font-size",Ot.fontSize,"10px"),di=ht.extend("--ft-typography-breadcrumb-font-weight",Ot.fontWeight,"normal"),yi=ht.extend("--ft-typography-breadcrumb-letter-spacing",Ot.letterSpacing,"0.33px"),gi=ht.extend("--ft-typography-breadcrumb-line-height",Ot.lineHeight,"1.6"),vi=ht.extend("--ft-typography-breadcrumb-text-transform",Ot.textTransform,"inherit"),bi=ht.extend("--ft-typography-overline-font-family",$t),mi=ht.extend("--ft-typography-overline-font-size",Ot.fontSize,"10px"),xi=ht.extend("--ft-typography-overline-font-weight",Ot.fontWeight,"normal"),wi=ht.extend("--ft-typography-overline-letter-spacing",Ot.letterSpacing,"1.5px"),$i=ht.extend("--ft-typography-overline-line-height",Ot.lineHeight,"1.6"),Oi=ht.extend("--ft-typography-overline-text-transform",Ot.textTransform,"uppercase"),Si=ht.extend("--ft-typography-button-font-family",$t),Ni=ht.extend("--ft-typography-button-font-size",Ot.fontSize,"14px"),Ci=ht.extend("--ft-typography-button-font-weight",Ot.fontWeight,"600"),Ei=ht.extend("--ft-typography-button-letter-spacing",Ot.letterSpacing,"1.246px"),Ri=ht.extend("--ft-typography-button-line-height",Ot.lineHeight,"1.15"),Mi=ht.extend("--ft-typography-button-text-transform",Ot.textTransform,"uppercase"),ki=d`
|
|
92
92
|
.ft-typography--title {
|
|
93
|
-
font-family: ${
|
|
94
|
-
font-size: ${
|
|
95
|
-
font-weight: ${
|
|
96
|
-
letter-spacing: ${
|
|
97
|
-
line-height: ${
|
|
98
|
-
text-transform: ${
|
|
93
|
+
font-family: ${St};
|
|
94
|
+
font-size: ${Nt};
|
|
95
|
+
font-weight: ${Ct};
|
|
96
|
+
letter-spacing: ${Et};
|
|
97
|
+
line-height: ${Rt};
|
|
98
|
+
text-transform: ${Mt};
|
|
99
99
|
}
|
|
100
|
-
`,
|
|
100
|
+
`,Ui=d`
|
|
101
101
|
.ft-typography--title-dense {
|
|
102
|
-
font-family: ${
|
|
103
|
-
font-size: ${
|
|
104
|
-
font-weight: ${
|
|
105
|
-
letter-spacing: ${
|
|
106
|
-
line-height: ${
|
|
107
|
-
text-transform: ${
|
|
102
|
+
font-family: ${kt};
|
|
103
|
+
font-size: ${Ut};
|
|
104
|
+
font-weight: ${Ft};
|
|
105
|
+
letter-spacing: ${Lt};
|
|
106
|
+
line-height: ${At};
|
|
107
|
+
text-transform: ${Pt};
|
|
108
108
|
}
|
|
109
|
-
`,
|
|
109
|
+
`,Fi=d`
|
|
110
110
|
.ft-typography--subtitle1 {
|
|
111
|
-
font-family: ${
|
|
112
|
-
font-size: ${
|
|
113
|
-
font-weight: ${
|
|
114
|
-
letter-spacing: ${
|
|
115
|
-
line-height: ${
|
|
116
|
-
text-transform: ${
|
|
111
|
+
font-family: ${Tt};
|
|
112
|
+
font-size: ${zt};
|
|
113
|
+
font-weight: ${jt};
|
|
114
|
+
letter-spacing: ${Bt};
|
|
115
|
+
line-height: ${_t};
|
|
116
|
+
text-transform: ${Wt};
|
|
117
117
|
}
|
|
118
|
-
`,
|
|
118
|
+
`,Li=d`
|
|
119
119
|
.ft-typography--subtitle2 {
|
|
120
|
-
font-family: ${
|
|
121
|
-
font-size: ${
|
|
122
|
-
font-weight: ${
|
|
123
|
-
letter-spacing: ${
|
|
124
|
-
line-height: ${
|
|
125
|
-
text-transform: ${
|
|
120
|
+
font-family: ${Dt};
|
|
121
|
+
font-size: ${Ht};
|
|
122
|
+
font-weight: ${Kt};
|
|
123
|
+
letter-spacing: ${It};
|
|
124
|
+
line-height: ${Zt};
|
|
125
|
+
text-transform: ${Vt};
|
|
126
126
|
}
|
|
127
127
|
|
|
128
|
-
`,
|
|
128
|
+
`,Ai=d`
|
|
129
129
|
.ft-typography--body1 {
|
|
130
|
-
font-family: ${
|
|
131
|
-
font-size: ${
|
|
132
|
-
font-weight: ${
|
|
133
|
-
letter-spacing: ${
|
|
134
|
-
line-height: ${
|
|
135
|
-
text-transform: ${
|
|
130
|
+
font-family: ${Jt};
|
|
131
|
+
font-size: ${qt};
|
|
132
|
+
font-weight: ${Xt};
|
|
133
|
+
letter-spacing: ${Gt};
|
|
134
|
+
line-height: ${Qt};
|
|
135
|
+
text-transform: ${Yt};
|
|
136
136
|
}
|
|
137
|
-
`,
|
|
137
|
+
`,Pi=d`
|
|
138
138
|
.ft-typography--body2 {
|
|
139
|
-
font-family: ${
|
|
140
|
-
font-size: ${
|
|
141
|
-
font-weight: ${
|
|
142
|
-
letter-spacing: ${
|
|
143
|
-
line-height: ${
|
|
144
|
-
text-transform: ${
|
|
139
|
+
font-family: ${ti};
|
|
140
|
+
font-size: ${ii};
|
|
141
|
+
font-weight: ${ei};
|
|
142
|
+
letter-spacing: ${oi};
|
|
143
|
+
line-height: ${ni};
|
|
144
|
+
text-transform: ${si};
|
|
145
145
|
}
|
|
146
|
-
`,
|
|
146
|
+
`,Ti=d`
|
|
147
147
|
.ft-typography--caption {
|
|
148
|
-
font-family: ${
|
|
149
|
-
font-size: ${
|
|
150
|
-
font-weight: ${
|
|
151
|
-
letter-spacing: ${
|
|
152
|
-
line-height: ${
|
|
153
|
-
text-transform: ${
|
|
148
|
+
font-family: ${ri};
|
|
149
|
+
font-size: ${ai};
|
|
150
|
+
font-weight: ${li};
|
|
151
|
+
letter-spacing: ${hi};
|
|
152
|
+
line-height: ${ci};
|
|
153
|
+
text-transform: ${pi};
|
|
154
154
|
}
|
|
155
|
-
`,
|
|
155
|
+
`,zi=d`
|
|
156
156
|
.ft-typography--breadcrumb {
|
|
157
|
-
font-family: ${
|
|
158
|
-
font-size: ${
|
|
159
|
-
font-weight: ${
|
|
160
|
-
letter-spacing: ${
|
|
161
|
-
line-height: ${
|
|
162
|
-
text-transform: ${
|
|
157
|
+
font-family: ${fi};
|
|
158
|
+
font-size: ${ui};
|
|
159
|
+
font-weight: ${di};
|
|
160
|
+
letter-spacing: ${yi};
|
|
161
|
+
line-height: ${gi};
|
|
162
|
+
text-transform: ${vi};
|
|
163
163
|
}
|
|
164
|
-
`,
|
|
164
|
+
`,ji=d`
|
|
165
165
|
.ft-typography--overline {
|
|
166
|
-
font-family: ${
|
|
167
|
-
font-size: ${
|
|
168
|
-
font-weight: ${
|
|
169
|
-
letter-spacing: ${
|
|
170
|
-
line-height: ${
|
|
171
|
-
text-transform: ${
|
|
166
|
+
font-family: ${bi};
|
|
167
|
+
font-size: ${mi};
|
|
168
|
+
font-weight: ${xi};
|
|
169
|
+
letter-spacing: ${wi};
|
|
170
|
+
line-height: ${$i};
|
|
171
|
+
text-transform: ${Oi};
|
|
172
172
|
}
|
|
173
|
-
`,
|
|
173
|
+
`,Bi=d`
|
|
174
174
|
.ft-typography--button {
|
|
175
|
-
font-family: ${
|
|
176
|
-
font-size: ${
|
|
177
|
-
font-weight: ${
|
|
178
|
-
letter-spacing: ${
|
|
179
|
-
line-height: ${
|
|
180
|
-
text-transform: ${
|
|
181
|
-
}
|
|
182
|
-
|
|
175
|
+
font-family: ${Si};
|
|
176
|
+
font-size: ${Ni};
|
|
177
|
+
font-weight: ${Ci};
|
|
178
|
+
letter-spacing: ${Ei};
|
|
179
|
+
line-height: ${Ri};
|
|
180
|
+
text-transform: ${Mi};
|
|
181
|
+
}
|
|
182
|
+
`,_i=d`
|
|
183
|
+
.ft-typography {
|
|
184
|
+
vertical-align: inherit;
|
|
185
|
+
}
|
|
186
|
+
`;var Wi=function(t,i,e,o){for(var n,s=arguments.length,r=s<3?i:null===o?o=Object.getOwnPropertyDescriptor(i,e):o,a=t.length-1;a>=0;a--)(n=t[a])&&(r=(s<3?n(r):s>3?n(i,e,r):n(i,e))||r);return s>3&&r&&Object.defineProperty(i,e,r),r};class Di extends dt{constructor(){super(...arguments),this.variant=xt.body1}render(){return this.element?mt`
|
|
183
187
|
<${vt(this.element)}
|
|
184
188
|
class="ft-typography ft-typography--${this.variant}">
|
|
185
189
|
<slot></slot>
|
|
186
190
|
</${vt(this.element)}>
|
|
187
191
|
`:mt`
|
|
188
192
|
<slot class="ft-typography ft-typography--${this.variant}"></slot>
|
|
189
|
-
`}}
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
193
|
+
`}}Di.styles=[ki,Ui,Fi,Li,Ai,Pi,Ti,zi,ji,Bi,_i],Wi([o()],Di.prototype,"element",void 0),Wi([o()],Di.prototype,"variant",void 0),l("ft-typography")(Di);const Hi={distance:ht.create("--ft-tooltip-distance","SIZE","4px"),color:ht.create("--ft-tooltip-color","COLOR","#FFFFFF"),backgroundColor:ht.create("--ft-tooltip-background-color","COLOR","#666666"),zIndex:ht.create("--ft-tooltip-z-index","NUMBER","1"),borderRadiusS:ht.external(ct.borderRadiusS,"Design system"),maxWidth:ht.create("--ft-tooltip-max-width","SIZE","150px")},Ki=d`
|
|
194
|
+
.ft-tooltip--container {
|
|
195
|
+
display: block;
|
|
196
|
+
position: relative;
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
.ft-tooltip--inline {
|
|
200
|
+
display: inline-block;
|
|
201
|
+
max-width: 100%;
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
.ft-tooltip {
|
|
205
|
+
position: absolute;
|
|
206
|
+
box-sizing: border-box;
|
|
207
|
+
overflow: hidden;
|
|
208
|
+
width: max-content;
|
|
209
|
+
max-width: ${Hi.maxWidth};
|
|
210
|
+
text-align: center;
|
|
211
|
+
padding: ${Hi.distance};
|
|
212
|
+
z-index: ${Hi.zIndex};
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
.ft-tooltip--content {
|
|
216
|
+
padding: 4px 8px;
|
|
217
|
+
border-radius: ${Hi.borderRadiusS};
|
|
218
|
+
background-color: ${Hi.backgroundColor};
|
|
219
|
+
color: ${Hi.color};
|
|
220
|
+
top: -500px;
|
|
221
|
+
left: -500px;
|
|
222
|
+
position: relative;
|
|
223
|
+
word-break: break-word;
|
|
224
|
+
}
|
|
225
|
+
`;var Ii=function(t,i,e,o){for(var n,s=arguments.length,r=s<3?i:null===o?o=Object.getOwnPropertyDescriptor(i,e):o,a=t.length-1;a>=0;a--)(n=t[a])&&(r=(s<3?n(r):s>3?n(i,e,r):n(i,e))||r);return s>3&&r&&Object.defineProperty(i,e,r),r};class Zi extends dt{constructor(){super(...arguments),this.text="",this.manual=!1,this.inline=!1,this.delay=500,this.position="bottom",this.visible=!1,this.hideDebounce=new i,this.revealDebouncer=new i}render(){return D`
|
|
194
226
|
<div part="container"
|
|
195
227
|
class="ft-tooltip--container ${this.inline?"ft-tooltip--inline":""}"
|
|
196
228
|
@mouseenter=${this.onHover}
|
|
@@ -206,42 +238,10 @@ const yt=Symbol.for(""),gt=t=>{if((null==t?void 0:t.r)===yt)return null==t?void
|
|
|
206
238
|
</div>
|
|
207
239
|
<slot></slot>
|
|
208
240
|
</div>
|
|
209
|
-
`}update(t){t.has("visible")&&!this.visible&&this.resetTooltipContent(),super.update(t)}contentAvailableCallback(t){t.has("visible")&&this.visible&&this.positionTooltip()}show(t){this.visible=!0,null!=t&&this.hideDebounce.run((()=>this.hide()),t)}hide(){this.visible=!1}toggle(){this.visible=!this.visible}get slottedElement(){var t;return(null!==(t=this.slotNodes)&&void 0!==t?t:[]).filter((t=>t.nodeType==Node.ELEMENT_NODE))[0]}resetTooltipContent(){if(this.tooltip&&this.tooltipContent){const t=this.tooltipContent.style;switch(t.transition="none",this.position){case"top":t.top=this.tooltip.clientHeight+"px",t.left="0";break;case"bottom":t.top=-this.tooltip.clientHeight+"px",t.left="0";break;case"left":t.top="0",t.left=this.tooltip.clientWidth+"px";break;case"right":t.top="0",t.left=-this.tooltip.clientWidth+"px"}}}positionTooltip(){this.resetTooltipContent();const t=this.slottedElement;if(this.tooltip&&t){const i=t.getBoundingClientRect(),e=(i.height-this.tooltip.clientHeight)/2,o=(i.width-this.tooltip.clientWidth)/2;let n=0,s=0;switch(this.position){case"top":s=-this.tooltip.clientHeight,n=o;break;case"bottom":s=i.height,n=o;break;case"left":s=e,n=-this.tooltip.clientWidth;break;case"right":s=e,n=i.width}i.left+n+this.tooltip.clientWidth>window.innerWidth&&(n=window.innerWidth-this.tooltip.clientWidth-i.left),i.left+n<0&&(n=0);const r=this.tooltip.style;r.left=n+"px",r.top=s+"px",r.maxWidth=`max(${i.width}px, ${Hi.maxWidth})`}this.revealDebouncer.run((()=>{this.tooltipContent&&(this.tooltipContent.style.transition="top var(--ft-transition-duration, 250ms), left var(--ft-transition-duration, 250ms)",this.tooltipContent.style.top="0",this.tooltipContent.style.left="0")}),this.manual?0:this.delay)}onTouch(){this.manual||(this.show(),setTimeout((()=>window.addEventListener("touchstart",(t=>{t.composedPath().includes(this.container)||this.onOut()}),{once:!0})),100))}onHover(){this.manual||this.show()}onOut(){this.manual||(this.revealDebouncer.cancel(),this.hide())}}
|
|
210
|
-
.ft-tooltip--container {
|
|
211
|
-
display: block;
|
|
212
|
-
position: relative;
|
|
213
|
-
}
|
|
214
|
-
|
|
215
|
-
.ft-tooltip--inline {
|
|
216
|
-
display: inline-block;
|
|
217
|
-
max-width: 100%;
|
|
218
|
-
}
|
|
219
|
-
|
|
220
|
-
.ft-tooltip {
|
|
221
|
-
position: absolute;
|
|
222
|
-
box-sizing: border-box;
|
|
223
|
-
overflow: hidden;
|
|
224
|
-
width: max-content;
|
|
225
|
-
max-width: ${Hi.maxWidth};
|
|
226
|
-
text-align: center;
|
|
227
|
-
padding: ${Hi.distance};
|
|
228
|
-
z-index: ${Hi.zIndex};
|
|
229
|
-
}
|
|
230
|
-
|
|
231
|
-
.ft-tooltip--content {
|
|
232
|
-
padding: 4px 8px;
|
|
233
|
-
border-radius: ${Hi.borderRadiusS};
|
|
234
|
-
background-color: ${Hi.backgroundColor};
|
|
235
|
-
color: ${Hi.color};
|
|
236
|
-
top: -500px;
|
|
237
|
-
left: -500px;
|
|
238
|
-
position: relative;
|
|
239
|
-
word-break: break-word;
|
|
240
|
-
}
|
|
241
|
-
`,Di([o()],Ki.prototype,"text",void 0),Di([o({type:Boolean})],Ki.prototype,"manual",void 0),Di([o({type:Boolean})],Ki.prototype,"inline",void 0),Di([o({type:Number})],Ki.prototype,"delay",void 0),Di([o()],Ki.prototype,"position",void 0),Di([
|
|
241
|
+
`}update(t){t.has("visible")&&!this.visible&&this.resetTooltipContent(),super.update(t)}contentAvailableCallback(t){t.has("visible")&&this.visible&&this.positionTooltip()}show(t){this.visible=!0,null!=t&&this.hideDebounce.run((()=>this.hide()),t)}hide(){this.visible=!1}toggle(){this.visible=!this.visible}get slottedElement(){var t;return(null!==(t=this.slotNodes)&&void 0!==t?t:[]).filter((t=>t.nodeType==Node.ELEMENT_NODE))[0]}resetTooltipContent(){if(this.tooltip&&this.tooltipContent){const t=this.tooltipContent.style;switch(t.transition="none",this.position){case"top":t.top=this.tooltip.clientHeight+"px",t.left="0";break;case"bottom":t.top=-this.tooltip.clientHeight+"px",t.left="0";break;case"left":t.top="0",t.left=this.tooltip.clientWidth+"px";break;case"right":t.top="0",t.left=-this.tooltip.clientWidth+"px"}}}positionTooltip(){this.resetTooltipContent();const t=this.slottedElement;if(this.tooltip&&t){const i=t.getBoundingClientRect(),e=(i.height-this.tooltip.clientHeight)/2,o=(i.width-this.tooltip.clientWidth)/2;let n=0,s=0;switch(this.position){case"top":s=-this.tooltip.clientHeight,n=o;break;case"bottom":s=i.height,n=o;break;case"left":s=e,n=-this.tooltip.clientWidth;break;case"right":s=e,n=i.width}i.left+n+this.tooltip.clientWidth>window.innerWidth&&(n=window.innerWidth-this.tooltip.clientWidth-i.left),i.left+n<0&&(n=0);const r=this.tooltip.style;r.left=n+"px",r.top=s+"px",r.maxWidth=`max(${i.width}px, ${Hi.maxWidth})`}this.revealDebouncer.run((()=>{this.tooltipContent&&(this.tooltipContent.style.transition="top var(--ft-transition-duration, 250ms), left var(--ft-transition-duration, 250ms)",this.tooltipContent.style.top="0",this.tooltipContent.style.left="0")}),this.manual?0:this.delay)}onTouch(){this.manual||(this.show(),setTimeout((()=>window.addEventListener("touchstart",(t=>{t.composedPath().includes(this.container)||this.onOut()}),{once:!0})),100))}onHover(){this.manual||this.show()}onOut(){this.manual||(this.revealDebouncer.cancel(),this.hide())}}Zi.elementDefinitions={"ft-typography":Di},Zi.styles=Ki,Ii([o()],Zi.prototype,"text",void 0),Ii([o({type:Boolean})],Zi.prototype,"manual",void 0),Ii([o({type:Boolean})],Zi.prototype,"inline",void 0),Ii([o({type:Number})],Zi.prototype,"delay",void 0),Ii([o()],Zi.prototype,"position",void 0),Ii([
|
|
242
242
|
/**
|
|
243
243
|
* @license
|
|
244
244
|
* Copyright 2017 Google LLC
|
|
245
245
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
246
246
|
*/
|
|
247
|
-
function(t,i,e){let o,s=t;return"object"==typeof t?(s=t.slot,o=t):o={flatten:i},e?function(t){const{slot:i,selector:e}=null!=t?t:{};return n({descriptor:o=>({get(){var o;const n="slot"+(i?`[name=${i}]`:":not([name])"),s=null===(o=this.renderRoot)||void 0===o?void 0:o.querySelector(n),r=null!=s?a(s,t):[];return e?r.filter((t=>t.matches(e))):r},enumerable:!0,configurable:!0})})}({slot:s,flatten:i,selector:e}):n({descriptor:t=>({get(){var t,i;const e="slot"+(s?`[name=${s}]`:":not([name])"),n=null===(t=this.renderRoot)||void 0===t?void 0:t.querySelector(e);return null!==(i=null==n?void 0:n.assignedNodes(o))&&void 0!==i?i:[]},enumerable:!0,configurable:!0})})}("",!0)],
|
|
247
|
+
function(t,i,e){let o,s=t;return"object"==typeof t?(s=t.slot,o=t):o={flatten:i},e?function(t){const{slot:i,selector:e}=null!=t?t:{};return n({descriptor:o=>({get(){var o;const n="slot"+(i?`[name=${i}]`:":not([name])"),s=null===(o=this.renderRoot)||void 0===o?void 0:o.querySelector(n),r=null!=s?a(s,t):[];return e?r.filter((t=>t.matches(e))):r},enumerable:!0,configurable:!0})})}({slot:s,flatten:i,selector:e}):n({descriptor:t=>({get(){var t,i;const e="slot"+(s?`[name=${s}]`:":not([name])"),n=null===(t=this.renderRoot)||void 0===t?void 0:t.querySelector(e);return null!==(i=null==n?void 0:n.assignedNodes(o))&&void 0!==i?i:[]},enumerable:!0,configurable:!0})})}("",!0)],Zi.prototype,"slotNodes",void 0),Ii([s(".ft-tooltip--container")],Zi.prototype,"container",void 0),Ii([s("slot")],Zi.prototype,"target",void 0),Ii([s(".ft-tooltip")],Zi.prototype,"tooltip",void 0),Ii([s(".ft-tooltip--content")],Zi.prototype,"tooltipContent",void 0),Ii([function(t){return o({...t,state:!0})}()],Zi.prototype,"visible",void 0),l("ft-tooltip")(Zi),t.FtTooltip=Zi,t.FtTooltipCssVariables=Hi,t.styles=Ki,Object.defineProperty(t,"i",{value:!0})}({});
|
package/build/index.d.ts
CHANGED
package/build/index.js
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { customElement } from "@fluid-topics/ft-wc-utils";
|
|
2
2
|
import { FtTooltip } from "./ft-tooltip";
|
|
3
3
|
export * from "./ft-tooltip";
|
|
4
|
+
export * from "./ft-tooltip.css";
|
|
5
|
+
export * from "./ft-tooltip.properties";
|
|
4
6
|
customElement("ft-tooltip")(FtTooltip);
|
|
5
7
|
//# sourceMappingURL=index.js.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fluid-topics/ft-tooltip",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.13",
|
|
4
4
|
"description": "A simple tooltip component",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"Lit"
|
|
@@ -19,9 +19,9 @@
|
|
|
19
19
|
"url": "ssh://git@scm.mrs.antidot.net:2222/fluidtopics/ft-web-components.git"
|
|
20
20
|
},
|
|
21
21
|
"dependencies": {
|
|
22
|
-
"@fluid-topics/ft-typography": "0.3.
|
|
23
|
-
"@fluid-topics/ft-wc-utils": "0.3.
|
|
22
|
+
"@fluid-topics/ft-typography": "0.3.13",
|
|
23
|
+
"@fluid-topics/ft-wc-utils": "0.3.13",
|
|
24
24
|
"lit": "2.2.8"
|
|
25
25
|
},
|
|
26
|
-
"gitHead": "
|
|
26
|
+
"gitHead": "84b5fc920bc5d2bdb646b5da8815ad51caaf228e"
|
|
27
27
|
}
|