@justeattakeaway/pie-thumbnail 0.7.0 → 0.7.1

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/declaration.d.ts CHANGED
@@ -1,13 +1,3 @@
1
- declare module '*.scss' {
2
- const content: Record<string, string>;
3
- export default content;
4
- }
5
-
6
- declare module '*.scss?inline' {
7
- const content: Record<string, string>;
8
- export default content;
9
- }
10
-
11
1
  declare module '*.svg?inline' {
12
2
  const content: string;
13
3
  export default content;
package/dist/index.js CHANGED
@@ -1,19 +1,19 @@
1
1
  import { LitElement as k, html as P, unsafeCSS as S } from "lit";
2
- import { property as n, query as E, state as z } from "lit/decorators.js";
3
- import { validPropertyValues as h, defineCustomElement as C } from "@justeattakeaway/pie-webc-core";
2
+ import { property as o, query as E, state as z } from "lit/decorators.js";
3
+ import { validPropertyValues as u, defineCustomElement as C } from "@justeattakeaway/pie-webc-core";
4
4
  import { classMap as I } from "lit/directives/class-map.js";
5
- var x = Object.defineProperty, D = (c, t, a, o) => {
5
+ var x = Object.defineProperty, D = (c, t, a, n) => {
6
6
  for (var e = void 0, s = c.length - 1, d; s >= 0; s--)
7
7
  (d = c[s]) && (e = d(t, a, e) || e);
8
8
  return e && x(t, a, e), e;
9
9
  };
10
10
  class p extends k {
11
11
  constructor() {
12
- super(...arguments), this.v = "0.7.0";
12
+ super(...arguments), this.v = "0.7.1";
13
13
  }
14
14
  }
15
15
  D([
16
- n({ type: String, reflect: !0 })
16
+ o({ type: String, reflect: !0 })
17
17
  ], p.prototype, "v");
18
18
  const $ = [
19
19
  "default",
@@ -50,12 +50,12 @@ const $ = [
50
50
  alt: ""
51
51
  }
52
52
  }, M = ".c-thumbnail{--thumbnail-size: 48px;--thumbnail-border-radius: var(--dt-radius-rounded-b);--thumbnail-bg-color: var(--dt-color-container-default);--thumbnail-padding: calc(var(--dt-spacing-a) / 2);--thumbnail-default-placeholder-padding: var(--dt-spacing-b);--thumbnail-img-border-radius: unset;--thumbnail-img-object-fit: cover;display:flex;justify-content:center;align-items:center;box-sizing:border-box;overflow:hidden;width:var(--thumbnail-size);height:var(--thumbnail-size);border-radius:var(--thumbnail-border-radius);background-color:var(--thumbnail-bg-color)}.c-thumbnail.c-thumbnail--outline{border:1px solid var(--dt-color-border-default)}.c-thumbnail.is-disabled{opacity:.5}.c-thumbnail.c-thumbnail--backgroundSubtle{--thumbnail-bg-color: var(--dt-color-container-subtle)}.c-thumbnail.c-thumbnail--backgroundStrong{--thumbnail-bg-color: var(--dt-color-container-strong)}.c-thumbnail.c-thumbnail--backgroundDark{--thumbnail-bg-color: var(--dt-color-container-dark)}.c-thumbnail.c-thumbnail--backgroundInverse{--thumbnail-bg-color: var(--dt-color-container-inverse)}.c-thumbnail.c-thumbnail--backgroundInverseAlternative{--thumbnail-bg-color: var(--dt-color-container-inverse-alternative)}.c-thumbnail.c-thumbnail--padding{--thumbnail-img-border-radius: calc(var(--thumbnail-border-radius) - var(--thumbnail-padding));padding:var(--thumbnail-padding)}.c-thumbnail.c-thumbnail--4by3{height:calc(var(--thumbnail-size) * 3 / 4)}.c-thumbnail.c-thumbnail--16by9{height:calc(var(--thumbnail-size) * 9 / 16)}.c-thumbnail .c-thumbnail-img{width:100%;height:100%;border-radius:var(--thumbnail-img-border-radius);object-fit:var(--thumbnail-img-object-fit)}.c-thumbnail.c-thumbnail--defaultPlaceholder{--thumbnail-bg-color: var(--dt-color-container-default);--thumbnail-img-object-fit: fill;padding:var(--thumbnail-default-placeholder-padding)}", N = "data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20fill='none'%20viewBox='0%200%2033%2032'%3e%3cpath%20d='M32.399%2015.493c-.102-.255-1.495-2.753-4.081-5.888a.507.507%200%200%201-.119-.267%2048.162%2048.162%200%200%200-.778-5.436.88.88%200%200%200-.282-.467.928.928%200%200%200-.509-.221l-2.679-.323a.84.84%200%200%200-.071%200c-.15%200-.294.058-.401.161s-.166.243-.166.389v.906c0%20.009-.004.017-.011.023s-.015.01-.025.01c-.015-.003-.018-.006-.021-.008A37.89%2037.89%200%200%200%2017.829.395%202.43%202.43%200%200%200%2016.493%200c-.473%200-.936.138-1.328.395C5.887%205.956.782%2015.005.585%2015.493a.87.87%200%200%200%20.004.757.9.9%200%200%200%20.246.306.93.93%200%200%200%20.356.176l2.672.5c.177.047.335.144.454.279s.193.302.213.479c.023.457.527%2010.691%201.162%2013.345a.89.89%200%200%200%20.328.479c.161.12.358.186.561.185h.02l4.528-.084h.129c.079-.001.155-.032.211-.086s.087-.128.087-.205l-.306-5.093c0-.054-.007-.121-.01-.176a.54.54%200%200%200-.08-.254.56.56%200%200%200-.193-.188c-.407-.236-.747-.566-.992-.96s-.385-.841-.41-1.3c-.142-3.589-.211-7.735-.008-10.981.003-.138.062-.27.165-.366a.545.545%200%200%201%20.76.016c.099.1.152.234.149.372v.041c-.132%202.163-.142%204.72-.095%207.244a.61.61%200%200%200%20.195.435.65.65%200%200%200%20.454.174.65.65%200%200%200%20.448-.189.61.61%200%200%200%20.179-.441c-.048-2.54-.035-5.114.099-7.285.003-.138.062-.27.165-.366a.545.545%200%200%201%20.76.016c.099.1.152.234.149.372v.041c-.132%202.152-.142%204.694-.096%207.204a.61.61%200%200%200%20.194.435.65.65%200%200%200%20.454.175.65.65%200%200%200%20.448-.188.61.61%200%200%200%20.18-.441c-.047-2.529-.034-5.093.101-7.249.003-.138.063-.27.165-.366s.241-.148.383-.145.278.061.377.161.152.234.149.372v.041c-.193%203.154-.13%207.147%200%2010.651a.26.26%200%200%201%200%20.033v.086c0%20.455-.113.902-.331%201.305s-.533.747-.919%201.004a.54.54%200%200%200-.166.177.52.52%200%200%200-.07.229s-.067.538.179%203.144l.241%202.284c.009.067.043.128.095.172s.119.068.188.068h4.053l1.516.012c.07%200%20.137-.024.189-.069s.086-.107.094-.174c.35-3.123.434-4.879.434-4.879-.002-.075-.032-.146-.084-.201s-.123-.09-.199-.099l-1.843-.246c-.122-.015-.238-.064-.331-.142s-.161-.181-.195-.297a.83.83%200%200%201-.024-.275c.747-10.411%204.282-13.92%204.282-13.92a1.05%201.05%200%200%201%20.172-.144.575.575%200%200%201%20.491-.082.57.57%200%200%201%20.223.122.55.55%200%200%201%20.145.205.97.97%200%200%201%20.045.251c.306%203.272.157%208.842-.033%2013.186l-.353%206.583c0%20.057.023.112.065.152s.098.063.156.063l3.037.062h.021a.94.94%200%200%200%20.561-.186.892.892%200%200%200%20.328-.479c.635-2.654%201.134-12.887%201.161-13.344a.877.877%200%200%201%20.214-.479.92.92%200%200%201%20.453-.28l2.672-.5a.92.92%200%200%200%20.499-.317.873.873%200%200%200%20.194-.548.885.885%200%200%200-.101-.368z'%20fill='%23efedea'/%3e%3c/svg%3e";
53
- var O = Object.defineProperty, l = (c, t, a, o) => {
53
+ var O = Object.defineProperty, l = (c, t, a, n) => {
54
54
  for (var e = void 0, s = c.length - 1, d; s >= 0; s--)
55
55
  (d = c[s]) && (e = d(t, a, e) || e);
56
56
  return e && O(t, a, e), e;
57
57
  };
58
- const u = "pie-thumbnail", b = class b extends p {
58
+ const h = "pie-thumbnail", b = class b extends p {
59
59
  constructor() {
60
60
  super(...arguments), this.variant = i.variant, this.size = i.size, this.aspectRatio = i.aspectRatio, this.src = i.src, this.alt = i.alt, this.disabled = i.disabled, this.hasPadding = i.hasPadding, this.hideDefaultPlaceholder = i.hideDefaultPlaceholder, this.backgroundColor = i.backgroundColor, this.placeholder = i.placeholder, this._hasError = !1;
61
61
  }
@@ -63,8 +63,8 @@ const u = "pie-thumbnail", b = class b extends p {
63
63
  * Determines if the default placeholder should be displayed.
64
64
  */
65
65
  get _isDefaultPlaceholderVisible() {
66
- const { _hasError: t, placeholder: a, hideDefaultPlaceholder: o } = this;
67
- return t && !(a != null && a.src) && !o;
66
+ const { _hasError: t, placeholder: a, hideDefaultPlaceholder: n } = this;
67
+ return t && !(a != null && a.src) && !n;
68
68
  }
69
69
  /**
70
70
  * Returns the appropriate image props based on the following order:
@@ -86,11 +86,11 @@ const u = "pie-thumbnail", b = class b extends p {
86
86
  */
87
87
  _generateSizeStyles() {
88
88
  const { size: t } = this;
89
- let a = "--dt-radius-rounded-c", o = "--dt-spacing-d";
90
- return t <= 40 ? (a = "--dt-radius-rounded-a", o = "--dt-spacing-a") : t <= 56 && (a = "--dt-radius-rounded-b", o = "--dt-spacing-b"), `
89
+ let a = "--dt-radius-rounded-c", n = "--dt-spacing-d";
90
+ return t <= 40 ? (a = "--dt-radius-rounded-a", n = "--dt-spacing-a") : t <= 56 && (a = "--dt-radius-rounded-b", n = "--dt-spacing-b"), `
91
91
  --thumbnail-size: ${t}px;
92
92
  --thumbnail-border-radius: var(${a});
93
- --thumbnail-default-placeholder-padding: var(${o});
93
+ --thumbnail-default-placeholder-padding: var(${n});
94
94
  `;
95
95
  }
96
96
  /**
@@ -116,17 +116,17 @@ const u = "pie-thumbnail", b = class b extends p {
116
116
  const {
117
117
  variant: t,
118
118
  _controlledSrc: a,
119
- _controlledAlt: o,
119
+ _controlledAlt: n,
120
120
  disabled: e,
121
121
  hasPadding: s,
122
122
  _isDefaultPlaceholderVisible: d,
123
- backgroundColor: f,
124
- aspectRatio: v
123
+ backgroundColor: v,
124
+ aspectRatio: f
125
125
  } = this, y = {
126
126
  "c-thumbnail": !0,
127
127
  [`c-thumbnail--${t}`]: !0,
128
- [`c-thumbnail--${v}`]: !0,
129
- [w[f]]: !0,
128
+ [`c-thumbnail--${f}`]: !0,
129
+ [w[v]]: !0,
130
130
  "is-disabled": e,
131
131
  "c-thumbnail--padding": s,
132
132
  "c-thumbnail--defaultPlaceholder": d
@@ -138,7 +138,7 @@ const u = "pie-thumbnail", b = class b extends p {
138
138
  <img
139
139
  data-test-id="pie-thumbnail-img"
140
140
  src="${a}"
141
- alt="${o}"
141
+ alt="${n}"
142
142
  class="c-thumbnail-img"
143
143
  @error="${this._handleImageError}"
144
144
  />
@@ -149,38 +149,38 @@ const u = "pie-thumbnail", b = class b extends p {
149
149
  b.styles = S(M);
150
150
  let r = b;
151
151
  l([
152
- n({ type: String }),
153
- h(u, $, i.variant)
152
+ o({ type: String }),
153
+ u(h, $, i.variant)
154
154
  ], r.prototype, "variant");
155
155
  l([
156
- n({ type: Number }),
157
- h(u, B, i.size)
156
+ o({ type: Number }),
157
+ u(h, B, i.size)
158
158
  ], r.prototype, "size");
159
159
  l([
160
- n({ type: String }),
161
- h(u, R, i.aspectRatio)
160
+ o({ type: String }),
161
+ u(h, R, i.aspectRatio)
162
162
  ], r.prototype, "aspectRatio");
163
163
  l([
164
- n({ type: String })
164
+ o({ type: String })
165
165
  ], r.prototype, "src");
166
166
  l([
167
- n({ type: String })
167
+ o({ type: String })
168
168
  ], r.prototype, "alt");
169
169
  l([
170
- n({ type: Boolean })
170
+ o({ type: Boolean })
171
171
  ], r.prototype, "disabled");
172
172
  l([
173
- n({ type: Boolean })
173
+ o({ type: Boolean })
174
174
  ], r.prototype, "hasPadding");
175
175
  l([
176
- n({ type: Boolean })
176
+ o({ type: Boolean })
177
177
  ], r.prototype, "hideDefaultPlaceholder");
178
178
  l([
179
- n({ type: String }),
180
- h(u, j, i.backgroundColor)
179
+ o({ type: String }),
180
+ u(h, j, i.backgroundColor)
181
181
  ], r.prototype, "backgroundColor");
182
182
  l([
183
- n({ type: Object })
183
+ o({ type: Object })
184
184
  ], r.prototype, "placeholder");
185
185
  l([
186
186
  E("img")
@@ -188,7 +188,7 @@ l([
188
188
  l([
189
189
  z()
190
190
  ], r.prototype, "_hasError");
191
- C(u, r);
191
+ C(h, r);
192
192
  export {
193
193
  r as PieThumbnail,
194
194
  R as aspectRatios,
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@justeattakeaway/pie-thumbnail",
3
3
  "description": "PIE Design System Thumbnail built using Web Components",
4
- "version": "0.7.0",
4
+ "version": "0.7.1",
5
5
  "repository": {
6
6
  "type": "git",
7
7
  "url": "https://github.com/justeattakeaway/pie",
@@ -39,13 +39,13 @@
39
39
  "license": "Apache-2.0",
40
40
  "devDependencies": {
41
41
  "@custom-elements-manifest/analyzer": "0.9.0",
42
- "@justeattakeaway/pie-components-config": "0.19.0",
42
+ "@justeattakeaway/pie-components-config": "0.19.1",
43
43
  "@justeattakeaway/pie-css": "0.16.0",
44
44
  "@justeattakeaway/pie-monorepo-utils": "0.5.0",
45
45
  "cem-plugin-module-file-extensions": "0.0.5"
46
46
  },
47
47
  "dependencies": {
48
- "@justeattakeaway/pie-webc-core": "0.25.0"
48
+ "@justeattakeaway/pie-webc-core": "0.25.1"
49
49
  },
50
50
  "volta": {
51
51
  "extends": "../../../package.json"