@fluid-topics/ft-button 2.0.37 → 2.1.0
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/definitions.d.ts +0 -2
- package/build/definitions.js +0 -2
- package/build/ft-button.d.ts +42 -6
- package/build/ft-button.js +205 -18
- package/build/ft-button.light.js +380 -1431
- package/build/ft-button.min.js +384 -1446
- package/build/ft-button.properties.d.ts +20 -2
- package/build/ft-button.styles.d.ts +18 -18
- package/build/ft-button.styles.js +139 -142
- package/build/index.d.ts +0 -3
- package/build/index.js +0 -3
- package/package.json +8 -9
- package/build/ft-base-button.d.ts +0 -62
- package/build/ft-base-button.js +0 -212
- package/build/ftds-button.d.ts +0 -20
- package/build/ftds-button.js +0 -69
- package/build/ftds-button.properties.d.ts +0 -6
- package/build/ftds-button.properties.js +0 -1
- package/build/ftds-button.styles.d.ts +0 -148
- package/build/ftds-button.styles.js +0 -485
|
@@ -1,8 +1,26 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import { FtIconVariants } from "@fluid-topics/ft-icon";
|
|
2
|
+
import { Position } from "@fluid-topics/ft-tooltip";
|
|
3
|
+
export type HTMLAnchorElementTargetAttribute = "_self" | "_blank" | "_parent" | "_top";
|
|
4
|
+
export type FtButtonType = "button" | "submit" | "reset";
|
|
5
|
+
export interface FtButtonProperties {
|
|
3
6
|
primary?: boolean;
|
|
4
7
|
outlined?: boolean;
|
|
5
8
|
dense?: boolean;
|
|
6
9
|
round?: boolean;
|
|
10
|
+
disabled?: boolean;
|
|
11
|
+
icon?: string;
|
|
12
|
+
iconVariant?: FtIconVariants;
|
|
13
|
+
trailingIcon?: boolean;
|
|
14
|
+
label?: string;
|
|
15
|
+
type: FtButtonType;
|
|
16
|
+
href?: string;
|
|
17
|
+
target?: HTMLAnchorElementTargetAttribute;
|
|
18
|
+
loading?: boolean;
|
|
19
|
+
ariaLabel?: string | null;
|
|
20
|
+
ariaHasPopup?: string | null;
|
|
21
|
+
ariaPressed?: string | null;
|
|
22
|
+
tooltipPosition?: Position;
|
|
23
|
+
hideTooltip?: boolean;
|
|
24
|
+
forceTooltip?: boolean;
|
|
7
25
|
activated?: boolean;
|
|
8
26
|
}
|
|
@@ -1,24 +1,24 @@
|
|
|
1
1
|
export declare const FtButtonCssVariables: {
|
|
2
|
-
backgroundColor: import("@fluid-topics/
|
|
3
|
-
borderRadius: import("@fluid-topics/
|
|
4
|
-
color: import("@fluid-topics/
|
|
5
|
-
fontSize: import("@fluid-topics/
|
|
6
|
-
iconSize: import("@fluid-topics/
|
|
7
|
-
rippleColor: import("@fluid-topics/
|
|
8
|
-
verticalPadding: import("@fluid-topics/
|
|
9
|
-
horizontalPadding: import("@fluid-topics/
|
|
10
|
-
iconPadding: import("@fluid-topics/
|
|
11
|
-
opacityDisabled: import("@fluid-topics/
|
|
2
|
+
backgroundColor: import("@fluid-topics/design-system-variables").FtCssVariable;
|
|
3
|
+
borderRadius: import("@fluid-topics/design-system-variables").FtCssVariable;
|
|
4
|
+
color: import("@fluid-topics/design-system-variables").FtCssVariable;
|
|
5
|
+
fontSize: import("@fluid-topics/design-system-variables").FtCssVariable;
|
|
6
|
+
iconSize: import("@fluid-topics/design-system-variables").FtCssVariable;
|
|
7
|
+
rippleColor: import("@fluid-topics/design-system-variables").FtCssVariable;
|
|
8
|
+
verticalPadding: import("@fluid-topics/design-system-variables").FtCssVariable;
|
|
9
|
+
horizontalPadding: import("@fluid-topics/design-system-variables").FtCssVariable;
|
|
10
|
+
iconPadding: import("@fluid-topics/design-system-variables").FtCssVariable;
|
|
11
|
+
opacityDisabled: import("@fluid-topics/design-system-variables").FtCssVariable;
|
|
12
12
|
};
|
|
13
13
|
export declare const FtButtonPrimaryCssVariables: {
|
|
14
|
-
backgroundColor: import("@fluid-topics/
|
|
15
|
-
color: import("@fluid-topics/
|
|
16
|
-
rippleColor: import("@fluid-topics/
|
|
14
|
+
backgroundColor: import("@fluid-topics/design-system-variables").FtCssVariable;
|
|
15
|
+
color: import("@fluid-topics/design-system-variables").FtCssVariable;
|
|
16
|
+
rippleColor: import("@fluid-topics/design-system-variables").FtCssVariable;
|
|
17
17
|
};
|
|
18
18
|
export declare const FtButtonDenseCssVariables: {
|
|
19
|
-
borderRadius: import("@fluid-topics/
|
|
20
|
-
verticalPadding: import("@fluid-topics/
|
|
21
|
-
horizontalPadding: import("@fluid-topics/
|
|
22
|
-
iconPadding: import("@fluid-topics/
|
|
19
|
+
borderRadius: import("@fluid-topics/design-system-variables").FtCssVariable;
|
|
20
|
+
verticalPadding: import("@fluid-topics/design-system-variables").FtCssVariable;
|
|
21
|
+
horizontalPadding: import("@fluid-topics/design-system-variables").FtCssVariable;
|
|
22
|
+
iconPadding: import("@fluid-topics/design-system-variables").FtCssVariable;
|
|
23
23
|
};
|
|
24
|
-
export declare const
|
|
24
|
+
export declare const buttonStyles: import("lit").CSSResult;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { css } from "lit";
|
|
2
|
-
import { designSystemVariables, FtCssVariableFactory,
|
|
2
|
+
import { designSystemVariables, FtCssVariableFactory, setVariable, } from "@fluid-topics/ft-wc-utils";
|
|
3
3
|
import { FtRippleCssVariables } from "@fluid-topics/ft-ripple/build/ft-ripple.styles";
|
|
4
4
|
import { FtTypographyButtonCssVariables } from "@fluid-topics/ft-typography/build/ft-typography.styles";
|
|
5
5
|
import { FtLoaderCssVariables } from "@fluid-topics/ft-loader/build/ft-loader.styles";
|
|
@@ -29,144 +29,141 @@ export const FtButtonDenseCssVariables = {
|
|
|
29
29
|
horizontalPadding: FtCssVariableFactory.create("--ft-button-dense-horizontal-padding", "", "SIZE", "4px"),
|
|
30
30
|
iconPadding: FtCssVariableFactory.create("--ft-button-dense-icon-padding", "", "SIZE", "4px"),
|
|
31
31
|
};
|
|
32
|
-
export const
|
|
33
|
-
|
|
34
|
-
:
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
.
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
.
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
.
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
`,
|
|
171
|
-
noTextSelect,
|
|
172
|
-
];
|
|
32
|
+
export const buttonStyles = css `
|
|
33
|
+
:host {
|
|
34
|
+
display: inline-block;
|
|
35
|
+
max-width: 100%;
|
|
36
|
+
pointer-events: none;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
.ft-button {
|
|
40
|
+
box-shadow: 0px 0px 0px transparent;
|
|
41
|
+
border: 0px solid transparent;
|
|
42
|
+
text-shadow: 0px 0px 0px transparent;
|
|
43
|
+
font-size: ${FtButtonCssVariables.fontSize};
|
|
44
|
+
text-decoration: none;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
.ft-button:hover {
|
|
48
|
+
box-shadow: 0px 0px 0px transparent;
|
|
49
|
+
border: 0px solid transparent;
|
|
50
|
+
text-shadow: 0px 0px 0px transparent;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
.ft-button:active {
|
|
54
|
+
outline: none;
|
|
55
|
+
border: none;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
.ft-button:focus {
|
|
59
|
+
outline: 0;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
.ft-button {
|
|
63
|
+
position: relative;
|
|
64
|
+
display: flex;
|
|
65
|
+
justify-content: center;
|
|
66
|
+
align-items: center;
|
|
67
|
+
width: 100%;
|
|
68
|
+
overflow: hidden;
|
|
69
|
+
box-sizing: border-box;
|
|
70
|
+
border: none;
|
|
71
|
+
pointer-events: auto;
|
|
72
|
+
|
|
73
|
+
--button-internal-line-height: max(calc(${FtButtonCssVariables.fontSize} + 2px), ${FtButtonCssVariables.iconSize});
|
|
74
|
+
--button-internal-color: ${FtButtonCssVariables.color};
|
|
75
|
+
${setVariable(FtIconCssVariables.size, FtButtonCssVariables.iconSize)};
|
|
76
|
+
${setVariable(FtRippleCssVariables.color, FtButtonCssVariables.rippleColor)};
|
|
77
|
+
|
|
78
|
+
border-radius: ${FtButtonCssVariables.borderRadius};
|
|
79
|
+
padding: ${FtButtonCssVariables.verticalPadding} ${FtButtonCssVariables.horizontalPadding};
|
|
80
|
+
background-color: ${FtButtonCssVariables.backgroundColor};
|
|
81
|
+
color: var(--button-internal-color);
|
|
82
|
+
-webkit-mask-image: radial-gradient(white, black);
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
.ft-button.ft-button--outlined {
|
|
86
|
+
border: 1px solid var(--button-internal-color);
|
|
87
|
+
padding: calc(${FtButtonCssVariables.verticalPadding} - 1px) calc(${FtButtonCssVariables.horizontalPadding} - 1px);
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
.ft-button.ft-button--dense {
|
|
91
|
+
padding: ${FtButtonDenseCssVariables.verticalPadding} ${FtButtonDenseCssVariables.horizontalPadding};
|
|
92
|
+
border-radius: ${FtButtonDenseCssVariables.borderRadius};
|
|
93
|
+
gap: ${FtButtonDenseCssVariables.iconPadding};
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
.ft-button.ft-button--dense.ft-button--outlined {
|
|
97
|
+
padding: calc(${FtButtonDenseCssVariables.verticalPadding} - 1px) calc(${FtButtonDenseCssVariables.horizontalPadding} - 1px);
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
.ft-button:not([disabled]):hover {
|
|
101
|
+
cursor: pointer;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
.ft-button--round {
|
|
105
|
+
border-radius: calc(var(--button-internal-line-height) / 2 + ${FtButtonCssVariables.verticalPadding});
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
.ft-button--round.ft-button--dense {
|
|
109
|
+
border-radius: calc(var(--button-internal-line-height) / 2 + ${FtButtonDenseCssVariables.verticalPadding});
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
.ft-button[disabled] {
|
|
113
|
+
filter: grayscale(1);
|
|
114
|
+
opacity: ${FtButtonCssVariables.opacityDisabled};
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
.ft-button.ft-button--primary {
|
|
118
|
+
background-color: ${FtButtonPrimaryCssVariables.backgroundColor};
|
|
119
|
+
--button-internal-color: ${FtButtonPrimaryCssVariables.color};
|
|
120
|
+
${setVariable(FtRippleCssVariables.color, FtButtonPrimaryCssVariables.rippleColor)};
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
.ft-button:focus {
|
|
124
|
+
outline: none;
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
.ft-button--label {
|
|
128
|
+
position: relative;
|
|
129
|
+
overflow: hidden;
|
|
130
|
+
white-space: nowrap;
|
|
131
|
+
text-overflow: ellipsis;
|
|
132
|
+
display: block;
|
|
133
|
+
margin: 0 ${FtButtonCssVariables.iconPadding};
|
|
134
|
+
${setVariable(FtTypographyButtonCssVariables.fontSize, "1em")};
|
|
135
|
+
${setVariable(FtTypographyButtonCssVariables.lineHeight, "var(--button-internal-line-height)")};
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
.ft-button--dense .ft-button--label {
|
|
139
|
+
margin: 0 ${FtButtonDenseCssVariables.iconPadding};
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
.ft-button--label[hidden] {
|
|
143
|
+
display: none;
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
[part="icon"] {
|
|
147
|
+
flex-shrink: 0;
|
|
148
|
+
position: relative;
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
.ft-button--label[hidden] + [part="icon"] {
|
|
152
|
+
margin: 0 calc(${FtButtonCssVariables.horizontalPadding} * -1);
|
|
153
|
+
padding: 0 ${FtButtonCssVariables.verticalPadding};
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
.ft-button--dense .ft-button--label[hidden] + [part="icon"] {
|
|
157
|
+
margin: 0 calc(${FtButtonDenseCssVariables.horizontalPadding} * -1);
|
|
158
|
+
padding: 0 ${FtButtonDenseCssVariables.verticalPadding};
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
.ft-button:not(.ft-button--trailing-icon) [part="label"] {
|
|
162
|
+
order: 2;
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
ft-loader {
|
|
166
|
+
${setVariable(FtLoaderCssVariables.size, FtButtonCssVariables.iconSize)};
|
|
167
|
+
${setVariable(FtLoaderCssVariables.color, "var(--button-internal-color)")};
|
|
168
|
+
}
|
|
169
|
+
`;
|
package/build/index.d.ts
CHANGED
package/build/index.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fluid-topics/ft-button",
|
|
3
|
-
"version": "2.0
|
|
3
|
+
"version": "2.1.0",
|
|
4
4
|
"description": "A generic Fluid Topics tag",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"Lit"
|
|
@@ -19,14 +19,13 @@
|
|
|
19
19
|
"url": "ssh://git@scm.mrs.antidot.net:2222/fluidtopics/ft-web-components.git"
|
|
20
20
|
},
|
|
21
21
|
"dependencies": {
|
|
22
|
-
"@fluid-topics/
|
|
23
|
-
"@fluid-topics/ft-
|
|
24
|
-
"@fluid-topics/ft-
|
|
25
|
-
"@fluid-topics/ft-
|
|
26
|
-
"@fluid-topics/ft-
|
|
27
|
-
"@fluid-topics/ft-
|
|
28
|
-
"@fluid-topics/ft-wc-utils": "2.0.37",
|
|
22
|
+
"@fluid-topics/ft-icon": "2.1.0",
|
|
23
|
+
"@fluid-topics/ft-loader": "2.1.0",
|
|
24
|
+
"@fluid-topics/ft-ripple": "2.1.0",
|
|
25
|
+
"@fluid-topics/ft-tooltip": "2.1.0",
|
|
26
|
+
"@fluid-topics/ft-typography": "2.1.0",
|
|
27
|
+
"@fluid-topics/ft-wc-utils": "2.1.0",
|
|
29
28
|
"lit": "3.1.0"
|
|
30
29
|
},
|
|
31
|
-
"gitHead": "
|
|
30
|
+
"gitHead": "4727cf19d04236ad1d2b2cb43ce1c46298834c7e"
|
|
32
31
|
}
|
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
import { ElementDefinitionsMap, FtLitElement } from "@fluid-topics/ft-wc-utils";
|
|
2
|
-
import { Position } from "@fluid-topics/ft-tooltip";
|
|
3
|
-
import { FtIconVariants } from "@fluid-topics/ft-icon";
|
|
4
|
-
import { HTMLTemplateResult } from "lit";
|
|
5
|
-
import { ClassInfo } from "lit/directives/class-map.js";
|
|
6
|
-
type HTMLAnchorElementTargetAttribute = "_self" | "_blank" | "_parent" | "_top";
|
|
7
|
-
export interface FtBaseButtonProperties {
|
|
8
|
-
disabled?: boolean;
|
|
9
|
-
label?: string;
|
|
10
|
-
href?: string;
|
|
11
|
-
target?: HTMLAnchorElementTargetAttribute;
|
|
12
|
-
icon?: string;
|
|
13
|
-
iconVariant?: FtIconVariants;
|
|
14
|
-
trailingIcon?: boolean;
|
|
15
|
-
loading?: boolean;
|
|
16
|
-
ariaLabel?: string | null;
|
|
17
|
-
tooltipPosition?: Position;
|
|
18
|
-
hideTooltip?: boolean;
|
|
19
|
-
forceTooltip?: boolean;
|
|
20
|
-
ariaHasPopup?: string | null;
|
|
21
|
-
ariaPressed?: string | null;
|
|
22
|
-
}
|
|
23
|
-
declare const FtBaseButton_base: import("@fluid-topics/ft-wc-utils").FtFormComponentType<typeof FtLitElement>;
|
|
24
|
-
export declare class FtBaseButton extends FtBaseButton_base implements FtBaseButtonProperties {
|
|
25
|
-
static elementDefinitions: ElementDefinitionsMap;
|
|
26
|
-
href?: string;
|
|
27
|
-
target?: HTMLAnchorElementTargetAttribute;
|
|
28
|
-
type: "button" | "submit" | "reset";
|
|
29
|
-
disabled: boolean;
|
|
30
|
-
label: string;
|
|
31
|
-
icon?: string;
|
|
32
|
-
iconVariant?: FtIconVariants;
|
|
33
|
-
trailingIcon: boolean;
|
|
34
|
-
loading: boolean;
|
|
35
|
-
ariaLabel: string | null;
|
|
36
|
-
ariaHasPopup: string | null;
|
|
37
|
-
ariaPressed: string | null;
|
|
38
|
-
tooltipPosition: Position;
|
|
39
|
-
hideTooltip: boolean;
|
|
40
|
-
forceTooltip: boolean;
|
|
41
|
-
activated: boolean;
|
|
42
|
-
private button?;
|
|
43
|
-
private slottedContent?;
|
|
44
|
-
private tooltip?;
|
|
45
|
-
get buttonClasses(): ClassInfo;
|
|
46
|
-
get typographyVariant(): string;
|
|
47
|
-
constructor();
|
|
48
|
-
protected render(): HTMLTemplateResult;
|
|
49
|
-
private addTooltipIfNeeded;
|
|
50
|
-
private resolveIcon;
|
|
51
|
-
focus(): void;
|
|
52
|
-
showTooltip(): void;
|
|
53
|
-
showTemporaryTooltip(text: string, duration: number): Promise<void> | undefined;
|
|
54
|
-
private setTooltipManual;
|
|
55
|
-
click(): void;
|
|
56
|
-
private getLabel;
|
|
57
|
-
getTextContent(): string;
|
|
58
|
-
protected hasTextContent(): boolean;
|
|
59
|
-
private onSlotchange;
|
|
60
|
-
private isDisabled;
|
|
61
|
-
}
|
|
62
|
-
export {};
|