@salesforcedevs/docs-components 1.28.1 → 1.28.2-paymentcard-gc-alpha1
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/lwc.config.json +1 -0
- package/package.json +29 -28
- package/src/modules/doc/paymentCard/paymentCard.css +118 -0
- package/src/modules/doc/paymentCard/paymentCard.html +22 -0
- package/src/modules/doc/paymentCard/paymentCard.ts +91 -0
- package/src/modules/doc/xmlContent/xmlContent.html +1 -1
- package/LICENSE +0 -12
package/lwc.config.json
CHANGED
package/package.json
CHANGED
|
@@ -1,29 +1,30 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
2
|
+
"name": "@salesforcedevs/docs-components",
|
|
3
|
+
"version": "1.28.2-paymentcard-gc-alpha1",
|
|
4
|
+
"description": "Docs Lightning web components for DSC",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"main": "index.js",
|
|
7
|
+
"engines": {
|
|
8
|
+
"node": "20.x"
|
|
9
|
+
},
|
|
10
|
+
"publishConfig": {
|
|
11
|
+
"access": "public"
|
|
12
|
+
},
|
|
13
|
+
"dependencies": {
|
|
14
|
+
"@api-components/amf-helper-mixin": "4.5.29",
|
|
15
|
+
"classnames": "2.5.1",
|
|
16
|
+
"dompurify": "3.2.4",
|
|
17
|
+
"kagekiri": "1.4.2",
|
|
18
|
+
"lodash.orderby": "4.6.0",
|
|
19
|
+
"lodash.uniqby": "4.7.0",
|
|
20
|
+
"query-string": "7.1.3",
|
|
21
|
+
"sentence-case": "3.0.4"
|
|
22
|
+
},
|
|
23
|
+
"devDependencies": {
|
|
24
|
+
"@types/classnames": "2.3.1",
|
|
25
|
+
"@types/lodash.orderby": "4.6.9",
|
|
26
|
+
"@types/lodash.uniqby": "4.7.9"
|
|
27
|
+
},
|
|
28
|
+
"gitHead": "4629fdd9ca18a13480044ad43515b91945d16aad",
|
|
29
|
+
"stableVersion": "1.28.2"
|
|
30
|
+
}
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
@import "dxHelpers/reset";
|
|
2
|
+
@import "dxHelpers/text";
|
|
3
|
+
|
|
4
|
+
:host {
|
|
5
|
+
display: block;
|
|
6
|
+
max-width: 520px;
|
|
7
|
+
margin: 2rem auto;
|
|
8
|
+
min-height: 400px;
|
|
9
|
+
border-radius: 8px;
|
|
10
|
+
padding: 1rem;
|
|
11
|
+
--x-deg: 0deg;
|
|
12
|
+
--y-deg: 0deg;
|
|
13
|
+
--bg-x: 50%;
|
|
14
|
+
--bg-y: 50%;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
.container {
|
|
18
|
+
perspective: 1000px;
|
|
19
|
+
display: flex;
|
|
20
|
+
justify-content: center;
|
|
21
|
+
align-items: center;
|
|
22
|
+
padding: 50px;
|
|
23
|
+
border-radius: 8px;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
.card {
|
|
27
|
+
width: 400px;
|
|
28
|
+
height: 250px;
|
|
29
|
+
background: rgba(255, 255, 255, 0.07);
|
|
30
|
+
backdrop-filter: blur(16px);
|
|
31
|
+
-webkit-backdrop-filter: blur(16px);
|
|
32
|
+
border-radius: 16px;
|
|
33
|
+
border: 1px solid rgba(255, 255, 255, 0.2);
|
|
34
|
+
position: relative;
|
|
35
|
+
padding: 30px;
|
|
36
|
+
display: flex;
|
|
37
|
+
flex-direction: column;
|
|
38
|
+
justify-content: space-between;
|
|
39
|
+
box-shadow: 0 25px 50px rgba(0, 0, 0, 0.4);
|
|
40
|
+
color: white;
|
|
41
|
+
transform: rotateX(var(--x-deg)) rotateY(var(--y-deg));
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
.card.debit {
|
|
45
|
+
background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
.card.credit {
|
|
49
|
+
background: linear-gradient(135deg, #b8860b 0%, #daa520 50%, #b8860b 100%);
|
|
50
|
+
border-color: rgba(255, 215, 0, 0.4);
|
|
51
|
+
color: #1a1508;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
.card.credit .label {
|
|
55
|
+
color: rgba(26, 21, 8, 0.85);
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
.card-label,
|
|
59
|
+
.chip,
|
|
60
|
+
.number,
|
|
61
|
+
.details {
|
|
62
|
+
position: relative;
|
|
63
|
+
z-index: 1;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
.card-label {
|
|
67
|
+
font-family: var(--dx-g-font-display, system-ui, sans-serif);
|
|
68
|
+
font-size: var(--dx-g-spacing-md, 0.875rem);
|
|
69
|
+
font-weight: 600;
|
|
70
|
+
line-height: 1.25;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
.card::before {
|
|
74
|
+
content: '';
|
|
75
|
+
position: absolute;
|
|
76
|
+
inset: 0;
|
|
77
|
+
z-index: 0;
|
|
78
|
+
background: linear-gradient(125deg,
|
|
79
|
+
transparent 0%,
|
|
80
|
+
rgba(255, 255, 255, 0.1) 45%,
|
|
81
|
+
rgba(255, 255, 255, 0.3) 50%,
|
|
82
|
+
rgba(255, 255, 255, 0.1) 55%,
|
|
83
|
+
transparent 100%);
|
|
84
|
+
background-size: 200% 200%;
|
|
85
|
+
background-position: var(--bg-x) var(--bg-y);
|
|
86
|
+
border-radius: inherit;
|
|
87
|
+
pointer-events: none;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
.chip {
|
|
91
|
+
width: 50px;
|
|
92
|
+
height: 40px;
|
|
93
|
+
background: linear-gradient(135deg, #fceabb 0%, #f8b500 50%, #fceabb 100%);
|
|
94
|
+
border-radius: 6px;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
.number,
|
|
98
|
+
.value {
|
|
99
|
+
font-family: 'Courier New', monospace;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
.number {
|
|
103
|
+
font-size: 1.6rem;
|
|
104
|
+
letter-spacing: 2px;
|
|
105
|
+
margin-top: 20px;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
.label {
|
|
109
|
+
display: block;
|
|
110
|
+
font-size: 0.65rem;
|
|
111
|
+
text-transform: uppercase;
|
|
112
|
+
color: rgba(255, 255, 255, 0.8);
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
.value {
|
|
116
|
+
font-size: 0.9rem;
|
|
117
|
+
font-weight: bold;
|
|
118
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="container">
|
|
3
|
+
<div class={cardClass}>
|
|
4
|
+
<div class={cardLabelClass}>{cardLabel}</div>
|
|
5
|
+
|
|
6
|
+
<div class="chip"></div>
|
|
7
|
+
|
|
8
|
+
<div class="number">{number}</div>
|
|
9
|
+
|
|
10
|
+
<div class="details">
|
|
11
|
+
<div>
|
|
12
|
+
<span class="label">Cardholder Name</span>
|
|
13
|
+
<span class="value">{cardHolder}</span>
|
|
14
|
+
</div>
|
|
15
|
+
<div>
|
|
16
|
+
<span class="label">Valid Thru</span>
|
|
17
|
+
<span class="value">{expires}</span>
|
|
18
|
+
</div>
|
|
19
|
+
</div>
|
|
20
|
+
</div>
|
|
21
|
+
</div>
|
|
22
|
+
</template>
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import { LightningElement, api } from "lwc";
|
|
2
|
+
import { normalizeBoolean } from "dxUtils/normalizers";
|
|
3
|
+
|
|
4
|
+
export default class PaymentCard extends LightningElement {
|
|
5
|
+
_isDebit: boolean = false;
|
|
6
|
+
_number: string | null = null;
|
|
7
|
+
|
|
8
|
+
@api
|
|
9
|
+
get number(): string | null {
|
|
10
|
+
return this._number;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
set number(value: string | null) {
|
|
14
|
+
if (value) {
|
|
15
|
+
const digits = value.replace(/\s/g, "");
|
|
16
|
+
this._number = digits.replace(/(.{4})/g, "$1 ").trim();
|
|
17
|
+
} else {
|
|
18
|
+
this._number = value;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
_cardHolder: string | null = null;
|
|
22
|
+
|
|
23
|
+
@api
|
|
24
|
+
get cardHolder(): string | null {
|
|
25
|
+
return this._cardHolder;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
set cardHolder(value: string | null) {
|
|
29
|
+
this._cardHolder = value ? value.toUpperCase() : value;
|
|
30
|
+
}
|
|
31
|
+
@api expires: string | null = null;
|
|
32
|
+
@api
|
|
33
|
+
get isDebit(): boolean {
|
|
34
|
+
return this._isDebit;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
set isDebit(value) {
|
|
38
|
+
this._isDebit = normalizeBoolean(value);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
get cardClass(): string {
|
|
42
|
+
return this._isDebit ? "card debit" : "card credit";
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
get cardLabelClass(): string {
|
|
46
|
+
return this._isDebit ? "card-label debit" : "card-label credit";
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
get cardLabel(): string {
|
|
50
|
+
return this._isDebit ? "Debit" : "Credit";
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
renderedCallback() {
|
|
54
|
+
if (this._initialized) {
|
|
55
|
+
return;
|
|
56
|
+
}
|
|
57
|
+
this._initialized = true;
|
|
58
|
+
|
|
59
|
+
const card = this.template.querySelector(".card") as HTMLElement;
|
|
60
|
+
if (!card) {
|
|
61
|
+
return;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
let mouseX = 0;
|
|
65
|
+
let mouseY = 0;
|
|
66
|
+
let rotateX = 0;
|
|
67
|
+
let rotateY = 0;
|
|
68
|
+
|
|
69
|
+
const onMouseMove = (e: MouseEvent) => {
|
|
70
|
+
mouseX = (window.innerWidth / 2 - e.clientX) / 15;
|
|
71
|
+
mouseY = (e.clientY - window.innerHeight / 2) / 15;
|
|
72
|
+
};
|
|
73
|
+
|
|
74
|
+
const animate = () => {
|
|
75
|
+
rotateX += (mouseY - rotateX) * 0.1;
|
|
76
|
+
rotateY += (mouseX - rotateY) * 0.1;
|
|
77
|
+
|
|
78
|
+
card.style.setProperty("--x-deg", `${rotateX}deg`);
|
|
79
|
+
card.style.setProperty("--y-deg", `${rotateY}deg`);
|
|
80
|
+
card.style.setProperty("--bg-x", `${50 + rotateY * 2}%`);
|
|
81
|
+
card.style.setProperty("--bg-y", `${50 + rotateX * 2}%`);
|
|
82
|
+
|
|
83
|
+
requestAnimationFrame(animate);
|
|
84
|
+
};
|
|
85
|
+
|
|
86
|
+
window.addEventListener("mousemove", onMouseMove);
|
|
87
|
+
requestAnimationFrame(animate);
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
_initialized = false;
|
|
91
|
+
}
|
|
@@ -53,7 +53,7 @@
|
|
|
53
53
|
</doc-content-layout>
|
|
54
54
|
<div lwc:if={display404}>
|
|
55
55
|
<dx-error
|
|
56
|
-
image="https://developer.salesforce.com/ns-assets/
|
|
56
|
+
image="https://developer.salesforce.com/ns-assets/404.svg"
|
|
57
57
|
code="404"
|
|
58
58
|
header="Beep boop. That did not compute."
|
|
59
59
|
subtitle="The document you're looking for doesn't seem to exist."
|
package/LICENSE
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
Copyright (c) 2020, Salesforce.com, Inc.
|
|
2
|
-
All rights reserved.
|
|
3
|
-
|
|
4
|
-
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
|
|
5
|
-
|
|
6
|
-
* Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
|
|
7
|
-
|
|
8
|
-
* Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
|
|
9
|
-
|
|
10
|
-
* Neither the name of Salesforce.com nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
|
|
11
|
-
|
|
12
|
-
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|