@fluid-topics/ft-switch 0.1.17 → 0.1.18
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/css-variables.d.ts +22 -0
- package/build/css-variables.js +23 -0
- package/build/ft-switch-option.d.ts +4 -11
- package/build/ft-switch-option.js +6 -17
- package/build/ft-switch.d.ts +3 -17
- package/build/ft-switch.inline-styles.js +521 -0
- package/build/ft-switch.js +7 -25
- package/build/ft-switch.light.js +252 -313
- package/build/ft-switch.min.js +287 -338
- package/build/index.d.ts +4 -0
- package/build/index.js +9 -0
- package/build/inline-styles.d.ts +2 -0
- package/build/inline-styles.js +6 -0
- package/package.json +8 -8
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { FtCssVariable } from "@fluid-topics/ft-wc-utils";
|
|
2
|
+
export declare const FtSwitchCssVariables: {
|
|
3
|
+
textColor: FtCssVariable;
|
|
4
|
+
backgroundColor: FtCssVariable;
|
|
5
|
+
selectedTextColor: FtCssVariable;
|
|
6
|
+
selectedBackgroundColor: FtCssVariable;
|
|
7
|
+
borderColor: FtCssVariable;
|
|
8
|
+
borderRadius: FtCssVariable;
|
|
9
|
+
fontSize: FtCssVariable;
|
|
10
|
+
iconSize: FtCssVariable;
|
|
11
|
+
iconColor: FtCssVariable;
|
|
12
|
+
rippleColor: FtCssVariable;
|
|
13
|
+
outlineColor: FtCssVariable;
|
|
14
|
+
};
|
|
15
|
+
export declare const FtSwitchOptionCssVariables: {
|
|
16
|
+
borderRadiusLeft: FtCssVariable;
|
|
17
|
+
borderRadiusRight: FtCssVariable;
|
|
18
|
+
borderWidthLeft: FtCssVariable;
|
|
19
|
+
borderWidthRight: FtCssVariable;
|
|
20
|
+
borderWidthVertical: FtCssVariable;
|
|
21
|
+
};
|
|
22
|
+
//# sourceMappingURL=css-variables.d.ts.map
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { designSystemVariables, FtCssVariable } from "@fluid-topics/ft-wc-utils";
|
|
2
|
+
import { FtTypographyButtonCssVariables } from "@fluid-topics/ft-typography";
|
|
3
|
+
export const FtSwitchCssVariables = {
|
|
4
|
+
textColor: FtCssVariable.extend("--ft-switch-text-color", designSystemVariables.colorOnSurfaceHigh),
|
|
5
|
+
backgroundColor: FtCssVariable.extend("--ft-switch-background-color", designSystemVariables.colorSurface),
|
|
6
|
+
selectedTextColor: FtCssVariable.extend("--ft-switch-selected-text-color", designSystemVariables.colorPrimary),
|
|
7
|
+
selectedBackgroundColor: FtCssVariable.extend("--ft-switch-selected-background-color", designSystemVariables.colorPrimary),
|
|
8
|
+
borderColor: FtCssVariable.extend("--ft-switch-border-color", designSystemVariables.colorOutline),
|
|
9
|
+
borderRadius: FtCssVariable.extend("--ft-switch-border-radius", designSystemVariables.borderRadiusL),
|
|
10
|
+
fontSize: FtCssVariable.extend("--ft-switch-font-size", FtTypographyButtonCssVariables.fontSize),
|
|
11
|
+
iconSize: FtCssVariable.create("--ft-switch-icon-size", "SIZE", "24px"),
|
|
12
|
+
iconColor: FtCssVariable.extend("--ft-switch-text-color", designSystemVariables.colorOnSurfaceMedium),
|
|
13
|
+
rippleColor: FtCssVariable.extend("--ft-switch-ripple-color", designSystemVariables.colorPrimary),
|
|
14
|
+
outlineColor: FtCssVariable.extend("--ft-switch-outline-color", designSystemVariables.colorPrimary),
|
|
15
|
+
};
|
|
16
|
+
export const FtSwitchOptionCssVariables = {
|
|
17
|
+
borderRadiusLeft: FtCssVariable.extend("--ft-switch-option-border-radius-left", designSystemVariables.borderRadiusL),
|
|
18
|
+
borderRadiusRight: FtCssVariable.extend("--ft-switch-option-border-radius-right", designSystemVariables.borderRadiusL),
|
|
19
|
+
borderWidthLeft: FtCssVariable.create("--ft-switch-option-border-width-left", "SIZE", "1px"),
|
|
20
|
+
borderWidthRight: FtCssVariable.create("--ft-switch-option-border-width-right", "SIZE", "1px"),
|
|
21
|
+
borderWidthVertical: FtCssVariable.create("--ft-switch-option-border-width-vertical", "SIZE", "1px"),
|
|
22
|
+
};
|
|
23
|
+
//# sourceMappingURL=css-variables.js.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { PropertyValues } from "lit";
|
|
2
|
-
import { ElementDefinitionsMap,
|
|
1
|
+
import { HTMLTemplateResult, PropertyValues } from "lit";
|
|
2
|
+
import { ElementDefinitionsMap, FtLitElement } from "@fluid-topics/ft-wc-utils";
|
|
3
3
|
import { Position } from "@fluid-topics/ft-tooltip";
|
|
4
4
|
export interface FtSwitchOptionProperties {
|
|
5
5
|
value: any;
|
|
@@ -7,19 +7,12 @@ export interface FtSwitchOptionProperties {
|
|
|
7
7
|
selected: boolean;
|
|
8
8
|
trailingIcon: boolean;
|
|
9
9
|
}
|
|
10
|
-
export declare const FtSwitchOptionCssVariables: {
|
|
11
|
-
borderRadiusLeft: FtCssVariable;
|
|
12
|
-
borderRadiusRight: FtCssVariable;
|
|
13
|
-
borderWidthLeft: FtCssVariable;
|
|
14
|
-
borderWidthRight: FtCssVariable;
|
|
15
|
-
borderWidthVertical: FtCssVariable;
|
|
16
|
-
};
|
|
17
10
|
export declare class SwitchOptionChange extends CustomEvent<void> {
|
|
18
11
|
constructor();
|
|
19
12
|
}
|
|
20
13
|
export declare class FtSwitchOption extends FtLitElement implements FtSwitchOptionProperties {
|
|
21
14
|
static elementDefinitions: ElementDefinitionsMap;
|
|
22
|
-
|
|
15
|
+
static get styles(): import("lit").CSSResult;
|
|
23
16
|
value: any;
|
|
24
17
|
icon?: string;
|
|
25
18
|
label: string;
|
|
@@ -30,7 +23,7 @@ export declare class FtSwitchOption extends FtLitElement implements FtSwitchOpti
|
|
|
30
23
|
private input;
|
|
31
24
|
focus(): void;
|
|
32
25
|
protected updated(props: PropertyValues<any>): void;
|
|
33
|
-
protected
|
|
26
|
+
protected render(): HTMLTemplateResult;
|
|
34
27
|
private addTooltip;
|
|
35
28
|
private onChange;
|
|
36
29
|
private getLabel;
|
|
@@ -6,26 +6,19 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
6
6
|
};
|
|
7
7
|
import { css, html, nothing } from "lit";
|
|
8
8
|
import { property, query } from "lit/decorators.js";
|
|
9
|
-
import {
|
|
9
|
+
import { designSystemVariables, FtLitElement, setVariable } from "@fluid-topics/ft-wc-utils";
|
|
10
10
|
import { FtRipple, FtRippleCssVariables } from "@fluid-topics/ft-ripple";
|
|
11
11
|
import { FtTypography, FtTypographyButtonCssVariables } from "@fluid-topics/ft-typography";
|
|
12
12
|
import { Icon } from "@material/mwc-icon";
|
|
13
13
|
import { classMap } from "lit/directives/class-map.js";
|
|
14
|
-
import { FtSwitchCssVariables } from "./ft-switch";
|
|
15
14
|
import { FtTooltip } from "@fluid-topics/ft-tooltip";
|
|
16
|
-
|
|
17
|
-
borderRadiusLeft: FtCssVariable.extend("--ft-switch-option-border-radius-left", designSystemVariables.borderRadiusL),
|
|
18
|
-
borderRadiusRight: FtCssVariable.extend("--ft-switch-option-border-radius-right", designSystemVariables.borderRadiusL),
|
|
19
|
-
borderWidthLeft: FtCssVariable.create("--ft-switch-option-border-width-left", "SIZE", "1px"),
|
|
20
|
-
borderWidthRight: FtCssVariable.create("--ft-switch-option-border-width-right", "SIZE", "1px"),
|
|
21
|
-
borderWidthVertical: FtCssVariable.create("--ft-switch-option-border-width-vertical", "SIZE", "1px"),
|
|
22
|
-
};
|
|
15
|
+
import { FtSwitchCssVariables, FtSwitchOptionCssVariables } from "./css-variables";
|
|
23
16
|
export class SwitchOptionChange extends CustomEvent {
|
|
24
17
|
constructor() {
|
|
25
18
|
super("option-change", { bubbles: true });
|
|
26
19
|
}
|
|
27
20
|
}
|
|
28
|
-
|
|
21
|
+
export class FtSwitchOption extends FtLitElement {
|
|
29
22
|
constructor() {
|
|
30
23
|
super(...arguments);
|
|
31
24
|
this.value = "";
|
|
@@ -34,7 +27,7 @@ let FtSwitchOption = class FtSwitchOption extends FtLitElement {
|
|
|
34
27
|
this.selected = false;
|
|
35
28
|
this.trailingIcon = false;
|
|
36
29
|
}
|
|
37
|
-
|
|
30
|
+
static get styles() {
|
|
38
31
|
// language=CSS
|
|
39
32
|
return css `
|
|
40
33
|
.ft-switch-option {
|
|
@@ -129,7 +122,7 @@ let FtSwitchOption = class FtSwitchOption extends FtLitElement {
|
|
|
129
122
|
this.dispatchEvent(new SwitchOptionChange());
|
|
130
123
|
}
|
|
131
124
|
}
|
|
132
|
-
|
|
125
|
+
render() {
|
|
133
126
|
const classes = {
|
|
134
127
|
"ft-switch-option": true,
|
|
135
128
|
"ft-switch-option--trailing-icon": this.trailingIcon,
|
|
@@ -181,7 +174,7 @@ let FtSwitchOption = class FtSwitchOption extends FtLitElement {
|
|
|
181
174
|
onSlotchange() {
|
|
182
175
|
this.requestUpdate();
|
|
183
176
|
}
|
|
184
|
-
}
|
|
177
|
+
}
|
|
185
178
|
FtSwitchOption.elementDefinitions = {
|
|
186
179
|
"ft-ripple": FtRipple,
|
|
187
180
|
"ft-typography": FtTypography,
|
|
@@ -212,8 +205,4 @@ __decorate([
|
|
|
212
205
|
__decorate([
|
|
213
206
|
query(".ft-switch-option--input")
|
|
214
207
|
], FtSwitchOption.prototype, "input", void 0);
|
|
215
|
-
FtSwitchOption = __decorate([
|
|
216
|
-
customElement("ft-switch-option")
|
|
217
|
-
], FtSwitchOption);
|
|
218
|
-
export { FtSwitchOption };
|
|
219
208
|
//# sourceMappingURL=ft-switch-option.js.map
|
package/build/ft-switch.d.ts
CHANGED
|
@@ -1,22 +1,8 @@
|
|
|
1
1
|
import { PropertyValues } from "lit";
|
|
2
|
-
import { ElementDefinitionsMap,
|
|
3
|
-
export * from "./ft-switch-option";
|
|
2
|
+
import { ElementDefinitionsMap, FtLitElement } from "@fluid-topics/ft-wc-utils";
|
|
4
3
|
export interface FtSwitchProperties {
|
|
5
4
|
value?: string;
|
|
6
5
|
}
|
|
7
|
-
export declare const FtSwitchCssVariables: {
|
|
8
|
-
textColor: FtCssVariable;
|
|
9
|
-
backgroundColor: FtCssVariable;
|
|
10
|
-
selectedTextColor: FtCssVariable;
|
|
11
|
-
selectedBackgroundColor: FtCssVariable;
|
|
12
|
-
borderColor: FtCssVariable;
|
|
13
|
-
borderRadius: FtCssVariable;
|
|
14
|
-
fontSize: FtCssVariable;
|
|
15
|
-
iconSize: FtCssVariable;
|
|
16
|
-
iconColor: FtCssVariable;
|
|
17
|
-
rippleColor: FtCssVariable;
|
|
18
|
-
outlineColor: FtCssVariable;
|
|
19
|
-
};
|
|
20
6
|
export declare class FtSwitchChange extends CustomEvent<any> {
|
|
21
7
|
constructor(value: any);
|
|
22
8
|
}
|
|
@@ -27,8 +13,8 @@ export declare class FtSwitch extends FtLitElement implements FtSwitchProperties
|
|
|
27
13
|
private selectedOption?;
|
|
28
14
|
private options;
|
|
29
15
|
protected updated(props: PropertyValues<any>): void;
|
|
30
|
-
|
|
31
|
-
protected
|
|
16
|
+
static get styles(): import("lit").CSSResult;
|
|
17
|
+
protected render(): import("lit-html").TemplateResult<1>;
|
|
32
18
|
private onKeyDown;
|
|
33
19
|
private fixIndex;
|
|
34
20
|
private onSlotchange;
|