@justeattakeaway/pie-spinner 0.2.2-next.0 → 0.2.2

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.
Files changed (3) hide show
  1. package/README.md +1 -1
  2. package/dist/react.js +10 -41
  3. package/package.json +2 -2
package/README.md CHANGED
@@ -55,7 +55,7 @@ import '@justeattakeaway/pie-spinner';
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 { PieSpinner } from '@justeattakeaway/pie-spinner/dist/react';
60
60
  ```
61
61
 
package/dist/react.js CHANGED
@@ -1,49 +1,18 @@
1
- import * as y from "react";
2
- import { PieSpinner as E } from "./index.js";
3
- import { sizes as k, variants as C } from "./index.js";
1
+ import * as e from "react";
2
+ import { createComponent as r } from "@lit/react";
3
+ import { PieSpinner as i } from "./index.js";
4
+ import { sizes as c, variants as f } from "./index.js";
4
5
  import "lit";
5
6
  import "lit/decorators.js";
6
- /**
7
- * @license
8
- * Copyright 2018 Google LLC
9
- * SPDX-License-Identifier: BSD-3-Clause
10
- */
11
- const N = /* @__PURE__ */ new Set(["children", "localName", "ref", "style", "className"]), v = /* @__PURE__ */ new WeakMap(), h = (t, c, o, u, l) => {
12
- const p = l == null ? void 0 : l[c];
13
- p === void 0 || o === u ? (t[c] = o, o == null && c in HTMLElement.prototype && t.removeAttribute(c)) : ((i, n, s) => {
14
- let a = v.get(i);
15
- a === void 0 && v.set(i, a = /* @__PURE__ */ new Map());
16
- let r = a.get(n);
17
- s !== void 0 ? r === void 0 ? (a.set(n, r = { handleEvent: s }), i.addEventListener(n, r)) : r.handleEvent = s : r !== void 0 && (a.delete(n), i.removeEventListener(n, r));
18
- })(t, p, o);
19
- }, S = ({ react: t, tagName: c, elementClass: o, events: u, displayName: l }) => {
20
- const p = new Set(Object.keys(u ?? {})), i = t.forwardRef((n, s) => {
21
- const a = t.useRef(null), r = t.useRef(null), m = {}, d = {};
22
- for (const [e, f] of Object.entries(n))
23
- N.has(e) ? m[e === "className" ? "class" : e] = f : p.has(e) || e in o.prototype ? d[e] = f : m[e] = f;
24
- return t.useLayoutEffect(() => {
25
- if (r.current !== null) {
26
- for (const e in d)
27
- h(r.current, e, n[e], a.current ? a.current[e] : void 0, u);
28
- a.current = n;
29
- }
30
- }), t.useLayoutEffect(() => {
31
- var e;
32
- (e = r.current) == null || e.removeAttribute("defer-hydration");
33
- }, []), m.suppressHydrationWarning = !0, t.createElement(c, { ...m, ref: t.useCallback((e) => {
34
- r.current = e, typeof s == "function" ? s(e) : s !== null && (s.current = e);
35
- }, [s]) });
36
- });
37
- return i.displayName = l ?? o.name, i;
38
- }, L = S({
7
+ const m = r({
39
8
  displayName: "PieSpinner",
40
- elementClass: E,
41
- react: y,
9
+ elementClass: i,
10
+ react: e,
42
11
  tagName: "pie-spinner",
43
12
  events: {}
44
13
  });
45
14
  export {
46
- L as PieSpinner,
47
- k as sizes,
48
- C as variants
15
+ m as PieSpinner,
16
+ c as sizes,
17
+ f as variants
49
18
  };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@justeattakeaway/pie-spinner",
3
3
  "description": "PIE Design System Spinner built using Web Components",
4
- "version": "0.2.2-next.0",
4
+ "version": "0.2.2",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
7
7
  "module": "dist/index.js",
@@ -31,7 +31,7 @@
31
31
  "@justeattakeaway/pie-components-config": "0.6.0"
32
32
  },
33
33
  "dependencies": {
34
- "@justeattakeaway/pie-webc-core": "0.12.0-next.0"
34
+ "@justeattakeaway/pie-webc-core": "0.12.0"
35
35
  },
36
36
  "volta": {
37
37
  "extends": "../../../package.json"