pixelize-design-library 2.4.2-beta.55 → 2.4.2-beta.57
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/CHANGELOG.md +64 -0
- package/COMPONENT-GOTCHAS.md +50 -22
- package/DESIGN-GUIDE.md +19 -2
- package/dist/Components/AddressCard/AddressCard.d.ts +4 -0
- package/dist/Components/AddressCard/AddressCard.js +25 -0
- package/dist/Components/AddressCard/AddressCardGroup.d.ts +4 -0
- package/dist/Components/AddressCard/AddressCardGroup.js +7 -0
- package/dist/Components/AddressCard/AddressCardProps.d.ts +43 -0
- package/dist/Components/AddressCard/AddressCardProps.js +2 -0
- package/dist/Components/BagBar/BagBar.d.ts +4 -0
- package/dist/Components/BagBar/BagBar.js +32 -0
- package/dist/Components/BagBar/BagBarProps.d.ts +30 -0
- package/dist/Components/BagBar/BagBarProps.js +2 -0
- package/dist/Components/CartItem/CartItem.d.ts +4 -0
- package/dist/Components/CartItem/CartItem.js +60 -0
- package/dist/Components/CartItem/CartItemProps.d.ts +64 -0
- package/dist/Components/CartItem/CartItemProps.js +2 -0
- package/dist/Components/CartItem/cartItemOptions.d.ts +3 -0
- package/dist/Components/CartItem/cartItemOptions.js +13 -0
- package/dist/Components/CheckoutKit/selectable.d.ts +58 -0
- package/dist/Components/CheckoutKit/selectable.js +120 -0
- package/dist/Components/Commerce/commerceTypes.d.ts +52 -0
- package/dist/Components/Commerce/commerceTypes.js +2 -0
- package/dist/Components/Commerce/commerceVariants.d.ts +13 -0
- package/dist/Components/Commerce/commerceVariants.js +51 -0
- package/dist/Components/Commerce/index.d.ts +2 -0
- package/dist/Components/Commerce/index.js +18 -0
- package/dist/Components/Commerce/useContainerWidth.d.ts +3 -0
- package/dist/Components/Commerce/useContainerWidth.js +25 -0
- package/dist/Components/CouponField/CouponField.d.ts +4 -0
- package/dist/Components/CouponField/CouponField.js +72 -0
- package/dist/Components/CouponField/CouponFieldProps.d.ts +49 -0
- package/dist/Components/CouponField/CouponFieldProps.js +2 -0
- package/dist/Components/DatePicker/DatePickerProps.d.ts +1 -1
- package/dist/Components/DatePicker/PickerPortal.d.ts +11 -0
- package/dist/Components/DatePicker/PickerPortal.js +26 -0
- package/dist/Components/DatePicker/RangeDatePicker.d.ts +1 -1
- package/dist/Components/DatePicker/RangeDatePicker.js +67 -32
- package/dist/Components/DatePicker/SingleDatePicker.js +49 -13
- package/dist/Components/DatePicker/TimeOnlyPicker.js +39 -4
- package/dist/Components/DetailSections/DetailSections.d.ts +4 -0
- package/dist/Components/DetailSections/DetailSections.js +112 -0
- package/dist/Components/DetailSections/DetailSectionsProps.d.ts +58 -0
- package/dist/Components/DetailSections/DetailSectionsProps.js +2 -0
- package/dist/Components/Input/PhoneNumberInputProps.d.ts +1 -1
- package/dist/Components/MediaGallery/MediaFrame.d.ts +31 -0
- package/dist/Components/MediaGallery/MediaFrame.js +55 -0
- package/dist/Components/MediaGallery/MediaGallery.d.ts +4 -0
- package/dist/Components/MediaGallery/MediaGallery.js +206 -0
- package/dist/Components/MediaGallery/MediaGalleryProps.d.ts +76 -0
- package/dist/Components/MediaGallery/MediaGalleryProps.js +20 -0
- package/dist/Components/MediaGallery/MediaLightbox.d.ts +4 -0
- package/dist/Components/MediaGallery/MediaLightbox.js +116 -0
- package/dist/Components/MediaGallery/MediaLightboxProps.d.ts +40 -0
- package/dist/Components/MediaGallery/MediaLightboxProps.js +15 -0
- package/dist/Components/MediaGallery/MediaThumb.d.ts +18 -0
- package/dist/Components/MediaGallery/MediaThumb.js +25 -0
- package/dist/Components/MediaGallery/glass.d.ts +31 -0
- package/dist/Components/MediaGallery/glass.js +47 -0
- package/dist/Components/MediaGallery/mediaGalleryModel.d.ts +22 -0
- package/dist/Components/MediaGallery/mediaGalleryModel.js +83 -0
- package/dist/Components/MediaGallery/motion.d.ts +5 -0
- package/dist/Components/MediaGallery/motion.js +12 -0
- package/dist/Components/MediaGallery/useMatchMedia.d.ts +2 -0
- package/dist/Components/MediaGallery/useMatchMedia.js +20 -0
- package/dist/Components/MultiSelect/MultiSelectProps.d.ts +1 -1
- package/dist/Components/OffersList/OffersList.d.ts +4 -0
- package/dist/Components/OffersList/OffersList.js +83 -0
- package/dist/Components/OffersList/OffersListProps.d.ts +34 -0
- package/dist/Components/OffersList/OffersListProps.js +2 -0
- package/dist/Components/OptionChip/OptionChip.d.ts +4 -0
- package/dist/Components/OptionChip/OptionChip.js +97 -0
- package/dist/Components/OptionChip/OptionChipProps.d.ts +33 -0
- package/dist/Components/OptionChip/OptionChipProps.js +2 -0
- package/dist/Components/OptionChip/optionInk.d.ts +12 -0
- package/dist/Components/OptionChip/optionInk.js +25 -0
- package/dist/Components/OrderStatusTimeline/OrderStatusTimeline.d.ts +4 -0
- package/dist/Components/OrderStatusTimeline/OrderStatusTimeline.js +57 -0
- package/dist/Components/OrderStatusTimeline/OrderStatusTimelineProps.d.ts +29 -0
- package/dist/Components/OrderStatusTimeline/OrderStatusTimelineProps.js +2 -0
- package/dist/Components/OrderSummary/OrderSummary.d.ts +4 -0
- package/dist/Components/OrderSummary/OrderSummary.js +63 -0
- package/dist/Components/OrderSummary/OrderSummaryProps.d.ts +53 -0
- package/dist/Components/OrderSummary/OrderSummaryProps.js +2 -0
- package/dist/Components/PaymentOption/PaymentOption.d.ts +4 -0
- package/dist/Components/PaymentOption/PaymentOption.js +24 -0
- package/dist/Components/PaymentOption/PaymentOptionGroup.d.ts +4 -0
- package/dist/Components/PaymentOption/PaymentOptionGroup.js +7 -0
- package/dist/Components/PaymentOption/PaymentOptionProps.d.ts +32 -0
- package/dist/Components/PaymentOption/PaymentOptionProps.js +2 -0
- package/dist/Components/PinInput/PinInputProps.d.ts +1 -1
- package/dist/Components/PincodeChecker/PincodeChecker.d.ts +4 -0
- package/dist/Components/PincodeChecker/PincodeChecker.js +175 -0
- package/dist/Components/PincodeChecker/PincodeCheckerProps.d.ts +57 -0
- package/dist/Components/PincodeChecker/PincodeCheckerProps.js +2 -0
- package/dist/Components/PriceBlock/PriceBlock.d.ts +4 -0
- package/dist/Components/PriceBlock/PriceBlock.js +41 -0
- package/dist/Components/PriceBlock/PriceBlockProps.d.ts +39 -0
- package/dist/Components/PriceBlock/PriceBlockProps.js +2 -0
- package/dist/Components/ProductBadges/ProductBadges.d.ts +4 -0
- package/dist/Components/ProductBadges/ProductBadges.js +61 -0
- package/dist/Components/ProductBadges/ProductBadgesProps.d.ts +18 -0
- package/dist/Components/ProductBadges/ProductBadgesProps.js +2 -0
- package/dist/Components/ProductCard/ProductCard.d.ts +3 -2
- package/dist/Components/ProductCard/ProductCard.js +103 -52
- package/dist/Components/ProductCard/ProductCardAction.d.ts +17 -0
- package/dist/Components/ProductCard/ProductCardAction.js +65 -0
- package/dist/Components/ProductCard/ProductCardGrid.d.ts +4 -0
- package/dist/Components/ProductCard/ProductCardGrid.js +20 -0
- package/dist/Components/ProductCard/ProductCardMedia.d.ts +18 -0
- package/dist/Components/ProductCard/ProductCardMedia.js +35 -0
- package/dist/Components/ProductCard/ProductCardProps.d.ts +138 -56
- package/dist/Components/ProductCard/ProductCardSkeleton.d.ts +4 -0
- package/dist/Components/ProductCard/ProductCardSkeleton.js +17 -0
- package/dist/Components/ProductCard/ProductCardSwatches.d.ts +15 -0
- package/dist/Components/ProductCard/ProductCardSwatches.js +37 -0
- package/dist/Components/ProductCard/QuickAddSheet.d.ts +4 -0
- package/dist/Components/ProductCard/QuickAddSheet.js +109 -0
- package/dist/Components/ProductCard/QuickAddSheetProps.d.ts +38 -0
- package/dist/Components/ProductCard/QuickAddSheetProps.js +2 -0
- package/dist/Components/ProductCard/cardLabels.d.ts +2 -0
- package/dist/Components/ProductCard/cardLabels.js +16 -0
- package/dist/Components/ProductCard/cardMetrics.d.ts +27 -0
- package/dist/Components/ProductCard/cardMetrics.js +55 -0
- package/dist/Components/ProductCard/productCardFixtures.d.ts +7 -0
- package/dist/Components/ProductCard/productCardFixtures.js +61 -0
- package/dist/Components/ProductCard/productCardModel.d.ts +22 -0
- package/dist/Components/ProductCard/productCardModel.js +79 -0
- package/dist/Components/ProductCard/useMinWidth.d.ts +2 -0
- package/dist/Components/ProductCard/useMinWidth.js +20 -0
- package/dist/Components/ProductDetails/ProductDetails.d.ts +3 -2
- package/dist/Components/ProductDetails/ProductDetails.js +209 -33
- package/dist/Components/ProductDetails/ProductDetailsProps.d.ts +143 -41
- package/dist/Components/ProductDetails/productDetailsModel.d.ts +14 -0
- package/dist/Components/ProductDetails/productDetailsModel.js +45 -0
- package/dist/Components/ProductDetails/useInViewport.d.ts +3 -0
- package/dist/Components/ProductDetails/useInViewport.js +18 -0
- package/dist/Components/QuantityStepper/QuantityStepper.d.ts +4 -0
- package/dist/Components/QuantityStepper/QuantityStepper.js +59 -0
- package/dist/Components/QuantityStepper/QuantityStepperProps.d.ts +24 -0
- package/dist/Components/QuantityStepper/QuantityStepperProps.js +2 -0
- package/dist/Components/Rating/Rating.d.ts +4 -0
- package/dist/Components/Rating/Rating.js +81 -0
- package/dist/Components/Rating/RatingProps.d.ts +27 -0
- package/dist/Components/Rating/RatingProps.js +2 -0
- package/dist/Components/ReviewList/ReviewList.d.ts +4 -0
- package/dist/Components/ReviewList/ReviewList.js +94 -0
- package/dist/Components/ReviewList/ReviewListProps.d.ts +68 -0
- package/dist/Components/ReviewList/ReviewListProps.js +2 -0
- package/dist/Components/ReviewSummary/ReviewSummary.d.ts +4 -0
- package/dist/Components/ReviewSummary/ReviewSummary.js +47 -0
- package/dist/Components/ReviewSummary/ReviewSummaryProps.d.ts +31 -0
- package/dist/Components/ReviewSummary/ReviewSummaryProps.js +2 -0
- package/dist/Components/Search/SearchProps.d.ts +1 -1
- package/dist/Components/SearchSelect/SearchSelectProps.d.ts +1 -1
- package/dist/Components/SegmentedControl/SegmentedControl.d.ts +1 -1
- package/dist/Components/SegmentedControl/SegmentedControl.js +17 -5
- package/dist/Components/SegmentedControl/SegmentedControlProps.d.ts +6 -0
- package/dist/Components/SegmentedControl/segmentedInk.d.ts +2 -0
- package/dist/Components/SegmentedControl/segmentedInk.js +4 -1
- package/dist/Components/SegmentedControl/useSlidingPill.d.ts +2 -0
- package/dist/Components/SegmentedControl/useSlidingPill.js +6 -1
- package/dist/Components/Select/SelectProps.d.ts +1 -1
- package/dist/Components/SelectSearch/SelectSearchProps.d.ts +1 -1
- package/dist/Components/SelectV2/SelectV2Props.d.ts +1 -1
- package/dist/Components/SideBar/SecondaryBar.js +13 -8
- package/dist/Components/SideBar/SideBarProps.d.ts +3 -1
- package/dist/Components/SideBar/components/MenuItemBox.js +47 -10
- package/dist/Components/SideBar/components/MenuPopoverContent.js +4 -3
- package/dist/Components/SpecTable/SpecTable.d.ts +4 -0
- package/dist/Components/SpecTable/SpecTable.js +39 -0
- package/dist/Components/SpecTable/SpecTableProps.d.ts +25 -0
- package/dist/Components/SpecTable/SpecTableProps.js +2 -0
- package/dist/Components/Spinner/Spinner.d.ts +1 -1
- package/dist/Components/Spinner/Spinner.js +2 -2
- package/dist/Components/Spinner/SpinnerProps.d.ts +2 -0
- package/dist/Components/StageProgress/StepperStage.js +2 -1
- package/dist/Components/StatCard/StatCard.d.ts +1 -1
- package/dist/Components/StatCard/StatCard.js +2 -2
- package/dist/Components/StatCard/StatCardProps.d.ts +4 -0
- package/dist/Components/StickyBuyBar/StickyBuyBar.d.ts +3 -0
- package/dist/Components/StickyBuyBar/StickyBuyBar.js +85 -0
- package/dist/Components/StickyBuyBar/StickyBuyBarProps.d.ts +54 -0
- package/dist/Components/StickyBuyBar/StickyBuyBarProps.js +2 -0
- package/dist/Components/StockStatus/StockStatus.d.ts +4 -0
- package/dist/Components/StockStatus/StockStatus.js +31 -0
- package/dist/Components/StockStatus/StockStatusProps.d.ts +14 -0
- package/dist/Components/StockStatus/StockStatusProps.js +2 -0
- package/dist/Components/Table/Table.js +2 -1
- package/dist/Components/Table/TableProps.d.ts +5 -2
- package/dist/Components/Table/columnLabel.d.ts +6 -0
- package/dist/Components/Table/columnLabel.js +27 -0
- package/dist/Components/Table/components/TableBody.js +5 -1
- package/dist/Components/Table/components/TableHeader.js +3 -2
- package/dist/Components/Table/filters/ActiveFilters.js +2 -1
- package/dist/Components/Table/filters/TableFilters.js +2 -1
- package/dist/Components/Table/hooks/useTable.js +3 -2
- package/dist/Components/Table/settings/ManageColumns.js +4 -3
- package/dist/Components/Table/settings/TableSettings.js +2 -1
- package/dist/Components/TrustBadges/TrustBadges.d.ts +4 -0
- package/dist/Components/TrustBadges/TrustBadges.js +24 -0
- package/dist/Components/TrustBadges/TrustBadgesProps.d.ts +20 -0
- package/dist/Components/TrustBadges/TrustBadgesProps.js +2 -0
- package/dist/Components/VariantSelector/VariantSelector.d.ts +4 -0
- package/dist/Components/VariantSelector/VariantSelector.js +123 -0
- package/dist/Components/VariantSelector/VariantSelectorProps.d.ts +27 -0
- package/dist/Components/VariantSelector/VariantSelectorProps.js +2 -0
- package/dist/Components/VariantSelector/variantSelection.d.ts +6 -0
- package/dist/Components/VariantSelector/variantSelection.js +25 -0
- package/dist/Components/WishlistToggle/WishlistToggle.d.ts +4 -0
- package/dist/Components/WishlistToggle/WishlistToggle.js +65 -0
- package/dist/Components/WishlistToggle/WishlistToggleProps.d.ts +19 -0
- package/dist/Components/WishlistToggle/WishlistToggleProps.js +2 -0
- package/dist/Theme/assertPalette.d.ts +1 -1
- package/dist/Theme/assertPalette.js +1 -1
- package/dist/Theme/tokens/brands/index.js +2 -0
- package/dist/Theme/tokens/brands/zinc/palette.dark.d.ts +1 -0
- package/dist/Theme/tokens/builders/buildDarkPalette.js +2 -0
- package/dist/Theme/tokens/builders/index.d.ts +1 -0
- package/dist/Theme/tokens/builders/index.js +1 -0
- package/dist/Theme/tokens/builders/rechartsTheme.d.ts +56 -0
- package/dist/Theme/tokens/builders/rechartsTheme.js +43 -0
- package/dist/Theme/tokens/builders/star.d.ts +3 -0
- package/dist/Theme/tokens/builders/star.js +8 -0
- package/dist/Theme/tokens/primitives/controlSizes.js +1 -1
- package/dist/Theme/tokens/types.d.ts +3 -1
- package/dist/Theme/useChartTheme.d.ts +4 -0
- package/dist/Theme/useChartTheme.js +12 -0
- package/dist/Utils/price.d.ts +16 -0
- package/dist/Utils/price.js +34 -0
- package/dist/esm/Components/AddressCard/AddressCard.js +20 -0
- package/dist/esm/Components/AddressCard/AddressCardGroup.js +5 -0
- package/dist/esm/Components/AddressCard/AddressCardProps.js +1 -0
- package/dist/esm/Components/BagBar/BagBar.js +27 -0
- package/dist/esm/Components/BagBar/BagBarProps.js +1 -0
- package/dist/esm/Components/CartItem/CartItem.js +55 -0
- package/dist/esm/Components/CartItem/CartItemProps.js +1 -0
- package/dist/esm/Components/CartItem/cartItemOptions.js +9 -0
- package/dist/esm/Components/CheckoutKit/selectable.js +112 -0
- package/dist/esm/Components/Commerce/commerceTypes.js +1 -0
- package/dist/esm/Components/Commerce/commerceVariants.js +41 -0
- package/dist/esm/Components/Commerce/index.js +2 -0
- package/dist/esm/Components/Commerce/useContainerWidth.js +21 -0
- package/dist/esm/Components/CouponField/CouponField.js +67 -0
- package/dist/esm/Components/CouponField/CouponFieldProps.js +1 -0
- package/dist/esm/Components/DatePicker/PickerPortal.js +21 -0
- package/dist/esm/Components/DatePicker/RangeDatePicker.js +34 -32
- package/dist/esm/Components/DatePicker/SingleDatePicker.js +16 -13
- package/dist/esm/Components/DatePicker/TimeOnlyPicker.js +6 -4
- package/dist/esm/Components/DetailSections/DetailSections.js +107 -0
- package/dist/esm/Components/DetailSections/DetailSectionsProps.js +1 -0
- package/dist/esm/Components/MediaGallery/MediaFrame.js +48 -0
- package/dist/esm/Components/MediaGallery/MediaGallery.js +201 -0
- package/dist/esm/Components/MediaGallery/MediaGalleryProps.js +17 -0
- package/dist/esm/Components/MediaGallery/MediaLightbox.js +78 -0
- package/dist/esm/Components/MediaGallery/MediaLightboxProps.js +12 -0
- package/dist/esm/Components/MediaGallery/MediaThumb.js +23 -0
- package/dist/esm/Components/MediaGallery/glass.js +42 -0
- package/dist/esm/Components/MediaGallery/mediaGalleryModel.js +71 -0
- package/dist/esm/Components/MediaGallery/motion.js +8 -0
- package/dist/esm/Components/MediaGallery/useMatchMedia.js +16 -0
- package/dist/esm/Components/OffersList/OffersList.js +81 -0
- package/dist/esm/Components/OffersList/OffersListProps.js +1 -0
- package/dist/esm/Components/OptionChip/OptionChip.js +95 -0
- package/dist/esm/Components/OptionChip/OptionChipProps.js +1 -0
- package/dist/esm/Components/OptionChip/optionInk.js +21 -0
- package/dist/esm/Components/OrderStatusTimeline/OrderStatusTimeline.js +55 -0
- package/dist/esm/Components/OrderStatusTimeline/OrderStatusTimelineProps.js +1 -0
- package/dist/esm/Components/OrderSummary/OrderSummary.js +58 -0
- package/dist/esm/Components/OrderSummary/OrderSummaryProps.js +1 -0
- package/dist/esm/Components/PaymentOption/PaymentOption.js +19 -0
- package/dist/esm/Components/PaymentOption/PaymentOptionGroup.js +5 -0
- package/dist/esm/Components/PaymentOption/PaymentOptionProps.js +1 -0
- package/dist/esm/Components/PincodeChecker/PincodeChecker.js +170 -0
- package/dist/esm/Components/PincodeChecker/PincodeCheckerProps.js +1 -0
- package/dist/esm/Components/PriceBlock/PriceBlock.js +39 -0
- package/dist/esm/Components/PriceBlock/PriceBlockProps.js +1 -0
- package/dist/esm/Components/ProductBadges/ProductBadges.js +59 -0
- package/dist/esm/Components/ProductBadges/ProductBadgesProps.js +1 -0
- package/dist/esm/Components/ProductCard/ProductCard.js +105 -54
- package/dist/esm/Components/ProductCard/ProductCardAction.js +60 -0
- package/dist/esm/Components/ProductCard/ProductCardGrid.js +18 -0
- package/dist/esm/Components/ProductCard/ProductCardMedia.js +33 -0
- package/dist/esm/Components/ProductCard/ProductCardSkeleton.js +12 -0
- package/dist/esm/Components/ProductCard/ProductCardSwatches.js +35 -0
- package/dist/esm/Components/ProductCard/QuickAddSheet.js +71 -0
- package/dist/esm/Components/ProductCard/QuickAddSheetProps.js +1 -0
- package/dist/esm/Components/ProductCard/cardLabels.js +13 -0
- package/dist/esm/Components/ProductCard/cardMetrics.js +52 -0
- package/dist/esm/Components/ProductCard/productCardFixtures.js +58 -0
- package/dist/esm/Components/ProductCard/productCardModel.js +65 -0
- package/dist/esm/Components/ProductCard/useMinWidth.js +16 -0
- package/dist/esm/Components/ProductDetails/ProductDetails.js +210 -34
- package/dist/esm/Components/ProductDetails/productDetailsModel.js +35 -0
- package/dist/esm/Components/ProductDetails/useInViewport.js +14 -0
- package/dist/esm/Components/QuantityStepper/QuantityStepper.js +57 -0
- package/dist/esm/Components/QuantityStepper/QuantityStepperProps.js +1 -0
- package/dist/esm/Components/Rating/Rating.js +79 -0
- package/dist/esm/Components/Rating/RatingProps.js +1 -0
- package/dist/esm/Components/ReviewList/ReviewList.js +89 -0
- package/dist/esm/Components/ReviewList/ReviewListProps.js +1 -0
- package/dist/esm/Components/ReviewSummary/ReviewSummary.js +42 -0
- package/dist/esm/Components/ReviewSummary/ReviewSummaryProps.js +1 -0
- package/dist/esm/Components/SegmentedControl/SegmentedControl.js +19 -7
- package/dist/esm/Components/SegmentedControl/segmentedInk.js +2 -0
- package/dist/esm/Components/SegmentedControl/useSlidingPill.js +6 -1
- package/dist/esm/Components/SideBar/SecondaryBar.js +14 -9
- package/dist/esm/Components/SideBar/components/MenuItemBox.js +14 -10
- package/dist/esm/Components/SideBar/components/MenuPopoverContent.js +4 -3
- package/dist/esm/Components/SpecTable/SpecTable.js +34 -0
- package/dist/esm/Components/SpecTable/SpecTableProps.js +1 -0
- package/dist/esm/Components/Spinner/Spinner.js +2 -2
- package/dist/esm/Components/StageProgress/StepperStage.js +2 -1
- package/dist/esm/Components/StatCard/StatCard.js +2 -2
- package/dist/esm/Components/StickyBuyBar/StickyBuyBar.js +80 -0
- package/dist/esm/Components/StickyBuyBar/StickyBuyBarProps.js +1 -0
- package/dist/esm/Components/StockStatus/StockStatus.js +29 -0
- package/dist/esm/Components/StockStatus/StockStatusProps.js +1 -0
- package/dist/esm/Components/Table/Table.js +2 -1
- package/dist/esm/Components/Table/columnLabel.js +21 -0
- package/dist/esm/Components/Table/components/TableBody.js +5 -1
- package/dist/esm/Components/Table/components/TableHeader.js +3 -2
- package/dist/esm/Components/Table/filters/ActiveFilters.js +2 -1
- package/dist/esm/Components/Table/filters/TableFilters.js +2 -1
- package/dist/esm/Components/Table/hooks/useTable.js +3 -2
- package/dist/esm/Components/Table/settings/ManageColumns.js +4 -3
- package/dist/esm/Components/Table/settings/TableSettings.js +2 -1
- package/dist/esm/Components/TrustBadges/TrustBadges.js +22 -0
- package/dist/esm/Components/TrustBadges/TrustBadgesProps.js +1 -0
- package/dist/esm/Components/VariantSelector/VariantSelector.js +118 -0
- package/dist/esm/Components/VariantSelector/VariantSelectorProps.js +1 -0
- package/dist/esm/Components/VariantSelector/variantSelection.js +19 -0
- package/dist/esm/Components/WishlistToggle/WishlistToggle.js +63 -0
- package/dist/esm/Components/WishlistToggle/WishlistToggleProps.js +1 -0
- package/dist/esm/Theme/assertPalette.js +1 -1
- package/dist/esm/Theme/tokens/brands/index.js +2 -0
- package/dist/esm/Theme/tokens/builders/buildDarkPalette.js +2 -0
- package/dist/esm/Theme/tokens/builders/index.js +1 -0
- package/dist/esm/Theme/tokens/builders/rechartsTheme.js +37 -0
- package/dist/esm/Theme/tokens/builders/star.js +4 -0
- package/dist/esm/Theme/tokens/primitives/controlSizes.js +1 -1
- package/dist/esm/Theme/useChartTheme.js +8 -0
- package/dist/esm/Utils/price.js +27 -0
- package/dist/esm/index.js +36 -0
- package/dist/index.d.ts +66 -0
- package/dist/index.js +86 -4
- package/package.json +1 -1
- package/dist/Components/ProductCard/ProductLabel.d.ts +0 -7
- package/dist/Components/ProductCard/ProductLabel.js +0 -20
- package/dist/Components/ProductCard/ProductPrice.d.ts +0 -10
- package/dist/Components/ProductCard/ProductPrice.js +0 -126
- package/dist/Components/ProductCard/ProductReview.d.ts +0 -8
- package/dist/Components/ProductCard/ProductReview.js +0 -30
- package/dist/Components/ProductCard/ProductTags.d.ts +0 -8
- package/dist/Components/ProductCard/ProductTags.js +0 -53
- package/dist/Components/ProductDetails/ProductDtlPrice.d.ts +0 -7
- package/dist/Components/ProductDetails/ProductDtlPrice.js +0 -24
- package/dist/Components/ProductDetails/ProductImageSlider.d.ts +0 -13
- package/dist/Components/ProductDetails/ProductImageSlider.js +0 -240
- package/dist/esm/Components/ProductCard/ProductLabel.js +0 -18
- package/dist/esm/Components/ProductCard/ProductPrice.js +0 -121
- package/dist/esm/Components/ProductCard/ProductReview.js +0 -28
- package/dist/esm/Components/ProductCard/ProductTags.js +0 -48
- package/dist/esm/Components/ProductDetails/ProductDtlPrice.js +0 -22
- package/dist/esm/Components/ProductDetails/ProductImageSlider.js +0 -204
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
7
|
+
const react_1 = require("react");
|
|
8
|
+
const react_2 = require("@chakra-ui/react");
|
|
9
|
+
const lucide_react_1 = require("lucide-react");
|
|
10
|
+
const useCustomTheme_1 = require("../../Theme/useCustomTheme");
|
|
11
|
+
const focusRing_styles_1 = require("../../Theme/chakra/focusRing.styles");
|
|
12
|
+
const scrollbar_1 = require("../../Theme/tokens/builders/scrollbar");
|
|
13
|
+
const OptionChip_1 = __importDefault(require("../OptionChip/OptionChip"));
|
|
14
|
+
const commerceVariants_1 = require("../Commerce/commerceVariants");
|
|
15
|
+
const variantSelection_1 = require("./variantSelection");
|
|
16
|
+
const GAP = "0.5rem";
|
|
17
|
+
const GRID_MIN = {
|
|
18
|
+
chip: "4rem",
|
|
19
|
+
swatch: "3rem",
|
|
20
|
+
"image-tile": "4.75rem",
|
|
21
|
+
pack: "6.5rem",
|
|
22
|
+
};
|
|
23
|
+
const cellKey = (axisId, valueId) => `${axisId}\u0000${valueId}`;
|
|
24
|
+
/** Per-axis radiogroups whose availability is derived from `variants`; no vertical-specific vocabulary lives here. */
|
|
25
|
+
const VariantSelector = ({ axes, variants, value, defaultValue, onValueChange, error, showSelectedLabel = false, showLowStock = false, size = "md", layout = "wrap", onGuideClick, "data-testid": testId, }) => {
|
|
26
|
+
const { colors } = (0, useCustomTheme_1.useCustomTheme)();
|
|
27
|
+
const uid = (0, react_1.useId)();
|
|
28
|
+
const statusId = `${uid}-status`;
|
|
29
|
+
const cells = (0, react_1.useRef)(new Map());
|
|
30
|
+
const [inner, setInner] = (0, react_1.useState)(defaultValue !== null && defaultValue !== void 0 ? defaultValue : {});
|
|
31
|
+
const [focus, setFocus] = (0, react_1.useState)(null);
|
|
32
|
+
const selection = value !== null && value !== void 0 ? value : inner;
|
|
33
|
+
const commit = (0, react_1.useCallback)((next) => {
|
|
34
|
+
if ((0, variantSelection_1.sameSelection)(next, selection))
|
|
35
|
+
return;
|
|
36
|
+
if (value === undefined)
|
|
37
|
+
setInner(next);
|
|
38
|
+
onValueChange === null || onValueChange === void 0 ? void 0 : onValueChange(next, (0, commerceVariants_1.findVariant)(axes, variants, next));
|
|
39
|
+
}, [axes, variants, selection, value, onValueChange]);
|
|
40
|
+
const choose = (axisId, valueId) => {
|
|
41
|
+
if ((0, variantSelection_1.isSoldOutEverywhere)(variants, axisId, valueId))
|
|
42
|
+
return;
|
|
43
|
+
commit((0, variantSelection_1.selectValue)(axes, variants, selection, axisId, valueId));
|
|
44
|
+
};
|
|
45
|
+
const lowStockHint = (axis, option) => {
|
|
46
|
+
if (!showLowStock)
|
|
47
|
+
return undefined;
|
|
48
|
+
const left = (0, commerceVariants_1.remainingStock)(variants, selection, axis.id, option.id);
|
|
49
|
+
if (left === undefined || left <= 0 || left > commerceVariants_1.LOW_STOCK_THRESHOLD)
|
|
50
|
+
return undefined;
|
|
51
|
+
return `${left} left`;
|
|
52
|
+
};
|
|
53
|
+
const hintFor = (axis, option) => {
|
|
54
|
+
const low = lowStockHint(axis, option);
|
|
55
|
+
if (!low)
|
|
56
|
+
return option.hint;
|
|
57
|
+
return axis.type === "pack" && option.hint ? `${option.hint} · ${low}` : low;
|
|
58
|
+
};
|
|
59
|
+
const onKeyDown = (axis) => (event) => {
|
|
60
|
+
var _a;
|
|
61
|
+
const index = axis.values.findIndex((option) => cells.current.get(cellKey(axis.id, option.id)) === document.activeElement);
|
|
62
|
+
if (index < 0)
|
|
63
|
+
return;
|
|
64
|
+
const last = axis.values.length - 1;
|
|
65
|
+
const target = event.key === "ArrowRight" || event.key === "ArrowDown"
|
|
66
|
+
? (index + 1) % axis.values.length
|
|
67
|
+
: event.key === "ArrowLeft" || event.key === "ArrowUp"
|
|
68
|
+
? (index - 1 + axis.values.length) % axis.values.length
|
|
69
|
+
: event.key === "Home"
|
|
70
|
+
? 0
|
|
71
|
+
: event.key === "End"
|
|
72
|
+
? last
|
|
73
|
+
: -1;
|
|
74
|
+
if (target < 0)
|
|
75
|
+
return;
|
|
76
|
+
event.preventDefault();
|
|
77
|
+
const next = axis.values[target];
|
|
78
|
+
(_a = cells.current.get(cellKey(axis.id, next.id))) === null || _a === void 0 ? void 0 : _a.focus();
|
|
79
|
+
setFocus({ axisId: axis.id, valueId: next.id });
|
|
80
|
+
if ((0, commerceVariants_1.isOptionAvailable)(variants, selection, axis.id, next.id))
|
|
81
|
+
choose(axis.id, next.id);
|
|
82
|
+
};
|
|
83
|
+
const containerStyles = (axis) => {
|
|
84
|
+
if (layout === "grid") {
|
|
85
|
+
return { display: "grid", gridTemplateColumns: `repeat(auto-fill, minmax(${GRID_MIN[axis.type]}, 1fr))`, gap: GAP };
|
|
86
|
+
}
|
|
87
|
+
if (layout === "scroll") {
|
|
88
|
+
return {
|
|
89
|
+
display: "flex",
|
|
90
|
+
flexWrap: "nowrap",
|
|
91
|
+
gap: GAP,
|
|
92
|
+
overflowX: "auto",
|
|
93
|
+
pt: "0.5rem",
|
|
94
|
+
mt: "-0.5rem",
|
|
95
|
+
pr: "0.5rem",
|
|
96
|
+
scrollSnapType: "x proximity",
|
|
97
|
+
sx: (0, scrollbar_1.scrollbarStyles)(colors, "hover"),
|
|
98
|
+
};
|
|
99
|
+
}
|
|
100
|
+
return { display: "flex", flexWrap: "wrap", gap: GAP, pt: "0.25rem" };
|
|
101
|
+
};
|
|
102
|
+
return ((0, jsx_runtime_1.jsxs)(react_2.Flex, { direction: "column", gap: 5, "data-testid": testId, children: [axes.map((axis) => {
|
|
103
|
+
var _a, _b;
|
|
104
|
+
const labelId = `${uid}-${axis.id}-label`;
|
|
105
|
+
const picked = axis.values.find((option) => option.id === selection[axis.id]);
|
|
106
|
+
const unpicked = selection[axis.id] === undefined;
|
|
107
|
+
const invalid = !!error && unpicked;
|
|
108
|
+
const available = axis.values.map((option) => (0, commerceVariants_1.isOptionAvailable)(variants, selection, axis.id, option.id));
|
|
109
|
+
const firstAvailable = (_a = axis.values.find((_, i) => available[i])) !== null && _a !== void 0 ? _a : axis.values[0];
|
|
110
|
+
const stopId = (focus === null || focus === void 0 ? void 0 : focus.axisId) === axis.id ? focus.valueId : (_b = (picked !== null && picked !== void 0 ? picked : firstAvailable)) === null || _b === void 0 ? void 0 : _b.id;
|
|
111
|
+
const { guide } = axis;
|
|
112
|
+
return ((0, jsx_runtime_1.jsxs)(react_2.Box, { children: [(0, jsx_runtime_1.jsxs)(react_2.Flex, { align: "baseline", justify: "space-between", gap: 3, mb: 3, children: [(0, jsx_runtime_1.jsxs)(react_2.Flex, { align: "baseline", gap: 2, minW: 0, children: [(0, jsx_runtime_1.jsx)(react_2.Text, { as: "span", id: labelId, fontSize: "sm", fontWeight: 600, color: colors.header[900], children: axis.label }), showSelectedLabel && picked ? ((0, jsx_runtime_1.jsx)(react_2.Text, { as: "span", fontSize: "sm", color: colors.textMuted, noOfLines: 1, children: picked.label })) : null] }), guide ? ((0, jsx_runtime_1.jsxs)(react_2.Box, { as: "button", type: "button", display: "inline-flex", alignItems: "center", gap: 1, flexShrink: 0, fontSize: "sm", fontWeight: 600, color: colors.accentText, borderRadius: "md", onClick: () => {
|
|
113
|
+
guide.onClick();
|
|
114
|
+
onGuideClick === null || onGuideClick === void 0 ? void 0 : onGuideClick(axis.id);
|
|
115
|
+
}, sx: (0, focusRing_styles_1.focusVisibleStyles)(colors), children: [(0, jsx_runtime_1.jsx)(lucide_react_1.Ruler, { size: 14, "aria-hidden": true }), guide.label] })) : null] }), (0, jsx_runtime_1.jsx)(react_2.Box, { role: "radiogroup", "aria-labelledby": labelId, "aria-invalid": invalid || undefined, "aria-describedby": invalid ? statusId : undefined, onKeyDown: onKeyDown(axis), onBlur: (event) => {
|
|
116
|
+
if (!event.currentTarget.contains(event.relatedTarget))
|
|
117
|
+
setFocus(null);
|
|
118
|
+
}, ...containerStyles(axis), children: axis.values.map((option, i) => ((0, jsx_runtime_1.jsx)(OptionChip_1.default, { ref: (node) => {
|
|
119
|
+
cells.current.set(cellKey(axis.id, option.id), node);
|
|
120
|
+
}, label: option.label, variant: axis.type, swatch: option.swatch, image: option.image, hint: hintFor(axis, option), showLabel: axis.type === "swatch" && layout === "grid", size: size, fullWidth: layout === "grid" && (axis.type === "chip" || axis.type === "pack"), selected: option.id === selection[axis.id], unavailable: !available[i], invalid: invalid, tabIndex: option.id === stopId ? 0 : -1, onFocus: () => setFocus({ axisId: axis.id, valueId: option.id }), onSelect: () => choose(axis.id, option.id) }, option.id))) })] }, axis.id));
|
|
121
|
+
}), (0, jsx_runtime_1.jsx)(react_2.Box, { role: "status", id: statusId, "aria-live": "polite", mt: error ? -2 : 0, children: error ? ((0, jsx_runtime_1.jsxs)(react_2.Flex, { align: "center", gap: 1.5, color: colors.semanticText.error, fontSize: "sm", fontWeight: 600, children: [(0, jsx_runtime_1.jsx)(lucide_react_1.CircleAlert, { size: 14, "aria-hidden": true }), (0, jsx_runtime_1.jsx)(react_2.Text, { as: "span", children: error })] })) : null })] }));
|
|
122
|
+
};
|
|
123
|
+
exports.default = VariantSelector;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { OptionAxis, ProductVariant, VariantSelection } from "../Commerce/commerceTypes";
|
|
2
|
+
import type { OptionChipSize } from "../OptionChip/OptionChipProps";
|
|
3
|
+
/** How an axis lays out its options: wrapping rows, one horizontal scroller, or an even grid (which also prints swatch names). */
|
|
4
|
+
export type VariantSelectorLayout = "wrap" | "scroll" | "grid";
|
|
5
|
+
/** Config-driven option picker for any product vertical; every axis label and value comes from `axes`. */
|
|
6
|
+
export interface VariantSelectorProps {
|
|
7
|
+
/** One radiogroup per axis, in order. */
|
|
8
|
+
axes: OptionAxis[];
|
|
9
|
+
/** Availability is derived per combination from these variants' stock. */
|
|
10
|
+
variants: ProductVariant[];
|
|
11
|
+
/** Controlled selection, axis id to option value id. */
|
|
12
|
+
value?: VariantSelection;
|
|
13
|
+
defaultValue?: VariantSelection;
|
|
14
|
+
/** Receives the new selection and the matching variant, or undefined while the selection is incomplete or has no variant. */
|
|
15
|
+
onValueChange?: (selection: VariantSelection, variant: ProductVariant | undefined) => void;
|
|
16
|
+
/** Prompt such as "Select a size": shown as a status message and rings every axis still unpicked. */
|
|
17
|
+
error?: string;
|
|
18
|
+
/** Prints the picked value beside each axis label ("Colour Indigo Wash"). */
|
|
19
|
+
showSelectedLabel?: boolean;
|
|
20
|
+
/** Tags a value "N left" only when its real remaining stock is at or under LOW_STOCK_THRESHOLD. */
|
|
21
|
+
showLowStock?: boolean;
|
|
22
|
+
size?: OptionChipSize;
|
|
23
|
+
layout?: VariantSelectorLayout;
|
|
24
|
+
/** Also called when an axis `guide` link is clicked, after the guide's own onClick. */
|
|
25
|
+
onGuideClick?: (axisId: string) => void;
|
|
26
|
+
"data-testid"?: string;
|
|
27
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { OptionAxis, ProductVariant, VariantSelection } from "../Commerce/commerceTypes";
|
|
2
|
+
/** Picks `valueId` on `axisId`, then drops every other pick that no sellable variant can pair with it. */
|
|
3
|
+
export declare const selectValue: (axes: OptionAxis[], variants: ProductVariant[], selection: VariantSelection, axisId: string, valueId: string) => VariantSelection;
|
|
4
|
+
/** Sold out under every combination, so picking it can never lead to a purchasable variant. */
|
|
5
|
+
export declare const isSoldOutEverywhere: (variants: ProductVariant[], axisId: string, valueId: string) => boolean;
|
|
6
|
+
export declare const sameSelection: (a: VariantSelection, b: VariantSelection) => boolean;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.sameSelection = exports.isSoldOutEverywhere = exports.selectValue = void 0;
|
|
4
|
+
const commerceVariants_1 = require("../Commerce/commerceVariants");
|
|
5
|
+
/** Picks `valueId` on `axisId`, then drops every other pick that no sellable variant can pair with it. */
|
|
6
|
+
const selectValue = (axes, variants, selection, axisId, valueId) => {
|
|
7
|
+
const next = { ...selection, [axisId]: valueId };
|
|
8
|
+
for (const axis of axes) {
|
|
9
|
+
const pick = next[axis.id];
|
|
10
|
+
if (axis.id === axisId || pick === undefined)
|
|
11
|
+
continue;
|
|
12
|
+
if (!(0, commerceVariants_1.isOptionAvailable)(variants, next, axis.id, pick))
|
|
13
|
+
delete next[axis.id];
|
|
14
|
+
}
|
|
15
|
+
return next;
|
|
16
|
+
};
|
|
17
|
+
exports.selectValue = selectValue;
|
|
18
|
+
/** Sold out under every combination, so picking it can never lead to a purchasable variant. */
|
|
19
|
+
const isSoldOutEverywhere = (variants, axisId, valueId) => !(0, commerceVariants_1.isOptionAvailable)(variants, {}, axisId, valueId);
|
|
20
|
+
exports.isSoldOutEverywhere = isSoldOutEverywhere;
|
|
21
|
+
const sameSelection = (a, b) => {
|
|
22
|
+
const keys = new Set([...Object.keys(a), ...Object.keys(b)]);
|
|
23
|
+
return [...keys].every((key) => a[key] === b[key]);
|
|
24
|
+
};
|
|
25
|
+
exports.sameSelection = sameSelection;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { WishlistToggleProps } from "./WishlistToggleProps";
|
|
2
|
+
/** Heart toggle for saving a product: glass on media, tonal or bare elsewhere; pops once when saved. */
|
|
3
|
+
declare const WishlistToggle: ({ selected, defaultSelected, onSelectedChange, size, variant, label, isDisabled, "data-testid": testId, }: WishlistToggleProps) => import("react/jsx-runtime").JSX.Element;
|
|
4
|
+
export default WishlistToggle;
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
4
|
+
const react_1 = require("react");
|
|
5
|
+
const react_2 = require("@chakra-ui/react");
|
|
6
|
+
const react_3 = require("@emotion/react");
|
|
7
|
+
const lucide_react_1 = require("lucide-react");
|
|
8
|
+
const useCustomTheme_1 = require("../../Theme/useCustomTheme");
|
|
9
|
+
const motion_1 = require("../../Theme/tokens/primitives/motion");
|
|
10
|
+
const controlSizes_1 = require("../../Theme/tokens/primitives/controlSizes");
|
|
11
|
+
const motion_2 = require("../../Theme/chakra/motion");
|
|
12
|
+
const focusRing_styles_1 = require("../../Theme/chakra/focusRing.styles");
|
|
13
|
+
const filledSurface_1 = require("../../Theme/tokens/builders/filledSurface");
|
|
14
|
+
const scrim_1 = require("../../Theme/tokens/builders/scrim");
|
|
15
|
+
const HIT_PX = { sm: 32, md: 44, lg: 48 };
|
|
16
|
+
const POP_MS = 320;
|
|
17
|
+
const pop = (0, react_3.keyframes) `
|
|
18
|
+
0% { transform: scale(1); }
|
|
19
|
+
40% { transform: scale(1.2); }
|
|
20
|
+
100% { transform: scale(1); }
|
|
21
|
+
`;
|
|
22
|
+
/** Heart toggle for saving a product: glass on media, tonal or bare elsewhere; pops once when saved. */
|
|
23
|
+
const WishlistToggle = ({ selected, defaultSelected = false, onSelectedChange, size = "md", variant = "soft", label, isDisabled = false, "data-testid": testId, }) => {
|
|
24
|
+
const { colors } = (0, useCustomTheme_1.useCustomTheme)();
|
|
25
|
+
const reduced = (0, motion_2.usePrefersReducedMotion)();
|
|
26
|
+
const [inner, setInner] = (0, react_1.useState)(defaultSelected);
|
|
27
|
+
const [popKey, setPopKey] = (0, react_1.useState)(0);
|
|
28
|
+
const on = selected !== null && selected !== void 0 ? selected : inner;
|
|
29
|
+
const spec = controlSizes_1.BUTTON_SIZES[size];
|
|
30
|
+
const hit = HIT_PX[size];
|
|
31
|
+
const icon = spec.iconSize + 2;
|
|
32
|
+
const popping = on && popKey > 0 && !reduced;
|
|
33
|
+
const toggle = () => {
|
|
34
|
+
const next = !on;
|
|
35
|
+
if (selected === undefined)
|
|
36
|
+
setInner(next);
|
|
37
|
+
if (next)
|
|
38
|
+
setPopKey((k) => k + 1);
|
|
39
|
+
onSelectedChange === null || onSelectedChange === void 0 ? void 0 : onSelectedChange(next);
|
|
40
|
+
};
|
|
41
|
+
const saved = (0, filledSurface_1.resolveFilledSurface)(colors.semantic.error, colors);
|
|
42
|
+
const look = (() => {
|
|
43
|
+
if (variant === "glass") {
|
|
44
|
+
return on
|
|
45
|
+
? { bg: saved.fill, hoverBg: saved.hoverFill, color: saved.color }
|
|
46
|
+
: { bg: (0, scrim_1.overlayScrim)(colors), hoverBg: (0, scrim_1.overlayScrim)(colors), color: colors.white };
|
|
47
|
+
}
|
|
48
|
+
const ink = on ? colors.semanticText.error : variant === "soft" ? colors.header[900] : colors.textMuted;
|
|
49
|
+
return {
|
|
50
|
+
bg: variant === "soft" ? colors.background[100] : colors.transparent,
|
|
51
|
+
hoverBg: variant === "soft" ? colors.background[200] : colors.background[100],
|
|
52
|
+
color: ink,
|
|
53
|
+
};
|
|
54
|
+
})();
|
|
55
|
+
return ((0, jsx_runtime_1.jsx)(react_2.Box, { as: "button", type: "button", "aria-pressed": on, "aria-label": label !== null && label !== void 0 ? label : (on ? "Remove from wishlist" : "Add to wishlist"), disabled: isDisabled, onClick: toggle, "data-testid": testId, "data-selected": on || undefined, display: "inline-flex", alignItems: "center", justifyContent: "center", boxSize: `${hit}px`, flexShrink: 0, borderRadius: "full", cursor: isDisabled ? "not-allowed" : "pointer", opacity: isDisabled ? 0.5 : 1, sx: {
|
|
56
|
+
outline: "none",
|
|
57
|
+
"&:focus-visible > [data-disc]": (0, focusRing_styles_1.focusVisibleRing)(colors),
|
|
58
|
+
"&:hover:not(:disabled) > [data-disc]": { backgroundColor: look.hoverBg },
|
|
59
|
+
...(reduced ? {} : { "&:active:not(:disabled) > [data-disc]": { transform: "scale(0.92)" } }),
|
|
60
|
+
}, children: (0, jsx_runtime_1.jsx)(react_2.Box, { as: "span", "data-disc": true, display: "inline-flex", alignItems: "center", justifyContent: "center", boxSize: spec.height, borderRadius: "full", bg: look.bg, color: look.color, transition: (0, motion_1.transitionFor)(["background-color", "color", "transform"]), sx: {
|
|
61
|
+
...(variant === "glass" ? { backdropFilter: "blur(8px)", WebkitBackdropFilter: "blur(8px)" } : {}),
|
|
62
|
+
...(0, motion_2.reducedMotionSx)(),
|
|
63
|
+
}, children: (0, jsx_runtime_1.jsx)(react_2.Box, { as: "span", display: "inline-flex", "data-pop": popping || undefined, animation: popping ? `${pop} ${POP_MS}ms ${motion_1.MOTION_EASE}` : undefined, children: (0, jsx_runtime_1.jsx)(lucide_react_1.Heart, { size: icon, "aria-hidden": true, fill: on ? "currentColor" : "none", strokeWidth: 2 }) }, popKey) }) }));
|
|
64
|
+
};
|
|
65
|
+
exports.default = WishlistToggle;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/** Button sizes: sm 32 px, md 40 px with a 44 px hit area, lg 48 px. */
|
|
2
|
+
export type WishlistToggleSize = "sm" | "md" | "lg";
|
|
3
|
+
/** glass: translucent dark disc for use on photos; soft: tonal disc on the page; ghost: icon only. */
|
|
4
|
+
export type WishlistToggleVariant = "glass" | "soft" | "ghost";
|
|
5
|
+
/** Heart toggle button with `aria-pressed`, a spring pop on save and a 44 px touch target from md up. */
|
|
6
|
+
export interface WishlistToggleProps {
|
|
7
|
+
/** Controlled state; pair with `onSelectedChange`. */
|
|
8
|
+
selected?: boolean;
|
|
9
|
+
/** Initial state when `selected` is not controlled. */
|
|
10
|
+
defaultSelected?: boolean;
|
|
11
|
+
/** Fires with the next state on click or keyboard activation. */
|
|
12
|
+
onSelectedChange?: (selected: boolean) => void;
|
|
13
|
+
size?: WishlistToggleSize;
|
|
14
|
+
variant?: WishlistToggleVariant;
|
|
15
|
+
/** Fixed accessible name, e.g. "Save Denim Jacket"; defaults to "Add to wishlist" / "Remove from wishlist". */
|
|
16
|
+
label?: string;
|
|
17
|
+
isDisabled?: boolean;
|
|
18
|
+
"data-testid"?: string;
|
|
19
|
+
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { PaletteProps } from "./tokens/types";
|
|
2
|
-
declare const REQUIRED_GROUPS: readonly ["gradient", "primary", "secondary", "tertiary", "transparent", "black", "white", "semantic", "gray", "red", "orange", "yellow", "green", "teal", "blue", "cyan", "purple", "pink", "backgroundColor", "background", "text", "header", "placeholder", "boxShadow", "focusRing", "sidebar", "boxborder", "border", "table", "disabled", "accentText", "textMuted", "semanticText", "onPrimary", "onSemantic", "surfaceRaised"];
|
|
2
|
+
declare const REQUIRED_GROUPS: readonly ["gradient", "primary", "secondary", "tertiary", "transparent", "black", "white", "semantic", "gray", "red", "orange", "yellow", "green", "teal", "blue", "cyan", "purple", "pink", "backgroundColor", "background", "text", "header", "placeholder", "boxShadow", "focusRing", "sidebar", "boxborder", "border", "table", "disabled", "accentText", "textMuted", "semanticText", "onPrimary", "onSemantic", "surfaceRaised", "star"];
|
|
3
3
|
type Unlisted = Exclude<keyof PaletteProps, (typeof REQUIRED_GROUPS)[number]>;
|
|
4
4
|
export type AllPaletteTokensListed = Unlisted extends never ? true : ["unlisted token", Unlisted];
|
|
5
5
|
export declare const allPaletteTokensListed: AllPaletteTokensListed;
|
|
@@ -6,7 +6,7 @@ const REQUIRED_GROUPS = [
|
|
|
6
6
|
"semantic", "gray", "red", "orange", "yellow", "green", "teal", "blue", "cyan",
|
|
7
7
|
"purple", "pink", "backgroundColor", "background", "text", "header", "placeholder",
|
|
8
8
|
"boxShadow", "focusRing", "sidebar", "boxborder", "border", "table", "disabled",
|
|
9
|
-
"accentText", "textMuted", "semanticText", "onPrimary", "onSemantic", "surfaceRaised",
|
|
9
|
+
"accentText", "textMuted", "semanticText", "onPrimary", "onSemantic", "surfaceRaised", "star",
|
|
10
10
|
];
|
|
11
11
|
exports.allPaletteTokensListed = true;
|
|
12
12
|
const NESTED = [
|
|
@@ -49,6 +49,7 @@ const resolvedRungs_1 = require("../builders/resolvedRungs");
|
|
|
49
49
|
const focusRing_1 = require("../builders/focusRing");
|
|
50
50
|
const surfaceRungs_1 = require("../builders/surfaceRungs");
|
|
51
51
|
const surfaceRaised_1 = require("../builders/surfaceRaised");
|
|
52
|
+
const star_1 = require("../builders/star");
|
|
52
53
|
/** Derived, never hand-written: a copied hex goes stale the moment a canvas moves. */
|
|
53
54
|
const finalizeLightPalette = (source) => ({
|
|
54
55
|
...source,
|
|
@@ -60,6 +61,7 @@ const finalizeLightPalette = (source) => ({
|
|
|
60
61
|
onSemantic: (0, semanticText_1.buildOnSemantic)(source.semantic, source.white, source.black),
|
|
61
62
|
focusRing: (0, focusRing_1.buildFocusRing)(source),
|
|
62
63
|
surfaceRaised: (0, surfaceRaised_1.buildSurfaceRaised)(source),
|
|
64
|
+
star: (0, star_1.buildStar)(source.backgroundColor.main),
|
|
63
65
|
});
|
|
64
66
|
exports.finalizeLightPalette = finalizeLightPalette;
|
|
65
67
|
// NOTE: withFocusRing is outermost — it must see primary and surfaces together, after every earlier step.
|
|
@@ -10,6 +10,7 @@ const mutedText_1 = require("./mutedText");
|
|
|
10
10
|
const semanticText_1 = require("./semanticText");
|
|
11
11
|
const focusRing_1 = require("./focusRing");
|
|
12
12
|
const surfaceRaised_1 = require("./surfaceRaised");
|
|
13
|
+
const star_1 = require("./star");
|
|
13
14
|
// Structural ramps are rebuilt at explicit targets (not reversed — light ramps bottom near 35%);
|
|
14
15
|
// utility hues are reversed so index roles survive; brand/semantic ramps shift one step lighter.
|
|
15
16
|
const SCALE_KEYS = [50, 100, 200, 300, 400, 500, 600, 700, 800, 900];
|
|
@@ -211,6 +212,7 @@ function buildDarkPalette(light) {
|
|
|
211
212
|
onSemantic: (0, semanticText_1.buildOnSemantic)(semantic, light.white, light.black),
|
|
212
213
|
focusRing: (0, focusRing_1.buildFocusRing)({ primary, background, backgroundColor: namedSurfaces }),
|
|
213
214
|
surfaceRaised: (0, surfaceRaised_1.buildSurfaceRaised)({ backgroundColor: namedSurfaces, background, white }),
|
|
215
|
+
star: (0, star_1.buildStar)(namedSurfaces.main),
|
|
214
216
|
sidebar: (0, sidebarAccent_1.withSidebarTokens)(light),
|
|
215
217
|
boxShadow: {
|
|
216
218
|
primary: (0, buildBrandTokens_1.buildPrimaryShadowTint)(primary[500]),
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import type { PaletteProps } from "../types";
|
|
2
|
+
export interface RechartsGridTheme {
|
|
3
|
+
stroke: string;
|
|
4
|
+
strokeDasharray: string;
|
|
5
|
+
}
|
|
6
|
+
export interface RechartsAxisTheme {
|
|
7
|
+
stroke: string;
|
|
8
|
+
tick: {
|
|
9
|
+
fill: string;
|
|
10
|
+
fontSize: string;
|
|
11
|
+
fontFamily: string;
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
export interface RechartsTooltipTheme {
|
|
15
|
+
contentStyle: {
|
|
16
|
+
backgroundColor: string;
|
|
17
|
+
border: string;
|
|
18
|
+
borderRadius: string;
|
|
19
|
+
color: string;
|
|
20
|
+
fontSize: string;
|
|
21
|
+
fontFamily: string;
|
|
22
|
+
};
|
|
23
|
+
labelStyle: {
|
|
24
|
+
color: string;
|
|
25
|
+
fontWeight: number;
|
|
26
|
+
};
|
|
27
|
+
itemStyle: {
|
|
28
|
+
color: string;
|
|
29
|
+
};
|
|
30
|
+
cursor: {
|
|
31
|
+
stroke: string;
|
|
32
|
+
strokeDasharray: string;
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
export interface RechartsLegendTheme {
|
|
36
|
+
wrapperStyle: {
|
|
37
|
+
color: string;
|
|
38
|
+
fontSize: string;
|
|
39
|
+
fontFamily: string;
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
export interface RechartsChartTheme {
|
|
43
|
+
seriesColors: string[];
|
|
44
|
+
grid: RechartsGridTheme;
|
|
45
|
+
axis: RechartsAxisTheme;
|
|
46
|
+
tooltip: RechartsTooltipTheme;
|
|
47
|
+
legend: RechartsLegendTheme;
|
|
48
|
+
referenceLine: {
|
|
49
|
+
stroke: string;
|
|
50
|
+
strokeDasharray: string;
|
|
51
|
+
};
|
|
52
|
+
surface: string;
|
|
53
|
+
text: string;
|
|
54
|
+
muted: string;
|
|
55
|
+
}
|
|
56
|
+
export declare function buildRechartsTheme(colors: PaletteProps): RechartsChartTheme;
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.buildRechartsTheme = buildRechartsTheme;
|
|
7
|
+
const radii_1 = __importDefault(require("../primitives/radii"));
|
|
8
|
+
const chartColorsFromTheme_1 = require("./chartColorsFromTheme");
|
|
9
|
+
const FONT = "inherit";
|
|
10
|
+
const FONT_SIZE = "12px";
|
|
11
|
+
const DASH = "4 4";
|
|
12
|
+
// Reuses chartInk/getCategoricalSeriesColors — no parallel color derivation. No recharts import.
|
|
13
|
+
function buildRechartsTheme(colors) {
|
|
14
|
+
const ink = (0, chartColorsFromTheme_1.chartInk)(colors);
|
|
15
|
+
return {
|
|
16
|
+
seriesColors: (0, chartColorsFromTheme_1.getCategoricalSeriesColors)(colors),
|
|
17
|
+
grid: { stroke: ink.grid, strokeDasharray: DASH },
|
|
18
|
+
axis: {
|
|
19
|
+
stroke: ink.grid,
|
|
20
|
+
tick: { fill: ink.axis, fontSize: FONT_SIZE, fontFamily: FONT },
|
|
21
|
+
},
|
|
22
|
+
tooltip: {
|
|
23
|
+
contentStyle: {
|
|
24
|
+
backgroundColor: ink.tooltipBg,
|
|
25
|
+
border: `1px solid ${ink.grid}`,
|
|
26
|
+
borderRadius: radii_1.default.md,
|
|
27
|
+
color: ink.text,
|
|
28
|
+
fontSize: FONT_SIZE,
|
|
29
|
+
fontFamily: FONT,
|
|
30
|
+
},
|
|
31
|
+
labelStyle: { color: ink.text, fontWeight: 600 },
|
|
32
|
+
itemStyle: { color: ink.text },
|
|
33
|
+
cursor: { stroke: ink.grid, strokeDasharray: DASH },
|
|
34
|
+
},
|
|
35
|
+
legend: {
|
|
36
|
+
wrapperStyle: { color: ink.muted, fontSize: FONT_SIZE, fontFamily: FONT },
|
|
37
|
+
},
|
|
38
|
+
referenceLine: { stroke: ink.muted, strokeDasharray: DASH },
|
|
39
|
+
surface: ink.surface,
|
|
40
|
+
text: ink.text,
|
|
41
|
+
muted: ink.muted,
|
|
42
|
+
};
|
|
43
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.buildStar = exports.STAR_ON_DARK = exports.STAR_ON_LIGHT = void 0;
|
|
4
|
+
const color_1 = require("./color");
|
|
5
|
+
exports.STAR_ON_LIGHT = "#f5a70a";
|
|
6
|
+
exports.STAR_ON_DARK = "#f6b93b";
|
|
7
|
+
const buildStar = (canvas) => (0, color_1.relativeLuminance)(canvas) > 0.18 ? exports.STAR_ON_LIGHT : exports.STAR_ON_DARK;
|
|
8
|
+
exports.buildStar = buildStar;
|
|
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.isControlSize = exports.DEFAULT_CONTROL_SIZE = exports.CONTROL_SIZE_NAMES = exports.BUTTON_SIZES = exports.CONTROL_SIZES = void 0;
|
|
4
4
|
/** Height scale for form fields and selects — text inputs, pickers, anything typed or picked into. */
|
|
5
5
|
exports.CONTROL_SIZES = {
|
|
6
|
-
xs: { height: "
|
|
6
|
+
xs: { height: "2rem", fontSize: "0.75rem", paddingX: "0.5rem", iconSize: 12 },
|
|
7
7
|
sm: { height: "2.375rem", fontSize: "0.8125rem", paddingX: "0.75rem", iconSize: 14 },
|
|
8
8
|
md: { height: "2.5rem", fontSize: "0.875rem", paddingX: "1rem", iconSize: 16 },
|
|
9
9
|
lg: { height: "3rem", fontSize: "1rem", paddingX: "1.5rem", iconSize: 18 },
|
|
@@ -122,10 +122,12 @@ export type PaletteProps = {
|
|
|
122
122
|
onSemantic: SemanticTextTokens;
|
|
123
123
|
/** Dialog/drawer/popover/menu surface: `background[50]` in light, one elevation step up in dark. */
|
|
124
124
|
surfaceRaised: string;
|
|
125
|
+
/** Rating-star gold, the same hue in every brand. Decorative: always pair it with a numeric rating. */
|
|
126
|
+
star: string;
|
|
125
127
|
};
|
|
126
128
|
/** What a brand writes by hand; every token required, so a gap is a compile error. */
|
|
127
129
|
/** Derived tokens are excluded — `finalizeLightPalette` resolves them per brand. */
|
|
128
|
-
export type BrandPaletteSource = Omit<PaletteProps, "accentText" | "textMuted" | "semanticText" | "sidebar" | "onPrimary" | "onSemantic" | "focusRing" | "surfaceRaised"> & {
|
|
130
|
+
export type BrandPaletteSource = Omit<PaletteProps, "accentText" | "textMuted" | "semanticText" | "sidebar" | "onPrimary" | "onSemantic" | "focusRing" | "surfaceRaised" | "star"> & {
|
|
129
131
|
sidebar: {
|
|
130
132
|
background: ColorScale;
|
|
131
133
|
};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { RechartsAxisTheme, RechartsChartTheme, RechartsGridTheme, RechartsLegendTheme, RechartsTooltipTheme } from "./tokens/builders/rechartsTheme";
|
|
2
|
+
export type { RechartsAxisTheme, RechartsChartTheme, RechartsGridTheme, RechartsLegendTheme, RechartsTooltipTheme, };
|
|
3
|
+
export declare const useChartTheme: () => RechartsChartTheme;
|
|
4
|
+
export default useChartTheme;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.useChartTheme = void 0;
|
|
4
|
+
const react_1 = require("react");
|
|
5
|
+
const useCustomTheme_1 = require("./useCustomTheme");
|
|
6
|
+
const rechartsTheme_1 = require("./tokens/builders/rechartsTheme");
|
|
7
|
+
const useChartTheme = () => {
|
|
8
|
+
const { colors } = (0, useCustomTheme_1.useCustomTheme)();
|
|
9
|
+
return (0, react_1.useMemo)(() => (0, rechartsTheme_1.buildRechartsTheme)(colors), [colors]);
|
|
10
|
+
};
|
|
11
|
+
exports.useChartTheme = useChartTheme;
|
|
12
|
+
exports.default = exports.useChartTheme;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export type PriceFormatOptions = {
|
|
2
|
+
currency?: string;
|
|
3
|
+
locale?: string;
|
|
4
|
+
maximumFractionDigits?: number;
|
|
5
|
+
};
|
|
6
|
+
export declare const DEFAULT_CURRENCY = "INR";
|
|
7
|
+
export declare const DEFAULT_LOCALE = "en-IN";
|
|
8
|
+
export declare function formatPrice(value: number, options?: PriceFormatOptions): string;
|
|
9
|
+
export declare function discountPercent(price: number, mrp?: number): number;
|
|
10
|
+
export declare function discountAmount(price: number, mrp?: number): number;
|
|
11
|
+
export type UnitPrice = {
|
|
12
|
+
value: number;
|
|
13
|
+
per: number;
|
|
14
|
+
unit: string;
|
|
15
|
+
};
|
|
16
|
+
export declare function unitPrice(price: number, quantity: number, unit: string, per?: number): UnitPrice | null;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DEFAULT_LOCALE = exports.DEFAULT_CURRENCY = void 0;
|
|
4
|
+
exports.formatPrice = formatPrice;
|
|
5
|
+
exports.discountPercent = discountPercent;
|
|
6
|
+
exports.discountAmount = discountAmount;
|
|
7
|
+
exports.unitPrice = unitPrice;
|
|
8
|
+
exports.DEFAULT_CURRENCY = "INR";
|
|
9
|
+
exports.DEFAULT_LOCALE = "en-IN";
|
|
10
|
+
function formatPrice(value, options = {}) {
|
|
11
|
+
const { currency = exports.DEFAULT_CURRENCY, locale = exports.DEFAULT_LOCALE, maximumFractionDigits } = options;
|
|
12
|
+
const whole = Number.isInteger(value);
|
|
13
|
+
return new Intl.NumberFormat(locale, {
|
|
14
|
+
style: "currency",
|
|
15
|
+
currency,
|
|
16
|
+
minimumFractionDigits: whole ? 0 : 2,
|
|
17
|
+
maximumFractionDigits: maximumFractionDigits !== null && maximumFractionDigits !== void 0 ? maximumFractionDigits : (whole ? 0 : 2),
|
|
18
|
+
}).format(value);
|
|
19
|
+
}
|
|
20
|
+
function discountPercent(price, mrp) {
|
|
21
|
+
if (mrp === undefined || mrp <= price || mrp <= 0)
|
|
22
|
+
return 0;
|
|
23
|
+
return Math.round(((mrp - price) / mrp) * 100);
|
|
24
|
+
}
|
|
25
|
+
function discountAmount(price, mrp) {
|
|
26
|
+
if (mrp === undefined || mrp <= price)
|
|
27
|
+
return 0;
|
|
28
|
+
return mrp - price;
|
|
29
|
+
}
|
|
30
|
+
function unitPrice(price, quantity, unit, per = 1) {
|
|
31
|
+
if (!(quantity > 0))
|
|
32
|
+
return null;
|
|
33
|
+
return { value: Math.round((price / quantity) * per * 100) / 100, per, unit };
|
|
34
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useId } from "react";
|
|
3
|
+
import { Box, Flex, Text } from "@chakra-ui/react";
|
|
4
|
+
import { useCustomTheme } from "../../Theme/useCustomTheme.js";
|
|
5
|
+
import { RadioIndicator, selectableSurface, useSelectable } from "../CheckoutKit/selectable.js";
|
|
6
|
+
import Button from "../Button/Button.js";
|
|
7
|
+
import Tag from "../Tag/Tag.js";
|
|
8
|
+
const DEFAULT_LABELS = { default: "Default", edit: "Edit", remove: "Remove" };
|
|
9
|
+
/** Tonal delivery-address card: name, tags, lines and calm Edit/Remove actions; selection is a ring plus a check. */
|
|
10
|
+
const AddressCard = ({ value, name, phone, lines, tag, isDefault = false, note, selected, onSelect, onEdit, onRemove, disabled = false, labels, "data-testid": testId, }) => {
|
|
11
|
+
const { colors } = useCustomTheme();
|
|
12
|
+
const uid = useId();
|
|
13
|
+
const nameId = `${uid}-name`;
|
|
14
|
+
const bodyId = `${uid}-body`;
|
|
15
|
+
const copy = { ...DEFAULT_LABELS, ...labels };
|
|
16
|
+
const { isSelected, interactive, inGroup, ringed, props } = useSelectable({ value, selected, disabled, onSelect });
|
|
17
|
+
const selectable = inGroup || !!onSelect;
|
|
18
|
+
return (_jsxs(Flex, { direction: "column", "data-testid": testId, "data-selected": isSelected || undefined, ...selectableSurface(colors, { selected: isSelected && selectable, disabled, interactive, ringed }), children: [_jsxs(Flex, { ...props, "data-radio": true, "aria-disabled": selectable && disabled ? true : undefined, "aria-labelledby": props.role ? nameId : undefined, "aria-describedby": props.role ? bodyId : undefined, gap: 3, p: 4, pb: onEdit || onRemove ? 2 : 4, borderRadius: "1rem", cursor: interactive ? "pointer" : "default", outline: "none", align: "flex-start", children: [selectable && (_jsx(Box, { mt: 0.5, children: _jsx(RadioIndicator, { selected: isSelected }) })), _jsxs(Flex, { direction: "column", gap: 1, flex: 1, minW: 0, children: [_jsxs(Flex, { align: "center", gap: 2, wrap: "wrap", children: [_jsx(Text, { as: "span", id: nameId, fontSize: "sm", fontWeight: 700, lineHeight: 1.4, color: colors.header[900], children: name }), tag && _jsx(Tag, { label: tag, size: "xs", tone: "neutral" }), isDefault && _jsx(Tag, { label: copy.default, size: "xs", tone: "neutral" })] }), _jsxs(Box, { id: bodyId, children: [lines.map((line) => (_jsx(Text, { as: "span", display: "block", fontSize: "sm", lineHeight: 1.5, color: colors.text[800], children: line }, line))), phone && (_jsx(Text, { as: "span", display: "block", mt: 1, fontSize: "xs", lineHeight: 1.4, color: colors.textMuted, sx: { fontVariantNumeric: "tabular-nums" }, children: phone })), note && (_jsx(Text, { as: "span", display: "block", mt: 1, fontSize: "xs", lineHeight: 1.4, color: colors.textMuted, children: note }))] })] })] }), (onEdit || onRemove) && (_jsxs(Flex, { gap: 1, pl: selectable ? "2.75rem" : 1, pr: 2, pb: 2, children: [onEdit && (_jsx(Button, { variant: "ghost", colorScheme: "gray", size: "sm", onClick: onEdit, "aria-label": `${copy.edit} address: ${name}`, children: copy.edit })), onRemove && (_jsx(Button, { variant: "ghost", colorScheme: "gray", size: "sm", onClick: onRemove, "aria-label": `${copy.remove} address: ${name}`, children: copy.remove }))] }))] }));
|
|
19
|
+
};
|
|
20
|
+
export default AddressCard;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { SelectableGroup } from "../CheckoutKit/selectable.js";
|
|
3
|
+
/** Radiogroup wrapper for `AddressCard`s. */
|
|
4
|
+
const AddressCardGroup = (props) => _jsx(SelectableGroup, { ...props });
|
|
5
|
+
export default AddressCardGroup;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|