@one-payments/web-components 1.1.32 → 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();
@@ -1127,11 +1241,64 @@ let OnePayment = class OnePayment extends LitElement {
1127
1241
  };
1128
1242
  // --- Styles (EXACT original design from PaymentElement.module.scss) ---
1129
1243
  OnePayment.styles = css `
1244
+ /* ═══════════════════════════════════════════════════════════════
1245
+ CSS CUSTOM PROPERTIES (Theming)
1246
+ ═══════════════════════════════════════════════════════════════ */
1247
+
1130
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 ─── */
1131
1279
  display: block;
1132
- font-family:
1133
- -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
1280
+ font-family: var(--op-font-family);
1134
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);
1135
1302
  }
1136
1303
 
1137
1304
  * {
@@ -1148,10 +1315,10 @@ OnePayment.styles = css `
1148
1315
  .header {
1149
1316
  text-align: left;
1150
1317
  padding: 1rem 0;
1151
- color: #6b7280;
1152
- font-size: 0.875rem;
1318
+ color: var(--op-color-text-secondary);
1319
+ font-size: var(--op-font-size-sm);
1153
1320
  font-weight: 400;
1154
- border-bottom: 1px solid #e5e7eb;
1321
+ border-bottom: 1px solid var(--op-color-border);
1155
1322
  margin-bottom: 1rem;
1156
1323
  }
1157
1324
 
@@ -1164,10 +1331,10 @@ OnePayment.styles = css `
1164
1331
  }
1165
1332
 
1166
1333
  .payment-method-item {
1167
- border: 1px solid #e5e7eb;
1168
- border-radius: 0.5rem;
1334
+ border: 1px solid var(--op-color-border);
1335
+ border-radius: var(--op-border-radius);
1169
1336
  overflow: visible;
1170
- background: #ffffff;
1337
+ background: var(--op-color-background);
1171
1338
  width: 100%;
1172
1339
  }
1173
1340
 
@@ -1175,20 +1342,20 @@ OnePayment.styles = css `
1175
1342
  display: flex;
1176
1343
  align-items: center;
1177
1344
  padding: 1rem 1.25rem;
1178
- background: #ffffff;
1345
+ background: var(--op-color-background);
1179
1346
  cursor: pointer;
1180
- transition: background-color 150ms ease;
1347
+ transition: background-color var(--op-transition);
1181
1348
  user-select: none;
1182
1349
  width: 100%;
1183
- border-radius: 0.5rem 0.5rem 0 0;
1350
+ border-radius: var(--op-border-radius) var(--op-border-radius) 0 0;
1184
1351
  }
1185
1352
 
1186
1353
  .method-header:hover {
1187
- background-color: #f9fafb;
1354
+ background-color: var(--op-color-surface);
1188
1355
  }
1189
1356
 
1190
1357
  .method-header.selected {
1191
- background-color: #f3f4f6;
1358
+ background-color: var(--op-color-surface);
1192
1359
  }
1193
1360
 
1194
1361
  .radio {
@@ -1199,20 +1366,20 @@ OnePayment.styles = css `
1199
1366
  margin-right: 10px;
1200
1367
  flex-shrink: 0;
1201
1368
  cursor: pointer;
1202
- accent-color: #ffbe32;
1369
+ accent-color: var(--op-color-primary);
1203
1370
  -webkit-appearance: none;
1204
1371
  -moz-appearance: none;
1205
1372
  appearance: none;
1206
- border: 2px solid #d1d5db;
1373
+ border: 2px solid var(--op-color-border);
1207
1374
  border-radius: 50%;
1208
- background-color: #ffffff;
1375
+ background-color: var(--op-color-background);
1209
1376
  position: relative;
1210
- transition: border-color 150ms ease;
1377
+ transition: border-color var(--op-transition);
1211
1378
  }
1212
1379
 
1213
1380
  .radio:checked {
1214
- border-color: #ffbe32;
1215
- background-color: #ffffff;
1381
+ border-color: var(--op-color-primary);
1382
+ background-color: var(--op-color-background);
1216
1383
  }
1217
1384
 
1218
1385
  .radio:checked::after {
@@ -1224,11 +1391,11 @@ OnePayment.styles = css `
1224
1391
  width: 0.625rem;
1225
1392
  height: 0.625rem;
1226
1393
  border-radius: 50%;
1227
- background-color: #ffbe32;
1394
+ background-color: var(--op-color-primary);
1228
1395
  }
1229
1396
 
1230
1397
  .radio:hover:not(:disabled) {
1231
- border-color: #9ca3af;
1398
+ border-color: var(--op-color-text-secondary);
1232
1399
  }
1233
1400
 
1234
1401
  .method-icon {
@@ -1240,7 +1407,7 @@ OnePayment.styles = css `
1240
1407
  justify-content: center;
1241
1408
  font-size: 1.25rem;
1242
1409
  flex-shrink: 0;
1243
- color: #6b7280;
1410
+ color: var(--op-color-text-secondary);
1244
1411
  margin-right: 0.625rem;
1245
1412
  }
1246
1413
 
@@ -1252,7 +1419,7 @@ OnePayment.styles = css `
1252
1419
  align-items: center;
1253
1420
  justify-content: center;
1254
1421
  flex-shrink: 0;
1255
- color: #6b7280;
1422
+ color: var(--op-color-text-secondary);
1256
1423
  }
1257
1424
 
1258
1425
  .method-icon-right svg {
@@ -1267,9 +1434,9 @@ OnePayment.styles = css `
1267
1434
  }
1268
1435
 
1269
1436
  .method-name {
1270
- font-size: 1rem;
1437
+ font-size: var(--op-font-size);
1271
1438
  font-weight: 500;
1272
- color: #111827;
1439
+ color: var(--op-color-text);
1273
1440
  flex-shrink: 0;
1274
1441
  text-align: left;
1275
1442
  margin-right: 10px;
@@ -1278,8 +1445,8 @@ OnePayment.styles = css `
1278
1445
  /* Accordion Content */
1279
1446
  .method-content {
1280
1447
  padding: 1.5rem;
1281
- background-color: #ffffff;
1282
- border-top: 1px solid #e5e7eb;
1448
+ background-color: var(--op-color-background);
1449
+ border-top: 1px solid var(--op-color-border);
1283
1450
  width: 100%;
1284
1451
  overflow: visible;
1285
1452
  }
@@ -1291,9 +1458,9 @@ OnePayment.styles = css `
1291
1458
  }
1292
1459
 
1293
1460
  .form-title {
1294
- font-size: 1rem;
1461
+ font-size: var(--op-font-size);
1295
1462
  font-weight: 500;
1296
- color: #111827;
1463
+ color: var(--op-color-text);
1297
1464
  margin: 0 0 1rem 0;
1298
1465
  text-align: left;
1299
1466
  }
@@ -1312,22 +1479,23 @@ OnePayment.styles = css `
1312
1479
  .form-label {
1313
1480
  display: block;
1314
1481
  margin-bottom: 0.5rem;
1315
- font-size: 0.875rem;
1482
+ font-size: var(--op-font-size-sm);
1316
1483
  font-weight: 500;
1317
- color: #374151;
1484
+ color: var(--op-color-text);
1318
1485
  text-align: left;
1319
1486
  }
1320
1487
 
1321
1488
  .input {
1322
1489
  width: 100%;
1323
1490
  padding: 0.75rem;
1324
- border: 1px solid #d1d5db;
1325
- border-radius: 0.375rem;
1326
- 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);
1327
1495
  line-height: 1.25rem;
1328
- background: white;
1329
- color: black;
1330
- transition: all 150ms ease;
1496
+ background: var(--op-color-background);
1497
+ color: var(--op-color-text);
1498
+ transition: all var(--op-transition);
1331
1499
  -webkit-appearance: none;
1332
1500
  -moz-appearance: none;
1333
1501
  appearance: none;
@@ -1335,24 +1503,24 @@ OnePayment.styles = css `
1335
1503
 
1336
1504
  .input:focus {
1337
1505
  outline: none;
1338
- border-color: #7c3aed;
1506
+ border-color: var(--op-color-border-focus);
1339
1507
  box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.1);
1340
1508
  }
1341
1509
 
1342
1510
  .input::placeholder {
1343
- color: #9ca3af;
1511
+ color: var(--op-color-text-secondary);
1344
1512
  }
1345
1513
 
1346
1514
  .input:hover:not(:focus) {
1347
- border-color: #9ca3af;
1515
+ border-color: var(--op-color-text-secondary);
1348
1516
  }
1349
1517
 
1350
1518
  .input.input-error {
1351
- border-color: #dc2626;
1519
+ border-color: var(--op-color-danger);
1352
1520
  }
1353
1521
 
1354
1522
  .input.input-error:focus {
1355
- border-color: #dc2626;
1523
+ border-color: var(--op-color-danger);
1356
1524
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.1);
1357
1525
  }
1358
1526
 
@@ -1365,8 +1533,8 @@ OnePayment.styles = css `
1365
1533
 
1366
1534
  .error-message {
1367
1535
  margin-top: 0.25rem;
1368
- color: #dc2626;
1369
- font-size: 0.75rem;
1536
+ color: var(--op-color-danger);
1537
+ font-size: var(--op-font-size-xs);
1370
1538
  line-height: 1.25;
1371
1539
  }
1372
1540
 
@@ -1384,21 +1552,21 @@ OnePayment.styles = css `
1384
1552
  padding: 10px 24px;
1385
1553
  font-size: 18px;
1386
1554
  font-weight: 650;
1387
- color: #ffbe32;
1555
+ color: var(--op-color-primary-text);
1388
1556
  line-height: normal;
1389
1557
  border: 0;
1390
- border-radius: 40px;
1558
+ border-radius: var(--op-border-radius-lg);
1391
1559
  text-decoration: none;
1392
1560
  transition:
1393
- background-color 0.2s ease,
1394
- border-color 0.2s ease,
1395
- color 0.2s ease,
1396
- 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);
1397
1565
  overflow: hidden;
1398
1566
  user-select: none;
1399
1567
  position: relative;
1400
1568
  cursor: pointer;
1401
- background-color: #2a2327;
1569
+ background-color: var(--op-color-primary);
1402
1570
  white-space: nowrap;
1403
1571
  letter-spacing: 0;
1404
1572
  -webkit-appearance: none;
@@ -1408,13 +1576,12 @@ OnePayment.styles = css `
1408
1576
 
1409
1577
  .pay-button:disabled {
1410
1578
  cursor: not-allowed;
1411
- color: rgba(255, 190, 50, 0.8);
1412
- background-color: rgba(42, 35, 39, 0.8);
1579
+ opacity: 0.7;
1413
1580
  }
1414
1581
 
1415
1582
  .pay-button:not(:disabled):hover,
1416
1583
  .pay-button:not(:disabled):focus-visible {
1417
- background-color: #000;
1584
+ background-color: var(--op-color-primary-hover);
1418
1585
  }
1419
1586
 
1420
1587
  .pay-button:not(:disabled):active {
@@ -1440,7 +1607,7 @@ OnePayment.styles = css `
1440
1607
  margin-left: -10px;
1441
1608
  margin-top: -10px;
1442
1609
  border: 2px solid transparent;
1443
- border-top-color: #ffbe32;
1610
+ border-top-color: var(--op-color-primary-text);
1444
1611
  border-radius: 50%;
1445
1612
  animation: button-spinner 0.8s linear infinite;
1446
1613
  }
@@ -1480,7 +1647,7 @@ OnePayment.styles = css `
1480
1647
  }
1481
1648
 
1482
1649
  .processing-text {
1483
- color: #6b7280;
1650
+ color: var(--op-color-text-secondary);
1484
1651
  margin: 0;
1485
1652
  }
1486
1653
 
@@ -1499,32 +1666,31 @@ OnePayment.styles = css `
1499
1666
  padding: 10px 24px;
1500
1667
  font-size: 18px;
1501
1668
  font-weight: 650;
1502
- color: #ffbe32;
1669
+ color: var(--op-color-primary-text);
1503
1670
  line-height: normal;
1504
1671
  border: 0;
1505
- border-radius: 40px;
1672
+ border-radius: var(--op-border-radius-lg);
1506
1673
  text-decoration: none;
1507
1674
  transition:
1508
- background-color 0.2s ease,
1675
+ background-color var(--op-transition),
1509
1676
  transform 0.05s ease;
1510
1677
  overflow: hidden;
1511
1678
  user-select: none;
1512
1679
  position: relative;
1513
1680
  cursor: pointer;
1514
- background-color: #2a2327;
1681
+ background-color: var(--op-color-primary);
1515
1682
  white-space: nowrap;
1516
1683
  letter-spacing: 0;
1517
1684
  }
1518
1685
 
1519
1686
  .paynow-container .scanned-button:disabled {
1520
1687
  cursor: not-allowed;
1521
- color: rgba(255, 190, 50, 0.8);
1522
- background-color: rgba(42, 35, 39, 0.8);
1688
+ opacity: 0.7;
1523
1689
  }
1524
1690
 
1525
1691
  .paynow-container .scanned-button:not(:disabled):hover,
1526
1692
  .paynow-container .scanned-button:not(:disabled):focus-visible {
1527
- background-color: #000;
1693
+ background-color: var(--op-color-primary-hover);
1528
1694
  }
1529
1695
 
1530
1696
  .paynow-container .scanned-button:not(:disabled):active {
@@ -1538,9 +1704,9 @@ OnePayment.styles = css `
1538
1704
  }
1539
1705
 
1540
1706
  .instructions-title {
1541
- font-size: 1rem;
1707
+ font-size: var(--op-font-size);
1542
1708
  font-weight: 600;
1543
- color: #111827;
1709
+ color: var(--op-color-text);
1544
1710
  margin: 0 0 1.5rem 0;
1545
1711
  text-align: left;
1546
1712
  }
@@ -1567,9 +1733,9 @@ OnePayment.styles = css `
1567
1733
  height: 1.75rem;
1568
1734
  min-width: 1.75rem;
1569
1735
  border-radius: 50%;
1570
- background-color: #ffbe32;
1571
- color: #ffffff;
1572
- 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);
1573
1739
  font-weight: 600;
1574
1740
  flex-shrink: 0;
1575
1741
  }
@@ -1578,7 +1744,7 @@ OnePayment.styles = css `
1578
1744
  flex: 1;
1579
1745
  margin: 0;
1580
1746
  padding-top: 0.125rem;
1581
- color: #374151;
1747
+ color: var(--op-color-text);
1582
1748
  font-size: 0.9375rem;
1583
1749
  line-height: 1.5;
1584
1750
  }
@@ -1589,8 +1755,8 @@ OnePayment.styles = css `
1589
1755
  }
1590
1756
 
1591
1757
  .qr-instruction {
1592
- color: #6b7280;
1593
- font-size: 14px;
1758
+ color: var(--op-color-text-secondary);
1759
+ font-size: var(--op-font-size-sm);
1594
1760
  margin-bottom: 1.5rem;
1595
1761
  line-height: 1.5;
1596
1762
  }
@@ -1602,33 +1768,33 @@ OnePayment.styles = css `
1602
1768
  }
1603
1769
 
1604
1770
  .qr-canvas {
1605
- border: 4px solid #f3f4f6;
1606
- border-radius: 12px;
1771
+ border: 4px solid var(--op-color-surface);
1772
+ border-radius: var(--op-border-radius);
1607
1773
  padding: 16px;
1608
- background: white;
1609
- 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);
1610
1776
  width: 200px;
1611
1777
  height: 200px;
1612
1778
  display: flex;
1613
1779
  align-items: center;
1614
1780
  justify-content: center;
1615
- color: #9ca3af;
1781
+ color: var(--op-color-text-secondary);
1616
1782
  }
1617
1783
 
1618
1784
  .scanned-button {
1619
1785
  padding: 12px 24px;
1620
- background: #10b981;
1621
- color: white;
1786
+ background: var(--op-color-success);
1787
+ color: var(--op-color-background);
1622
1788
  border: none;
1623
- border-radius: 8px;
1624
- font-size: 16px;
1789
+ border-radius: var(--op-border-radius);
1790
+ font-size: var(--op-font-size);
1625
1791
  font-weight: 600;
1626
1792
  cursor: pointer;
1627
- transition: all 0.2s ease;
1793
+ transition: all var(--op-transition);
1628
1794
  }
1629
1795
 
1630
1796
  .scanned-button:hover:not(:disabled) {
1631
- background: #059669;
1797
+ filter: brightness(0.9);
1632
1798
  transform: translateY(-2px);
1633
1799
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4);
1634
1800
  }
@@ -1646,25 +1812,25 @@ OnePayment.styles = css `
1646
1812
 
1647
1813
  /* Result Status Block - Replaces payment methods when succeeded/failed */
1648
1814
  .result-card {
1649
- background: white;
1650
- border-radius: 12px;
1815
+ background: var(--op-color-background);
1816
+ border-radius: var(--op-border-radius);
1651
1817
  padding: 40px;
1652
1818
  width: 100%;
1653
1819
  text-align: center;
1654
- box-shadow: 0 4px 6px rgba(0, 0, 0, 0.07);
1820
+ box-shadow: var(--op-box-shadow-lg);
1655
1821
  border: 2px solid transparent;
1656
- transition: all 0.3s ease;
1822
+ transition: all var(--op-transition);
1657
1823
  margin-top: 0;
1658
1824
  }
1659
1825
 
1660
1826
  .result-card.success {
1661
- border-color: #10b981;
1662
- background: linear-gradient(135deg, #f0fdf4 0%, #ffffff 100%);
1827
+ border-color: var(--op-color-success);
1828
+ background: var(--op-color-background);
1663
1829
  }
1664
1830
 
1665
1831
  .result-card.error {
1666
- border-color: #ef4444;
1667
- background: linear-gradient(135deg, #fef2f2 0%, #ffffff 100%);
1832
+ border-color: var(--op-color-danger);
1833
+ background: var(--op-color-background);
1668
1834
  }
1669
1835
 
1670
1836
  .result-icon-wrapper {
@@ -1679,11 +1845,11 @@ OnePayment.styles = css `
1679
1845
  }
1680
1846
 
1681
1847
  .result-card.success .result-icon-wrapper {
1682
- background: #10b981;
1848
+ background: var(--op-color-success);
1683
1849
  }
1684
1850
 
1685
1851
  .result-card.error .result-icon-wrapper {
1686
- background: #ef4444;
1852
+ background: var(--op-color-danger);
1687
1853
  }
1688
1854
 
1689
1855
  @keyframes scaleIn {
@@ -1707,13 +1873,13 @@ OnePayment.styles = css `
1707
1873
  margin: 0 0 12px 0;
1708
1874
  font-size: 28px;
1709
1875
  font-weight: 700;
1710
- color: #111827;
1876
+ color: var(--op-color-text);
1711
1877
  }
1712
1878
 
1713
1879
  .result-message {
1714
1880
  margin: 0 0 32px 0;
1715
- font-size: 16px;
1716
- color: #6b7280;
1881
+ font-size: var(--op-font-size);
1882
+ color: var(--op-color-text-secondary);
1717
1883
  line-height: 1.5;
1718
1884
  }
1719
1885
 
@@ -1825,16 +1991,16 @@ OnePayment.styles = css `
1825
1991
  /* Transaction Details */
1826
1992
  .transaction-details {
1827
1993
  padding: 1.25rem;
1828
- background: #f9fafb;
1829
- border: 1px solid #e5e7eb;
1830
- 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);
1831
1997
  margin-bottom: 1rem;
1832
1998
  }
1833
1999
 
1834
2000
  .transaction-title {
1835
2001
  font-size: 1.125rem;
1836
2002
  font-weight: 600;
1837
- color: #111827;
2003
+ color: var(--op-color-text);
1838
2004
  margin: 0 0 1rem 0;
1839
2005
  line-height: 1.2;
1840
2006
  }
@@ -1852,15 +2018,15 @@ OnePayment.styles = css `
1852
2018
  }
1853
2019
 
1854
2020
  .details-label {
1855
- font-size: 0.875rem;
2021
+ font-size: var(--op-font-size-sm);
1856
2022
  font-weight: 500;
1857
- color: #6b7280;
2023
+ color: var(--op-color-text-secondary);
1858
2024
  }
1859
2025
 
1860
2026
  .details-value {
1861
- font-size: 0.875rem;
2027
+ font-size: var(--op-font-size-sm);
1862
2028
  font-weight: 600;
1863
- color: #111827;
2029
+ color: var(--op-color-text);
1864
2030
  text-align: right;
1865
2031
  }
1866
2032
 
@@ -1896,7 +2062,7 @@ OnePayment.styles = css `
1896
2062
  left: 0.9375rem;
1897
2063
  top: 0.625rem;
1898
2064
  bottom: 0.625rem;
1899
- border-left: 2px solid #d1d5db;
2065
+ border-left: 2px solid var(--op-color-border);
1900
2066
  }
1901
2067
 
1902
2068
  .fee-breakdown-inner {
@@ -1926,7 +2092,7 @@ OnePayment.styles = css `
1926
2092
  width: 10px;
1927
2093
  height: 10px;
1928
2094
  border-radius: 50%;
1929
- background: #d1d5db;
2095
+ background: var(--op-color-border);
1930
2096
  }
1931
2097
 
1932
2098
  .breakdown-row:first-child::after {
@@ -1937,7 +2103,7 @@ OnePayment.styles = css `
1937
2103
  transform: translateY(-50%);
1938
2104
  width: 1rem;
1939
2105
  height: 2px;
1940
- background: #d1d5db;
2106
+ background: var(--op-color-border);
1941
2107
  }
1942
2108
 
1943
2109
  .breakdown-row:nth-child(2) {
@@ -1953,7 +2119,7 @@ OnePayment.styles = css `
1953
2119
  transform: translateY(-60%);
1954
2120
  width: 1.5rem;
1955
2121
  height: 2px;
1956
- background: #d1d5db;
2122
+ background: var(--op-color-border);
1957
2123
  }
1958
2124
 
1959
2125
  .breakdown-row:nth-child(2)::after {
@@ -1963,25 +2129,25 @@ OnePayment.styles = css `
1963
2129
  top: calc(60% - 0.25rem);
1964
2130
  border-top: 4px solid transparent;
1965
2131
  border-bottom: 4px solid transparent;
1966
- border-left: 6px solid #d1d5db;
2132
+ border-left: 6px solid var(--op-color-border);
1967
2133
  }
1968
2134
 
1969
2135
  .breakdown-label {
1970
- font-size: 0.875rem;
2136
+ font-size: var(--op-font-size-sm);
1971
2137
  font-weight: 400;
1972
- color: #6b7280;
2138
+ color: var(--op-color-text-secondary);
1973
2139
  }
1974
2140
 
1975
2141
  .breakdown-value {
1976
- font-size: 0.875rem;
2142
+ font-size: var(--op-font-size-sm);
1977
2143
  font-weight: 500;
1978
- color: #111827;
2144
+ color: var(--op-color-text);
1979
2145
  text-align: right;
1980
2146
  }
1981
2147
 
1982
2148
  .transaction-divider {
1983
2149
  height: 1px;
1984
- background: #d1d5db;
2150
+ background: var(--op-color-border);
1985
2151
  margin: 1rem 0;
1986
2152
  }
1987
2153
 
@@ -1992,21 +2158,21 @@ OnePayment.styles = css `
1992
2158
  }
1993
2159
 
1994
2160
  .net-label {
1995
- font-size: 1rem;
2161
+ font-size: var(--op-font-size);
1996
2162
  font-weight: 600;
1997
- color: #111827;
2163
+ color: var(--op-color-text);
1998
2164
  }
1999
2165
 
2000
2166
  .net-value {
2001
2167
  font-size: 1.25rem;
2002
2168
  font-weight: 700;
2003
- color: #111827;
2169
+ color: var(--op-color-text);
2004
2170
  text-align: right;
2005
2171
  }
2006
2172
 
2007
2173
  /* Skeleton Loading */
2008
2174
  .skeleton {
2009
- 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%);
2010
2176
  background-size: 200% 100%;
2011
2177
  animation: shimmer 1.5s infinite;
2012
2178
  border-radius: 0.25rem;
@@ -2023,9 +2189,9 @@ OnePayment.styles = css `
2023
2189
 
2024
2190
  .skeleton-transaction {
2025
2191
  padding: 1.25rem;
2026
- background: #f9fafb;
2027
- border: 1px solid #e5e7eb;
2028
- 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);
2029
2195
  margin-bottom: 1rem;
2030
2196
  }
2031
2197
 
@@ -2053,7 +2219,7 @@ OnePayment.styles = css `
2053
2219
 
2054
2220
  .skeleton-divider {
2055
2221
  height: 1px;
2056
- background: #d1d5db;
2222
+ background: var(--op-color-border);
2057
2223
  margin: 1rem 0;
2058
2224
  }
2059
2225
 
@@ -2074,10 +2240,10 @@ OnePayment.styles = css `
2074
2240
  }
2075
2241
 
2076
2242
  .skeleton-method {
2077
- border: 1px solid #e5e7eb;
2078
- border-radius: 0.5rem;
2243
+ border: 1px solid var(--op-color-border);
2244
+ border-radius: var(--op-border-radius);
2079
2245
  padding: 1rem 1.25rem;
2080
- background: #ffffff;
2246
+ background: var(--op-color-background);
2081
2247
  margin-bottom: 1rem;
2082
2248
  display: flex;
2083
2249
  align-items: center;
@@ -2123,8 +2289,8 @@ OnePayment.styles = css `
2123
2289
  width: 100%;
2124
2290
  max-width: 500px;
2125
2291
  max-height: 90vh;
2126
- background: white;
2127
- border-radius: 8px;
2292
+ background: var(--op-color-background);
2293
+ border-radius: var(--op-border-radius);
2128
2294
  overflow-y: auto;
2129
2295
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
2130
2296
  }
@@ -2160,10 +2326,10 @@ OnePayment.styles = css `
2160
2326
  .modal-content .qr-code-section .scanned-button {
2161
2327
  width: 100%;
2162
2328
  padding: 16px 24px;
2163
- background: #10b981;
2164
- color: white;
2329
+ background: var(--op-color-success);
2330
+ color: var(--op-color-background);
2165
2331
  border: none;
2166
- border-radius: 8px;
2332
+ border-radius: var(--op-border-radius);
2167
2333
  font-size: 18px;
2168
2334
  font-weight: 700;
2169
2335
  cursor: pointer;
@@ -2180,14 +2346,14 @@ OnePayment.styles = css `
2180
2346
  max-height: 85vh;
2181
2347
  padding: 0;
2182
2348
  overflow: hidden;
2183
- 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%);
2184
2350
  }
2185
2351
 
2186
2352
  .qr-iframe-container {
2187
2353
  flex: 1;
2188
2354
  width: 100%;
2189
2355
  overflow: hidden;
2190
- background: white;
2356
+ background: var(--op-color-background);
2191
2357
  position: relative;
2192
2358
  }
2193
2359
 
@@ -2195,13 +2361,13 @@ OnePayment.styles = css `
2195
2361
  width: 100%;
2196
2362
  height: 100%;
2197
2363
  border: none;
2198
- background: white;
2364
+ background: var(--op-color-background);
2199
2365
  }
2200
2366
 
2201
2367
  .qr-button-container {
2202
2368
  padding: 2rem 2.5rem;
2203
- background: linear-gradient(to top, #ffffff 0%, #fafbfc 100%);
2204
- 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);
2205
2371
  display: flex;
2206
2372
  flex-direction: column;
2207
2373
  gap: 1rem;
@@ -2227,7 +2393,7 @@ OnePayment.styles = css `
2227
2393
  }
2228
2394
 
2229
2395
  .qr-button-hint {
2230
- color: #6b7280;
2396
+ color: var(--op-color-text-secondary);
2231
2397
  font-size: 14px;
2232
2398
  font-weight: 500;
2233
2399
  text-align: center;
@@ -2240,8 +2406,8 @@ OnePayment.styles = css `
2240
2406
  width: 100%;
2241
2407
  max-width: 420px;
2242
2408
  padding: 20px 40px;
2243
- background: linear-gradient(135deg, #10b981 0%, #059669 100%);
2244
- color: white;
2409
+ background: var(--op-color-success);
2410
+ color: #ffffff;
2245
2411
  border: none;
2246
2412
  border-radius: 16px;
2247
2413
  font-size: 17px;
@@ -2274,7 +2440,8 @@ OnePayment.styles = css `
2274
2440
  }
2275
2441
 
2276
2442
  .qr-button-container .scanned-button:hover {
2277
- background: linear-gradient(135deg, #059669 0%, #047857 100%);
2443
+ background: var(--op-color-success);
2444
+ filter: brightness(0.9);
2278
2445
  transform: translateY(-3px);
2279
2446
  box-shadow:
2280
2447
  0 12px 32px rgba(16, 185, 129, 0.45),
@@ -2309,15 +2476,15 @@ OnePayment.styles = css `
2309
2476
  height: 450px;
2310
2477
  border-radius: 8px;
2311
2478
  overflow: hidden;
2312
- background: white;
2313
- border: 1px solid #e5e7eb;
2479
+ background: var(--op-color-background);
2480
+ border: 1px solid var(--op-color-border);
2314
2481
  }
2315
2482
 
2316
2483
  .qr-iframe-inline {
2317
2484
  width: 100%;
2318
2485
  height: 100%;
2319
2486
  border: none;
2320
- background: white;
2487
+ background: var(--op-color-background);
2321
2488
  }
2322
2489
 
2323
2490
  .radio:disabled {
@@ -2331,7 +2498,7 @@ OnePayment.styles = css `
2331
2498
  }
2332
2499
 
2333
2500
  .method-header.disabled:hover {
2334
- background-color: #ffffff;
2501
+ background-color: var(--op-color-background);
2335
2502
  }
2336
2503
 
2337
2504
  /* Tooltip for disabled payment methods */
@@ -2347,8 +2514,8 @@ OnePayment.styles = css `
2347
2514
  transform: translateX(-50%);
2348
2515
  margin-top: 0.5rem;
2349
2516
  padding: 0.5rem 0.75rem;
2350
- background: #1f2937;
2351
- color: white;
2517
+ background: var(--op-color-text);
2518
+ color: var(--op-color-background);
2352
2519
  font-size: 0.875rem;
2353
2520
  line-height: 1.25rem;
2354
2521
  border-radius: 0.375rem;
@@ -2366,7 +2533,7 @@ OnePayment.styles = css `
2366
2533
  transform: translateX(-50%);
2367
2534
  margin-top: 0.25rem;
2368
2535
  border: 5px solid transparent;
2369
- border-bottom-color: #1f2937;
2536
+ border-bottom-color: var(--op-color-text);
2370
2537
  z-index: 1001;
2371
2538
  }
2372
2539
 
@@ -2414,6 +2581,9 @@ __decorate([
2414
2581
  __decorate([
2415
2582
  property({ type: String })
2416
2583
  ], OnePayment.prototype, "maxWidth", void 0);
2584
+ __decorate([
2585
+ property({ type: Object })
2586
+ ], OnePayment.prototype, "appearance", void 0);
2417
2587
  __decorate([
2418
2588
  state()
2419
2589
  ], OnePayment.prototype, "currentState", void 0);