@justeattakeaway/pie-notification 0.1.1 → 0.1.2-next.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.d.ts +0 -0
- package/dist/index.js +0 -0
- package/dist/react.d.ts +1 -1
- package/dist/react.js +32 -55
- package/package.json +3 -3
package/dist/index.d.ts
CHANGED
|
File without changes
|
package/dist/index.js
CHANGED
|
File without changes
|
package/dist/react.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { CSSResult } from 'lit';
|
|
2
2
|
import type { LitElement } from 'lit';
|
|
3
|
-
import type { ReactWebComponent } from '@lit
|
|
3
|
+
import type { ReactWebComponent } from '@lit/react';
|
|
4
4
|
import type { TemplateResult } from 'lit-html';
|
|
5
5
|
|
|
6
6
|
export declare interface NotificationProps {
|
package/dist/react.js
CHANGED
|
@@ -1,68 +1,45 @@
|
|
|
1
|
-
import * as
|
|
2
|
-
import { PieNotification as
|
|
1
|
+
import * as y from "react";
|
|
2
|
+
import { PieNotification as N } from "./index.js";
|
|
3
3
|
import "lit";
|
|
4
4
|
/**
|
|
5
5
|
* @license
|
|
6
6
|
* Copyright 2018 Google LLC
|
|
7
7
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
8
8
|
*/
|
|
9
|
-
const
|
|
10
|
-
const
|
|
11
|
-
|
|
12
|
-
let
|
|
13
|
-
|
|
14
|
-
let
|
|
15
|
-
|
|
16
|
-
})(t,
|
|
17
|
-
},
|
|
18
|
-
|
|
19
|
-
};
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
constructor() {
|
|
30
|
-
super(...arguments), this.o = null;
|
|
31
|
-
}
|
|
32
|
-
t(e) {
|
|
33
|
-
if (this.o !== null)
|
|
34
|
-
for (const u in this.i)
|
|
35
|
-
M(this.o, u, this.props[u], e ? e[u] : void 0, m);
|
|
36
|
-
}
|
|
37
|
-
componentDidMount() {
|
|
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(() => {
|
|
38
29
|
var e;
|
|
39
|
-
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
this.h !== e && (this.u = (n) => {
|
|
47
|
-
e !== null && P(e, n), this.o = n, this.h = e;
|
|
48
|
-
}), this.i = {};
|
|
49
|
-
const f = { ref: this.u };
|
|
50
|
-
for (const [n, N] of Object.entries(u))
|
|
51
|
-
b.has(n) ? f[n === "className" ? "class" : n] = N : l.has(n) || n in o.prototype ? this.i[n] = N : f[n] = N;
|
|
52
|
-
return f.suppressHydrationWarning = !0, r(a, f);
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
v.displayName = p ?? o.name;
|
|
56
|
-
const y = s.forwardRef((c, e) => r(v, { ...c, _$Gl: e }, c == null ? void 0 : c.children));
|
|
57
|
-
return y.displayName = v.displayName, y;
|
|
58
|
-
}
|
|
59
|
-
const $ = C({
|
|
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({
|
|
60
37
|
displayName: "PieNotification",
|
|
61
|
-
elementClass:
|
|
62
|
-
react:
|
|
38
|
+
elementClass: N,
|
|
39
|
+
react: y,
|
|
63
40
|
tagName: "pie-notification",
|
|
64
41
|
events: {}
|
|
65
42
|
});
|
|
66
43
|
export {
|
|
67
|
-
|
|
44
|
+
L as PieNotification
|
|
68
45
|
};
|
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.
|
|
4
|
+
"version": "0.1.2-next.0",
|
|
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.
|
|
31
|
+
"@justeattakeaway/pie-components-config": "0.6.0"
|
|
32
32
|
},
|
|
33
33
|
"dependencies": {
|
|
34
|
-
"@justeattakeaway/pie-webc-core": "0.
|
|
34
|
+
"@justeattakeaway/pie-webc-core": "0.12.0-next.0"
|
|
35
35
|
},
|
|
36
36
|
"volta": {
|
|
37
37
|
"extends": "../../../package.json"
|