@fluid-topics/ft-toggle 1.3.17 → 1.3.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/ft-toggle.d.ts +1 -1
- package/build/ft-toggle.js +8 -5
- package/build/ft-toggle.light.js +53 -49
- package/build/ft-toggle.min.js +60 -56
- package/build/ft-toggle.styles.js +6 -5
- package/package.json +4 -4
package/build/ft-toggle.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import { ElementDefinitionsMap, FtLitElement } from "@fluid-topics/ft-wc-utils";
|
|
|
2
2
|
import { FtToggleProperties } from "./ft-toggle.properties";
|
|
3
3
|
export declare class FtToggle extends FtLitElement implements FtToggleProperties {
|
|
4
4
|
static elementDefinitions: ElementDefinitionsMap;
|
|
5
|
-
static styles: import("lit").CSSResult;
|
|
5
|
+
static styles: import("lit").CSSResult[];
|
|
6
6
|
checked: boolean;
|
|
7
7
|
disabled: boolean;
|
|
8
8
|
protected render(): import("lit-html").TemplateResult<1>;
|
package/build/ft-toggle.js
CHANGED
|
@@ -6,10 +6,10 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
6
6
|
};
|
|
7
7
|
import { html } from "lit";
|
|
8
8
|
import { property } from "lit/decorators.js";
|
|
9
|
-
import { FtLitElement } from "@fluid-topics/ft-wc-utils";
|
|
9
|
+
import { FtLitElement, screenReaderStyles } from "@fluid-topics/ft-wc-utils";
|
|
10
10
|
import { classMap } from "lit/directives/class-map.js";
|
|
11
11
|
import { styles } from "./ft-toggle.styles";
|
|
12
|
-
import { FtTypography } from "@fluid-topics/ft-typography";
|
|
12
|
+
import { FtTypography, FtTypographyVariants } from "@fluid-topics/ft-typography";
|
|
13
13
|
class FtToggle extends FtLitElement {
|
|
14
14
|
constructor() {
|
|
15
15
|
super(...arguments);
|
|
@@ -24,14 +24,17 @@ class FtToggle extends FtLitElement {
|
|
|
24
24
|
};
|
|
25
25
|
return html `
|
|
26
26
|
<label class="${classMap(classes)}" for="toggle-input">
|
|
27
|
-
<input type="checkbox"
|
|
27
|
+
<input type="checkbox"
|
|
28
|
+
role="switch"
|
|
29
|
+
class="ft-toggle-input sr-only"
|
|
30
|
+
id="toggle-input"
|
|
28
31
|
?checked=${this.checked}
|
|
29
32
|
?disabled=${this.disabled}
|
|
30
33
|
@change=${this.onChange}>
|
|
31
34
|
<div class="ft-toggle-background">
|
|
32
35
|
<div class="ft-toggle-handle"></div>
|
|
33
36
|
</div>
|
|
34
|
-
<ft-typography variant="body2">
|
|
37
|
+
<ft-typography variant="${FtTypographyVariants.body2}">
|
|
35
38
|
<slot></slot>
|
|
36
39
|
</ft-typography>
|
|
37
40
|
</label>
|
|
@@ -46,7 +49,7 @@ class FtToggle extends FtLitElement {
|
|
|
46
49
|
FtToggle.elementDefinitions = {
|
|
47
50
|
"ft-typography": FtTypography,
|
|
48
51
|
};
|
|
49
|
-
FtToggle.styles = styles;
|
|
52
|
+
FtToggle.styles = [styles, screenReaderStyles];
|
|
50
53
|
__decorate([
|
|
51
54
|
property({ type: Boolean, reflect: true })
|
|
52
55
|
], FtToggle.prototype, "checked", void 0);
|