@justeattakeaway/pie-modal 0.10.0 → 0.11.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
+ [5:08:22 PM] @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
8
+ dist/index.js 13.38 kB │ gzip: 4.21 kB
9
9
  dist/react.js 59.04 kB │ gzip: 15.92 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 10.29s
13
+ [vite:dts] Declaration files built in 9310ms.
14
14
  
package/CHANGELOG.md CHANGED
@@ -1,5 +1,13 @@
1
1
  # @justeattakeaway/pie-modal
2
2
 
3
+ ## 0.11.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [Changed] - Ensure component implements it's props interface ([#611](https://github.com/justeattakeaway/pie/pull/611)) by [@jamieomaguire](https://github.com/jamieomaguire)
8
+
9
+ - [Fixed] - Added IconClose to Visual tests and modal ([#604](https://github.com/justeattakeaway/pie/pull/604)) by [@ashleynolan](https://github.com/ashleynolan)
10
+
3
11
  ## 0.10.0
4
12
 
5
13
  ### 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([
@@ -7,7 +7,7 @@ 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
+ export declare class PieModal extends PieModal_base implements ModalProps {
11
11
  heading: string;
12
12
  headingLevel: ModalProps['headingLevel'];
13
13
  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,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M,CAAC,MAAM,0BAAqB;CACrC;AAID,OAAO,CAAC,MAAM,CAAC;IACX,UAAU,qBAAqB;QAC3B,CAAC,iBAAiB,CAAC,EAAE,QAAQ,CAAC;KACjC;CACJ"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@justeattakeaway/pie-modal",
3
- "version": "0.10.0",
3
+ "version": "0.11.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,7 @@ export { type ModalProps, headingLevels, sizes };
22
23
 
23
24
  const componentSelector = 'pie-modal';
24
25
 
25
- export class PieModal extends RtlMixin(LitElement) {
26
+ export class PieModal extends RtlMixin(LitElement) implements ModalProps {
26
27
  @property({ type: String })
27
28
  @requiredProperty(componentSelector)
28
29
  public heading!: string;
@@ -233,12 +234,15 @@ export class PieModal extends RtlMixin(LitElement) {
233
234
  *
234
235
  * @private
235
236
  */
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>`;
237
+ private renderCloseButton (): TemplateResult {
238
+ return html`
239
+ <pie-icon-button
240
+ @click="${() => { this.isOpen = false; }}"
241
+ variant="ghost-secondary"
242
+ class="c-modal-closeBtn"
243
+ data-test-id="modal-close-button"><icon-close /></pie-icon-button>
244
+ `;
245
+ }
242
246
 
243
247
  // Renders a `CSSResult` generated from SCSS by Vite
244
248
  static styles = unsafeCSS(styles);