@justeattakeaway/pie-divider 0.9.1 → 0.9.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.
package/README.md CHANGED
@@ -56,7 +56,7 @@ import '@justeattakeaway/pie-divider';
56
56
  ```js
57
57
  // React
58
58
  // For React, you will need to import our React-specific component build
59
- // which wraps the web component using @lit-labs/react
59
+ // which wraps the web component using ​@lit/react
60
60
  import { PieDivider } from '@justeattakeaway/pie-divider/dist/react';
61
61
  ```
62
62
 
package/dist/index.d.ts CHANGED
File without changes
package/dist/index.js CHANGED
@@ -1,60 +1,60 @@
1
- import { unsafeCSS as u, LitElement as f, html as g } from "lit";
1
+ import { unsafeCSS as h, LitElement as u, html as f } from "lit";
2
2
  import { property as c } from "lit/decorators.js";
3
- const l = (i, e, r) => function(t, o) {
3
+ const l = (i, e, t) => function(r, o) {
4
4
  const n = `#${o}`;
5
- Object.defineProperty(t, o, {
5
+ Object.defineProperty(r, o, {
6
6
  get() {
7
7
  return this[n];
8
8
  },
9
9
  set(s) {
10
- const p = this[n];
11
10
  e.includes(s) ? this[n] = s : (console.error(
12
11
  `<${i}> Invalid value "${s}" provided for property "${o}".`,
13
12
  `Must be one of: ${e.join(" | ")}.`,
14
- `Falling back to default value: "${r}"`
15
- ), this[n] = r), this.requestUpdate(o, p);
16
- }
13
+ `Falling back to default value: "${t}"`
14
+ ), this[n] = t);
15
+ },
16
+ configurable: !0
17
17
  });
18
18
  };
19
- function m(i, e) {
19
+ function g(i, e) {
20
20
  customElements.get(i) ? console.warn(`PIE Web Component: "${i}" has already been defined. Please ensure the component is only being defined once in your application.`) : customElements.define(i, e);
21
21
  }
22
- const b = `.c-divider{--divider-bg-color: var(--dt-color-divider-default);--divider-width: 100%;--divider-height: 1px;margin:0;border:0;width:var(--divider-width);height:var(--divider-height);background-color:var(--divider-bg-color)}.c-divider[variant=inverse]{--divider-bg-color: var(--dt-color-divider-inverse)}.c-divider[orientation=vertical]{--divider-width: 1px;--divider-height: 100%}
23
- `, P = ["default", "inverse"], y = ["horizontal", "vertical"];
24
- var $ = Object.defineProperty, w = Object.getOwnPropertyDescriptor, h = (i, e, r, d) => {
25
- for (var t = d > 1 ? void 0 : d ? w(e, r) : e, o = i.length - 1, n; o >= 0; o--)
26
- (n = i[o]) && (t = (d ? n(e, r, t) : n(t)) || t);
27
- return d && t && $(e, r, t), t;
22
+ const m = `.c-divider{--divider-bg-color: var(--dt-color-divider-default);--divider-width: 100%;--divider-height: 1px;margin:0;border:0;width:var(--divider-width);height:var(--divider-height);background-color:var(--divider-bg-color)}.c-divider[variant=inverse]{--divider-bg-color: var(--dt-color-divider-inverse)}.c-divider[orientation=vertical]{--divider-width: 1px;--divider-height: 100%}
23
+ `, b = ["default", "inverse"], y = ["horizontal", "vertical"];
24
+ var P = Object.defineProperty, $ = Object.getOwnPropertyDescriptor, p = (i, e, t, d) => {
25
+ for (var r = d > 1 ? void 0 : d ? $(e, t) : e, o = i.length - 1, n; o >= 0; o--)
26
+ (n = i[o]) && (r = (d ? n(e, t, r) : n(r)) || r);
27
+ return d && r && P(e, t, r), r;
28
28
  };
29
29
  const v = "pie-divider";
30
- class a extends f {
30
+ class a extends u {
31
31
  constructor() {
32
32
  super(...arguments), this.variant = "default", this.orientation = "horizontal";
33
33
  }
34
34
  render() {
35
- const { variant: e, orientation: r } = this;
36
- return g`
35
+ const { variant: e, orientation: t } = this;
36
+ return f`
37
37
  <hr
38
38
  data-test-id="pie-divider"
39
39
  aria-hidden="true"
40
40
  class="c-divider"
41
41
  variant=${e}
42
- orientation=${r}
42
+ orientation=${t}
43
43
  />`;
44
44
  }
45
45
  }
46
- a.styles = u(b);
47
- h([
46
+ a.styles = h(m);
47
+ p([
48
48
  c({ type: String }),
49
- l(v, P, "default")
49
+ l(v, b, "default")
50
50
  ], a.prototype, "variant", 2);
51
- h([
51
+ p([
52
52
  c({ type: String }),
53
53
  l(v, y, "horizontal")
54
54
  ], a.prototype, "orientation", 2);
55
- m(v, a);
55
+ g(v, a);
56
56
  export {
57
57
  a as PieDivider,
58
58
  y as orientations,
59
- P as variants
59
+ b as variants
60
60
  };
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-labs/react';
3
+ import type { ReactWebComponent } from '@lit/react';
4
4
  import type { TemplateResult } from 'lit-html';
5
5
 
6
6
  export declare interface DividerProps {
package/dist/react.js CHANGED
@@ -1,72 +1,18 @@
1
- import * as g from "react";
2
- import { PieDivider as D } from "./index.js";
3
- import { orientations as k, variants as A } from "./index.js";
1
+ import * as e from "react";
2
+ import { createComponent as i } from "@lit/react";
3
+ import { PieDivider as r } from "./index.js";
4
+ import { orientations as d, variants as v } 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 E = /* @__PURE__ */ new Set(["children", "localName", "ref", "style", "className"]), w = /* @__PURE__ */ new WeakMap(), b = (t, i, c, m, p) => {
12
- const s = p == null ? void 0 : p[i];
13
- s === void 0 || c === m ? c == null && i in HTMLElement.prototype ? t.removeAttribute(i) : t[i] = c : ((r, n, v) => {
14
- let a = w.get(r);
15
- a === void 0 && w.set(r, a = /* @__PURE__ */ new Map());
16
- let l = a.get(n);
17
- v !== void 0 ? l === void 0 ? (a.set(n, l = { handleEvent: v }), r.addEventListener(n, l)) : l.handleEvent = v : l !== void 0 && (a.delete(n), r.removeEventListener(n, l));
18
- })(t, s, c);
19
- }, M = (t, i) => {
20
- typeof t == "function" ? t(i) : t.current = i;
21
- };
22
- function P(t = window.React, i, c, m, p) {
23
- let s, r, n;
24
- if (i === void 0) {
25
- const d = t;
26
- ({ tagName: r, elementClass: n, events: m, displayName: p } = d), s = d.react;
27
- } else
28
- s = t, n = c, r = i;
29
- const v = s.Component, a = s.createElement, l = new Set(Object.keys(m ?? {}));
30
- class f extends v {
31
- constructor() {
32
- super(...arguments), this.o = null;
33
- }
34
- t(e) {
35
- if (this.o !== null)
36
- for (const h in this.i)
37
- b(this.o, h, this.props[h], e ? e[h] : void 0, m);
38
- }
39
- componentDidMount() {
40
- var e;
41
- this.t(), (e = this.o) === null || e === void 0 || e.removeAttribute("defer-hydration");
42
- }
43
- componentDidUpdate(e) {
44
- this.t(e);
45
- }
46
- render() {
47
- const { _$Gl: e, ...h } = this.props;
48
- this.h !== e && (this.u = (o) => {
49
- e !== null && M(e, o), this.o = o, this.h = e;
50
- }), this.i = {};
51
- const u = { ref: this.u };
52
- for (const [o, y] of Object.entries(h))
53
- E.has(o) ? u[o === "className" ? "class" : o] = y : l.has(o) || o in n.prototype ? this.i[o] = y : u[o] = y;
54
- return u.suppressHydrationWarning = !0, a(r, u);
55
- }
56
- }
57
- f.displayName = p ?? n.name;
58
- const N = s.forwardRef((d, e) => a(f, { ...d, _$Gl: e }, d == null ? void 0 : d.children));
59
- return N.displayName = f.displayName, N;
60
- }
61
- const R = P({
7
+ const p = i({
62
8
  displayName: "PieDivider",
63
- elementClass: D,
64
- react: g,
9
+ elementClass: r,
10
+ react: e,
65
11
  tagName: "pie-divider",
66
12
  events: {}
67
13
  });
68
14
  export {
69
- R as PieDivider,
70
- k as orientations,
71
- A as variants
15
+ p as PieDivider,
16
+ d as orientations,
17
+ v as variants
72
18
  };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@justeattakeaway/pie-divider",
3
3
  "description": "PIE Design System Divider built using Web Components",
4
- "version": "0.9.1",
4
+ "version": "0.9.2",
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.4.0"
31
+ "@justeattakeaway/pie-components-config": "0.6.0"
32
32
  },
33
33
  "dependencies": {
34
- "@justeattakeaway/pie-webc-core": "0.11.0"
34
+ "@justeattakeaway/pie-webc-core": "0.12.0"
35
35
  },
36
36
  "volta": {
37
37
  "extends": "../../../package.json"