@justeattakeaway/pie-form-label 0.14.1 → 0.14.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 CHANGED
@@ -1,25 +1,22 @@
1
- import { LitElement as d, html as c, nothing as a, unsafeCSS as g } from "lit";
1
+ import { LitElement as d, html as l, nothing as i, unsafeCSS as g } from "lit";
2
2
  import { ifDefined as m } from "lit/directives/if-defined.js";
3
3
  import { RtlMixin as b, defineCustomElement as h } from "@justeattakeaway/pie-webc-core";
4
- import { property as f } from "lit/decorators.js";
5
- const u = `*,*:after,*:before{box-sizing:inherit}.c-formLabel{--form-label-font-size: calc(var(--dt-font-size-14) * 1px);--form-label-line-height: calc(var(--dt-font-size-14-line-height) * 1px);--form-label-font-weight: var(--dt-font-weight-bold);--form-label-color: var(--dt-color-content-default);display:flex;justify-content:space-between;align-items:flex-end;gap:var(--dt-spacing-d);color:var(--form-label-color);font-size:var(--form-label-font-size);line-height:var(--form-label-line-height);font-weight:var(--form-label-font-weight);margin-block-end:var(--dt-spacing-a)}.c-formLabel-optional,.c-formLabel-trailing{color:var(--dt-color-content-subdued);font-weight:var(--dt-font-weight-regular)}.c-formLabel-leading{margin-inline-end:var(--dt-spacing-b)}.c-formLabel-trailing{flex-shrink:0;white-space:var(--dt-spacing-d)}
6
- `;
7
- var v = Object.defineProperty, L = Object.getOwnPropertyDescriptor, p = (i, e, t, l) => {
8
- for (var r = l > 1 ? void 0 : l ? L(e, t) : e, n = i.length - 1, s; n >= 0; n--)
9
- (s = i[n]) && (r = (l ? s(e, t, r) : s(r)) || r);
10
- return l && r && v(e, t, r), r;
4
+ import { property as n } from "lit/decorators.js";
5
+ const u = "*,*:after,*:before{box-sizing:inherit}.c-formLabel{--form-label-font-size: calc(var(--dt-font-size-14) * 1px);--form-label-line-height: calc(var(--dt-font-size-14-line-height) * 1px);--form-label-font-weight: var(--dt-font-weight-bold);--form-label-color: var(--dt-color-content-default);display:flex;justify-content:space-between;align-items:flex-end;gap:var(--dt-spacing-d);color:var(--form-label-color);font-size:var(--form-label-font-size);line-height:var(--form-label-line-height);font-weight:var(--form-label-font-weight);margin-block-end:var(--dt-spacing-a)}.c-formLabel-optional,.c-formLabel-trailing{color:var(--dt-color-content-subdued);font-weight:var(--dt-font-weight-regular)}.c-formLabel-leading{margin-inline-end:var(--dt-spacing-b)}.c-formLabel-trailing{flex-shrink:0;white-space:var(--dt-spacing-d)}";
6
+ var v = Object.defineProperty, s = (f, e, t, L) => {
7
+ for (var r = void 0, a = f.length - 1, p; a >= 0; a--)
8
+ (p = f[a]) && (r = p(e, t, r) || r);
9
+ return r && v(e, t, r), r;
11
10
  };
12
- const y = "pie-form-label";
13
- class o extends b(d) {
11
+ const y = "pie-form-label", c = class c extends b(d) {
14
12
  _renderOptionalLabel() {
15
13
  const { optional: e } = this;
16
- return e ? c`<span class="c-formLabel-optional">${e}</span>` : a;
14
+ return e ? l`<span class="c-formLabel-optional">${e}</span>` : i;
17
15
  }
18
16
  handleClick() {
19
17
  if (this.for) {
20
18
  const e = document.querySelector(`#${this.for}`);
21
- if (!(e && e.focusTarget && "focus" in e.focusTarget && "click" in e.focusTarget))
22
- return;
19
+ if (!(e && e.focusTarget && "focus" in e.focusTarget && "click" in e.focusTarget)) return;
23
20
  e.focusTarget.focus(), e.focusTarget.click();
24
21
  }
25
22
  }
@@ -28,31 +25,32 @@ class o extends b(d) {
28
25
  trailing: e,
29
26
  isRTL: t
30
27
  } = this;
31
- return c`
28
+ return l`
32
29
  <label
33
30
  @click=${this.handleClick}
34
31
  data-test-id="pie-form-label"
35
32
  class="c-formLabel"
36
33
  for=${m(this.for)}>
37
34
  <div>
38
- ${t ? this._renderOptionalLabel() : a}
35
+ ${t ? this._renderOptionalLabel() : i}
39
36
  <span class="c-formLabel-leading" data-test-id="pie-form-label-leading"><slot></slot></span>
40
- ${t ? a : this._renderOptionalLabel()}
37
+ ${t ? i : this._renderOptionalLabel()}
41
38
  </div>
42
- ${e ? c`<span class="c-formLabel-trailing" data-test-id="pie-form-label-trailing">${e}</span>` : a}
39
+ ${e ? l`<span class="c-formLabel-trailing" data-test-id="pie-form-label-trailing">${e}</span>` : i}
43
40
  </label>`;
44
41
  }
45
- }
46
- o.styles = g(u);
47
- p([
48
- f({ type: String, reflect: !0 })
49
- ], o.prototype, "for", 2);
50
- p([
51
- f({ type: String })
52
- ], o.prototype, "optional", 2);
53
- p([
54
- f({ type: String })
55
- ], o.prototype, "trailing", 2);
42
+ };
43
+ c.styles = g(u);
44
+ let o = c;
45
+ s([
46
+ n({ type: String, reflect: !0 })
47
+ ], o.prototype, "for");
48
+ s([
49
+ n({ type: String })
50
+ ], o.prototype, "optional");
51
+ s([
52
+ n({ type: String })
53
+ ], o.prototype, "trailing");
56
54
  h(y, o);
57
55
  export {
58
56
  o as PieFormLabel
package/dist/react.js CHANGED
@@ -1,17 +1,13 @@
1
1
  import * as e from "react";
2
- import { createComponent as o } from "@lit/react";
3
- import { PieFormLabel as m } from "./index.js";
4
- import "lit";
5
- import "lit/directives/if-defined.js";
6
- import "@justeattakeaway/pie-webc-core";
7
- import "lit/decorators.js";
8
- const r = o({
2
+ import { createComponent as a } from "@lit/react";
3
+ import { PieFormLabel as o } from "./index.js";
4
+ const m = a({
9
5
  displayName: "PieFormLabel",
10
- elementClass: m,
6
+ elementClass: o,
11
7
  react: e,
12
8
  tagName: "pie-form-label",
13
9
  events: {}
14
- }), b = r;
10
+ }), i = m;
15
11
  export {
16
- b as PieFormLabel
12
+ i as PieFormLabel
17
13
  };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@justeattakeaway/pie-form-label",
3
3
  "description": "PIE Design System Form Label built using Web Components",
4
- "version": "0.14.1",
4
+ "version": "0.14.2",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
7
7
  "module": "dist/index.js",
@@ -36,15 +36,15 @@
36
36
  "license": "Apache-2.0",
37
37
  "devDependencies": {
38
38
  "@custom-elements-manifest/analyzer": "0.9.0",
39
- "@justeattakeaway/pie-components-config": "0.17.0",
40
- "@justeattakeaway/pie-css": "0.12.1",
41
- "@justeattakeaway/pie-switch": "0.29.12",
42
- "@justeattakeaway/pie-text-input": "0.23.3",
39
+ "@justeattakeaway/pie-components-config": "0.18.0",
40
+ "@justeattakeaway/pie-css": "0.13.0",
41
+ "@justeattakeaway/pie-switch": "0.30.2",
42
+ "@justeattakeaway/pie-text-input": "0.24.1",
43
43
  "@justeattakeaway/pie-wrapper-react": "0.14.1",
44
44
  "cem-plugin-module-file-extensions": "0.0.5"
45
45
  },
46
46
  "dependencies": {
47
- "@justeattakeaway/pie-webc-core": "0.24.0"
47
+ "@justeattakeaway/pie-webc-core": "0.24.1"
48
48
  },
49
49
  "volta": {
50
50
  "extends": "../../../package.json"