@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.
- package/README.md +4 -0
- package/dist/core/index.d.cts +8 -0
- package/dist/core/index.d.ts +8 -0
- package/dist/next/index.cjs +10 -2
- package/dist/next/index.cjs.map +1 -1
- package/dist/next/index.d.cts +8 -0
- package/dist/next/index.d.ts +8 -0
- package/dist/next/index.js +10 -2
- package/dist/next/index.js.map +1 -1
- package/dist/react/index.d.cts +8 -0
- package/dist/react/index.d.ts +8 -0
- package/dist/styles.css +24 -21
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -77,6 +77,10 @@ export default function Checkout() {
|
|
|
77
77
|
| `summaryBackground` | `--szc-summary-bg` | Summary sidebar |
|
|
78
78
|
| `danger` | `--szc-danger` | Errors and destructive states |
|
|
79
79
|
| `success` | `--szc-success` | Completed and success states |
|
|
80
|
+
| `successForeground` | `--szc-success-foreground` | Text/icons on solid success surfaces |
|
|
81
|
+
| `logoBackground` | `--szc-logo-bg` | Plate behind shipping-provider logos |
|
|
82
|
+
| `shippingNeutral` | `--szc-shipping-neutral` | Neutral surface for white shipping colors |
|
|
83
|
+
| `shippingNeutralForeground` | `--szc-shipping-neutral-foreground` | Foreground on the neutral shipping surface |
|
|
80
84
|
|
|
81
85
|
`radius` and `fontFamily` remain available for shape and typography. Shipping-rate icon colors continue to come from the shipping API.
|
|
82
86
|
|
package/dist/core/index.d.cts
CHANGED
|
@@ -70,6 +70,14 @@ interface CheckoutTheme {
|
|
|
70
70
|
danger?: string;
|
|
71
71
|
/** Success and completed-state color. */
|
|
72
72
|
success?: string;
|
|
73
|
+
/** Foreground used on top of solid success surfaces. */
|
|
74
|
+
successForeground?: string;
|
|
75
|
+
/** Background plate behind carrier and shipping-method logos. */
|
|
76
|
+
logoBackground?: string;
|
|
77
|
+
/** Neutral surface used when a shipping color is white or near-white. */
|
|
78
|
+
shippingNeutral?: string;
|
|
79
|
+
/** Foreground used on the neutral shipping surface. */
|
|
80
|
+
shippingNeutralForeground?: string;
|
|
73
81
|
/** Base corner radius in px. */
|
|
74
82
|
radius?: number;
|
|
75
83
|
/** Font family. Defaults to `inherit` so the host font flows through. */
|
package/dist/core/index.d.ts
CHANGED
|
@@ -70,6 +70,14 @@ interface CheckoutTheme {
|
|
|
70
70
|
danger?: string;
|
|
71
71
|
/** Success and completed-state color. */
|
|
72
72
|
success?: string;
|
|
73
|
+
/** Foreground used on top of solid success surfaces. */
|
|
74
|
+
successForeground?: string;
|
|
75
|
+
/** Background plate behind carrier and shipping-method logos. */
|
|
76
|
+
logoBackground?: string;
|
|
77
|
+
/** Neutral surface used when a shipping color is white or near-white. */
|
|
78
|
+
shippingNeutral?: string;
|
|
79
|
+
/** Foreground used on the neutral shipping surface. */
|
|
80
|
+
shippingNeutralForeground?: string;
|
|
73
81
|
/** Base corner radius in px. */
|
|
74
82
|
radius?: number;
|
|
75
83
|
/** Font family. Defaults to `inherit` so the host font flows through. */
|
package/dist/next/index.cjs
CHANGED
|
@@ -575,8 +575,8 @@ function shippingRateIconStyle(color) {
|
|
|
575
575
|
// the card. Render a neutral chip with a slate glyph instead.
|
|
576
576
|
if (luminance > 0.9) {
|
|
577
577
|
return {
|
|
578
|
-
'--szc-rate-color': '
|
|
579
|
-
'--szc-rate-foreground': '
|
|
578
|
+
'--szc-rate-color': 'var(--szc-shipping-neutral)',
|
|
579
|
+
'--szc-rate-foreground': 'var(--szc-shipping-neutral-foreground)'
|
|
580
580
|
};
|
|
581
581
|
}
|
|
582
582
|
const foreground = luminance > 0.62
|
|
@@ -742,6 +742,14 @@ function themeVars(theme) {
|
|
|
742
742
|
vars['--szc-danger'] = theme.danger;
|
|
743
743
|
if (theme?.success)
|
|
744
744
|
vars['--szc-success'] = theme.success;
|
|
745
|
+
if (theme?.successForeground)
|
|
746
|
+
vars['--szc-success-foreground'] = theme.successForeground;
|
|
747
|
+
if (theme?.logoBackground)
|
|
748
|
+
vars['--szc-logo-bg'] = theme.logoBackground;
|
|
749
|
+
if (theme?.shippingNeutral)
|
|
750
|
+
vars['--szc-shipping-neutral'] = theme.shippingNeutral;
|
|
751
|
+
if (theme?.shippingNeutralForeground)
|
|
752
|
+
vars['--szc-shipping-neutral-foreground'] = theme.shippingNeutralForeground;
|
|
745
753
|
if (theme?.radius != null)
|
|
746
754
|
vars['--szc-radius'] = `${theme.radius}px`;
|
|
747
755
|
if (theme?.fontFamily)
|