@justeattakeaway/pie-modal 0.1.1 → 0.2.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.
@@ -1,11 +1,11 @@
1
1
  vite v4.2.1 building for production...
2
2
  transforming...
3
- ✓ 1 modules transformed.
3
+ ✓ 5 modules transformed.
4
4
  rendering chunks...
5
5
  computing gzip size...
6
- dist/index.js 0.63 kB │ gzip: 0.40 kB
6
+ dist/index.js 1.78 kB │ gzip: 0.81 kB
7
7
  
8
8
  [vite:dts] Start generate declaration files...
9
- ✓ built in 24.45s
10
- [vite:dts] Declaration files built in 23862ms.
9
+ ✓ built in 23.66s
10
+ [vite:dts] Declaration files built in 23401ms.
11
11
  
package/CHANGELOG.md CHANGED
@@ -1,5 +1,16 @@
1
1
  # @justeattakeaway/pie-modal
2
2
 
3
+ ## 0.2.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [Changed] - use RTL mixin on component ([#478](https://github.com/justeattakeaway/pie/pull/478)) by [@jamieomaguire](https://github.com/jamieomaguire)
8
+
9
+ ### Patch Changes
10
+
11
+ - Updated dependencies [[`1f79d9d1a`](https://github.com/justeattakeaway/pie/commit/1f79d9d1a6fe9160b244e82d956290136b87187b)]:
12
+ - @justeattakeaway/pie-webc-core@0.1.0
13
+
3
14
  ## 0.1.1
4
15
 
5
16
  ### Patch Changes
package/dist/index.js CHANGED
@@ -1,22 +1,51 @@
1
- import { LitElement as p, html as v } from "lit";
2
- import { customElement as f } from "lit/decorators.js";
3
- var n = Object.defineProperty, P = Object.getOwnPropertyDescriptor, _ = (i, r, l, t) => {
4
- for (var e = t > 1 ? void 0 : t ? P(r, l) : r, o = i.length - 1, s; o >= 0; o--)
5
- (s = i[o]) && (e = (t ? s(r, l, e) : s(e)) || e);
6
- return t && e && n(r, l, e), e;
1
+ import { html as p, LitElement as f } from "lit";
2
+ import { customElement as u } from "lit/decorators.js";
3
+ import { property as m } from "lit/decorators/property.js";
4
+ var v = Object.defineProperty, _ = Object.getOwnPropertyDescriptor, c = (i, e, s, t) => {
5
+ for (var r = t > 1 ? void 0 : t ? _(e, s) : e, o = i.length - 1, l; o >= 0; o--)
6
+ (l = i[o]) && (r = (t ? l(e, s, r) : l(r)) || r);
7
+ return t && r && v(e, s, r), r;
7
8
  };
8
- let m = class extends p {
9
+ const d = (i) => {
10
+ class e extends i {
11
+ constructor() {
12
+ super(...arguments), this.dir = "";
13
+ }
14
+ /**
15
+ * Returns true if the element is in Right to Left mode.
16
+ * If a dir attribute is not explicitly set on the web component
17
+ * then it falls back to the nearest parent with a dir attribute set.
18
+ *
19
+ * A dir attribute being set will result in a reactive property.
20
+ * If the component falls back to a parent dir attribute then the value
21
+ * will not be reactive and is only computed once
22
+ */
23
+ get isRTL() {
24
+ var t;
25
+ return this.dir === "ltr" ? !1 : this.dir === "rtl" || ((t = window == null ? void 0 : window.getComputedStyle(this)) == null ? void 0 : t.direction) === "rtl";
26
+ }
27
+ }
28
+ return c([
29
+ m({ type: String })
30
+ ], e.prototype, "dir", 2), e;
31
+ };
32
+ var a = Object.defineProperty, P = Object.getOwnPropertyDescriptor, h = (i, e, s, t) => {
33
+ for (var r = t > 1 ? void 0 : t ? P(e, s) : e, o = i.length - 1, l; o >= 0; o--)
34
+ (l = i[o]) && (r = (t ? l(e, s, r) : l(r)) || r);
35
+ return t && r && a(e, s, r), r;
36
+ };
37
+ let n = class extends d(f) {
9
38
  // eslint-disable-next-line class-methods-use-this
10
39
  render() {
11
- return v`
40
+ return p`
12
41
  <div>This is the Pie Modal
13
42
  <slot></slot>
14
43
  </div>`;
15
44
  }
16
45
  };
17
- m = _([
18
- f("pie-modal")
19
- ], m);
46
+ n = h([
47
+ u("pie-modal")
48
+ ], n);
20
49
  export {
21
- m as PieModal
50
+ n as PieModal
22
51
  };
@@ -1 +1 @@
1
- export * from './src/index'
1
+ export * from './packages/components/pie-modal/src/index'
@@ -0,0 +1,15 @@
1
+ import { LitElement } from 'lit';
2
+ declare const PieModal_base: (new (...args: any[]) => {
3
+ dir: string;
4
+ isRTL: boolean;
5
+ }) & typeof LitElement;
6
+ export declare class PieModal extends PieModal_base {
7
+ render(): import("lit-html").TemplateResult<1>;
8
+ }
9
+ declare global {
10
+ interface HTMLElementTagNameMap {
11
+ 'pie-modal': PieModal;
12
+ }
13
+ }
14
+ export {};
15
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAQ,MAAM,KAAK,CAAC;;;;;AAIvC,qBACa,QAAS,SAAQ,aAAoB;IAE9C,MAAM;CAMT;AAED,OAAO,CAAC,MAAM,CAAC;IACX,UAAU,qBAAqB;QAC3B,WAAW,EAAE,QAAQ,CAAC;KACzB;CACJ"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@justeattakeaway/pie-modal",
3
- "version": "0.1.1",
3
+ "version": "0.2.0",
4
4
  "description": "PIE design system modal built using web components",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -13,6 +13,9 @@
13
13
  },
14
14
  "author": "JustEatTakeaway - Design System Web Team",
15
15
  "license": "Apache-2.0",
16
+ "dependencies": {
17
+ "@justeattakeaway/pie-webc-core": "workspace:*"
18
+ },
16
19
  "volta": {
17
20
  "extends": "../../../package.json"
18
21
  }
package/src/index.ts CHANGED
@@ -1,8 +1,9 @@
1
1
  import { LitElement, html } from 'lit'; // eslint-disable-line import/no-extraneous-dependencies
2
2
  import { customElement } from 'lit/decorators.js'; // eslint-disable-line import/no-extraneous-dependencies
3
+ import { RtlMixin } from '@justeattakeaway/pie-webc-core';
3
4
 
4
5
  @customElement('pie-modal')
5
- export class PieModal extends LitElement {
6
+ export class PieModal extends RtlMixin(LitElement) {
6
7
  // eslint-disable-next-line class-methods-use-this
7
8
  render () {
8
9
  return html`
@@ -1,10 +0,0 @@
1
- import { LitElement } from 'lit';
2
- export declare class PieModal extends LitElement {
3
- render(): import("lit-html").TemplateResult<1>;
4
- }
5
- declare global {
6
- interface HTMLElementTagNameMap {
7
- 'pie-modal': PieModal;
8
- }
9
- }
10
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAQ,MAAM,KAAK,CAAC;AAGvC,qBACa,QAAS,SAAQ,UAAU;IAEpC,MAAM;CAMT;AAED,OAAO,CAAC,MAAM,CAAC;IACX,UAAU,qBAAqB;QAC3B,WAAW,EAAE,QAAQ,CAAC;KACzB;CACJ"}