@fluid-topics/ft-switch 0.1.16 → 0.2.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/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 +14 -26
- package/build/ft-switch.d.ts +3 -17
- package/build/ft-switch.inline-styles.js +532 -0
- package/build/ft-switch.js +7 -25
- package/build/ft-switch.light.js +276 -326
- package/build/ft-switch.min.js +315 -355
- 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 +9 -9
package/build/ft-switch.js
CHANGED
|
@@ -6,29 +6,15 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
6
6
|
};
|
|
7
7
|
import { css, html } from "lit";
|
|
8
8
|
import { query, state } from "lit/decorators.js";
|
|
9
|
-
import {
|
|
10
|
-
import { FtSwitchOption
|
|
11
|
-
import {
|
|
12
|
-
export * from "./ft-switch-option";
|
|
13
|
-
export const FtSwitchCssVariables = {
|
|
14
|
-
textColor: FtCssVariable.extend("--ft-switch-text-color", designSystemVariables.colorOnSurfaceHigh),
|
|
15
|
-
backgroundColor: FtCssVariable.extend("--ft-switch-background-color", designSystemVariables.colorSurface),
|
|
16
|
-
selectedTextColor: FtCssVariable.extend("--ft-switch-selected-text-color", designSystemVariables.colorPrimary),
|
|
17
|
-
selectedBackgroundColor: FtCssVariable.extend("--ft-switch-selected-background-color", designSystemVariables.colorPrimary),
|
|
18
|
-
borderColor: FtCssVariable.extend("--ft-switch-border-color", designSystemVariables.colorOutline),
|
|
19
|
-
borderRadius: FtCssVariable.extend("--ft-switch-border-radius", designSystemVariables.borderRadiusL),
|
|
20
|
-
fontSize: FtCssVariable.extend("--ft-switch-font-size", FtTypographyButtonCssVariables.fontSize),
|
|
21
|
-
iconSize: FtCssVariable.create("--ft-switch-icon-size", "SIZE", "24px"),
|
|
22
|
-
iconColor: FtCssVariable.extend("--ft-switch-text-color", designSystemVariables.colorOnSurfaceMedium),
|
|
23
|
-
rippleColor: FtCssVariable.extend("--ft-switch-ripple-color", designSystemVariables.colorPrimary),
|
|
24
|
-
outlineColor: FtCssVariable.extend("--ft-switch-outline-color", designSystemVariables.colorPrimary),
|
|
25
|
-
};
|
|
9
|
+
import { FtLitElement, setVariable } from "@fluid-topics/ft-wc-utils";
|
|
10
|
+
import { FtSwitchOption } from "./ft-switch-option";
|
|
11
|
+
import { FtSwitchCssVariables, FtSwitchOptionCssVariables } from "./css-variables";
|
|
26
12
|
export class FtSwitchChange extends CustomEvent {
|
|
27
13
|
constructor(value) {
|
|
28
14
|
super("change", { detail: value });
|
|
29
15
|
}
|
|
30
16
|
}
|
|
31
|
-
|
|
17
|
+
export class FtSwitch extends FtLitElement {
|
|
32
18
|
constructor() {
|
|
33
19
|
super(...arguments);
|
|
34
20
|
this.options = [];
|
|
@@ -45,7 +31,7 @@ let FtSwitch = class FtSwitch extends FtLitElement {
|
|
|
45
31
|
this.dispatchEvent(new FtSwitchChange((_a = this.selectedOption) === null || _a === void 0 ? void 0 : _a.value));
|
|
46
32
|
}
|
|
47
33
|
}
|
|
48
|
-
|
|
34
|
+
static get styles() {
|
|
49
35
|
// language=CSS
|
|
50
36
|
return css `
|
|
51
37
|
:host {
|
|
@@ -78,7 +64,7 @@ let FtSwitch = class FtSwitch extends FtLitElement {
|
|
|
78
64
|
}
|
|
79
65
|
`;
|
|
80
66
|
}
|
|
81
|
-
|
|
67
|
+
render() {
|
|
82
68
|
return html `
|
|
83
69
|
<div class="ft-switch" @keydown=${this.onKeyDown} tabindex="0">
|
|
84
70
|
<slot @slotchange=${this.onSlotchange}
|
|
@@ -136,7 +122,7 @@ let FtSwitch = class FtSwitch extends FtLitElement {
|
|
|
136
122
|
option.selected = option == this.selectedOption;
|
|
137
123
|
});
|
|
138
124
|
}
|
|
139
|
-
}
|
|
125
|
+
}
|
|
140
126
|
FtSwitch.elementDefinitions = {};
|
|
141
127
|
__decorate([
|
|
142
128
|
query(".ft-switch slot")
|
|
@@ -144,8 +130,4 @@ __decorate([
|
|
|
144
130
|
__decorate([
|
|
145
131
|
state()
|
|
146
132
|
], FtSwitch.prototype, "selectedOption", void 0);
|
|
147
|
-
FtSwitch = __decorate([
|
|
148
|
-
customElement("ft-switch")
|
|
149
|
-
], FtSwitch);
|
|
150
|
-
export { FtSwitch };
|
|
151
133
|
//# sourceMappingURL=ft-switch.js.map
|