@justeattakeaway/pie-link 1.3.3 → 1.3.5

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,16 +1,16 @@
1
- import { LitElement as b, unsafeCSS as m, nothing as y, html as d } from "lit";
1
+ import { LitElement as b, unsafeCSS as m, nothing as g, html as d } from "lit";
2
2
  import { property as i } from "lit/decorators.js";
3
- import { classMap as g } from "lit/directives/class-map.js";
3
+ import { classMap as u } from "lit/directives/class-map.js";
4
4
  import { ifDefined as s } from "lit/directives/if-defined.js";
5
5
  import { validPropertyValues as a, safeCustomElement as x } from "@justeattakeaway/pie-webc-core";
6
- const h = class h extends b {
6
+ const k = class k extends b {
7
7
  willUpdate() {
8
- this.getAttribute("v") || this.setAttribute("v", h.v);
8
+ this.getAttribute("v") || this.setAttribute("v", k.v);
9
9
  }
10
10
  };
11
- h.v = "1.3.3";
12
- let u = h;
13
- const z = "*,*:after,*:before{box-sizing:inherit}:host{display:inline-block;--link-font-weight: var(--dt-font-weight-regular);--link-text-color: var(--dt-color-content-link);--link-text-decoration: var(--dt-font-style-underline)}:host([isstandalone]){display:block}.c-link{--link-font-family: var(--dt-font-interactive-l-family);--link-font-size: calc(var(--dt-font-size-16) * 1px);--link-line-height: calc(var(--dt-font-size-16-line-height) * 1px);--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.c-link--high-visibility{--link-text-color: var(--dt-color-content-link-distinct)}.c-link.c-link--inverse{--link-text-color: var(--dt-color-content-link-inverse)}.c-link.c-link--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.c-link--underline-reversed.c-link--standalone{--link-text-decoration: none}.c-link.c-link--underline-reversed.c-link--standalone:hover,.c-link.c-link--underline-reversed.c-link--standalone:active{--link-text-decoration: var(--dt-font-style-underline)}.c-link.c-link--bold{--link-font-weight: var(--dt-font-weight-bold)}.c-link.c-link--standalone{display:block;width:fit-content}.c-link.c-link--hasVisited:visited{color:var(--dt-color-content-link-visited)}.c-link.c-link--hasVisited:visited.c-link--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)}button.c-link{outline:none;border:none;-webkit-user-select:none;user-select:none;background:transparent;padding:0}.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)}", S = ["default", "high-visibility", "inverse"], w = ["small", "medium"], $ = ["leading", "trailing"], P = ["a", "button"], B = ["submit", "button", "reset", "menu"], V = ["default", "reversed"], e = {
11
+ k.v = "1.3.5";
12
+ let y = k;
13
+ const z = "*,*:after,*:before{box-sizing:inherit}:host{display:inline-block;--link-font-weight: var(--dt-font-body-l-link-weight);--link-text-color: var(--dt-color-content-link);--link-text-decoration: var(--dt-font-body-l-link-text-decoration)}:host([isstandalone]){display:block}.c-link{--link-font-family: var(--dt-font-interactive-l-family);--link-font-size: calc(var(--dt-font-body-l-link-size) * 1px);--link-line-height: calc(var(--dt-font-body-l-link-line-height) * 1px);--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.c-link--high-visibility{--link-text-color: var(--dt-color-content-link-distinct)}.c-link.c-link--inverse{--link-text-color: var(--dt-color-content-link-inverse)}.c-link.c-link--small{--link-font-size: calc(var(--dt-font-body-s-link-size) * 1px);--link-line-height: calc(var(--dt-font-body-s-link-line-height) * 1px);--link-font-weight: var(--dt-font-body-s-link-weight);--link-text-decoration: var(--dt-font-body-s-link-text-decoration);--link-icon-offset-top: 2px}.c-link.c-link--underline-reversed.c-link--standalone{--link-text-decoration: none}.c-link.c-link--underline-reversed.c-link--standalone:hover,.c-link.c-link--underline-reversed.c-link--standalone:active{--link-text-decoration: var(--dt-font-body-l-link-text-decoration)}.c-link.c-link--bold{--link-font-size: calc(var(--dt-font-body-strong-l-link-size) * 1px);--link-line-height: calc(var(--dt-font-body-strong-l-link-line-height) * 1px);--link-font-weight: var(--dt-font-body-strong-l-link-weight)}.c-link.c-link--bold.c-link--small{--link-font-size: calc(var(--dt-font-body-strong-s-link-size) * 1px);--link-line-height: calc(var(--dt-font-body-strong-s-link-line-height) * 1px);--link-font-weight: var(--dt-font-body-strong-s-link-weight)}.c-link.c-link--standalone{display:block;width:fit-content}.c-link.c-link--hasVisited:visited{color:var(--dt-color-content-link-visited)}.c-link.c-link--hasVisited:visited.c-link--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)}button.c-link{outline:none;border:none;-webkit-user-select:none;user-select:none;background:transparent;padding:0}.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)}", w = ["default", "high-visibility", "inverse"], S = ["small", "medium"], $ = ["leading", "trailing"], P = ["a", "button"], B = ["submit", "button", "reset", "menu"], V = ["default", "reversed"], n = {
14
14
  tag: "a",
15
15
  variant: "default",
16
16
  size: "medium",
@@ -21,15 +21,15 @@ const z = "*,*:after,*:before{box-sizing:inherit}:host{display:inline-block;--li
21
21
  iconPlacement: "leading",
22
22
  type: "submit"
23
23
  };
24
- var C = Object.defineProperty, O = Object.getOwnPropertyDescriptor, n = (l, o, k, p) => {
25
- for (var r = p > 1 ? void 0 : p ? O(o, k) : o, f = l.length - 1, v; f >= 0; f--)
26
- (v = l[f]) && (r = (p ? v(o, k, r) : v(r)) || r);
27
- return p && r && C(o, k, r), r;
24
+ var C = Object.defineProperty, O = Object.getOwnPropertyDescriptor, e = (l, o, h, p) => {
25
+ for (var r = p > 1 ? void 0 : p ? O(o, h) : o, f = l.length - 1, v; f >= 0; f--)
26
+ (v = l[f]) && (r = (p ? v(o, h, r) : v(r)) || r);
27
+ return p && r && C(o, h, r), r;
28
28
  };
29
29
  const c = "pie-link";
30
- let t = class extends u {
30
+ let t = class extends y {
31
31
  constructor() {
32
- super(...arguments), this.tag = e.tag, this.variant = e.variant, this.size = e.size, this.underline = e.underline, this.iconPlacement = e.iconPlacement, this.isBold = e.isBold, this.isStandalone = e.isStandalone, this.hasVisited = e.hasVisited, this.type = e.type;
32
+ super(...arguments), this.tag = n.tag, this.variant = n.variant, this.size = n.size, this.underline = n.underline, this.iconPlacement = n.iconPlacement, this.isBold = n.isBold, this.isStandalone = n.isStandalone, this.hasVisited = n.hasVisited, this.type = n.type;
33
33
  }
34
34
  /**
35
35
  * Renders the link content.
@@ -40,9 +40,9 @@ let t = class extends u {
40
40
  const { iconPlacement: l, isStandalone: o } = this;
41
41
  return d`
42
42
  <span class="c-link-content">
43
- ${o && l === "leading" ? d`<slot name="icon"></slot>` : y}
43
+ ${o && l === "leading" ? d`<slot name="icon"></slot>` : g}
44
44
  <slot></slot>
45
- ${o && l === "trailing" ? d`<slot name="icon"></slot>` : y}
45
+ ${o && l === "trailing" ? d`<slot name="icon"></slot>` : g}
46
46
  </span>`;
47
47
  }
48
48
  /**
@@ -55,7 +55,7 @@ let t = class extends u {
55
55
  return d`
56
56
  <button
57
57
  data-test-id="pie-link-button"
58
- class="${g(l)}"
58
+ class="${u(l)}"
59
59
  type=${this.type}
60
60
  aria-label=${s((o = this.aria) == null ? void 0 : o.label)}
61
61
  part="base">
@@ -72,7 +72,7 @@ let t = class extends u {
72
72
  return d`
73
73
  <a
74
74
  data-test-id="pie-link-anchor"
75
- class="${g(l)}"
75
+ class="${u(l)}"
76
76
  href=${s(this.href)}
77
77
  target=${s(this.target)}
78
78
  rel=${s(this.rel)}
@@ -96,64 +96,64 @@ let t = class extends u {
96
96
  }
97
97
  };
98
98
  t.styles = m(z);
99
- n([
99
+ e([
100
100
  i({ type: String }),
101
- a(c, P, e.tag)
101
+ a(c, P, n.tag)
102
102
  ], t.prototype, "tag", 2);
103
- n([
103
+ e([
104
104
  i({ type: String }),
105
- a(c, S, e.variant)
105
+ a(c, w, n.variant)
106
106
  ], t.prototype, "variant", 2);
107
- n([
107
+ e([
108
108
  i({ type: String }),
109
- a(c, w, e.size)
109
+ a(c, S, n.size)
110
110
  ], t.prototype, "size", 2);
111
- n([
111
+ e([
112
112
  i({ type: String }),
113
- a(c, V, e.underline)
113
+ a(c, V, n.underline)
114
114
  ], t.prototype, "underline", 2);
115
- n([
115
+ e([
116
116
  i({ type: String }),
117
- a(c, $, e.iconPlacement)
117
+ a(c, $, n.iconPlacement)
118
118
  ], t.prototype, "iconPlacement", 2);
119
- n([
119
+ e([
120
120
  i({ type: String, reflect: !0 })
121
121
  ], t.prototype, "href", 2);
122
- n([
122
+ e([
123
123
  i({ type: String, reflect: !0 })
124
124
  ], t.prototype, "target", 2);
125
- n([
125
+ e([
126
126
  i({ type: String, reflect: !0 })
127
127
  ], t.prototype, "rel", 2);
128
- n([
128
+ e([
129
129
  i({ type: String })
130
130
  ], t.prototype, "download", 2);
131
- n([
131
+ e([
132
132
  i({ type: Boolean })
133
133
  ], t.prototype, "isBold", 2);
134
- n([
134
+ e([
135
135
  i({ type: Boolean, reflect: !0 })
136
136
  ], t.prototype, "isStandalone", 2);
137
- n([
137
+ e([
138
138
  i({ type: Boolean })
139
139
  ], t.prototype, "hasVisited", 2);
140
- n([
140
+ e([
141
141
  i({ type: String }),
142
- a(c, B, e.type)
142
+ a(c, B, n.type)
143
143
  ], t.prototype, "type", 2);
144
- n([
144
+ e([
145
145
  i({ type: Object })
146
146
  ], t.prototype, "aria", 2);
147
- t = n([
147
+ t = e([
148
148
  x("pie-link")
149
149
  ], t);
150
150
  export {
151
151
  t as PieLink,
152
152
  B as buttonTypes,
153
- e as defaultProps,
153
+ n as defaultProps,
154
154
  $ as iconPlacements,
155
- w as sizes,
155
+ S as sizes,
156
156
  P as tags,
157
157
  V as underlineTypes,
158
- S as variants
158
+ w as variants
159
159
  };
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": "1.3.3",
4
+ "version": "1.3.5",
5
5
  "repository": {
6
6
  "type": "git",
7
7
  "url": "https://github.com/justeattakeaway/pie",
@@ -45,14 +45,14 @@
45
45
  "devDependencies": {
46
46
  "@custom-elements-manifest/analyzer": "0.9.0",
47
47
  "@justeattakeaway/pie-components-config": "0.21.0",
48
- "@justeattakeaway/pie-css": "0.24.0",
48
+ "@justeattakeaway/pie-css": "0.25.0",
49
49
  "@justeattakeaway/pie-monorepo-utils": "0.7.0",
50
50
  "@justeattakeaway/pie-wrapper-react": "0.14.3",
51
51
  "cem-plugin-module-file-extensions": "0.0.5"
52
52
  },
53
53
  "dependencies": {
54
- "@justeattakeaway/pie-icons-webc": "1.17.0",
55
- "@justeattakeaway/pie-webc-core": "4.0.0"
54
+ "@justeattakeaway/pie-icons-webc": "1.17.1",
55
+ "@justeattakeaway/pie-webc-core": "5.0.0"
56
56
  },
57
57
  "volta": {
58
58
  "extends": "../../../package.json"
package/src/link.scss CHANGED
@@ -3,9 +3,9 @@
3
3
  :host {
4
4
  display: inline-block;
5
5
 
6
- --link-font-weight: var(--dt-font-weight-regular);
6
+ --link-font-weight: var(--dt-font-body-l-link-weight);
7
7
  --link-text-color: var(--dt-color-content-link);
8
- --link-text-decoration: var(--dt-font-style-underline);
8
+ --link-text-decoration: var(--dt-font-body-l-link-text-decoration);
9
9
  }
10
10
 
11
11
  :host([isstandalone]) {
@@ -16,7 +16,7 @@
16
16
  &:hover,
17
17
  &:active {
18
18
  @if $mode == 'reversed' {
19
- --link-text-decoration: var(--dt-font-style-underline);
19
+ --link-text-decoration: var(--dt-font-body-l-link-text-decoration);
20
20
  } @else {
21
21
  --link-text-decoration: none;
22
22
  }
@@ -25,8 +25,8 @@
25
25
 
26
26
  .c-link {
27
27
  --link-font-family: var(--dt-font-interactive-l-family);
28
- --link-font-size: #{p.font-size(--dt-font-size-16)};
29
- --link-line-height: calc(var(--dt-font-size-16-line-height) * 1px);
28
+ --link-font-size: #{p.font-size(--dt-font-body-l-link-size)};
29
+ --link-line-height: calc(var(--dt-font-body-l-link-line-height) * 1px);
30
30
  --link-icon-size: 16px;
31
31
  --link-icon-offset-top: var(--dt-spacing-a);
32
32
 
@@ -54,8 +54,10 @@
54
54
  }
55
55
 
56
56
  &.c-link--small {
57
- --link-font-size: #{p.font-size(--dt-font-size-14)};
58
- --link-line-height: calc(var(--dt-font-size-14-line-height) * 1px);
57
+ --link-font-size: #{p.font-size(--dt-font-body-s-link-size)};
58
+ --link-line-height: calc(var(--dt-font-body-s-link-line-height) * 1px);
59
+ --link-font-weight: var(--dt-font-body-s-link-weight);
60
+ --link-text-decoration: var(--dt-font-body-s-link-text-decoration);
59
61
  --link-icon-offset-top: 2px;
60
62
  }
61
63
 
@@ -70,7 +72,15 @@
70
72
  }
71
73
 
72
74
  &.c-link--bold {
73
- --link-font-weight: var(--dt-font-weight-bold);
75
+ --link-font-size: #{p.font-size(--dt-font-body-strong-l-link-size)};
76
+ --link-line-height: calc(var(--dt-font-body-strong-l-link-line-height) * 1px);
77
+ --link-font-weight: var(--dt-font-body-strong-l-link-weight);
78
+
79
+ &.c-link--small {
80
+ --link-font-size: #{p.font-size(--dt-font-body-strong-s-link-size)};
81
+ --link-line-height: calc(var(--dt-font-body-strong-s-link-line-height) * 1px);
82
+ --link-font-weight: var(--dt-font-body-strong-s-link-weight);
83
+ }
74
84
  }
75
85
 
76
86
  &.c-link--standalone {