@justeattakeaway/pie-link 0.15.4 → 0.17.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/dist/index.js CHANGED
@@ -1,14 +1,14 @@
1
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 = `*,*: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)}
4
+ const g = `*,*:after,*:before{box-sizing:inherit}.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-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, 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;
6
+ var z = Object.defineProperty, B = Object.getOwnPropertyDescriptor, n = (p, e, r, c) => {
7
+ for (var o = c > 1 ? void 0 : c ? B(e, r) : e, h = p.length - 1, u; h >= 0; h--)
8
+ (u = p[h]) && (o = (c ? u(e, r, o) : u(o)) || o);
9
+ return c && o && z(e, r, o), o;
10
10
  };
11
- const r = "pie-link";
11
+ const l = "pie-link";
12
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";
@@ -19,12 +19,12 @@ class t extends v {
19
19
  * @private
20
20
  */
21
21
  renderContent() {
22
- const { iconPlacement: e, isStandalone: l } = this;
22
+ const { iconPlacement: e, isStandalone: r } = this;
23
23
  return d`
24
24
  <span class="c-link-content">
25
- ${l && e === "leading" ? d`<slot name="icon"></slot>` : s}
25
+ ${r && e === "leading" ? d`<slot name="icon"></slot>` : s}
26
26
  <slot></slot>
27
- ${l && e === "trailing" ? d`<slot name="icon"></slot>` : s}
27
+ ${r && e === "trailing" ? d`<slot name="icon"></slot>` : s}
28
28
  </span>`;
29
29
  }
30
30
  /**
@@ -82,23 +82,23 @@ class t extends v {
82
82
  t.styles = f(g);
83
83
  n([
84
84
  i(),
85
- a(r, x, "a")
85
+ a(l, x, "a")
86
86
  ], t.prototype, "tag", 2);
87
87
  n([
88
88
  i({ type: String }),
89
- a(r, y, "default")
89
+ a(l, y, "default")
90
90
  ], t.prototype, "variant", 2);
91
91
  n([
92
92
  i({ type: String }),
93
- a(r, m, "medium")
93
+ a(l, m, "medium")
94
94
  ], t.prototype, "size", 2);
95
95
  n([
96
96
  i({ type: String }),
97
- a(r, S, "default")
97
+ a(l, S, "default")
98
98
  ], t.prototype, "underline", 2);
99
99
  n([
100
100
  i({ type: String }),
101
- a(r, b, "leading")
101
+ a(l, 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(r, $, "submit")
123
+ a(l, $, "submit")
124
124
  ], t.prototype, "type", 2);
125
125
  n([
126
126
  i({ type: Object })
127
127
  ], t.prototype, "aria", 2);
128
- k(r, t);
128
+ k(l, 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",
4
+ "version": "0.17.0",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
7
7
  "module": "dist/index.js",
@@ -23,6 +23,7 @@
23
23
  "watch": "run -T vite build --watch",
24
24
  "test": "echo \"Error: no test specified\" && exit 0",
25
25
  "test:ci": "yarn test",
26
+ "test:browsers-setup": "npx playwright-lit-setup",
26
27
  "test:browsers": "npx playwright test -c ./playwright-lit.config.ts",
27
28
  "test:browsers:ci": "yarn test:browsers",
28
29
  "test:visual": "run -T cross-env-shell PERCY_TOKEN=${PERCY_TOKEN_PIE_LINK} percy exec --allowed-hostname cloudfront.net -- npx playwright test -c ./playwright-lit-visual.config.ts",
@@ -32,13 +33,13 @@
32
33
  "license": "Apache-2.0",
33
34
  "devDependencies": {
34
35
  "@custom-elements-manifest/analyzer": "0.9.0",
35
- "@justeattakeaway/pie-components-config": "0.11.0",
36
- "@justeattakeaway/pie-icons-webc": "0.19.1",
36
+ "@justeattakeaway/pie-components-config": "0.14.0",
37
+ "@justeattakeaway/pie-icons-webc": "0.20.0",
37
38
  "@justeattakeaway/pie-wrapper-react": "0.14.0",
38
39
  "cem-plugin-module-file-extensions": "0.0.5"
39
40
  },
40
41
  "dependencies": {
41
- "@justeattakeaway/pie-webc-core": "0.19.1"
42
+ "@justeattakeaway/pie-webc-core": "0.20.0"
42
43
  },
43
44
  "volta": {
44
45
  "extends": "../../../package.json"
package/src/link.scss CHANGED
@@ -13,7 +13,7 @@
13
13
  }
14
14
 
15
15
  .c-link {
16
- --link-font-family: var(--dt-font-interactive-m-family);
16
+ --link-font-family: var(--dt-font-interactive-l-family);
17
17
  --link-font-size: #{p.font-size(--dt-font-size-16)};
18
18
  --link-line-height: calc(var(--dt-font-size-16-line-height) * 1px);
19
19
  --link-font-weight: var(--dt-font-weight-regular);