@fluid-topics/ft-button 0.1.18 → 0.2.2
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-button.inline-styles.js +181 -170
- package/build/ft-button.js +8 -9
- package/build/ft-button.light.js +148 -137
- package/build/ft-button.min.js +183 -172
- package/package.json +8 -8
package/build/ft-button.js
CHANGED
|
@@ -10,10 +10,10 @@ import { classMap } from "lit/directives/class-map.js";
|
|
|
10
10
|
import { designSystemVariables, FtCssVariable, FtLitElement, isSafari, noTextSelect, setVariable } from "@fluid-topics/ft-wc-utils";
|
|
11
11
|
import { FtRipple, FtRippleCssVariables } from "@fluid-topics/ft-ripple";
|
|
12
12
|
import { FtTypography, FtTypographyButtonCssVariables } from "@fluid-topics/ft-typography";
|
|
13
|
-
import { Icon } from "@material/mwc-icon";
|
|
14
13
|
import { FtTooltip } from "@fluid-topics/ft-tooltip";
|
|
15
14
|
import { FtLoader, FtLoaderCssVariables } from "@fluid-topics/ft-loader";
|
|
16
15
|
import "@fluid-topics/ft-loader";
|
|
16
|
+
import { FtIcon, FtIconCssVariables } from "@fluid-topics/ft-icon";
|
|
17
17
|
const buttonColor = FtCssVariable.extend("--ft-button-color", designSystemVariables.colorPrimary);
|
|
18
18
|
export const FtButtonCssVariables = {
|
|
19
19
|
backgroundColor: FtCssVariable.extend("--ft-button-background-color", designSystemVariables.colorSurface),
|
|
@@ -100,11 +100,11 @@ export class FtButton extends FtLitElement {
|
|
|
100
100
|
--ft-button-internal-font-size: ${FtButtonCssVariables.fontSize};
|
|
101
101
|
--ft-button-internal-line-height: calc(var(--ft-button-internal-font-size) + 2px);
|
|
102
102
|
--ft-button-internal-color: ${FtButtonCssVariables.color};
|
|
103
|
-
|
|
103
|
+
${setVariable(FtIconCssVariables.size, FtButtonCssVariables.iconSize)};
|
|
104
104
|
--ft-button-internal-vertical-padding: 6px;
|
|
105
105
|
--ft-button-internal-horizontal-padding: 8px;
|
|
106
106
|
${setVariable(FtRippleCssVariables.color, FtButtonCssVariables.rippleColor)};
|
|
107
|
-
--ft-button-internal-content-height: max(var(--ft-button-internal-line-height),
|
|
107
|
+
--ft-button-internal-content-height: max(var(--ft-button-internal-line-height), ${FtButtonCssVariables.iconSize});
|
|
108
108
|
|
|
109
109
|
border-radius: ${FtButtonCssVariables.borderRadius};
|
|
110
110
|
padding: var(--ft-button-internal-vertical-padding) var(--ft-button-internal-horizontal-padding);
|
|
@@ -171,17 +171,16 @@ export class FtButton extends FtLitElement {
|
|
|
171
171
|
display: none;
|
|
172
172
|
}
|
|
173
173
|
|
|
174
|
-
|
|
174
|
+
ft-icon {
|
|
175
175
|
flex-shrink: 0;
|
|
176
|
-
width: var(--mdc-icon-size);
|
|
177
176
|
}
|
|
178
177
|
|
|
179
|
-
.ft-button--label[hidden] +
|
|
178
|
+
.ft-button--label[hidden] + ft-icon {
|
|
180
179
|
margin: 0 calc(var(--ft-button-internal-horizontal-padding) * -1);
|
|
181
180
|
padding: 0 var(--ft-button-internal-vertical-padding);
|
|
182
181
|
}
|
|
183
182
|
|
|
184
|
-
.ft-button:not(.ft-button--trailing-icon)
|
|
183
|
+
.ft-button:not(.ft-button--trailing-icon) ft-icon,
|
|
185
184
|
.ft-button:not(.ft-button--trailing-icon) ft-loader {
|
|
186
185
|
order: -1;
|
|
187
186
|
}
|
|
@@ -238,7 +237,7 @@ export class FtButton extends FtLitElement {
|
|
|
238
237
|
else {
|
|
239
238
|
return this.icon
|
|
240
239
|
? html `
|
|
241
|
-
<
|
|
240
|
+
<ft-icon variant="material">${this.icon}</ft-icon> `
|
|
242
241
|
: nothing;
|
|
243
242
|
}
|
|
244
243
|
}
|
|
@@ -272,7 +271,7 @@ FtButton.elementDefinitions = {
|
|
|
272
271
|
"ft-ripple": FtRipple,
|
|
273
272
|
"ft-tooltip": FtTooltip,
|
|
274
273
|
"ft-typography": FtTypography,
|
|
275
|
-
"
|
|
274
|
+
"ft-icon": FtIcon,
|
|
276
275
|
"ft-loader": FtLoader,
|
|
277
276
|
};
|
|
278
277
|
__decorate([
|