@one-payments/web-components 1.1.31 → 1.2.0

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.
@@ -80,6 +80,39 @@ let OnePayment = class OnePayment extends LitElement {
80
80
  this.expiryCleave = null;
81
81
  this.leaveEventsCounter = 0;
82
82
  this.previousState = null;
83
+ // ═══════════════════════════════════════════════════════════════
84
+ // Appearance/Theming Methods
85
+ // ═══════════════════════════════════════════════════════════════
86
+ /**
87
+ * Map of appearance variable names to CSS custom property names
88
+ */
89
+ this.cssVariableMap = {
90
+ colorPrimary: '--op-color-primary',
91
+ colorPrimaryHover: '--op-color-primary-hover',
92
+ colorPrimaryText: '--op-color-primary-text',
93
+ colorBackground: '--op-color-background',
94
+ colorSurface: '--op-color-surface',
95
+ colorText: '--op-color-text',
96
+ colorTextSecondary: '--op-color-text-secondary',
97
+ colorDanger: '--op-color-danger',
98
+ colorSuccess: '--op-color-success',
99
+ colorWarning: '--op-color-warning',
100
+ colorBorder: '--op-color-border',
101
+ colorBorderFocus: '--op-color-border-focus',
102
+ fontFamily: '--op-font-family',
103
+ fontSize: '--op-font-size',
104
+ fontSizeSmall: '--op-font-size-sm',
105
+ borderRadius: '--op-border-radius',
106
+ borderRadiusLarge: '--op-border-radius-lg',
107
+ spacingUnit: '--op-spacing-unit',
108
+ boxShadow: '--op-box-shadow',
109
+ boxShadowLarge: '--op-box-shadow-lg',
110
+ };
111
+ /**
112
+ * Media query listener for auto theme
113
+ */
114
+ this.themeMediaQuery = null;
115
+ this.themeMediaQueryHandler = null;
83
116
  this.handle3DSPostMessage = (event) => {
84
117
  if (event.data === 'ON_AWX_3DS_START_PAGE_LEAVE') {
85
118
  this.leaveEventsCounter++;
@@ -114,6 +147,79 @@ let OnePayment = class OnePayment extends LitElement {
114
147
  }
115
148
  return true;
116
149
  }
150
+ /**
151
+ * Apply appearance settings to the component
152
+ *
153
+ * This method:
154
+ * 1. Sets the data-theme attribute based on theme option
155
+ * 2. Applies CSS custom properties from variables
156
+ *
157
+ * @private
158
+ */
159
+ applyAppearance() {
160
+ if (!this.appearance) {
161
+ // Reset to default if appearance is removed
162
+ this.removeAttribute('data-theme');
163
+ return;
164
+ }
165
+ const { theme, variables } = this.appearance;
166
+ // Apply theme
167
+ if (theme) {
168
+ if (theme === 'auto') {
169
+ // Check system preference
170
+ const prefersDark = window.matchMedia('(prefers-color-scheme: dark)').matches;
171
+ this.dataset['theme'] = prefersDark ? 'dark' : 'light';
172
+ // Listen for system theme changes
173
+ this.setupThemeMediaQueryListener();
174
+ }
175
+ else {
176
+ this.dataset['theme'] = theme;
177
+ }
178
+ }
179
+ // Apply CSS variable overrides
180
+ if (variables) {
181
+ this.applyCssVariables(variables);
182
+ }
183
+ }
184
+ /**
185
+ * Apply CSS custom properties from variables object
186
+ */
187
+ applyCssVariables(variables) {
188
+ for (const [key, cssVar] of Object.entries(this.cssVariableMap)) {
189
+ const value = variables[key];
190
+ if (value !== undefined && value !== null) {
191
+ this.style.setProperty(cssVar, value);
192
+ }
193
+ else {
194
+ // Remove custom property to use default
195
+ this.style.removeProperty(cssVar);
196
+ }
197
+ }
198
+ }
199
+ /**
200
+ * Setup listener for system theme changes (for theme: 'auto')
201
+ */
202
+ setupThemeMediaQueryListener() {
203
+ // Clean up existing listener
204
+ this.cleanupThemeMediaQueryListener();
205
+ this.themeMediaQuery = window.matchMedia('(prefers-color-scheme: dark)');
206
+ this.themeMediaQueryHandler = (e) => {
207
+ if (this.appearance?.theme === 'auto') {
208
+ this.dataset['theme'] = e.matches ? 'dark' : 'light';
209
+ }
210
+ };
211
+ this.themeMediaQuery.addEventListener('change', this.themeMediaQueryHandler);
212
+ }
213
+ /**
214
+ * Clean up theme media query listener
215
+ */
216
+ cleanupThemeMediaQueryListener() {
217
+ if (this.themeMediaQuery && this.themeMediaQueryHandler) {
218
+ this.themeMediaQuery.removeEventListener('change', this.themeMediaQueryHandler);
219
+ this.themeMediaQuery = null;
220
+ this.themeMediaQueryHandler = null;
221
+ }
222
+ }
117
223
  // --- Lifecycle ---
118
224
  connectedCallback() {
119
225
  super.connectedCallback();
@@ -130,6 +236,8 @@ let OnePayment = class OnePayment extends LitElement {
130
236
  });
131
237
  }
132
238
  firstUpdated() {
239
+ // Apply appearance settings
240
+ this.applyAppearance();
133
241
  // Initialize SDK after properties are set
134
242
  // This runs AFTER the first render and property updates
135
243
  this.initializeSDK();
@@ -146,6 +254,10 @@ let OnePayment = class OnePayment extends LitElement {
146
254
  */
147
255
  updated(changedProperties) {
148
256
  super.updated(changedProperties);
257
+ // Apply appearance when it changes
258
+ if (changedProperties.has('appearance')) {
259
+ this.applyAppearance();
260
+ }
149
261
  // If not yet initialized and all required props are now present, initialize
150
262
  if (!this.isInitialized && this.hasAllRequiredProps()) {
151
263
  console.info('[OnePayment] All required props now available. Initializing SDK...');
@@ -154,6 +266,8 @@ let OnePayment = class OnePayment extends LitElement {
154
266
  }
155
267
  disconnectedCallback() {
156
268
  super.disconnectedCallback();
269
+ // Clean up theme media query listener
270
+ this.cleanupThemeMediaQueryListener();
157
271
  this.sdk?.destroy();
158
272
  this.isInitialized = false;
159
273
  this.destroyCleave();
@@ -1006,7 +1120,6 @@ let OnePayment = class OnePayment extends LitElement {
1006
1120
  </div>
1007
1121
  <h2 class="result-title">Payment Failed</h2>
1008
1122
  <p class="result-message">${errorMessage}</p>
1009
- <button class="retry-button" @click=${() => window.location.reload()}>Try Again</button>
1010
1123
  </div>
1011
1124
  `;
1012
1125
  }
@@ -1045,12 +1158,7 @@ let OnePayment = class OnePayment extends LitElement {
1045
1158
  // Card icon SVG
1046
1159
  return html `
1047
1160
  <div class="method-icon-right">
1048
- <svg
1049
- width="24"
1050
- height="24"
1051
- viewBox="0 0 24 24"
1052
- xmlns="http://www.w3.org/2000/svg"
1053
- >
1161
+ <svg width="24" height="24" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
1054
1162
  <path
1055
1163
  fill="none"
1056
1164
  d="M22 10H2M11 14H6M2 8.2L2 15.8C2 16.9201 2 17.4802 2.21799 17.908C2.40973 18.2843 2.71569 18.5903 3.09202 18.782C3.51984 19 4.07989 19 5.2 19L18.8 19C19.9201 19 20.4802 19 20.908 18.782C21.2843 18.5903 21.5903 18.2843 21.782 17.908C22 17.4802 22 16.9201 22 15.8V8.2C22 7.0799 22 6.51984 21.782 6.09202C21.5903 5.7157 21.2843 5.40974 20.908 5.21799C20.4802 5 19.9201 5 18.8 5L5.2 5C4.0799 5 3.51984 5 3.09202 5.21799C2.7157 5.40973 2.40973 5.71569 2.21799 6.09202C2 6.51984 2 7.07989 2 8.2Z"
@@ -1133,11 +1241,64 @@ let OnePayment = class OnePayment extends LitElement {
1133
1241
  };
1134
1242
  // --- Styles (EXACT original design from PaymentElement.module.scss) ---
1135
1243
  OnePayment.styles = css `
1244
+ /* ═══════════════════════════════════════════════════════════════
1245
+ CSS CUSTOM PROPERTIES (Theming)
1246
+ ═══════════════════════════════════════════════════════════════ */
1247
+
1136
1248
  :host {
1249
+ /* ─── Color Tokens (Light Theme Default) ─── */
1250
+ --op-color-primary: #2a2327;
1251
+ --op-color-primary-hover: #1a1517;
1252
+ --op-color-primary-text: #ffbe32;
1253
+ --op-color-background: #ffffff;
1254
+ --op-color-surface: #f9fafb;
1255
+ --op-color-text: #1f2937;
1256
+ --op-color-text-secondary: #6b7280;
1257
+ --op-color-danger: #ef4444;
1258
+ --op-color-success: #10b981;
1259
+ --op-color-warning: #f59e0b;
1260
+ --op-color-border: #e5e7eb;
1261
+ --op-color-border-focus: #2a2327;
1262
+
1263
+ /* ─── Typography Tokens ─── */
1264
+ --op-font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto,
1265
+ 'Helvetica Neue', Arial, sans-serif;
1266
+ --op-font-size: 16px;
1267
+ --op-font-size-sm: 14px;
1268
+ --op-font-size-xs: 12px;
1269
+
1270
+ /* ─── Layout Tokens ─── */
1271
+ --op-border-radius: 8px;
1272
+ --op-border-radius-lg: 40px;
1273
+ --op-spacing-unit: 4px;
1274
+ --op-box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
1275
+ --op-box-shadow-lg: 0 4px 6px rgba(0, 0, 0, 0.1);
1276
+ --op-transition: 0.2s ease;
1277
+
1278
+ /* ─── Base Styles ─── */
1137
1279
  display: block;
1138
- font-family:
1139
- -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
1280
+ font-family: var(--op-font-family);
1140
1281
  box-sizing: border-box;
1282
+ background-color: var(--op-color-background);
1283
+ color: var(--op-color-text);
1284
+ }
1285
+
1286
+ /* ─── Dark Theme ─── */
1287
+ :host([data-theme="dark"]) {
1288
+ --op-color-primary: #ffbe32;
1289
+ --op-color-primary-hover: #ffd666;
1290
+ --op-color-primary-text: #1a1517;
1291
+ --op-color-background: #1a1517;
1292
+ --op-color-surface: #2a2327;
1293
+ --op-color-text: #f9fafb;
1294
+ --op-color-text-secondary: #9ca3af;
1295
+ --op-color-danger: #f87171;
1296
+ --op-color-success: #34d399;
1297
+ --op-color-warning: #fbbf24;
1298
+ --op-color-border: #4b5563;
1299
+ --op-color-border-focus: #ffbe32;
1300
+ --op-box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
1301
+ --op-box-shadow-lg: 0 4px 6px rgba(0, 0, 0, 0.4);
1141
1302
  }
1142
1303
 
1143
1304
  * {
@@ -1154,10 +1315,10 @@ OnePayment.styles = css `
1154
1315
  .header {
1155
1316
  text-align: left;
1156
1317
  padding: 1rem 0;
1157
- color: #6b7280;
1158
- font-size: 0.875rem;
1318
+ color: var(--op-color-text-secondary);
1319
+ font-size: var(--op-font-size-sm);
1159
1320
  font-weight: 400;
1160
- border-bottom: 1px solid #e5e7eb;
1321
+ border-bottom: 1px solid var(--op-color-border);
1161
1322
  margin-bottom: 1rem;
1162
1323
  }
1163
1324
 
@@ -1170,10 +1331,10 @@ OnePayment.styles = css `
1170
1331
  }
1171
1332
 
1172
1333
  .payment-method-item {
1173
- border: 1px solid #e5e7eb;
1174
- border-radius: 0.5rem;
1334
+ border: 1px solid var(--op-color-border);
1335
+ border-radius: var(--op-border-radius);
1175
1336
  overflow: visible;
1176
- background: #ffffff;
1337
+ background: var(--op-color-background);
1177
1338
  width: 100%;
1178
1339
  }
1179
1340
 
@@ -1181,20 +1342,20 @@ OnePayment.styles = css `
1181
1342
  display: flex;
1182
1343
  align-items: center;
1183
1344
  padding: 1rem 1.25rem;
1184
- background: #ffffff;
1345
+ background: var(--op-color-background);
1185
1346
  cursor: pointer;
1186
- transition: background-color 150ms ease;
1347
+ transition: background-color var(--op-transition);
1187
1348
  user-select: none;
1188
1349
  width: 100%;
1189
- border-radius: 0.5rem 0.5rem 0 0;
1350
+ border-radius: var(--op-border-radius) var(--op-border-radius) 0 0;
1190
1351
  }
1191
1352
 
1192
1353
  .method-header:hover {
1193
- background-color: #f9fafb;
1354
+ background-color: var(--op-color-surface);
1194
1355
  }
1195
1356
 
1196
1357
  .method-header.selected {
1197
- background-color: #f3f4f6;
1358
+ background-color: var(--op-color-surface);
1198
1359
  }
1199
1360
 
1200
1361
  .radio {
@@ -1205,20 +1366,20 @@ OnePayment.styles = css `
1205
1366
  margin-right: 10px;
1206
1367
  flex-shrink: 0;
1207
1368
  cursor: pointer;
1208
- accent-color: #ffbe32;
1369
+ accent-color: var(--op-color-primary);
1209
1370
  -webkit-appearance: none;
1210
1371
  -moz-appearance: none;
1211
1372
  appearance: none;
1212
- border: 2px solid #d1d5db;
1373
+ border: 2px solid var(--op-color-border);
1213
1374
  border-radius: 50%;
1214
- background-color: #ffffff;
1375
+ background-color: var(--op-color-background);
1215
1376
  position: relative;
1216
- transition: border-color 150ms ease;
1377
+ transition: border-color var(--op-transition);
1217
1378
  }
1218
1379
 
1219
1380
  .radio:checked {
1220
- border-color: #ffbe32;
1221
- background-color: #ffffff;
1381
+ border-color: var(--op-color-primary);
1382
+ background-color: var(--op-color-background);
1222
1383
  }
1223
1384
 
1224
1385
  .radio:checked::after {
@@ -1230,11 +1391,11 @@ OnePayment.styles = css `
1230
1391
  width: 0.625rem;
1231
1392
  height: 0.625rem;
1232
1393
  border-radius: 50%;
1233
- background-color: #ffbe32;
1394
+ background-color: var(--op-color-primary);
1234
1395
  }
1235
1396
 
1236
1397
  .radio:hover:not(:disabled) {
1237
- border-color: #9ca3af;
1398
+ border-color: var(--op-color-text-secondary);
1238
1399
  }
1239
1400
 
1240
1401
  .method-icon {
@@ -1246,7 +1407,7 @@ OnePayment.styles = css `
1246
1407
  justify-content: center;
1247
1408
  font-size: 1.25rem;
1248
1409
  flex-shrink: 0;
1249
- color: #6b7280;
1410
+ color: var(--op-color-text-secondary);
1250
1411
  margin-right: 0.625rem;
1251
1412
  }
1252
1413
 
@@ -1258,7 +1419,7 @@ OnePayment.styles = css `
1258
1419
  align-items: center;
1259
1420
  justify-content: center;
1260
1421
  flex-shrink: 0;
1261
- color: #6b7280;
1422
+ color: var(--op-color-text-secondary);
1262
1423
  }
1263
1424
 
1264
1425
  .method-icon-right svg {
@@ -1273,9 +1434,9 @@ OnePayment.styles = css `
1273
1434
  }
1274
1435
 
1275
1436
  .method-name {
1276
- font-size: 1rem;
1437
+ font-size: var(--op-font-size);
1277
1438
  font-weight: 500;
1278
- color: #111827;
1439
+ color: var(--op-color-text);
1279
1440
  flex-shrink: 0;
1280
1441
  text-align: left;
1281
1442
  margin-right: 10px;
@@ -1284,8 +1445,8 @@ OnePayment.styles = css `
1284
1445
  /* Accordion Content */
1285
1446
  .method-content {
1286
1447
  padding: 1.5rem;
1287
- background-color: #ffffff;
1288
- border-top: 1px solid #e5e7eb;
1448
+ background-color: var(--op-color-background);
1449
+ border-top: 1px solid var(--op-color-border);
1289
1450
  width: 100%;
1290
1451
  overflow: visible;
1291
1452
  }
@@ -1297,9 +1458,9 @@ OnePayment.styles = css `
1297
1458
  }
1298
1459
 
1299
1460
  .form-title {
1300
- font-size: 1rem;
1461
+ font-size: var(--op-font-size);
1301
1462
  font-weight: 500;
1302
- color: #111827;
1463
+ color: var(--op-color-text);
1303
1464
  margin: 0 0 1rem 0;
1304
1465
  text-align: left;
1305
1466
  }
@@ -1318,22 +1479,23 @@ OnePayment.styles = css `
1318
1479
  .form-label {
1319
1480
  display: block;
1320
1481
  margin-bottom: 0.5rem;
1321
- font-size: 0.875rem;
1482
+ font-size: var(--op-font-size-sm);
1322
1483
  font-weight: 500;
1323
- color: #374151;
1484
+ color: var(--op-color-text);
1324
1485
  text-align: left;
1325
1486
  }
1326
1487
 
1327
1488
  .input {
1328
1489
  width: 100%;
1329
1490
  padding: 0.75rem;
1330
- border: 1px solid #d1d5db;
1331
- border-radius: 0.375rem;
1332
- font-size: 0.9375rem;
1491
+ border: 1px solid var(--op-color-border);
1492
+ border-radius: calc(var(--op-border-radius) / 2);
1493
+ font-size: var(--op-font-size);
1494
+ font-family: var(--op-font-family);
1333
1495
  line-height: 1.25rem;
1334
- background: white;
1335
- color: black;
1336
- transition: all 150ms ease;
1496
+ background: var(--op-color-background);
1497
+ color: var(--op-color-text);
1498
+ transition: all var(--op-transition);
1337
1499
  -webkit-appearance: none;
1338
1500
  -moz-appearance: none;
1339
1501
  appearance: none;
@@ -1341,24 +1503,24 @@ OnePayment.styles = css `
1341
1503
 
1342
1504
  .input:focus {
1343
1505
  outline: none;
1344
- border-color: #7c3aed;
1506
+ border-color: var(--op-color-border-focus);
1345
1507
  box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.1);
1346
1508
  }
1347
1509
 
1348
1510
  .input::placeholder {
1349
- color: #9ca3af;
1511
+ color: var(--op-color-text-secondary);
1350
1512
  }
1351
1513
 
1352
1514
  .input:hover:not(:focus) {
1353
- border-color: #9ca3af;
1515
+ border-color: var(--op-color-text-secondary);
1354
1516
  }
1355
1517
 
1356
1518
  .input.input-error {
1357
- border-color: #dc2626;
1519
+ border-color: var(--op-color-danger);
1358
1520
  }
1359
1521
 
1360
1522
  .input.input-error:focus {
1361
- border-color: #dc2626;
1523
+ border-color: var(--op-color-danger);
1362
1524
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.1);
1363
1525
  }
1364
1526
 
@@ -1371,8 +1533,8 @@ OnePayment.styles = css `
1371
1533
 
1372
1534
  .error-message {
1373
1535
  margin-top: 0.25rem;
1374
- color: #dc2626;
1375
- font-size: 0.75rem;
1536
+ color: var(--op-color-danger);
1537
+ font-size: var(--op-font-size-xs);
1376
1538
  line-height: 1.25;
1377
1539
  }
1378
1540
 
@@ -1390,21 +1552,21 @@ OnePayment.styles = css `
1390
1552
  padding: 10px 24px;
1391
1553
  font-size: 18px;
1392
1554
  font-weight: 650;
1393
- color: #ffbe32;
1555
+ color: var(--op-color-primary-text);
1394
1556
  line-height: normal;
1395
1557
  border: 0;
1396
- border-radius: 40px;
1558
+ border-radius: var(--op-border-radius-lg);
1397
1559
  text-decoration: none;
1398
1560
  transition:
1399
- background-color 0.2s ease,
1400
- border-color 0.2s ease,
1401
- color 0.2s ease,
1402
- opacity 0.2s ease;
1561
+ background-color var(--op-transition),
1562
+ border-color var(--op-transition),
1563
+ color var(--op-transition),
1564
+ opacity var(--op-transition);
1403
1565
  overflow: hidden;
1404
1566
  user-select: none;
1405
1567
  position: relative;
1406
1568
  cursor: pointer;
1407
- background-color: #2a2327;
1569
+ background-color: var(--op-color-primary);
1408
1570
  white-space: nowrap;
1409
1571
  letter-spacing: 0;
1410
1572
  -webkit-appearance: none;
@@ -1414,13 +1576,12 @@ OnePayment.styles = css `
1414
1576
 
1415
1577
  .pay-button:disabled {
1416
1578
  cursor: not-allowed;
1417
- color: rgba(255, 190, 50, 0.8);
1418
- background-color: rgba(42, 35, 39, 0.8);
1579
+ opacity: 0.7;
1419
1580
  }
1420
1581
 
1421
1582
  .pay-button:not(:disabled):hover,
1422
1583
  .pay-button:not(:disabled):focus-visible {
1423
- background-color: #000;
1584
+ background-color: var(--op-color-primary-hover);
1424
1585
  }
1425
1586
 
1426
1587
  .pay-button:not(:disabled):active {
@@ -1446,7 +1607,7 @@ OnePayment.styles = css `
1446
1607
  margin-left: -10px;
1447
1608
  margin-top: -10px;
1448
1609
  border: 2px solid transparent;
1449
- border-top-color: #ffbe32;
1610
+ border-top-color: var(--op-color-primary-text);
1450
1611
  border-radius: 50%;
1451
1612
  animation: button-spinner 0.8s linear infinite;
1452
1613
  }
@@ -1486,7 +1647,7 @@ OnePayment.styles = css `
1486
1647
  }
1487
1648
 
1488
1649
  .processing-text {
1489
- color: #6b7280;
1650
+ color: var(--op-color-text-secondary);
1490
1651
  margin: 0;
1491
1652
  }
1492
1653
 
@@ -1505,32 +1666,31 @@ OnePayment.styles = css `
1505
1666
  padding: 10px 24px;
1506
1667
  font-size: 18px;
1507
1668
  font-weight: 650;
1508
- color: #ffbe32;
1669
+ color: var(--op-color-primary-text);
1509
1670
  line-height: normal;
1510
1671
  border: 0;
1511
- border-radius: 40px;
1672
+ border-radius: var(--op-border-radius-lg);
1512
1673
  text-decoration: none;
1513
1674
  transition:
1514
- background-color 0.2s ease,
1675
+ background-color var(--op-transition),
1515
1676
  transform 0.05s ease;
1516
1677
  overflow: hidden;
1517
1678
  user-select: none;
1518
1679
  position: relative;
1519
1680
  cursor: pointer;
1520
- background-color: #2a2327;
1681
+ background-color: var(--op-color-primary);
1521
1682
  white-space: nowrap;
1522
1683
  letter-spacing: 0;
1523
1684
  }
1524
1685
 
1525
1686
  .paynow-container .scanned-button:disabled {
1526
1687
  cursor: not-allowed;
1527
- color: rgba(255, 190, 50, 0.8);
1528
- background-color: rgba(42, 35, 39, 0.8);
1688
+ opacity: 0.7;
1529
1689
  }
1530
1690
 
1531
1691
  .paynow-container .scanned-button:not(:disabled):hover,
1532
1692
  .paynow-container .scanned-button:not(:disabled):focus-visible {
1533
- background-color: #000;
1693
+ background-color: var(--op-color-primary-hover);
1534
1694
  }
1535
1695
 
1536
1696
  .paynow-container .scanned-button:not(:disabled):active {
@@ -1544,9 +1704,9 @@ OnePayment.styles = css `
1544
1704
  }
1545
1705
 
1546
1706
  .instructions-title {
1547
- font-size: 1rem;
1707
+ font-size: var(--op-font-size);
1548
1708
  font-weight: 600;
1549
- color: #111827;
1709
+ color: var(--op-color-text);
1550
1710
  margin: 0 0 1.5rem 0;
1551
1711
  text-align: left;
1552
1712
  }
@@ -1573,9 +1733,9 @@ OnePayment.styles = css `
1573
1733
  height: 1.75rem;
1574
1734
  min-width: 1.75rem;
1575
1735
  border-radius: 50%;
1576
- background-color: #ffbe32;
1577
- color: #ffffff;
1578
- font-size: 0.875rem;
1736
+ background-color: var(--op-color-primary);
1737
+ color: var(--op-color-background);
1738
+ font-size: var(--op-font-size-sm);
1579
1739
  font-weight: 600;
1580
1740
  flex-shrink: 0;
1581
1741
  }
@@ -1584,7 +1744,7 @@ OnePayment.styles = css `
1584
1744
  flex: 1;
1585
1745
  margin: 0;
1586
1746
  padding-top: 0.125rem;
1587
- color: #374151;
1747
+ color: var(--op-color-text);
1588
1748
  font-size: 0.9375rem;
1589
1749
  line-height: 1.5;
1590
1750
  }
@@ -1595,8 +1755,8 @@ OnePayment.styles = css `
1595
1755
  }
1596
1756
 
1597
1757
  .qr-instruction {
1598
- color: #6b7280;
1599
- font-size: 14px;
1758
+ color: var(--op-color-text-secondary);
1759
+ font-size: var(--op-font-size-sm);
1600
1760
  margin-bottom: 1.5rem;
1601
1761
  line-height: 1.5;
1602
1762
  }
@@ -1608,33 +1768,33 @@ OnePayment.styles = css `
1608
1768
  }
1609
1769
 
1610
1770
  .qr-canvas {
1611
- border: 4px solid #f3f4f6;
1612
- border-radius: 12px;
1771
+ border: 4px solid var(--op-color-surface);
1772
+ border-radius: var(--op-border-radius);
1613
1773
  padding: 16px;
1614
- background: white;
1615
- box-shadow: 0 4px 6px rgba(0, 0, 0, 0.07);
1774
+ background: var(--op-color-background);
1775
+ box-shadow: var(--op-box-shadow-lg);
1616
1776
  width: 200px;
1617
1777
  height: 200px;
1618
1778
  display: flex;
1619
1779
  align-items: center;
1620
1780
  justify-content: center;
1621
- color: #9ca3af;
1781
+ color: var(--op-color-text-secondary);
1622
1782
  }
1623
1783
 
1624
1784
  .scanned-button {
1625
1785
  padding: 12px 24px;
1626
- background: #10b981;
1627
- color: white;
1786
+ background: var(--op-color-success);
1787
+ color: var(--op-color-background);
1628
1788
  border: none;
1629
- border-radius: 8px;
1630
- font-size: 16px;
1789
+ border-radius: var(--op-border-radius);
1790
+ font-size: var(--op-font-size);
1631
1791
  font-weight: 600;
1632
1792
  cursor: pointer;
1633
- transition: all 0.2s ease;
1793
+ transition: all var(--op-transition);
1634
1794
  }
1635
1795
 
1636
1796
  .scanned-button:hover:not(:disabled) {
1637
- background: #059669;
1797
+ filter: brightness(0.9);
1638
1798
  transform: translateY(-2px);
1639
1799
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4);
1640
1800
  }
@@ -1652,25 +1812,25 @@ OnePayment.styles = css `
1652
1812
 
1653
1813
  /* Result Status Block - Replaces payment methods when succeeded/failed */
1654
1814
  .result-card {
1655
- background: white;
1656
- border-radius: 12px;
1815
+ background: var(--op-color-background);
1816
+ border-radius: var(--op-border-radius);
1657
1817
  padding: 40px;
1658
1818
  width: 100%;
1659
1819
  text-align: center;
1660
- box-shadow: 0 4px 6px rgba(0, 0, 0, 0.07);
1820
+ box-shadow: var(--op-box-shadow-lg);
1661
1821
  border: 2px solid transparent;
1662
- transition: all 0.3s ease;
1822
+ transition: all var(--op-transition);
1663
1823
  margin-top: 0;
1664
1824
  }
1665
1825
 
1666
1826
  .result-card.success {
1667
- border-color: #10b981;
1668
- background: linear-gradient(135deg, #f0fdf4 0%, #ffffff 100%);
1827
+ border-color: var(--op-color-success);
1828
+ background: var(--op-color-background);
1669
1829
  }
1670
1830
 
1671
1831
  .result-card.error {
1672
- border-color: #ef4444;
1673
- background: linear-gradient(135deg, #fef2f2 0%, #ffffff 100%);
1832
+ border-color: var(--op-color-danger);
1833
+ background: var(--op-color-background);
1674
1834
  }
1675
1835
 
1676
1836
  .result-icon-wrapper {
@@ -1685,11 +1845,11 @@ OnePayment.styles = css `
1685
1845
  }
1686
1846
 
1687
1847
  .result-card.success .result-icon-wrapper {
1688
- background: #10b981;
1848
+ background: var(--op-color-success);
1689
1849
  }
1690
1850
 
1691
1851
  .result-card.error .result-icon-wrapper {
1692
- background: #ef4444;
1852
+ background: var(--op-color-danger);
1693
1853
  }
1694
1854
 
1695
1855
  @keyframes scaleIn {
@@ -1713,48 +1873,16 @@ OnePayment.styles = css `
1713
1873
  margin: 0 0 12px 0;
1714
1874
  font-size: 28px;
1715
1875
  font-weight: 700;
1716
- color: #111827;
1876
+ color: var(--op-color-text);
1717
1877
  }
1718
1878
 
1719
1879
  .result-message {
1720
1880
  margin: 0 0 32px 0;
1721
- font-size: 16px;
1722
- color: #6b7280;
1881
+ font-size: var(--op-font-size);
1882
+ color: var(--op-color-text-secondary);
1723
1883
  line-height: 1.5;
1724
1884
  }
1725
1885
 
1726
- .retry-button {
1727
- display: inline-block;
1728
- min-width: 162px;
1729
- height: 52px;
1730
- padding: 10px 24px;
1731
- font-size: 18px;
1732
- font-weight: 650;
1733
- color: #ffbe32;
1734
- line-height: normal;
1735
- border: 0;
1736
- border-radius: 40px;
1737
- text-decoration: none;
1738
- transition:
1739
- background-color 0.2s ease,
1740
- transform 0.05s ease;
1741
- overflow: hidden;
1742
- user-select: none;
1743
- position: relative;
1744
- cursor: pointer;
1745
- background-color: #2a2327;
1746
- white-space: nowrap;
1747
- letter-spacing: 0;
1748
- }
1749
-
1750
- .retry-button:hover {
1751
- background: #000;
1752
- }
1753
-
1754
- .retry-button:active {
1755
- transform: translateY(1px);
1756
- }
1757
-
1758
1886
  /* Mobile responsiveness */
1759
1887
  @media (max-width: 640px) {
1760
1888
  .header {
@@ -1863,16 +1991,16 @@ OnePayment.styles = css `
1863
1991
  /* Transaction Details */
1864
1992
  .transaction-details {
1865
1993
  padding: 1.25rem;
1866
- background: #f9fafb;
1867
- border: 1px solid #e5e7eb;
1868
- border-radius: 0.5rem;
1994
+ background: var(--op-color-surface);
1995
+ border: 1px solid var(--op-color-border);
1996
+ border-radius: var(--op-border-radius);
1869
1997
  margin-bottom: 1rem;
1870
1998
  }
1871
1999
 
1872
2000
  .transaction-title {
1873
2001
  font-size: 1.125rem;
1874
2002
  font-weight: 600;
1875
- color: #111827;
2003
+ color: var(--op-color-text);
1876
2004
  margin: 0 0 1rem 0;
1877
2005
  line-height: 1.2;
1878
2006
  }
@@ -1890,15 +2018,15 @@ OnePayment.styles = css `
1890
2018
  }
1891
2019
 
1892
2020
  .details-label {
1893
- font-size: 0.875rem;
2021
+ font-size: var(--op-font-size-sm);
1894
2022
  font-weight: 500;
1895
- color: #6b7280;
2023
+ color: var(--op-color-text-secondary);
1896
2024
  }
1897
2025
 
1898
2026
  .details-value {
1899
- font-size: 0.875rem;
2027
+ font-size: var(--op-font-size-sm);
1900
2028
  font-weight: 600;
1901
- color: #111827;
2029
+ color: var(--op-color-text);
1902
2030
  text-align: right;
1903
2031
  }
1904
2032
 
@@ -1934,7 +2062,7 @@ OnePayment.styles = css `
1934
2062
  left: 0.9375rem;
1935
2063
  top: 0.625rem;
1936
2064
  bottom: 0.625rem;
1937
- border-left: 2px solid #d1d5db;
2065
+ border-left: 2px solid var(--op-color-border);
1938
2066
  }
1939
2067
 
1940
2068
  .fee-breakdown-inner {
@@ -1964,7 +2092,7 @@ OnePayment.styles = css `
1964
2092
  width: 10px;
1965
2093
  height: 10px;
1966
2094
  border-radius: 50%;
1967
- background: #d1d5db;
2095
+ background: var(--op-color-border);
1968
2096
  }
1969
2097
 
1970
2098
  .breakdown-row:first-child::after {
@@ -1975,7 +2103,7 @@ OnePayment.styles = css `
1975
2103
  transform: translateY(-50%);
1976
2104
  width: 1rem;
1977
2105
  height: 2px;
1978
- background: #d1d5db;
2106
+ background: var(--op-color-border);
1979
2107
  }
1980
2108
 
1981
2109
  .breakdown-row:nth-child(2) {
@@ -1991,7 +2119,7 @@ OnePayment.styles = css `
1991
2119
  transform: translateY(-60%);
1992
2120
  width: 1.5rem;
1993
2121
  height: 2px;
1994
- background: #d1d5db;
2122
+ background: var(--op-color-border);
1995
2123
  }
1996
2124
 
1997
2125
  .breakdown-row:nth-child(2)::after {
@@ -2001,25 +2129,25 @@ OnePayment.styles = css `
2001
2129
  top: calc(60% - 0.25rem);
2002
2130
  border-top: 4px solid transparent;
2003
2131
  border-bottom: 4px solid transparent;
2004
- border-left: 6px solid #d1d5db;
2132
+ border-left: 6px solid var(--op-color-border);
2005
2133
  }
2006
2134
 
2007
2135
  .breakdown-label {
2008
- font-size: 0.875rem;
2136
+ font-size: var(--op-font-size-sm);
2009
2137
  font-weight: 400;
2010
- color: #6b7280;
2138
+ color: var(--op-color-text-secondary);
2011
2139
  }
2012
2140
 
2013
2141
  .breakdown-value {
2014
- font-size: 0.875rem;
2142
+ font-size: var(--op-font-size-sm);
2015
2143
  font-weight: 500;
2016
- color: #111827;
2144
+ color: var(--op-color-text);
2017
2145
  text-align: right;
2018
2146
  }
2019
2147
 
2020
2148
  .transaction-divider {
2021
2149
  height: 1px;
2022
- background: #d1d5db;
2150
+ background: var(--op-color-border);
2023
2151
  margin: 1rem 0;
2024
2152
  }
2025
2153
 
@@ -2030,21 +2158,21 @@ OnePayment.styles = css `
2030
2158
  }
2031
2159
 
2032
2160
  .net-label {
2033
- font-size: 1rem;
2161
+ font-size: var(--op-font-size);
2034
2162
  font-weight: 600;
2035
- color: #111827;
2163
+ color: var(--op-color-text);
2036
2164
  }
2037
2165
 
2038
2166
  .net-value {
2039
2167
  font-size: 1.25rem;
2040
2168
  font-weight: 700;
2041
- color: #111827;
2169
+ color: var(--op-color-text);
2042
2170
  text-align: right;
2043
2171
  }
2044
2172
 
2045
2173
  /* Skeleton Loading */
2046
2174
  .skeleton {
2047
- background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
2175
+ background: linear-gradient(90deg, var(--op-color-surface) 25%, var(--op-color-border) 50%, var(--op-color-surface) 75%);
2048
2176
  background-size: 200% 100%;
2049
2177
  animation: shimmer 1.5s infinite;
2050
2178
  border-radius: 0.25rem;
@@ -2061,9 +2189,9 @@ OnePayment.styles = css `
2061
2189
 
2062
2190
  .skeleton-transaction {
2063
2191
  padding: 1.25rem;
2064
- background: #f9fafb;
2065
- border: 1px solid #e5e7eb;
2066
- border-radius: 0.5rem;
2192
+ background: var(--op-color-surface);
2193
+ border: 1px solid var(--op-color-border);
2194
+ border-radius: var(--op-border-radius);
2067
2195
  margin-bottom: 1rem;
2068
2196
  }
2069
2197
 
@@ -2091,7 +2219,7 @@ OnePayment.styles = css `
2091
2219
 
2092
2220
  .skeleton-divider {
2093
2221
  height: 1px;
2094
- background: #d1d5db;
2222
+ background: var(--op-color-border);
2095
2223
  margin: 1rem 0;
2096
2224
  }
2097
2225
 
@@ -2112,10 +2240,10 @@ OnePayment.styles = css `
2112
2240
  }
2113
2241
 
2114
2242
  .skeleton-method {
2115
- border: 1px solid #e5e7eb;
2116
- border-radius: 0.5rem;
2243
+ border: 1px solid var(--op-color-border);
2244
+ border-radius: var(--op-border-radius);
2117
2245
  padding: 1rem 1.25rem;
2118
- background: #ffffff;
2246
+ background: var(--op-color-background);
2119
2247
  margin-bottom: 1rem;
2120
2248
  display: flex;
2121
2249
  align-items: center;
@@ -2161,8 +2289,8 @@ OnePayment.styles = css `
2161
2289
  width: 100%;
2162
2290
  max-width: 500px;
2163
2291
  max-height: 90vh;
2164
- background: white;
2165
- border-radius: 8px;
2292
+ background: var(--op-color-background);
2293
+ border-radius: var(--op-border-radius);
2166
2294
  overflow-y: auto;
2167
2295
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
2168
2296
  }
@@ -2198,10 +2326,10 @@ OnePayment.styles = css `
2198
2326
  .modal-content .qr-code-section .scanned-button {
2199
2327
  width: 100%;
2200
2328
  padding: 16px 24px;
2201
- background: #10b981;
2202
- color: white;
2329
+ background: var(--op-color-success);
2330
+ color: var(--op-color-background);
2203
2331
  border: none;
2204
- border-radius: 8px;
2332
+ border-radius: var(--op-border-radius);
2205
2333
  font-size: 18px;
2206
2334
  font-weight: 700;
2207
2335
  cursor: pointer;
@@ -2218,14 +2346,14 @@ OnePayment.styles = css `
2218
2346
  max-height: 85vh;
2219
2347
  padding: 0;
2220
2348
  overflow: hidden;
2221
- background: linear-gradient(to bottom, #ffffff 0%, #f9fafb 100%);
2349
+ background: linear-gradient(to bottom, var(--op-color-background) 0%, var(--op-color-surface) 100%);
2222
2350
  }
2223
2351
 
2224
2352
  .qr-iframe-container {
2225
2353
  flex: 1;
2226
2354
  width: 100%;
2227
2355
  overflow: hidden;
2228
- background: white;
2356
+ background: var(--op-color-background);
2229
2357
  position: relative;
2230
2358
  }
2231
2359
 
@@ -2233,13 +2361,13 @@ OnePayment.styles = css `
2233
2361
  width: 100%;
2234
2362
  height: 100%;
2235
2363
  border: none;
2236
- background: white;
2364
+ background: var(--op-color-background);
2237
2365
  }
2238
2366
 
2239
2367
  .qr-button-container {
2240
2368
  padding: 2rem 2.5rem;
2241
- background: linear-gradient(to top, #ffffff 0%, #fafbfc 100%);
2242
- border-top: 1px solid rgba(0, 0, 0, 0.08);
2369
+ background: linear-gradient(to top, var(--op-color-background) 0%, var(--op-color-surface) 100%);
2370
+ border-top: 1px solid var(--op-color-border);
2243
2371
  display: flex;
2244
2372
  flex-direction: column;
2245
2373
  gap: 1rem;
@@ -2265,7 +2393,7 @@ OnePayment.styles = css `
2265
2393
  }
2266
2394
 
2267
2395
  .qr-button-hint {
2268
- color: #6b7280;
2396
+ color: var(--op-color-text-secondary);
2269
2397
  font-size: 14px;
2270
2398
  font-weight: 500;
2271
2399
  text-align: center;
@@ -2278,8 +2406,8 @@ OnePayment.styles = css `
2278
2406
  width: 100%;
2279
2407
  max-width: 420px;
2280
2408
  padding: 20px 40px;
2281
- background: linear-gradient(135deg, #10b981 0%, #059669 100%);
2282
- color: white;
2409
+ background: var(--op-color-success);
2410
+ color: #ffffff;
2283
2411
  border: none;
2284
2412
  border-radius: 16px;
2285
2413
  font-size: 17px;
@@ -2312,7 +2440,8 @@ OnePayment.styles = css `
2312
2440
  }
2313
2441
 
2314
2442
  .qr-button-container .scanned-button:hover {
2315
- background: linear-gradient(135deg, #059669 0%, #047857 100%);
2443
+ background: var(--op-color-success);
2444
+ filter: brightness(0.9);
2316
2445
  transform: translateY(-3px);
2317
2446
  box-shadow:
2318
2447
  0 12px 32px rgba(16, 185, 129, 0.45),
@@ -2347,15 +2476,15 @@ OnePayment.styles = css `
2347
2476
  height: 450px;
2348
2477
  border-radius: 8px;
2349
2478
  overflow: hidden;
2350
- background: white;
2351
- border: 1px solid #e5e7eb;
2479
+ background: var(--op-color-background);
2480
+ border: 1px solid var(--op-color-border);
2352
2481
  }
2353
2482
 
2354
2483
  .qr-iframe-inline {
2355
2484
  width: 100%;
2356
2485
  height: 100%;
2357
2486
  border: none;
2358
- background: white;
2487
+ background: var(--op-color-background);
2359
2488
  }
2360
2489
 
2361
2490
  .radio:disabled {
@@ -2369,7 +2498,7 @@ OnePayment.styles = css `
2369
2498
  }
2370
2499
 
2371
2500
  .method-header.disabled:hover {
2372
- background-color: #ffffff;
2501
+ background-color: var(--op-color-background);
2373
2502
  }
2374
2503
 
2375
2504
  /* Tooltip for disabled payment methods */
@@ -2385,8 +2514,8 @@ OnePayment.styles = css `
2385
2514
  transform: translateX(-50%);
2386
2515
  margin-top: 0.5rem;
2387
2516
  padding: 0.5rem 0.75rem;
2388
- background: #1f2937;
2389
- color: white;
2517
+ background: var(--op-color-text);
2518
+ color: var(--op-color-background);
2390
2519
  font-size: 0.875rem;
2391
2520
  line-height: 1.25rem;
2392
2521
  border-radius: 0.375rem;
@@ -2404,7 +2533,7 @@ OnePayment.styles = css `
2404
2533
  transform: translateX(-50%);
2405
2534
  margin-top: 0.25rem;
2406
2535
  border: 5px solid transparent;
2407
- border-bottom-color: #1f2937;
2536
+ border-bottom-color: var(--op-color-text);
2408
2537
  z-index: 1001;
2409
2538
  }
2410
2539
 
@@ -2452,6 +2581,9 @@ __decorate([
2452
2581
  __decorate([
2453
2582
  property({ type: String })
2454
2583
  ], OnePayment.prototype, "maxWidth", void 0);
2584
+ __decorate([
2585
+ property({ type: Object })
2586
+ ], OnePayment.prototype, "appearance", void 0);
2455
2587
  __decorate([
2456
2588
  state()
2457
2589
  ], OnePayment.prototype, "currentState", void 0);