@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
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var
|
|
1
|
+
var x=Object.defineProperty;var k=Object.getOwnPropertyDescriptor;var n=(e,o,r,t)=>{for(var a=t>1?void 0:t?k(o,r):o,s=e.length-1,l;s>=0;s--)(l=e[s])&&(a=(t?l(o,r,a):l(a))||a);return t&&a&&x(o,r,a),a};import{html as M,LitElement as H}from"lit";import{property as b,query as p}from"lit/decorators.js";import{ifDefined as O}from"lit/directives/if-defined.js";var d=[],c={documentElement:{},body:{}},y=Object.freeze({documentElement:{"scrollbar-gutter":"stable"},body:{overflow:"hidden",position:"relative",height:"100%"}}),g=e=>{e.touches.length>1||e.preventDefault?.()},z=e=>([o,r])=>{c[e][o]=document[e].style[o],document[e].style[o]=r},E=()=>Object.entries(y).forEach(([e,o])=>{Object.entries(o).forEach(z(e))}),C=e=>([o,r])=>{document[e].style[o]=c[e][o]},_=()=>Object.entries(c).forEach(([e,o])=>{Object.entries(o).forEach(C(e))}),Y=e=>e.scrollHeight-Math.abs(e.scrollTop)===e.clientHeight;function T(e){let o=-1,r=t=>{if(t.targetTouches.length!==1)return;let a=t.targetTouches[0].clientY-o;return e.scrollTop===0&&a>0||Y(e)&&a<0?g(t):(t.stopPropagation(),!0)};e.ontouchstart=t=>{t.targetTouches.length===1&&(o=t.targetTouches[0].clientY)},e.ontouchmove=r}function j(e){e.ontouchstart=null,e.ontouchmove=null}var h=e=>()=>document[e?"addEventListener":"removeEventListener"]("touchmove",g,{passive:!1}),L=h(!0),B=h();function v(e){if(!e)throw Error("Could not run setup, an element must be provided");d.some(o=>o===e)||(d.length||(E(),L()),T(e),d.push(e))}function m(){d.forEach(j),B(),_(),d=[]}import{css as S}from"lit";import{unsafeCSS as X}from"lit";var u=S`
|
|
2
2
|
*,
|
|
3
3
|
:before,
|
|
4
4
|
:after {
|
|
@@ -271,7 +271,7 @@ var f=Object.defineProperty;var x=Object.getOwnPropertyDescriptor;var n=(e,o,r,t
|
|
|
271
271
|
svg {
|
|
272
272
|
pointer-events: none;
|
|
273
273
|
}
|
|
274
|
-
|
|
274
|
+
`,$=X(`*, :before, :after {
|
|
275
275
|
--w-rotate: 0;
|
|
276
276
|
--w-rotate-x: 0;
|
|
277
277
|
--w-rotate-y: 0;
|
|
@@ -2437,137 +2437,184 @@ var f=Object.defineProperty;var x=Object.getOwnPropertyDescriptor;var n=(e,o,r,t
|
|
|
2437
2437
|
display: none
|
|
2438
2438
|
}
|
|
2439
2439
|
}
|
|
2440
|
-
`);
|
|
2441
|
-
|
|
2442
|
-
|
|
2440
|
+
`);import{css as Z}from"lit";var w=Z`
|
|
2441
|
+
:host {
|
|
2442
|
+
--_backdrop-bg: var(
|
|
2443
|
+
--w-c-modal-backdrop-color,
|
|
2444
|
+
light-dark(rgba(0, 0, 0, 0.3), rgba(0, 0, 0, 0.75))
|
|
2445
|
+
);
|
|
2446
|
+
--_background-color: var(--w-c-modal-bg, var(--w-s-color-background));
|
|
2447
|
+
--_box-shadow: var(--w-c-modal-box-shadow, var(--w-shadow-l));
|
|
2448
|
+
--_color: var(--w-c-modal-color, var(--w-s-color-text));
|
|
2449
|
+
--_height: var(
|
|
2450
|
+
--w-c-modal-height,
|
|
2451
|
+
var(--w-modal-height) /* --w-modal-height kept for backwards compat */
|
|
2452
|
+
);
|
|
2453
|
+
--_max-height: var(
|
|
2454
|
+
--w-c-modal-max-height,
|
|
2455
|
+
var(--w-modal-max-height, 80%)
|
|
2456
|
+
/* --w-modal-max-height kept for backwards compat */
|
|
2457
|
+
);
|
|
2458
|
+
--_min-height: var(
|
|
2459
|
+
--w-c-modal-min-height,
|
|
2460
|
+
var(--w-modal-min-heigh)
|
|
2461
|
+
/* --w-modal-min-height kept for backwards compat */
|
|
2462
|
+
);
|
|
2463
|
+
--_translate-distance: var(
|
|
2464
|
+
--w-c-modal-translate-distance,
|
|
2465
|
+
var(--w-modal-translate-distance, 100%)
|
|
2466
|
+
/* --w-modal-translate-distance kept for backwards compat */
|
|
2467
|
+
);
|
|
2468
|
+
--_width: var(
|
|
2469
|
+
--w-c-modal-width,
|
|
2470
|
+
var(--w-modal-width, 640px)
|
|
2471
|
+
/* --w-modal-width kept for backwards compat */
|
|
2472
|
+
);
|
|
2473
|
+
}
|
|
2474
|
+
|
|
2475
|
+
[part="dialog"] {
|
|
2476
|
+
background-color: transparent;
|
|
2477
|
+
border-width: 0;
|
|
2478
|
+
align-items: flex-end;
|
|
2479
|
+
inset: 0rem;
|
|
2480
|
+
height: unset;
|
|
2481
|
+
max-height: unset;
|
|
2482
|
+
max-width: unset;
|
|
2483
|
+
width: unset;
|
|
2484
|
+
margin: auto;
|
|
2485
|
+
padding: 0rem;
|
|
2486
|
+
backface-visibility: hidden;
|
|
2487
|
+
}
|
|
2488
|
+
|
|
2489
|
+
[part="dialog"]::backdrop {
|
|
2490
|
+
background: var(--_backdrop-bg);
|
|
2491
|
+
}
|
|
2492
|
+
|
|
2493
|
+
[part="wrapper"] {
|
|
2494
|
+
will-change: height;
|
|
2495
|
+
border-radius: 8px;
|
|
2496
|
+
display: flex;
|
|
2497
|
+
flex-direction: column;
|
|
2498
|
+
overflow: hidden;
|
|
2499
|
+
position: relative;
|
|
2500
|
+
background-color: var(--_background-color);
|
|
2501
|
+
color: var(--_color);
|
|
2502
|
+
box-shadow: var(--_box-shadow);
|
|
2503
|
+
height: var(--_height);
|
|
2504
|
+
max-height: var(--_max-height);
|
|
2505
|
+
min-height: var(--_min-height);
|
|
2506
|
+
width: var(--_width);
|
|
2507
|
+
backface-visibility: hidden;
|
|
2508
|
+
padding-bottom: calc(32px + env(safe-area-inset-bottom, 0px));
|
|
2509
|
+
transition-property: all;
|
|
2510
|
+
transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
|
|
2511
|
+
transition-duration: 150ms;
|
|
2512
|
+
transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
|
|
2513
|
+
}
|
|
2514
|
+
|
|
2515
|
+
[part="content"] {
|
|
2516
|
+
display: block;
|
|
2517
|
+
flex-shrink: 1;
|
|
2518
|
+
flex-grow: 1;
|
|
2519
|
+
overflow-x: hidden;
|
|
2520
|
+
overflow-y: auto;
|
|
2521
|
+
position: relative;
|
|
2522
|
+
margin-bottom: 0rem;
|
|
2523
|
+
padding-left: 1.6rem;
|
|
2524
|
+
padding-right: 1.6rem;
|
|
2525
|
+
}
|
|
2526
|
+
|
|
2527
|
+
@media (min-width: 480px) {
|
|
2528
|
+
[part="dialog"] {
|
|
2529
|
+
--w-c-modal-translate-distance: 50%;
|
|
2530
|
+
place-content: center;
|
|
2531
|
+
place-items: center;
|
|
2532
|
+
}
|
|
2533
|
+
[part="wrapper"] {
|
|
2534
|
+
margin-left: 1.6rem;
|
|
2535
|
+
margin-right: 1.6rem;
|
|
2536
|
+
padding-bottom: 3.2rem;
|
|
2537
|
+
}
|
|
2538
|
+
[part="content"] {
|
|
2539
|
+
padding-left: 3.2rem;
|
|
2540
|
+
padding-right: 3.2rem;
|
|
2541
|
+
}
|
|
2542
|
+
}
|
|
2543
|
+
|
|
2544
|
+
@media (max-width: 479.9px) {
|
|
2545
|
+
[part="wrapper"] {
|
|
2546
|
+
border-bottom-left-radius: 0;
|
|
2547
|
+
border-bottom-right-radius: 0;
|
|
2548
|
+
}
|
|
2549
|
+
}
|
|
2550
|
+
|
|
2551
|
+
[part="dialog"][open] {
|
|
2552
|
+
animation: w-modal-in 0.3s ease-in-out forwards;
|
|
2553
|
+
display: flex;
|
|
2554
|
+
position: fixed;
|
|
2555
|
+
}
|
|
2556
|
+
|
|
2557
|
+
[part="dialog"].close {
|
|
2558
|
+
animation: w-modal-out 0.3s ease-in-out forwards;
|
|
2559
|
+
}
|
|
2560
|
+
|
|
2561
|
+
[part="dialog"][open]::backdrop {
|
|
2562
|
+
animation: backdrop-in 0.3s ease-in-out forwards;
|
|
2563
|
+
}
|
|
2564
|
+
|
|
2565
|
+
[part="dialog"].close::backdrop {
|
|
2566
|
+
animation: backdrop-out 0.3s ease-in-out forwards;
|
|
2567
|
+
}
|
|
2568
|
+
|
|
2569
|
+
/* shouldn't need two (in/out) animations declared here, but reversing is being weird */
|
|
2570
|
+
@keyframes w-modal-in {
|
|
2571
|
+
from {
|
|
2572
|
+
transform: translateY(var(--_translate-distance));
|
|
2573
|
+
opacity: 0;
|
|
2574
|
+
}
|
|
2575
|
+
to {
|
|
2576
|
+
transform: translateY(0);
|
|
2577
|
+
opacity: 1;
|
|
2578
|
+
}
|
|
2579
|
+
}
|
|
2580
|
+
|
|
2581
|
+
@keyframes w-modal-out {
|
|
2582
|
+
from {
|
|
2583
|
+
transform: translateY(0);
|
|
2584
|
+
opacity: 1;
|
|
2585
|
+
}
|
|
2586
|
+
to {
|
|
2587
|
+
transform: translateY(var(--_translate-distance));
|
|
2588
|
+
opacity: 0;
|
|
2589
|
+
}
|
|
2590
|
+
}
|
|
2591
|
+
|
|
2592
|
+
@keyframes backdrop-in {
|
|
2593
|
+
from {
|
|
2594
|
+
background: transparent;
|
|
2595
|
+
}
|
|
2596
|
+
to {
|
|
2597
|
+
background: var(--_backdrop-bg);
|
|
2598
|
+
}
|
|
2599
|
+
}
|
|
2600
|
+
|
|
2601
|
+
@keyframes backdrop-out {
|
|
2602
|
+
from {
|
|
2603
|
+
background: var(--_backdrop-bg);
|
|
2604
|
+
}
|
|
2605
|
+
to {
|
|
2606
|
+
background: transparent;
|
|
2607
|
+
}
|
|
2608
|
+
}
|
|
2609
|
+
`;var f=e=>class extends e{handleSlotChange(o){let r=o.target.assignedNodes({flatten:!0});for(let t of r.filter(a=>a.patchClose))t._close=()=>this.close()}};var i=class extends f(H){constructor(){super();this.show=!1;this.ignoreBackdropClicks=!1;this._isClosing=!1;this.interceptEscape=this.interceptEscape.bind(this),this.closeOnBackdropClick=this.closeOnBackdropClick.bind(this),this.eventPreventer=this.eventPreventer.bind(this),this.modifyBorderRadius=this.modifyBorderRadius.bind(this)}connectedCallback(){super.connectedCallback(),this.addEventListener("command",r=>{let t=r.command;t==="--show-modal"?this.open():(t==="--close"||t==="--confirm")&&this.close()})}async open(){this._isClosing=!1,this.dialogEl.classList.remove("close"),this.dialogEl.showModal(),this.handleListeners(),v(this.contentEl),await this.updateComplete,this.dispatchEvent(new CustomEvent("shown",{bubbles:!0,composed:!0}))}close(){this.dialogEl?.open&&(this._isClosing=!0,this.handleListeners("removeEventListener"),this.dialogEl.classList.add("close"),this.dialogEl.addEventListener("animationend",async r=>{r.animationName==="w-modal-out"&&this._isClosing&&(this.dialogEl.classList.remove("close"),this.dialogEl.close(),this._isClosing=!1,m(),this.show=!1,await this.updateComplete,this.dispatchEvent(new CustomEvent("hidden",{bubbles:!0,composed:!0})))},{once:!0}))}updated(r){!r.has("show")||r.get("show")===void 0&&this.show===!1||this[this.show?"open":"close"]()}handleListeners(r="addEventListener"){document[r]("keydown",this.interceptEscape),this.ignoreBackdropClicks||this.dialogEl[r]("mousedown",this.closeOnBackdropClick),this.dialogEl[r]("close",this.eventPreventer),this.dialogEl[r]("cancel",this.eventPreventer),this.dialogInnerEl[r]("transitionend",this.modifyBorderRadius)}eventPreventer(r){r.preventDefault()}closeOnBackdropClick(r){this.dialogEl===r.target&&this.close()}interceptEscape(r){r.key==="Escape"&&(r.preventDefault(),this.close())}modifyBorderRadius(){this.dialogInnerEl.scrollHeight*1.02>innerHeight?this.dialogInnerEl.style.borderRadius="0px":this.dialogInnerEl.style.borderRadius=null}render(){return M`
|
|
2610
|
+
<dialog part="dialog">
|
|
2611
|
+
<div part="wrapper">
|
|
2443
2612
|
<slot name="header" @slotchange="${this.handleSlotChange}"></slot>
|
|
2444
|
-
<div
|
|
2613
|
+
<div part="content" id=${O(this.contentId)}>
|
|
2445
2614
|
<slot name="content" @slotchange="${this.handleSlotChange}"></slot>
|
|
2446
2615
|
</div>
|
|
2447
2616
|
<slot name="footer" @slotchange="${this.handleSlotChange}"></slot>
|
|
2448
2617
|
</div>
|
|
2449
2618
|
</dialog>
|
|
2450
|
-
`}
|
|
2451
|
-
.dialog-el {
|
|
2452
|
-
--w-modal-translate-distance: 100%;
|
|
2453
|
-
--w-modal-max-height: 80%;
|
|
2454
|
-
--w-modal-width: 640px;
|
|
2455
|
-
background-color: transparent;
|
|
2456
|
-
border-width: 0;
|
|
2457
|
-
align-items: flex-end;
|
|
2458
|
-
inset: 0rem;
|
|
2459
|
-
height: unset;
|
|
2460
|
-
max-height: unset;
|
|
2461
|
-
max-width: unset;
|
|
2462
|
-
width: unset;
|
|
2463
|
-
margin: auto;
|
|
2464
|
-
padding: 0rem;
|
|
2465
|
-
backface-visibility: hidden;
|
|
2466
|
-
}
|
|
2467
|
-
.dialog-inner-el {
|
|
2468
|
-
will-change: height;
|
|
2469
|
-
border-radius: 8px;
|
|
2470
|
-
display: flex;
|
|
2471
|
-
flex-direction: column;
|
|
2472
|
-
overflow: hidden;
|
|
2473
|
-
position: relative;
|
|
2474
|
-
background-color: var(--w-s-color-background);
|
|
2475
|
-
color: var(--w-s-color-text);
|
|
2476
|
-
box-shadow: var(--w-shadow-m);
|
|
2477
|
-
height: var(--w-modal-height);
|
|
2478
|
-
max-height: var(--w-modal-max-height);
|
|
2479
|
-
min-height: var(--w-modal-min-height);
|
|
2480
|
-
width: var(--w-modal-width);
|
|
2481
|
-
backface-visibility: hidden;
|
|
2482
|
-
padding-bottom: calc(32px + env(safe-area-inset-bottom, 0px));
|
|
2483
|
-
transition-property: all;
|
|
2484
|
-
transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
|
|
2485
|
-
transition-duration: 150ms;
|
|
2486
|
-
transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
|
|
2487
|
-
}
|
|
2488
|
-
.content-el {
|
|
2489
|
-
display: block;
|
|
2490
|
-
flex-shrink: 1;
|
|
2491
|
-
flex-grow: 1;
|
|
2492
|
-
overflow-x: hidden;
|
|
2493
|
-
overflow-y: auto;
|
|
2494
|
-
position: relative;
|
|
2495
|
-
margin-bottom: 0rem;
|
|
2496
|
-
padding-left: 1.6rem;
|
|
2497
|
-
padding-right: 1.6rem;
|
|
2498
|
-
}
|
|
2499
|
-
@media (min-width: 480px) {
|
|
2500
|
-
.dialog-el {
|
|
2501
|
-
--w-modal-translate-distance: 50%;
|
|
2502
|
-
place-content: center;
|
|
2503
|
-
place-items: center;
|
|
2504
|
-
}
|
|
2505
|
-
.dialog-inner-el {
|
|
2506
|
-
margin-left: 1.6rem;
|
|
2507
|
-
margin-right: 1.6rem;
|
|
2508
|
-
padding-bottom: 3.2rem;
|
|
2509
|
-
}
|
|
2510
|
-
.content-el {
|
|
2511
|
-
padding-left: 3.2rem;
|
|
2512
|
-
padding-right: 3.2rem;
|
|
2513
|
-
}
|
|
2514
|
-
}
|
|
2515
|
-
@media (max-width: 479.9px) {
|
|
2516
|
-
.dialog-inner-el {
|
|
2517
|
-
border-bottom-left-radius: 0;
|
|
2518
|
-
border-bottom-right-radius: 0;
|
|
2519
|
-
}
|
|
2520
|
-
}
|
|
2521
|
-
.dialog-el[open] {
|
|
2522
|
-
animation: w-modal-in 0.3s ease-in-out forwards;
|
|
2523
|
-
display: flex;
|
|
2524
|
-
position: fixed;
|
|
2525
|
-
}
|
|
2526
|
-
.dialog-el.close {
|
|
2527
|
-
animation: w-modal-out 0.3s ease-in-out forwards;
|
|
2528
|
-
}
|
|
2529
|
-
.dialog-el[open]::backdrop {
|
|
2530
|
-
animation: backdrop-in 0.3s ease-in-out forwards;
|
|
2531
|
-
}
|
|
2532
|
-
.dialog-el.close::backdrop {
|
|
2533
|
-
animation: backdrop-out 0.3s ease-in-out forwards;
|
|
2534
|
-
}
|
|
2535
|
-
/* shouldn't need two (in/out) animations declared here, but reversing is being weird */
|
|
2536
|
-
@keyframes w-modal-in {
|
|
2537
|
-
from {
|
|
2538
|
-
transform: translateY(var(--w-modal-translate-distance));
|
|
2539
|
-
opacity: 0;
|
|
2540
|
-
}
|
|
2541
|
-
to {
|
|
2542
|
-
transform: translateY(0);
|
|
2543
|
-
opacity: 1;
|
|
2544
|
-
}
|
|
2545
|
-
}
|
|
2546
|
-
@keyframes w-modal-out {
|
|
2547
|
-
from {
|
|
2548
|
-
transform: translateY(0);
|
|
2549
|
-
opacity: 1;
|
|
2550
|
-
}
|
|
2551
|
-
to {
|
|
2552
|
-
transform: translateY(var(--w-modal-translate-distance));
|
|
2553
|
-
opacity: 0;
|
|
2554
|
-
}
|
|
2555
|
-
}
|
|
2556
|
-
@keyframes backdrop-in {
|
|
2557
|
-
from {
|
|
2558
|
-
background: transparent;
|
|
2559
|
-
}
|
|
2560
|
-
to {
|
|
2561
|
-
background: rgba(0, 0, 0, 0.25);
|
|
2562
|
-
}
|
|
2563
|
-
}
|
|
2564
|
-
@keyframes backdrop-out {
|
|
2565
|
-
from {
|
|
2566
|
-
background: rgba(0, 0, 0, 0.25);
|
|
2567
|
-
}
|
|
2568
|
-
to {
|
|
2569
|
-
background: transparent;
|
|
2570
|
-
}
|
|
2571
|
-
}
|
|
2572
|
-
`],n([b({type:Boolean})],i.prototype,"show",2),n([b({type:String,attribute:"content-id"})],i.prototype,"contentId",2),n([b({type:Boolean,attribute:"ignore-backdrop-clicks"})],i.prototype,"ignoreBackdropClicks",2),n([p(".dialog-el")],i.prototype,"dialogEl",2),n([p(".dialog-inner-el")],i.prototype,"dialogInnerEl",2),n([p(".content-el")],i.prototype,"contentEl",2);var J=i;customElements.get("w-modal")||customElements.define("w-modal",i);export{J as ModalMain,i as WarpModal};
|
|
2619
|
+
`}};i.styles=[u,w],n([b({type:Boolean})],i.prototype,"show",2),n([b({type:String,attribute:"content-id"})],i.prototype,"contentId",2),n([b({type:Boolean,attribute:"ignore-backdrop-clicks"})],i.prototype,"ignoreBackdropClicks",2),n([p('[part="dialog"]')],i.prototype,"dialogEl",2),n([p('[part="wrapper"]')],i.prototype,"dialogInnerEl",2),n([p('[part="content"]')],i.prototype,"contentEl",2);var re=i;customElements.get("w-modal")||customElements.define("w-modal",i);export{re as ModalMain,i as WarpModal};
|
|
2573
2620
|
//# sourceMappingURL=modal.js.map
|