@clickmax/checkout-react 0.0.0-stage → 12.5.3
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/LICENSE +201 -0
- package/README.md +133 -2
- package/dist/index.d.ts +2405 -0
- package/dist/index.js +2822 -0
- package/dist/theme.css +147 -0
- package/package.json +63 -3
package/dist/theme.css
ADDED
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Optional base theme for the default markup of @clickmax/checkout-react.
|
|
3
|
+
* Import it once: `import '@clickmax/checkout-react/theme.css'`. Every rule targets a
|
|
4
|
+
* `data-cx-checkout` attribute at low specificity (`:where`), so any class of the page wins.
|
|
5
|
+
* Tweak it through the custom properties below.
|
|
6
|
+
*/
|
|
7
|
+
:where([data-cx-checkout]) {
|
|
8
|
+
--cx-checkout-color-text: #09090b;
|
|
9
|
+
--cx-checkout-color-muted: #71717a;
|
|
10
|
+
--cx-checkout-color-border: #e4e4e7;
|
|
11
|
+
--cx-checkout-color-accent: #16a34a;
|
|
12
|
+
--cx-checkout-color-danger: #dc2626;
|
|
13
|
+
--cx-checkout-radius: 8px;
|
|
14
|
+
--cx-checkout-gap: 12px;
|
|
15
|
+
color: var(--cx-checkout-color-text);
|
|
16
|
+
box-sizing: border-box;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
:where([data-cx-checkout="offer-item"]) {
|
|
20
|
+
display: grid;
|
|
21
|
+
gap: var(--cx-checkout-gap);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
:where([data-cx-checkout="offer-image"]) {
|
|
25
|
+
max-width: 100%;
|
|
26
|
+
border-radius: var(--cx-checkout-radius);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
:where([data-cx-checkout="offer-name"]) {
|
|
30
|
+
font-size: 1.25rem;
|
|
31
|
+
font-weight: 600;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
:where([data-cx-checkout="price"]) {
|
|
35
|
+
display: flex;
|
|
36
|
+
flex-wrap: wrap;
|
|
37
|
+
align-items: baseline;
|
|
38
|
+
gap: 8px;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
:where([data-cx-checkout="price-original"]) {
|
|
42
|
+
color: var(--cx-checkout-color-muted);
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
:where([data-cx-checkout="price-current"]) {
|
|
46
|
+
font-size: 1.5rem;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
:where([data-cx-checkout="price-installments"]) {
|
|
50
|
+
color: var(--cx-checkout-color-muted);
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
:where(
|
|
54
|
+
[data-cx-checkout="personal-data"],
|
|
55
|
+
[data-cx-checkout="address"],
|
|
56
|
+
[data-cx-checkout="order-bumps"],
|
|
57
|
+
[data-cx-checkout="order-bumps-required"],
|
|
58
|
+
[data-cx-checkout="order-bumps-optional"],
|
|
59
|
+
[data-cx-checkout="payment-methods"],
|
|
60
|
+
[data-cx-checkout="pix"]
|
|
61
|
+
) {
|
|
62
|
+
display: grid;
|
|
63
|
+
gap: var(--cx-checkout-gap);
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
:where([data-cx-checkout="field"]) {
|
|
67
|
+
display: grid;
|
|
68
|
+
gap: 4px;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
:where(
|
|
72
|
+
[data-cx-checkout="field"] input,
|
|
73
|
+
[data-cx-checkout="installments"],
|
|
74
|
+
[data-cx-checkout="coupon"] input
|
|
75
|
+
) {
|
|
76
|
+
height: 44px;
|
|
77
|
+
padding: 0 12px;
|
|
78
|
+
border: 1px solid var(--cx-checkout-color-border);
|
|
79
|
+
border-radius: var(--cx-checkout-radius);
|
|
80
|
+
font: inherit;
|
|
81
|
+
/* 16px or more keeps iOS from zooming into the field on focus. */
|
|
82
|
+
font-size: max(16px, 1rem);
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
:where([data-cx-checkout="field"][data-invalid="true"] input) {
|
|
86
|
+
border-color: var(--cx-checkout-color-danger);
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
:where([data-cx-checkout="field-error"], [data-cx-checkout="error"]) {
|
|
90
|
+
color: var(--cx-checkout-color-danger);
|
|
91
|
+
font-size: 0.875rem;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
:where([data-cx-checkout="order-bump"]) {
|
|
95
|
+
display: flex;
|
|
96
|
+
gap: var(--cx-checkout-gap);
|
|
97
|
+
align-items: center;
|
|
98
|
+
padding: 12px;
|
|
99
|
+
border: 1px dashed var(--cx-checkout-color-border);
|
|
100
|
+
border-radius: var(--cx-checkout-radius);
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
:where([data-cx-checkout="order-bump"][data-selected="true"]) {
|
|
104
|
+
border-color: var(--cx-checkout-color-accent);
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
:where([data-cx-checkout="order-bump"][data-required="true"]) {
|
|
108
|
+
border-style: solid;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
:where([data-cx-checkout="order-bumps-title"]) {
|
|
112
|
+
margin: 0;
|
|
113
|
+
font-size: 1rem;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
:where([data-cx-checkout="summary"] > div) {
|
|
117
|
+
display: flex;
|
|
118
|
+
justify-content: space-between;
|
|
119
|
+
margin: 0;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
:where([data-cx-checkout="summary-total"]) {
|
|
123
|
+
font-weight: 600;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
:where([data-cx-checkout="submit"], [data-cx-checkout="upsell-accept"]) {
|
|
127
|
+
width: 100%;
|
|
128
|
+
min-height: 48px;
|
|
129
|
+
border: 0;
|
|
130
|
+
border-radius: var(--cx-checkout-radius);
|
|
131
|
+
background: var(--cx-checkout-color-accent);
|
|
132
|
+
color: #fff;
|
|
133
|
+
font: inherit;
|
|
134
|
+
font-weight: 600;
|
|
135
|
+
cursor: pointer;
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
:where([data-cx-checkout="submit"][disabled], [data-cx-checkout="upsell-accept"][disabled]) {
|
|
139
|
+
opacity: 0.6;
|
|
140
|
+
cursor: progress;
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
:where([data-cx-checkout="pix-qrcode"]) {
|
|
144
|
+
width: 220px;
|
|
145
|
+
height: 220px;
|
|
146
|
+
justify-self: center;
|
|
147
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,66 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@clickmax/checkout-react",
|
|
3
|
-
"version": "
|
|
4
|
-
"
|
|
5
|
-
"
|
|
3
|
+
"version": "12.5.3",
|
|
4
|
+
"description": "Headless React components for the Clickmax checkout",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"clickmax",
|
|
7
|
+
"checkout",
|
|
8
|
+
"react",
|
|
9
|
+
"headless",
|
|
10
|
+
"payments",
|
|
11
|
+
"ssr"
|
|
12
|
+
],
|
|
13
|
+
"license": "Apache-2.0",
|
|
14
|
+
"sideEffects": [
|
|
15
|
+
"*.css"
|
|
16
|
+
],
|
|
17
|
+
"type": "module",
|
|
18
|
+
"exports": {
|
|
19
|
+
".": {
|
|
20
|
+
"types": "./dist/index.d.ts",
|
|
21
|
+
"default": "./dist/index.js"
|
|
22
|
+
},
|
|
23
|
+
"./theme.css": "./dist/theme.css"
|
|
24
|
+
},
|
|
25
|
+
"files": [
|
|
26
|
+
"dist"
|
|
27
|
+
],
|
|
28
|
+
"config": {
|
|
29
|
+
"deploy": "npm",
|
|
30
|
+
"watch": [
|
|
31
|
+
"sdk/payments/openapi.yaml"
|
|
32
|
+
]
|
|
33
|
+
},
|
|
34
|
+
"devDependencies": {
|
|
35
|
+
"@clickmax/tsconfig": "^1.0.0",
|
|
36
|
+
"@microsoft/api-extractor": "^7.58.12",
|
|
37
|
+
"@rsbuild/plugin-react": "^1.4.6",
|
|
38
|
+
"@rslib/core": "^0.20.3",
|
|
39
|
+
"@types/node": "^24.13.3",
|
|
40
|
+
"@types/react": "^19.2.18",
|
|
41
|
+
"@types/react-dom": "^19.2.4",
|
|
42
|
+
"happy-dom": "^20.11.1",
|
|
43
|
+
"orval": "^8.46.0",
|
|
44
|
+
"react": "^19.2.8",
|
|
45
|
+
"react-dom": "^19.2.8",
|
|
46
|
+
"typescript": "^7.0.2",
|
|
47
|
+
"vitest": "^4.1.10"
|
|
48
|
+
},
|
|
49
|
+
"peerDependencies": {
|
|
50
|
+
"react": ">=18.2.0",
|
|
51
|
+
"react-dom": ">=18.2.0"
|
|
52
|
+
},
|
|
53
|
+
"engines": {
|
|
54
|
+
"node": ">=20"
|
|
55
|
+
},
|
|
56
|
+
"publishConfig": {
|
|
57
|
+
"access": "public",
|
|
58
|
+
"registry": "https://registry.npmjs.org/"
|
|
59
|
+
},
|
|
60
|
+
"scripts": {
|
|
61
|
+
"build": "orval && rslib build",
|
|
62
|
+
"test": "vitest run",
|
|
63
|
+
"test-dev": "vitest",
|
|
64
|
+
"test-types": "tsrs --noEmit"
|
|
65
|
+
}
|
|
6
66
|
}
|