@justeattakeaway/pie-checkbox-group 0.6.3 → 0.7.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/dist/index.js CHANGED
@@ -1,28 +1,26 @@
1
- import { LitElement as x, html as n, unsafeCSS as g } from "lit";
2
- import { state as k, property as l, queryAssignedElements as u } from "lit/decorators.js";
3
- import { FormControlMixin as v, RtlMixin as m, validPropertyValues as y, defineCustomElement as G } from "@justeattakeaway/pie-webc-core";
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 _ } from "lit/directives/class-map.js";
5
+ import { classMap as C } from "lit/directives/class-map.js";
6
6
  import "@justeattakeaway/pie-assistive-text";
7
- const C = `*,*: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)}
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 $ = Object.defineProperty, T = Object.getOwnPropertyDescriptor, a = (d, e, t, i) => {
14
- for (var o = i > 1 ? void 0 : i ? T(e, t) : e, c = d.length - 1, r; c >= 0; c--)
15
- (r = d[c]) && (o = (i ? r(e, t, o) : r(o)) || o);
16
- return i && o && $(e, t, o), o;
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 f = "pie-checkbox-group", h = "assistive-text";
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(S, {
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(O, { bubbles: !1, composed: !1, detail: { error: !0 } })));
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: i,
59
+ assistiveText: l,
62
60
  status: o,
63
- disabled: c
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=${c}
72
- aria-describedby="${b(i ? h : void 0)}"
69
+ ?disabled=${a}
70
+ aria-describedby="${b(l ? u : void 0)}"
73
71
  data-test-id="pie-checkbox-group"
74
- class="${_(r)}"
72
+ class="${C(r)}"
75
73
  >
76
74
  ${this.renderWrappedLabel()}
77
75
  <slot></slot>
78
76
  </fieldset>
79
- ${i && n`
77
+ ${l && n`
80
78
  <pie-assistive-text
81
- id="${h}"
79
+ id="${u}"
82
80
  variant=${o}
83
81
  class="c-checkboxGroup-assistiveText"
84
82
  data-test-id="pie-checkbox-group-assistive-text">
85
- ${i}
83
+ ${l}
86
84
  </pie-assistive-text>`}
87
85
  `;
88
86
  }
89
- }
90
- s.styles = g(C);
91
- a([
92
- k()
93
- ], s.prototype, "hasLabel", 2);
94
- a([
95
- l({ type: String })
96
- ], s.prototype, "name", 2);
97
- a([
98
- l({ type: String })
99
- ], s.prototype, "assistiveText", 2);
100
- a([
101
- l({ type: Boolean })
102
- ], s.prototype, "isInline", 2);
103
- a([
104
- l({ type: String }),
105
- y(f, E, p.status)
106
- ], s.prototype, "status", 2);
107
- a([
108
- l({ type: Boolean, reflect: !0 })
109
- ], s.prototype, "disabled", 2);
110
- a([
111
- u({ selector: "pie-checkbox" })
112
- ], s.prototype, "_slottedChildren", 2);
113
- a([
114
- u({ slot: "label" })
115
- ], s.prototype, "_labelSlot", 2);
116
- G(f, s);
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
- S as ON_CHECKBOX_GROUP_DISABLED,
119
- O as ON_CHECKBOX_GROUP_ERROR,
117
+ $ as ON_CHECKBOX_GROUP_DISABLED,
118
+ T as ON_CHECKBOX_GROUP_ERROR,
120
119
  s as PieCheckboxGroup,
121
120
  p as defaultProps,
122
- E as statusTypes
121
+ S as statusTypes
123
122
  };
package/dist/react.js CHANGED
@@ -1,17 +1,11 @@
1
- import * as o from "react";
2
- import { createComponent as e } from "@lit/react";
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 k, ON_CHECKBOX_GROUP_ERROR as P, defaultProps as G, statusTypes as n } from "./index.js";
5
- import "lit";
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: o,
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
- }), u = p;
16
+ }), i = p;
23
17
  export {
24
- k as ON_CHECKBOX_GROUP_DISABLED,
25
- P as ON_CHECKBOX_GROUP_ERROR,
26
- u as PieCheckboxGroup,
27
- G as defaultProps,
28
- n as statusTypes
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.6.3",
4
+ "version": "0.7.1",
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.12.1",
40
+ "@justeattakeaway/pie-css": "0.13.0",
41
41
  "cem-plugin-module-file-extensions": "0.0.5"
42
42
  },
43
43
  "dependencies": {
44
- "@justeattakeaway/pie-assistive-text": "0.7.1",
45
- "@justeattakeaway/pie-webc-core": "0.24.0"
44
+ "@justeattakeaway/pie-assistive-text": "0.7.2",
45
+ "@justeattakeaway/pie-webc-core": "0.24.1"
46
46
  },
47
47
  "volta": {
48
48
  "extends": "../../../package.json"