@fluid-topics/ft-checkbox 2.0.38 → 2.1.1
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/definitions.d.ts +0 -2
- package/build/definitions.js +0 -2
- package/build/ft-checkbox.d.ts +28 -3
- package/build/ft-checkbox.js +141 -5
- package/build/ft-checkbox.light.js +154 -2197
- package/build/ft-checkbox.min.js +222 -2239
- package/build/ft-checkbox.properties.d.ts +7 -0
- package/build/ft-checkbox.properties.js +1 -0
- package/build/ft-checkbox.styles.d.ts +7 -7
- package/build/index.d.ts +1 -2
- package/build/index.js +1 -2
- package/package.json +5 -8
- package/build/ft-base-checkbox.d.ts +0 -45
- package/build/ft-base-checkbox.js +0 -173
- package/build/ftds-checkbox.d.ts +0 -29
- package/build/ftds-checkbox.js +0 -110
- package/build/ftds-checkbox.styles.d.ts +0 -1
- package/build/ftds-checkbox.styles.js +0 -159
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
export declare const FtCheckboxCssVariables: {
|
|
2
|
-
textColor: import("@fluid-topics/
|
|
3
|
-
fontSize: import("@fluid-topics/
|
|
4
|
-
activeColor: import("@fluid-topics/
|
|
5
|
-
checkColor: import("@fluid-topics/
|
|
6
|
-
borderColor: import("@fluid-topics/
|
|
7
|
-
disabledColor: import("@fluid-topics/
|
|
8
|
-
errorColor: import("@fluid-topics/
|
|
2
|
+
textColor: import("@fluid-topics/design-system-variables").FtCssVariable;
|
|
3
|
+
fontSize: import("@fluid-topics/design-system-variables").FtCssVariable;
|
|
4
|
+
activeColor: import("@fluid-topics/design-system-variables").FtCssVariable;
|
|
5
|
+
checkColor: import("@fluid-topics/design-system-variables").FtCssVariable;
|
|
6
|
+
borderColor: import("@fluid-topics/design-system-variables").FtCssVariable;
|
|
7
|
+
disabledColor: import("@fluid-topics/design-system-variables").FtCssVariable;
|
|
8
|
+
errorColor: import("@fluid-topics/design-system-variables").FtCssVariable;
|
|
9
9
|
};
|
|
10
10
|
export declare const styles: import("lit").CSSResult;
|
package/build/index.d.ts
CHANGED
package/build/index.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fluid-topics/ft-checkbox",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.1.1",
|
|
4
4
|
"description": "A checkbox component",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"Lit"
|
|
@@ -19,13 +19,10 @@
|
|
|
19
19
|
"url": "ssh://git@scm.mrs.antidot.net:2222/fluidtopics/ft-web-components.git"
|
|
20
20
|
},
|
|
21
21
|
"dependencies": {
|
|
22
|
-
"@fluid-topics/ft-
|
|
23
|
-
"@fluid-topics/ft-
|
|
24
|
-
"@fluid-topics/ft-
|
|
25
|
-
"@fluid-topics/ft-ripple": "2.0.38",
|
|
26
|
-
"@fluid-topics/ft-typography": "2.0.38",
|
|
27
|
-
"@fluid-topics/ft-wc-utils": "2.0.38",
|
|
22
|
+
"@fluid-topics/ft-ripple": "2.1.1",
|
|
23
|
+
"@fluid-topics/ft-typography": "2.1.1",
|
|
24
|
+
"@fluid-topics/ft-wc-utils": "2.1.1",
|
|
28
25
|
"lit": "3.1.0"
|
|
29
26
|
},
|
|
30
|
-
"gitHead": "
|
|
27
|
+
"gitHead": "a9f1e471fb2dba9aeb8c12394a25460f675597dc"
|
|
31
28
|
}
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
import { PropertyValues } from "lit";
|
|
2
|
-
import { ElementDefinitionsMap, FtLitElement } from "@fluid-topics/ft-wc-utils";
|
|
3
|
-
import { ClassInfo } from "lit/directives/class-map.js";
|
|
4
|
-
export interface FtBaseCheckboxProperties {
|
|
5
|
-
name: string;
|
|
6
|
-
value: string;
|
|
7
|
-
label: string;
|
|
8
|
-
checked: boolean;
|
|
9
|
-
indeterminate: boolean;
|
|
10
|
-
disabled: boolean;
|
|
11
|
-
legendColor: string;
|
|
12
|
-
helper: string;
|
|
13
|
-
}
|
|
14
|
-
export declare class FtCheckboxChangeEvent extends CustomEvent<boolean> {
|
|
15
|
-
constructor(checked: boolean);
|
|
16
|
-
}
|
|
17
|
-
export declare class FtBaseCheckbox extends FtLitElement implements FtBaseCheckboxProperties {
|
|
18
|
-
static elementDefinitions: ElementDefinitionsMap;
|
|
19
|
-
name: string;
|
|
20
|
-
value: string;
|
|
21
|
-
label: string;
|
|
22
|
-
helper: string;
|
|
23
|
-
checked: boolean;
|
|
24
|
-
indeterminate: boolean;
|
|
25
|
-
disabled: boolean;
|
|
26
|
-
rippleUnbounded: boolean;
|
|
27
|
-
error: boolean;
|
|
28
|
-
legendColor: string;
|
|
29
|
-
private container?;
|
|
30
|
-
private ripple?;
|
|
31
|
-
private input;
|
|
32
|
-
get checkboxClasses(): ClassInfo;
|
|
33
|
-
get checkboxHelperClasses(): ClassInfo;
|
|
34
|
-
get typographyVariant(): string;
|
|
35
|
-
protected renderBoxContainer(): import("lit-html").TemplateResult<1>;
|
|
36
|
-
protected render(): import("lit-html").TemplateResult<1>;
|
|
37
|
-
protected renderBoxIcon(): any;
|
|
38
|
-
protected renderSlotBody(): unknown;
|
|
39
|
-
protected onSlotchange(): void;
|
|
40
|
-
protected willUpdate(changedProperties: PropertyValues): void;
|
|
41
|
-
protected onChange(event: Event): void;
|
|
42
|
-
protected contentAvailableCallback(props: PropertyValues): void;
|
|
43
|
-
click(): void;
|
|
44
|
-
focus(): void;
|
|
45
|
-
}
|
|
@@ -1,173 +0,0 @@
|
|
|
1
|
-
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
-
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
-
};
|
|
7
|
-
import { html, } from "lit";
|
|
8
|
-
import { property, query, } from "lit/decorators.js";
|
|
9
|
-
import { FtLitElement, } from "@fluid-topics/ft-wc-utils";
|
|
10
|
-
import { classMap, } from "lit/directives/class-map.js";
|
|
11
|
-
import { FtRipple } from "@fluid-topics/ft-ripple";
|
|
12
|
-
import { FtTypography, FtTypographyVariants, } from "@fluid-topics/ft-typography";
|
|
13
|
-
export class FtCheckboxChangeEvent extends CustomEvent {
|
|
14
|
-
constructor(checked) {
|
|
15
|
-
super("change", { detail: checked });
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
export class FtBaseCheckbox extends FtLitElement {
|
|
19
|
-
constructor() {
|
|
20
|
-
super(...arguments);
|
|
21
|
-
this.name = "";
|
|
22
|
-
this.value = "";
|
|
23
|
-
this.label = "";
|
|
24
|
-
this.helper = "";
|
|
25
|
-
this.checked = false;
|
|
26
|
-
this.indeterminate = false;
|
|
27
|
-
this.disabled = false;
|
|
28
|
-
this.rippleUnbounded = true;
|
|
29
|
-
this.error = false;
|
|
30
|
-
this.legendColor = "";
|
|
31
|
-
}
|
|
32
|
-
get checkboxClasses() {
|
|
33
|
-
return {
|
|
34
|
-
"ft-checkbox": true,
|
|
35
|
-
"ft-checkbox--error": this.error,
|
|
36
|
-
"ft-checkbox--checked": this.indeterminate ? false : this.checked,
|
|
37
|
-
"ft-checkbox--indeterminate": this.indeterminate,
|
|
38
|
-
"ft-checkbox--disabled": this.disabled,
|
|
39
|
-
};
|
|
40
|
-
}
|
|
41
|
-
get checkboxHelperClasses() {
|
|
42
|
-
return {
|
|
43
|
-
"ft-checkbox-helper--disabled": this.disabled,
|
|
44
|
-
"ft-checkbox-helper--error": this.error,
|
|
45
|
-
"ft-checkbox-helper--checked": this.indeterminate ? false : this.checked,
|
|
46
|
-
"ft-checkbox-helper--indeterminate": this.indeterminate,
|
|
47
|
-
"ft-checkbox-helper--legend-color-displayed": this.legendColor && this.legendColor.trim().length > 0,
|
|
48
|
-
};
|
|
49
|
-
}
|
|
50
|
-
get typographyVariant() {
|
|
51
|
-
return FtTypographyVariants.body2;
|
|
52
|
-
}
|
|
53
|
-
renderBoxContainer() {
|
|
54
|
-
return html `
|
|
55
|
-
<div class="ft-checkbox--box-container" part="checkbox-box-container">
|
|
56
|
-
<ft-ripple part="checkbox-ripple"
|
|
57
|
-
?disabled=${this.disabled}
|
|
58
|
-
?primary=${this.checked || this.indeterminate}
|
|
59
|
-
?unbounded=${this.rippleUnbounded}>
|
|
60
|
-
</ft-ripple>
|
|
61
|
-
<div class="ft-checkbox--box" part="checkbox-box">
|
|
62
|
-
${this.renderBoxIcon()}
|
|
63
|
-
</div>
|
|
64
|
-
<input type="checkbox"
|
|
65
|
-
id="checkbox-input"
|
|
66
|
-
part="checkbox-input"
|
|
67
|
-
name="${this.name}"
|
|
68
|
-
aria-checked="${this.indeterminate ? "mixed" : (this.checked ? "true" : "false")}"
|
|
69
|
-
role="checkbox"
|
|
70
|
-
.checked=${this.indeterminate ? false : this.checked}
|
|
71
|
-
.indeterminate=${this.indeterminate}
|
|
72
|
-
.disabled=${this.disabled}
|
|
73
|
-
@change=${this.onChange}
|
|
74
|
-
>
|
|
75
|
-
</div>
|
|
76
|
-
`;
|
|
77
|
-
}
|
|
78
|
-
render() {
|
|
79
|
-
return html `
|
|
80
|
-
<label class="${classMap(this.checkboxClasses)}" for="checkbox-input" part="checkbox-label">
|
|
81
|
-
${this.renderBoxContainer()}
|
|
82
|
-
${this.renderSlotBody()}
|
|
83
|
-
</label>
|
|
84
|
-
`;
|
|
85
|
-
}
|
|
86
|
-
renderBoxIcon() {
|
|
87
|
-
return html `
|
|
88
|
-
<svg class="ft-checkbox--checkmark" viewBox="0 0 24 24" part="checkbox-check" aria-hidden="true">
|
|
89
|
-
<path class="ft-checkbox--checkmark-path" fill="none"
|
|
90
|
-
d="${(this.indeterminate && !this.checked)
|
|
91
|
-
? "M2,12 22,12"
|
|
92
|
-
: "M1.73,12.91 8.1,19.28 22.79,4.59"}"></path>
|
|
93
|
-
</svg>
|
|
94
|
-
`;
|
|
95
|
-
}
|
|
96
|
-
renderSlotBody() {
|
|
97
|
-
return html `
|
|
98
|
-
<ft-typography variant="${this.typographyVariant}" part="checkbox-body">
|
|
99
|
-
<slot @slotchange=${this.onSlotchange}></slot>
|
|
100
|
-
</ft-typography>
|
|
101
|
-
`;
|
|
102
|
-
}
|
|
103
|
-
onSlotchange() {
|
|
104
|
-
this.requestUpdate();
|
|
105
|
-
}
|
|
106
|
-
willUpdate(changedProperties) {
|
|
107
|
-
super.willUpdate(changedProperties);
|
|
108
|
-
if (changedProperties.has("checked")) {
|
|
109
|
-
this.ariaChecked = this.checked ? "true" : "false";
|
|
110
|
-
}
|
|
111
|
-
}
|
|
112
|
-
onChange(event) {
|
|
113
|
-
event.stopPropagation();
|
|
114
|
-
this.checked = event.target.checked;
|
|
115
|
-
this.indeterminate = false;
|
|
116
|
-
this.dispatchEvent(new FtCheckboxChangeEvent(this.checked));
|
|
117
|
-
}
|
|
118
|
-
contentAvailableCallback(props) {
|
|
119
|
-
var _a;
|
|
120
|
-
super.contentAvailableCallback(props);
|
|
121
|
-
(_a = this.ripple) === null || _a === void 0 ? void 0 : _a.setupFor(this.container);
|
|
122
|
-
}
|
|
123
|
-
click() {
|
|
124
|
-
this.input.click();
|
|
125
|
-
}
|
|
126
|
-
focus() {
|
|
127
|
-
this.input.focus();
|
|
128
|
-
setTimeout(() => {
|
|
129
|
-
var _a;
|
|
130
|
-
(_a = this.ripple) === null || _a === void 0 ? void 0 : _a.forceFocusUpdate();
|
|
131
|
-
}, 0);
|
|
132
|
-
}
|
|
133
|
-
}
|
|
134
|
-
FtBaseCheckbox.elementDefinitions = {
|
|
135
|
-
"ft-ripple": FtRipple,
|
|
136
|
-
"ft-typography": FtTypography,
|
|
137
|
-
};
|
|
138
|
-
__decorate([
|
|
139
|
-
property()
|
|
140
|
-
], FtBaseCheckbox.prototype, "name", void 0);
|
|
141
|
-
__decorate([
|
|
142
|
-
property()
|
|
143
|
-
], FtBaseCheckbox.prototype, "value", void 0);
|
|
144
|
-
__decorate([
|
|
145
|
-
property()
|
|
146
|
-
], FtBaseCheckbox.prototype, "label", void 0);
|
|
147
|
-
__decorate([
|
|
148
|
-
property()
|
|
149
|
-
], FtBaseCheckbox.prototype, "helper", void 0);
|
|
150
|
-
__decorate([
|
|
151
|
-
property({ type: Boolean, reflect: true })
|
|
152
|
-
], FtBaseCheckbox.prototype, "checked", void 0);
|
|
153
|
-
__decorate([
|
|
154
|
-
property({ type: Boolean })
|
|
155
|
-
], FtBaseCheckbox.prototype, "indeterminate", void 0);
|
|
156
|
-
__decorate([
|
|
157
|
-
property({ type: Boolean })
|
|
158
|
-
], FtBaseCheckbox.prototype, "disabled", void 0);
|
|
159
|
-
__decorate([
|
|
160
|
-
property({ type: Boolean })
|
|
161
|
-
], FtBaseCheckbox.prototype, "error", void 0);
|
|
162
|
-
__decorate([
|
|
163
|
-
property()
|
|
164
|
-
], FtBaseCheckbox.prototype, "legendColor", void 0);
|
|
165
|
-
__decorate([
|
|
166
|
-
query(".ft-checkbox")
|
|
167
|
-
], FtBaseCheckbox.prototype, "container", void 0);
|
|
168
|
-
__decorate([
|
|
169
|
-
query("ft-ripple")
|
|
170
|
-
], FtBaseCheckbox.prototype, "ripple", void 0);
|
|
171
|
-
__decorate([
|
|
172
|
-
query("input")
|
|
173
|
-
], FtBaseCheckbox.prototype, "input", void 0);
|
package/build/ftds-checkbox.d.ts
DELETED
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import { FtBaseCheckbox, FtBaseCheckboxProperties } from "./ft-base-checkbox";
|
|
2
|
-
import { ClassInfo } from "lit/directives/class-map.js";
|
|
3
|
-
import { ElementDefinitionsMap } from "@fluid-topics/ft-wc-utils";
|
|
4
|
-
import { DesignSystemFamily } from "@fluid-topics/design-system-variables";
|
|
5
|
-
import { nothing } from "lit";
|
|
6
|
-
export declare class FtdsCheckboxChangeEvent extends CustomEvent<{
|
|
7
|
-
value: string;
|
|
8
|
-
checked: boolean;
|
|
9
|
-
}> {
|
|
10
|
-
constructor(value: string, checked: boolean);
|
|
11
|
-
}
|
|
12
|
-
declare const FtdsCheckbox_base: import("@fluid-topics/ft-wc-utils").FtdsBaseType<typeof FtBaseCheckbox>;
|
|
13
|
-
export declare class FtdsCheckbox extends FtdsCheckbox_base implements FtBaseCheckboxProperties {
|
|
14
|
-
static elementDefinitions: ElementDefinitionsMap;
|
|
15
|
-
rippleUnbounded: boolean;
|
|
16
|
-
family: DesignSystemFamily;
|
|
17
|
-
static styles: import("lit").CSSResult[];
|
|
18
|
-
get checkboxClasses(): ClassInfo;
|
|
19
|
-
protected render(): import("lit-html").TemplateResult<1>;
|
|
20
|
-
protected renderBoxIcon(): unknown;
|
|
21
|
-
private notNullOrBlank;
|
|
22
|
-
protected renderSlotBody(): import("lit-html").TemplateResult<1> | typeof nothing;
|
|
23
|
-
protected renderLegendColor(): import("lit-html").TemplateResult<1> | typeof nothing;
|
|
24
|
-
protected renderHelper(): import("lit-html").TemplateResult<1> | typeof nothing;
|
|
25
|
-
protected renderPopover(): import("lit-html").TemplateResult<1>;
|
|
26
|
-
get typographyVariant(): string;
|
|
27
|
-
protected onChange(event: Event): void;
|
|
28
|
-
}
|
|
29
|
-
export {};
|
package/build/ftds-checkbox.js
DELETED
|
@@ -1,110 +0,0 @@
|
|
|
1
|
-
import { FtBaseCheckbox, } from "./ft-base-checkbox";
|
|
2
|
-
import { classMap, } from "lit/directives/class-map.js";
|
|
3
|
-
import { safariEllipsisFix, toFtdsBase, } from "@fluid-topics/ft-wc-utils";
|
|
4
|
-
import { dsStyles } from "./ftds-checkbox.styles";
|
|
5
|
-
import { DesignSystemFamily } from "@fluid-topics/design-system-variables";
|
|
6
|
-
import { FtdsTypography, FtdsTypographyVariants, } from "@fluid-topics/ft-typography";
|
|
7
|
-
import { html, nothing, } from "lit";
|
|
8
|
-
import { FtIcon, FtIcons, } from "@fluid-topics/ft-icon";
|
|
9
|
-
import { FtdsPopover } from "@fluid-topics/ft-popover";
|
|
10
|
-
import { FtdsLink } from "@fluid-topics/ft-link";
|
|
11
|
-
export class FtdsCheckboxChangeEvent extends CustomEvent {
|
|
12
|
-
constructor(value, checked) {
|
|
13
|
-
super("change", { detail: { value: value, checked: checked }, bubbles: true, composed: true });
|
|
14
|
-
}
|
|
15
|
-
}
|
|
16
|
-
export class FtdsCheckbox extends toFtdsBase(FtBaseCheckbox) {
|
|
17
|
-
constructor() {
|
|
18
|
-
super(...arguments);
|
|
19
|
-
this.rippleUnbounded = false;
|
|
20
|
-
this.family = DesignSystemFamily.brand;
|
|
21
|
-
}
|
|
22
|
-
get checkboxClasses() {
|
|
23
|
-
return {
|
|
24
|
-
...super.checkboxClasses,
|
|
25
|
-
...this.getDesignSystemBaseClasses(),
|
|
26
|
-
};
|
|
27
|
-
}
|
|
28
|
-
render() {
|
|
29
|
-
return html `
|
|
30
|
-
<div part="checkbox-and-popover">
|
|
31
|
-
<div part="checkbox-label-and-helper">
|
|
32
|
-
<label class="${classMap(this.checkboxClasses)}" for="checkbox-input" part="checkbox-label">
|
|
33
|
-
${this.renderBoxContainer()}
|
|
34
|
-
${this.renderLegendColor()}
|
|
35
|
-
${this.renderSlotBody()}
|
|
36
|
-
</label>
|
|
37
|
-
${this.renderHelper()}
|
|
38
|
-
</div>
|
|
39
|
-
${this.renderPopover()}
|
|
40
|
-
</div>
|
|
41
|
-
`;
|
|
42
|
-
}
|
|
43
|
-
renderBoxIcon() {
|
|
44
|
-
if (this.indeterminate) {
|
|
45
|
-
return html `
|
|
46
|
-
<ft-icon part="checkbox-icon" value="${FtIcons.HYPHEN_SOLID}"></ft-icon>`;
|
|
47
|
-
}
|
|
48
|
-
if (this.checked) {
|
|
49
|
-
return html `
|
|
50
|
-
<ft-icon part="checkbox-icon" value="${FtIcons.CHECK}"></ft-icon>`;
|
|
51
|
-
}
|
|
52
|
-
return nothing;
|
|
53
|
-
}
|
|
54
|
-
notNullOrBlank(field) {
|
|
55
|
-
return field && field.trim().length > 0;
|
|
56
|
-
}
|
|
57
|
-
renderSlotBody() {
|
|
58
|
-
return this.notNullOrBlank(this.label)
|
|
59
|
-
? html `
|
|
60
|
-
<ftds-typography variant="${this.typographyVariant}"
|
|
61
|
-
part="checkbox-body">${this.label}
|
|
62
|
-
</ftds-typography>`
|
|
63
|
-
: nothing;
|
|
64
|
-
}
|
|
65
|
-
renderLegendColor() {
|
|
66
|
-
return this.notNullOrBlank(this.legendColor)
|
|
67
|
-
? html `
|
|
68
|
-
<div part="checkbox-legend-color"
|
|
69
|
-
style="background-color: ${this.legendColor}">
|
|
70
|
-
</div>`
|
|
71
|
-
: nothing;
|
|
72
|
-
}
|
|
73
|
-
renderHelper() {
|
|
74
|
-
return this.notNullOrBlank(this.helper)
|
|
75
|
-
? html `
|
|
76
|
-
<ftds-typography class="${classMap(this.checkboxHelperClasses)}"
|
|
77
|
-
variant="${FtdsTypographyVariants.caption1medium}"
|
|
78
|
-
part="checkbox-helper">${this.helper}
|
|
79
|
-
</ftds-typography>`
|
|
80
|
-
: nothing;
|
|
81
|
-
}
|
|
82
|
-
renderPopover() {
|
|
83
|
-
return html `
|
|
84
|
-
<div part="checkbox-popover">
|
|
85
|
-
<div part="checkbox-popover-wrapper">
|
|
86
|
-
<slot @slotchange=${this.onSlotchange}></slot>
|
|
87
|
-
</div>
|
|
88
|
-
</div>`;
|
|
89
|
-
}
|
|
90
|
-
get typographyVariant() {
|
|
91
|
-
return FtdsTypographyVariants.body2medium;
|
|
92
|
-
}
|
|
93
|
-
onChange(event) {
|
|
94
|
-
event.stopPropagation();
|
|
95
|
-
this.checked = event.target.checked;
|
|
96
|
-
this.indeterminate = false;
|
|
97
|
-
this.dispatchEvent(new FtdsCheckboxChangeEvent(this.value, this.checked));
|
|
98
|
-
}
|
|
99
|
-
}
|
|
100
|
-
FtdsCheckbox.elementDefinitions = {
|
|
101
|
-
...FtBaseCheckbox.elementDefinitions,
|
|
102
|
-
"ftds-popover": FtdsPopover,
|
|
103
|
-
"ftds-link": FtdsLink,
|
|
104
|
-
"ftds-typography": FtdsTypography,
|
|
105
|
-
"ft-icon": FtIcon,
|
|
106
|
-
};
|
|
107
|
-
FtdsCheckbox.styles = [
|
|
108
|
-
safariEllipsisFix,
|
|
109
|
-
dsStyles,
|
|
110
|
-
];
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const dsStyles: import("lit").CSSResult;
|
|
@@ -1,159 +0,0 @@
|
|
|
1
|
-
import { checkbox, } from "@fluid-topics/ft-wc-utils";
|
|
2
|
-
import { css } from "lit";
|
|
3
|
-
import { FtRippleCssVariables } from "@fluid-topics/ft-ripple";
|
|
4
|
-
import { FtIconCssVariables } from "@fluid-topics/ft-icon";
|
|
5
|
-
// language=CSS
|
|
6
|
-
export const dsStyles = css `
|
|
7
|
-
* {
|
|
8
|
-
box-sizing: border-box;
|
|
9
|
-
--input-size: calc(${checkbox.boxSize} + 2 * (${checkbox.focusOutlineOffset} + ${checkbox.focusOutlineWidth}));
|
|
10
|
-
--input-margin: calc(-1 * ${checkbox.focusOutlineOffset} - ${checkbox.focusOutlineWidth});
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
[part="checkbox-label-and-helper"] {
|
|
14
|
-
display: flex;
|
|
15
|
-
flex-direction: column;
|
|
16
|
-
align-items: self-start;
|
|
17
|
-
gap: ${checkbox.helperPaddingTop};
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
[part="checkbox-and-popover"] {
|
|
21
|
-
display: flex;
|
|
22
|
-
align-items: flex-start;
|
|
23
|
-
gap: ${checkbox.labelHorizontalGap};
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
[part="checkbox-popover"] {
|
|
27
|
-
flex: 0 0 auto;
|
|
28
|
-
height: ${checkbox.boxSize};
|
|
29
|
-
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
[part="checkbox-popover-wrapper"] {
|
|
33
|
-
margin-top: -5px;
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
[part="checkbox-helper"] {
|
|
37
|
-
display: block;
|
|
38
|
-
color: ${checkbox.helperTextColor};
|
|
39
|
-
margin-left: calc(${checkbox.boxSize} + ${checkbox.horizontalGap});
|
|
40
|
-
|
|
41
|
-
&.ft-checkbox-helper--disabled {
|
|
42
|
-
background-color: transparent;
|
|
43
|
-
opacity: ${checkbox.uncheckedDisabledComponentOpacity};
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
&.ft-checkbox-helper--disabled.ft-checkbox-helper--checked, &.ft-checkbox-helper--disabled.ft-checkbox-helper--indeterminate {
|
|
47
|
-
background-color: transparent;
|
|
48
|
-
opacity: ${checkbox.checkedDisabledComponentOpacity};
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
&.ft-checkbox-helper--legend-color-displayed {
|
|
52
|
-
margin-left: calc(${checkbox.boxSize} + (${checkbox.horizontalGap} * 2 + ${checkbox.colorLegendSize}));
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
.ft-checkbox {
|
|
57
|
-
display: inline-flex;
|
|
58
|
-
align-items: flex-start;
|
|
59
|
-
gap: ${checkbox.horizontalGap};
|
|
60
|
-
color: ${checkbox.color};
|
|
61
|
-
|
|
62
|
-
input {
|
|
63
|
-
opacity: 0;
|
|
64
|
-
position: absolute;
|
|
65
|
-
flex: 0 0 auto;
|
|
66
|
-
width: var(--input-size);
|
|
67
|
-
height: var(--input-size);
|
|
68
|
-
border-radius: ${checkbox.borderRadius};
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
.ft-checkbox--box-container {
|
|
72
|
-
position: relative;
|
|
73
|
-
display: flex;
|
|
74
|
-
flex: 0 0 auto;
|
|
75
|
-
justify-content: center;
|
|
76
|
-
align-items: center;
|
|
77
|
-
width: var(--input-size);
|
|
78
|
-
height: var(--input-size);
|
|
79
|
-
margin: var(--input-margin);
|
|
80
|
-
border-radius: ${checkbox.borderRadius};
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
.ft-checkbox--box-container:has(:focus-visible) {
|
|
84
|
-
outline: ${checkbox.focusOutlineWidth} solid ${checkbox.focusFocusRingColor};
|
|
85
|
-
outline-offset: calc(${checkbox.focusOutlineWidth} * -1);
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
.ft-checkbox--box {
|
|
89
|
-
display: flex;
|
|
90
|
-
flex: 0 0 auto;
|
|
91
|
-
align-items: center;
|
|
92
|
-
justify-content: center;
|
|
93
|
-
box-shadow: inset 0 0 0 ${checkbox.borderWidth} ${checkbox.uncheckedBorderColor};
|
|
94
|
-
border-radius: ${checkbox.borderRadius};
|
|
95
|
-
width: ${checkbox.boxSize};
|
|
96
|
-
height: ${checkbox.boxSize};
|
|
97
|
-
color: ${checkbox.checkedIconColor};
|
|
98
|
-
|
|
99
|
-
ft-icon {
|
|
100
|
-
${FtIconCssVariables.size.set(checkbox.iconSize)};
|
|
101
|
-
}
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
&.ft-checkbox--disabled {
|
|
105
|
-
background-color: transparent;
|
|
106
|
-
opacity: ${checkbox.uncheckedDisabledComponentOpacity};
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
ft-ripple {
|
|
110
|
-
flex: 0 0 auto;
|
|
111
|
-
z-index: 0;
|
|
112
|
-
${FtRippleCssVariables.color.set(checkbox.uncheckedStateLayerColor)};
|
|
113
|
-
${FtRippleCssVariables.backgroundColor.set(checkbox.uncheckedStateLayerColor)};
|
|
114
|
-
${FtRippleCssVariables.opacityContentOnSurfaceHover.set(checkbox.uncheckedHoverStateLayerOpacity)};
|
|
115
|
-
${FtRippleCssVariables.opacityContentOnSurfaceFocused.set(checkbox.uncheckedFocusStateLayerOpacity)};
|
|
116
|
-
${FtRippleCssVariables.opacityContentOnSurfacePressed.set(checkbox.uncheckedActiveStateLayerOpacity)};
|
|
117
|
-
${FtRippleCssVariables.borderRadius.set(checkbox.focusOutlineBorderRadius)};
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
[part="checkbox-legend-color"] {
|
|
121
|
-
flex: 0 0 auto;
|
|
122
|
-
margin-top: calc((${checkbox.boxSize} - ${checkbox.colorLegendSize}) / 2);
|
|
123
|
-
width: ${checkbox.colorLegendSize};
|
|
124
|
-
height: ${checkbox.colorLegendSize};
|
|
125
|
-
border-radius: 50%;
|
|
126
|
-
}
|
|
127
|
-
}
|
|
128
|
-
|
|
129
|
-
.ft-checkbox--checked, .ft-checkbox--indeterminate {
|
|
130
|
-
color: ${checkbox.color};
|
|
131
|
-
|
|
132
|
-
.ft-checkbox--box {
|
|
133
|
-
display: flex;
|
|
134
|
-
align-items: center;
|
|
135
|
-
justify-content: center;
|
|
136
|
-
background-color: ${checkbox.checkedBackgroundColor};
|
|
137
|
-
box-shadow: inset 0 0 0 ${checkbox.borderWidth} ${checkbox.checkedBackgroundColor};
|
|
138
|
-
color: ${checkbox.checkedIconColor};
|
|
139
|
-
}
|
|
140
|
-
|
|
141
|
-
&.ft-checkbox--disabled {
|
|
142
|
-
opacity: ${checkbox.checkedDisabledComponentOpacity};
|
|
143
|
-
}
|
|
144
|
-
|
|
145
|
-
.ft-checkbox--checkmark {
|
|
146
|
-
opacity: 1;
|
|
147
|
-
}
|
|
148
|
-
|
|
149
|
-
ft-ripple {
|
|
150
|
-
z-index: 0;
|
|
151
|
-
${FtRippleCssVariables.color.set(checkbox.checkedStateLayerColor)};
|
|
152
|
-
${FtRippleCssVariables.backgroundColor.set(checkbox.checkedStateLayerColor)};
|
|
153
|
-
${FtRippleCssVariables.opacityContentOnSurfaceHover.set(checkbox.checkedHoverStateLayerOpacity)};
|
|
154
|
-
${FtRippleCssVariables.opacityContentOnSurfaceFocused.set(checkbox.checkedFocusStateLayerOpacity)};
|
|
155
|
-
${FtRippleCssVariables.opacityContentOnSurfacePressed.set(checkbox.checkedActiveStateLayerOpacity)};
|
|
156
|
-
${FtRippleCssVariables.borderRadius.set(checkbox.focusOutlineBorderRadius)};
|
|
157
|
-
}
|
|
158
|
-
}
|
|
159
|
-
`;
|