@justeattakeaway/pie-assistive-text 0.8.4 → 0.9.0

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.
@@ -98,8 +98,8 @@
98
98
  }
99
99
  ],
100
100
  "superclass": {
101
- "name": "LitElement",
102
- "package": "lit"
101
+ "name": "PieElement",
102
+ "package": "@justeattakeaway/pie-webc-core/src/internals/PieElement"
103
103
  },
104
104
  "tagName": "pie-assistive-text",
105
105
  "customElement": true
package/dist/index.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import { ComponentDefaultProps } from '@justeattakeaway/pie-webc-core';
2
2
  import type { CSSResult } from 'lit';
3
- import type { LitElement } from 'lit';
3
+ import { PieElement } from '@justeattakeaway/pie-webc-core/src/internals/PieElement';
4
4
  import type { TemplateResult } from 'lit';
5
5
 
6
6
  export declare interface AssistiveTextProps {
@@ -22,7 +22,7 @@ export declare const defaultProps: DefaultProps;
22
22
  * @tagname pie-assistive-text
23
23
  * @slot - Default slot
24
24
  */
25
- export declare class PieAssistiveText extends LitElement implements AssistiveTextProps {
25
+ export declare class PieAssistiveText extends PieElement implements AssistiveTextProps {
26
26
  variant: "default" | "error" | "success";
27
27
  isVisuallyHidden: boolean;
28
28
  /**
package/dist/index.js CHANGED
@@ -1,62 +1,75 @@
1
- import { LitElement as x, html as r, nothing as p, unsafeCSS as y } from "lit";
2
- import { property as v } from "lit/decorators.js";
3
- import { validPropertyValues as h, defineCustomElement as m } from "@justeattakeaway/pie-webc-core";
4
- import { classMap as g } from "lit/directives/class-map.js";
1
+ import { LitElement as y, html as n, nothing as v, unsafeCSS as h } from "lit";
2
+ import { property as d } from "lit/decorators.js";
3
+ import { validPropertyValues as m, defineCustomElement as g } from "@justeattakeaway/pie-webc-core";
4
+ import { classMap as b } from "lit/directives/class-map.js";
5
5
  import "@justeattakeaway/pie-icons-webc/dist/IconAlertCircle.js";
6
6
  import "@justeattakeaway/pie-icons-webc/dist/IconCheckCircle.js";
7
- const b = "*,*:after,*:before{box-sizing:inherit}.c-assistiveText{--assistive-text-color: var(--dt-color-content-subdued);margin:0;padding-block-start:var(--dt-spacing-a);color:var(--assistive-text-color);font-family:var(--dt-font-body-s-family);font-weight:var(--dt-font-body-s-weight);font-size:calc(var(--dt-font-body-s-size) * 1px);line-height:calc(var(--dt-font-body-s-line-height) * 1px);gap:var(--dt-spacing-b);display:flex;align-items:flex-start;overflow-wrap:anywhere}.c-assistiveText .c-assistiveText-icon{display:inline-flex}.c-assistiveText--success{--assistive-text-color: var(--dt-color-content-positive)}.c-assistiveText--error{--assistive-text-color: var(--dt-color-content-error)}.c-assistiveText--isVisuallyHidden{position:absolute;display:block;height:1px;width:1px;overflow:hidden;padding:1px;white-space:nowrap}", w = ["default", "error", "success"], o = {
7
+ var w = Object.defineProperty, T = (r, e, s, c) => {
8
+ for (var t = void 0, i = r.length - 1, a; i >= 0; i--)
9
+ (a = r[i]) && (t = a(e, s, t) || t);
10
+ return t && w(e, s, t), t;
11
+ };
12
+ class f extends y {
13
+ constructor() {
14
+ super(...arguments), this.v = "0.9.0";
15
+ }
16
+ }
17
+ T([
18
+ d({ type: String, reflect: !0 })
19
+ ], f.prototype, "v");
20
+ const V = "*,*:after,*:before{box-sizing:inherit}.c-assistiveText{--assistive-text-color: var(--dt-color-content-subdued);margin:0;padding-block-start:var(--dt-spacing-a);color:var(--assistive-text-color);font-family:var(--dt-font-body-s-family);font-weight:var(--dt-font-body-s-weight);font-size:calc(var(--dt-font-body-s-size) * 1px);line-height:calc(var(--dt-font-body-s-line-height) * 1px);gap:var(--dt-spacing-b);display:flex;align-items:flex-start;overflow-wrap:anywhere}.c-assistiveText .c-assistiveText-icon{display:inline-flex}.c-assistiveText--success{--assistive-text-color: var(--dt-color-content-positive)}.c-assistiveText--error{--assistive-text-color: var(--dt-color-content-error)}.c-assistiveText--isVisuallyHidden{position:absolute;display:block;height:1px;width:1px;overflow:hidden;padding:1px;white-space:nowrap}", H = ["default", "error", "success"], l = {
8
21
  variant: "default",
9
22
  isVisuallyHidden: !1
10
23
  };
11
- var T = Object.defineProperty, f = (c, t, i, l) => {
12
- for (var s = void 0, a = c.length - 1, d; a >= 0; a--)
13
- (d = c[a]) && (s = d(t, i, s) || s);
14
- return s && T(t, i, s), s;
24
+ var _ = Object.defineProperty, u = (r, e, s, c) => {
25
+ for (var t = void 0, i = r.length - 1, a; i >= 0; i--)
26
+ (a = r[i]) && (t = a(e, s, t) || t);
27
+ return t && _(e, s, t), t;
15
28
  };
16
- const u = "pie-assistive-text", n = class n extends x {
29
+ const x = "pie-assistive-text", p = class p extends f {
17
30
  constructor() {
18
- super(...arguments), this.variant = o.variant, this.isVisuallyHidden = o.isVisuallyHidden;
31
+ super(...arguments), this.variant = l.variant, this.isVisuallyHidden = l.isVisuallyHidden;
19
32
  }
20
33
  /**
21
34
  * Renders the assistive-text icon content.
22
35
  * @private
23
36
  */
24
37
  renderIcon() {
25
- const { variant: t } = this;
26
- return r`
27
- ${t === "success" ? r`<icon-check-circle class="c-assistiveText-icon" size="s" ></icon-check-circle>` : p}
28
- ${t === "error" ? r`<icon-alert-circle class="c-assistiveText-icon" size="s"></icon-alert-circle>` : p}`;
38
+ const { variant: e } = this;
39
+ return n`
40
+ ${e === "success" ? n`<icon-check-circle class="c-assistiveText-icon" size="s" ></icon-check-circle>` : v}
41
+ ${e === "error" ? n`<icon-alert-circle class="c-assistiveText-icon" size="s"></icon-alert-circle>` : v}`;
29
42
  }
30
43
  render() {
31
44
  const {
32
- variant: t,
33
- isVisuallyHidden: i
34
- } = this, l = {
45
+ variant: e,
46
+ isVisuallyHidden: s
47
+ } = this, c = {
35
48
  "c-assistiveText": !0,
36
- "c-assistiveText--isVisuallyHidden": i,
37
- [`c-assistiveText--${t}`]: !0
49
+ "c-assistiveText--isVisuallyHidden": s,
50
+ [`c-assistiveText--${e}`]: !0
38
51
  };
39
- return r`
52
+ return n`
40
53
  <p
41
- class="${g(l)}"
54
+ class="${b(c)}"
42
55
  data-test-id="pie-assistive-text">
43
56
  ${this.renderIcon()}
44
57
  <slot></slot>
45
58
  </p>`;
46
59
  }
47
60
  };
48
- n.styles = y(b);
49
- let e = n;
50
- f([
51
- v({ type: String }),
52
- h(u, w, o.variant)
53
- ], e.prototype, "variant");
54
- f([
55
- v({ type: Boolean })
56
- ], e.prototype, "isVisuallyHidden");
57
- m(u, e);
61
+ p.styles = h(V);
62
+ let o = p;
63
+ u([
64
+ d({ type: String }),
65
+ m(x, H, l.variant)
66
+ ], o.prototype, "variant");
67
+ u([
68
+ d({ type: Boolean })
69
+ ], o.prototype, "isVisuallyHidden");
70
+ g(x, o);
58
71
  export {
59
- e as PieAssistiveText,
60
- o as defaultProps,
61
- w as variants
72
+ o as PieAssistiveText,
73
+ l as defaultProps,
74
+ H as variants
62
75
  };
package/dist/react.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import { ComponentDefaultProps } from '@justeattakeaway/pie-webc-core';
2
2
  import type { CSSResult } from 'lit';
3
- import type { LitElement } from 'lit';
3
+ import { PieElement } from '@justeattakeaway/pie-webc-core/src/internals/PieElement';
4
4
  import * as React_2 from 'react';
5
5
  import type { TemplateResult } from 'lit';
6
6
 
@@ -25,7 +25,7 @@ export declare const PieAssistiveText: React_2.ForwardRefExoticComponent<Assisti
25
25
  * @tagname pie-assistive-text
26
26
  * @slot - Default slot
27
27
  */
28
- declare class PieAssistiveText_2 extends LitElement implements AssistiveTextProps {
28
+ declare class PieAssistiveText_2 extends PieElement implements AssistiveTextProps {
29
29
  variant: "default" | "error" | "success";
30
30
  isVisuallyHidden: boolean;
31
31
  /**
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@justeattakeaway/pie-assistive-text",
3
3
  "description": "PIE Design System Assistive Text built using Web Components",
4
- "version": "0.8.4",
4
+ "version": "0.9.0",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
7
7
  "module": "dist/index.js",
@@ -33,13 +33,14 @@
33
33
  "license": "Apache-2.0",
34
34
  "devDependencies": {
35
35
  "@custom-elements-manifest/analyzer": "0.9.0",
36
- "@justeattakeaway/pie-components-config": "0.18.0",
37
- "@justeattakeaway/pie-css": "0.14.1",
36
+ "@justeattakeaway/pie-components-config": "0.19.0",
37
+ "@justeattakeaway/pie-css": "0.16.0",
38
+ "@justeattakeaway/pie-monorepo-utils": "0.5.0",
38
39
  "cem-plugin-module-file-extensions": "0.0.5"
39
40
  },
40
41
  "dependencies": {
41
- "@justeattakeaway/pie-icons-webc": "1.5.0",
42
- "@justeattakeaway/pie-webc-core": "0.24.2"
42
+ "@justeattakeaway/pie-icons-webc": "1.6.1",
43
+ "@justeattakeaway/pie-webc-core": "0.25.0"
43
44
  },
44
45
  "volta": {
45
46
  "extends": "../../../package.json"
package/src/index.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  import {
2
- LitElement, html, unsafeCSS, nothing, type TemplateResult,
2
+ html, unsafeCSS, nothing, type TemplateResult,
3
3
  } from 'lit';
4
-
4
+ import { PieElement } from '@justeattakeaway/pie-webc-core/src/internals/PieElement';
5
5
  import { property } from 'lit/decorators.js';
6
6
  import { validPropertyValues, defineCustomElement } from '@justeattakeaway/pie-webc-core';
7
7
  import { classMap } from 'lit/directives/class-map.js';
@@ -20,7 +20,7 @@ const componentSelector = 'pie-assistive-text';
20
20
  * @tagname pie-assistive-text
21
21
  * @slot - Default slot
22
22
  */
23
- export class PieAssistiveText extends LitElement implements AssistiveTextProps {
23
+ export class PieAssistiveText extends PieElement implements AssistiveTextProps {
24
24
  @property({ type: String })
25
25
  @validPropertyValues(componentSelector, variants, defaultProps.variant)
26
26
  public variant = defaultProps.variant;