@justeattakeaway/pie-checkbox-group 0.7.0 → 0.7.2
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/dist/index.js +52 -53
- package/dist/react.js +11 -17
- package/package.json +4 -4
- package/src/defs-react.ts +1 -1
- package/src/index.ts +2 -2
- package/src/react.ts +2 -2
package/dist/index.js
CHANGED
|
@@ -1,28 +1,26 @@
|
|
|
1
|
-
import { LitElement as
|
|
2
|
-
import { state as
|
|
3
|
-
import { FormControlMixin as
|
|
1
|
+
import { LitElement as g, html as n, unsafeCSS as k } from "lit";
|
|
2
|
+
import { state as v, property as c, queryAssignedElements as f } from "lit/decorators.js";
|
|
3
|
+
import { FormControlMixin as m, RtlMixin as y, validPropertyValues as G, defineCustomElement as _ } from "@justeattakeaway/pie-webc-core";
|
|
4
4
|
import { ifDefined as b } from "lit/directives/if-defined.js";
|
|
5
|
-
import { classMap as
|
|
5
|
+
import { classMap as C } from "lit/directives/class-map.js";
|
|
6
6
|
import "@justeattakeaway/pie-assistive-text";
|
|
7
|
-
const
|
|
8
|
-
`, E = ["default", "success", "error"], S = "pie-checkbox-group-disabled", O = "pie-checkbox-group-error", p = {
|
|
7
|
+
const E = "*,*:after,*:before{box-sizing:inherit}.c-checkboxGroup{--checkbox-group-offset: var(--dt-spacing-c);--checkbox-group-offset--inline: var(--dt-spacing-e);--checkbox-group-label-offset: var(--dt-spacing-a);margin:0;padding:0;border:0;min-width:0}.c-checkboxGroup ::slotted(pie-checkbox){display:flex}.c-checkboxGroup ::slotted(pie-form-label){display:block;padding-block-end:var(--checkbox-group-label-offset)}.c-checkboxGroup:not(.c-checkboxGroup--inline) ::slotted(pie-checkbox:not(:last-child)){margin-block-end:var(--checkbox-group-offset)}.c-checkboxGroup--inline{display:flex;align-items:flex-start;flex-wrap:wrap}.c-checkboxGroup.c-checkboxGroup--inline{margin:calc(-1 * var(--checkbox-group-offset) / 2) calc(-1 * var(--checkbox-group-offset--inline) / 2)}.c-checkboxGroup.c-checkboxGroup--inline ::slotted(pie-checkbox){margin:calc(var(--checkbox-group-offset) / 2) calc(var(--checkbox-group-offset--inline) / 2)}.c-checkboxGroup.c-checkboxGroup--inline ::slotted(pie-form-label){margin:0 calc(var(--checkbox-group-offset--inline) / 2) calc(-1 * (var(--checkbox-group-offset) / 2 - var(--checkbox-group-label-offset)));padding-block-end:0}.c-checkboxGroup-assistiveText{--checkbox-group-assistive-text-offset: var(--dt-spacing-a);display:block;margin-block-start:var(--checkbox-group-assistive-text-offset)}", S = ["default", "success", "error"], $ = "pie-checkbox-group-disabled", T = "pie-checkbox-group-error", p = {
|
|
9
8
|
status: "default",
|
|
10
9
|
disabled: !1,
|
|
11
10
|
isInline: !1
|
|
12
11
|
};
|
|
13
|
-
var
|
|
14
|
-
for (var o =
|
|
15
|
-
(r =
|
|
16
|
-
return
|
|
12
|
+
var L = Object.defineProperty, i = (h, e, t, l) => {
|
|
13
|
+
for (var o = void 0, a = h.length - 1, r; a >= 0; a--)
|
|
14
|
+
(r = h[a]) && (o = r(e, t, o) || o);
|
|
15
|
+
return o && L(e, t, o), o;
|
|
17
16
|
};
|
|
18
|
-
const
|
|
19
|
-
class s extends v(m(x)) {
|
|
17
|
+
const x = "pie-checkbox-group", u = "assistive-text", d = class d extends m(y(g)) {
|
|
20
18
|
constructor() {
|
|
21
19
|
super(...arguments), this.hasLabel = !1, this.isInline = p.isInline, this.status = p.status, this.disabled = p.disabled;
|
|
22
20
|
}
|
|
23
21
|
_handleDisabled() {
|
|
24
22
|
var e;
|
|
25
|
-
(e = this._slottedChildren) == null || e.forEach((t) => t.dispatchEvent(new CustomEvent(
|
|
23
|
+
(e = this._slottedChildren) == null || e.forEach((t) => t.dispatchEvent(new CustomEvent($, {
|
|
26
24
|
bubbles: !1,
|
|
27
25
|
composed: !1,
|
|
28
26
|
detail: { disabled: this.disabled }
|
|
@@ -31,7 +29,7 @@ class s extends v(m(x)) {
|
|
|
31
29
|
_handleStatus() {
|
|
32
30
|
var e;
|
|
33
31
|
(e = this._slottedChildren) == null || e.forEach((t) => {
|
|
34
|
-
t.setAttribute("status", this.status), this.status === "error" && this.assistiveText && (t.setAttribute("assistiveText", this.assistiveText), t.dispatchEvent(new CustomEvent(
|
|
32
|
+
t.setAttribute("status", this.status), this.status === "error" && this.assistiveText && (t.setAttribute("assistiveText", this.assistiveText), t.dispatchEvent(new CustomEvent(T, { bubbles: !1, composed: !1, detail: { error: !0 } })));
|
|
35
33
|
});
|
|
36
34
|
}
|
|
37
35
|
/**
|
|
@@ -58,9 +56,9 @@ class s extends v(m(x)) {
|
|
|
58
56
|
const {
|
|
59
57
|
name: e,
|
|
60
58
|
isInline: t,
|
|
61
|
-
assistiveText:
|
|
59
|
+
assistiveText: l,
|
|
62
60
|
status: o,
|
|
63
|
-
disabled:
|
|
61
|
+
disabled: a
|
|
64
62
|
} = this, r = {
|
|
65
63
|
"c-checkboxGroup": !0,
|
|
66
64
|
"c-checkboxGroup--inline": t
|
|
@@ -68,56 +66,57 @@ class s extends v(m(x)) {
|
|
|
68
66
|
return n`
|
|
69
67
|
<fieldset
|
|
70
68
|
name=${b(e)}
|
|
71
|
-
?disabled=${
|
|
72
|
-
aria-describedby="${b(
|
|
69
|
+
?disabled=${a}
|
|
70
|
+
aria-describedby="${b(l ? u : void 0)}"
|
|
73
71
|
data-test-id="pie-checkbox-group"
|
|
74
|
-
class="${
|
|
72
|
+
class="${C(r)}"
|
|
75
73
|
>
|
|
76
74
|
${this.renderWrappedLabel()}
|
|
77
75
|
<slot></slot>
|
|
78
76
|
</fieldset>
|
|
79
|
-
${
|
|
77
|
+
${l && n`
|
|
80
78
|
<pie-assistive-text
|
|
81
|
-
id="${
|
|
79
|
+
id="${u}"
|
|
82
80
|
variant=${o}
|
|
83
81
|
class="c-checkboxGroup-assistiveText"
|
|
84
82
|
data-test-id="pie-checkbox-group-assistive-text">
|
|
85
|
-
${
|
|
83
|
+
${l}
|
|
86
84
|
</pie-assistive-text>`}
|
|
87
85
|
`;
|
|
88
86
|
}
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
87
|
+
};
|
|
88
|
+
d.styles = k(E);
|
|
89
|
+
let s = d;
|
|
90
|
+
i([
|
|
91
|
+
v()
|
|
92
|
+
], s.prototype, "hasLabel");
|
|
93
|
+
i([
|
|
94
|
+
c({ type: String })
|
|
95
|
+
], s.prototype, "name");
|
|
96
|
+
i([
|
|
97
|
+
c({ type: String })
|
|
98
|
+
], s.prototype, "assistiveText");
|
|
99
|
+
i([
|
|
100
|
+
c({ type: Boolean })
|
|
101
|
+
], s.prototype, "isInline");
|
|
102
|
+
i([
|
|
103
|
+
c({ type: String }),
|
|
104
|
+
G(x, S, p.status)
|
|
105
|
+
], s.prototype, "status");
|
|
106
|
+
i([
|
|
107
|
+
c({ type: Boolean, reflect: !0 })
|
|
108
|
+
], s.prototype, "disabled");
|
|
109
|
+
i([
|
|
110
|
+
f({ selector: "pie-checkbox" })
|
|
111
|
+
], s.prototype, "_slottedChildren");
|
|
112
|
+
i([
|
|
113
|
+
f({ slot: "label" })
|
|
114
|
+
], s.prototype, "_labelSlot");
|
|
115
|
+
_(x, s);
|
|
117
116
|
export {
|
|
118
|
-
|
|
119
|
-
|
|
117
|
+
$ as ON_CHECKBOX_GROUP_DISABLED,
|
|
118
|
+
T as ON_CHECKBOX_GROUP_ERROR,
|
|
120
119
|
s as PieCheckboxGroup,
|
|
121
120
|
p as defaultProps,
|
|
122
|
-
|
|
121
|
+
S as statusTypes
|
|
123
122
|
};
|
package/dist/react.js
CHANGED
|
@@ -1,17 +1,11 @@
|
|
|
1
|
-
import * as
|
|
2
|
-
import { createComponent as
|
|
1
|
+
import * as e from "react";
|
|
2
|
+
import { createComponent as o } from "@lit/react";
|
|
3
3
|
import { PieCheckboxGroup as r } from "./index.js";
|
|
4
|
-
import { ON_CHECKBOX_GROUP_DISABLED as
|
|
5
|
-
|
|
6
|
-
import "lit/decorators.js";
|
|
7
|
-
import "@justeattakeaway/pie-webc-core";
|
|
8
|
-
import "lit/directives/if-defined.js";
|
|
9
|
-
import "lit/directives/class-map.js";
|
|
10
|
-
import "@justeattakeaway/pie-assistive-text";
|
|
11
|
-
const p = e({
|
|
4
|
+
import { ON_CHECKBOX_GROUP_DISABLED as C, ON_CHECKBOX_GROUP_ERROR as b, defaultProps as u, statusTypes as x } from "./index.js";
|
|
5
|
+
const p = o({
|
|
12
6
|
displayName: "PieCheckboxGroup",
|
|
13
7
|
elementClass: r,
|
|
14
|
-
react:
|
|
8
|
+
react: e,
|
|
15
9
|
tagName: "pie-checkbox-group",
|
|
16
10
|
events: {
|
|
17
11
|
onPieCheckboxGroupDisabled: "pie-checkbox-group-disabled",
|
|
@@ -19,11 +13,11 @@ const p = e({
|
|
|
19
13
|
onPieCheckboxGroupError: "pie-checkbox-group-error"
|
|
20
14
|
// triggered after the state of the checkbox group changes to error.
|
|
21
15
|
}
|
|
22
|
-
}),
|
|
16
|
+
}), i = p;
|
|
23
17
|
export {
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
18
|
+
C as ON_CHECKBOX_GROUP_DISABLED,
|
|
19
|
+
b as ON_CHECKBOX_GROUP_ERROR,
|
|
20
|
+
i as PieCheckboxGroup,
|
|
21
|
+
u as defaultProps,
|
|
22
|
+
x as statusTypes
|
|
29
23
|
};
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@justeattakeaway/pie-checkbox-group",
|
|
3
3
|
"description": "PIE Design System Checkbox Group built using Web Components",
|
|
4
|
-
"version": "0.7.
|
|
4
|
+
"version": "0.7.2",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
7
7
|
"module": "dist/index.js",
|
|
@@ -37,12 +37,12 @@
|
|
|
37
37
|
"devDependencies": {
|
|
38
38
|
"@custom-elements-manifest/analyzer": "0.9.0",
|
|
39
39
|
"@justeattakeaway/pie-components-config": "0.18.0",
|
|
40
|
-
"@justeattakeaway/pie-css": "0.
|
|
40
|
+
"@justeattakeaway/pie-css": "0.13.1",
|
|
41
41
|
"cem-plugin-module-file-extensions": "0.0.5"
|
|
42
42
|
},
|
|
43
43
|
"dependencies": {
|
|
44
|
-
"@justeattakeaway/pie-assistive-text": "0.7.
|
|
45
|
-
"@justeattakeaway/pie-webc-core": "0.24.
|
|
44
|
+
"@justeattakeaway/pie-assistive-text": "0.7.3",
|
|
45
|
+
"@justeattakeaway/pie-webc-core": "0.24.2"
|
|
46
46
|
},
|
|
47
47
|
"volta": {
|
|
48
48
|
"extends": "../../../package.json"
|
package/src/defs-react.ts
CHANGED
package/src/index.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import {
|
|
2
|
-
LitElement, html, unsafeCSS, PropertyValues, nothing, type TemplateResult,
|
|
2
|
+
LitElement, html, unsafeCSS, type PropertyValues, type nothing, type TemplateResult,
|
|
3
3
|
} from 'lit';
|
|
4
4
|
import { property, queryAssignedElements, state } from 'lit/decorators.js';
|
|
5
5
|
import {
|
|
@@ -14,7 +14,7 @@ import styles from './checkbox-group.scss?inline';
|
|
|
14
14
|
import {
|
|
15
15
|
ON_CHECKBOX_GROUP_DISABLED,
|
|
16
16
|
ON_CHECKBOX_GROUP_ERROR,
|
|
17
|
-
CheckboxGroupProps,
|
|
17
|
+
type CheckboxGroupProps,
|
|
18
18
|
defaultProps,
|
|
19
19
|
statusTypes,
|
|
20
20
|
} from './defs';
|
package/src/react.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import { createComponent, EventName } from '@lit/react';
|
|
2
|
+
import { createComponent, type EventName } from '@lit/react';
|
|
3
3
|
import { PieCheckboxGroup as PieCheckboxGroupLit } from './index';
|
|
4
|
-
import { CheckboxGroupProps } from './defs';
|
|
4
|
+
import { type CheckboxGroupProps } from './defs';
|
|
5
5
|
|
|
6
6
|
export * from './defs';
|
|
7
7
|
|