@justeattakeaway/pie-checkbox 0.2.0 → 0.3.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/README.md +23 -4
- package/custom-elements.json +36 -6
- package/dist/index.d.ts +16 -0
- package/dist/index.js +57 -46
- package/dist/react.d.ts +16 -0
- package/dist/react.js +5 -3
- package/package.json +2 -2
- package/src/defs.ts +20 -0
- package/src/index.ts +12 -4
package/README.md
CHANGED
|
@@ -15,7 +15,8 @@
|
|
|
15
15
|
3. [Importing the component](#importing-the-component)
|
|
16
16
|
4. [Peer Dependencies](#peer-dependencies)
|
|
17
17
|
5. [Props](#props)
|
|
18
|
-
6. [
|
|
18
|
+
6. [Events](#events)
|
|
19
|
+
7. [Contributing](#contributing)
|
|
19
20
|
|
|
20
21
|
## pie-checkbox
|
|
21
22
|
|
|
@@ -74,18 +75,36 @@ import { PieCheckbox } from '@justeattakeaway/pie-checkbox/dist/react';
|
|
|
74
75
|
|
|
75
76
|
| Property | Type | Default | Description |
|
|
76
77
|
|---|---|---|---|
|
|
77
|
-
|
|
|
78
|
+
| `name` | `string` | - | The name of the checkbox (used as a key/value pair with `value`). This is required in order to work properly with forms. |
|
|
79
|
+
| `value` | `string` | 'on' | The value of the input (used as a key/value pair in HTML forms with `name`). If not passed falls back to the html default value "on". |
|
|
80
|
+
| `required` | `boolean` | `false` | If true, the checkbox is required to be checked before submitting the form. If it is not in checked state, the component validity state will be invalid. |
|
|
81
|
+
| `label` | `string` | '' | Text associated with the checkbox. If there is no label to provide, make sure to pass label, labelledby or describedby to the aria property. |
|
|
82
|
+
| `disabled` | `boolean` | `false` | Indicates whether or not the checkbox is disabled. |
|
|
83
|
+
| `checked` | `boolean` | `false` | Indicates whether or not the checkbox is checked by default (when the page loads). |
|
|
84
|
+
| `indeterminate` | `boolean` | `false` | Indicates whether the checkbox visually shows a horizontal line in the box instead of a check/tick. It has no impact on whether the checkbox's value is used in a form submission. That is decided by the checked state, regardless of the indeterminate state. |
|
|
85
|
+
| `aria` | `object` | {} | accepts `label`, `labeledby` and `describedby` keys with string values. |
|
|
78
86
|
|
|
79
87
|
In your markup or JSX, you can then use these to set the properties for the `pie-checkbox` component:
|
|
80
88
|
|
|
81
89
|
```html
|
|
82
90
|
<!-- Native HTML -->
|
|
83
|
-
<pie-checkbox
|
|
91
|
+
<pie-checkbox
|
|
92
|
+
name="mycheckbox"
|
|
93
|
+
label="Checkbox Label">
|
|
94
|
+
</pie-checkbox>
|
|
84
95
|
|
|
85
96
|
<!-- JSX -->
|
|
86
|
-
<PieCheckbox
|
|
97
|
+
<PieCheckbox
|
|
98
|
+
name="mycheckbox"
|
|
99
|
+
label="Checkbox Label">
|
|
100
|
+
</PieCheckbox>
|
|
87
101
|
```
|
|
88
102
|
|
|
103
|
+
## Events
|
|
104
|
+
| Event | Type | Description |
|
|
105
|
+
|-------|------|-------------|
|
|
106
|
+
| `change` | `CustomEvent` | Triggered after the checked state of a checkbox changes. |
|
|
107
|
+
|
|
89
108
|
## Contributing
|
|
90
109
|
|
|
91
110
|
Check out our [contributing guide](https://github.com/justeattakeaway/pie/wiki/Contributing-Guide) for more information on [local development](https://github.com/justeattakeaway/pie/wiki/Contributing-Guide#local-development) and how to run specific [component tests](https://github.com/justeattakeaway/pie/wiki/Contributing-Guide#testing).
|
package/custom-elements.json
CHANGED
|
@@ -11,8 +11,26 @@
|
|
|
11
11
|
{
|
|
12
12
|
"kind": "javascript-module",
|
|
13
13
|
"path": "src/defs.js",
|
|
14
|
-
"declarations": [
|
|
15
|
-
|
|
14
|
+
"declarations": [
|
|
15
|
+
{
|
|
16
|
+
"kind": "variable",
|
|
17
|
+
"name": "defaultProps",
|
|
18
|
+
"type": {
|
|
19
|
+
"text": "DefaultProps"
|
|
20
|
+
},
|
|
21
|
+
"default": "{\n required: false,\n indeterminate: false,\n}"
|
|
22
|
+
}
|
|
23
|
+
],
|
|
24
|
+
"exports": [
|
|
25
|
+
{
|
|
26
|
+
"kind": "js",
|
|
27
|
+
"name": "defaultProps",
|
|
28
|
+
"declaration": {
|
|
29
|
+
"name": "defaultProps",
|
|
30
|
+
"module": "src/defs.js"
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
]
|
|
16
34
|
},
|
|
17
35
|
{
|
|
18
36
|
"kind": "javascript-module",
|
|
@@ -91,7 +109,6 @@
|
|
|
91
109
|
"text": "CheckboxProps['required'] | undefined"
|
|
92
110
|
},
|
|
93
111
|
"privacy": "public",
|
|
94
|
-
"default": "false",
|
|
95
112
|
"attribute": "required",
|
|
96
113
|
"reflects": true
|
|
97
114
|
},
|
|
@@ -102,9 +119,17 @@
|
|
|
102
119
|
"text": "CheckboxProps['indeterminate'] | undefined"
|
|
103
120
|
},
|
|
104
121
|
"privacy": "public",
|
|
105
|
-
"default": "false",
|
|
106
122
|
"attribute": "indeterminate"
|
|
107
123
|
},
|
|
124
|
+
{
|
|
125
|
+
"kind": "field",
|
|
126
|
+
"name": "aria",
|
|
127
|
+
"type": {
|
|
128
|
+
"text": "CheckboxProps['aria']"
|
|
129
|
+
},
|
|
130
|
+
"privacy": "public",
|
|
131
|
+
"attribute": "aria"
|
|
132
|
+
},
|
|
108
133
|
{
|
|
109
134
|
"kind": "field",
|
|
110
135
|
"name": "checkbox",
|
|
@@ -180,7 +205,6 @@
|
|
|
180
205
|
"type": {
|
|
181
206
|
"text": "CheckboxProps['required'] | undefined"
|
|
182
207
|
},
|
|
183
|
-
"default": "false",
|
|
184
208
|
"fieldName": "required"
|
|
185
209
|
},
|
|
186
210
|
{
|
|
@@ -188,8 +212,14 @@
|
|
|
188
212
|
"type": {
|
|
189
213
|
"text": "CheckboxProps['indeterminate'] | undefined"
|
|
190
214
|
},
|
|
191
|
-
"default": "false",
|
|
192
215
|
"fieldName": "indeterminate"
|
|
216
|
+
},
|
|
217
|
+
{
|
|
218
|
+
"name": "aria",
|
|
219
|
+
"type": {
|
|
220
|
+
"text": "CheckboxProps['aria']"
|
|
221
|
+
},
|
|
222
|
+
"fieldName": "aria"
|
|
193
223
|
}
|
|
194
224
|
],
|
|
195
225
|
"mixins": [
|
package/dist/index.d.ts
CHANGED
|
@@ -1,9 +1,16 @@
|
|
|
1
|
+
import { ComponentDefaultPropsGeneric } from '@justeattakeaway/pie-webc-core';
|
|
1
2
|
import type { CSSResult } from 'lit';
|
|
2
3
|
import type { GenericConstructor } from '@justeattakeaway/pie-webc-core';
|
|
3
4
|
import type { LitElement } from 'lit';
|
|
4
5
|
import type { RTLInterface } from '@justeattakeaway/pie-webc-core';
|
|
5
6
|
import type { TemplateResult } from 'lit-html';
|
|
6
7
|
|
|
8
|
+
export declare type AriaProps = {
|
|
9
|
+
label?: string;
|
|
10
|
+
labelledby?: string;
|
|
11
|
+
describedby?: string;
|
|
12
|
+
};
|
|
13
|
+
|
|
7
14
|
export declare interface CheckboxProps {
|
|
8
15
|
/**
|
|
9
16
|
* The value of the checkbox (used as a key/value pair in HTML forms with `name`).
|
|
@@ -34,8 +41,16 @@ export declare interface CheckboxProps {
|
|
|
34
41
|
* If true, the checkbox must be checked for the form to be submittable.
|
|
35
42
|
*/
|
|
36
43
|
required?: boolean;
|
|
44
|
+
/**
|
|
45
|
+
* Various ARIA attributes.
|
|
46
|
+
*/
|
|
47
|
+
aria?: AriaProps;
|
|
37
48
|
}
|
|
38
49
|
|
|
50
|
+
export declare type DefaultProps = ComponentDefaultPropsGeneric<CheckboxProps, 'required' | 'indeterminate'>;
|
|
51
|
+
|
|
52
|
+
export declare const defaultProps: DefaultProps;
|
|
53
|
+
|
|
39
54
|
/**
|
|
40
55
|
* @tagname pie-checkbox
|
|
41
56
|
* @slot - Default slot (checkbox label)
|
|
@@ -53,6 +68,7 @@ export declare class PieCheckbox extends PieCheckbox_base implements CheckboxPro
|
|
|
53
68
|
disabled?: CheckboxProps['disabled'];
|
|
54
69
|
required?: CheckboxProps['required'];
|
|
55
70
|
indeterminate?: CheckboxProps['indeterminate'];
|
|
71
|
+
aria: CheckboxProps['aria'];
|
|
56
72
|
private checkbox?;
|
|
57
73
|
/**
|
|
58
74
|
* (Read-only) returns a ValidityState with the validity states that this element is in.
|
package/dist/index.js
CHANGED
|
@@ -1,20 +1,23 @@
|
|
|
1
|
-
import { LitElement as
|
|
2
|
-
import { RtlMixin as
|
|
3
|
-
import { property as
|
|
4
|
-
import { ifDefined as
|
|
5
|
-
const
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
(s = l[a]) && (t = (p ? s(o, n, t) : s(t)) || t);
|
|
10
|
-
return p && t && x(o, n, t), t;
|
|
1
|
+
import { LitElement as y, html as m, nothing as d, unsafeCSS as f } from "lit";
|
|
2
|
+
import { RtlMixin as v, wrapNativeEvent as g, defineCustomElement as $ } from "@justeattakeaway/pie-webc-core";
|
|
3
|
+
import { property as n, query as x } from "lit/decorators.js";
|
|
4
|
+
import { ifDefined as h } from "lit/directives/if-defined.js";
|
|
5
|
+
const q = `*,*:after,*:before{box-sizing:inherit}
|
|
6
|
+
`, b = {
|
|
7
|
+
required: !1,
|
|
8
|
+
indeterminate: !1
|
|
11
9
|
};
|
|
12
|
-
|
|
13
|
-
|
|
10
|
+
var C = Object.defineProperty, O = Object.getOwnPropertyDescriptor, o = (c, i, p, a) => {
|
|
11
|
+
for (var t = a > 1 ? void 0 : a ? O(i, p) : i, l = c.length - 1, s; l >= 0; l--)
|
|
12
|
+
(s = c[l]) && (t = (a ? s(i, p, t) : s(t)) || t);
|
|
13
|
+
return a && t && C(i, p, t), t;
|
|
14
|
+
};
|
|
15
|
+
const P = "pie-checkbox";
|
|
16
|
+
class e extends v(y) {
|
|
14
17
|
constructor() {
|
|
15
|
-
super(...arguments), this.required =
|
|
16
|
-
const
|
|
17
|
-
this.dispatchEvent(
|
|
18
|
+
super(...arguments), this.required = b.required, this.indeterminate = b.indeterminate, this.handleChange = (i) => {
|
|
19
|
+
const p = g(i);
|
|
20
|
+
this.dispatchEvent(p);
|
|
18
21
|
};
|
|
19
22
|
}
|
|
20
23
|
/**
|
|
@@ -26,24 +29,28 @@ class e extends y(d) {
|
|
|
26
29
|
}
|
|
27
30
|
render() {
|
|
28
31
|
const {
|
|
29
|
-
checked:
|
|
30
|
-
value:
|
|
31
|
-
name:
|
|
32
|
+
checked: i,
|
|
33
|
+
value: p,
|
|
34
|
+
name: a,
|
|
32
35
|
label: t,
|
|
33
|
-
disabled:
|
|
36
|
+
disabled: l,
|
|
34
37
|
required: s,
|
|
35
|
-
indeterminate:
|
|
38
|
+
indeterminate: u,
|
|
39
|
+
aria: r
|
|
36
40
|
} = this;
|
|
37
|
-
return
|
|
41
|
+
return m`
|
|
38
42
|
<label>
|
|
39
43
|
<input
|
|
40
44
|
type="checkbox"
|
|
41
|
-
?checked=${
|
|
42
|
-
.value=${
|
|
43
|
-
name=${
|
|
44
|
-
?disabled=${
|
|
45
|
+
?checked=${h(i)}
|
|
46
|
+
.value=${h(p)}
|
|
47
|
+
name=${h(a)}
|
|
48
|
+
?disabled=${l}
|
|
45
49
|
?required=${s}
|
|
46
|
-
.indeterminate=${
|
|
50
|
+
.indeterminate=${u}
|
|
51
|
+
aria-label=${(r == null ? void 0 : r.label) || d}
|
|
52
|
+
aria-labelledby=${t ? d : (r == null ? void 0 : r.labelledby) || d}
|
|
53
|
+
aria-describedby= ${(r == null ? void 0 : r.describedby) || d}
|
|
47
54
|
@change=${this.handleChange}
|
|
48
55
|
data-test-id="pie-checkbox"
|
|
49
56
|
/>
|
|
@@ -51,33 +58,37 @@ class e extends y(d) {
|
|
|
51
58
|
</label>`;
|
|
52
59
|
}
|
|
53
60
|
}
|
|
54
|
-
e.shadowRootOptions = { ...
|
|
55
|
-
e.styles =
|
|
56
|
-
|
|
57
|
-
|
|
61
|
+
e.shadowRootOptions = { ...y.shadowRootOptions, delegatesFocus: !0 };
|
|
62
|
+
e.styles = f(q);
|
|
63
|
+
o([
|
|
64
|
+
n({ type: String })
|
|
58
65
|
], e.prototype, "value", 2);
|
|
59
|
-
|
|
60
|
-
|
|
66
|
+
o([
|
|
67
|
+
n({ type: String })
|
|
61
68
|
], e.prototype, "label", 2);
|
|
62
|
-
|
|
63
|
-
|
|
69
|
+
o([
|
|
70
|
+
n({ type: String })
|
|
64
71
|
], e.prototype, "name", 2);
|
|
65
|
-
|
|
66
|
-
|
|
72
|
+
o([
|
|
73
|
+
n({ type: Boolean })
|
|
67
74
|
], e.prototype, "checked", 2);
|
|
68
|
-
|
|
69
|
-
|
|
75
|
+
o([
|
|
76
|
+
n({ type: Boolean, reflect: !0 })
|
|
70
77
|
], e.prototype, "disabled", 2);
|
|
71
|
-
|
|
72
|
-
|
|
78
|
+
o([
|
|
79
|
+
n({ type: Boolean, reflect: !0 })
|
|
73
80
|
], e.prototype, "required", 2);
|
|
74
|
-
|
|
75
|
-
|
|
81
|
+
o([
|
|
82
|
+
n({ type: Boolean })
|
|
76
83
|
], e.prototype, "indeterminate", 2);
|
|
77
|
-
|
|
78
|
-
|
|
84
|
+
o([
|
|
85
|
+
n({ type: Object })
|
|
86
|
+
], e.prototype, "aria", 2);
|
|
87
|
+
o([
|
|
88
|
+
x("input")
|
|
79
89
|
], e.prototype, "checkbox", 2);
|
|
80
|
-
|
|
90
|
+
$(P, e);
|
|
81
91
|
export {
|
|
82
|
-
e as PieCheckbox
|
|
92
|
+
e as PieCheckbox,
|
|
93
|
+
b as defaultProps
|
|
83
94
|
};
|
package/dist/react.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { ComponentDefaultPropsGeneric } from '@justeattakeaway/pie-webc-core';
|
|
1
2
|
import type { CSSResult } from 'lit';
|
|
2
3
|
import type { GenericConstructor } from '@justeattakeaway/pie-webc-core';
|
|
3
4
|
import type { LitElement } from 'lit';
|
|
@@ -5,6 +6,12 @@ import * as React_2 from 'react';
|
|
|
5
6
|
import type { RTLInterface } from '@justeattakeaway/pie-webc-core';
|
|
6
7
|
import type { TemplateResult } from 'lit-html';
|
|
7
8
|
|
|
9
|
+
export declare type AriaProps = {
|
|
10
|
+
label?: string;
|
|
11
|
+
labelledby?: string;
|
|
12
|
+
describedby?: string;
|
|
13
|
+
};
|
|
14
|
+
|
|
8
15
|
export declare interface CheckboxProps {
|
|
9
16
|
/**
|
|
10
17
|
* The value of the checkbox (used as a key/value pair in HTML forms with `name`).
|
|
@@ -35,8 +42,16 @@ export declare interface CheckboxProps {
|
|
|
35
42
|
* If true, the checkbox must be checked for the form to be submittable.
|
|
36
43
|
*/
|
|
37
44
|
required?: boolean;
|
|
45
|
+
/**
|
|
46
|
+
* Various ARIA attributes.
|
|
47
|
+
*/
|
|
48
|
+
aria?: AriaProps;
|
|
38
49
|
}
|
|
39
50
|
|
|
51
|
+
export declare type DefaultProps = ComponentDefaultPropsGeneric<CheckboxProps, 'required' | 'indeterminate'>;
|
|
52
|
+
|
|
53
|
+
export declare const defaultProps: DefaultProps;
|
|
54
|
+
|
|
40
55
|
export declare const PieCheckbox: React_2.ForwardRefExoticComponent<CheckboxProps & React_2.RefAttributes<PieCheckbox_2> & ReactBaseType>;
|
|
41
56
|
|
|
42
57
|
/**
|
|
@@ -56,6 +71,7 @@ declare class PieCheckbox_2 extends PieCheckbox_base implements CheckboxProps {
|
|
|
56
71
|
disabled?: CheckboxProps['disabled'];
|
|
57
72
|
required?: CheckboxProps['required'];
|
|
58
73
|
indeterminate?: CheckboxProps['indeterminate'];
|
|
74
|
+
aria: CheckboxProps['aria'];
|
|
59
75
|
private checkbox?;
|
|
60
76
|
/**
|
|
61
77
|
* (Read-only) returns a ValidityState with the validity states that this element is in.
|
package/dist/react.js
CHANGED
|
@@ -1,17 +1,19 @@
|
|
|
1
1
|
import * as e from "react";
|
|
2
2
|
import { createComponent as o } from "@lit/react";
|
|
3
3
|
import { PieCheckbox as t } from "./index.js";
|
|
4
|
+
import { defaultProps as h } from "./index.js";
|
|
4
5
|
import "lit";
|
|
5
6
|
import "@justeattakeaway/pie-webc-core";
|
|
6
7
|
import "lit/decorators.js";
|
|
7
8
|
import "lit/directives/if-defined.js";
|
|
8
|
-
const
|
|
9
|
+
const r = o({
|
|
9
10
|
displayName: "PieCheckbox",
|
|
10
11
|
elementClass: t,
|
|
11
12
|
react: e,
|
|
12
13
|
tagName: "pie-checkbox",
|
|
13
14
|
events: {}
|
|
14
|
-
}), x =
|
|
15
|
+
}), x = r;
|
|
15
16
|
export {
|
|
16
|
-
x as PieCheckbox
|
|
17
|
+
x as PieCheckbox,
|
|
18
|
+
h as defaultProps
|
|
17
19
|
};
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@justeattakeaway/pie-checkbox",
|
|
3
3
|
"description": "PIE Design System Checkbox built using Web Components",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.3.1",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
7
7
|
"module": "dist/index.js",
|
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
"cem-plugin-module-file-extensions": "0.0.5"
|
|
41
41
|
},
|
|
42
42
|
"dependencies": {
|
|
43
|
-
"@justeattakeaway/pie-webc-core": "0.
|
|
43
|
+
"@justeattakeaway/pie-webc-core": "0.23.0"
|
|
44
44
|
},
|
|
45
45
|
"volta": {
|
|
46
46
|
"extends": "../../../package.json"
|
package/src/defs.ts
CHANGED
|
@@ -1,3 +1,10 @@
|
|
|
1
|
+
import { type ComponentDefaultPropsGeneric } from '@justeattakeaway/pie-webc-core';
|
|
2
|
+
|
|
3
|
+
export type AriaProps = {
|
|
4
|
+
label?: string;
|
|
5
|
+
labelledby?: string;
|
|
6
|
+
describedby?: string;
|
|
7
|
+
};
|
|
1
8
|
export interface CheckboxProps {
|
|
2
9
|
/**
|
|
3
10
|
* The value of the checkbox (used as a key/value pair in HTML forms with `name`).
|
|
@@ -34,4 +41,17 @@ export interface CheckboxProps {
|
|
|
34
41
|
* If true, the checkbox must be checked for the form to be submittable.
|
|
35
42
|
*/
|
|
36
43
|
required?: boolean;
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* Various ARIA attributes.
|
|
47
|
+
*/
|
|
48
|
+
aria?: AriaProps;
|
|
37
49
|
}
|
|
50
|
+
|
|
51
|
+
export type DefaultProps = ComponentDefaultPropsGeneric<CheckboxProps, 'required' | 'indeterminate'>;
|
|
52
|
+
|
|
53
|
+
export const defaultProps: DefaultProps = {
|
|
54
|
+
required: false,
|
|
55
|
+
indeterminate: false,
|
|
56
|
+
};
|
|
57
|
+
|
package/src/index.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import {
|
|
2
|
-
LitElement, html, unsafeCSS,
|
|
2
|
+
LitElement, html, unsafeCSS, nothing,
|
|
3
3
|
} from 'lit';
|
|
4
4
|
import {
|
|
5
5
|
RtlMixin,
|
|
@@ -10,7 +10,7 @@ import { property, query } from 'lit/decorators.js';
|
|
|
10
10
|
import { ifDefined } from 'lit/directives/if-defined.js';
|
|
11
11
|
|
|
12
12
|
import styles from './checkbox.scss?inline';
|
|
13
|
-
import { CheckboxProps } from './defs';
|
|
13
|
+
import { CheckboxProps, defaultProps } from './defs';
|
|
14
14
|
|
|
15
15
|
// Valid values available to consumers
|
|
16
16
|
export * from './defs';
|
|
@@ -40,10 +40,13 @@ export class PieCheckbox extends RtlMixin(LitElement) implements CheckboxProps {
|
|
|
40
40
|
public disabled?: CheckboxProps['disabled'];
|
|
41
41
|
|
|
42
42
|
@property({ type: Boolean, reflect: true })
|
|
43
|
-
public required?: CheckboxProps['required'] =
|
|
43
|
+
public required?: CheckboxProps['required'] = defaultProps.required;
|
|
44
44
|
|
|
45
45
|
@property({ type: Boolean })
|
|
46
|
-
public indeterminate?: CheckboxProps['indeterminate'] =
|
|
46
|
+
public indeterminate?: CheckboxProps['indeterminate'] = defaultProps.indeterminate;
|
|
47
|
+
|
|
48
|
+
@property({ type: Object })
|
|
49
|
+
public aria: CheckboxProps['aria'];
|
|
47
50
|
|
|
48
51
|
@query('input')
|
|
49
52
|
private checkbox?: HTMLInputElement;
|
|
@@ -77,7 +80,9 @@ export class PieCheckbox extends RtlMixin(LitElement) implements CheckboxProps {
|
|
|
77
80
|
disabled,
|
|
78
81
|
required,
|
|
79
82
|
indeterminate,
|
|
83
|
+
aria,
|
|
80
84
|
} = this;
|
|
85
|
+
|
|
81
86
|
return html`
|
|
82
87
|
<label>
|
|
83
88
|
<input
|
|
@@ -88,6 +93,9 @@ export class PieCheckbox extends RtlMixin(LitElement) implements CheckboxProps {
|
|
|
88
93
|
?disabled=${disabled}
|
|
89
94
|
?required=${required}
|
|
90
95
|
.indeterminate=${indeterminate}
|
|
96
|
+
aria-label=${aria?.label || nothing}
|
|
97
|
+
aria-labelledby=${label ? nothing : aria?.labelledby || nothing}
|
|
98
|
+
aria-describedby= ${aria?.describedby || nothing}
|
|
91
99
|
@change=${this.handleChange}
|
|
92
100
|
data-test-id="pie-checkbox"
|
|
93
101
|
/>
|