@sazito/checkout 0.1.2 → 0.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.
@@ -71,6 +71,14 @@ interface CheckoutTheme {
71
71
  danger?: string;
72
72
  /** Success and completed-state color. */
73
73
  success?: string;
74
+ /** Foreground used on top of solid success surfaces. */
75
+ successForeground?: string;
76
+ /** Background plate behind carrier and shipping-method logos. */
77
+ logoBackground?: string;
78
+ /** Neutral surface used when a shipping color is white or near-white. */
79
+ shippingNeutral?: string;
80
+ /** Foreground used on the neutral shipping surface. */
81
+ shippingNeutralForeground?: string;
74
82
  /** Base corner radius in px. */
75
83
  radius?: number;
76
84
  /** Font family. Defaults to `inherit` so the host font flows through. */
@@ -71,6 +71,14 @@ interface CheckoutTheme {
71
71
  danger?: string;
72
72
  /** Success and completed-state color. */
73
73
  success?: string;
74
+ /** Foreground used on top of solid success surfaces. */
75
+ successForeground?: string;
76
+ /** Background plate behind carrier and shipping-method logos. */
77
+ logoBackground?: string;
78
+ /** Neutral surface used when a shipping color is white or near-white. */
79
+ shippingNeutral?: string;
80
+ /** Foreground used on the neutral shipping surface. */
81
+ shippingNeutralForeground?: string;
74
82
  /** Base corner radius in px. */
75
83
  radius?: number;
76
84
  /** Font family. Defaults to `inherit` so the host font flows through. */
package/dist/styles.css CHANGED
@@ -5,7 +5,6 @@
5
5
  .szc-root {
6
6
  --szc-accent: #4f46e5;
7
7
  --szc-accent-foreground: #ffffff;
8
- --szc-accent-soft: color-mix(in srgb, var(--szc-accent) 10%, #ffffff);
9
8
  --szc-radius: 16px;
10
9
  --szc-font: inherit;
11
10
 
@@ -18,6 +17,11 @@
18
17
  --szc-summary-bg: #f6f6fb;
19
18
  --szc-danger: #dc2626;
20
19
  --szc-success: #16a34a;
20
+ --szc-success-foreground: #ffffff;
21
+ --szc-logo-bg: #ffffff;
22
+ --szc-shipping-neutral: #eef0f5;
23
+ --szc-shipping-neutral-foreground: #475569;
24
+ --szc-accent-soft: color-mix(in srgb, var(--szc-accent) 10%, var(--szc-card));
21
25
 
22
26
  font-family: var(--szc-font);
23
27
  color: var(--szc-fg);
@@ -161,7 +165,7 @@
161
165
  }
162
166
  .szc-step--done .szc-step__dot {
163
167
  background: var(--szc-success);
164
- color: #fff;
168
+ color: var(--szc-success-foreground);
165
169
  }
166
170
  /* The mobile header replaces the stepper on small screens. Must come after
167
171
  the base .szc-stepper rule — same specificity, source order decides. */
@@ -425,15 +429,15 @@
425
429
  line-height: 1.7;
426
430
  }
427
431
  .szc-input--error {
428
- border-color: #ef4444;
432
+ border-color: var(--szc-danger);
429
433
  }
430
434
  .szc-input--error:focus {
431
- border-color: #ef4444;
432
- box-shadow: 0 0 0 3px color-mix(in srgb, #ef4444 18%, transparent);
435
+ border-color: var(--szc-danger);
436
+ box-shadow: 0 0 0 3px color-mix(in srgb, var(--szc-danger) 18%, transparent);
433
437
  }
434
438
  .szc-field__error {
435
439
  font-size: 11.5px;
436
- color: #ef4444;
440
+ color: var(--szc-danger);
437
441
  }
438
442
  .szc-select-wrap {
439
443
  position: relative;
@@ -506,7 +510,7 @@
506
510
  color: var(--szc-accent-foreground);
507
511
  }
508
512
  .szc-btn--primary:not(:disabled):hover {
509
- background: color-mix(in srgb, var(--szc-accent) 88%, #000);
513
+ background: color-mix(in srgb, var(--szc-accent) 88%, var(--szc-fg));
510
514
  }
511
515
  .szc-btn--primary:disabled:not([aria-busy='true']) {
512
516
  background: color-mix(in srgb, var(--szc-border) 60%, var(--szc-card));
@@ -578,7 +582,6 @@
578
582
  gap: 6px;
579
583
  padding-block: 9px;
580
584
  padding-inline: 12px 16px;
581
- border-radius: 999px;
582
585
  }
583
586
  .szc-back-btn:not(:disabled):hover {
584
587
  background: var(--szc-muted);
@@ -689,10 +692,10 @@
689
692
  display: flex;
690
693
  align-items: center;
691
694
  justify-content: center;
692
- background: #ffffff;
695
+ background: var(--szc-card);
693
696
  border: 1px solid color-mix(in srgb, var(--szc-border) 85%, var(--szc-muted-fg));
694
697
  color: color-mix(in srgb, var(--szc-muted-fg) 78%, var(--szc-accent));
695
- box-shadow: 0 1px 2px rgb(15 23 42 / 3%);
698
+ box-shadow: 0 1px 2px color-mix(in srgb, var(--szc-fg) 3%, transparent);
696
699
  }
697
700
  .szc-cart-row__thumb {
698
701
  object-fit: cover;
@@ -730,7 +733,7 @@
730
733
  width: 12px;
731
734
  height: 12px;
732
735
  border-radius: 50%;
733
- border: 1px solid rgba(0, 0, 0, 0.15);
736
+ border: 1px solid color-mix(in srgb, var(--szc-fg) 15%, transparent);
734
737
  flex-shrink: 0;
735
738
  }
736
739
  .szc-cart-row__price {
@@ -762,7 +765,7 @@
762
765
  background: var(--szc-card);
763
766
  border: 1px solid var(--szc-border);
764
767
  border-radius: 9px;
765
- box-shadow: 0 1px 2px rgb(15 23 42 / 4%);
768
+ box-shadow: 0 1px 2px color-mix(in srgb, var(--szc-fg) 4%, transparent);
766
769
  transition: border-color 0.16s ease, box-shadow 0.16s ease;
767
770
  }
768
771
  .szc-qty:focus-within {
@@ -844,8 +847,8 @@
844
847
  transition: background 0.13s, color 0.13s;
845
848
  }
846
849
  .szc-cart-row__remove:not(:disabled):hover {
847
- background: color-mix(in srgb, #ef4444 12%, transparent);
848
- color: #ef4444;
850
+ background: color-mix(in srgb, var(--szc-danger) 12%, transparent);
851
+ color: var(--szc-danger);
849
852
  }
850
853
  .szc-cart-row__remove:disabled {
851
854
  opacity: 0.35;
@@ -974,7 +977,7 @@
974
977
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--szc-rate-foreground, var(--szc-accent)) 14%, transparent);
975
978
  }
976
979
  .szc-ship-group__mark:has(img) {
977
- background: #fff;
980
+ background: var(--szc-logo-bg);
978
981
  color: inherit;
979
982
  box-shadow: inset 0 0 0 1px var(--szc-border);
980
983
  }
@@ -1177,9 +1180,9 @@
1177
1180
  .szc-rate--selected .szc-rate__icon {
1178
1181
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--szc-rate-foreground, var(--szc-accent)) 24%, transparent);
1179
1182
  }
1180
- /* Image/logo icons render on a clean white plate so brand artwork stays true. */
1183
+ /* Image/logo icons render on a configurable clean plate so brand artwork stays true. */
1181
1184
  .szc-rate__icon:has(img) {
1182
- background: #fff;
1185
+ background: var(--szc-logo-bg);
1183
1186
  color: inherit;
1184
1187
  box-shadow: inset 0 0 0 1px var(--szc-border);
1185
1188
  }
@@ -1386,7 +1389,7 @@
1386
1389
  }
1387
1390
  .szc-pay--selected .szc-pay__icon {
1388
1391
  background: var(--szc-accent);
1389
- color: #fff;
1392
+ color: var(--szc-accent-foreground);
1390
1393
  }
1391
1394
  .szc-pay__body {
1392
1395
  display: flex;
@@ -1435,7 +1438,7 @@
1435
1438
  align-items: center;
1436
1439
  gap: 6px;
1437
1440
  font-size: 12.5px;
1438
- color: #ef4444;
1441
+ color: var(--szc-danger);
1439
1442
  margin: 0;
1440
1443
  }
1441
1444
  .szc-discount__error svg {
@@ -1704,9 +1707,9 @@
1704
1707
  .szc-error {
1705
1708
  padding: 12px 14px;
1706
1709
  border-radius: calc(var(--szc-radius) * 0.6);
1707
- background: color-mix(in srgb, var(--szc-danger) 10%, #fff);
1710
+ background: color-mix(in srgb, var(--szc-danger) 10%, var(--szc-card));
1708
1711
  color: var(--szc-danger);
1709
- border: 1px solid color-mix(in srgb, var(--szc-danger) 30%, #fff);
1712
+ border: 1px solid color-mix(in srgb, var(--szc-danger) 30%, var(--szc-card));
1710
1713
  font-size: 13.5px;
1711
1714
  }
1712
1715
  /* ---- checkout skeleton --------------------------------------------- */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sazito/checkout",
3
- "version": "0.1.2",
3
+ "version": "0.2.0",
4
4
  "description": "Headless checkout engine + React UI for the Sazito platform, powered by @sazito/client-sdk",
5
5
  "license": "MIT",
6
6
  "repository": {