@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.
@@ -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 { customElement, designSystemVariables, FtCssVariable, FtLitElement, setVariable } from "@fluid-topics/ft-wc-utils";
10
- import { FtSwitchOption, FtSwitchOptionCssVariables } from "./ft-switch-option";
11
- import { FtTypographyButtonCssVariables } from "@fluid-topics/ft-typography";
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
- let FtSwitch = class FtSwitch extends FtLitElement {
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
- getStyles() {
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
- getTemplate() {
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