@warp-ds/elements 2.10.0-next.22 → 2.10.0-next.24
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/dist/custom-elements.json +100 -18
- package/dist/docs/modal/api.md +3 -1
- package/dist/docs/modal/modal.md +82 -9
- package/dist/docs/modal/styling.md +75 -0
- package/dist/docs/modal/usage.md +4 -8
- package/dist/index.d.ts +134 -4
- package/dist/packages/modal/modal.d.ts +17 -2
- package/dist/packages/modal/modal.js +176 -129
- package/dist/packages/modal/modal.js.map +4 -4
- package/dist/packages/modal/modal.stories.d.ts +5 -4
- package/dist/packages/modal/modal.stories.js +41 -38
- package/dist/packages/modal/styles.d.ts +1 -0
- package/dist/packages/modal/styles.js +171 -0
- package/dist/packages/modal-footer/modal-footer.d.ts +5 -1
- package/dist/packages/modal-footer/modal-footer.js +25 -22
- package/dist/packages/modal-footer/modal-footer.js.map +4 -4
- package/dist/packages/modal-footer/styles.d.ts +1 -0
- package/dist/packages/modal-footer/styles.js +22 -0
- package/dist/packages/modal-header/modal-header.d.ts +12 -5
- package/dist/packages/modal-header/modal-header.js +149 -141
- package/dist/packages/modal-header/modal-header.js.map +4 -4
- package/dist/packages/modal-header/styles.d.ts +1 -0
- package/dist/packages/modal-header/styles.js +96 -0
- package/dist/packages/textarea/react.d.ts +1 -1
- package/dist/packages/textarea/textarea.d.ts +2 -4
- package/dist/packages/textarea/textarea.js.map +2 -2
- package/dist/packages/textarea/textarea.react.stories.d.ts +19 -2
- package/dist/packages/textarea/textarea.react.stories.js +17 -0
- package/dist/packages/textfield/textfield.react.stories.d.ts +30 -0
- package/dist/packages/textfield/textfield.react.stories.js +32 -0
- package/dist/web-types.json +50 -4
- package/eik/index.js +16 -16
- package/package.json +1 -1
|
@@ -2,6 +2,7 @@ import { spread } from "@open-wc/lit-helpers";
|
|
|
2
2
|
import { getStorybookHelpers } from "@wc-toolkit/storybook-helpers";
|
|
3
3
|
import { html } from "lit";
|
|
4
4
|
import { prespread } from "../../.storybook/utilities.js";
|
|
5
|
+
import "../button/button.js";
|
|
5
6
|
import "./modal.js";
|
|
6
7
|
import "../modal-header/modal-header.js";
|
|
7
8
|
import "../modal-footer/modal-footer.js";
|
|
@@ -13,25 +14,26 @@ const meta = {
|
|
|
13
14
|
};
|
|
14
15
|
export default meta;
|
|
15
16
|
export const Default = {
|
|
16
|
-
args: {
|
|
17
|
-
|
|
17
|
+
args: {
|
|
18
|
+
show: false,
|
|
19
|
+
back: false,
|
|
20
|
+
noClose: false,
|
|
21
|
+
},
|
|
22
|
+
render({ show, back, noClose }) {
|
|
18
23
|
return html `
|
|
19
|
-
<w-button id="modal-open-button-one" aria-haspopup="dialog"
|
|
20
|
-
|
|
21
|
-
>
|
|
22
|
-
<w-modal id="example-modal-one">
|
|
24
|
+
<w-button id="modal-open-button-one" aria-haspopup="dialog">
|
|
25
|
+
Open a modal
|
|
26
|
+
</w-button>
|
|
27
|
+
<w-modal id="example-modal-one" ?show="${show}">
|
|
23
28
|
<w-modal-header
|
|
24
29
|
id="modal-header-one"
|
|
25
30
|
slot="header"
|
|
26
31
|
title="An example modal"
|
|
32
|
+
?back="${back}"
|
|
33
|
+
?no-close="${noClose}"
|
|
27
34
|
></w-modal-header>
|
|
28
35
|
<div slot="content">
|
|
29
|
-
<
|
|
30
|
-
<div style="margin-bottom: 12px">
|
|
31
|
-
<w-button id="modal-toggle-back-one" variant="utility" small
|
|
32
|
-
>Toggle back button</w-button
|
|
33
|
-
>
|
|
34
|
-
</div>
|
|
36
|
+
<p class="t4">Triumph by Wu Tang Clan</p>
|
|
35
37
|
<p>
|
|
36
38
|
I bomb atomically, Socrates' philosophies and hypotheses Can't
|
|
37
39
|
define how I be droppin' these mockeries Lyrically perform armed
|
|
@@ -87,14 +89,12 @@ export const Default = {
|
|
|
87
89
|
</p>
|
|
88
90
|
</div>
|
|
89
91
|
<w-modal-footer slot="footer">
|
|
90
|
-
<
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
>
|
|
97
|
-
</div>
|
|
92
|
+
<w-button variant="secondary" id="modal-close-button-cancel">
|
|
93
|
+
Cancel
|
|
94
|
+
</w-button>
|
|
95
|
+
<w-button variant="primary" id="modal-close-button-one">
|
|
96
|
+
Confirm
|
|
97
|
+
</w-button>
|
|
98
98
|
</w-modal-footer>
|
|
99
99
|
</w-modal>
|
|
100
100
|
`;
|
|
@@ -108,10 +108,8 @@ export const Default = {
|
|
|
108
108
|
]);
|
|
109
109
|
const openButton = canvasElement.querySelector("#modal-open-button-one");
|
|
110
110
|
const closeButton = canvasElement.querySelector("#modal-close-button-one");
|
|
111
|
-
const toggleBackButton = canvasElement.querySelector("#modal-toggle-back-one");
|
|
112
111
|
const cancelButton = canvasElement.querySelector("#modal-close-button-cancel");
|
|
113
112
|
const modal = canvasElement.querySelector("#example-modal-one");
|
|
114
|
-
const modalHeader = canvasElement.querySelector("#modal-header-one");
|
|
115
113
|
if (openButton && modal) {
|
|
116
114
|
openButton.addEventListener("click", () => modal.open());
|
|
117
115
|
}
|
|
@@ -121,11 +119,6 @@ export const Default = {
|
|
|
121
119
|
if (cancelButton && modal) {
|
|
122
120
|
cancelButton.addEventListener("click", () => modal.close());
|
|
123
121
|
}
|
|
124
|
-
if (toggleBackButton && modalHeader) {
|
|
125
|
-
toggleBackButton.addEventListener("click", () => {
|
|
126
|
-
modalHeader.back = !modalHeader.back;
|
|
127
|
-
});
|
|
128
|
-
}
|
|
129
122
|
},
|
|
130
123
|
parameters: {
|
|
131
124
|
docs: {
|
|
@@ -136,8 +129,12 @@ export const Default = {
|
|
|
136
129
|
},
|
|
137
130
|
};
|
|
138
131
|
export const InvokerCommands = {
|
|
139
|
-
args: {
|
|
140
|
-
|
|
132
|
+
args: {
|
|
133
|
+
show: false,
|
|
134
|
+
back: false,
|
|
135
|
+
noClose: false,
|
|
136
|
+
},
|
|
137
|
+
render({ show, back, noClose }) {
|
|
141
138
|
return html `
|
|
142
139
|
<w-button
|
|
143
140
|
commandfor="invoker-modal"
|
|
@@ -145,14 +142,16 @@ export const InvokerCommands = {
|
|
|
145
142
|
aria-haspopup="dialog"
|
|
146
143
|
>Open a modal</w-button
|
|
147
144
|
>
|
|
148
|
-
<w-modal id="invoker-modal">
|
|
145
|
+
<w-modal id="invoker-modal" ?show="${show}">
|
|
149
146
|
<w-modal-header
|
|
150
147
|
id="modal-header-one"
|
|
151
148
|
slot="header"
|
|
152
149
|
title="An example modal"
|
|
150
|
+
?back="${back}"
|
|
151
|
+
?no-close="${noClose}"
|
|
153
152
|
></w-modal-header>
|
|
154
153
|
<div slot="content">
|
|
155
|
-
<
|
|
154
|
+
<p class="t4">Triumph by Wu Tang Clan</p>
|
|
156
155
|
<p>
|
|
157
156
|
I bomb atomically, Socrates' philosophies and hypotheses Can't
|
|
158
157
|
define how I be droppin' these mockeries Lyrically perform armed
|
|
@@ -230,17 +229,21 @@ export const InvokerCommands = {
|
|
|
230
229
|
},
|
|
231
230
|
};
|
|
232
231
|
export const WithImage = {
|
|
233
|
-
args: {
|
|
234
|
-
|
|
232
|
+
args: {
|
|
233
|
+
show: false,
|
|
234
|
+
noClose: false,
|
|
235
|
+
},
|
|
236
|
+
render({ show, noClose }) {
|
|
235
237
|
return html `
|
|
236
238
|
<w-button id="modal-open-button-two" aria-haspopup="dialog"
|
|
237
239
|
>Open a modal</w-button
|
|
238
240
|
>
|
|
239
|
-
<w-modal
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
241
|
+
<w-modal id="example-modal-two" ?show="${show}">
|
|
242
|
+
<w-modal-header
|
|
243
|
+
slot="header"
|
|
244
|
+
title="Look a doggo!"
|
|
245
|
+
?no-close="${noClose}"
|
|
246
|
+
>
|
|
244
247
|
<img
|
|
245
248
|
slot="top"
|
|
246
249
|
style="height: 256px; width: 100%; object-fit: cover;"
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const styles: import("lit").CSSResult;
|
|
@@ -0,0 +1,171 @@
|
|
|
1
|
+
import { css } from "lit";
|
|
2
|
+
export const styles = css `
|
|
3
|
+
:host {
|
|
4
|
+
--_backdrop-bg: var(
|
|
5
|
+
--w-c-modal-backdrop-color,
|
|
6
|
+
light-dark(rgba(0, 0, 0, 0.3), rgba(0, 0, 0, 0.75))
|
|
7
|
+
);
|
|
8
|
+
--_background-color: var(--w-c-modal-bg, var(--w-s-color-background));
|
|
9
|
+
--_box-shadow: var(--w-c-modal-box-shadow, var(--w-shadow-l));
|
|
10
|
+
--_color: var(--w-c-modal-color, var(--w-s-color-text));
|
|
11
|
+
--_height: var(
|
|
12
|
+
--w-c-modal-height,
|
|
13
|
+
var(--w-modal-height) /* --w-modal-height kept for backwards compat */
|
|
14
|
+
);
|
|
15
|
+
--_max-height: var(
|
|
16
|
+
--w-c-modal-max-height,
|
|
17
|
+
var(--w-modal-max-height, 80%)
|
|
18
|
+
/* --w-modal-max-height kept for backwards compat */
|
|
19
|
+
);
|
|
20
|
+
--_min-height: var(
|
|
21
|
+
--w-c-modal-min-height,
|
|
22
|
+
var(--w-modal-min-heigh)
|
|
23
|
+
/* --w-modal-min-height kept for backwards compat */
|
|
24
|
+
);
|
|
25
|
+
--_translate-distance: var(
|
|
26
|
+
--w-c-modal-translate-distance,
|
|
27
|
+
var(--w-modal-translate-distance, 100%)
|
|
28
|
+
/* --w-modal-translate-distance kept for backwards compat */
|
|
29
|
+
);
|
|
30
|
+
--_width: var(
|
|
31
|
+
--w-c-modal-width,
|
|
32
|
+
var(--w-modal-width, 640px)
|
|
33
|
+
/* --w-modal-width kept for backwards compat */
|
|
34
|
+
);
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
[part="dialog"] {
|
|
38
|
+
background-color: transparent;
|
|
39
|
+
border-width: 0;
|
|
40
|
+
align-items: flex-end;
|
|
41
|
+
inset: 0rem;
|
|
42
|
+
height: unset;
|
|
43
|
+
max-height: unset;
|
|
44
|
+
max-width: unset;
|
|
45
|
+
width: unset;
|
|
46
|
+
margin: auto;
|
|
47
|
+
padding: 0rem;
|
|
48
|
+
backface-visibility: hidden;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
[part="dialog"]::backdrop {
|
|
52
|
+
background: var(--_backdrop-bg);
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
[part="wrapper"] {
|
|
56
|
+
will-change: height;
|
|
57
|
+
border-radius: 8px;
|
|
58
|
+
display: flex;
|
|
59
|
+
flex-direction: column;
|
|
60
|
+
overflow: hidden;
|
|
61
|
+
position: relative;
|
|
62
|
+
background-color: var(--_background-color);
|
|
63
|
+
color: var(--_color);
|
|
64
|
+
box-shadow: var(--_box-shadow);
|
|
65
|
+
height: var(--_height);
|
|
66
|
+
max-height: var(--_max-height);
|
|
67
|
+
min-height: var(--_min-height);
|
|
68
|
+
width: var(--_width);
|
|
69
|
+
backface-visibility: hidden;
|
|
70
|
+
padding-bottom: calc(32px + env(safe-area-inset-bottom, 0px));
|
|
71
|
+
transition-property: all;
|
|
72
|
+
transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
|
|
73
|
+
transition-duration: 150ms;
|
|
74
|
+
transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
[part="content"] {
|
|
78
|
+
display: block;
|
|
79
|
+
flex-shrink: 1;
|
|
80
|
+
flex-grow: 1;
|
|
81
|
+
overflow-x: hidden;
|
|
82
|
+
overflow-y: auto;
|
|
83
|
+
position: relative;
|
|
84
|
+
margin-bottom: 0rem;
|
|
85
|
+
padding-left: 1.6rem;
|
|
86
|
+
padding-right: 1.6rem;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
@media (min-width: 480px) {
|
|
90
|
+
[part="dialog"] {
|
|
91
|
+
--w-c-modal-translate-distance: 50%;
|
|
92
|
+
place-content: center;
|
|
93
|
+
place-items: center;
|
|
94
|
+
}
|
|
95
|
+
[part="wrapper"] {
|
|
96
|
+
margin-left: 1.6rem;
|
|
97
|
+
margin-right: 1.6rem;
|
|
98
|
+
padding-bottom: 3.2rem;
|
|
99
|
+
}
|
|
100
|
+
[part="content"] {
|
|
101
|
+
padding-left: 3.2rem;
|
|
102
|
+
padding-right: 3.2rem;
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
@media (max-width: 479.9px) {
|
|
107
|
+
[part="wrapper"] {
|
|
108
|
+
border-bottom-left-radius: 0;
|
|
109
|
+
border-bottom-right-radius: 0;
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
[part="dialog"][open] {
|
|
114
|
+
animation: w-modal-in 0.3s ease-in-out forwards;
|
|
115
|
+
display: flex;
|
|
116
|
+
position: fixed;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
[part="dialog"].close {
|
|
120
|
+
animation: w-modal-out 0.3s ease-in-out forwards;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
[part="dialog"][open]::backdrop {
|
|
124
|
+
animation: backdrop-in 0.3s ease-in-out forwards;
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
[part="dialog"].close::backdrop {
|
|
128
|
+
animation: backdrop-out 0.3s ease-in-out forwards;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
/* shouldn't need two (in/out) animations declared here, but reversing is being weird */
|
|
132
|
+
@keyframes w-modal-in {
|
|
133
|
+
from {
|
|
134
|
+
transform: translateY(var(--_translate-distance));
|
|
135
|
+
opacity: 0;
|
|
136
|
+
}
|
|
137
|
+
to {
|
|
138
|
+
transform: translateY(0);
|
|
139
|
+
opacity: 1;
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
@keyframes w-modal-out {
|
|
144
|
+
from {
|
|
145
|
+
transform: translateY(0);
|
|
146
|
+
opacity: 1;
|
|
147
|
+
}
|
|
148
|
+
to {
|
|
149
|
+
transform: translateY(var(--_translate-distance));
|
|
150
|
+
opacity: 0;
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
@keyframes backdrop-in {
|
|
155
|
+
from {
|
|
156
|
+
background: transparent;
|
|
157
|
+
}
|
|
158
|
+
to {
|
|
159
|
+
background: var(--_backdrop-bg);
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
@keyframes backdrop-out {
|
|
164
|
+
from {
|
|
165
|
+
background: var(--_backdrop-bg);
|
|
166
|
+
}
|
|
167
|
+
to {
|
|
168
|
+
background: transparent;
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
`;
|
|
@@ -8,10 +8,14 @@ declare const WarpModalFooter_base: import("../modal/util.js").Constructor<{
|
|
|
8
8
|
* The footer section of a modal, typically where you place actions.
|
|
9
9
|
*
|
|
10
10
|
* @parent w-modal
|
|
11
|
+
*
|
|
12
|
+
* @csspart footer - the container for slotted items (children).
|
|
13
|
+
*
|
|
14
|
+
* @cssprop --w-c-modal-footer-gap - adjusts the flex gap between actions in the footer.
|
|
11
15
|
*/
|
|
12
16
|
export declare class WarpModalFooter extends WarpModalFooter_base {
|
|
13
|
-
render(): import("lit").TemplateResult<1>;
|
|
14
17
|
static styles: import("lit").CSSResult[];
|
|
18
|
+
render(): import("lit").TemplateResult<1>;
|
|
15
19
|
}
|
|
16
20
|
/** @deprecated Exported for backwards compatibility. Use WarpModalFooter. */
|
|
17
21
|
export declare const ModalFooter: typeof WarpModalFooter;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{html as g,LitElement as v}from"lit";var t=e=>class extends e{constructor(){super(...arguments);this.patchClose=!0;this._close=null}close(){this._close()}},a=e=>class extends e{handleSlotChange(o){let d=o.target.assignedNodes({flatten:!0});for(let l of d.filter(c=>c.patchClose))l._close=()=>this.close()}};import{css as s}from"lit";import{unsafeCSS as b}from"lit";var i=s`
|
|
2
2
|
*,
|
|
3
3
|
:before,
|
|
4
4
|
:after {
|
|
@@ -271,7 +271,7 @@ import{css as b,html as p,LitElement as g}from"lit";var t=e=>class extends e{con
|
|
|
271
271
|
svg {
|
|
272
272
|
pointer-events: none;
|
|
273
273
|
}
|
|
274
|
-
`,
|
|
274
|
+
`,x=b(`*, :before, :after {
|
|
275
275
|
--w-rotate: 0;
|
|
276
276
|
--w-rotate-x: 0;
|
|
277
277
|
--w-rotate-y: 0;
|
|
@@ -2437,24 +2437,27 @@ import{css as b,html as p,LitElement as g}from"lit";var t=e=>class extends e{con
|
|
|
2437
2437
|
display: none
|
|
2438
2438
|
}
|
|
2439
2439
|
}
|
|
2440
|
-
`);var
|
|
2441
|
-
|
|
2442
|
-
|
|
2443
|
-
|
|
2444
|
-
|
|
2445
|
-
|
|
2446
|
-
|
|
2447
|
-
|
|
2448
|
-
|
|
2449
|
-
|
|
2450
|
-
|
|
2451
|
-
|
|
2452
|
-
|
|
2453
|
-
|
|
2454
|
-
|
|
2455
|
-
|
|
2456
|
-
|
|
2457
|
-
|
|
2458
|
-
|
|
2459
|
-
|
|
2440
|
+
`);import{css as p}from"lit";var n=p`
|
|
2441
|
+
:host {
|
|
2442
|
+
--_gap: var(--w-c-modal-footer-gap, 8px);
|
|
2443
|
+
}
|
|
2444
|
+
|
|
2445
|
+
[part="footer"] {
|
|
2446
|
+
display: flex;
|
|
2447
|
+
justify-content: flex-end;
|
|
2448
|
+
padding-left: 1.6rem;
|
|
2449
|
+
padding-right: 1.6rem;
|
|
2450
|
+
padding-top: 2.4rem;
|
|
2451
|
+
gap: var(--_gap);
|
|
2452
|
+
}
|
|
2453
|
+
|
|
2454
|
+
@media (min-width: 480px) {
|
|
2455
|
+
[part="footer"] {
|
|
2456
|
+
padding-left: 3.2rem;
|
|
2457
|
+
padding-right: 3.2rem;
|
|
2458
|
+
}
|
|
2459
|
+
}
|
|
2460
|
+
`;var r=class extends t(a(v)){render(){return g`
|
|
2461
|
+
<slot part="footer" @slotchange="${this.handleSlotChange}"></slot>
|
|
2462
|
+
`}};r.styles=[i,n];var _=r;customElements.get("w-modal-footer")||customElements.define("w-modal-footer",r);export{_ as ModalFooter,r as WarpModalFooter};
|
|
2460
2463
|
//# sourceMappingURL=modal-footer.js.map
|