@justeattakeaway/pie-link 0.15.2 → 0.15.4
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 +19 -19
- package/package.json +3 -3
package/dist/index.js
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import { unsafeCSS as
|
|
1
|
+
import { unsafeCSS as f, LitElement as v, html as d, nothing as s } from "lit";
|
|
2
2
|
import { property as i } from "lit/decorators.js";
|
|
3
3
|
import { validPropertyValues as a, defineCustomElement as k } from "@justeattakeaway/pie-webc-core";
|
|
4
|
-
const g =
|
|
4
|
+
const g = `*,*:after,*:before{box-sizing:inherit}.c-link{--link-font-family: var(--dt-font-interactive-m-family);--link-font-size: calc(var(--dt-font-size-16) * 1px);--link-line-height: calc(var(--dt-font-size-16-line-height) * 1px);--link-font-weight: var(--dt-font-weight-regular);--link-text-color: var(--dt-color-content-link);--link-text-decoration: var(--dt-font-style-underline);--link-icon-size: 16px;--link-icon-offset-top: var(--dt-spacing-a);display:inline-block;font-family:var(--link-font-family);font-size:var(--link-font-size);line-height:var(--link-line-height);font-weight:var(--link-font-weight);color:var(--link-text-color);text-decoration:var(--link-text-decoration);cursor:pointer}.c-link:hover,.c-link:active{--link-text-decoration: none}.c-link[tag=button]{outline:none;border:none;-webkit-user-select:none;user-select:none;background:transparent;padding:0}.c-link[variant=high-visibility]{--link-text-color: var(--dt-color-content-link-distinct)}.c-link[variant=inverse]{--link-text-color: var(--dt-color-content-link-inverse)}.c-link[size=small]{--link-font-size: calc(var(--dt-font-size-14) * 1px);--link-line-height: calc(var(--dt-font-size-14-line-height) * 1px);--link-icon-offset-top: 2px}.c-link[underline=reversed][isStandalone]{--link-text-decoration: none}.c-link[underline=reversed][isStandalone]:hover,.c-link[underline=reversed][isStandalone]:active{--link-text-decoration: var(--dt-font-style-underline)}.c-link[isBold]{--link-font-weight: var(--dt-font-weight-bold)}.c-link[isStandalone]{display:block;width:fit-content}.c-link[hasVisited]:visited{color:var(--dt-color-content-link-visited)}.c-link[hasVisited]:visited[variant=inverse]{color:var(--dt-color-content-link-visited-inverse)}.c-link:focus-visible{outline:none;border-radius:2px;box-shadow:0 0 0 2px var(--dt-color-focus-inner),0 0 0 4px var(--dt-color-focus-outer)}.c-link-content{display:flex;gap:var(--dt-spacing-a)}::slotted(.c-pieIcon),::slotted(svg){display:inline-flex;margin-block-start:var(--link-icon-offset-top);height:var(--link-icon-size);width:var(--link-icon-size)}
|
|
5
5
|
`, y = ["default", "high-visibility", "inverse"], m = ["small", "medium"], b = ["leading", "trailing"], x = ["a", "button"], $ = ["submit", "button", "reset", "menu"], S = ["default", "reversed"];
|
|
6
|
-
var z = Object.defineProperty, B = Object.getOwnPropertyDescriptor, n = (p, e,
|
|
7
|
-
for (var o = c > 1 ? void 0 : c ? B(e,
|
|
8
|
-
(u = p[h]) && (o = (c ? u(e,
|
|
9
|
-
return c && o && z(e,
|
|
6
|
+
var z = Object.defineProperty, B = Object.getOwnPropertyDescriptor, n = (p, e, l, c) => {
|
|
7
|
+
for (var o = c > 1 ? void 0 : c ? B(e, l) : e, h = p.length - 1, u; h >= 0; h--)
|
|
8
|
+
(u = p[h]) && (o = (c ? u(e, l, o) : u(o)) || o);
|
|
9
|
+
return c && o && z(e, l, o), o;
|
|
10
10
|
};
|
|
11
|
-
const
|
|
12
|
-
class t extends
|
|
11
|
+
const r = "pie-link";
|
|
12
|
+
class t extends v {
|
|
13
13
|
constructor() {
|
|
14
14
|
super(...arguments), this.tag = "a", this.variant = "default", this.size = "medium", this.underline = "default", this.iconPlacement = "leading", this.isBold = !1, this.isStandalone = !1, this.hasVisited = !1, this.type = "submit";
|
|
15
15
|
}
|
|
@@ -19,12 +19,12 @@ class t extends f {
|
|
|
19
19
|
* @private
|
|
20
20
|
*/
|
|
21
21
|
renderContent() {
|
|
22
|
-
const { iconPlacement: e, isStandalone:
|
|
22
|
+
const { iconPlacement: e, isStandalone: l } = this;
|
|
23
23
|
return d`
|
|
24
24
|
<span class="c-link-content">
|
|
25
|
-
${
|
|
25
|
+
${l && e === "leading" ? d`<slot name="icon"></slot>` : s}
|
|
26
26
|
<slot></slot>
|
|
27
|
-
${
|
|
27
|
+
${l && e === "trailing" ? d`<slot name="icon"></slot>` : s}
|
|
28
28
|
</span>`;
|
|
29
29
|
}
|
|
30
30
|
/**
|
|
@@ -79,26 +79,26 @@ class t extends f {
|
|
|
79
79
|
return this.tag === "button" ? this.renderButton() : this.renderAnchor();
|
|
80
80
|
}
|
|
81
81
|
}
|
|
82
|
-
t.styles =
|
|
82
|
+
t.styles = f(g);
|
|
83
83
|
n([
|
|
84
84
|
i(),
|
|
85
|
-
a(
|
|
85
|
+
a(r, x, "a")
|
|
86
86
|
], t.prototype, "tag", 2);
|
|
87
87
|
n([
|
|
88
88
|
i({ type: String }),
|
|
89
|
-
a(
|
|
89
|
+
a(r, y, "default")
|
|
90
90
|
], t.prototype, "variant", 2);
|
|
91
91
|
n([
|
|
92
92
|
i({ type: String }),
|
|
93
|
-
a(
|
|
93
|
+
a(r, m, "medium")
|
|
94
94
|
], t.prototype, "size", 2);
|
|
95
95
|
n([
|
|
96
96
|
i({ type: String }),
|
|
97
|
-
a(
|
|
97
|
+
a(r, S, "default")
|
|
98
98
|
], t.prototype, "underline", 2);
|
|
99
99
|
n([
|
|
100
100
|
i({ type: String }),
|
|
101
|
-
a(
|
|
101
|
+
a(r, b, "leading")
|
|
102
102
|
], t.prototype, "iconPlacement", 2);
|
|
103
103
|
n([
|
|
104
104
|
i({ type: String, reflect: !0 })
|
|
@@ -120,12 +120,12 @@ n([
|
|
|
120
120
|
], t.prototype, "hasVisited", 2);
|
|
121
121
|
n([
|
|
122
122
|
i(),
|
|
123
|
-
a(
|
|
123
|
+
a(r, $, "submit")
|
|
124
124
|
], t.prototype, "type", 2);
|
|
125
125
|
n([
|
|
126
126
|
i({ type: Object })
|
|
127
127
|
], t.prototype, "aria", 2);
|
|
128
|
-
k(
|
|
128
|
+
k(r, t);
|
|
129
129
|
export {
|
|
130
130
|
t as PieLink,
|
|
131
131
|
$ as buttonTypes,
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@justeattakeaway/pie-link",
|
|
3
3
|
"description": "PIE Design System Link built using Web Components",
|
|
4
|
-
"version": "0.15.
|
|
4
|
+
"version": "0.15.4",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
7
7
|
"module": "dist/index.js",
|
|
@@ -33,12 +33,12 @@
|
|
|
33
33
|
"devDependencies": {
|
|
34
34
|
"@custom-elements-manifest/analyzer": "0.9.0",
|
|
35
35
|
"@justeattakeaway/pie-components-config": "0.11.0",
|
|
36
|
-
"@justeattakeaway/pie-icons-webc": "0.
|
|
36
|
+
"@justeattakeaway/pie-icons-webc": "0.19.1",
|
|
37
37
|
"@justeattakeaway/pie-wrapper-react": "0.14.0",
|
|
38
38
|
"cem-plugin-module-file-extensions": "0.0.5"
|
|
39
39
|
},
|
|
40
40
|
"dependencies": {
|
|
41
|
-
"@justeattakeaway/pie-webc-core": "0.
|
|
41
|
+
"@justeattakeaway/pie-webc-core": "0.19.1"
|
|
42
42
|
},
|
|
43
43
|
"volta": {
|
|
44
44
|
"extends": "../../../package.json"
|