@justeattakeaway/pie-button 0.38.1-next.0 → 0.39.1-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/README.md +1 -1
- package/dist/react.js +16 -47
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -61,7 +61,7 @@ import '@justeattakeaway/pie-button';
|
|
|
61
61
|
```js
|
|
62
62
|
// React
|
|
63
63
|
// For React, you will need to import our React-specific component build
|
|
64
|
-
// which wraps the web component using
|
|
64
|
+
// which wraps the web component using @lit/react
|
|
65
65
|
import { PieButton } from '@justeattakeaway/pie-button/dist/react';
|
|
66
66
|
```
|
|
67
67
|
|
package/dist/react.js
CHANGED
|
@@ -1,57 +1,26 @@
|
|
|
1
|
-
import * as
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import * as t from "react";
|
|
2
|
+
import { createComponent as e } from "@lit/react";
|
|
3
|
+
import { PieButton as o } from "./index.js";
|
|
4
|
+
import { formEncodingtypes as u, formMethodTypes as y, formTargetTypes as P, iconPlacements as l, responsiveSizes as B, sizes as d, types as g, variants as v } from "./index.js";
|
|
4
5
|
import "lit";
|
|
5
6
|
import "lit/decorators.js";
|
|
6
7
|
import "lit/directives/if-defined.js";
|
|
7
8
|
import "@justeattakeaway/pie-spinner";
|
|
8
|
-
|
|
9
|
-
* @license
|
|
10
|
-
* Copyright 2018 Google LLC
|
|
11
|
-
* SPDX-License-Identifier: BSD-3-Clause
|
|
12
|
-
*/
|
|
13
|
-
const N = /* @__PURE__ */ new Set(["children", "localName", "ref", "style", "className"]), v = /* @__PURE__ */ new WeakMap(), g = (t, c, a, l, u) => {
|
|
14
|
-
const m = u == null ? void 0 : u[c];
|
|
15
|
-
m === void 0 || a === l ? (t[c] = a, a == null && c in HTMLElement.prototype && t.removeAttribute(c)) : ((i, n, o) => {
|
|
16
|
-
let s = v.get(i);
|
|
17
|
-
s === void 0 && v.set(i, s = /* @__PURE__ */ new Map());
|
|
18
|
-
let r = s.get(n);
|
|
19
|
-
o !== void 0 ? r === void 0 ? (s.set(n, r = { handleEvent: o }), i.addEventListener(n, r)) : r.handleEvent = o : r !== void 0 && (s.delete(n), i.removeEventListener(n, r));
|
|
20
|
-
})(t, m, a);
|
|
21
|
-
}, h = ({ react: t, tagName: c, elementClass: a, events: l, displayName: u }) => {
|
|
22
|
-
const m = new Set(Object.keys(l ?? {})), i = t.forwardRef((n, o) => {
|
|
23
|
-
const s = t.useRef(null), r = t.useRef(null), p = {}, d = {};
|
|
24
|
-
for (const [e, f] of Object.entries(n))
|
|
25
|
-
N.has(e) ? p[e === "className" ? "class" : e] = f : m.has(e) || e in a.prototype ? d[e] = f : p[e] = f;
|
|
26
|
-
return t.useLayoutEffect(() => {
|
|
27
|
-
if (r.current !== null) {
|
|
28
|
-
for (const e in d)
|
|
29
|
-
g(r.current, e, n[e], s.current ? s.current[e] : void 0, l);
|
|
30
|
-
s.current = n;
|
|
31
|
-
}
|
|
32
|
-
}), t.useLayoutEffect(() => {
|
|
33
|
-
var e;
|
|
34
|
-
(e = r.current) == null || e.removeAttribute("defer-hydration");
|
|
35
|
-
}, []), p.suppressHydrationWarning = !0, t.createElement(c, { ...p, ref: t.useCallback((e) => {
|
|
36
|
-
r.current = e, typeof o == "function" ? o(e) : o !== null && (o.current = e);
|
|
37
|
-
}, [o]) });
|
|
38
|
-
});
|
|
39
|
-
return i.displayName = u ?? a.name, i;
|
|
40
|
-
}, M = h({
|
|
9
|
+
const a = e({
|
|
41
10
|
displayName: "PieButton",
|
|
42
|
-
elementClass:
|
|
43
|
-
react:
|
|
11
|
+
elementClass: o,
|
|
12
|
+
react: t,
|
|
44
13
|
tagName: "pie-button",
|
|
45
14
|
events: {}
|
|
46
15
|
});
|
|
47
16
|
export {
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
17
|
+
a as PieButton,
|
|
18
|
+
u as formEncodingtypes,
|
|
19
|
+
y as formMethodTypes,
|
|
20
|
+
P as formTargetTypes,
|
|
21
|
+
l as iconPlacements,
|
|
22
|
+
B as responsiveSizes,
|
|
23
|
+
d as sizes,
|
|
24
|
+
g as types,
|
|
25
|
+
v as variants
|
|
57
26
|
};
|