@justeattakeaway/pie-notification 0.1.2-next.0 → 0.1.3

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
@@ -55,7 +55,7 @@ import '@justeattakeaway/pie-notification';
55
55
  ```js
56
56
  // React
57
57
  // For React, you will need to import our React-specific component build
58
- // which wraps the web component using @lit-labs/react
58
+ // which wraps the web component using ​@lit/react
59
59
  import { PieNotification } from '@justeattakeaway/pie-notification/dist/react';
60
60
  ```
61
61
 
package/dist/index.js CHANGED
@@ -1,15 +1,13 @@
1
- import { unsafeCSS as o, LitElement as i, html as s } from "lit";
2
- function a(e, t) {
3
- customElements.get(e) ? console.warn(`PIE Web Component: "${e}" has already been defined. Please ensure the component is only being defined once in your application.`) : customElements.define(e, t);
4
- }
5
- const l = "", c = "pie-notification";
6
- class n extends i {
1
+ import { unsafeCSS as e, LitElement as o, html as i } from "lit";
2
+ import { defineCustomElement as n } from "@justeattakeaway/pie-webc-core";
3
+ const s = "", r = "pie-notification";
4
+ class t extends o {
7
5
  render() {
8
- return s`<h1 data-test-id="pie-notification">Hello world!</h1>`;
6
+ return i`<h1 data-test-id="pie-notification">Hello world!</h1>`;
9
7
  }
10
8
  }
11
- n.styles = o(l);
12
- a(c, n);
9
+ t.styles = e(s);
10
+ n(r, t);
13
11
  export {
14
- n as PieNotification
12
+ t as PieNotification
15
13
  };
package/dist/react.js CHANGED
@@ -1,45 +1,15 @@
1
- import * as y from "react";
2
- import { PieNotification as N } from "./index.js";
1
+ import * as i from "react";
2
+ import { createComponent as t } from "@lit/react";
3
+ import { PieNotification as o } from "./index.js";
3
4
  import "lit";
4
- /**
5
- * @license
6
- * Copyright 2018 Google LLC
7
- * SPDX-License-Identifier: BSD-3-Clause
8
- */
9
- const E = /* @__PURE__ */ new Set(["children", "localName", "ref", "style", "className"]), v = /* @__PURE__ */ new WeakMap(), h = (t, c, i, u, l) => {
10
- const f = l == null ? void 0 : l[c];
11
- f === void 0 || i === u ? (t[c] = i, i == null && c in HTMLElement.prototype && t.removeAttribute(c)) : ((s, r, o) => {
12
- let a = v.get(s);
13
- a === void 0 && v.set(s, a = /* @__PURE__ */ new Map());
14
- let n = a.get(r);
15
- o !== void 0 ? n === void 0 ? (a.set(r, n = { handleEvent: o }), s.addEventListener(r, n)) : n.handleEvent = o : n !== void 0 && (a.delete(r), s.removeEventListener(r, n));
16
- })(t, f, i);
17
- }, b = ({ react: t, tagName: c, elementClass: i, events: u, displayName: l }) => {
18
- const f = new Set(Object.keys(u ?? {})), s = t.forwardRef((r, o) => {
19
- const a = t.useRef(null), n = t.useRef(null), m = {}, p = {};
20
- for (const [e, d] of Object.entries(r))
21
- E.has(e) ? m[e === "className" ? "class" : e] = d : f.has(e) || e in i.prototype ? p[e] = d : m[e] = d;
22
- return t.useLayoutEffect(() => {
23
- if (n.current !== null) {
24
- for (const e in p)
25
- h(n.current, e, r[e], a.current ? a.current[e] : void 0, u);
26
- a.current = r;
27
- }
28
- }), t.useLayoutEffect(() => {
29
- var e;
30
- (e = n.current) == null || e.removeAttribute("defer-hydration");
31
- }, []), m.suppressHydrationWarning = !0, t.createElement(c, { ...m, ref: t.useCallback((e) => {
32
- n.current = e, typeof o == "function" ? o(e) : o !== null && (o.current = e);
33
- }, [o]) });
34
- });
35
- return s.displayName = l ?? i.name, s;
36
- }, L = b({
5
+ import "@justeattakeaway/pie-webc-core";
6
+ const r = t({
37
7
  displayName: "PieNotification",
38
- elementClass: N,
39
- react: y,
8
+ elementClass: o,
9
+ react: i,
40
10
  tagName: "pie-notification",
41
11
  events: {}
42
12
  });
43
13
  export {
44
- L as PieNotification
14
+ r as PieNotification
45
15
  };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@justeattakeaway/pie-notification",
3
3
  "description": "PIE Design System Notification built using Web Components",
4
- "version": "0.1.2-next.0",
4
+ "version": "0.1.3",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
7
7
  "module": "dist/index.js",
@@ -28,10 +28,10 @@
28
28
  "author": "Just Eat Takeaway.com - Design System Team",
29
29
  "license": "Apache-2.0",
30
30
  "devDependencies": {
31
- "@justeattakeaway/pie-components-config": "0.6.0"
31
+ "@justeattakeaway/pie-components-config": "0.6.1"
32
32
  },
33
33
  "dependencies": {
34
- "@justeattakeaway/pie-webc-core": "0.12.0-next.0"
34
+ "@justeattakeaway/pie-webc-core": "0.13.0"
35
35
  },
36
36
  "volta": {
37
37
  "extends": "../../../package.json"