@usecapsule/core-components 1.0.13 → 2.0.0
Sign up to get free protection for your applications and to get access to all the features.
- package/css/capsule-core.css +74 -41
- package/css/capsule-core.css.map +1 -1
- package/dist/capsule/capsule.esm.js +1 -1
- package/dist/capsule/capsule.esm.js.map +1 -1
- package/dist/capsule/index.esm.js +1 -1
- package/dist/capsule/index.esm.js.map +1 -1
- package/dist/capsule/p-0462f723.js +2 -0
- package/dist/capsule/p-0462f723.js.map +1 -0
- package/dist/capsule/p-202a85c9.entry.js +29 -0
- package/dist/capsule/p-202a85c9.entry.js.map +1 -0
- package/dist/capsule/p-68c73705.entry.js +2 -0
- package/dist/capsule/{p-1dc07cd7.entry.js.map → p-68c73705.entry.js.map} +1 -1
- package/dist/capsule/p-6fb7c4d1.js +3 -0
- package/dist/capsule/p-6fb7c4d1.js.map +1 -0
- package/dist/capsule/{p-11048392.entry.js → p-91412151.entry.js} +2 -2
- package/dist/capsule/{p-62e7869a.entry.js → p-a95ec4df.entry.js} +2 -2
- package/dist/capsule/p-c2bf050b.js +2 -0
- package/dist/capsule/p-c2bf050b.js.map +1 -0
- package/dist/capsule/p-d7be092d.entry.js +10 -0
- package/dist/capsule/p-d7be092d.entry.js.map +1 -0
- package/dist/capsule/p-f604b591.entry.js +2 -0
- package/dist/cjs/_commonjsHelpers-b3309d7b.js +12 -0
- package/dist/cjs/_commonjsHelpers-b3309d7b.js.map +1 -0
- package/dist/cjs/capsule.cjs.js +2 -2
- package/dist/cjs/constants-4bb85cc5.js +12 -0
- package/dist/cjs/constants-4bb85cc5.js.map +1 -0
- package/dist/cjs/cpsl-alert_17.cjs.entry.js +3748 -554
- package/dist/cjs/cpsl-alert_17.cjs.entry.js.map +1 -1
- package/dist/cjs/cpsl-animation.cjs.entry.js +20129 -0
- package/dist/cjs/cpsl-animation.cjs.entry.js.map +1 -0
- package/dist/cjs/cpsl-col.cjs.entry.js +2 -2
- package/dist/cjs/cpsl-grid.cjs.entry.js +3 -3
- package/dist/cjs/cpsl-info-box.cjs.entry.js +3 -3
- package/dist/cjs/cpsl-info-box.cjs.entry.js.map +1 -1
- package/dist/cjs/cpsl-row.cjs.entry.js +2 -2
- package/dist/cjs/{index-2a026742.js → index-3fccb5b4.js} +22 -1
- package/dist/cjs/index-3fccb5b4.js.map +1 -0
- package/dist/cjs/index.cjs.js +338 -0
- package/dist/cjs/index.cjs.js.map +1 -1
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/collection/assets/icons/capsule-rings-dark.svg +34 -0
- package/dist/collection/assets/icons/capsule.svg +4 -4
- package/dist/collection/assets/icons/hero-email.svg +8 -30
- package/dist/collection/assets/icons/hero-lock.svg +4 -34
- package/dist/collection/assets/icons/hero-passkey.svg +9 -17
- package/dist/collection/assets/icons/hero-phone.svg +4 -15
- package/dist/collection/assets/icons/hero-wallet.svg +5 -44
- package/dist/collection/assets/icons/index.js +4 -2
- package/dist/collection/assets/icons/index.js.map +1 -1
- package/dist/collection/assets/icons/more-login-options.svg +10 -10
- package/dist/collection/assets/icons/plus-circle.svg +5 -0
- package/dist/collection/assets/icons/wallet.svg +5 -0
- package/dist/collection/collection-manifest.json +1 -0
- package/dist/collection/components/cpsl-alert/cpsl-alert.js +1 -1
- package/dist/collection/components/cpsl-animation/cpsl-animation.css +17 -0
- package/dist/collection/components/cpsl-animation/cpsl-animation.js +102 -0
- package/dist/collection/components/cpsl-animation/cpsl-animation.js.map +1 -0
- package/dist/collection/components/cpsl-animation/test/cpsl-animation.e2e.js +29 -0
- package/dist/collection/components/cpsl-animation/test/cpsl-animation.e2e.js.map +1 -0
- package/dist/collection/components/cpsl-animation/test/cpsl-animation.spec.js +37 -0
- package/dist/collection/components/cpsl-animation/test/cpsl-animation.spec.js.map +1 -0
- package/dist/collection/components/cpsl-button/cpsl-button.css +3 -0
- package/dist/collection/components/cpsl-button/cpsl-button.js +2 -2
- package/dist/collection/components/cpsl-button/cpsl-button.js.map +1 -1
- package/dist/collection/components/cpsl-code-input/cpsl-code-input.js +1 -1
- package/dist/collection/components/cpsl-col/cpsl-col.js +1 -1
- package/dist/collection/components/cpsl-divider/cpsl-divider.js +1 -1
- package/dist/collection/components/cpsl-grid/cpsl-grid.js +2 -2
- package/dist/collection/components/cpsl-icon/cpsl-icon.css +14 -0
- package/dist/collection/components/cpsl-icon/cpsl-icon.js +2 -3
- package/dist/collection/components/cpsl-icon/cpsl-icon.js.map +1 -1
- package/dist/collection/components/cpsl-info-box/cpsl-info-box.css +1 -1
- package/dist/collection/components/cpsl-info-box/cpsl-info-box.js +1 -1
- package/dist/collection/components/cpsl-input/cpsl-input.css +9 -4
- package/dist/collection/components/cpsl-input/cpsl-input.js +8 -6
- package/dist/collection/components/cpsl-input/cpsl-input.js.map +1 -1
- package/dist/collection/components/cpsl-modal/cpsl-modal.css +46 -4
- package/dist/collection/components/cpsl-modal/cpsl-modal.js +341 -24
- package/dist/collection/components/cpsl-modal/cpsl-modal.js.map +1 -1
- package/dist/collection/components/cpsl-overlay/cpsl-overlay.js +30 -13
- package/dist/collection/components/cpsl-overlay/cpsl-overlay.js.map +1 -1
- package/dist/collection/components/cpsl-pill/cpsl-pill.css +3 -3
- package/dist/collection/components/cpsl-pill/cpsl-pill.js +1 -1
- package/dist/collection/components/cpsl-progress-indicator/cpsl-progress-indicator.css +3 -3
- package/dist/collection/components/cpsl-qr-code/cpsl-qr-code.css +3 -3
- package/dist/collection/components/cpsl-qr-code/cpsl-qr-code.js +1 -1
- package/dist/collection/components/cpsl-row/cpsl-row.js +1 -1
- package/dist/collection/components/cpsl-slide-button/cpsl-slide-button.css +11 -9
- package/dist/collection/components/cpsl-slide-button/cpsl-slide-button.js +3 -3
- package/dist/collection/components/cpsl-spinner/cpsl-spinner.css +2 -2
- package/dist/collection/components/cpsl-spinner/cpsl-spinner.js +2 -2
- package/dist/collection/components/cpsl-tab/cpsl-tab.js +1 -1
- package/dist/collection/components/cpsl-tabs/cpsl-tabs.css +17 -16
- package/dist/collection/components/cpsl-tabs/cpsl-tabs.js +2 -2
- package/dist/collection/components/cpsl-tabs/cpsl-tabs.js.map +1 -1
- package/dist/collection/components/cpsl-text/cpsl-text.js +1 -1
- package/dist/collection/components/cpsl-tile-button/cpsl-tile-button.css +3 -0
- package/dist/collection/components/cpsl-tile-button/cpsl-tile-button.js +2 -2
- package/dist/collection/constants.js +6 -0
- package/dist/collection/constants.js.map +1 -0
- package/dist/collection/index.js +1 -0
- package/dist/collection/index.js.map +1 -1
- package/dist/collection/interface.js.map +1 -1
- package/dist/collection/utils/theme/generateBorderRadii.js +56 -0
- package/dist/collection/utils/theme/generateBorderRadii.js.map +1 -0
- package/dist/collection/utils/theme/generateFont.js +7 -0
- package/dist/collection/utils/theme/generateFont.js.map +1 -0
- package/dist/collection/utils/theme/generatePalette.js +46 -0
- package/dist/collection/utils/theme/generatePalette.js.map +1 -0
- package/dist/collection/utils/theme/generateTheme.js +12 -0
- package/dist/collection/utils/theme/generateTheme.js.map +1 -0
- package/dist/collection/utils/theme/utils.js +21 -0
- package/dist/collection/utils/theme/utils.js.map +1 -0
- package/dist/esm/_commonjsHelpers-1789f0cf.js +9 -0
- package/dist/esm/_commonjsHelpers-1789f0cf.js.map +1 -0
- package/dist/esm/capsule.js +3 -3
- package/dist/esm/constants-7b49abd5.js +9 -0
- package/dist/esm/constants-7b49abd5.js.map +1 -0
- package/dist/esm/cpsl-alert_17.entry.js +3747 -553
- package/dist/esm/cpsl-alert_17.entry.js.map +1 -1
- package/dist/esm/cpsl-animation.entry.js +20125 -0
- package/dist/esm/cpsl-animation.entry.js.map +1 -0
- package/dist/esm/cpsl-col.entry.js +2 -2
- package/dist/esm/cpsl-grid.entry.js +3 -3
- package/dist/esm/cpsl-info-box.entry.js +3 -3
- package/dist/esm/cpsl-info-box.entry.js.map +1 -1
- package/dist/esm/cpsl-row.entry.js +2 -2
- package/dist/esm/{index-7c2f5cb9.js → index-f00e090c.js} +22 -1
- package/dist/esm/index-f00e090c.js.map +1 -0
- package/dist/esm/index.js +335 -0
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/loader.js +3 -3
- package/dist/types/assets/icons/index.d.ts +3 -1
- package/dist/types/components/cpsl-animation/cpsl-animation.d.ts +9 -0
- package/dist/types/components/cpsl-modal/cpsl-modal.d.ts +26 -5
- package/dist/types/components/cpsl-overlay/cpsl-overlay.d.ts +2 -2
- package/dist/types/components.d.ts +117 -13
- package/dist/types/constants.d.ts +3 -0
- package/dist/types/index.d.ts +2 -0
- package/dist/types/interface.d.ts +122 -0
- package/dist/types/utils/theme/generateBorderRadii.d.ts +2 -0
- package/dist/types/utils/theme/generateFont.d.ts +2 -0
- package/dist/types/utils/theme/generatePalette.d.ts +7 -0
- package/dist/types/utils/theme/generateTheme.d.ts +3 -0
- package/dist/types/utils/theme/utils.d.ts +5 -0
- package/package.json +5 -2
- package/dist/capsule/p-0e2fbb7f.entry.js +0 -20
- package/dist/capsule/p-0e2fbb7f.entry.js.map +0 -1
- package/dist/capsule/p-1dc07cd7.entry.js +0 -2
- package/dist/capsule/p-5c020abe.entry.js +0 -2
- package/dist/capsule/p-9647dd63.js +0 -3
- package/dist/capsule/p-9647dd63.js.map +0 -1
- package/dist/cjs/index-2a026742.js.map +0 -1
- package/dist/collection/assets/icons/more-login-options-dark.svg +0 -13
- package/dist/esm/index-7c2f5cb9.js.map +0 -1
- /package/dist/capsule/{p-11048392.entry.js.map → p-91412151.entry.js.map} +0 -0
- /package/dist/capsule/{p-62e7869a.entry.js.map → p-a95ec4df.entry.js.map} +0 -0
- /package/dist/capsule/{p-5c020abe.entry.js.map → p-f604b591.entry.js.map} +0 -0
@@ -1,28 +1,169 @@
|
|
1
1
|
import { Host, h } from "@stencil/core";
|
2
2
|
import gsap from "gsap";
|
3
|
+
import Draggable from "gsap/Draggable";
|
4
|
+
import { MOBILE_SIZE } from "../../constants";
|
5
|
+
gsap.registerPlugin(Draggable);
|
6
|
+
const mm = gsap.matchMedia();
|
3
7
|
export class CpslModal {
|
4
8
|
constructor() {
|
5
|
-
this.
|
9
|
+
this.getDraggableHeight = () => {
|
10
|
+
return this.innerContainerEl.clientHeight;
|
11
|
+
};
|
12
|
+
this.hasFooter = undefined;
|
13
|
+
this.enterTransitionDuration = 0.15;
|
14
|
+
this.exitTransitionDuration = 0.15;
|
6
15
|
this.footerExpanded = undefined;
|
7
|
-
this.
|
16
|
+
this.footerTransitionDuration = 0.15;
|
17
|
+
this.noOverlay = undefined;
|
18
|
+
this.open = undefined;
|
8
19
|
}
|
9
20
|
toggleHeight() {
|
10
21
|
this.footerExpanded ? this.expandFooterTl.play() : this.expandFooterTl.reverse();
|
11
22
|
}
|
12
|
-
|
13
|
-
if (
|
14
|
-
|
23
|
+
toggleModal() {
|
24
|
+
if (this.open) {
|
25
|
+
if (window.innerWidth >= MOBILE_SIZE + 1) {
|
26
|
+
gsap
|
27
|
+
.timeline({
|
28
|
+
onStart: () => {
|
29
|
+
this.cpslModalEntering.emit();
|
30
|
+
},
|
31
|
+
onComplete: () => {
|
32
|
+
this.addExpandAnim();
|
33
|
+
this.cpslModalEntered.emit();
|
34
|
+
},
|
35
|
+
})
|
36
|
+
.set(this.modalWrapperEl, { display: 'flex', yPercent: 0 })
|
37
|
+
.to(this.modalWrapperEl, {
|
38
|
+
scale: 1,
|
39
|
+
opacity: 1,
|
40
|
+
duration: this.enterTransitionDuration,
|
41
|
+
});
|
42
|
+
}
|
43
|
+
else {
|
44
|
+
gsap
|
45
|
+
.timeline({
|
46
|
+
onStart: () => {
|
47
|
+
this.cpslModalEntering.emit();
|
48
|
+
},
|
49
|
+
onComplete: () => {
|
50
|
+
this.addExpandAnim();
|
51
|
+
this.cpslModalEntered.emit();
|
52
|
+
},
|
53
|
+
})
|
54
|
+
.set(this.modalWrapperEl, { display: 'flex', scale: 1, opacity: 1 })
|
55
|
+
.to(this.modalWrapperEl, {
|
56
|
+
yPercent: -100,
|
57
|
+
duration: this.enterTransitionDuration,
|
58
|
+
});
|
59
|
+
}
|
60
|
+
}
|
61
|
+
else {
|
62
|
+
if (window.innerWidth >= MOBILE_SIZE + 1) {
|
63
|
+
gsap
|
64
|
+
.timeline({
|
65
|
+
onStart: () => {
|
66
|
+
this.cpslModalExiting.emit();
|
67
|
+
},
|
68
|
+
onComplete: () => {
|
69
|
+
this.cpslModalExited.emit();
|
70
|
+
this.modalWrapperEl.style.setProperty('display', 'none');
|
71
|
+
},
|
72
|
+
})
|
73
|
+
.to(this.modalWrapperEl, {
|
74
|
+
scale: 0.8,
|
75
|
+
opacity: 0,
|
76
|
+
duration: this.exitTransitionDuration,
|
77
|
+
});
|
78
|
+
}
|
79
|
+
else {
|
80
|
+
gsap
|
81
|
+
.timeline({
|
82
|
+
onStart: () => {
|
83
|
+
this.cpslModalExiting.emit();
|
84
|
+
},
|
85
|
+
onComplete: () => {
|
86
|
+
this.cpslModalExited.emit();
|
87
|
+
this.modalWrapperEl.style.setProperty('display', 'none');
|
88
|
+
},
|
89
|
+
})
|
90
|
+
.to(this.modalWrapperEl, {
|
91
|
+
yPercent: 0,
|
92
|
+
duration: this.exitTransitionDuration,
|
93
|
+
})
|
94
|
+
.set(this.modalContainerEl, { y: 0 });
|
95
|
+
}
|
15
96
|
}
|
16
|
-
this.expandFooterTl = gsap
|
17
|
-
.timeline({ reversed: true, paused: true })
|
18
|
-
.to(this.bodyEl, { height: '0px', duration: this.transitionDuration })
|
19
|
-
.to(this.footerEl, { height: '0px', duration: this.transitionDuration }, '<')
|
20
|
-
.to(this.footerExpandedEl, { height: 'auto', duration: this.transitionDuration }, '<')
|
21
|
-
.to(this.headerEl, { height: '0px', duration: this.transitionDuration }, '<')
|
22
|
-
.to(this.headerExpandedEl, { height: 'auto', duration: this.transitionDuration }, '<');
|
23
97
|
}
|
24
|
-
|
25
|
-
|
98
|
+
componentDidLoad() {
|
99
|
+
mm.add(`(min-width: ${MOBILE_SIZE + 1}px)`, () => {
|
100
|
+
var _a;
|
101
|
+
(_a = this.draggable) === null || _a === void 0 ? void 0 : _a.disable();
|
102
|
+
gsap.timeline({}).set(this.modalWrapperEl, { yPercent: 0, scale: this.open ? 1 : 0.8, opacity: this.open ? 1 : 0 });
|
103
|
+
});
|
104
|
+
mm.add(`(max-width: ${MOBILE_SIZE}px)`, () => {
|
105
|
+
this.initDraggable();
|
106
|
+
gsap.timeline({}).set(this.modalWrapperEl, { scale: 1, opacity: 1, yPercent: this.open ? -100 : 0 });
|
107
|
+
});
|
108
|
+
this.footerSlotEl.addEventListener('slotchange', () => {
|
109
|
+
if (this.footerSlotEl.assignedNodes().length >= 1) {
|
110
|
+
this.hasFooter = true;
|
111
|
+
}
|
112
|
+
else {
|
113
|
+
this.hasFooter = false;
|
114
|
+
}
|
115
|
+
});
|
116
|
+
}
|
117
|
+
addExpandAnim() {
|
118
|
+
setTimeout(() => {
|
119
|
+
this.expandFooterTl = gsap
|
120
|
+
.timeline({
|
121
|
+
reversed: true,
|
122
|
+
paused: true,
|
123
|
+
onReverseComplete: () => {
|
124
|
+
this.contentEl.style.setProperty('height', 'auto');
|
125
|
+
},
|
126
|
+
defaults: {
|
127
|
+
duration: this.footerTransitionDuration,
|
128
|
+
},
|
129
|
+
})
|
130
|
+
.set(this.footerExpandedEl, { overflow: 'auto', display: 'block' })
|
131
|
+
.set(this.headerExpandedEl, { display: 'block' })
|
132
|
+
.to(this.innerContainerEl, { paddingBottom: '8px' })
|
133
|
+
.to(this.contentEl, { height: '0px', overflow: 'hidden', opacity: 0 }, '<')
|
134
|
+
.to(this.footerEl, { height: '0px', overflow: 'hidden', opacity: 0 }, '<')
|
135
|
+
.to(this.footerExpandedEl, { height: 'auto', opacity: 1 }, '<')
|
136
|
+
.to(this.headerExpandedEl, { height: 'auto', opacity: 1 }, '<');
|
137
|
+
}, 10);
|
138
|
+
}
|
139
|
+
initDraggable() {
|
140
|
+
this.draggable = Draggable.create(this.modalContainerEl, {
|
141
|
+
trigger: this.headerEl,
|
142
|
+
dragClickables: false,
|
143
|
+
type: 'y',
|
144
|
+
edgeResistance: 0.2,
|
145
|
+
liveSnap: {
|
146
|
+
y: function (y) {
|
147
|
+
if (y < 0)
|
148
|
+
return 0;
|
149
|
+
return y;
|
150
|
+
},
|
151
|
+
},
|
152
|
+
onDrag: () => {
|
153
|
+
const y = gsap.utils.mapRange(0, this.getDraggableHeight(), 1, 0, this.draggable.y);
|
154
|
+
gsap.set(this.overlayEl, { opacity: y });
|
155
|
+
},
|
156
|
+
onDragEnd: () => {
|
157
|
+
if (this.draggable.y > 60) {
|
158
|
+
this.cpslModalRequestClose.emit();
|
159
|
+
}
|
160
|
+
else {
|
161
|
+
gsap.set(this.overlayEl, { opacity: 1 });
|
162
|
+
gsap.set(this.modalWrapperEl, { yPercent: -100 });
|
163
|
+
gsap.set(this.modalContainerEl, { y: 0 });
|
164
|
+
}
|
165
|
+
},
|
166
|
+
})[0];
|
26
167
|
}
|
27
168
|
get footerEl() {
|
28
169
|
return this.el.shadowRoot.getElementById('modal-footer');
|
@@ -30,14 +171,39 @@ export class CpslModal {
|
|
30
171
|
get footerExpandedEl() {
|
31
172
|
return this.el.shadowRoot.getElementById('modal-footer-expanded');
|
32
173
|
}
|
174
|
+
get headerExpandedEl() {
|
175
|
+
return this.el.shadowRoot.getElementById('modal-header-expanded');
|
176
|
+
}
|
177
|
+
get innerContainerEl() {
|
178
|
+
return this.el.shadowRoot.getElementById('modal-inner-container');
|
179
|
+
}
|
180
|
+
get contentEl() {
|
181
|
+
return this.el.shadowRoot.getElementById('modal-content');
|
182
|
+
}
|
183
|
+
get modalWrapperEl() {
|
184
|
+
return this.el.shadowRoot.getElementById('modal-wrapper');
|
185
|
+
}
|
186
|
+
get modalContainerEl() {
|
187
|
+
return this.el.shadowRoot.getElementById('modal-container');
|
188
|
+
}
|
189
|
+
get overlayEl() {
|
190
|
+
return this.el.shadowRoot.getElementById('overlay');
|
191
|
+
}
|
192
|
+
get footerSlotEl() {
|
193
|
+
return this.footerEl.querySelectorAll('slot')[0];
|
194
|
+
}
|
33
195
|
get headerEl() {
|
34
196
|
return this.el.shadowRoot.getElementById('modal-header');
|
35
197
|
}
|
36
|
-
get
|
37
|
-
return this.
|
198
|
+
get Modal() {
|
199
|
+
return (h("div", { class: { 'modal-container': true, 'no-footer': !this.hasFooter }, part: "modal-container", id: "modal-container" }, h("slot", null), h("div", { id: "modal-inner-container", class: { 'modal-inner-container': true, 'no-footer': !this.hasFooter }, part: "modal-inner-container" }, h("div", { id: "modal-content", part: "modal-content" }, h("div", { id: "modal-header", class: "modal-header" }, h("slot", { name: "header" })), h("slot", { name: "body" })), h("div", { id: "modal-header-expanded", class: { 'modal-header': true, 'expanded': true, 'no-opacity': true } }, h("slot", { name: "footerExpandedHeader" }))), h("div", { id: "modal-footer" }, h("slot", { name: "footer" })), h("div", { id: "modal-footer-expanded", class: { 'expanded': true, 'no-opacity': true } }, h("slot", { name: "footerExpandedFooter" }))));
|
38
200
|
}
|
39
201
|
render() {
|
40
|
-
|
202
|
+
if (this.noOverlay) {
|
203
|
+
this.addExpandAnim();
|
204
|
+
return h(Host, null, this.Modal);
|
205
|
+
}
|
206
|
+
return (h(Host, { class: { 'include-mobile-styling': true } }, h("cpsl-overlay", { id: "overlay", open: this.open, enterTransitionDuration: this.enterTransitionDuration, exitTransitionDuration: this.exitTransitionDuration }), h("div", { id: "modal-wrapper", class: "modal-wrapper" }, this.Modal)));
|
41
207
|
}
|
42
208
|
static get is() { return "cpsl-modal"; }
|
43
209
|
static get encapsulation() { return "shadow"; }
|
@@ -53,6 +219,42 @@ export class CpslModal {
|
|
53
219
|
}
|
54
220
|
static get properties() {
|
55
221
|
return {
|
222
|
+
"enterTransitionDuration": {
|
223
|
+
"type": "number",
|
224
|
+
"mutable": false,
|
225
|
+
"complexType": {
|
226
|
+
"original": "number",
|
227
|
+
"resolved": "number",
|
228
|
+
"references": {}
|
229
|
+
},
|
230
|
+
"required": false,
|
231
|
+
"optional": true,
|
232
|
+
"docs": {
|
233
|
+
"tags": [],
|
234
|
+
"text": "Duration in seconds of the modal entering.\nDefault is .15."
|
235
|
+
},
|
236
|
+
"attribute": "enter-transition-duration",
|
237
|
+
"reflect": false,
|
238
|
+
"defaultValue": "0.15"
|
239
|
+
},
|
240
|
+
"exitTransitionDuration": {
|
241
|
+
"type": "number",
|
242
|
+
"mutable": false,
|
243
|
+
"complexType": {
|
244
|
+
"original": "number",
|
245
|
+
"resolved": "number",
|
246
|
+
"references": {}
|
247
|
+
},
|
248
|
+
"required": false,
|
249
|
+
"optional": true,
|
250
|
+
"docs": {
|
251
|
+
"tags": [],
|
252
|
+
"text": "Duration in seconds of the modal exiting.\nDefault is .15."
|
253
|
+
},
|
254
|
+
"attribute": "exit-transition-duration",
|
255
|
+
"reflect": false,
|
256
|
+
"defaultValue": "0.15"
|
257
|
+
},
|
56
258
|
"footerExpanded": {
|
57
259
|
"type": "boolean",
|
58
260
|
"mutable": false,
|
@@ -62,7 +264,7 @@ export class CpslModal {
|
|
62
264
|
"references": {}
|
63
265
|
},
|
64
266
|
"required": false,
|
65
|
-
"optional":
|
267
|
+
"optional": true,
|
66
268
|
"docs": {
|
67
269
|
"tags": [],
|
68
270
|
"text": "Whether or not to show `footerExpandedFooter` and `footerExpandedHeader` slots."
|
@@ -70,7 +272,7 @@ export class CpslModal {
|
|
70
272
|
"attribute": "footer-expanded",
|
71
273
|
"reflect": false
|
72
274
|
},
|
73
|
-
"
|
275
|
+
"footerTransitionDuration": {
|
74
276
|
"type": "number",
|
75
277
|
"mutable": false,
|
76
278
|
"complexType": {
|
@@ -79,27 +281,142 @@ export class CpslModal {
|
|
79
281
|
"references": {}
|
80
282
|
},
|
81
283
|
"required": false,
|
82
|
-
"optional":
|
284
|
+
"optional": true,
|
83
285
|
"docs": {
|
84
286
|
"tags": [],
|
85
|
-
"text": "Duration in seconds of the footer expansion animation.\nDefault is .
|
287
|
+
"text": "Duration in seconds of the footer expansion animation.\nDefault is 0.15."
|
86
288
|
},
|
87
|
-
"attribute": "transition-duration",
|
289
|
+
"attribute": "footer-transition-duration",
|
88
290
|
"reflect": false,
|
89
|
-
"defaultValue": "0.
|
291
|
+
"defaultValue": "0.15"
|
292
|
+
},
|
293
|
+
"noOverlay": {
|
294
|
+
"type": "boolean",
|
295
|
+
"mutable": false,
|
296
|
+
"complexType": {
|
297
|
+
"original": "boolean",
|
298
|
+
"resolved": "boolean",
|
299
|
+
"references": {}
|
300
|
+
},
|
301
|
+
"required": false,
|
302
|
+
"optional": true,
|
303
|
+
"docs": {
|
304
|
+
"tags": [],
|
305
|
+
"text": "Whether or not to show the overlay. This will always show the modal, regardless of the value of `open`."
|
306
|
+
},
|
307
|
+
"attribute": "no-overlay",
|
308
|
+
"reflect": false
|
309
|
+
},
|
310
|
+
"open": {
|
311
|
+
"type": "boolean",
|
312
|
+
"mutable": false,
|
313
|
+
"complexType": {
|
314
|
+
"original": "boolean",
|
315
|
+
"resolved": "boolean",
|
316
|
+
"references": {}
|
317
|
+
},
|
318
|
+
"required": false,
|
319
|
+
"optional": false,
|
320
|
+
"docs": {
|
321
|
+
"tags": [],
|
322
|
+
"text": "Whether or not to show the modal."
|
323
|
+
},
|
324
|
+
"attribute": "open",
|
325
|
+
"reflect": false
|
90
326
|
}
|
91
327
|
};
|
92
328
|
}
|
93
329
|
static get states() {
|
94
330
|
return {
|
95
|
-
"
|
331
|
+
"hasFooter": {}
|
96
332
|
};
|
97
333
|
}
|
334
|
+
static get events() {
|
335
|
+
return [{
|
336
|
+
"method": "cpslModalEntering",
|
337
|
+
"name": "cpslModalEntering",
|
338
|
+
"bubbles": true,
|
339
|
+
"cancelable": true,
|
340
|
+
"composed": true,
|
341
|
+
"docs": {
|
342
|
+
"tags": [],
|
343
|
+
"text": "Emitted when enter animation starts."
|
344
|
+
},
|
345
|
+
"complexType": {
|
346
|
+
"original": "null",
|
347
|
+
"resolved": "null",
|
348
|
+
"references": {}
|
349
|
+
}
|
350
|
+
}, {
|
351
|
+
"method": "cpslModalEntered",
|
352
|
+
"name": "cpslModalEntered",
|
353
|
+
"bubbles": true,
|
354
|
+
"cancelable": true,
|
355
|
+
"composed": true,
|
356
|
+
"docs": {
|
357
|
+
"tags": [],
|
358
|
+
"text": "Emitted when enter animation finishes."
|
359
|
+
},
|
360
|
+
"complexType": {
|
361
|
+
"original": "null",
|
362
|
+
"resolved": "null",
|
363
|
+
"references": {}
|
364
|
+
}
|
365
|
+
}, {
|
366
|
+
"method": "cpslModalExiting",
|
367
|
+
"name": "cpslModalExiting",
|
368
|
+
"bubbles": true,
|
369
|
+
"cancelable": true,
|
370
|
+
"composed": true,
|
371
|
+
"docs": {
|
372
|
+
"tags": [],
|
373
|
+
"text": "Emitted when exit animation starts."
|
374
|
+
},
|
375
|
+
"complexType": {
|
376
|
+
"original": "null",
|
377
|
+
"resolved": "null",
|
378
|
+
"references": {}
|
379
|
+
}
|
380
|
+
}, {
|
381
|
+
"method": "cpslModalExited",
|
382
|
+
"name": "cpslModalExited",
|
383
|
+
"bubbles": true,
|
384
|
+
"cancelable": true,
|
385
|
+
"composed": true,
|
386
|
+
"docs": {
|
387
|
+
"tags": [],
|
388
|
+
"text": "Emitted when exit animation finishes."
|
389
|
+
},
|
390
|
+
"complexType": {
|
391
|
+
"original": "null",
|
392
|
+
"resolved": "null",
|
393
|
+
"references": {}
|
394
|
+
}
|
395
|
+
}, {
|
396
|
+
"method": "cpslModalRequestClose",
|
397
|
+
"name": "cpslModalRequestClose",
|
398
|
+
"bubbles": true,
|
399
|
+
"cancelable": true,
|
400
|
+
"composed": true,
|
401
|
+
"docs": {
|
402
|
+
"tags": [],
|
403
|
+
"text": "Emitted when exit animation finishes."
|
404
|
+
},
|
405
|
+
"complexType": {
|
406
|
+
"original": "null",
|
407
|
+
"resolved": "null",
|
408
|
+
"references": {}
|
409
|
+
}
|
410
|
+
}];
|
411
|
+
}
|
98
412
|
static get elementRef() { return "el"; }
|
99
413
|
static get watchers() {
|
100
414
|
return [{
|
101
415
|
"propName": "footerExpanded",
|
102
416
|
"methodName": "toggleHeight"
|
417
|
+
}, {
|
418
|
+
"propName": "open",
|
419
|
+
"methodName": "toggleModal"
|
103
420
|
}];
|
104
421
|
}
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AAa,EAAE,IAAI,EAAE;wBAC9E,6DAAM,IAAI,EAAC,sBAAsB,GAAQ,CACrC;oBACN,4DAAK,EAAE,EAAC,YAAY,EAAC,KAAK,EAAC,aAAa;wBACtC,6DAAM,IAAI,EAAC,MAAM,GAAQ,CACrB,CACF;gBACN,4DAAK,EAAE,EAAC,cAAc,EAAC,KAAK,EAAC,aAAa;oBACxC,6DAAM,IAAI,EAAC,QAAQ,GAAQ,CACvB;gBACN,4DAAK,EAAE,EAAC,uBAAuB,EAAC,KAAK,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,aAAa,EAAE,IAAI,EAAE;oBAC9E,6DAAM,IAAI,EAAC,sBAAsB,GAAQ,CACrC,CACF,CACD,CACR,CAAC;IACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, Element, Host, Prop, State, Watch, h } from '@stencil/core';\nimport gsap from 'gsap';\n\n@Component({\n tag: 'cpsl-modal',\n styleUrl: 'cpsl-modal.scss',\n shadow: true,\n})\nexport class CpslModal {\n private expandFooterTl;\n\n @Element() el!: HTMLCpslModalElement;\n\n @State() noFooter: boolean;\n\n /**\n * Whether or not to show `footerExpandedFooter` and `footerExpandedHeader` slots.\n */\n @Prop() footerExpanded: boolean;\n\n /**\n * Duration in seconds of the footer expansion animation.\n * Default is .5.\n */\n @Prop() transitionDuration: number = 0.5;\n\n @Watch('footerExpanded')\n toggleHeight() {\n this.footerExpanded ? this.expandFooterTl.play() : this.expandFooterTl.reverse();\n }\n\n componentDidLoad() {\n if (!Boolean(this.el.querySelector('[slot=\"footer\"]'))) {\n this.noFooter = true;\n }\n\n this.expandFooterTl = gsap\n .timeline({ reversed: true, paused: true })\n .to(this.bodyEl, { height: '0px', duration: this.transitionDuration })\n .to(this.footerEl, { height: '0px', duration: this.transitionDuration }, '<')\n .to(this.footerExpandedEl, { height: 'auto', duration: this.transitionDuration }, '<')\n .to(this.headerEl, { height: '0px', duration: this.transitionDuration }, '<')\n .to(this.headerExpandedEl, { height: 'auto', duration: this.transitionDuration }, '<');\n }\n\n private get bodyEl() {\n return this.el.shadowRoot.getElementById('modal-body');\n }\n\n private get footerEl() {\n return this.el.shadowRoot.getElementById('modal-footer');\n }\n\n private get footerExpandedEl() {\n return this.el.shadowRoot.getElementById('modal-footer-expanded');\n }\n\n private get headerEl() {\n return this.el.shadowRoot.getElementById('modal-header');\n }\n\n private get headerExpandedEl() {\n return this.el.shadowRoot.getElementById('modal-header-expanded');\n }\n\n render() {\n return (\n <Host>\n <div class={{ 'modal-container': true, 'no-footer': this.noFooter }} part=\"modal-container\">\n <div class={{ 'modal-inner-container': true, 'no-footer': this.noFooter }} part=\"modal-inner-container\">\n <div id=\"modal-header\" class=\"no-overflow\">\n <slot name=\"header\"></slot>\n </div>\n <div id=\"modal-header-expanded\" class={{ 'expanded': true, 'no-overflow': true }}>\n <slot name=\"footerExpandedHeader\"></slot>\n </div>\n <div id=\"modal-body\" class=\"no-overflow\">\n <slot name=\"body\"></slot>\n </div>\n </div>\n <div id=\"modal-footer\" class=\"no-overflow\">\n <slot name=\"footer\"></slot>\n </div>\n <div id=\"modal-footer-expanded\" class={{ 'expanded': true, 'no-overflow': true }}>\n <slot name=\"footerExpandedFooter\"></slot>\n </div>\n </div>\n </Host>\n );\n }\n}\n"]}
|
1
|
+
{"version":3,"file":"cpsl-modal.js","sourceRoot":"","sources":["../../../../src/components/cpsl-modal/cpsl-modal.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC,EAAE,KAAK,EAAgB,MAAM,eAAe,CAAC;AACrG,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,SAAS,MAAM,gBAAgB,CAAC;AACvC,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAE9C,IAAI,CAAC,cAAc,CAAC,SAA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AAE,wBAAwB,EAAE,IAAI,EAAE;YAC7C,oBAAc,EAAE,EAAC,SAAS,EAAC,IAAI,EAAE,IAAI,CAAC,IAAI,EAAE,uBAAuB,EAAE,IAAI,CAAC,uBAAuB,EAAE,sBAAsB,EAAE,IAAI,CAAC,sBAAsB,GAAI;YAC1J,WAAK,EAAE,EAAC,eAAe,EAAC,KAAK,EAAC,eAAe,IAC1C,IAAI,CAAC,KAAK,CACP,CACD,CACR,CAAC;IACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, Element, Host, Prop, State, Watch, h, Event, EventEmitter } from '@stencil/core';\nimport gsap from 'gsap';\nimport Draggable from 'gsap/Draggable';\nimport { MOBILE_SIZE } from '../../constants';\n\ngsap.registerPlugin(Draggable);\nconst mm = gsap.matchMedia();\n@Component({\n tag: 'cpsl-modal',\n styleUrl: 'cpsl-modal.scss',\n shadow: true,\n})\nexport class CpslModal {\n private draggable: Draggable;\n private expandFooterTl;\n\n @Element() el!: HTMLCpslModalElement;\n\n @State() hasFooter: boolean;\n\n /**\n * Duration in seconds of the modal entering.\n * Default is .15.\n */\n @Prop() enterTransitionDuration?: number = 0.15;\n\n /**\n * Duration in seconds of the modal exiting.\n * Default is .15.\n */\n @Prop() exitTransitionDuration?: number = 0.15;\n\n /**\n * Whether or not to show `footerExpandedFooter` and `footerExpandedHeader` slots.\n */\n @Prop() footerExpanded?: boolean;\n\n /**\n * Duration in seconds of the footer expansion animation.\n * Default is 0.15.\n */\n @Prop() footerTransitionDuration?: number = 0.15;\n\n /**\n * Whether or not to show the overlay. This will always show the modal, regardless of the value of `open`.\n */\n @Prop() noOverlay?: boolean;\n\n /**\n * Whether or not to show the modal.\n */\n @Prop() open: boolean;\n\n /**\n * Emitted when enter animation starts.\n */\n @Event() cpslModalEntering!: EventEmitter<null>;\n\n /**\n * Emitted when enter animation finishes.\n */\n @Event() cpslModalEntered!: EventEmitter<null>;\n\n /**\n * Emitted when exit animation starts.\n */\n @Event() cpslModalExiting!: EventEmitter<null>;\n\n /**\n * Emitted when exit animation finishes.\n */\n @Event() cpslModalExited!: EventEmitter<null>;\n\n /**\n * Emitted when exit animation finishes.\n */\n @Event() cpslModalRequestClose!: EventEmitter<null>;\n\n @Watch('footerExpanded')\n toggleHeight() {\n this.footerExpanded ? this.expandFooterTl.play() : this.expandFooterTl.reverse();\n }\n\n @Watch('open')\n toggleModal() {\n if (this.open) {\n if (window.innerWidth >= MOBILE_SIZE + 1) {\n gsap\n .timeline({\n onStart: () => {\n this.cpslModalEntering.emit();\n },\n onComplete: () => {\n this.addExpandAnim();\n this.cpslModalEntered.emit();\n },\n })\n .set(this.modalWrapperEl, { display: 'flex', yPercent: 0 })\n .to(this.modalWrapperEl, {\n scale: 1,\n opacity: 1,\n duration: this.enterTransitionDuration,\n });\n } else {\n gsap\n .timeline({\n onStart: () => {\n this.cpslModalEntering.emit();\n },\n onComplete: () => {\n this.addExpandAnim();\n this.cpslModalEntered.emit();\n },\n })\n .set(this.modalWrapperEl, { display: 'flex', scale: 1, opacity: 1 })\n .to(this.modalWrapperEl, {\n yPercent: -100,\n duration: this.enterTransitionDuration,\n });\n }\n } else {\n if (window.innerWidth >= MOBILE_SIZE + 1) {\n gsap\n .timeline({\n onStart: () => {\n this.cpslModalExiting.emit();\n },\n onComplete: () => {\n this.cpslModalExited.emit();\n this.modalWrapperEl.style.setProperty('display', 'none');\n },\n })\n .to(this.modalWrapperEl, {\n scale: 0.8,\n opacity: 0,\n duration: this.exitTransitionDuration,\n });\n } else {\n gsap\n .timeline({\n onStart: () => {\n this.cpslModalExiting.emit();\n },\n onComplete: () => {\n this.cpslModalExited.emit();\n this.modalWrapperEl.style.setProperty('display', 'none');\n },\n })\n .to(this.modalWrapperEl, {\n yPercent: 0,\n duration: this.exitTransitionDuration,\n })\n .set(this.modalContainerEl, { y: 0 });\n }\n }\n }\n\n componentDidLoad() {\n mm.add(`(min-width: ${MOBILE_SIZE + 1}px)`, () => {\n this.draggable?.disable();\n gsap.timeline({}).set(this.modalWrapperEl, { yPercent: 0, scale: this.open ? 1 : 0.8, opacity: this.open ? 1 : 0 });\n });\n mm.add(`(max-width: ${MOBILE_SIZE}px)`, () => {\n this.initDraggable();\n gsap.timeline({}).set(this.modalWrapperEl, { scale: 1, opacity: 1, yPercent: this.open ? -100 : 0 });\n });\n\n this.footerSlotEl.addEventListener('slotchange', () => {\n if (this.footerSlotEl.assignedNodes().length >= 1) {\n this.hasFooter = true;\n } else {\n this.hasFooter = false;\n }\n });\n }\n\n private addExpandAnim() {\n setTimeout(() => {\n this.expandFooterTl = gsap\n .timeline({\n reversed: true,\n paused: true,\n onReverseComplete: () => {\n this.contentEl.style.setProperty('height', 'auto');\n },\n defaults: {\n duration: this.footerTransitionDuration,\n },\n })\n .set(this.footerExpandedEl, { overflow: 'auto', display: 'block' })\n .set(this.headerExpandedEl, { display: 'block' })\n .to(this.innerContainerEl, { paddingBottom: '8px' })\n .to(this.contentEl, { height: '0px', overflow: 'hidden', opacity: 0 }, '<')\n .to(this.footerEl, { height: '0px', overflow: 'hidden', opacity: 0 }, '<')\n .to(this.footerExpandedEl, { height: 'auto', opacity: 1 }, '<')\n .to(this.headerExpandedEl, { height: 'auto', opacity: 1 }, '<');\n }, 10);\n }\n\n private getDraggableHeight = () => {\n return this.innerContainerEl.clientHeight;\n };\n\n private initDraggable() {\n this.draggable = Draggable.create(this.modalContainerEl, {\n trigger: this.headerEl,\n dragClickables: false,\n type: 'y',\n edgeResistance: 0.2,\n liveSnap: {\n y: function (y) {\n if (y < 0) return 0; // Restricts dragging to down\n return y;\n },\n },\n onDrag: () => {\n const y = gsap.utils.mapRange(0, this.getDraggableHeight(), 1, 0, this.draggable.y);\n gsap.set(this.overlayEl, { opacity: y });\n },\n onDragEnd: () => {\n if (this.draggable.y > 60) {\n this.cpslModalRequestClose.emit();\n } else {\n gsap.set(this.overlayEl, { opacity: 1 });\n gsap.set(this.modalWrapperEl, { yPercent: -100 });\n gsap.set(this.modalContainerEl, { y: 0 });\n }\n },\n })[0];\n }\n\n private get footerEl() {\n return this.el.shadowRoot.getElementById('modal-footer');\n }\n\n private get footerExpandedEl() {\n return this.el.shadowRoot.getElementById('modal-footer-expanded');\n }\n\n private get headerExpandedEl() {\n return this.el.shadowRoot.getElementById('modal-header-expanded');\n }\n\n private get innerContainerEl() {\n return this.el.shadowRoot.getElementById('modal-inner-container');\n }\n\n private get contentEl() {\n return this.el.shadowRoot.getElementById('modal-content');\n }\n\n private get modalWrapperEl() {\n return this.el.shadowRoot.getElementById('modal-wrapper');\n }\n\n private get modalContainerEl() {\n return this.el.shadowRoot.getElementById('modal-container');\n }\n\n private get overlayEl() {\n return this.el.shadowRoot.getElementById('overlay');\n }\n\n private get footerSlotEl() {\n return this.footerEl.querySelectorAll('slot')[0];\n }\n\n private get headerEl() {\n return this.el.shadowRoot.getElementById('modal-header');\n }\n\n private get Modal() {\n return (\n <div class={{ 'modal-container': true, 'no-footer': !this.hasFooter }} part=\"modal-container\" id=\"modal-container\">\n <slot></slot>\n <div id=\"modal-inner-container\" class={{ 'modal-inner-container': true, 'no-footer': !this.hasFooter }} part=\"modal-inner-container\">\n <div id=\"modal-content\" part=\"modal-content\">\n <div id=\"modal-header\" class=\"modal-header\">\n <slot name=\"header\"></slot>\n </div>\n <slot name=\"body\"></slot>\n </div>\n <div id=\"modal-header-expanded\" class={{ 'modal-header': true, 'expanded': true, 'no-opacity': true }}>\n <slot name=\"footerExpandedHeader\"></slot>\n </div>\n </div>\n <div id=\"modal-footer\">\n <slot name=\"footer\"></slot>\n </div>\n <div id=\"modal-footer-expanded\" class={{ 'expanded': true, 'no-opacity': true }}>\n <slot name=\"footerExpandedFooter\"></slot>\n </div>\n </div>\n );\n }\n\n render() {\n if (this.noOverlay) {\n this.addExpandAnim();\n return <Host>{this.Modal}</Host>;\n }\n\n return (\n <Host class={{ 'include-mobile-styling': true }}>\n <cpsl-overlay id=\"overlay\" open={this.open} enterTransitionDuration={this.enterTransitionDuration} exitTransitionDuration={this.exitTransitionDuration} />\n <div id=\"modal-wrapper\" class=\"modal-wrapper\">\n {this.Modal}\n </div>\n </Host>\n );\n }\n}\n"]}
|
@@ -3,31 +3,30 @@ import gsap from "gsap";
|
|
3
3
|
export class CpslOverlay {
|
4
4
|
constructor() {
|
5
5
|
this.open = undefined;
|
6
|
-
this.
|
6
|
+
this.enterTransitionDuration = 0.5;
|
7
|
+
this.exitTransitionDuration = 0.5;
|
7
8
|
}
|
8
9
|
toggleHeight() {
|
9
|
-
this.open
|
10
|
+
this.open
|
11
|
+
? gsap.timeline({ defaults: { duration: this.enterTransitionDuration } }).to(this.el, { display: 'block', opacity: 1 })
|
12
|
+
: gsap.timeline({ defaults: { duration: this.exitTransitionDuration } }).to(this.el, { display: 'none', opacity: 0 });
|
10
13
|
if (this.open) {
|
11
14
|
document.documentElement.style.overflow = 'hidden';
|
12
15
|
}
|
13
16
|
else {
|
14
17
|
setTimeout(() => {
|
15
18
|
document.documentElement.style.overflow = 'auto';
|
16
|
-
}, this.
|
19
|
+
}, this.exitTransitionDuration * 1000);
|
17
20
|
}
|
18
21
|
}
|
19
22
|
componentDidLoad() {
|
20
|
-
this.showTl = gsap
|
21
|
-
.timeline({ reversed: true, paused: true })
|
22
|
-
.to(this.el, { display: 'block', duration: this.transitionDuration })
|
23
|
-
.to(this.el, { opacity: '100%', duration: this.transitionDuration }, '<');
|
24
23
|
if (this.open) {
|
25
|
-
this.
|
24
|
+
gsap.timeline({ defaults: { duration: this.enterTransitionDuration } }).to(this.el, { display: 'block', opacity: 1 });
|
26
25
|
document.documentElement.style.overflow = 'hidden';
|
27
26
|
}
|
28
27
|
}
|
29
28
|
render() {
|
30
|
-
return (h(Host, { key: '
|
29
|
+
return (h(Host, { key: '4d8c07e1704e32808745d92d5befa8a4145a779f' }, h("slot", { key: 'f767b8da95b657cf8c118c298c38acaf72af8e8c' })));
|
31
30
|
}
|
32
31
|
static get is() { return "cpsl-overlay"; }
|
33
32
|
static get encapsulation() { return "shadow"; }
|
@@ -60,7 +59,7 @@ export class CpslOverlay {
|
|
60
59
|
"attribute": "open",
|
61
60
|
"reflect": false
|
62
61
|
},
|
63
|
-
"
|
62
|
+
"enterTransitionDuration": {
|
64
63
|
"type": "number",
|
65
64
|
"mutable": false,
|
66
65
|
"complexType": {
|
@@ -69,12 +68,30 @@ export class CpslOverlay {
|
|
69
68
|
"references": {}
|
70
69
|
},
|
71
70
|
"required": false,
|
72
|
-
"optional":
|
71
|
+
"optional": true,
|
72
|
+
"docs": {
|
73
|
+
"tags": [],
|
74
|
+
"text": "Duration in seconds of the fade out animation.\nDefault is .5."
|
75
|
+
},
|
76
|
+
"attribute": "enter-transition-duration",
|
77
|
+
"reflect": false,
|
78
|
+
"defaultValue": "0.5"
|
79
|
+
},
|
80
|
+
"exitTransitionDuration": {
|
81
|
+
"type": "number",
|
82
|
+
"mutable": false,
|
83
|
+
"complexType": {
|
84
|
+
"original": "number",
|
85
|
+
"resolved": "number",
|
86
|
+
"references": {}
|
87
|
+
},
|
88
|
+
"required": false,
|
89
|
+
"optional": true,
|
73
90
|
"docs": {
|
74
91
|
"tags": [],
|
75
|
-
"text": "Duration in seconds of the fade
|
92
|
+
"text": "Duration in seconds of the fade out animation.\nDefault is .5."
|
76
93
|
},
|
77
|
-
"attribute": "transition-duration",
|
94
|
+
"attribute": "exit-transition-duration",
|
78
95
|
"reflect": false,
|
79
96
|
"defaultValue": "0.5"
|
80
97
|
}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"cpsl-overlay.js","sourceRoot":"","sources":["../../../../src/components/cpsl-overlay/cpsl-overlay.tsx"],"names":[],"mappings":"AA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GAAG,IAAI,CAAC,CAAC;QACzC,CAAC;IACH,CAAC;IAED,gBAAgB;QACd,IAAI,IAAI,CAAC,IAAI,EAAE,CAAC;YACd,IAAI,CAAC,QAAQ,CAAC,EAAE,QAAQ,EAAE,EAAE,QAAQ,EAAE,IAAI,CAAC,uBAAuB,EAAE,EAAE,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,EAAE,EAAE,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,CAAC,EAAE,CAAC,CAAC;YACtH,QAAQ,CAAC,eAAe,CAAC,KAAK,CAAC,QAAQ,GAAG,QAAQ,CAAC;QACrD,CAAC;IACH,CAAC;IAED,MAAM;QACJ,OAAO,CACL,EAAC,IAAI;YACH,8DAAa,CACR,CACR,CAAC;IACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, Host, Prop, h, Element, Watch } from '@stencil/core';\nimport gsap from 'gsap';\n\n@Component({\n tag: 'cpsl-overlay',\n styleUrl: 'cpsl-overlay.scss',\n shadow: true,\n})\nexport class CpslOverlay {\n @Element() el!: HTMLCpslOverlayElement;\n\n /**\n * Whether or not to show the overlay.\n */\n @Prop() open: boolean;\n\n /**\n * Duration in seconds of the fade out animation.\n * Default is .5.\n */\n @Prop() enterTransitionDuration?: number = 0.5;\n\n /**\n * Duration in seconds of the fade out animation.\n * Default is .5.\n */\n @Prop() exitTransitionDuration?: number = 0.5;\n\n @Watch('open')\n toggleHeight() {\n this.open\n ? gsap.timeline({ defaults: { duration: this.enterTransitionDuration } }).to(this.el, { display: 'block', opacity: 1 })\n : gsap.timeline({ defaults: { duration: this.exitTransitionDuration } }).to(this.el, { display: 'none', opacity: 0 });\n\n if (this.open) {\n document.documentElement.style.overflow = 'hidden';\n } else {\n // Setting a timeout here to prevent modal from shifting when the scroll bar appears\n setTimeout(() => {\n document.documentElement.style.overflow = 'auto';\n }, this.exitTransitionDuration * 1000);\n }\n }\n\n componentDidLoad() {\n if (this.open) {\n gsap.timeline({ defaults: { duration: this.enterTransitionDuration } }).to(this.el, { display: 'block', opacity: 1 });\n document.documentElement.style.overflow = 'hidden';\n }\n }\n\n render() {\n return (\n <Host>\n <slot></slot>\n </Host>\n );\n }\n}\n"]}
|
@@ -54,12 +54,12 @@
|
|
54
54
|
* }
|
55
55
|
*/
|
56
56
|
:host {
|
57
|
-
--pill-text-color: var(--cpsl-
|
57
|
+
--pill-text-color: var(--cpsl-pill-text);
|
58
58
|
--pill-text-size: clamp(10px, 0.625rem, 15px);
|
59
59
|
--pill-text-line-height: 100%;
|
60
60
|
--pill-container-height: 18px;
|
61
|
-
--pill-container-background-color: var(--cpsl-color-
|
62
|
-
--pill-container-border-color: var(--cpsl-color-
|
61
|
+
--pill-container-background-color: var(--cpsl-color-pill-container-background);
|
62
|
+
--pill-container-border-color: var(--cpsl-color-pill-container-border);
|
63
63
|
--pill-container-padding-start: 8px;
|
64
64
|
--pill-container-padding-end: 8px;
|
65
65
|
--pill-container-border-radius: var(--cpsl-border-radius-pill);
|
@@ -4,7 +4,7 @@ export class CpslPill {
|
|
4
4
|
this.text = undefined;
|
5
5
|
}
|
6
6
|
render() {
|
7
|
-
return (h(Host, { key: '
|
7
|
+
return (h(Host, { key: 'c0d7930033e08ea264480fd457b176755eac7662' }, h("div", { key: 'b0f6d184dcfe34559b62a9c9da4354f5bfb59797', class: "pill-container" }, h("span", { key: '88634c4cd20dba3d850c51bb4089649364112566' }, this.text))));
|
8
8
|
}
|
9
9
|
static get is() { return "cpsl-pill"; }
|
10
10
|
static get encapsulation() { return "shadow"; }
|
@@ -55,9 +55,9 @@
|
|
55
55
|
*/
|
56
56
|
:host {
|
57
57
|
--step-height: 3px;
|
58
|
-
--step-active-color: var(--cpsl-color-
|
59
|
-
--step-next-color: var(--cpsl-color-
|
60
|
-
--step-previous-color: var(--cpsl-color-
|
58
|
+
--step-active-color: var(--cpsl-color-progressIndicator-active);
|
59
|
+
--step-next-color: var(--cpsl-color-progressIndicator-next);
|
60
|
+
--step-previous-color: var(--cpsl-color-progressIndicator-previous);
|
61
61
|
display: flex;
|
62
62
|
align-items: center;
|
63
63
|
justify-content: center;
|
@@ -54,9 +54,9 @@
|
|
54
54
|
* }
|
55
55
|
*/
|
56
56
|
:host {
|
57
|
-
--qr-color: var(--cpsl-color-
|
58
|
-
--qr-background-color: var(--cpsl-color-
|
59
|
-
--qr-border-color: var(--cpsl-color-
|
57
|
+
--qr-color: var(--cpsl-color-qr-fill);
|
58
|
+
--qr-background-color: var(--cpsl-color-qr-background);
|
59
|
+
--qr-border-color: var(--cpsl-color-qr-border);
|
60
60
|
--qr-border-radius: var(--cpsl-border-radius-qr-code);
|
61
61
|
--qr-border-width: 1px;
|
62
62
|
--qr-box-shadow: 0px 1px 2px var(--cpsl-color-alpha-black-10);
|