@justeattakeaway/pie-modal 0.43.2 → 0.43.4
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 +1 -1
- package/custom-elements.json +1 -1
- package/dist/index.d.ts +6 -6
- package/dist/index.js +2 -2
- package/dist/react.d.ts +6 -6
- package/package.json +6 -6
- package/src/defs.ts +9 -9
package/README.md
CHANGED
|
@@ -28,7 +28,7 @@ yarn add @justeattakeaway/pie-modal
|
|
|
28
28
|
|
|
29
29
|
## Documentation
|
|
30
30
|
|
|
31
|
-
Visit [Modal | PIE Design System](https://pie.design/components/modal
|
|
31
|
+
Visit [Modal | PIE Design System](https://pie.design/components/modal) to view more information on this component.
|
|
32
32
|
|
|
33
33
|
## Questions
|
|
34
34
|
|
package/custom-elements.json
CHANGED
|
@@ -87,7 +87,7 @@
|
|
|
87
87
|
"type": {
|
|
88
88
|
"text": "DefaultProps"
|
|
89
89
|
},
|
|
90
|
-
"default": "{\n
|
|
90
|
+
"default": "{\n hasBackButton: false,\n hasStackedActions: false,\n headingLevel: 'h2',\n isOpen: false,\n isDismissible: false,\n isFooterPinned: true,\n isFullWidthBelowMid: false,\n isLoading: false,\n position: 'center',\n size: 'medium',\n}"
|
|
91
91
|
}
|
|
92
92
|
],
|
|
93
93
|
"exports": [
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ComponentDefaultProps } from '@justeattakeaway/pie-webc-core';
|
|
2
2
|
import type { CSSResult } from 'lit';
|
|
3
3
|
import type { GenericConstructor } from '@justeattakeaway/pie-webc-core';
|
|
4
4
|
import type { LitElement } from 'lit';
|
|
@@ -28,7 +28,7 @@ export declare type AriaProps = {
|
|
|
28
28
|
loading?: string;
|
|
29
29
|
};
|
|
30
30
|
|
|
31
|
-
export declare type DefaultProps =
|
|
31
|
+
export declare type DefaultProps = ComponentDefaultProps<ModalProps, keyof Omit<ModalProps, 'aria' | 'heading' | 'leadingAction' | 'supportingAction' | 'returnFocusAfterCloseSelector'>>;
|
|
32
32
|
|
|
33
33
|
export declare const defaultProps: DefaultProps;
|
|
34
34
|
|
|
@@ -93,6 +93,10 @@ export declare type ModalProps = {
|
|
|
93
93
|
* The leading action configuration for the modal.
|
|
94
94
|
*/
|
|
95
95
|
leadingAction?: ActionProps;
|
|
96
|
+
/**
|
|
97
|
+
* The supporting action configuration for the modal.
|
|
98
|
+
*/
|
|
99
|
+
supportingAction?: ActionProps;
|
|
96
100
|
position?: typeof positions[number];
|
|
97
101
|
/**
|
|
98
102
|
* The selector for the element that you would like focus to be returned to when the modal is closed, e.g., #skipToMain
|
|
@@ -102,10 +106,6 @@ export declare type ModalProps = {
|
|
|
102
106
|
* The size of the modal; this controls how wide it will appear on the page.
|
|
103
107
|
*/
|
|
104
108
|
size?: typeof sizes[number];
|
|
105
|
-
/**
|
|
106
|
-
* The supporting action configuration for the modal.
|
|
107
|
-
*/
|
|
108
|
-
supportingAction?: ActionProps;
|
|
109
109
|
};
|
|
110
110
|
|
|
111
111
|
/**
|
package/dist/index.js
CHANGED
|
@@ -74,14 +74,14 @@ var S = typeof window < "u" && window.navigator && window.navigator.platform &&
|
|
|
74
74
|
};
|
|
75
75
|
const J = `*,*:after,*:before{box-sizing:inherit}dialog{position:absolute;left:0;right:0;width:-moz-fit-content;width:-webkit-fit-content;width:fit-content;height:-moz-fit-content;height:-webkit-fit-content;height:fit-content;margin:auto;border:solid;padding:1em;background:white;color:#000;display:block}dialog:not([open]){display:none}dialog+.backdrop{position:fixed;top:0;right:0;bottom:0;left:0;background:rgba(0,0,0,.1)}._dialog_overlay{position:fixed;top:0;right:0;bottom:0;left:0}dialog.fixed{position:fixed;top:50%;transform:translateY(-50%)}.c-modal{--modal-size-s: 450px;--modal-size-m: 600px;--modal-size-l: 1080px;--modal-border-radius: var(--dt-radius-rounded-d);--modal-font: var(--dt-font-interactive-l-family);--modal-bg-color: var(--dt-color-container-default);--modal-elevation: var(--dt-elevation-04);border-radius:var(--modal-border-radius);border:none;box-shadow:var(--modal-elevation);font-family:var(--modal-font);background-color:var(--modal-bg-color);padding:0;--modal-margin-none: var(--dt-spacing-none);--modal-margin-small: var(--dt-spacing-g);--modal-margin-large: var(--dt-spacing-j);--modal-margin-block: var(--modal-margin-small);--modal-block-size: fit-content;--modal-inline-size: 75%;--modal-max-block-size: calc(100vh - calc(var(--modal-margin-block) * 2));--modal-max-inline-size: var(--modal-size-m);block-size:var(--modal-block-size);inline-size:var(--modal-inline-size);max-block-size:var(--modal-max-block-size);max-inline-size:var(--modal-max-inline-size)}.c-modal:focus-visible{outline:none}@media (width < 768px){.c-modal pie-icon-button{--btn-dimension: 40px}}.c-modal[open]{display:flex;flex-direction:column}@media (min-width: 768px){.c-modal{--modal-margin-block: var(--modal-margin-large)}}.c-modal[size=small]{--modal-max-inline-size: var(--modal-size-s)}@media (min-width: 768px){.c-modal[size=small]{--modal-margin-block: var(--modal-margin-large)}}.c-modal[size=large]{--modal-inline-size: 75%;--modal-max-inline-size: var(--modal-size-l);--modal-margin-block: var(--modal-margin-large)}@media (width < 768px){.c-modal[size=large],.c-modal[size=medium][isfullwidthbelowmid]{--modal-margin-block: var(--modal-margin-none);--modal-border-radius: var(--dt-radius-rounded-none);--modal-block-size: 100%;--modal-inline-size: 100%;--modal-max-inline-size: 100%}.c-modal[size=large]>.c-modal-scrollContainer,.c-modal[size=medium][isfullwidthbelowmid]>.c-modal-scrollContainer{block-size:100%}}.c-modal[position=top]{margin-block-start:var(--dt-spacing-j);max-block-size:calc(100% - var(--dt-spacing-j) * 2)}@media (width < 768px){.c-modal[position=top][size=large],.c-modal[position=top][isfullwidthbelowmid][size=medium]{margin-block-start:var(--dt-spacing-none);max-block-size:100%}}.c-modal::backdrop{background:rgba(0,0,0,.55)}.c-modal .c-modal-footer{--modal-button-spacing: var(--dt-spacing-d);--modal-footer-padding: var(--dt-spacing-d);display:flex;flex-flow:row-reverse;flex-wrap:wrap;gap:var(--modal-button-spacing);padding:var(--modal-footer-padding)}@media (min-width: 768px){.c-modal .c-modal-footer{--modal-footer-padding: var(--dt-spacing-e)}}@media (width < 768px){.c-modal[hasstackedactions] .c-modal-footer{flex-direction:column}}.c-modal .c-modal-header{display:grid;grid-template-areas:"back heading close";grid-template-columns:minmax(0,max-content) minmax(0,1fr) minmax(0,max-content);align-items:start}.c-modal .c-modal-heading{--modal-header-font-size: calc(var(--dt-font-heading-m-size--narrow) * 1px);--modal-header-font-line-height: calc(var(--dt-font-heading-m-line-height--narrow) * 1px);--modal-header-font-weight: var(--dt-font-heading-m-weight);font-size:var(--modal-header-font-size);line-height:var(--modal-header-font-line-height);font-weight:var(--modal-header-font-weight);margin:0;grid-area:heading;margin-inline-start:var(--dt-spacing-d);margin-inline-end:var(--dt-spacing-d);margin-block:14px}@media (min-width: 768px){.c-modal .c-modal-heading{--modal-header-font-size: calc(var(--dt-font-heading-m-size--wide) * 1px);--modal-header-font-line-height: calc(var(--dt-font-heading-m-line-height--wide) * 1px);margin-inline-start:var(--dt-spacing-e);margin-inline-end:var(--dt-spacing-e);margin-block:20px}}.c-modal[hasbackbutton] .c-modal-heading{margin-inline-start:var(--dt-spacing-b)}@media (min-width: 768px){.c-modal[hasbackbutton] .c-modal-heading{margin-inline-start:var(--dt-spacing-c)}}.c-modal[isdismissible] .c-modal-heading{margin-inline-end:var(--dt-spacing-d)}@media (min-width: 768px){.c-modal[isdismissible] .c-modal-heading{margin-inline-end:var(--dt-spacing-e)}}.c-modal .c-modal-backBtn{grid-area:back;margin-block-start:var(--dt-spacing-b);margin-block-end:var(--dt-spacing-b);margin-inline-start:var(--dt-spacing-b);margin-inline-end:var(--dt-spacing-none)}@media (min-width: 768px){.c-modal .c-modal-backBtn{margin-block-start:var(--dt-spacing-c);margin-block-end:var(--dt-spacing-c);margin-inline-start:var(--dt-spacing-c);margin-inline-end:var(--dt-spacing-none)}}.c-modal .c-modal-closeBtn{grid-area:close;margin-block-start:var(--dt-spacing-b);margin-block-end:var(--dt-spacing-b);margin-inline-start:var(--dt-spacing-none);margin-inline-end:var(--dt-spacing-b)}@media (min-width: 768px){.c-modal .c-modal-closeBtn{margin-block-start:var(--dt-spacing-c);margin-block-end:var(--dt-spacing-c);margin-inline-start:var(--dt-spacing-none);margin-inline-end:var(--dt-spacing-c)}}.c-modal .c-modal-content{--modal-content-font-size: calc(var(--dt-font-size-16) * 1px);--modal-content-font-weight: var(--dt-font-weight-regular);--modal-content-line-height: calc(var(--dt-font-size-16-line-height) * 1px);--modal-content-padding-block: var(--dt-spacing-a);--modal-content-padding-inline: var(--dt-spacing-d);position:relative;min-block-size:var(--dt-spacing-j);font-size:var(--modal-content-font-size);line-height:var(--modal-content-line-height);font-weight:var(--modal-content-font-weight);padding-inline-start:var(--modal-content-padding-inline);padding-inline-end:var(--modal-content-padding-inline);padding-block-start:var(--modal-content-padding-block);padding-block-end:var(--modal-content-padding-block-end);flex-grow:1}@media (min-width: 768px){.c-modal .c-modal-content{--modal-content-padding-inline: var(--dt-spacing-e)}}.c-modal .c-modal-content.c-modal-hasFooterActions{padding-block-end:var(--modal-content-padding-block)}.c-modal .c-modal-content--scrollable{background:linear-gradient(to bottom,transparent,var(--dt-color-container-default) 75%) center bottom,linear-gradient(transparent,var(--dt-color-border-strong)) center bottom;background-repeat:no-repeat;background-size:100% 48px,100% 12px;background-attachment:local,scroll}.c-modal>.c-modal-scrollContainer{display:flex;flex-direction:column;overflow-y:auto;--bg-scroll-end: linear-gradient(rgba(255, 255, 255, 0), var(--dt-color-container-default) 70%) 0 100%;--bg-scroll-bottom: radial-gradient(farthest-corner at 50% 100%, rgba(0, 0, 0, .3), rgba(0, 0, 0, 0)) 0 100%;--bg-size-scroll-end: 100% 40px;--bg-size-scroll-bottom: 100% 8px;background:var(--bg-scroll-end),var(--bg-scroll-bottom);background-repeat:no-repeat;background-size:var(--bg-size-scroll-end),var(--bg-size-scroll-bottom);background-attachment:local,scroll}.c-modal>.c-modal-scrollContainer .c-modal-content{flex-shrink:0}.c-modal[isfooterpinned] .c-modal-content{overflow-y:auto}.c-modal[isLoading] .c-modal-content pie-spinner{position:absolute;left:50%;top:50%;transform:translate(-50%,-50%)}.c-modal[isLoading] .c-modal-content .c-modal-contentInner{display:none}@supports not (aspect-ratio: 1/1){.c-modal .c-modal-scrollContainer{background:none}}
|
|
76
76
|
`, Q = ["h1", "h2", "h3", "h4", "h5", "h6"], Z = ["small", "medium", "large"], ee = ["top", "center"], _ = "pie-modal-close", w = "pie-modal-open", C = "pie-modal-back", ie = "pie-modal-leading-action-click", oe = "pie-modal-supporting-action-click", d = {
|
|
77
|
-
headingLevel: "h2",
|
|
78
77
|
hasBackButton: !1,
|
|
79
78
|
hasStackedActions: !1,
|
|
79
|
+
headingLevel: "h2",
|
|
80
|
+
isOpen: !1,
|
|
80
81
|
isDismissible: !1,
|
|
81
82
|
isFooterPinned: !0,
|
|
82
83
|
isFullWidthBelowMid: !1,
|
|
83
84
|
isLoading: !1,
|
|
84
|
-
isOpen: !1,
|
|
85
85
|
position: "center",
|
|
86
86
|
size: "medium"
|
|
87
87
|
};
|
package/dist/react.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ComponentDefaultProps } from '@justeattakeaway/pie-webc-core';
|
|
2
2
|
import type { CSSResult } from 'lit';
|
|
3
3
|
import type { GenericConstructor } from '@justeattakeaway/pie-webc-core';
|
|
4
4
|
import type { LitElement } from 'lit';
|
|
@@ -29,7 +29,7 @@ export declare type AriaProps = {
|
|
|
29
29
|
loading?: string;
|
|
30
30
|
};
|
|
31
31
|
|
|
32
|
-
export declare type DefaultProps =
|
|
32
|
+
export declare type DefaultProps = ComponentDefaultProps<ModalProps, keyof Omit<ModalProps, 'aria' | 'heading' | 'leadingAction' | 'supportingAction' | 'returnFocusAfterCloseSelector'>>;
|
|
33
33
|
|
|
34
34
|
export declare const defaultProps: DefaultProps;
|
|
35
35
|
|
|
@@ -90,6 +90,10 @@ export declare type ModalProps = {
|
|
|
90
90
|
* The leading action configuration for the modal.
|
|
91
91
|
*/
|
|
92
92
|
leadingAction?: ActionProps;
|
|
93
|
+
/**
|
|
94
|
+
* The supporting action configuration for the modal.
|
|
95
|
+
*/
|
|
96
|
+
supportingAction?: ActionProps;
|
|
93
97
|
position?: typeof positions[number];
|
|
94
98
|
/**
|
|
95
99
|
* The selector for the element that you would like focus to be returned to when the modal is closed, e.g., #skipToMain
|
|
@@ -99,10 +103,6 @@ export declare type ModalProps = {
|
|
|
99
103
|
* The size of the modal; this controls how wide it will appear on the page.
|
|
100
104
|
*/
|
|
101
105
|
size?: typeof sizes[number];
|
|
102
|
-
/**
|
|
103
|
-
* The supporting action configuration for the modal.
|
|
104
|
-
*/
|
|
105
|
-
supportingAction?: ActionProps;
|
|
106
106
|
};
|
|
107
107
|
|
|
108
108
|
/**
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@justeattakeaway/pie-modal",
|
|
3
|
-
"version": "0.43.
|
|
3
|
+
"version": "0.43.4",
|
|
4
4
|
"description": "PIE design system modal built using web components",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -46,11 +46,11 @@
|
|
|
46
46
|
"extends": "../../../package.json"
|
|
47
47
|
},
|
|
48
48
|
"dependencies": {
|
|
49
|
-
"@justeattakeaway/pie-button": "0.47.
|
|
50
|
-
"@justeattakeaway/pie-icon-button": "0.28.
|
|
51
|
-
"@justeattakeaway/pie-icons-webc": "0.24.
|
|
52
|
-
"@justeattakeaway/pie-spinner": "0.6.
|
|
53
|
-
"@justeattakeaway/pie-webc-core": "0.
|
|
49
|
+
"@justeattakeaway/pie-button": "0.47.8",
|
|
50
|
+
"@justeattakeaway/pie-icon-button": "0.28.9",
|
|
51
|
+
"@justeattakeaway/pie-icons-webc": "0.24.2",
|
|
52
|
+
"@justeattakeaway/pie-spinner": "0.6.6",
|
|
53
|
+
"@justeattakeaway/pie-webc-core": "0.24.0",
|
|
54
54
|
"body-scroll-lock": "3.1.5",
|
|
55
55
|
"dialog-polyfill": "0.5.6"
|
|
56
56
|
},
|
package/src/defs.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type
|
|
1
|
+
import { type ComponentDefaultProps } from '@justeattakeaway/pie-webc-core';
|
|
2
2
|
|
|
3
3
|
import { Variant } from '@justeattakeaway/pie-button/src/defs.ts';
|
|
4
4
|
|
|
@@ -93,6 +93,11 @@ export type ModalProps = {
|
|
|
93
93
|
*/
|
|
94
94
|
leadingAction?: ActionProps;
|
|
95
95
|
|
|
96
|
+
/**
|
|
97
|
+
* The supporting action configuration for the modal.
|
|
98
|
+
*/
|
|
99
|
+
supportingAction?: ActionProps;
|
|
100
|
+
|
|
96
101
|
/*
|
|
97
102
|
* The position of the modal; this controls where it will appear on the page.
|
|
98
103
|
*/
|
|
@@ -107,11 +112,6 @@ export type ModalProps = {
|
|
|
107
112
|
* The size of the modal; this controls how wide it will appear on the page.
|
|
108
113
|
*/
|
|
109
114
|
size?: typeof sizes[number];
|
|
110
|
-
|
|
111
|
-
/**
|
|
112
|
-
* The supporting action configuration for the modal.
|
|
113
|
-
*/
|
|
114
|
-
supportingAction?: ActionProps;
|
|
115
115
|
};
|
|
116
116
|
|
|
117
117
|
/**
|
|
@@ -151,17 +151,17 @@ export const ON_MODAL_SUPPORTING_ACTION_CLICK = 'pie-modal-supporting-action-cli
|
|
|
151
151
|
|
|
152
152
|
export type ModalActionType = 'leading' | 'supporting';
|
|
153
153
|
|
|
154
|
-
export type DefaultProps =
|
|
154
|
+
export type DefaultProps = ComponentDefaultProps<ModalProps, keyof Omit<ModalProps, 'aria' | 'heading' | 'leadingAction' | 'supportingAction' | 'returnFocusAfterCloseSelector'>>;
|
|
155
155
|
|
|
156
156
|
export const defaultProps: DefaultProps = {
|
|
157
|
-
headingLevel: 'h2',
|
|
158
157
|
hasBackButton: false,
|
|
159
158
|
hasStackedActions: false,
|
|
159
|
+
headingLevel: 'h2',
|
|
160
|
+
isOpen: false,
|
|
160
161
|
isDismissible: false,
|
|
161
162
|
isFooterPinned: true,
|
|
162
163
|
isFullWidthBelowMid: false,
|
|
163
164
|
isLoading: false,
|
|
164
|
-
isOpen: false,
|
|
165
165
|
position: 'center',
|
|
166
166
|
size: 'medium',
|
|
167
167
|
};
|