@justeattakeaway/pie-lottie-player 0.2.10 → 0.3.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/README.md CHANGED
@@ -32,14 +32,16 @@ Ideally, you should install the component using the **`@justeattakeaway/pie-webc
32
32
 
33
33
  ### Properties
34
34
 
35
- | Prop | Options | Description | Default |
36
- |--------------------|----------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------|-------------|
37
- | `animationSrc` | — | Lottie animation JSON file URL or relative path. `animationSrc` and `animationData` are mutually exclusive. | `-` |
38
- | `animationData` | — | Object with Lottie animation data. `animationSrc` and `animationData` are mutually exclusive. | `-` |
39
- | `loopDisabled` | `true`, `false` | By default, animations loop. Setting this prop to `true` will prevent that behavior. | `false` |
40
- | `autoPlayDisabled` | `true`, `false` | By default, animations start playing as soon as their data is available. Setting this prop to `true` will prevent that behavior. | `false` |
41
- | `speed` | — | Determines the animation playback speed. `1` is normal speed, `2` is twice as fast, etc. | `1` |
42
- | `direction` | `"forward"`, `"reverse"` | Sets the animation playback direction. | `"forward"` |
35
+ | Prop | Options | Description | Default |
36
+ | --- | --- | --- | --- |
37
+ | `animationSrc` | — | Lottie animation JSON file URL or relative path. `animationSrc` and `animationData` are mutually exclusive. | `-` |
38
+ | `animationData` | — | Object with Lottie animation data. `animationSrc` and `animationData` are mutually exclusive. | `-` |
39
+ | `loopDisabled` | `true`, `false` | By default, animations loop. Setting this prop to `true` will prevent that behavior. | `false` |
40
+ | `autoPlayDisabled` | `true`, `false` | By default, animations start playing as soon as their data is available. Setting this prop to `true` will prevent that behavior. | `false` |
41
+ | `speed` | — | Determines the animation playback speed. `1` is normal speed, `2` is twice as fast, etc. | `1` |
42
+ | `direction` | `"forward"`, `"reverse"` | Sets the animation playback direction. | `"forward"` |
43
+
44
+ > **Note:** If you want to change the height or width of the animation, you should pass a class that sets the desired values as the animation will scale to its container size automatically.
43
45
 
44
46
  ### Slots
45
47
  This component does not have any slots. All content is controlled through properties.
package/dist/index.js CHANGED
@@ -6,18 +6,18 @@ const d = class d extends m {
6
6
  this.getAttribute("v") || this.setAttribute("v", d.v);
7
7
  }
8
8
  };
9
- d.v = "0.2.10";
9
+ d.v = "0.3.0";
10
10
  let p = d;
11
- const v = ["forward", "reverse"], l = {
11
+ const A = ["forward", "reverse"], l = {
12
12
  loopDisabled: !1,
13
13
  autoPlayDisabled: !1,
14
14
  speed: 1,
15
15
  direction: "forward"
16
- };
17
- var b = Object.defineProperty, P = Object.getOwnPropertyDescriptor, s = (t, e, r, n) => {
18
- for (var a = n > 1 ? void 0 : n ? P(e, r) : e, c = t.length - 1, h; c >= 0; c--)
16
+ }, b = ":host{display:block}.c-lottiePlayer{width:100%;height:100%}";
17
+ var P = Object.defineProperty, I = Object.getOwnPropertyDescriptor, s = (t, e, r, n) => {
18
+ for (var a = n > 1 ? void 0 : n ? I(e, r) : e, c = t.length - 1, h; c >= 0; c--)
19
19
  (h = t[c]) && (a = (n ? h(e, r, a) : h(a)) || a);
20
- return n && a && b(e, r, a), a;
20
+ return n && a && P(e, r, a), a;
21
21
  };
22
22
  let i = class extends p {
23
23
  constructor() {
@@ -112,11 +112,10 @@ let i = class extends p {
112
112
  this._animationInstance && this._animationInstance.stop();
113
113
  }
114
114
  render() {
115
- return y`<div aria-hidden="true" data-test-id="pie-lottie-player"></div>`;
115
+ return y`<div class="c-lottiePlayer" aria-hidden="true" data-test-id="pie-lottie-player"></div>`;
116
116
  }
117
- // Kept as empty to ensure it will be present during SSR testing
118
117
  };
119
- i.styles = u("");
118
+ i.styles = u(b);
120
119
  s([
121
120
  f("div")
122
121
  ], i.prototype, "_hostElement", 2);
@@ -144,5 +143,5 @@ i = s([
144
143
  export {
145
144
  i as PieLottiePlayer,
146
145
  l as defaultProps,
147
- v as directions
146
+ A as directions
148
147
  };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@justeattakeaway/pie-lottie-player",
3
3
  "description": "PIE Design System Lottie Player built using Web Components",
4
- "version": "0.2.10",
4
+ "version": "0.3.0",
5
5
  "repository": {
6
6
  "type": "git",
7
7
  "url": "https://github.com/justeattakeaway/pie",
@@ -41,12 +41,12 @@
41
41
  "devDependencies": {
42
42
  "@custom-elements-manifest/analyzer": "0.9.0",
43
43
  "@justeattakeaway/pie-components-config": "0.21.0",
44
- "@justeattakeaway/pie-css": "0.24.0",
44
+ "@justeattakeaway/pie-css": "0.25.0",
45
45
  "@justeattakeaway/pie-monorepo-utils": "0.7.0",
46
46
  "cem-plugin-module-file-extensions": "0.0.5"
47
47
  },
48
48
  "dependencies": {
49
- "@justeattakeaway/pie-webc-core": "4.0.0",
49
+ "@justeattakeaway/pie-webc-core": "5.0.0",
50
50
  "lottie-web": "5.12.2"
51
51
  },
52
52
  "volta": {
package/src/index.ts CHANGED
@@ -197,11 +197,11 @@ export class PieLottiePlayer extends PieElement implements LottiePlayerProps {
197
197
  }
198
198
 
199
199
  render () {
200
- return html`<div aria-hidden="true" data-test-id="pie-lottie-player"></div>`;
200
+ return html`<div class="c-lottiePlayer" aria-hidden="true" data-test-id="pie-lottie-player"></div>`;
201
201
  }
202
202
 
203
203
  // Renders a `CSSResult` generated from SCSS by Vite
204
- static styles = unsafeCSS(''); // Kept as empty to ensure it will be present during SSR testing
204
+ static styles = unsafeCSS(styles);
205
205
  }
206
206
 
207
207
  declare global {
@@ -1,3 +1,8 @@
1
1
  :host {
2
2
  display: block;
3
3
  }
4
+
5
+ .c-lottiePlayer {
6
+ width: 100%;
7
+ height: 100%;
8
+ }