@justeattakeaway/pie-modal 0.35.6 → 0.36.1

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
@@ -8,16 +8,6 @@
8
8
  </a>
9
9
  </p>
10
10
 
11
- # Table of Contents
12
-
13
- 1. [Introduction](#pie-modal)
14
- 2. [Installation](#installation)
15
- 3. [Importing the component](#importing-the-component)
16
- 4. [Peer Dependencies](#peer-dependencies)
17
- 5. [Props](#props)
18
- 6. [Legacy browser support](#legacy-browser-support)
19
- 7. [Contributing](#contributing)
20
-
21
11
 
22
12
  ## pie-modal
23
13
 
@@ -38,84 +28,14 @@ $ npm i @justeattakeaway/pie-modal
38
28
  $ yarn add @justeattakeaway/pie-modal
39
29
  ```
40
30
 
41
- For full information on using PIE components as part of an application, check out the [Getting Started Guide](https://github.com/justeattakeaway/pie/wiki/Getting-started-with-PIE-Web-Components).
42
-
43
-
44
- ### Importing the component
45
-
46
- #### JavaScript
47
- ```js
48
- // Default – for Native JS Applications, Vue, Angular, Svelte, etc.
49
- import { PieModal } from '@justeattakeaway/pie-modal';
50
-
51
- // If you don't need to reference the imported object, you can simply
52
- // import the module which registers the component as a custom element.
53
- import '@justeattakeaway/pie-modal';
54
- ```
55
-
56
- #### React
57
- ```js
58
- // React
59
- // For React, you will need to import our React-specific component build
60
- // which wraps the web component using ​@lit/react
61
- import { PieModal } from '@justeattakeaway/pie-modal/dist/react';
62
- ```
63
-
64
- > [!NOTE]
65
- > When using the React version of the component, please make sure to also
66
- > include React as a [peer dependency](#peer-dependencies) in your project.
67
-
68
-
69
- ## Peer Dependencies
70
-
71
- > [!IMPORTANT]
72
- > When using `pie-modal`, you will also need to include a couple of dependencies to ensure the component renders as expected. See [the PIE Wiki](https://github.com/justeattakeaway/pie/wiki/Getting-started-with-PIE-Web-Components#expected-dependencies) for more information and how to include these in your application.
73
-
74
-
75
- ## Props
76
-
77
- | Property | Type | Default | Description |
78
- |-------------------------------|-----------|----------------|-------------|
79
- | aria | `Object` | `undefined` | An object representing the aria labels for the `close` & `back` buttons within the modal as well as the `isLoading` state labels (`aria-label` & `aria-busy`). |
80
- | hasBackButton | `Boolean` | `false` | If true, the modal includes a back button which closes the modal when clicked. |
81
- | hasStackedActions | `Boolean` | `false` | If true, the action buttons will be stacked (full width) at narrow breakpoints. |
82
- | heading | `String` | n/a (Required) | The heading text of the modal. |
83
- | headingLevel | `String` | `h2` | The HTML tag to use for the modal's heading (can be `h1`-`h6`). |
84
- | isDismissible | `Boolean` | `false` | If true, the modal includes a close button and can be dismissed by clicking on the backdrop or pressing the `Esc` key. |
85
- | isFooterPinned | `Boolean` | `true` | When false, the modal footer will scroll with the content inside the modal body. |
86
- | isFullWidthBelowMid | `Boolean` | `false` | If true and the page is narrower than the mid breakpoint, a **medium-sized** modal will take up the full width of the screen. |
87
- | isLoading | `Boolean` | `false` | When true, displays a loading spinner in the modal |
88
- | isOpen | `Boolean` | `false` | Controls if the modal element is open or closed |
89
- | leadingAction | `Object` | `undefined` | An object representing the leading action of the modal. It has the following properties:<br>- text (required): The text to display on the leading action button.<br>- variant: The variant of the leading action button. Please see [pie-button](https://github.com/justeattakeaway/pie/blob/main/packages/components/pie-button/README.md#props) for options. Defaults to primary if not provided.<br>- ariaLabel: The ARIA label for the leading action button. Example: `leadingAction = { text: "Example Text", variant: "secondary", ariaLabel: "Example Aria Label" }` |
90
- | position | `String` | `center` | The position of the modal; this controls where it will appear on the page. Can be `top` or `center`. |
91
- | returnFocusAfterCloseSelector | `String` | `undefined` | If provided, focus will be sent to the first element that matches this selector when the modal is closed. If not provided, the `dialog` element will return focus to the element that opened the modal. |
92
- | size | `String` | `medium` | Determines the maximum width of the modal. Large modals will expand to fill the entire page width at narrow viewports. Can be `small`, `medium` or `large`. |
93
- | supportingAction | `Object` | `undefined` | An object representing the supporting action of the modal. It has the following properties:<br>- text (required): The text to display on the supporting action button.<br>- variant: The variant of the supporting action button. Please see [pie-button](https://github.com/justeattakeaway/pie/blob/main/packages/components/pie-button/README.md#props) for options. Defaults to ghost if not provided.<br>- ariaLabel: The ARIA label for the supporting action button. Example: `supportingAction = { text: "Example Text", variant: "ghost", ariaLabel: "Example Aria Label" }` |
94
-
95
- In your markup or JSX, you can then use these to set the properties for the `pie-modal` component:
96
-
97
- ```html
98
- <!-- Native HTML -->
99
- <pie-modal heading='My Awesome Heading' headingLevel='h3'>Click me!</pie-modal>
100
-
101
- <!-- JSX -->
102
- <PieModal heading='My Awesome Heading' headingLevel='h3'>Click me!</PieModal>
103
- ```
104
-
105
- ## Legacy browser support
106
-
107
- `pie-modal` uses the Dialog element which might not be supported by legacy browsers.
108
-
109
- To support them, `pie-modal` uses the [dialog-polyfill](https://github.com/GoogleChrome/dialog-polyfill) package. It works automatically and doesn't need any setup.
31
+ ## Documentation
110
32
 
111
- The polyfill comes with a few limitations, as noted on its [documentation page](https://github.com/GoogleChrome/dialog-polyfill#limitations):
112
- - Dialogs should not be contained by parents that create a stacking context
113
- - The browser's chrome may not always be accessible via the tab key
114
- - Changes to the CSS top/bottom values while open aren't retained
33
+ Visit [Modal | PIE Design System](https://pie.design/components/modal/overview) to view more information on this component.
115
34
 
116
- For more details, check the package documentation mentioned above.
35
+ ## Questions
117
36
 
37
+ Please head to [FAQs | PIE Design System](https://pie.design/support/contact-us/) to see our FAQs and get in touch.
118
38
 
119
39
  ## Contributing
120
40
 
121
- Check out our [contributing guide](https://github.com/justeattakeaway/pie/wiki/Contributing-Guide) for more information on [local development](https://github.com/justeattakeaway/pie/wiki/Contributing-Guide#local-development) and how to run specific [component tests](https://github.com/justeattakeaway/pie/wiki/Contributing-Guide#testing).
41
+ Check out our [contributing guide](https://github.com/justeattakeaway/pie/wiki/Contributing-Guide) for more information on [local development](https://github.com/justeattakeaway/pie/wiki/Contributing-Guide#local-development) and how to run specific [component tests](https://github.com/justeattakeaway/pie/wiki/Contributing-Guide#testing).
package/dist/index.d.ts CHANGED
@@ -1,4 +1,5 @@
1
1
  import type { CSSResult } from 'lit';
2
+ import type { GenericConstructor } from '@justeattakeaway/pie-webc-core';
2
3
  import type { LitElement } from 'lit';
3
4
  import type { PropertyValues } from 'lit';
4
5
  import type { TemplateResult } from 'lit';
@@ -251,9 +252,9 @@ export declare class PieModal extends PieModal_base implements ModalProps {
251
252
  private _dispatchModalCustomEvent;
252
253
  }
253
254
 
254
- declare const PieModal_base: (new (...args: any[]) => {
255
+ declare const PieModal_base: GenericConstructor<{
255
256
  isRTL: boolean;
256
- }) & typeof LitElement;
257
+ }> & typeof LitElement;
257
258
 
258
259
  export declare const positions: readonly ["top", "center"];
259
260
 
package/dist/react.d.ts CHANGED
@@ -1,5 +1,6 @@
1
1
  import type { CSSResult } from 'lit';
2
2
  import type { EventName } from '@lit/react';
3
+ import type { GenericConstructor } from '@justeattakeaway/pie-webc-core';
3
4
  import type { LitElement } from 'lit';
4
5
  import type { PropertyValues } from 'lit';
5
6
  import type { ReactWebComponent } from '@lit/react';
@@ -257,9 +258,9 @@ declare class PieModal_2 extends PieModal_base implements ModalProps {
257
258
  private _dispatchModalCustomEvent;
258
259
  }
259
260
 
260
- declare const PieModal_base: (new (...args: any[]) => {
261
+ declare const PieModal_base: GenericConstructor<{
261
262
  isRTL: boolean;
262
- }) & typeof LitElement;
263
+ }> & typeof LitElement;
263
264
 
264
265
  export declare const positions: readonly ["top", "center"];
265
266
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@justeattakeaway/pie-modal",
3
- "version": "0.35.6",
3
+ "version": "0.36.1",
4
4
  "description": "PIE design system modal built using web components",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -36,11 +36,11 @@
36
36
  "extends": "../../../package.json"
37
37
  },
38
38
  "dependencies": {
39
- "@justeattakeaway/pie-button": "0.41.1",
40
- "@justeattakeaway/pie-icon-button": "0.24.3",
41
- "@justeattakeaway/pie-icons-webc": "0.15.0",
42
- "@justeattakeaway/pie-spinner": "0.3.1",
43
- "@justeattakeaway/pie-webc-core": "0.13.0",
39
+ "@justeattakeaway/pie-button": "0.42.1",
40
+ "@justeattakeaway/pie-icon-button": "0.25.1",
41
+ "@justeattakeaway/pie-icons-webc": "0.16.1",
42
+ "@justeattakeaway/pie-spinner": "0.3.2",
43
+ "@justeattakeaway/pie-webc-core": "0.14.0",
44
44
  "body-scroll-lock": "3.1.5",
45
45
  "dialog-polyfill": "0.5.6"
46
46
  },