@justeattakeaway/pie-assistive-text 0.7.0 → 0.7.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 +32 -33
- package/dist/react.js +11 -17
- package/package.json +5 -5
package/dist/index.js
CHANGED
|
@@ -1,63 +1,62 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { property as
|
|
3
|
-
import { validPropertyValues as
|
|
4
|
-
import { classMap as
|
|
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";
|
|
5
5
|
import "@justeattakeaway/pie-icons-webc/dist/IconAlertCircle.js";
|
|
6
6
|
import "@justeattakeaway/pie-icons-webc/dist/IconCheckCircle.js";
|
|
7
|
-
const
|
|
8
|
-
`, b = ["default", "error", "success"], l = {
|
|
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 = {
|
|
9
8
|
variant: "default",
|
|
10
9
|
isVisuallyHidden: !1
|
|
11
10
|
};
|
|
12
|
-
var T = Object.defineProperty,
|
|
13
|
-
for (var
|
|
14
|
-
(
|
|
15
|
-
return
|
|
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;
|
|
16
15
|
};
|
|
17
|
-
const
|
|
18
|
-
class a extends u {
|
|
16
|
+
const u = "pie-assistive-text", n = class n extends x {
|
|
19
17
|
constructor() {
|
|
20
|
-
super(...arguments), this.variant =
|
|
18
|
+
super(...arguments), this.variant = o.variant, this.isVisuallyHidden = o.isVisuallyHidden;
|
|
21
19
|
}
|
|
22
20
|
/**
|
|
23
21
|
* Renders the assistive-text icon content.
|
|
24
22
|
* @private
|
|
25
23
|
*/
|
|
26
24
|
renderIcon() {
|
|
27
|
-
const { variant:
|
|
25
|
+
const { variant: t } = this;
|
|
28
26
|
return r`
|
|
29
|
-
${
|
|
30
|
-
${
|
|
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}`;
|
|
31
29
|
}
|
|
32
30
|
render() {
|
|
33
31
|
const {
|
|
34
|
-
variant:
|
|
32
|
+
variant: t,
|
|
35
33
|
isVisuallyHidden: i
|
|
36
|
-
} = this,
|
|
34
|
+
} = this, l = {
|
|
37
35
|
"c-assistiveText": !0,
|
|
38
36
|
"c-assistiveText--isVisuallyHidden": i,
|
|
39
|
-
[`c-assistiveText--${
|
|
37
|
+
[`c-assistiveText--${t}`]: !0
|
|
40
38
|
};
|
|
41
39
|
return r`
|
|
42
40
|
<p
|
|
43
|
-
class="${
|
|
41
|
+
class="${g(l)}"
|
|
44
42
|
data-test-id="pie-assistive-text">
|
|
45
43
|
${this.renderIcon()}
|
|
46
44
|
<slot></slot>
|
|
47
45
|
</p>`;
|
|
48
46
|
}
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
47
|
+
};
|
|
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);
|
|
59
58
|
export {
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
59
|
+
e as PieAssistiveText,
|
|
60
|
+
o as defaultProps,
|
|
61
|
+
w as variants
|
|
63
62
|
};
|
package/dist/react.js
CHANGED
|
@@ -1,22 +1,16 @@
|
|
|
1
|
-
import * as
|
|
2
|
-
import { createComponent as
|
|
3
|
-
import { PieAssistiveText as
|
|
4
|
-
import { defaultProps as
|
|
5
|
-
|
|
6
|
-
import "lit/decorators.js";
|
|
7
|
-
import "@justeattakeaway/pie-webc-core";
|
|
8
|
-
import "lit/directives/class-map.js";
|
|
9
|
-
import "@justeattakeaway/pie-icons-webc/dist/IconAlertCircle.js";
|
|
10
|
-
import "@justeattakeaway/pie-icons-webc/dist/IconCheckCircle.js";
|
|
11
|
-
const s = e({
|
|
1
|
+
import * as e from "react";
|
|
2
|
+
import { createComponent as t } from "@lit/react";
|
|
3
|
+
import { PieAssistiveText as s } from "./index.js";
|
|
4
|
+
import { defaultProps as v, variants as x } from "./index.js";
|
|
5
|
+
const i = t({
|
|
12
6
|
displayName: "PieAssistiveText",
|
|
13
|
-
elementClass:
|
|
14
|
-
react:
|
|
7
|
+
elementClass: s,
|
|
8
|
+
react: e,
|
|
15
9
|
tagName: "pie-assistive-text",
|
|
16
10
|
events: {}
|
|
17
|
-
}),
|
|
11
|
+
}), r = i;
|
|
18
12
|
export {
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
13
|
+
r as PieAssistiveText,
|
|
14
|
+
v as defaultProps,
|
|
15
|
+
x as variants
|
|
22
16
|
};
|
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.7.
|
|
4
|
+
"version": "0.7.2",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
7
7
|
"module": "dist/index.js",
|
|
@@ -36,13 +36,13 @@
|
|
|
36
36
|
"license": "Apache-2.0",
|
|
37
37
|
"devDependencies": {
|
|
38
38
|
"@custom-elements-manifest/analyzer": "0.9.0",
|
|
39
|
-
"@justeattakeaway/pie-components-config": "0.
|
|
40
|
-
"@justeattakeaway/pie-css": "0.
|
|
39
|
+
"@justeattakeaway/pie-components-config": "0.18.0",
|
|
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-icons-webc": "0.25.
|
|
45
|
-
"@justeattakeaway/pie-webc-core": "0.24.
|
|
44
|
+
"@justeattakeaway/pie-icons-webc": "0.25.2",
|
|
45
|
+
"@justeattakeaway/pie-webc-core": "0.24.1"
|
|
46
46
|
},
|
|
47
47
|
"volta": {
|
|
48
48
|
"extends": "../../../package.json"
|