yt-uikit 0.10.147 → 0.10.149-note.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 +94 -94
- package/dist/esm/assets/confetti.d.ts +2 -2
- package/dist/esm/atoms/bundleBuilderProductDetailsAtom.d.ts +4 -4
- package/dist/esm/atoms/cartDataAtom.d.ts +3 -3
- package/dist/esm/atoms/cartLoadingAtom.d.ts +23 -23
- package/dist/esm/atoms/cartTimer.d.ts +2 -2
- package/dist/esm/atoms/dateAtom.d.ts +1 -1
- package/dist/esm/atoms/freebieClaimModalAtom.d.ts +7 -7
- package/dist/esm/atoms/giftWrap.d.ts +2 -2
- package/dist/esm/atoms/gstCompanyNameAtom.d.ts +1 -1
- package/dist/esm/atoms/gstInputAtom.d.ts +1 -1
- package/dist/esm/atoms/maxQtyErrorAtom.d.ts +3 -3
- package/dist/esm/atoms/multiClaimSelectionAtom.d.ts +28 -28
- package/dist/esm/atoms/noteInputAtom.d.ts +3 -3
- package/dist/esm/atoms/postalCodeAtom.d.ts +1 -1
- package/dist/esm/atoms/shippingAtom.d.ts +8 -8
- package/dist/esm/atoms/showGSTInputAtom.d.ts +1 -1
- package/dist/esm/atoms/variantSelectionModalAtom.d.ts +35 -35
- package/dist/esm/components/BundleBlock/Bundle.d.ts +478 -478
- package/dist/esm/components/BundleBlock/BundleBuilder/BundleBuilder.d.ts +52 -52
- package/dist/esm/components/BundleBlock/BundleBuilder/ResponsiveBgImage.d.ts +9 -9
- package/dist/esm/components/BundleBlock/BundleBuilder/SortAndFilter.d.ts +74 -74
- package/dist/esm/components/BundleBlock/BundleBuilder/VariantOptionsModal.d.ts +30 -30
- package/dist/esm/components/BundleBlock/BundleBuilder/bundleBuilder.style.d.ts +36 -36
- package/dist/esm/components/BundleBlock/BundleBuilderTracker/BundleBuilderTracker.d.ts +56 -56
- package/dist/esm/components/BundleBlock/BundleBuilderTracker/bundleBuilderTracker.style.d.ts +80 -80
- package/dist/esm/components/BundleBlock/BundleLoaderModal.d.ts +7 -7
- package/dist/esm/components/BundleBlock/BundleProductDetailsModal/BundleProductDetailsModal.d.ts +54 -54
- package/dist/esm/components/BundleBlock/BundleProductDetailsModal/ImageViewer.d.ts +18 -18
- package/dist/esm/components/BundleBlock/BundleProductDetailsModal/bundleProductDetailsModal.style.d.ts +9 -9
- package/dist/esm/components/BundleBlock/CartATCLoader.d.ts +12 -12
- package/dist/esm/components/BundleBlock/CollectionBundle/CategoryFilter.d.ts +10 -10
- package/dist/esm/components/BundleBlock/CollectionBundle/ColllectionBundle.d.ts +135 -135
- package/dist/esm/components/BundleBlock/CollectionBundle/ProductDetailsModal.d.ts +20 -20
- package/dist/esm/components/BundleBlock/ComboBundle.d.ts +17 -17
- package/dist/esm/components/BundleBlock/ErrorToast.d.ts +10 -10
- package/dist/esm/components/BundleBlock/FixedBundle/FixedBundle.d.ts +4 -4
- package/dist/esm/components/BundleBlock/FixedBundle/SeparateVariantOptions.d.ts +52 -52
- package/dist/esm/components/BundleBlock/FixedBundle/VariantSelectorModal.d.ts +23 -23
- package/dist/esm/components/BundleBlock/FixedBundle/fixedBundle.style.d.ts +86 -86
- package/dist/esm/components/BundleBlock/Loader.d.ts +5 -5
- package/dist/esm/components/BundleBlock/MixAndMatchBundle/MixAndMatchBundle.d.ts +9 -9
- package/dist/esm/components/BundleBlock/MixAndMatchBundle/mixAndMatchBundle.style.d.ts +91 -91
- package/dist/esm/components/BundleBlock/PersonalizationForm/PersonalizationForm.d.ts +35 -35
- package/dist/esm/components/BundleBlock/PersonalizationForm/PersonalizationFormModal.d.ts +24 -24
- package/dist/esm/components/BundleBlock/VariantDropdown.d.ts +33 -33
- package/dist/esm/components/BundleBlock/VolumeBundle/VolumeBundle.d.ts +31 -31
- package/dist/esm/components/BundleBlock/VolumeBundle/volumeBundle.style.d.ts +102 -102
- package/dist/esm/components/BundleBlock/gokwikGuard.d.ts +22 -22
- package/dist/esm/components/BundleBlock/index.d.ts +1 -1
- package/dist/esm/components/Cart/ApplyCoupon.d.ts +13 -13
- package/dist/esm/components/Cart/Bundle.d.ts +6 -6
- package/dist/esm/components/Cart/Cart.d.ts +272 -272
- package/dist/esm/components/Cart/CartDrawer.d.ts +41 -41
- package/dist/esm/components/Cart/CartOffersCarousel.d.ts +48 -48
- package/dist/esm/components/Cart/CartProductsList.d.ts +55 -55
- package/dist/esm/components/Cart/CartTimer.d.ts +8 -8
- package/dist/esm/components/Cart/CheckoutSection.d.ts +55 -55
- package/dist/esm/components/Cart/CouponSelection.d.ts +18 -18
- package/dist/esm/components/Cart/CustomVariantSwatches.d.ts +15 -15
- package/dist/esm/components/Cart/DatePicker.d.ts +10 -10
- package/dist/esm/components/Cart/EmptyCart.d.ts +34 -34
- package/dist/esm/components/Cart/FloatingCart.d.ts +24 -24
- package/dist/esm/components/Cart/FooterSections.d.ts +9 -9
- package/dist/esm/components/Cart/FreebieClaimManager.d.ts +17 -17
- package/dist/esm/components/Cart/FreebieClaimOverlay.d.ts +18 -18
- package/dist/esm/components/Cart/FreebieClaimOverlayCard.d.ts +14 -14
- package/dist/esm/components/Cart/FreebieClaimSection.d.ts +16 -16
- package/dist/esm/components/Cart/FreebieClaimSectionCard.d.ts +23 -23
- package/dist/esm/components/Cart/GSTSection.d.ts +15 -15
- package/dist/esm/components/Cart/GiftWrap.d.ts +13 -13
- package/dist/esm/components/Cart/InlineCartOfferInfoText.d.ts +10 -10
- package/dist/esm/components/Cart/ItemSwap.d.ts +35 -35
- package/dist/esm/components/Cart/LoyaltyAppliedCTA.d.ts +14 -14
- package/dist/esm/components/Cart/LoyaltyApplyCTA.d.ts +16 -16
- package/dist/esm/components/Cart/LoyaltyBadge.d.ts +11 -11
- package/dist/esm/components/Cart/LoyaltyGuestCTA.d.ts +15 -15
- package/dist/esm/components/Cart/MultiStepProgressBar/CheckpointConfetti.d.ts +11 -11
- package/dist/esm/components/Cart/MultiStepProgressBar/CheckpointIcon.d.ts +3 -3
- package/dist/esm/components/Cart/MultiStepProgressBar/CheckpointTooltip.d.ts +3 -3
- package/dist/esm/components/Cart/MultiStepProgressBar/MultiStepIcon.d.ts +9 -9
- package/dist/esm/components/Cart/MultiStepProgressBar/MultiStepProgressBar.d.ts +5 -5
- package/dist/esm/components/Cart/MultiStepProgressBar/MultiStepProgressBar.styled.d.ts +47 -47
- package/dist/esm/components/Cart/MultiStepProgressBar/MultiStepUtils.d.ts +6 -6
- package/dist/esm/components/Cart/MultiStepProgressBar/MultiTierProgressBar.d.ts +4 -4
- package/dist/esm/components/Cart/MultiStepProgressBar/MutiTierNextRewardMessage.d.ts +3 -3
- package/dist/esm/components/Cart/MultiStepProgressBar/NextRewardMessage.d.ts +3 -3
- package/dist/esm/components/Cart/MultiStepProgressBar/SingleTierProgressBar.d.ts +4 -4
- package/dist/esm/components/Cart/MultiStepProgressBar/SingleTierProgressBar.styled.d.ts +22 -22
- package/dist/esm/components/Cart/MultiStepProgressBar/SingletTierNextRewardMessage.d.ts +3 -3
- package/dist/esm/components/Cart/MultiStepProgressBar/types.d.ts +54 -54
- package/dist/esm/components/Cart/NextFreebieRow.d.ts +21 -21
- package/dist/esm/components/Cart/NoteSection.d.ts +8 -8
- package/dist/esm/components/Cart/ProductCard.d.ts +37 -37
- package/dist/esm/components/Cart/ProductRecCard.d.ts +23 -23
- package/dist/esm/components/Cart/ProductRecList.d.ts +24 -24
- package/dist/esm/components/Cart/ProgressBarCartLoader.d.ts +7 -7
- package/dist/esm/components/Cart/QuantitySelector.d.ts +11 -11
- package/dist/esm/components/Cart/RegionSpecificDelivery.d.ts +14 -14
- package/dist/esm/components/Cart/RewardPointsPreview.d.ts +12 -12
- package/dist/esm/components/Cart/StandardDelivery.d.ts +11 -11
- package/dist/esm/components/Cart/StealDealSection.d.ts +16 -16
- package/dist/esm/components/Cart/StickyCart.d.ts +68 -68
- package/dist/esm/components/Cart/SubtotalSection.d.ts +13 -13
- package/dist/esm/components/Cart/UploadImageSection.d.ts +31 -31
- package/dist/esm/components/Cart/VariantDropDown.d.ts +13 -13
- package/dist/esm/components/Cart/VariantSelectionPopup/DesktopVariantPopup.d.ts +17 -17
- package/dist/esm/components/Cart/VariantSelectionPopup/DesktopVariantPopup.styled.d.ts +48 -48
- package/dist/esm/components/Cart/VariantSelectionPopup/MobileVariantPopover.d.ts +17 -17
- package/dist/esm/components/Cart/index.d.ts +1 -1
- package/dist/esm/components/Loyalty/AccountAddresses.d.ts +30 -30
- package/dist/esm/components/Loyalty/AccountBlock.d.ts +108 -108
- package/dist/esm/components/Loyalty/AccountBlock.types.d.ts +290 -290
- package/dist/esm/components/Loyalty/AccountLoginForm.d.ts +57 -57
- package/dist/esm/components/Loyalty/AccountOrderHistory.d.ts +61 -61
- package/dist/esm/components/Loyalty/AccountRewards.d.ts +25 -25
- package/dist/esm/components/Loyalty/AccountWaysToRedeem.d.ts +10 -10
- package/dist/esm/components/Loyalty/ActiveSessionOverlay.d.ts +8 -8
- package/dist/esm/components/Loyalty/BubbleLauncher.d.ts +14 -14
- package/dist/esm/components/Loyalty/GuestDesktop.d.ts +5 -5
- package/dist/esm/components/Loyalty/GuestDesktopWithoutImage.d.ts +7 -7
- package/dist/esm/components/Loyalty/GuestMobile.d.ts +6 -6
- package/dist/esm/components/Loyalty/Loader.d.ts +10 -10
- package/dist/esm/components/Loyalty/LoyaltyProductCatalog.d.ts +69 -69
- package/dist/esm/components/Loyalty/LoyaltyProfile.d.ts +6 -6
- package/dist/esm/components/Loyalty/LoyaltyWidget.d.ts +6 -6
- package/dist/esm/components/Loyalty/OTPComponent.d.ts +20 -20
- package/dist/esm/components/Loyalty/PointEarnBadge.d.ts +17 -17
- package/dist/esm/components/Loyalty/PointRedeemBadge.d.ts +17 -17
- package/dist/esm/components/Loyalty/RecentTransactions.d.ts +8 -8
- package/dist/esm/components/Loyalty/RewardsModal.d.ts +13 -13
- package/dist/esm/components/Loyalty/RibbonLauncher.d.ts +12 -12
- package/dist/esm/components/Loyalty/StickyLauncher.d.ts +14 -14
- package/dist/esm/components/Loyalty/StickyTextLauncher.d.ts +2 -2
- package/dist/esm/components/Loyalty/Toast.d.ts +7 -7
- package/dist/esm/components/Loyalty/VIPTiersScreen.d.ts +11 -11
- package/dist/esm/components/Loyalty/WTRCoupon.d.ts +13 -13
- package/dist/esm/components/Loyalty/WaysToEarn.d.ts +34 -34
- package/dist/esm/components/Loyalty/WaysToRedeem.d.ts +111 -109
- package/dist/esm/components/Loyalty/index.d.ts +16 -16
- package/dist/esm/components/Loyalty/loyaltyLauncher.d.ts +19 -19
- package/dist/esm/components/Loyalty/styles/AccountBlock.styles.d.ts +27 -27
- package/dist/esm/components/Loyalty/styles/ActiveSession.styles.d.ts +3 -3
- package/dist/esm/components/Loyalty/styles/DobPopup.styles.d.ts +3 -3
- package/dist/esm/components/Loyalty/styles/PointEarnBadge.styles.d.ts +3 -3
- package/dist/esm/components/Loyalty/styles/PointRedeemBadge.styles.d.ts +3 -3
- package/dist/esm/components/Loyalty/styles/RecentTransactions.styles.d.ts +6 -6
- package/dist/esm/components/Loyalty/styles/VIPTiers.styles.d.ts +4 -4
- package/dist/esm/components/Loyalty/styles/WaysToRedeem.styles.d.ts +5 -5
- package/dist/esm/components/Loyalty/styles/shared.styles.d.ts +3 -3
- package/dist/esm/components/Loyalty/styles.d.ts +23 -23
- package/dist/esm/components/Loyalty/types.d.ts +418 -416
- package/dist/esm/components/LoyaltyPageBlock/LoyaltyPageBlock.d.ts +235 -235
- package/dist/esm/components/Nudge/LeadGenerationNudge.d.ts +15 -15
- package/dist/esm/components/Nudge/Nudge.d.ts +40 -40
- package/dist/esm/components/Nudge/index.d.ts +1 -1
- package/dist/esm/components/ProductOffersBlock/ProductOffersCoupon.d.ts +12 -12
- package/dist/esm/components/ProductOffersBlock/ProductOffersList.d.ts +12 -12
- package/dist/esm/components/ProductOffersBlock/ProductOffersTermsMobilePopover.d.ts +10 -10
- package/dist/esm/components/ProductOffersBlock/ProductOffersTermsPopup.d.ts +10 -10
- package/dist/esm/components/ProductOffersBlock/ProductsOffers.d.ts +42 -42
- package/dist/esm/components/SpinnerWheel/SpinnerWheel.d.ts +23 -23
- package/dist/esm/components/SpinnerWheel/WheelSection.d.ts +9 -9
- package/dist/esm/components/SpinnerWheel/index.d.ts +1 -1
- package/dist/esm/components/index.d.ts +20 -20
- package/dist/esm/index.d.ts +3 -3
- package/dist/esm/index.js +84 -84
- package/dist/esm/utils/converter.d.ts +4 -4
- package/dist/esm/utils/customCartConfig.d.ts +2 -2
- package/dist/esm/utils/customHtmlInteractions.d.ts +9 -9
- package/dist/esm/utils/customVariantOptions.d.ts +30 -30
- package/dist/esm/utils/freebieProductUtils.d.ts +40 -40
- package/dist/esm/utils/freebieUtils.d.ts +12 -12
- package/dist/esm/utils/index.d.ts +36 -36
- package/dist/esm/utils/safeguardDOM.d.ts +5 -5
- package/dist/esm/utils/shopifyAtcBridge.d.ts +43 -43
- package/dist/esm/utils/useMediaQuery.d.ts +1 -1
- package/dist/esm/utils/variantAvailability.d.ts +53 -53
- package/package.json +98 -98
- /package/dist/esm/{confetti-f3502561.js → confetti-89678a6f.js} +0 -0
|
@@ -1,290 +1,290 @@
|
|
|
1
|
-
import type React from "react";
|
|
2
|
-
import type { RecentTransactionsData } from "./types";
|
|
3
|
-
import type { LoyaltyWaysToRedeemConfig } from "../LoyaltyPageBlock/LoyaltyPageBlock";
|
|
4
|
-
export type AccountTabId = "profile" | "orders" | "rewards" | "addresses";
|
|
5
|
-
export type AccountRewardsSectionId = "rewards" | "referrals" | "waysToEarn" | "waysToRedeem" | "customHtml" | "activity";
|
|
6
|
-
export interface AccountCustomHtmlConfig {
|
|
7
|
-
visibility?: "show" | "hide";
|
|
8
|
-
htmlText?: string;
|
|
9
|
-
}
|
|
10
|
-
/** Matches the `status` query enum on the orders endpoint. */
|
|
11
|
-
export type AccountOrderStatusFilter = "all" | "inTransit" | "delivered" | "cancelled";
|
|
12
|
-
export type AccountOrderCounts = Partial<Record<AccountOrderStatusFilter, number>>;
|
|
13
|
-
/** Legacy chip values on the address form; hosts may send any free-text label. */
|
|
14
|
-
export type AccountAddressType = "Work" | "Home" | "Other";
|
|
15
|
-
/** A `<select>` option where the stored value differs from the label. */
|
|
16
|
-
export interface AccountOption {
|
|
17
|
-
label: string;
|
|
18
|
-
value: string;
|
|
19
|
-
}
|
|
20
|
-
export interface AccountUser {
|
|
21
|
-
firstName?: string | null;
|
|
22
|
-
lastName?: string | null;
|
|
23
|
-
email?: string | null;
|
|
24
|
-
/** E.164, e.g. `phone.e164PhoneNumber`. Null/empty renders the add-phone state. */
|
|
25
|
-
phoneNumber?: string | null;
|
|
26
|
-
/** ISO date or `yyyy-mm-dd` (the API's `birthDate`). */
|
|
27
|
-
dateOfBirth?: string | null;
|
|
28
|
-
/** Matched against `genderOptions` case-insensitively, so `"male"` works. */
|
|
29
|
-
gender?: string | null;
|
|
30
|
-
/** Green "Verified" tag beside the field label. */
|
|
31
|
-
emailVerified?: boolean;
|
|
32
|
-
/** Drive from `phone.isVerified` only — never from the number existing. */
|
|
33
|
-
phoneVerified?: boolean;
|
|
34
|
-
/** Signed URL, e.g. `photo.path`. */
|
|
35
|
-
avatarUrl?: string | null;
|
|
36
|
-
/** Sidebar name when it differs from first + last. */
|
|
37
|
-
displayName?: string | null;
|
|
38
|
-
}
|
|
39
|
-
/** One row of the "Notifications & consent" section. */
|
|
40
|
-
export interface AccountNotificationPreference {
|
|
41
|
-
id: string;
|
|
42
|
-
title: string;
|
|
43
|
-
description?: string;
|
|
44
|
-
enabled?: boolean;
|
|
45
|
-
}
|
|
46
|
-
export interface AccountOrderLineItem {
|
|
47
|
-
id?: string | number;
|
|
48
|
-
title?: string;
|
|
49
|
-
/** Grey line under the title (the API's `description`). */
|
|
50
|
-
subtitle?: string;
|
|
51
|
-
variantTitle?: string;
|
|
52
|
-
sku?: string;
|
|
53
|
-
/** Per-unit price, rendered as "($24.00 each)". Null renders an em dash. */
|
|
54
|
-
unitPrice?: string | number | null;
|
|
55
|
-
/** Row total. Falls back to `unitPrice x quantity` when absent. */
|
|
56
|
-
lineTotal?: string | number | null;
|
|
57
|
-
/** @deprecated use `unitPrice` / `lineTotal` */
|
|
58
|
-
price?: string | number | null;
|
|
59
|
-
quantity?: number | null;
|
|
60
|
-
currency?: string;
|
|
61
|
-
image?: string | null;
|
|
62
|
-
productId?: string | number;
|
|
63
|
-
/** Needed by the host for Buy Again / Reorder. */
|
|
64
|
-
variantId?: string | number;
|
|
65
|
-
productUrl?: string;
|
|
66
|
-
/** Not served by the API today — the chip hides when absent. */
|
|
67
|
-
pointsEarned?: number | string;
|
|
68
|
-
/** @deprecated use `pointsEarned` */
|
|
69
|
-
coinsEarned?: number | string;
|
|
70
|
-
}
|
|
71
|
-
export interface AccountOrder {
|
|
72
|
-
id?: string | number;
|
|
73
|
-
/** Shopify GID, passed back to the host for invoice/reorder actions. */
|
|
74
|
-
orderGid?: string;
|
|
75
|
-
/** Rendered verbatim as the card title, e.g. "ORDER-6349856". */
|
|
76
|
-
name?: string;
|
|
77
|
-
/** The API's `placedAt`. */
|
|
78
|
-
createdAt?: string;
|
|
79
|
-
statusUrl?: string;
|
|
80
|
-
/** ISO code ("USD") or a symbol ("$") — both render correctly. */
|
|
81
|
-
currency?: string;
|
|
82
|
-
totalPrice?: string | number | null;
|
|
83
|
-
subtotal?: string | number | null;
|
|
84
|
-
refundedAmount?: string | number | null;
|
|
85
|
-
netAmount?: string | number | null;
|
|
86
|
-
isFullyRefunded?: boolean;
|
|
87
|
-
/** Preferred over summing line-item quantities. */
|
|
88
|
-
itemCount?: number;
|
|
89
|
-
/** Order-level points, shown under the total as "+300 … earned". */
|
|
90
|
-
pointsEarned?: number | string;
|
|
91
|
-
pointsSpent?: number | string;
|
|
92
|
-
paymentMethod?: string;
|
|
93
|
-
/** Footer line, e.g. "Standard Delivery". */
|
|
94
|
-
shippingMethod?: string;
|
|
95
|
-
/** @deprecated use `shippingMethod` */
|
|
96
|
-
deliveryNote?: string;
|
|
97
|
-
/** Explicit badge text; otherwise derived from the three fields below. */
|
|
98
|
-
status?: string;
|
|
99
|
-
cancelledAt?: string | null;
|
|
100
|
-
isDelivered?: boolean;
|
|
101
|
-
fulfillmentStatus?: string | null;
|
|
102
|
-
financialStatus?: string | null;
|
|
103
|
-
shippingCity?: string;
|
|
104
|
-
shippingProvince?: string;
|
|
105
|
-
shippingZip?: string;
|
|
106
|
-
shippingCountry?: string;
|
|
107
|
-
lineItems?: AccountOrderLineItem[];
|
|
108
|
-
}
|
|
109
|
-
export interface AccountAddress {
|
|
110
|
-
/** Full GID or numeric id — whatever the host wants echoed back. */
|
|
111
|
-
id?: string;
|
|
112
|
-
isDefault?: boolean;
|
|
113
|
-
firstName?: string;
|
|
114
|
-
lastName?: string;
|
|
115
|
-
company?: string | null;
|
|
116
|
-
address1?: string;
|
|
117
|
-
address2?: string;
|
|
118
|
-
city?: string;
|
|
119
|
-
/** Display name, e.g. "Karnataka". */
|
|
120
|
-
province?: string;
|
|
121
|
-
/** Written back on save, e.g. "KA". */
|
|
122
|
-
provinceCode?: string;
|
|
123
|
-
/** Display name, e.g. "India". */
|
|
124
|
-
country?: string;
|
|
125
|
-
countryCode?: string;
|
|
126
|
-
zip?: string;
|
|
127
|
-
phone?: string;
|
|
128
|
-
/** Free-text chip label from the API, e.g. "home" / "office". */
|
|
129
|
-
addressType?: string;
|
|
130
|
-
/** @deprecated use `addressType` */
|
|
131
|
-
label?: string;
|
|
132
|
-
/** @deprecated use `addressType` */
|
|
133
|
-
type?: AccountAddressType;
|
|
134
|
-
/** Green "VERIFIED" chip — drive from the user's `phone.isVerified`. */
|
|
135
|
-
phoneVerified?: boolean;
|
|
136
|
-
}
|
|
137
|
-
/** Mirrors the create/update address body. */
|
|
138
|
-
export interface AccountAddressPayload {
|
|
139
|
-
firstName: string;
|
|
140
|
-
lastName: string;
|
|
141
|
-
company?: string;
|
|
142
|
-
address1: string;
|
|
143
|
-
address2?: string;
|
|
144
|
-
city: string;
|
|
145
|
-
/** Display name, for hosts that keep both. */
|
|
146
|
-
province?: string;
|
|
147
|
-
provinceCode?: string;
|
|
148
|
-
country?: string;
|
|
149
|
-
countryCode?: string;
|
|
150
|
-
zip?: string;
|
|
151
|
-
phone?: string;
|
|
152
|
-
addressType?: string;
|
|
153
|
-
setAsDefault?: boolean;
|
|
154
|
-
}
|
|
155
|
-
export interface AccountProfilePayload {
|
|
156
|
-
firstName: string;
|
|
157
|
-
lastName: string;
|
|
158
|
-
email: string;
|
|
159
|
-
/** E.164 — maps to the API's `phoneNumber`. */
|
|
160
|
-
phoneNumber: string;
|
|
161
|
-
/** `yyyy-mm-dd` — maps to the API's `birthDate`. */
|
|
162
|
-
dateOfBirth?: string;
|
|
163
|
-
gender?: string;
|
|
164
|
-
/** Keyed by preference id; consent saves through its own endpoint. */
|
|
165
|
-
notifications?: Record<string, boolean>;
|
|
166
|
-
/** Only the keys the customer actually edited. */
|
|
167
|
-
changed?: Array<keyof AccountProfilePayload>;
|
|
168
|
-
}
|
|
169
|
-
/** A labelled button anywhere in the rewards pane. */
|
|
170
|
-
export interface AccountRewardsAction {
|
|
171
|
-
label: string;
|
|
172
|
-
onClick?: () => void;
|
|
173
|
-
href?: string;
|
|
174
|
-
icon?: React.ReactNode;
|
|
175
|
-
/** Icon sits before the label unless this is "end". */
|
|
176
|
-
iconPosition?: "start" | "end";
|
|
177
|
-
}
|
|
178
|
-
export interface AccountRewardsTier {
|
|
179
|
-
/** Pill beside "Active Tier :", e.g. "GOLD MEMBER". */
|
|
180
|
-
name?: string;
|
|
181
|
-
/** Left of the progress bar, e.g. "Gold (Current)". */
|
|
182
|
-
currentLabel?: string;
|
|
183
|
-
/** Right of the progress bar, e.g. "Platinum (2,000 pts)". */
|
|
184
|
-
nextLabel?: string;
|
|
185
|
-
/** Drives the bar; falls back to `currentPoints / targetPoints`. */
|
|
186
|
-
progress?: number;
|
|
187
|
-
currentPoints?: number;
|
|
188
|
-
targetPoints?: number;
|
|
189
|
-
lockedInLabel?: string;
|
|
190
|
-
remainingLabel?: string;
|
|
191
|
-
/** Muted note top-right of the card, e.g. "Reset in 12 months". */
|
|
192
|
-
resetLabel?: string;
|
|
193
|
-
perksLabel?: string;
|
|
194
|
-
onPerksClick?: () => void;
|
|
195
|
-
}
|
|
196
|
-
export interface AccountReferralStat {
|
|
197
|
-
id: string;
|
|
198
|
-
value: number | string;
|
|
199
|
-
label: string;
|
|
200
|
-
icon?: React.ReactNode;
|
|
201
|
-
/** Image URL, e.g. the brand's coin art; takes precedence over the glyph. */
|
|
202
|
-
iconUrl?: string;
|
|
203
|
-
}
|
|
204
|
-
export interface AccountReferralShare {
|
|
205
|
-
id: string;
|
|
206
|
-
label: string;
|
|
207
|
-
href?: string;
|
|
208
|
-
onClick?: () => void;
|
|
209
|
-
icon?: React.ReactNode;
|
|
210
|
-
}
|
|
211
|
-
export interface AccountReferralConfig {
|
|
212
|
-
title?: string;
|
|
213
|
-
/** String or rich node — the design bolds the reward amounts. */
|
|
214
|
-
description?: React.ReactNode;
|
|
215
|
-
link?: string;
|
|
216
|
-
copyLabel?: string;
|
|
217
|
-
onCopyLink?: (link: string) => void;
|
|
218
|
-
shareLabel?: string;
|
|
219
|
-
shares?: AccountReferralShare[];
|
|
220
|
-
performanceTitle?: string;
|
|
221
|
-
/** Chip top-right of the performance card, e.g. "Tier Booster". */
|
|
222
|
-
badgeLabel?: string;
|
|
223
|
-
stats?: AccountReferralStat[];
|
|
224
|
-
note?: React.ReactNode;
|
|
225
|
-
}
|
|
226
|
-
/** One tile under "Ways to Accumulate Points". */
|
|
227
|
-
export interface AccountEarnAction {
|
|
228
|
-
id: string;
|
|
229
|
-
title: string;
|
|
230
|
-
description?: string;
|
|
231
|
-
/** Chip text; a number is rendered as "+N pts". */
|
|
232
|
-
points?: number | string;
|
|
233
|
-
ctaLabel?: string;
|
|
234
|
-
completed?: boolean;
|
|
235
|
-
completedLabel?: string;
|
|
236
|
-
/**
|
|
237
|
-
* Birthday actions receive the selected date after confirmation.
|
|
238
|
-
* Return false to keep the picker open and show its fallback error toast.
|
|
239
|
-
*/
|
|
240
|
-
onClick?: (birthday?: string) => void | boolean | Promise<void | boolean>;
|
|
241
|
-
href?: string;
|
|
242
|
-
}
|
|
243
|
-
export type AccountActivityKind = "earned" | "redeemed" | "expired";
|
|
244
|
-
export interface AccountActivityItem {
|
|
245
|
-
id: string;
|
|
246
|
-
title: string;
|
|
247
|
-
/** Pre-formatted, e.g. "04 Aug 2025". */
|
|
248
|
-
date?: string;
|
|
249
|
-
kind?: AccountActivityKind;
|
|
250
|
-
/** Signed points; a number is rendered with its sign and "pts". */
|
|
251
|
-
points?: number | string;
|
|
252
|
-
/** Sub-line under the points, e.g. "+$3.00 credit". */
|
|
253
|
-
note?: string;
|
|
254
|
-
/** Chip beside the row, e.g. "Completed" / "Bonus" / "Applied". */
|
|
255
|
-
statusLabel?: string;
|
|
256
|
-
icon?: React.ReactNode;
|
|
257
|
-
}
|
|
258
|
-
export interface AccountRewardsConfig {
|
|
259
|
-
/** Legacy transactions payload; used for the activity list when `activity` is absent. */
|
|
260
|
-
data?: RecentTransactionsData;
|
|
261
|
-
/** Headline balance (the API's `pointsBalance`), also used in the sidebar. */
|
|
262
|
-
balance?: number | string;
|
|
263
|
-
/** Word beside the balance, e.g. "Trust Points". */
|
|
264
|
-
pointsLabel?: string;
|
|
265
|
-
/** Overrides the generated credit line entirely. */
|
|
266
|
-
balanceNote?: string;
|
|
267
|
-
/** Store-credit value of the balance; rendered with `currencySymbol`. */
|
|
268
|
-
creditValue?: number;
|
|
269
|
-
/** Trailing words of the generated line. */
|
|
270
|
-
creditLabel?: string;
|
|
271
|
-
tokenName?: string;
|
|
272
|
-
currencySymbol?: string;
|
|
273
|
-
/** Brand coin artwork, used for the points stat in the referral card. */
|
|
274
|
-
coinIcon?: string;
|
|
275
|
-
tier?: AccountRewardsTier;
|
|
276
|
-
primaryAction?: AccountRewardsAction;
|
|
277
|
-
secondaryAction?: AccountRewardsAction;
|
|
278
|
-
referral?: AccountReferralConfig;
|
|
279
|
-
earnTitle?: string;
|
|
280
|
-
earnActions?: AccountEarnAction[];
|
|
281
|
-
/** Uses the same cards and action contract as LoyaltyPageBlock. */
|
|
282
|
-
waysToRedeem?: LoyaltyWaysToRedeemConfig;
|
|
283
|
-
activityTitle?: string;
|
|
284
|
-
activity?: AccountActivityItem[];
|
|
285
|
-
}
|
|
286
|
-
export interface AccountTheme {
|
|
287
|
-
color: string;
|
|
288
|
-
textColor: string;
|
|
289
|
-
tint: string;
|
|
290
|
-
}
|
|
1
|
+
import type React from "react";
|
|
2
|
+
import type { RecentTransactionsData } from "./types";
|
|
3
|
+
import type { LoyaltyWaysToRedeemConfig } from "../LoyaltyPageBlock/LoyaltyPageBlock";
|
|
4
|
+
export type AccountTabId = "profile" | "orders" | "rewards" | "addresses";
|
|
5
|
+
export type AccountRewardsSectionId = "rewards" | "referrals" | "waysToEarn" | "waysToRedeem" | "customHtml" | "activity";
|
|
6
|
+
export interface AccountCustomHtmlConfig {
|
|
7
|
+
visibility?: "show" | "hide";
|
|
8
|
+
htmlText?: string;
|
|
9
|
+
}
|
|
10
|
+
/** Matches the `status` query enum on the orders endpoint. */
|
|
11
|
+
export type AccountOrderStatusFilter = "all" | "inTransit" | "delivered" | "cancelled";
|
|
12
|
+
export type AccountOrderCounts = Partial<Record<AccountOrderStatusFilter, number>>;
|
|
13
|
+
/** Legacy chip values on the address form; hosts may send any free-text label. */
|
|
14
|
+
export type AccountAddressType = "Work" | "Home" | "Other";
|
|
15
|
+
/** A `<select>` option where the stored value differs from the label. */
|
|
16
|
+
export interface AccountOption {
|
|
17
|
+
label: string;
|
|
18
|
+
value: string;
|
|
19
|
+
}
|
|
20
|
+
export interface AccountUser {
|
|
21
|
+
firstName?: string | null;
|
|
22
|
+
lastName?: string | null;
|
|
23
|
+
email?: string | null;
|
|
24
|
+
/** E.164, e.g. `phone.e164PhoneNumber`. Null/empty renders the add-phone state. */
|
|
25
|
+
phoneNumber?: string | null;
|
|
26
|
+
/** ISO date or `yyyy-mm-dd` (the API's `birthDate`). */
|
|
27
|
+
dateOfBirth?: string | null;
|
|
28
|
+
/** Matched against `genderOptions` case-insensitively, so `"male"` works. */
|
|
29
|
+
gender?: string | null;
|
|
30
|
+
/** Green "Verified" tag beside the field label. */
|
|
31
|
+
emailVerified?: boolean;
|
|
32
|
+
/** Drive from `phone.isVerified` only — never from the number existing. */
|
|
33
|
+
phoneVerified?: boolean;
|
|
34
|
+
/** Signed URL, e.g. `photo.path`. */
|
|
35
|
+
avatarUrl?: string | null;
|
|
36
|
+
/** Sidebar name when it differs from first + last. */
|
|
37
|
+
displayName?: string | null;
|
|
38
|
+
}
|
|
39
|
+
/** One row of the "Notifications & consent" section. */
|
|
40
|
+
export interface AccountNotificationPreference {
|
|
41
|
+
id: string;
|
|
42
|
+
title: string;
|
|
43
|
+
description?: string;
|
|
44
|
+
enabled?: boolean;
|
|
45
|
+
}
|
|
46
|
+
export interface AccountOrderLineItem {
|
|
47
|
+
id?: string | number;
|
|
48
|
+
title?: string;
|
|
49
|
+
/** Grey line under the title (the API's `description`). */
|
|
50
|
+
subtitle?: string;
|
|
51
|
+
variantTitle?: string;
|
|
52
|
+
sku?: string;
|
|
53
|
+
/** Per-unit price, rendered as "($24.00 each)". Null renders an em dash. */
|
|
54
|
+
unitPrice?: string | number | null;
|
|
55
|
+
/** Row total. Falls back to `unitPrice x quantity` when absent. */
|
|
56
|
+
lineTotal?: string | number | null;
|
|
57
|
+
/** @deprecated use `unitPrice` / `lineTotal` */
|
|
58
|
+
price?: string | number | null;
|
|
59
|
+
quantity?: number | null;
|
|
60
|
+
currency?: string;
|
|
61
|
+
image?: string | null;
|
|
62
|
+
productId?: string | number;
|
|
63
|
+
/** Needed by the host for Buy Again / Reorder. */
|
|
64
|
+
variantId?: string | number;
|
|
65
|
+
productUrl?: string;
|
|
66
|
+
/** Not served by the API today — the chip hides when absent. */
|
|
67
|
+
pointsEarned?: number | string;
|
|
68
|
+
/** @deprecated use `pointsEarned` */
|
|
69
|
+
coinsEarned?: number | string;
|
|
70
|
+
}
|
|
71
|
+
export interface AccountOrder {
|
|
72
|
+
id?: string | number;
|
|
73
|
+
/** Shopify GID, passed back to the host for invoice/reorder actions. */
|
|
74
|
+
orderGid?: string;
|
|
75
|
+
/** Rendered verbatim as the card title, e.g. "ORDER-6349856". */
|
|
76
|
+
name?: string;
|
|
77
|
+
/** The API's `placedAt`. */
|
|
78
|
+
createdAt?: string;
|
|
79
|
+
statusUrl?: string;
|
|
80
|
+
/** ISO code ("USD") or a symbol ("$") — both render correctly. */
|
|
81
|
+
currency?: string;
|
|
82
|
+
totalPrice?: string | number | null;
|
|
83
|
+
subtotal?: string | number | null;
|
|
84
|
+
refundedAmount?: string | number | null;
|
|
85
|
+
netAmount?: string | number | null;
|
|
86
|
+
isFullyRefunded?: boolean;
|
|
87
|
+
/** Preferred over summing line-item quantities. */
|
|
88
|
+
itemCount?: number;
|
|
89
|
+
/** Order-level points, shown under the total as "+300 … earned". */
|
|
90
|
+
pointsEarned?: number | string;
|
|
91
|
+
pointsSpent?: number | string;
|
|
92
|
+
paymentMethod?: string;
|
|
93
|
+
/** Footer line, e.g. "Standard Delivery". */
|
|
94
|
+
shippingMethod?: string;
|
|
95
|
+
/** @deprecated use `shippingMethod` */
|
|
96
|
+
deliveryNote?: string;
|
|
97
|
+
/** Explicit badge text; otherwise derived from the three fields below. */
|
|
98
|
+
status?: string;
|
|
99
|
+
cancelledAt?: string | null;
|
|
100
|
+
isDelivered?: boolean;
|
|
101
|
+
fulfillmentStatus?: string | null;
|
|
102
|
+
financialStatus?: string | null;
|
|
103
|
+
shippingCity?: string;
|
|
104
|
+
shippingProvince?: string;
|
|
105
|
+
shippingZip?: string;
|
|
106
|
+
shippingCountry?: string;
|
|
107
|
+
lineItems?: AccountOrderLineItem[];
|
|
108
|
+
}
|
|
109
|
+
export interface AccountAddress {
|
|
110
|
+
/** Full GID or numeric id — whatever the host wants echoed back. */
|
|
111
|
+
id?: string;
|
|
112
|
+
isDefault?: boolean;
|
|
113
|
+
firstName?: string;
|
|
114
|
+
lastName?: string;
|
|
115
|
+
company?: string | null;
|
|
116
|
+
address1?: string;
|
|
117
|
+
address2?: string;
|
|
118
|
+
city?: string;
|
|
119
|
+
/** Display name, e.g. "Karnataka". */
|
|
120
|
+
province?: string;
|
|
121
|
+
/** Written back on save, e.g. "KA". */
|
|
122
|
+
provinceCode?: string;
|
|
123
|
+
/** Display name, e.g. "India". */
|
|
124
|
+
country?: string;
|
|
125
|
+
countryCode?: string;
|
|
126
|
+
zip?: string;
|
|
127
|
+
phone?: string;
|
|
128
|
+
/** Free-text chip label from the API, e.g. "home" / "office". */
|
|
129
|
+
addressType?: string;
|
|
130
|
+
/** @deprecated use `addressType` */
|
|
131
|
+
label?: string;
|
|
132
|
+
/** @deprecated use `addressType` */
|
|
133
|
+
type?: AccountAddressType;
|
|
134
|
+
/** Green "VERIFIED" chip — drive from the user's `phone.isVerified`. */
|
|
135
|
+
phoneVerified?: boolean;
|
|
136
|
+
}
|
|
137
|
+
/** Mirrors the create/update address body. */
|
|
138
|
+
export interface AccountAddressPayload {
|
|
139
|
+
firstName: string;
|
|
140
|
+
lastName: string;
|
|
141
|
+
company?: string;
|
|
142
|
+
address1: string;
|
|
143
|
+
address2?: string;
|
|
144
|
+
city: string;
|
|
145
|
+
/** Display name, for hosts that keep both. */
|
|
146
|
+
province?: string;
|
|
147
|
+
provinceCode?: string;
|
|
148
|
+
country?: string;
|
|
149
|
+
countryCode?: string;
|
|
150
|
+
zip?: string;
|
|
151
|
+
phone?: string;
|
|
152
|
+
addressType?: string;
|
|
153
|
+
setAsDefault?: boolean;
|
|
154
|
+
}
|
|
155
|
+
export interface AccountProfilePayload {
|
|
156
|
+
firstName: string;
|
|
157
|
+
lastName: string;
|
|
158
|
+
email: string;
|
|
159
|
+
/** E.164 — maps to the API's `phoneNumber`. */
|
|
160
|
+
phoneNumber: string;
|
|
161
|
+
/** `yyyy-mm-dd` — maps to the API's `birthDate`. */
|
|
162
|
+
dateOfBirth?: string;
|
|
163
|
+
gender?: string;
|
|
164
|
+
/** Keyed by preference id; consent saves through its own endpoint. */
|
|
165
|
+
notifications?: Record<string, boolean>;
|
|
166
|
+
/** Only the keys the customer actually edited. */
|
|
167
|
+
changed?: Array<keyof AccountProfilePayload>;
|
|
168
|
+
}
|
|
169
|
+
/** A labelled button anywhere in the rewards pane. */
|
|
170
|
+
export interface AccountRewardsAction {
|
|
171
|
+
label: string;
|
|
172
|
+
onClick?: () => void;
|
|
173
|
+
href?: string;
|
|
174
|
+
icon?: React.ReactNode;
|
|
175
|
+
/** Icon sits before the label unless this is "end". */
|
|
176
|
+
iconPosition?: "start" | "end";
|
|
177
|
+
}
|
|
178
|
+
export interface AccountRewardsTier {
|
|
179
|
+
/** Pill beside "Active Tier :", e.g. "GOLD MEMBER". */
|
|
180
|
+
name?: string;
|
|
181
|
+
/** Left of the progress bar, e.g. "Gold (Current)". */
|
|
182
|
+
currentLabel?: string;
|
|
183
|
+
/** Right of the progress bar, e.g. "Platinum (2,000 pts)". */
|
|
184
|
+
nextLabel?: string;
|
|
185
|
+
/** Drives the bar; falls back to `currentPoints / targetPoints`. */
|
|
186
|
+
progress?: number;
|
|
187
|
+
currentPoints?: number;
|
|
188
|
+
targetPoints?: number;
|
|
189
|
+
lockedInLabel?: string;
|
|
190
|
+
remainingLabel?: string;
|
|
191
|
+
/** Muted note top-right of the card, e.g. "Reset in 12 months". */
|
|
192
|
+
resetLabel?: string;
|
|
193
|
+
perksLabel?: string;
|
|
194
|
+
onPerksClick?: () => void;
|
|
195
|
+
}
|
|
196
|
+
export interface AccountReferralStat {
|
|
197
|
+
id: string;
|
|
198
|
+
value: number | string;
|
|
199
|
+
label: string;
|
|
200
|
+
icon?: React.ReactNode;
|
|
201
|
+
/** Image URL, e.g. the brand's coin art; takes precedence over the glyph. */
|
|
202
|
+
iconUrl?: string;
|
|
203
|
+
}
|
|
204
|
+
export interface AccountReferralShare {
|
|
205
|
+
id: string;
|
|
206
|
+
label: string;
|
|
207
|
+
href?: string;
|
|
208
|
+
onClick?: () => void;
|
|
209
|
+
icon?: React.ReactNode;
|
|
210
|
+
}
|
|
211
|
+
export interface AccountReferralConfig {
|
|
212
|
+
title?: string;
|
|
213
|
+
/** String or rich node — the design bolds the reward amounts. */
|
|
214
|
+
description?: React.ReactNode;
|
|
215
|
+
link?: string;
|
|
216
|
+
copyLabel?: string;
|
|
217
|
+
onCopyLink?: (link: string) => void;
|
|
218
|
+
shareLabel?: string;
|
|
219
|
+
shares?: AccountReferralShare[];
|
|
220
|
+
performanceTitle?: string;
|
|
221
|
+
/** Chip top-right of the performance card, e.g. "Tier Booster". */
|
|
222
|
+
badgeLabel?: string;
|
|
223
|
+
stats?: AccountReferralStat[];
|
|
224
|
+
note?: React.ReactNode;
|
|
225
|
+
}
|
|
226
|
+
/** One tile under "Ways to Accumulate Points". */
|
|
227
|
+
export interface AccountEarnAction {
|
|
228
|
+
id: string;
|
|
229
|
+
title: string;
|
|
230
|
+
description?: string;
|
|
231
|
+
/** Chip text; a number is rendered as "+N pts". */
|
|
232
|
+
points?: number | string;
|
|
233
|
+
ctaLabel?: string;
|
|
234
|
+
completed?: boolean;
|
|
235
|
+
completedLabel?: string;
|
|
236
|
+
/**
|
|
237
|
+
* Birthday actions receive the selected date after confirmation.
|
|
238
|
+
* Return false to keep the picker open and show its fallback error toast.
|
|
239
|
+
*/
|
|
240
|
+
onClick?: (birthday?: string) => void | boolean | Promise<void | boolean>;
|
|
241
|
+
href?: string;
|
|
242
|
+
}
|
|
243
|
+
export type AccountActivityKind = "earned" | "redeemed" | "expired";
|
|
244
|
+
export interface AccountActivityItem {
|
|
245
|
+
id: string;
|
|
246
|
+
title: string;
|
|
247
|
+
/** Pre-formatted, e.g. "04 Aug 2025". */
|
|
248
|
+
date?: string;
|
|
249
|
+
kind?: AccountActivityKind;
|
|
250
|
+
/** Signed points; a number is rendered with its sign and "pts". */
|
|
251
|
+
points?: number | string;
|
|
252
|
+
/** Sub-line under the points, e.g. "+$3.00 credit". */
|
|
253
|
+
note?: string;
|
|
254
|
+
/** Chip beside the row, e.g. "Completed" / "Bonus" / "Applied". */
|
|
255
|
+
statusLabel?: string;
|
|
256
|
+
icon?: React.ReactNode;
|
|
257
|
+
}
|
|
258
|
+
export interface AccountRewardsConfig {
|
|
259
|
+
/** Legacy transactions payload; used for the activity list when `activity` is absent. */
|
|
260
|
+
data?: RecentTransactionsData;
|
|
261
|
+
/** Headline balance (the API's `pointsBalance`), also used in the sidebar. */
|
|
262
|
+
balance?: number | string;
|
|
263
|
+
/** Word beside the balance, e.g. "Trust Points". */
|
|
264
|
+
pointsLabel?: string;
|
|
265
|
+
/** Overrides the generated credit line entirely. */
|
|
266
|
+
balanceNote?: string;
|
|
267
|
+
/** Store-credit value of the balance; rendered with `currencySymbol`. */
|
|
268
|
+
creditValue?: number;
|
|
269
|
+
/** Trailing words of the generated line. */
|
|
270
|
+
creditLabel?: string;
|
|
271
|
+
tokenName?: string;
|
|
272
|
+
currencySymbol?: string;
|
|
273
|
+
/** Brand coin artwork, used for the points stat in the referral card. */
|
|
274
|
+
coinIcon?: string;
|
|
275
|
+
tier?: AccountRewardsTier;
|
|
276
|
+
primaryAction?: AccountRewardsAction;
|
|
277
|
+
secondaryAction?: AccountRewardsAction;
|
|
278
|
+
referral?: AccountReferralConfig;
|
|
279
|
+
earnTitle?: string;
|
|
280
|
+
earnActions?: AccountEarnAction[];
|
|
281
|
+
/** Uses the same cards and action contract as LoyaltyPageBlock. */
|
|
282
|
+
waysToRedeem?: LoyaltyWaysToRedeemConfig;
|
|
283
|
+
activityTitle?: string;
|
|
284
|
+
activity?: AccountActivityItem[];
|
|
285
|
+
}
|
|
286
|
+
export interface AccountTheme {
|
|
287
|
+
color: string;
|
|
288
|
+
textColor: string;
|
|
289
|
+
tint: string;
|
|
290
|
+
}
|