@justeattakeaway/pie-checkbox 0.13.6 → 0.13.8

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 CHANGED
@@ -16,10 +16,10 @@ const P = '*,*:after,*:before{box-sizing:inherit}@keyframes checkboxCheck{0%{wid
16
16
  required: !1,
17
17
  status: "default"
18
18
  };
19
- var L = Object.defineProperty, o = (p, c, t, s) => {
19
+ var L = Object.defineProperty, o = (p, e, t, s) => {
20
20
  for (var a = void 0, n = p.length - 1, l; n >= 0; n--)
21
- (l = p[n]) && (a = l(c, t, a) || a);
22
- return a && L(c, t, a), a;
21
+ (l = p[n]) && (a = l(e, t, a) || a);
22
+ return a && L(e, t, a), a;
23
23
  };
24
24
  const w = "pie-checkbox", g = "assistive-text", b = class b extends S(z(v)) {
25
25
  constructor() {
@@ -27,12 +27,12 @@ const w = "pie-checkbox", g = "assistive-text", b = class b extends S(z(v)) {
27
27
  }
28
28
  connectedCallback() {
29
29
  super.connectedCallback(), this._abortController = new AbortController();
30
- const { signal: c } = this._abortController;
30
+ const { signal: e } = this._abortController;
31
31
  this.addEventListener("pie-checkbox-group-disabled", (t) => {
32
32
  this._disabledByParent = t.detail.disabled;
33
- }, { signal: c }), this.addEventListener("pie-checkbox-group-error", (t) => {
33
+ }, { signal: e }), this.addEventListener("pie-checkbox-group-error", (t) => {
34
34
  this._visuallyHiddenError = t.detail.error;
35
- }, { signal: c });
35
+ }, { signal: e });
36
36
  }
37
37
  disconnectedCallback() {
38
38
  super.disconnectedCallback(), this._abortController.abort();
@@ -56,8 +56,8 @@ const w = "pie-checkbox", g = "assistive-text", b = class b extends S(z(v)) {
56
56
  * or because the disabled state changed on a <fieldset> that's an ancestor of this element.
57
57
  * @param disabled - The latest disabled state of the input.
58
58
  */
59
- formDisabledCallback(c) {
60
- this.disabled = c;
59
+ formDisabledCallback(e) {
60
+ this.disabled = e;
61
61
  }
62
62
  updated() {
63
63
  this._handleFormAssociation();
@@ -66,10 +66,10 @@ const w = "pie-checkbox", g = "assistive-text", b = class b extends S(z(v)) {
66
66
  * Captures the native change event and wraps it in a custom event.
67
67
  * @param {Event} event - This should be the change event that was listened for on an input element with `type="checkbox"`.
68
68
  */
69
- _handleChange(c) {
70
- const { checked: t } = c == null ? void 0 : c.currentTarget;
69
+ _handleChange(e) {
70
+ const { checked: t } = e == null ? void 0 : e.currentTarget;
71
71
  this.checked = t;
72
- const s = T(c);
72
+ const s = T(e);
73
73
  this.dispatchEvent(s), this._handleFormAssociation();
74
74
  }
75
75
  /**
@@ -81,12 +81,12 @@ const w = "pie-checkbox", g = "assistive-text", b = class b extends S(z(v)) {
81
81
  if (this.checked === this.defaultChecked)
82
82
  return;
83
83
  this.checked = this.defaultChecked;
84
- const c = new Event("change", { bubbles: !0, composed: !0 });
85
- this.dispatchEvent(c), this._handleFormAssociation();
84
+ const e = new Event("change", { bubbles: !0, composed: !0 });
85
+ this.dispatchEvent(e), this._handleFormAssociation();
86
86
  }
87
87
  render() {
88
88
  const {
89
- checked: c,
89
+ checked: e,
90
90
  value: t,
91
91
  name: s,
92
92
  disabled: a,
@@ -101,14 +101,14 @@ const w = "pie-checkbox", g = "assistive-text", b = class b extends S(z(v)) {
101
101
  "c-checkbox": !0,
102
102
  [`c-checkbox--status-${h}`]: !d,
103
103
  "c-checkbox--disabled": d,
104
- "c-checkbox--checked": c,
105
- "c-checkbox--indeterminate": k && !c
104
+ "c-checkbox--checked": e,
105
+ "c-checkbox--indeterminate": k && !e
106
106
  }, E = {
107
107
  "c-checkbox-tick": !0,
108
108
  [`c-checkbox-tick--status-${h}`]: !d,
109
109
  "c-checkbox-tick--disabled": d,
110
- "c-checkbox-tick--checked": c,
111
- "c-checkbox-tick--indeterminate": k && !c,
110
+ "c-checkbox-tick--checked": e,
111
+ "c-checkbox-tick--indeterminate": k && !e,
112
112
  "c-checkbox-tick--rtl": _
113
113
  };
114
114
  return u`
@@ -118,7 +118,7 @@ const w = "pie-checkbox", g = "assistive-text", b = class b extends S(z(v)) {
118
118
  type="checkbox"
119
119
  id="inputId"
120
120
  .value=${t}
121
- .checked=${A(c)}
121
+ .checked=${A(e)}
122
122
  name=${f(s)}
123
123
  ?disabled=${d}
124
124
  ?required=${C}
@@ -126,9 +126,9 @@ const w = "pie-checkbox", g = "assistive-text", b = class b extends S(z(v)) {
126
126
  aria-invalid=${h === "error" ? "true" : "false"}
127
127
  aria-describedby=${f(x ? g : void 0)}
128
128
  @change=${this._handleChange}
129
- data-test-id="checkbox-input"
129
+ data-test-id="pie-checkbox-input"
130
130
  />
131
- <label for="inputId" data-test-id="checkbox-component">
131
+ <label for="inputId" data-test-id="pie-checkbox-label">
132
132
  <span
133
133
  class="${m(E)}"></span>
134
134
  <span class="c-checkbox-text">
@@ -147,47 +147,47 @@ const w = "pie-checkbox", g = "assistive-text", b = class b extends S(z(v)) {
147
147
  }
148
148
  };
149
149
  b.shadowRootOptions = { ...v.shadowRootOptions, delegatesFocus: !0 }, b.styles = F(P);
150
- let e = b;
150
+ let c = b;
151
151
  o([
152
152
  y()
153
- ], e.prototype, "_disabledByParent");
153
+ ], c.prototype, "_disabledByParent");
154
154
  o([
155
155
  y()
156
- ], e.prototype, "_visuallyHiddenError");
156
+ ], c.prototype, "_visuallyHiddenError");
157
157
  o([
158
158
  r({ type: String })
159
- ], e.prototype, "value");
159
+ ], c.prototype, "value");
160
160
  o([
161
161
  r({ type: String })
162
- ], e.prototype, "name");
162
+ ], c.prototype, "name");
163
163
  o([
164
164
  r({ type: Boolean, reflect: !0 })
165
- ], e.prototype, "checked");
165
+ ], c.prototype, "checked");
166
166
  o([
167
167
  r({ type: Boolean, reflect: !0 })
168
- ], e.prototype, "defaultChecked");
168
+ ], c.prototype, "defaultChecked");
169
169
  o([
170
170
  r({ type: Boolean, reflect: !0 })
171
- ], e.prototype, "disabled");
171
+ ], c.prototype, "disabled");
172
172
  o([
173
173
  r({ type: Boolean, reflect: !0 })
174
- ], e.prototype, "required");
174
+ ], c.prototype, "required");
175
175
  o([
176
176
  r({ type: Boolean, reflect: !0 })
177
- ], e.prototype, "indeterminate");
177
+ ], c.prototype, "indeterminate");
178
178
  o([
179
179
  q('input[type="checkbox"]')
180
- ], e.prototype, "_checkbox");
180
+ ], c.prototype, "_checkbox");
181
181
  o([
182
182
  r({ type: String })
183
- ], e.prototype, "assistiveText");
183
+ ], c.prototype, "assistiveText");
184
184
  o([
185
185
  r({ type: String }),
186
186
  D(w, R, i.status)
187
- ], e.prototype, "status");
188
- H(w, e);
187
+ ], c.prototype, "status");
188
+ H(w, c);
189
189
  export {
190
- e as PieCheckbox,
190
+ c as PieCheckbox,
191
191
  i as defaultProps,
192
192
  R as statusTypes
193
193
  };
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.13.6",
4
+ "version": "0.13.8",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
7
7
  "module": "dist/index.js",
@@ -37,11 +37,11 @@
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.13.1",
40
+ "@justeattakeaway/pie-css": "0.14.1",
41
41
  "cem-plugin-module-file-extensions": "0.0.5"
42
42
  },
43
43
  "dependencies": {
44
- "@justeattakeaway/pie-assistive-text": "0.8.0",
44
+ "@justeattakeaway/pie-assistive-text": "0.8.2",
45
45
  "@justeattakeaway/pie-webc-core": "0.24.2"
46
46
  },
47
47
  "volta": {
package/src/index.ts CHANGED
@@ -200,9 +200,9 @@ export class PieCheckbox extends FormControlMixin(RtlMixin(LitElement)) implemen
200
200
  aria-invalid=${status === 'error' ? 'true' : 'false'}
201
201
  aria-describedby=${ifDefined(assistiveText ? assistiveTextId : undefined)}
202
202
  @change=${this._handleChange}
203
- data-test-id="checkbox-input"
203
+ data-test-id="pie-checkbox-input"
204
204
  />
205
- <label for="inputId" data-test-id="checkbox-component">
205
+ <label for="inputId" data-test-id="pie-checkbox-label">
206
206
  <span
207
207
  class="${classMap(labelClasses)}"></span>
208
208
  <span class="c-checkbox-text">