@justeattakeaway/pie-modal 0.10.0 → 0.12.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,14 +1,14 @@
1
- [2:59:55 PM] @custom-elements-manifest/analyzer: Created new manifest.
1
+ [9:29:39 AM] @custom-elements-manifest/analyzer: Created new manifest.
2
2
  react wrapper has been added!
3
3
  vite v4.3.9 building for production...
4
4
  transforming...
5
- ✓ 23 modules transformed.
5
+ ✓ 25 modules transformed.
6
6
  rendering chunks...
7
7
  computing gzip size...
8
- dist/index.js 13.21 kB │ gzip: 4.16 kB
9
- dist/react.js 59.04 kB │ gzip: 15.92 kB
8
+ dist/index.js 13.38 kB │ gzip: 4.21 kB
9
+ dist/react.js 59.18 kB │ gzip: 15.97 kB
10
10
  
11
11
  [vite:dts] Start generate declaration files...
12
- ✓ built in 10.22s
13
- [vite:dts] Declaration files built in 9231ms.
12
+ ✓ built in 9.68s
13
+ [vite:dts] Declaration files built in 8742ms.
14
14
  
package/CHANGELOG.md CHANGED
@@ -1,5 +1,19 @@
1
1
  # @justeattakeaway/pie-modal
2
2
 
3
+ ## 0.12.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [Added] - @event jsdoc comments for modal events for react wrapper to analyse ([#612](https://github.com/justeattakeaway/pie/pull/612)) by [@jamieomaguire](https://github.com/jamieomaguire)
8
+
9
+ ## 0.11.0
10
+
11
+ ### Minor Changes
12
+
13
+ - [Changed] - Ensure component implements it's props interface ([#611](https://github.com/justeattakeaway/pie/pull/611)) by [@jamieomaguire](https://github.com/jamieomaguire)
14
+
15
+ - [Fixed] - Added IconClose to Visual tests and modal ([#604](https://github.com/justeattakeaway/pie/pull/604)) by [@ashleynolan](https://github.com/ashleynolan)
16
+
3
17
  ## 0.10.0
4
18
 
5
19
  ### Minor Changes
package/dist/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { nothing as x, unsafeCSS as D, LitElement as B } from "lit";
2
- import { html as z, unsafeStatic as E } from "lit/static-html.js";
2
+ import { unsafeStatic as E, html as z } from "lit/static-html.js";
3
3
  import { property as u, query as L } from "lit/decorators.js";
4
4
  import { property as T } from "lit/decorators/property.js";
5
5
  var $ = Object.defineProperty, F = Object.getOwnPropertyDescriptor, A = (n, e, t, o) => {
@@ -176,14 +176,7 @@ class a extends k(B) {
176
176
  composed: !0
177
177
  });
178
178
  this.dispatchEvent(t);
179
- }, this.renderCloseButton = () => z`
180
- <pie-icon-button
181
- @click="${() => {
182
- this.isOpen = !1;
183
- }}"
184
- variant="ghost-secondary"
185
- class="c-modal-closeBtn"
186
- data-test-id="modal-close-button"></pie-icon-button>`, this.addEventListener("click", (e) => this._handleDialogLightDismiss(e));
179
+ }, this.addEventListener("click", (e) => this._handleDialogLightDismiss(e));
187
180
  }
188
181
  connectedCallback() {
189
182
  super.connectedCallback(), document.addEventListener(v, this._handleModalOpened.bind(this)), document.addEventListener(_, this._handleModalClosed.bind(this));
@@ -256,6 +249,23 @@ class a extends k(B) {
256
249
  </dialog>
257
250
  `;
258
251
  }
252
+ /**
253
+ * Template for the close button element. Called within the
254
+ * main render function.
255
+ *
256
+ * @private
257
+ */
258
+ renderCloseButton() {
259
+ return z`
260
+ <pie-icon-button
261
+ @click="${() => {
262
+ this.isOpen = !1;
263
+ }}"
264
+ variant="ghost-secondary"
265
+ class="c-modal-closeBtn"
266
+ data-test-id="modal-close-button"><icon-close /></pie-icon-button>
267
+ `;
268
+ }
259
269
  }
260
270
  a.styles = D(X);
261
271
  s([
package/dist/react.js CHANGED
@@ -1585,7 +1585,12 @@ const Qr = zr({
1585
1585
  elementClass: Nr,
1586
1586
  react: Vr,
1587
1587
  tagName: "pie-modal",
1588
- events: {}
1588
+ events: {
1589
+ onpiemodalopen: "pie-modal-open",
1590
+ // when the modal is opened.
1591
+ onpiemodalclose: "pie-modal-close"
1592
+ // when the modal is closed.
1593
+ }
1589
1594
  });
1590
1595
  export {
1591
1596
  Qr as PieModal
@@ -7,7 +7,11 @@ declare const PieModal_base: (new (...args: any[]) => {
7
7
  dir: string;
8
8
  isRTL: boolean;
9
9
  }) & typeof LitElement;
10
- export declare class PieModal extends PieModal_base {
10
+ /**
11
+ * @event {CustomEvent} pie-modal-open - when the modal is opened.
12
+ * @event {CustomEvent} pie-modal-close - when the modal is closed.
13
+ */
14
+ export declare class PieModal extends PieModal_base implements ModalProps {
11
15
  heading: string;
12
16
  headingLevel: ModalProps['headingLevel'];
13
17
  isDismissible: boolean;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,UAAU,EAAW,cAAc,EACtC,MAAM,KAAK,CAAC;AAMb,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,gCAAgC,CAAC;AAGnE,OAAO,EACH,UAAU,EACV,aAAa,EAGb,KAAK,EACR,MAAM,QAAQ,CAAC;AAGhB,OAAO,EAAE,KAAK,UAAU,EAAE,aAAa,EAAE,KAAK,EAAE,CAAC;AAEjD,QAAA,MAAM,iBAAiB,cAAc,CAAC;;;;;AAEtC,qBAAa,QAAS,SAAQ,aAAoB;IAGvC,OAAO,EAAG,MAAM,CAAC;IAIjB,YAAY,EAAE,UAAU,CAAC,cAAc,CAAC,CAAQ;IAGhD,aAAa,UAAS;IAGtB,mBAAmB,UAAS;IAG5B,MAAM,UAAS;IAGf,6BAA6B,CAAC,EAAE,MAAM,CAAC;IAIvC,IAAI,EAAE,UAAU,CAAC,MAAM,CAAC,CAAY;IAGvC,OAAO,CAAC,EAAE,iBAAiB,CAAC;;IAOhC,iBAAiB,IAAM,IAAI;IAM3B,oBAAoB,IAAM,IAAI;IAM9B,YAAY,CAAE,iBAAiB,EAAE,YAAY,CAAC,UAAU,CAAC,GAAI,IAAI;IASjE,OAAO,CAAE,iBAAiB,EAAE,YAAY,CAAC,UAAU,CAAC,GAAI,IAAI;IAI5D;;OAEG;IACH,OAAO,CAAC,kBAAkB;IAS1B;;OAEG;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IAAI;IAM3B,oBAAoB,IAAM,IAAI;IAM9B,YAAY,CAAE,iBAAiB,EAAE,YAAY,CAAC,UAAU,CAAC,GAAI,IAAI;IASjE,OAAO,CAAE,iBAAiB,EAAE,YAAY,CAAC,UAAU,CAAC,GAAI,IAAI;IAI5D;;OAEG;IACH,OAAO,CAAC,kBAAkB;IAS1B;;OAEG;IACH,OAAO,CAAC,kBAAkB;IAM1B;;;;;OAKG;IACH,OAAO,CAAC,wBAAwB,CAI9B;IAGF,OAAO,CAAC,kCAAkC;IAU1C,OAAO,CAAC,4BAA4B;IAYpC;;;;OAIG;IACH,OAAO,CAAC,YAAY;IAQpB,MAAM;IA2BN;;;OAGG;IACH,OAAO,CAAC,yBAAyB,CAyB/B;IAEF;;;;;;;;;;OAUG;IACH,OAAO,CAAC,yBAAyB,CAO/B;IAEF;;;;;OAKG;IACH,OAAO,CAAC,iBAAiB;IAWzB,MAAM,CAAC,MAAM,0BAAqB;CACrC;AAID,OAAO,CAAC,MAAM,CAAC;IACX,UAAU,qBAAqB;QAC3B,CAAC,iBAAiB,CAAC,EAAE,QAAQ,CAAC;KACjC;CACJ"}
@@ -1,3 +1,7 @@
1
+ import { EventName } from '@lit-labs/react';
1
2
  import { PieModal as PieModalReact } from './index';
2
- export declare const PieModal: import("@lit-labs/react").ReactWebComponent<PieModalReact, {}>;
3
+ export declare const PieModal: import("@lit-labs/react").ReactWebComponent<PieModalReact, {
4
+ onpiemodalopen: EventName<CustomEvent<any>>;
5
+ onpiemodalclose: EventName<CustomEvent<any>>;
6
+ }>;
3
7
  //# sourceMappingURL=react.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"react.d.ts","sourceRoot":"","sources":["../../../src/react.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,QAAQ,IAAI,aAAa,EAAE,MAAM,SAAS,CAAC;AAGpD,eAAO,MAAM,QAAQ,gEAMnB,CAAC"}
1
+ {"version":3,"file":"react.d.ts","sourceRoot":"","sources":["../../../src/react.ts"],"names":[],"mappings":"AAEA,OAAO,EAAmB,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC7D,OAAO,EAAE,QAAQ,IAAI,aAAa,EAAE,MAAM,SAAS,CAAC;AAEpD,eAAO,MAAM,QAAQ;;;EASnB,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@justeattakeaway/pie-modal",
3
- "version": "0.10.0",
3
+ "version": "0.12.0",
4
4
  "description": "PIE design system modal built using web components",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -23,6 +23,7 @@
23
23
  "devDependencies": {
24
24
  "@justeattakeaway/pie-components-config": "workspace:*",
25
25
  "@justeattakeaway/pie-icon-button": "workspace:*",
26
+ "@justeattakeaway/pie-icons-webc": "workspace:*",
26
27
  "@justeattakeaway/pie-webc-core": "workspace:*",
27
28
  "@types/body-scroll-lock": "3.1.0"
28
29
  },
package/src/index.ts CHANGED
@@ -8,6 +8,7 @@ import {
8
8
  } from '@justeattakeaway/pie-webc-core';
9
9
  import type { DependentMap } from '@justeattakeaway/pie-webc-core';
10
10
  import { disableBodyScroll, enableBodyScroll } from 'body-scroll-lock';
11
+ import '@justeattakeaway/pie-icons-webc/icons/IconClose';
11
12
  import styles from './modal.scss?inline';
12
13
  import {
13
14
  ModalProps,
@@ -22,7 +23,11 @@ export { type ModalProps, headingLevels, sizes };
22
23
 
23
24
  const componentSelector = 'pie-modal';
24
25
 
25
- export class PieModal extends RtlMixin(LitElement) {
26
+ /**
27
+ * @event {CustomEvent} pie-modal-open - when the modal is opened.
28
+ * @event {CustomEvent} pie-modal-close - when the modal is closed.
29
+ */
30
+ export class PieModal extends RtlMixin(LitElement) implements ModalProps {
26
31
  @property({ type: String })
27
32
  @requiredProperty(componentSelector)
28
33
  public heading!: string;
@@ -233,12 +238,15 @@ export class PieModal extends RtlMixin(LitElement) {
233
238
  *
234
239
  * @private
235
240
  */
236
- private renderCloseButton = () : TemplateResult => html`
237
- <pie-icon-button
238
- @click="${() => { this.isOpen = false; }}"
239
- variant="ghost-secondary"
240
- class="c-modal-closeBtn"
241
- data-test-id="modal-close-button"></pie-icon-button>`;
241
+ private renderCloseButton (): TemplateResult {
242
+ return html`
243
+ <pie-icon-button
244
+ @click="${() => { this.isOpen = false; }}"
245
+ variant="ghost-secondary"
246
+ class="c-modal-closeBtn"
247
+ data-test-id="modal-close-button"><icon-close /></pie-icon-button>
248
+ `;
249
+ }
242
250
 
243
251
  // Renders a `CSSResult` generated from SCSS by Vite
244
252
  static styles = unsafeCSS(styles);