yt-uikit 0.10.142-oos-bundle.0 → 0.10.142
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 +271 -271
- 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 +36 -36
- 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 +109 -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 +416 -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 +543 -543
- 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 +30 -30
- 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-89678a6f.js → confetti-f3502561.js} +0 -0
|
@@ -1,108 +1,108 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import "./AccountBlock.css";
|
|
3
|
-
import type { AccountLoginFormProps } from "./AccountLoginForm";
|
|
4
|
-
import type { AccountAddress, AccountAddressPayload, AccountCustomHtmlConfig, AccountNotificationPreference, AccountOption, AccountOrderCounts, AccountOrderStatusFilter, AccountOrder, AccountOrderLineItem, AccountProfilePayload, AccountRewardsConfig, AccountRewardsSectionId, AccountTabId, AccountUser } from "./AccountBlock.types";
|
|
5
|
-
export type { AccountLoginAuthType, AccountLoginFormProps, AccountLoginIdentity, } from "./AccountLoginForm";
|
|
6
|
-
export type { AccountAddress, AccountAddressPayload, AccountCustomHtmlConfig, AccountAddressType, AccountNotificationPreference, AccountOption, AccountOrderCounts, AccountOrderStatusFilter, AccountOrder, AccountOrderLineItem, AccountProfilePayload, AccountRewardsConfig, AccountRewardsSectionId, AccountTabId, AccountTheme, AccountUser, } from "./AccountBlock.types";
|
|
7
|
-
export interface AccountBlockProps {
|
|
8
|
-
/** false renders the login form in place of the account view. */
|
|
9
|
-
isLoggedIn?: boolean;
|
|
10
|
-
/** Login form configuration, used only when `isLoggedIn` is false. */
|
|
11
|
-
login?: AccountLoginFormProps;
|
|
12
|
-
user?: AccountUser | null;
|
|
13
|
-
/** Plain list, or the Shopify storefront `{ edges: [{ node }] }` connection. */
|
|
14
|
-
orders?: AccountOrder[] | any;
|
|
15
|
-
addresses?: AccountAddress[];
|
|
16
|
-
defaultAddressId?: string;
|
|
17
|
-
rewards?: AccountRewardsConfig;
|
|
18
|
-
/** Rows of the "Notifications & consent" section; omit to hide the section. */
|
|
19
|
-
notifications?: AccountNotificationPreference[];
|
|
20
|
-
/** Controlled tab. Leave unset to let the block own its own tab state. */
|
|
21
|
-
activeTab?: AccountTabId;
|
|
22
|
-
defaultTab?: AccountTabId;
|
|
23
|
-
onTabChange?: (tab: AccountTabId) => void;
|
|
24
|
-
/** Order and subset of tabs to render. */
|
|
25
|
-
visibleTabs?: AccountTabId[];
|
|
26
|
-
tabLabels?: Partial<Record<AccountTabId, string>>;
|
|
27
|
-
themeColor?: string;
|
|
28
|
-
themeTextColor?: string;
|
|
29
|
-
/** Sanitized merchant content rendered as an orderable section in Rewards. */
|
|
30
|
-
customHtml?: AccountCustomHtmlConfig;
|
|
31
|
-
/** Controls Rewards pane section order; omitted sections retain their defaults. */
|
|
32
|
-
sectionOrder?: AccountRewardsSectionId[];
|
|
33
|
-
customCss?: string;
|
|
34
|
-
enableCustomCss?: boolean;
|
|
35
|
-
currencySymbol?: string;
|
|
36
|
-
tokenName?: string;
|
|
37
|
-
/** Pane copy. */
|
|
38
|
-
profileTitle?: string;
|
|
39
|
-
profileSubtitle?: string;
|
|
40
|
-
ordersTitle?: string;
|
|
41
|
-
ordersSubtitle?: string;
|
|
42
|
-
addressesTitle?: string;
|
|
43
|
-
addressesSubtitle?: string;
|
|
44
|
-
securityNote?: string;
|
|
45
|
-
/** Plain strings, or `{ label, value }` when the stored value differs. */
|
|
46
|
-
genderOptions?: Array<string | AccountOption>;
|
|
47
|
-
isLoadingOrders?: boolean;
|
|
48
|
-
isLoadingAddresses?: boolean;
|
|
49
|
-
isSavingAddress?: boolean;
|
|
50
|
-
isSavingProfile?: boolean;
|
|
51
|
-
/** Open the profile form in edit mode instead of the locked view. */
|
|
52
|
-
defaultEditing?: boolean;
|
|
53
|
-
/** Force a layout instead of measuring the viewport (handy in stories/tests). */
|
|
54
|
-
isMobile?: boolean;
|
|
55
|
-
mobileBreakpoint?: number;
|
|
56
|
-
orderRangeOptions?: Array<{
|
|
57
|
-
label: string;
|
|
58
|
-
value: string;
|
|
59
|
-
}>;
|
|
60
|
-
orderRange?: string;
|
|
61
|
-
onOrderRangeChange?: (value: string) => void;
|
|
62
|
-
orderPageSize?: number;
|
|
63
|
-
maxVisibleOrderItems?: number;
|
|
64
|
-
/** Server-side order counts: chips, and the "of N" total in the footer. */
|
|
65
|
-
orderCounts?: AccountOrderCounts;
|
|
66
|
-
/** Sidebar badge; defaults to `orderCounts.all`, then the rows held. */
|
|
67
|
-
ordersCount?: number;
|
|
68
|
-
/** Controlled order tab / search / page — omit any to filter locally. */
|
|
69
|
-
orderStatusFilter?: AccountOrderStatusFilter;
|
|
70
|
-
onOrderStatusFilterChange?: (status: AccountOrderStatusFilter) => void;
|
|
71
|
-
orderSearchQuery?: string;
|
|
72
|
-
onOrderSearchChange?: (query: string) => void;
|
|
73
|
-
orderPage?: number;
|
|
74
|
-
onOrderPageChange?: (page: number) => void;
|
|
75
|
-
orderTotalPages?: number;
|
|
76
|
-
orderHasNextPage?: boolean;
|
|
77
|
-
/** Rewards activity paging; omit the controlled ones to page locally. */
|
|
78
|
-
activityPageSize?: number;
|
|
79
|
-
activityPage?: number;
|
|
80
|
-
onActivityPageChange?: (page: number) => void;
|
|
81
|
-
activityTotalPages?: number;
|
|
82
|
-
activityHasNextPage?: boolean;
|
|
83
|
-
activityCount?: number;
|
|
84
|
-
/** Address form pickers — supply these so writes carry ISO codes. */
|
|
85
|
-
countryOptions?: AccountOption[];
|
|
86
|
-
/** Starting country for the address phone field; changeable by the customer. */
|
|
87
|
-
defaultPhoneCountry?: string;
|
|
88
|
-
provinceOptions?: AccountOption[] | Record<string, AccountOption[]>;
|
|
89
|
-
addressTypeOptions?: string[];
|
|
90
|
-
onLogout?: () => void;
|
|
91
|
-
/** Return false to keep the form dirty (e.g. the save failed). */
|
|
92
|
-
onSaveProfile?: (payload: AccountProfilePayload) => void | boolean | Promise<void | boolean>;
|
|
93
|
-
/** Resolve with the state the server applied; the toggle repaints from it. */
|
|
94
|
-
onNotificationChange?: (id: string, enabled: boolean) => void | boolean | Promise<void | boolean>;
|
|
95
|
-
onSaveAddress?: (payload: AccountAddressPayload, addressId?: string) => void | boolean | Promise<void | boolean>;
|
|
96
|
-
onDeleteAddress?: (addressId: string) => void | Promise<void>;
|
|
97
|
-
onBuyAgain?: (item: AccountOrderLineItem, order: AccountOrder) => void;
|
|
98
|
-
onViewItem?: (item: AccountOrderLineItem, order: AccountOrder) => void;
|
|
99
|
-
onOrderAgain?: (order: AccountOrder) => void;
|
|
100
|
-
onCancelOrder?: (order: AccountOrder) => void;
|
|
101
|
-
onOrderSupport?: (order: AccountOrder) => void;
|
|
102
|
-
onViewDetails?: (order: AccountOrder) => void;
|
|
103
|
-
/** Renders "Email Invoice" — Shopify serves no downloadable invoice. */
|
|
104
|
-
onEmailInvoice?: (order: AccountOrder) => void;
|
|
105
|
-
className?: string;
|
|
106
|
-
style?: React.CSSProperties;
|
|
107
|
-
}
|
|
108
|
-
export default function AccountBlock({ isLoggedIn, login, user, orders, addresses, defaultAddressId, rewards, notifications, activeTab, defaultTab, onTabChange, visibleTabs, tabLabels, themeColor, themeTextColor, customHtml, sectionOrder, customCss, enableCustomCss, currencySymbol, tokenName, profileTitle, profileSubtitle, ordersTitle, ordersSubtitle, addressesTitle, addressesSubtitle, securityNote, genderOptions, isLoadingOrders, isLoadingAddresses, isSavingAddress, isSavingProfile, defaultEditing, isMobile, mobileBreakpoint, orderRangeOptions, orderRange, onOrderRangeChange, orderPageSize, maxVisibleOrderItems, orderCounts, ordersCount, orderStatusFilter, onOrderStatusFilterChange, orderSearchQuery, onOrderSearchChange, orderPage, onOrderPageChange, orderTotalPages, orderHasNextPage, activityPageSize, activityPage, onActivityPageChange, activityTotalPages, activityHasNextPage, activityCount, countryOptions, defaultPhoneCountry, provinceOptions, addressTypeOptions, onLogout, onSaveProfile, onNotificationChange, onSaveAddress, onDeleteAddress, onBuyAgain, onViewItem, onOrderAgain, onCancelOrder, onOrderSupport, onViewDetails, onEmailInvoice, className, style, }: AccountBlockProps): React.JSX.Element;
|
|
1
|
+
import React from "react";
|
|
2
|
+
import "./AccountBlock.css";
|
|
3
|
+
import type { AccountLoginFormProps } from "./AccountLoginForm";
|
|
4
|
+
import type { AccountAddress, AccountAddressPayload, AccountCustomHtmlConfig, AccountNotificationPreference, AccountOption, AccountOrderCounts, AccountOrderStatusFilter, AccountOrder, AccountOrderLineItem, AccountProfilePayload, AccountRewardsConfig, AccountRewardsSectionId, AccountTabId, AccountUser } from "./AccountBlock.types";
|
|
5
|
+
export type { AccountLoginAuthType, AccountLoginFormProps, AccountLoginIdentity, } from "./AccountLoginForm";
|
|
6
|
+
export type { AccountAddress, AccountAddressPayload, AccountCustomHtmlConfig, AccountAddressType, AccountNotificationPreference, AccountOption, AccountOrderCounts, AccountOrderStatusFilter, AccountOrder, AccountOrderLineItem, AccountProfilePayload, AccountRewardsConfig, AccountRewardsSectionId, AccountTabId, AccountTheme, AccountUser, } from "./AccountBlock.types";
|
|
7
|
+
export interface AccountBlockProps {
|
|
8
|
+
/** false renders the login form in place of the account view. */
|
|
9
|
+
isLoggedIn?: boolean;
|
|
10
|
+
/** Login form configuration, used only when `isLoggedIn` is false. */
|
|
11
|
+
login?: AccountLoginFormProps;
|
|
12
|
+
user?: AccountUser | null;
|
|
13
|
+
/** Plain list, or the Shopify storefront `{ edges: [{ node }] }` connection. */
|
|
14
|
+
orders?: AccountOrder[] | any;
|
|
15
|
+
addresses?: AccountAddress[];
|
|
16
|
+
defaultAddressId?: string;
|
|
17
|
+
rewards?: AccountRewardsConfig;
|
|
18
|
+
/** Rows of the "Notifications & consent" section; omit to hide the section. */
|
|
19
|
+
notifications?: AccountNotificationPreference[];
|
|
20
|
+
/** Controlled tab. Leave unset to let the block own its own tab state. */
|
|
21
|
+
activeTab?: AccountTabId;
|
|
22
|
+
defaultTab?: AccountTabId;
|
|
23
|
+
onTabChange?: (tab: AccountTabId) => void;
|
|
24
|
+
/** Order and subset of tabs to render. */
|
|
25
|
+
visibleTabs?: AccountTabId[];
|
|
26
|
+
tabLabels?: Partial<Record<AccountTabId, string>>;
|
|
27
|
+
themeColor?: string;
|
|
28
|
+
themeTextColor?: string;
|
|
29
|
+
/** Sanitized merchant content rendered as an orderable section in Rewards. */
|
|
30
|
+
customHtml?: AccountCustomHtmlConfig;
|
|
31
|
+
/** Controls Rewards pane section order; omitted sections retain their defaults. */
|
|
32
|
+
sectionOrder?: AccountRewardsSectionId[];
|
|
33
|
+
customCss?: string;
|
|
34
|
+
enableCustomCss?: boolean;
|
|
35
|
+
currencySymbol?: string;
|
|
36
|
+
tokenName?: string;
|
|
37
|
+
/** Pane copy. */
|
|
38
|
+
profileTitle?: string;
|
|
39
|
+
profileSubtitle?: string;
|
|
40
|
+
ordersTitle?: string;
|
|
41
|
+
ordersSubtitle?: string;
|
|
42
|
+
addressesTitle?: string;
|
|
43
|
+
addressesSubtitle?: string;
|
|
44
|
+
securityNote?: string;
|
|
45
|
+
/** Plain strings, or `{ label, value }` when the stored value differs. */
|
|
46
|
+
genderOptions?: Array<string | AccountOption>;
|
|
47
|
+
isLoadingOrders?: boolean;
|
|
48
|
+
isLoadingAddresses?: boolean;
|
|
49
|
+
isSavingAddress?: boolean;
|
|
50
|
+
isSavingProfile?: boolean;
|
|
51
|
+
/** Open the profile form in edit mode instead of the locked view. */
|
|
52
|
+
defaultEditing?: boolean;
|
|
53
|
+
/** Force a layout instead of measuring the viewport (handy in stories/tests). */
|
|
54
|
+
isMobile?: boolean;
|
|
55
|
+
mobileBreakpoint?: number;
|
|
56
|
+
orderRangeOptions?: Array<{
|
|
57
|
+
label: string;
|
|
58
|
+
value: string;
|
|
59
|
+
}>;
|
|
60
|
+
orderRange?: string;
|
|
61
|
+
onOrderRangeChange?: (value: string) => void;
|
|
62
|
+
orderPageSize?: number;
|
|
63
|
+
maxVisibleOrderItems?: number;
|
|
64
|
+
/** Server-side order counts: chips, and the "of N" total in the footer. */
|
|
65
|
+
orderCounts?: AccountOrderCounts;
|
|
66
|
+
/** Sidebar badge; defaults to `orderCounts.all`, then the rows held. */
|
|
67
|
+
ordersCount?: number;
|
|
68
|
+
/** Controlled order tab / search / page — omit any to filter locally. */
|
|
69
|
+
orderStatusFilter?: AccountOrderStatusFilter;
|
|
70
|
+
onOrderStatusFilterChange?: (status: AccountOrderStatusFilter) => void;
|
|
71
|
+
orderSearchQuery?: string;
|
|
72
|
+
onOrderSearchChange?: (query: string) => void;
|
|
73
|
+
orderPage?: number;
|
|
74
|
+
onOrderPageChange?: (page: number) => void;
|
|
75
|
+
orderTotalPages?: number;
|
|
76
|
+
orderHasNextPage?: boolean;
|
|
77
|
+
/** Rewards activity paging; omit the controlled ones to page locally. */
|
|
78
|
+
activityPageSize?: number;
|
|
79
|
+
activityPage?: number;
|
|
80
|
+
onActivityPageChange?: (page: number) => void;
|
|
81
|
+
activityTotalPages?: number;
|
|
82
|
+
activityHasNextPage?: boolean;
|
|
83
|
+
activityCount?: number;
|
|
84
|
+
/** Address form pickers — supply these so writes carry ISO codes. */
|
|
85
|
+
countryOptions?: AccountOption[];
|
|
86
|
+
/** Starting country for the address phone field; changeable by the customer. */
|
|
87
|
+
defaultPhoneCountry?: string;
|
|
88
|
+
provinceOptions?: AccountOption[] | Record<string, AccountOption[]>;
|
|
89
|
+
addressTypeOptions?: string[];
|
|
90
|
+
onLogout?: () => void;
|
|
91
|
+
/** Return false to keep the form dirty (e.g. the save failed). */
|
|
92
|
+
onSaveProfile?: (payload: AccountProfilePayload) => void | boolean | Promise<void | boolean>;
|
|
93
|
+
/** Resolve with the state the server applied; the toggle repaints from it. */
|
|
94
|
+
onNotificationChange?: (id: string, enabled: boolean) => void | boolean | Promise<void | boolean>;
|
|
95
|
+
onSaveAddress?: (payload: AccountAddressPayload, addressId?: string) => void | boolean | Promise<void | boolean>;
|
|
96
|
+
onDeleteAddress?: (addressId: string) => void | Promise<void>;
|
|
97
|
+
onBuyAgain?: (item: AccountOrderLineItem, order: AccountOrder) => void;
|
|
98
|
+
onViewItem?: (item: AccountOrderLineItem, order: AccountOrder) => void;
|
|
99
|
+
onOrderAgain?: (order: AccountOrder) => void;
|
|
100
|
+
onCancelOrder?: (order: AccountOrder) => void;
|
|
101
|
+
onOrderSupport?: (order: AccountOrder) => void;
|
|
102
|
+
onViewDetails?: (order: AccountOrder) => void;
|
|
103
|
+
/** Renders "Email Invoice" — Shopify serves no downloadable invoice. */
|
|
104
|
+
onEmailInvoice?: (order: AccountOrder) => void;
|
|
105
|
+
className?: string;
|
|
106
|
+
style?: React.CSSProperties;
|
|
107
|
+
}
|
|
108
|
+
export default function AccountBlock({ isLoggedIn, login, user, orders, addresses, defaultAddressId, rewards, notifications, activeTab, defaultTab, onTabChange, visibleTabs, tabLabels, themeColor, themeTextColor, customHtml, sectionOrder, customCss, enableCustomCss, currencySymbol, tokenName, profileTitle, profileSubtitle, ordersTitle, ordersSubtitle, addressesTitle, addressesSubtitle, securityNote, genderOptions, isLoadingOrders, isLoadingAddresses, isSavingAddress, isSavingProfile, defaultEditing, isMobile, mobileBreakpoint, orderRangeOptions, orderRange, onOrderRangeChange, orderPageSize, maxVisibleOrderItems, orderCounts, ordersCount, orderStatusFilter, onOrderStatusFilterChange, orderSearchQuery, onOrderSearchChange, orderPage, onOrderPageChange, orderTotalPages, orderHasNextPage, activityPageSize, activityPage, onActivityPageChange, activityTotalPages, activityHasNextPage, activityCount, countryOptions, defaultPhoneCountry, provinceOptions, addressTypeOptions, onLogout, onSaveProfile, onNotificationChange, onSaveAddress, onDeleteAddress, onBuyAgain, onViewItem, onOrderAgain, onCancelOrder, onOrderSupport, onViewDetails, onEmailInvoice, className, style, }: AccountBlockProps): React.JSX.Element;
|