@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. */
@@ -574,8 +574,8 @@ function shippingRateIconStyle(color) {
574
574
  // the card. Render a neutral chip with a slate glyph instead.
575
575
  if (luminance > 0.9) {
576
576
  return {
577
- '--szc-rate-color': '#eef0f5',
578
- '--szc-rate-foreground': '#475569'
577
+ '--szc-rate-color': 'var(--szc-shipping-neutral)',
578
+ '--szc-rate-foreground': 'var(--szc-shipping-neutral-foreground)'
579
579
  };
580
580
  }
581
581
  const foreground = luminance > 0.62
@@ -741,6 +741,14 @@ function themeVars(theme) {
741
741
  vars['--szc-danger'] = theme.danger;
742
742
  if (theme?.success)
743
743
  vars['--szc-success'] = theme.success;
744
+ if (theme?.successForeground)
745
+ vars['--szc-success-foreground'] = theme.successForeground;
746
+ if (theme?.logoBackground)
747
+ vars['--szc-logo-bg'] = theme.logoBackground;
748
+ if (theme?.shippingNeutral)
749
+ vars['--szc-shipping-neutral'] = theme.shippingNeutral;
750
+ if (theme?.shippingNeutralForeground)
751
+ vars['--szc-shipping-neutral-foreground'] = theme.shippingNeutralForeground;
744
752
  if (theme?.radius != null)
745
753
  vars['--szc-radius'] = `${theme.radius}px`;
746
754
  if (theme?.fontFamily)