@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.
- package/custom-elements.json +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +48 -35
- package/dist/react.d.ts +2 -2
- package/package.json +6 -5
- package/src/index.ts +3 -3
package/custom-elements.json
CHANGED
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
|
|
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
|
|
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
|
|
2
|
-
import { property as
|
|
3
|
-
import { validPropertyValues as
|
|
4
|
-
import { classMap as
|
|
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
|
-
|
|
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
|
|
12
|
-
for (var
|
|
13
|
-
(
|
|
14
|
-
return
|
|
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
|
|
29
|
+
const x = "pie-assistive-text", p = class p extends f {
|
|
17
30
|
constructor() {
|
|
18
|
-
super(...arguments), this.variant =
|
|
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:
|
|
26
|
-
return
|
|
27
|
-
${
|
|
28
|
-
${
|
|
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:
|
|
33
|
-
isVisuallyHidden:
|
|
34
|
-
} = this,
|
|
45
|
+
variant: e,
|
|
46
|
+
isVisuallyHidden: s
|
|
47
|
+
} = this, c = {
|
|
35
48
|
"c-assistiveText": !0,
|
|
36
|
-
"c-assistiveText--isVisuallyHidden":
|
|
37
|
-
[`c-assistiveText--${
|
|
49
|
+
"c-assistiveText--isVisuallyHidden": s,
|
|
50
|
+
[`c-assistiveText--${e}`]: !0
|
|
38
51
|
};
|
|
39
|
-
return
|
|
52
|
+
return n`
|
|
40
53
|
<p
|
|
41
|
-
class="${
|
|
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
|
-
|
|
49
|
-
let
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
],
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
],
|
|
57
|
-
|
|
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
|
-
|
|
60
|
-
|
|
61
|
-
|
|
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
|
|
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
|
|
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.
|
|
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.
|
|
37
|
-
"@justeattakeaway/pie-css": "0.
|
|
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.
|
|
42
|
-
"@justeattakeaway/pie-webc-core": "0.
|
|
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
|
-
|
|
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
|
|
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;
|