@funnelsgrove/payments 0.11.24 → 0.12.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.
Files changed (29) hide show
  1. package/README.md +14 -8
  2. package/dist/providers/solidgate/components/SolidgateCheckoutDialog.d.ts +2 -66
  3. package/dist/providers/solidgate/components/SolidgateCheckoutDialog.js +5 -524
  4. package/dist/providers/solidgate/components/SolidgateCheckoutDialog.styles.d.ts +1 -0
  5. package/dist/providers/solidgate/components/SolidgateCheckoutDialog.styles.js +400 -0
  6. package/dist/providers/solidgate/components/SolidgateCheckoutDialog.types.d.ts +66 -0
  7. package/dist/providers/solidgate/components/SolidgateCheckoutSummary.d.ts +4 -0
  8. package/dist/providers/solidgate/components/SolidgateCheckoutSummary.js +15 -0
  9. package/dist/providers/solidgate/components/SolidgatePaymentForm.d.ts +12 -0
  10. package/dist/providers/solidgate/components/SolidgatePaymentForm.js +114 -0
  11. package/dist/providers/solidgate/services/solidgate.service.js +15 -18
  12. package/dist/providers/stripe/hooks/checkoutAttempt.js +0 -3
  13. package/dist/providers/stripe/hooks/checkoutIdentity.js +1 -5
  14. package/dist/providers/stripe/hooks/useStripeOneTimeCheckoutSession.js +1 -1
  15. package/dist/providers/stripe/hooks/useStripeSubscriptionCheckoutSession.js +1 -1
  16. package/dist/providers/stripe/services/hostedCheckout/requests.d.ts +7 -0
  17. package/dist/providers/stripe/services/hostedCheckout/requests.js +15 -8
  18. package/dist/providers/stripe/services/hostedCheckout/types.d.ts +6 -0
  19. package/dist/providers/stripe/services/stripe.service.d.ts +0 -1
  20. package/dist/providers/stripe/services/stripe.service.js +0 -1
  21. package/dist/services/checkoutObservability.service.js +1 -1
  22. package/dist/services/publishedBillingRuntime.service.js +4 -4
  23. package/package.json +3 -3
  24. package/dist/providers/stripe/services/paymentIntent/createPaymentIntent.d.ts +0 -5
  25. package/dist/providers/stripe/services/paymentIntent/createPaymentIntent.js +0 -8
  26. package/dist/providers/stripe/services/paymentIntent/requests.d.ts +0 -12
  27. package/dist/providers/stripe/services/paymentIntent/requests.js +0 -15
  28. package/dist/providers/stripe/services/paymentIntent/types.d.ts +0 -18
  29. /package/dist/providers/{stripe/services/paymentIntent/types.js → solidgate/components/SolidgateCheckoutDialog.types.js} +0 -0
@@ -1,12 +1,12 @@
1
1
  'use client';
2
2
  import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
3
3
  import { publicAnalyticsSdk } from '@funnelsgrove/analytics';
4
- import { Suspense, lazy, useCallback, useEffect, useMemo, useRef, useState, } from 'react';
4
+ import { useCallback, useEffect, useMemo, useRef, useState, } from 'react';
5
5
  import { pollSolidgateCheckoutStatus, prepareSolidgateCheckout, } from '../services/solidgate.service.js';
6
6
  import { trackCheckoutCanceled, trackCheckoutFailureShown, } from '../../../services/checkoutObservability.service.js';
7
- const SolidgatePayment = lazy(async () => ({
8
- default: (await import('@solidgate/react-sdk')).default,
9
- }));
7
+ import { SolidgateCheckoutSummary } from './SolidgateCheckoutSummary.js';
8
+ import { SolidgatePaymentForm } from './SolidgatePaymentForm.js';
9
+ import { solidgateCheckoutDialogStyles } from './SolidgateCheckoutDialog.styles.js';
10
10
  const defaultContent = {
11
11
  title: 'Secure checkout',
12
12
  closeAriaLabel: 'Close checkout',
@@ -35,14 +35,6 @@ const initialView = {
35
35
  checkout: null,
36
36
  canResumeVerification: false,
37
37
  };
38
- const formatCountdown = (remainingSeconds) => {
39
- const normalizedSeconds = Number.isFinite(remainingSeconds)
40
- ? Math.max(0, Math.floor(remainingSeconds))
41
- : 0;
42
- const minutes = Math.floor(normalizedSeconds / 60);
43
- const seconds = normalizedSeconds % 60;
44
- return `${String(minutes).padStart(2, '0')}:${String(seconds).padStart(2, '0')}`;
45
- };
46
38
  const trackSolidgateCheckoutEvent = async (eventName, attemptId, context) => {
47
39
  var _a;
48
40
  if (!context) {
@@ -70,114 +62,6 @@ const trackSolidgateCheckoutEvent = async (eventName, attemptId, context) => {
70
62
  }
71
63
  };
72
64
  const isAbortError = (error) => (error instanceof DOMException && error.name === 'AbortError');
73
- const safeDestroyPaymentForm = (instance) => {
74
- var _a;
75
- try {
76
- instance === null || instance === void 0 ? void 0 : instance.unsubscribeAll();
77
- }
78
- catch (_b) {
79
- // The global destroy below is the final cleanup boundary.
80
- }
81
- try {
82
- (_a = window.PaymentFormSdk) === null || _a === void 0 ? void 0 : _a.destroy();
83
- }
84
- catch (_c) {
85
- // Cleanup must stay safe when the remote SDK is partially initialized.
86
- }
87
- };
88
- function SolidgatePaymentForm({ buttonColor, cardSubmitLabel, checkout, hidden, loadingLabel, onError, onMounted, onSubmit, onVerify, }) {
89
- const instanceRef = useRef(null);
90
- const submittedRef = useRef(false);
91
- const paymentBoundaryRef = useRef(null);
92
- const mountedReportedRef = useRef(false);
93
- const onMountedRef = useRef(onMounted);
94
- const applePayContainerRef = useRef(null);
95
- const googlePayContainerRef = useRef(null);
96
- useEffect(() => {
97
- onMountedRef.current = onMounted;
98
- }, [onMounted]);
99
- useEffect(() => {
100
- mountedReportedRef.current = false;
101
- const boundary = paymentBoundaryRef.current;
102
- if (!boundary) {
103
- return;
104
- }
105
- const reportIframeMounted = () => {
106
- if (!mountedReportedRef.current
107
- && boundary.querySelector('iframe#solid-payment-form-iframe, iframe[name="solid-payment-form-iframe"]')) {
108
- mountedReportedRef.current = true;
109
- onMountedRef.current();
110
- }
111
- };
112
- reportIframeMounted();
113
- const observer = new MutationObserver(reportIframeMounted);
114
- observer.observe(boundary, { childList: true, subtree: true });
115
- return () => observer.disconnect();
116
- }, [checkout.attemptId]);
117
- useEffect(() => {
118
- submittedRef.current = false;
119
- return () => {
120
- safeDestroyPaymentForm(instanceRef.current);
121
- instanceRef.current = null;
122
- };
123
- }, [checkout.attemptId]);
124
- const walletButtonType = checkout.display.billingInterval ? 'subscribe' : 'buy';
125
- return (_jsxs("div", { ref: paymentBoundaryRef, className: 'solidgate-checkout-payment', "data-solidgate-attempt-id": checkout.attemptId, hidden: hidden, "aria-hidden": hidden || undefined, children: [_jsxs("div", { className: 'solidgate-checkout-wallets', children: [_jsx("div", { ref: applePayContainerRef, "data-solidgate-wallet": 'apple-pay' }), _jsx("div", { ref: googlePayContainerRef, "data-solidgate-wallet": 'google-pay' })] }), _jsx(Suspense, { fallback: (_jsx("p", { role: 'status', className: 'solidgate-checkout-status-text', children: loadingLabel })), children: _jsx(SolidgatePayment, { merchantData: checkout.initialization.merchantData, width: '100%', formParams: {
126
- autoFocus: false,
127
- isSolidLogoVisible: true,
128
- submitButtonText: cardSubmitLabel,
129
- }, styles: {
130
- form_body: {
131
- 'font-family': 'Inter, Arial, sans-serif',
132
- },
133
- input_group: {
134
- input: {
135
- 'border-color': '#d8d9dd',
136
- 'border-radius': '10px',
137
- },
138
- },
139
- submit_button: {
140
- 'background-color': buttonColor,
141
- 'border-radius': '10px',
142
- 'font-size': '16px',
143
- 'font-weight': '800',
144
- height: '52px',
145
- },
146
- }, applePayButtonParams: {
147
- color: 'black',
148
- enabled: true,
149
- integrationType: 'js',
150
- type: walletButtonType,
151
- }, googlePayButtonParams: {
152
- color: 'black',
153
- enabled: true,
154
- type: walletButtonType,
155
- }, applePayContainerRef: applePayContainerRef, googlePayContainerRef: googlePayContainerRef, onReadyPaymentInstance: (instance) => {
156
- if (instanceRef.current && instanceRef.current !== instance) {
157
- try {
158
- instanceRef.current.unsubscribeAll();
159
- }
160
- catch (_a) {
161
- // The active instance remains usable even if stale-listener cleanup fails.
162
- }
163
- }
164
- instanceRef.current = instance;
165
- }, onMounted: () => {
166
- if (!mountedReportedRef.current) {
167
- mountedReportedRef.current = true;
168
- onMountedRef.current();
169
- }
170
- }, onSubmit: () => {
171
- submittedRef.current = true;
172
- onSubmit();
173
- }, onVerify: onVerify, onSuccess: onVerify, onFail: onVerify, onError: () => {
174
- if (submittedRef.current) {
175
- onVerify();
176
- return;
177
- }
178
- onError();
179
- } }, checkout.attemptId) })] }));
180
- }
181
65
  export function SolidgateCheckoutDialog({ open, request, customerEmail, checkoutAnalytics, content, presentation, onClose, onCustomerEmailCommit, onSuccess, onRetry, onError, onStateChange, }) {
182
66
  const copy = useMemo(() => (Object.assign(Object.assign({}, defaultContent), content)), [content]);
183
67
  const [view, setView] = useState(initialView);
@@ -474,9 +358,6 @@ export function SolidgateCheckoutDialog({ open, request, customerEmail, checkout
474
358
  : view.state === 'recoverable_error'
475
359
  ? copy.error
476
360
  : null;
477
- const showPromo = Boolean((presentation === null || presentation === void 0 ? void 0 : presentation.promoActive) &&
478
- presentation.discountPercent > 0 &&
479
- presentation.promoCode.trim());
480
361
  const presentationStyle = presentation
481
362
  ? {
482
363
  '--solidgate-checkout-theme-color': presentation.themeColor,
@@ -486,7 +367,7 @@ export function SolidgateCheckoutDialog({ open, request, customerEmail, checkout
486
367
  'solidgate-checkout-dialog',
487
368
  showPreparingLoader ? 'is-preparing' : '',
488
369
  presentation ? 'is-branded' : '',
489
- ].filter(Boolean).join(' '), children: [_jsxs("div", { className: 'solidgate-checkout-header', children: [_jsx("button", { ref: closeButtonRef, type: 'button', onClick: handleClose, "aria-label": copy.closeAriaLabel, className: 'solidgate-checkout-close', children: _jsx("span", { "aria-hidden": 'true' }) }), _jsx("h2", { id: 'solidgate-checkout-title', className: 'solidgate-checkout-title', children: (presentation === null || presentation === void 0 ? void 0 : presentation.title) || copy.title })] }), presentation ? (_jsxs("section", { className: 'solidgate-checkout-summary', children: [showPromo ? (_jsxs("p", { className: 'solidgate-checkout-countdown', children: [presentation.discountPercent, "% ", presentation.countdownLabel, ' ', formatCountdown(presentation.remainingSeconds), " min"] })) : null, _jsxs("p", { className: 'solidgate-checkout-satisfaction', children: [_jsx("strong", { children: presentation.satisfactionPercent }), ' ', presentation.satisfactionLabel] }), showPromo ? (_jsxs("div", { className: 'solidgate-checkout-price-stack', children: [_jsxs("div", { className: 'solidgate-checkout-price-row is-muted', children: [_jsx("span", { children: presentation.originalPriceLabel }), _jsx("span", { className: 'solidgate-checkout-strike', children: presentation.originalPriceValue })] }), _jsxs("div", { className: 'solidgate-checkout-price-row is-discount', children: [_jsx("strong", { children: presentation.discountLabel }), _jsx("strong", { children: presentation.discountAmountLabel })] }), _jsxs("div", { className: 'solidgate-checkout-promo', children: [_jsx("span", { children: presentation.promoCodeLabel }), _jsx("strong", { children: presentation.promoCode.trim() })] })] })) : null, _jsxs("div", { className: `solidgate-checkout-total${showPromo ? '' : ' is-plain'}`, children: [_jsx("span", { children: presentation.totalLabel }), _jsx("strong", { children: presentation.totalValue })] }), showPromo ? (_jsxs("p", { className: 'solidgate-checkout-saved', children: [_jsx("span", { "aria-hidden": 'true', children: "\uD83D\uDD25" }), presentation.savedLabel] })) : null] })) : null, view.state === 'collecting_email' ? (_jsxs("form", { className: 'solidgate-checkout-email-form', onSubmit: (event) => void commitCustomerEmail(event), children: [_jsxs("label", { className: 'solidgate-checkout-email-label', children: [copy.customerEmailLabel, _jsx("input", { type: 'email', autoComplete: 'email', inputMode: 'email', maxLength: 320, required: true, value: emailInput, onChange: (event) => {
370
+ ].filter(Boolean).join(' '), children: [_jsxs("div", { className: 'solidgate-checkout-header', children: [_jsx("button", { ref: closeButtonRef, type: 'button', onClick: handleClose, "aria-label": copy.closeAriaLabel, className: 'solidgate-checkout-close', children: _jsx("span", { "aria-hidden": 'true' }) }), _jsx("h2", { id: 'solidgate-checkout-title', className: 'solidgate-checkout-title', children: (presentation === null || presentation === void 0 ? void 0 : presentation.title) || copy.title })] }), presentation ? _jsx(SolidgateCheckoutSummary, { presentation: presentation }) : null, view.state === 'collecting_email' ? (_jsxs("form", { className: 'solidgate-checkout-email-form', onSubmit: (event) => void commitCustomerEmail(event), children: [_jsxs("label", { className: 'solidgate-checkout-email-label', children: [copy.customerEmailLabel, _jsx("input", { type: 'email', autoComplete: 'email', inputMode: 'email', maxLength: 320, required: true, value: emailInput, onChange: (event) => {
490
371
  setEmailInput(event.target.value);
491
372
  setEmailError(null);
492
373
  }, placeholder: copy.customerEmailPlaceholder, "aria-invalid": Boolean(emailError), className: 'solidgate-checkout-email-input' })] }), emailError ? (_jsx("p", { role: 'alert', className: 'solidgate-checkout-alert', children: emailError })) : null, _jsx("button", { type: 'submit', disabled: emailSubmitting, className: 'solidgate-checkout-action', children: copy.customerEmailContinue })] })) : null, view.checkout ? (_jsx(SolidgatePaymentForm, { buttonColor: (presentation === null || presentation === void 0 ? void 0 : presentation.buttonColor) || '#3f51b5', cardSubmitLabel: (presentation === null || presentation === void 0 ? void 0 : presentation.cardSubmitLabel) || 'Pay securely', checkout: view.checkout, hidden: !showForm, loadingLabel: copy.loading, onMounted: () => {
@@ -506,403 +387,3 @@ export function SolidgateCheckoutDialog({ open, request, customerEmail, checkout
506
387
  (_b = onErrorRef.current) === null || _b === void 0 ? void 0 : _b.call(onErrorRef, copyRef.current.error);
507
388
  } }, view.checkout.attemptId)) : null, presentation && view.checkout && showForm ? (_jsx("p", { className: 'solidgate-checkout-secure', children: presentation.secureLabel })) : null, statusMessage && view.state !== 'ready' ? (_jsx("div", { className: 'solidgate-checkout-status', children: _jsx("p", { role: 'status', "aria-live": 'polite', children: statusMessage }) })) : null, view.state === 'verifying' && view.canResumeVerification ? (_jsx("button", { type: 'button', onClick: () => void verifyCanonicalStatus(), className: 'solidgate-checkout-action solidgate-checkout-action--spaced', children: copy.resumeVerification })) : null, (view.state === 'recoverable_error' || view.state === 'expired') && onRetry ? (_jsx("button", { type: 'button', onClick: onRetry, className: 'solidgate-checkout-action solidgate-checkout-action--spaced', children: copy.retry })) : null] })) : null] }), _jsx("style", { children: solidgateCheckoutDialogStyles })] }));
508
389
  }
509
- const solidgateCheckoutDialogStyles = `
510
- .solidgate-checkout-overlay {
511
- position: fixed;
512
- inset: 0;
513
- z-index: 100;
514
- box-sizing: border-box;
515
- display: flex;
516
- align-items: center;
517
- justify-content: center;
518
- overflow: hidden;
519
- padding: 16px;
520
- background: rgb(17 24 39 / 60%);
521
- backdrop-filter: blur(4px);
522
- }
523
-
524
- .solidgate-checkout-overlay.is-branded {
525
- z-index: 110;
526
- align-items: stretch;
527
- padding: 0;
528
- background: #fff;
529
- backdrop-filter: none;
530
- }
531
-
532
- .solidgate-checkout-dialog {
533
- box-sizing: border-box;
534
- width: min(100%, 512px);
535
- max-height: calc(100svh - 32px);
536
- overflow-y: auto;
537
- border: 1px solid var(--color-border, #d1d5db);
538
- border-radius: 16px;
539
- background: var(--color-surface, #fff);
540
- padding: 20px;
541
- color: var(--color-text, #111827);
542
- box-shadow: 0 24px 80px rgb(17 24 39 / 22%);
543
- }
544
-
545
- .solidgate-checkout-dialog.is-branded {
546
- width: min(100%, 430px);
547
- height: 100svh;
548
- max-height: 100svh;
549
- border: 0;
550
- border-radius: 0;
551
- background: #fff;
552
- padding: 0 17px 28px;
553
- color: #303136;
554
- box-shadow: none;
555
- font-family: Inter, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
556
- }
557
-
558
- .solidgate-checkout-dialog.is-preparing {
559
- position: absolute;
560
- opacity: 0;
561
- pointer-events: none;
562
- }
563
-
564
- .solidgate-checkout-loader {
565
- display: grid;
566
- place-items: center;
567
- }
568
-
569
- .solidgate-checkout-spinner {
570
- box-sizing: border-box;
571
- width: 44px;
572
- height: 44px;
573
- border: 4px solid var(--color-border, #d1d5db);
574
- border-top-color: var(--color-primary, #22c55e);
575
- border-radius: 50%;
576
- animation: solidgate-checkout-spin 720ms linear infinite;
577
- }
578
-
579
- .solidgate-checkout-visually-hidden {
580
- position: absolute;
581
- width: 1px;
582
- height: 1px;
583
- overflow: hidden;
584
- clip: rect(0 0 0 0);
585
- clip-path: inset(50%);
586
- white-space: nowrap;
587
- }
588
-
589
- @keyframes solidgate-checkout-spin {
590
- to {
591
- transform: rotate(360deg);
592
- }
593
- }
594
-
595
- @media (prefers-reduced-motion: reduce) {
596
- .solidgate-checkout-spinner {
597
- animation-duration: 1.6s;
598
- }
599
- }
600
-
601
- .solidgate-checkout-header {
602
- position: relative;
603
- display: flex;
604
- align-items: center;
605
- justify-content: center;
606
- gap: 16px;
607
- margin-bottom: 16px;
608
- }
609
-
610
- .solidgate-checkout-dialog.is-branded .solidgate-checkout-header {
611
- min-height: 70px;
612
- margin: 0 -17px;
613
- padding: 0 56px;
614
- }
615
-
616
- .solidgate-checkout-title {
617
- margin: 0;
618
- color: var(--color-text, #111827);
619
- font-size: 18px;
620
- font-weight: 600;
621
- line-height: 1.3;
622
- }
623
-
624
- .solidgate-checkout-dialog.is-branded .solidgate-checkout-title {
625
- color: #020203;
626
- font-size: 24px;
627
- font-weight: 900;
628
- line-height: 1.15;
629
- text-align: center;
630
- }
631
-
632
- .solidgate-checkout-close {
633
- position: absolute;
634
- left: 0;
635
- top: 50%;
636
- width: 36px;
637
- height: 36px;
638
- flex: none;
639
- border: 1px solid var(--color-border, #d1d5db);
640
- border-radius: 8px;
641
- background: var(--color-bg, #f9fafb);
642
- color: var(--color-text, #111827);
643
- font-size: 22px;
644
- transform: translateY(-50%);
645
- cursor: pointer;
646
- }
647
-
648
- .solidgate-checkout-dialog.is-branded .solidgate-checkout-close {
649
- left: 16px;
650
- width: 40px;
651
- height: 40px;
652
- border: 0;
653
- border-radius: 999px;
654
- background: #f2f2f3;
655
- color: #aaa;
656
- }
657
-
658
- .solidgate-checkout-close span,
659
- .solidgate-checkout-close span::after {
660
- position: absolute;
661
- left: 50%;
662
- top: 50%;
663
- width: 22px;
664
- height: 3px;
665
- border-radius: 999px;
666
- background: currentColor;
667
- content: '';
668
- }
669
-
670
- .solidgate-checkout-close span {
671
- transform: translate(-50%, -50%) rotate(45deg);
672
- }
673
-
674
- .solidgate-checkout-close span::after {
675
- transform: translate(-50%, -50%) rotate(90deg);
676
- }
677
-
678
- .solidgate-checkout-close:hover {
679
- background: var(--color-accent-soft, #eef2ff);
680
- }
681
-
682
- .solidgate-checkout-summary {
683
- color: #303136;
684
- }
685
-
686
- .solidgate-checkout-countdown {
687
- min-height: 37px;
688
- display: flex;
689
- align-items: center;
690
- justify-content: center;
691
- margin: 0;
692
- border-radius: 12px;
693
- background: color-mix(in srgb, var(--solidgate-checkout-theme-color) 10%, #fff);
694
- color: var(--solidgate-checkout-theme-color);
695
- font-size: 16px;
696
- font-weight: 900;
697
- text-align: center;
698
- }
699
-
700
- .solidgate-checkout-satisfaction {
701
- margin: 17px 0 21px;
702
- color: #2f3034;
703
- font-size: 19px;
704
- font-weight: 800;
705
- line-height: 1.15;
706
- text-align: center;
707
- }
708
-
709
- .solidgate-checkout-satisfaction strong {
710
- color: var(--solidgate-checkout-theme-color);
711
- }
712
-
713
- .solidgate-checkout-price-stack {
714
- display: flex;
715
- flex-direction: column;
716
- gap: 8px;
717
- }
718
-
719
- .solidgate-checkout-price-row,
720
- .solidgate-checkout-promo,
721
- .solidgate-checkout-total {
722
- display: flex;
723
- align-items: center;
724
- justify-content: space-between;
725
- gap: 12px;
726
- }
727
-
728
- .solidgate-checkout-price-row {
729
- font-size: 17px;
730
- }
731
-
732
- .solidgate-checkout-price-row.is-muted {
733
- color: #9d9d9f;
734
- font-weight: 500;
735
- }
736
-
737
- .solidgate-checkout-strike {
738
- text-decoration: line-through 2px;
739
- }
740
-
741
- .solidgate-checkout-price-row.is-discount {
742
- color: #040508;
743
- font-weight: 900;
744
- }
745
-
746
- .solidgate-checkout-price-row.is-discount strong:last-child {
747
- color: #ff2544;
748
- }
749
-
750
- .solidgate-checkout-promo {
751
- min-height: 42px;
752
- border-radius: 13px;
753
- background: #f0f0f0;
754
- padding: 0 14px;
755
- color: #8d8d90;
756
- font-size: 16px;
757
- }
758
-
759
- .solidgate-checkout-promo strong {
760
- color: #050609;
761
- font-weight: 900;
762
- }
763
-
764
- .solidgate-checkout-total {
765
- min-height: 76px;
766
- margin-top: 20px;
767
- border-top: 1px solid #dedede;
768
- font-size: 23px;
769
- font-weight: 800;
770
- }
771
-
772
- .solidgate-checkout-total.is-plain {
773
- margin-top: 0;
774
- }
775
-
776
- .solidgate-checkout-total strong {
777
- font-size: 25px;
778
- font-weight: 900;
779
- }
780
-
781
- .solidgate-checkout-saved {
782
- width: fit-content;
783
- min-height: 36px;
784
- display: flex;
785
- align-items: center;
786
- gap: 7px;
787
- margin: 0 auto 12px;
788
- border-radius: 999px;
789
- background: #fff3cf;
790
- padding: 0 13px;
791
- color: #2e3034;
792
- font-size: 14px;
793
- font-weight: 800;
794
- }
795
-
796
- .solidgate-checkout-email-form,
797
- .solidgate-checkout-email-label,
798
- .solidgate-checkout-wallets {
799
- display: grid;
800
- }
801
-
802
- .solidgate-checkout-email-form {
803
- gap: 16px;
804
- }
805
-
806
- .solidgate-checkout-email-label {
807
- gap: 8px;
808
- color: var(--color-text, #111827);
809
- font-size: 14px;
810
- font-weight: 500;
811
- }
812
-
813
- .solidgate-checkout-email-input {
814
- box-sizing: border-box;
815
- width: 100%;
816
- min-height: 44px;
817
- border: 1px solid var(--color-border, #d1d5db);
818
- border-radius: 8px;
819
- background: var(--color-bg, #fff);
820
- padding: 8px 12px;
821
- color: var(--color-text, #111827);
822
- font: inherit;
823
- }
824
-
825
- .solidgate-checkout-email-input::placeholder,
826
- .solidgate-checkout-status,
827
- .solidgate-checkout-status-text {
828
- color: var(--color-text-muted, #6b7280);
829
- }
830
-
831
- .solidgate-checkout-email-input:focus-visible,
832
- .solidgate-checkout-close:focus-visible,
833
- .solidgate-checkout-action:focus-visible {
834
- outline: 2px solid var(--color-accent, #3f51b5);
835
- outline-offset: 2px;
836
- }
837
-
838
- .solidgate-checkout-alert {
839
- margin: 0;
840
- color: var(--color-danger, #b91c1c);
841
- font-size: 14px;
842
- }
843
-
844
- .solidgate-checkout-action {
845
- box-sizing: border-box;
846
- width: 100%;
847
- min-height: 44px;
848
- border: 1px solid var(--color-accent, #3f51b5);
849
- border-radius: 8px;
850
- background: var(--color-accent, #3f51b5);
851
- padding: 8px 16px;
852
- color: var(--color-primary-text, #fff);
853
- font: inherit;
854
- font-weight: 600;
855
- cursor: pointer;
856
- }
857
-
858
- .solidgate-checkout-action:disabled {
859
- cursor: not-allowed;
860
- opacity: 0.6;
861
- }
862
-
863
- .solidgate-checkout-action--spaced {
864
- margin-top: 16px;
865
- }
866
-
867
- .solidgate-checkout-wallets {
868
- gap: 12px;
869
- margin-bottom: 12px;
870
- }
871
-
872
- .solidgate-checkout-dialog.is-branded .solidgate-checkout-wallets {
873
- margin-top: 4px;
874
- }
875
-
876
- .solidgate-checkout-dialog.is-branded .solidgate-checkout-wallets > div:not(:empty) {
877
- min-height: 48px;
878
- }
879
-
880
- .solidgate-checkout-secure {
881
- width: fit-content;
882
- margin: 14px auto 0;
883
- border-radius: 999px;
884
- background: #edfff4;
885
- padding: 8px 14px;
886
- color: #2b2d31;
887
- font-size: 13px;
888
- font-weight: 700;
889
- }
890
-
891
- .solidgate-checkout-payment[hidden] {
892
- display: none;
893
- }
894
-
895
- .solidgate-checkout-status {
896
- margin-top: 12px;
897
- border: 1px solid var(--color-border, #d1d5db);
898
- border-radius: 12px;
899
- background: var(--color-bg, #f9fafb);
900
- padding: 16px;
901
- font-size: 14px;
902
- }
903
-
904
- .solidgate-checkout-status p,
905
- .solidgate-checkout-status-text {
906
- margin: 0;
907
- }
908
- `;
@@ -0,0 +1 @@
1
+ export declare const solidgateCheckoutDialogStyles = "\n.solidgate-checkout-overlay {\n position: fixed;\n inset: 0;\n z-index: 100;\n box-sizing: border-box;\n display: flex;\n align-items: center;\n justify-content: center;\n overflow: hidden;\n padding: 16px;\n background: rgb(17 24 39 / 60%);\n backdrop-filter: blur(4px);\n}\n\n.solidgate-checkout-overlay.is-branded {\n z-index: 110;\n align-items: stretch;\n padding: 0;\n background: #fff;\n backdrop-filter: none;\n}\n\n.solidgate-checkout-dialog {\n box-sizing: border-box;\n width: min(100%, 512px);\n max-height: calc(100svh - 32px);\n overflow-y: auto;\n border: 1px solid var(--color-border, #d1d5db);\n border-radius: 16px;\n background: var(--color-surface, #fff);\n padding: 20px;\n color: var(--color-text, #111827);\n box-shadow: 0 24px 80px rgb(17 24 39 / 22%);\n}\n\n.solidgate-checkout-dialog.is-branded {\n width: min(100%, 430px);\n height: 100svh;\n max-height: 100svh;\n border: 0;\n border-radius: 0;\n background: #fff;\n padding: 0 17px 28px;\n color: #303136;\n box-shadow: none;\n font-family: Inter, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;\n}\n\n.solidgate-checkout-dialog.is-preparing {\n position: absolute;\n opacity: 0;\n pointer-events: none;\n}\n\n.solidgate-checkout-loader {\n display: grid;\n place-items: center;\n}\n\n.solidgate-checkout-spinner {\n box-sizing: border-box;\n width: 44px;\n height: 44px;\n border: 4px solid var(--color-border, #d1d5db);\n border-top-color: var(--color-primary, #22c55e);\n border-radius: 50%;\n animation: solidgate-checkout-spin 720ms linear infinite;\n}\n\n.solidgate-checkout-visually-hidden {\n position: absolute;\n width: 1px;\n height: 1px;\n overflow: hidden;\n clip: rect(0 0 0 0);\n clip-path: inset(50%);\n white-space: nowrap;\n}\n\n@keyframes solidgate-checkout-spin {\n to {\n transform: rotate(360deg);\n }\n}\n\n@media (prefers-reduced-motion: reduce) {\n .solidgate-checkout-spinner {\n animation-duration: 1.6s;\n }\n}\n\n.solidgate-checkout-header {\n position: relative;\n display: flex;\n align-items: center;\n justify-content: center;\n gap: 16px;\n margin-bottom: 16px;\n}\n\n.solidgate-checkout-dialog.is-branded .solidgate-checkout-header {\n min-height: 70px;\n margin: 0 -17px;\n padding: 0 56px;\n}\n\n.solidgate-checkout-title {\n margin: 0;\n color: var(--color-text, #111827);\n font-size: 18px;\n font-weight: 600;\n line-height: 1.3;\n}\n\n.solidgate-checkout-dialog.is-branded .solidgate-checkout-title {\n color: #020203;\n font-size: 24px;\n font-weight: 900;\n line-height: 1.15;\n text-align: center;\n}\n\n.solidgate-checkout-close {\n position: absolute;\n left: 0;\n top: 50%;\n width: 36px;\n height: 36px;\n flex: none;\n border: 1px solid var(--color-border, #d1d5db);\n border-radius: 8px;\n background: var(--color-bg, #f9fafb);\n color: var(--color-text, #111827);\n font-size: 22px;\n transform: translateY(-50%);\n cursor: pointer;\n}\n\n.solidgate-checkout-dialog.is-branded .solidgate-checkout-close {\n left: 16px;\n width: 40px;\n height: 40px;\n border: 0;\n border-radius: 999px;\n background: #f2f2f3;\n color: #aaa;\n}\n\n.solidgate-checkout-close span,\n.solidgate-checkout-close span::after {\n position: absolute;\n left: 50%;\n top: 50%;\n width: 22px;\n height: 3px;\n border-radius: 999px;\n background: currentColor;\n content: '';\n}\n\n.solidgate-checkout-close span {\n transform: translate(-50%, -50%) rotate(45deg);\n}\n\n.solidgate-checkout-close span::after {\n transform: translate(-50%, -50%) rotate(90deg);\n}\n\n.solidgate-checkout-close:hover {\n background: var(--color-accent-soft, #eef2ff);\n}\n\n.solidgate-checkout-summary {\n color: #303136;\n}\n\n.solidgate-checkout-countdown {\n min-height: 37px;\n display: flex;\n align-items: center;\n justify-content: center;\n margin: 0;\n border-radius: 12px;\n background: color-mix(in srgb, var(--solidgate-checkout-theme-color) 10%, #fff);\n color: var(--solidgate-checkout-theme-color);\n font-size: 16px;\n font-weight: 900;\n text-align: center;\n}\n\n.solidgate-checkout-satisfaction {\n margin: 17px 0 21px;\n color: #2f3034;\n font-size: 19px;\n font-weight: 800;\n line-height: 1.15;\n text-align: center;\n}\n\n.solidgate-checkout-satisfaction strong {\n color: var(--solidgate-checkout-theme-color);\n}\n\n.solidgate-checkout-price-stack {\n display: flex;\n flex-direction: column;\n gap: 8px;\n}\n\n.solidgate-checkout-price-row,\n.solidgate-checkout-promo,\n.solidgate-checkout-total {\n display: flex;\n align-items: center;\n justify-content: space-between;\n gap: 12px;\n}\n\n.solidgate-checkout-price-row {\n font-size: 17px;\n}\n\n.solidgate-checkout-price-row.is-muted {\n color: #9d9d9f;\n font-weight: 500;\n}\n\n.solidgate-checkout-strike {\n text-decoration: line-through 2px;\n}\n\n.solidgate-checkout-price-row.is-discount {\n color: #040508;\n font-weight: 900;\n}\n\n.solidgate-checkout-price-row.is-discount strong:last-child {\n color: #ff2544;\n}\n\n.solidgate-checkout-promo {\n min-height: 42px;\n border-radius: 13px;\n background: #f0f0f0;\n padding: 0 14px;\n color: #8d8d90;\n font-size: 16px;\n}\n\n.solidgate-checkout-promo strong {\n color: #050609;\n font-weight: 900;\n}\n\n.solidgate-checkout-total {\n min-height: 76px;\n margin-top: 20px;\n border-top: 1px solid #dedede;\n font-size: 23px;\n font-weight: 800;\n}\n\n.solidgate-checkout-total.is-plain {\n margin-top: 0;\n}\n\n.solidgate-checkout-total strong {\n font-size: 25px;\n font-weight: 900;\n}\n\n.solidgate-checkout-saved {\n width: fit-content;\n min-height: 36px;\n display: flex;\n align-items: center;\n gap: 7px;\n margin: 0 auto 12px;\n border-radius: 999px;\n background: #fff3cf;\n padding: 0 13px;\n color: #2e3034;\n font-size: 14px;\n font-weight: 800;\n}\n\n.solidgate-checkout-email-form,\n.solidgate-checkout-email-label,\n.solidgate-checkout-wallets {\n display: grid;\n}\n\n.solidgate-checkout-email-form {\n gap: 16px;\n}\n\n.solidgate-checkout-email-label {\n gap: 8px;\n color: var(--color-text, #111827);\n font-size: 14px;\n font-weight: 500;\n}\n\n.solidgate-checkout-email-input {\n box-sizing: border-box;\n width: 100%;\n min-height: 44px;\n border: 1px solid var(--color-border, #d1d5db);\n border-radius: 8px;\n background: var(--color-bg, #fff);\n padding: 8px 12px;\n color: var(--color-text, #111827);\n font: inherit;\n}\n\n.solidgate-checkout-email-input::placeholder,\n.solidgate-checkout-status,\n.solidgate-checkout-status-text {\n color: var(--color-text-muted, #6b7280);\n}\n\n.solidgate-checkout-email-input:focus-visible,\n.solidgate-checkout-close:focus-visible,\n.solidgate-checkout-action:focus-visible {\n outline: 2px solid var(--color-accent, #3f51b5);\n outline-offset: 2px;\n}\n\n.solidgate-checkout-alert {\n margin: 0;\n color: var(--color-danger, #b91c1c);\n font-size: 14px;\n}\n\n.solidgate-checkout-action {\n box-sizing: border-box;\n width: 100%;\n min-height: 44px;\n border: 1px solid var(--color-accent, #3f51b5);\n border-radius: 8px;\n background: var(--color-accent, #3f51b5);\n padding: 8px 16px;\n color: var(--color-primary-text, #fff);\n font: inherit;\n font-weight: 600;\n cursor: pointer;\n}\n\n.solidgate-checkout-action:disabled {\n cursor: not-allowed;\n opacity: 0.6;\n}\n\n.solidgate-checkout-action--spaced {\n margin-top: 16px;\n}\n\n.solidgate-checkout-wallets {\n gap: 12px;\n margin-bottom: 12px;\n}\n\n.solidgate-checkout-dialog.is-branded .solidgate-checkout-wallets {\n margin-top: 4px;\n}\n\n.solidgate-checkout-dialog.is-branded .solidgate-checkout-wallets > div:not(:empty) {\n min-height: 48px;\n}\n\n.solidgate-checkout-secure {\n width: fit-content;\n margin: 14px auto 0;\n border-radius: 999px;\n background: #edfff4;\n padding: 8px 14px;\n color: #2b2d31;\n font-size: 13px;\n font-weight: 700;\n}\n\n.solidgate-checkout-payment[hidden] {\n display: none;\n}\n\n.solidgate-checkout-status {\n margin-top: 12px;\n border: 1px solid var(--color-border, #d1d5db);\n border-radius: 12px;\n background: var(--color-bg, #f9fafb);\n padding: 16px;\n font-size: 14px;\n}\n\n.solidgate-checkout-status p,\n.solidgate-checkout-status-text {\n margin: 0;\n}\n";