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.
Files changed (365) hide show
  1. package/CHANGELOG.md +64 -0
  2. package/COMPONENT-GOTCHAS.md +50 -22
  3. package/DESIGN-GUIDE.md +19 -2
  4. package/dist/Components/AddressCard/AddressCard.d.ts +4 -0
  5. package/dist/Components/AddressCard/AddressCard.js +25 -0
  6. package/dist/Components/AddressCard/AddressCardGroup.d.ts +4 -0
  7. package/dist/Components/AddressCard/AddressCardGroup.js +7 -0
  8. package/dist/Components/AddressCard/AddressCardProps.d.ts +43 -0
  9. package/dist/Components/AddressCard/AddressCardProps.js +2 -0
  10. package/dist/Components/BagBar/BagBar.d.ts +4 -0
  11. package/dist/Components/BagBar/BagBar.js +32 -0
  12. package/dist/Components/BagBar/BagBarProps.d.ts +30 -0
  13. package/dist/Components/BagBar/BagBarProps.js +2 -0
  14. package/dist/Components/CartItem/CartItem.d.ts +4 -0
  15. package/dist/Components/CartItem/CartItem.js +60 -0
  16. package/dist/Components/CartItem/CartItemProps.d.ts +64 -0
  17. package/dist/Components/CartItem/CartItemProps.js +2 -0
  18. package/dist/Components/CartItem/cartItemOptions.d.ts +3 -0
  19. package/dist/Components/CartItem/cartItemOptions.js +13 -0
  20. package/dist/Components/CheckoutKit/selectable.d.ts +58 -0
  21. package/dist/Components/CheckoutKit/selectable.js +120 -0
  22. package/dist/Components/Commerce/commerceTypes.d.ts +52 -0
  23. package/dist/Components/Commerce/commerceTypes.js +2 -0
  24. package/dist/Components/Commerce/commerceVariants.d.ts +13 -0
  25. package/dist/Components/Commerce/commerceVariants.js +51 -0
  26. package/dist/Components/Commerce/index.d.ts +2 -0
  27. package/dist/Components/Commerce/index.js +18 -0
  28. package/dist/Components/Commerce/useContainerWidth.d.ts +3 -0
  29. package/dist/Components/Commerce/useContainerWidth.js +25 -0
  30. package/dist/Components/CouponField/CouponField.d.ts +4 -0
  31. package/dist/Components/CouponField/CouponField.js +72 -0
  32. package/dist/Components/CouponField/CouponFieldProps.d.ts +49 -0
  33. package/dist/Components/CouponField/CouponFieldProps.js +2 -0
  34. package/dist/Components/DatePicker/DatePickerProps.d.ts +1 -1
  35. package/dist/Components/DatePicker/PickerPortal.d.ts +11 -0
  36. package/dist/Components/DatePicker/PickerPortal.js +26 -0
  37. package/dist/Components/DatePicker/RangeDatePicker.d.ts +1 -1
  38. package/dist/Components/DatePicker/RangeDatePicker.js +67 -32
  39. package/dist/Components/DatePicker/SingleDatePicker.js +49 -13
  40. package/dist/Components/DatePicker/TimeOnlyPicker.js +39 -4
  41. package/dist/Components/DetailSections/DetailSections.d.ts +4 -0
  42. package/dist/Components/DetailSections/DetailSections.js +112 -0
  43. package/dist/Components/DetailSections/DetailSectionsProps.d.ts +58 -0
  44. package/dist/Components/DetailSections/DetailSectionsProps.js +2 -0
  45. package/dist/Components/Input/PhoneNumberInputProps.d.ts +1 -1
  46. package/dist/Components/MediaGallery/MediaFrame.d.ts +31 -0
  47. package/dist/Components/MediaGallery/MediaFrame.js +55 -0
  48. package/dist/Components/MediaGallery/MediaGallery.d.ts +4 -0
  49. package/dist/Components/MediaGallery/MediaGallery.js +206 -0
  50. package/dist/Components/MediaGallery/MediaGalleryProps.d.ts +76 -0
  51. package/dist/Components/MediaGallery/MediaGalleryProps.js +20 -0
  52. package/dist/Components/MediaGallery/MediaLightbox.d.ts +4 -0
  53. package/dist/Components/MediaGallery/MediaLightbox.js +116 -0
  54. package/dist/Components/MediaGallery/MediaLightboxProps.d.ts +40 -0
  55. package/dist/Components/MediaGallery/MediaLightboxProps.js +15 -0
  56. package/dist/Components/MediaGallery/MediaThumb.d.ts +18 -0
  57. package/dist/Components/MediaGallery/MediaThumb.js +25 -0
  58. package/dist/Components/MediaGallery/glass.d.ts +31 -0
  59. package/dist/Components/MediaGallery/glass.js +47 -0
  60. package/dist/Components/MediaGallery/mediaGalleryModel.d.ts +22 -0
  61. package/dist/Components/MediaGallery/mediaGalleryModel.js +83 -0
  62. package/dist/Components/MediaGallery/motion.d.ts +5 -0
  63. package/dist/Components/MediaGallery/motion.js +12 -0
  64. package/dist/Components/MediaGallery/useMatchMedia.d.ts +2 -0
  65. package/dist/Components/MediaGallery/useMatchMedia.js +20 -0
  66. package/dist/Components/MultiSelect/MultiSelectProps.d.ts +1 -1
  67. package/dist/Components/OffersList/OffersList.d.ts +4 -0
  68. package/dist/Components/OffersList/OffersList.js +83 -0
  69. package/dist/Components/OffersList/OffersListProps.d.ts +34 -0
  70. package/dist/Components/OffersList/OffersListProps.js +2 -0
  71. package/dist/Components/OptionChip/OptionChip.d.ts +4 -0
  72. package/dist/Components/OptionChip/OptionChip.js +97 -0
  73. package/dist/Components/OptionChip/OptionChipProps.d.ts +33 -0
  74. package/dist/Components/OptionChip/OptionChipProps.js +2 -0
  75. package/dist/Components/OptionChip/optionInk.d.ts +12 -0
  76. package/dist/Components/OptionChip/optionInk.js +25 -0
  77. package/dist/Components/OrderStatusTimeline/OrderStatusTimeline.d.ts +4 -0
  78. package/dist/Components/OrderStatusTimeline/OrderStatusTimeline.js +57 -0
  79. package/dist/Components/OrderStatusTimeline/OrderStatusTimelineProps.d.ts +29 -0
  80. package/dist/Components/OrderStatusTimeline/OrderStatusTimelineProps.js +2 -0
  81. package/dist/Components/OrderSummary/OrderSummary.d.ts +4 -0
  82. package/dist/Components/OrderSummary/OrderSummary.js +63 -0
  83. package/dist/Components/OrderSummary/OrderSummaryProps.d.ts +53 -0
  84. package/dist/Components/OrderSummary/OrderSummaryProps.js +2 -0
  85. package/dist/Components/PaymentOption/PaymentOption.d.ts +4 -0
  86. package/dist/Components/PaymentOption/PaymentOption.js +24 -0
  87. package/dist/Components/PaymentOption/PaymentOptionGroup.d.ts +4 -0
  88. package/dist/Components/PaymentOption/PaymentOptionGroup.js +7 -0
  89. package/dist/Components/PaymentOption/PaymentOptionProps.d.ts +32 -0
  90. package/dist/Components/PaymentOption/PaymentOptionProps.js +2 -0
  91. package/dist/Components/PinInput/PinInputProps.d.ts +1 -1
  92. package/dist/Components/PincodeChecker/PincodeChecker.d.ts +4 -0
  93. package/dist/Components/PincodeChecker/PincodeChecker.js +175 -0
  94. package/dist/Components/PincodeChecker/PincodeCheckerProps.d.ts +57 -0
  95. package/dist/Components/PincodeChecker/PincodeCheckerProps.js +2 -0
  96. package/dist/Components/PriceBlock/PriceBlock.d.ts +4 -0
  97. package/dist/Components/PriceBlock/PriceBlock.js +41 -0
  98. package/dist/Components/PriceBlock/PriceBlockProps.d.ts +39 -0
  99. package/dist/Components/PriceBlock/PriceBlockProps.js +2 -0
  100. package/dist/Components/ProductBadges/ProductBadges.d.ts +4 -0
  101. package/dist/Components/ProductBadges/ProductBadges.js +61 -0
  102. package/dist/Components/ProductBadges/ProductBadgesProps.d.ts +18 -0
  103. package/dist/Components/ProductBadges/ProductBadgesProps.js +2 -0
  104. package/dist/Components/ProductCard/ProductCard.d.ts +3 -2
  105. package/dist/Components/ProductCard/ProductCard.js +103 -52
  106. package/dist/Components/ProductCard/ProductCardAction.d.ts +17 -0
  107. package/dist/Components/ProductCard/ProductCardAction.js +65 -0
  108. package/dist/Components/ProductCard/ProductCardGrid.d.ts +4 -0
  109. package/dist/Components/ProductCard/ProductCardGrid.js +20 -0
  110. package/dist/Components/ProductCard/ProductCardMedia.d.ts +18 -0
  111. package/dist/Components/ProductCard/ProductCardMedia.js +35 -0
  112. package/dist/Components/ProductCard/ProductCardProps.d.ts +138 -56
  113. package/dist/Components/ProductCard/ProductCardSkeleton.d.ts +4 -0
  114. package/dist/Components/ProductCard/ProductCardSkeleton.js +17 -0
  115. package/dist/Components/ProductCard/ProductCardSwatches.d.ts +15 -0
  116. package/dist/Components/ProductCard/ProductCardSwatches.js +37 -0
  117. package/dist/Components/ProductCard/QuickAddSheet.d.ts +4 -0
  118. package/dist/Components/ProductCard/QuickAddSheet.js +109 -0
  119. package/dist/Components/ProductCard/QuickAddSheetProps.d.ts +38 -0
  120. package/dist/Components/ProductCard/QuickAddSheetProps.js +2 -0
  121. package/dist/Components/ProductCard/cardLabels.d.ts +2 -0
  122. package/dist/Components/ProductCard/cardLabels.js +16 -0
  123. package/dist/Components/ProductCard/cardMetrics.d.ts +27 -0
  124. package/dist/Components/ProductCard/cardMetrics.js +55 -0
  125. package/dist/Components/ProductCard/productCardFixtures.d.ts +7 -0
  126. package/dist/Components/ProductCard/productCardFixtures.js +61 -0
  127. package/dist/Components/ProductCard/productCardModel.d.ts +22 -0
  128. package/dist/Components/ProductCard/productCardModel.js +79 -0
  129. package/dist/Components/ProductCard/useMinWidth.d.ts +2 -0
  130. package/dist/Components/ProductCard/useMinWidth.js +20 -0
  131. package/dist/Components/ProductDetails/ProductDetails.d.ts +3 -2
  132. package/dist/Components/ProductDetails/ProductDetails.js +209 -33
  133. package/dist/Components/ProductDetails/ProductDetailsProps.d.ts +143 -41
  134. package/dist/Components/ProductDetails/productDetailsModel.d.ts +14 -0
  135. package/dist/Components/ProductDetails/productDetailsModel.js +45 -0
  136. package/dist/Components/ProductDetails/useInViewport.d.ts +3 -0
  137. package/dist/Components/ProductDetails/useInViewport.js +18 -0
  138. package/dist/Components/QuantityStepper/QuantityStepper.d.ts +4 -0
  139. package/dist/Components/QuantityStepper/QuantityStepper.js +59 -0
  140. package/dist/Components/QuantityStepper/QuantityStepperProps.d.ts +24 -0
  141. package/dist/Components/QuantityStepper/QuantityStepperProps.js +2 -0
  142. package/dist/Components/Rating/Rating.d.ts +4 -0
  143. package/dist/Components/Rating/Rating.js +81 -0
  144. package/dist/Components/Rating/RatingProps.d.ts +27 -0
  145. package/dist/Components/Rating/RatingProps.js +2 -0
  146. package/dist/Components/ReviewList/ReviewList.d.ts +4 -0
  147. package/dist/Components/ReviewList/ReviewList.js +94 -0
  148. package/dist/Components/ReviewList/ReviewListProps.d.ts +68 -0
  149. package/dist/Components/ReviewList/ReviewListProps.js +2 -0
  150. package/dist/Components/ReviewSummary/ReviewSummary.d.ts +4 -0
  151. package/dist/Components/ReviewSummary/ReviewSummary.js +47 -0
  152. package/dist/Components/ReviewSummary/ReviewSummaryProps.d.ts +31 -0
  153. package/dist/Components/ReviewSummary/ReviewSummaryProps.js +2 -0
  154. package/dist/Components/Search/SearchProps.d.ts +1 -1
  155. package/dist/Components/SearchSelect/SearchSelectProps.d.ts +1 -1
  156. package/dist/Components/SegmentedControl/SegmentedControl.d.ts +1 -1
  157. package/dist/Components/SegmentedControl/SegmentedControl.js +17 -5
  158. package/dist/Components/SegmentedControl/SegmentedControlProps.d.ts +6 -0
  159. package/dist/Components/SegmentedControl/segmentedInk.d.ts +2 -0
  160. package/dist/Components/SegmentedControl/segmentedInk.js +4 -1
  161. package/dist/Components/SegmentedControl/useSlidingPill.d.ts +2 -0
  162. package/dist/Components/SegmentedControl/useSlidingPill.js +6 -1
  163. package/dist/Components/Select/SelectProps.d.ts +1 -1
  164. package/dist/Components/SelectSearch/SelectSearchProps.d.ts +1 -1
  165. package/dist/Components/SelectV2/SelectV2Props.d.ts +1 -1
  166. package/dist/Components/SideBar/SecondaryBar.js +13 -8
  167. package/dist/Components/SideBar/SideBarProps.d.ts +3 -1
  168. package/dist/Components/SideBar/components/MenuItemBox.js +47 -10
  169. package/dist/Components/SideBar/components/MenuPopoverContent.js +4 -3
  170. package/dist/Components/SpecTable/SpecTable.d.ts +4 -0
  171. package/dist/Components/SpecTable/SpecTable.js +39 -0
  172. package/dist/Components/SpecTable/SpecTableProps.d.ts +25 -0
  173. package/dist/Components/SpecTable/SpecTableProps.js +2 -0
  174. package/dist/Components/Spinner/Spinner.d.ts +1 -1
  175. package/dist/Components/Spinner/Spinner.js +2 -2
  176. package/dist/Components/Spinner/SpinnerProps.d.ts +2 -0
  177. package/dist/Components/StageProgress/StepperStage.js +2 -1
  178. package/dist/Components/StatCard/StatCard.d.ts +1 -1
  179. package/dist/Components/StatCard/StatCard.js +2 -2
  180. package/dist/Components/StatCard/StatCardProps.d.ts +4 -0
  181. package/dist/Components/StickyBuyBar/StickyBuyBar.d.ts +3 -0
  182. package/dist/Components/StickyBuyBar/StickyBuyBar.js +85 -0
  183. package/dist/Components/StickyBuyBar/StickyBuyBarProps.d.ts +54 -0
  184. package/dist/Components/StickyBuyBar/StickyBuyBarProps.js +2 -0
  185. package/dist/Components/StockStatus/StockStatus.d.ts +4 -0
  186. package/dist/Components/StockStatus/StockStatus.js +31 -0
  187. package/dist/Components/StockStatus/StockStatusProps.d.ts +14 -0
  188. package/dist/Components/StockStatus/StockStatusProps.js +2 -0
  189. package/dist/Components/Table/Table.js +2 -1
  190. package/dist/Components/Table/TableProps.d.ts +5 -2
  191. package/dist/Components/Table/columnLabel.d.ts +6 -0
  192. package/dist/Components/Table/columnLabel.js +27 -0
  193. package/dist/Components/Table/components/TableBody.js +5 -1
  194. package/dist/Components/Table/components/TableHeader.js +3 -2
  195. package/dist/Components/Table/filters/ActiveFilters.js +2 -1
  196. package/dist/Components/Table/filters/TableFilters.js +2 -1
  197. package/dist/Components/Table/hooks/useTable.js +3 -2
  198. package/dist/Components/Table/settings/ManageColumns.js +4 -3
  199. package/dist/Components/Table/settings/TableSettings.js +2 -1
  200. package/dist/Components/TrustBadges/TrustBadges.d.ts +4 -0
  201. package/dist/Components/TrustBadges/TrustBadges.js +24 -0
  202. package/dist/Components/TrustBadges/TrustBadgesProps.d.ts +20 -0
  203. package/dist/Components/TrustBadges/TrustBadgesProps.js +2 -0
  204. package/dist/Components/VariantSelector/VariantSelector.d.ts +4 -0
  205. package/dist/Components/VariantSelector/VariantSelector.js +123 -0
  206. package/dist/Components/VariantSelector/VariantSelectorProps.d.ts +27 -0
  207. package/dist/Components/VariantSelector/VariantSelectorProps.js +2 -0
  208. package/dist/Components/VariantSelector/variantSelection.d.ts +6 -0
  209. package/dist/Components/VariantSelector/variantSelection.js +25 -0
  210. package/dist/Components/WishlistToggle/WishlistToggle.d.ts +4 -0
  211. package/dist/Components/WishlistToggle/WishlistToggle.js +65 -0
  212. package/dist/Components/WishlistToggle/WishlistToggleProps.d.ts +19 -0
  213. package/dist/Components/WishlistToggle/WishlistToggleProps.js +2 -0
  214. package/dist/Theme/assertPalette.d.ts +1 -1
  215. package/dist/Theme/assertPalette.js +1 -1
  216. package/dist/Theme/tokens/brands/index.js +2 -0
  217. package/dist/Theme/tokens/brands/zinc/palette.dark.d.ts +1 -0
  218. package/dist/Theme/tokens/builders/buildDarkPalette.js +2 -0
  219. package/dist/Theme/tokens/builders/index.d.ts +1 -0
  220. package/dist/Theme/tokens/builders/index.js +1 -0
  221. package/dist/Theme/tokens/builders/rechartsTheme.d.ts +56 -0
  222. package/dist/Theme/tokens/builders/rechartsTheme.js +43 -0
  223. package/dist/Theme/tokens/builders/star.d.ts +3 -0
  224. package/dist/Theme/tokens/builders/star.js +8 -0
  225. package/dist/Theme/tokens/primitives/controlSizes.js +1 -1
  226. package/dist/Theme/tokens/types.d.ts +3 -1
  227. package/dist/Theme/useChartTheme.d.ts +4 -0
  228. package/dist/Theme/useChartTheme.js +12 -0
  229. package/dist/Utils/price.d.ts +16 -0
  230. package/dist/Utils/price.js +34 -0
  231. package/dist/esm/Components/AddressCard/AddressCard.js +20 -0
  232. package/dist/esm/Components/AddressCard/AddressCardGroup.js +5 -0
  233. package/dist/esm/Components/AddressCard/AddressCardProps.js +1 -0
  234. package/dist/esm/Components/BagBar/BagBar.js +27 -0
  235. package/dist/esm/Components/BagBar/BagBarProps.js +1 -0
  236. package/dist/esm/Components/CartItem/CartItem.js +55 -0
  237. package/dist/esm/Components/CartItem/CartItemProps.js +1 -0
  238. package/dist/esm/Components/CartItem/cartItemOptions.js +9 -0
  239. package/dist/esm/Components/CheckoutKit/selectable.js +112 -0
  240. package/dist/esm/Components/Commerce/commerceTypes.js +1 -0
  241. package/dist/esm/Components/Commerce/commerceVariants.js +41 -0
  242. package/dist/esm/Components/Commerce/index.js +2 -0
  243. package/dist/esm/Components/Commerce/useContainerWidth.js +21 -0
  244. package/dist/esm/Components/CouponField/CouponField.js +67 -0
  245. package/dist/esm/Components/CouponField/CouponFieldProps.js +1 -0
  246. package/dist/esm/Components/DatePicker/PickerPortal.js +21 -0
  247. package/dist/esm/Components/DatePicker/RangeDatePicker.js +34 -32
  248. package/dist/esm/Components/DatePicker/SingleDatePicker.js +16 -13
  249. package/dist/esm/Components/DatePicker/TimeOnlyPicker.js +6 -4
  250. package/dist/esm/Components/DetailSections/DetailSections.js +107 -0
  251. package/dist/esm/Components/DetailSections/DetailSectionsProps.js +1 -0
  252. package/dist/esm/Components/MediaGallery/MediaFrame.js +48 -0
  253. package/dist/esm/Components/MediaGallery/MediaGallery.js +201 -0
  254. package/dist/esm/Components/MediaGallery/MediaGalleryProps.js +17 -0
  255. package/dist/esm/Components/MediaGallery/MediaLightbox.js +78 -0
  256. package/dist/esm/Components/MediaGallery/MediaLightboxProps.js +12 -0
  257. package/dist/esm/Components/MediaGallery/MediaThumb.js +23 -0
  258. package/dist/esm/Components/MediaGallery/glass.js +42 -0
  259. package/dist/esm/Components/MediaGallery/mediaGalleryModel.js +71 -0
  260. package/dist/esm/Components/MediaGallery/motion.js +8 -0
  261. package/dist/esm/Components/MediaGallery/useMatchMedia.js +16 -0
  262. package/dist/esm/Components/OffersList/OffersList.js +81 -0
  263. package/dist/esm/Components/OffersList/OffersListProps.js +1 -0
  264. package/dist/esm/Components/OptionChip/OptionChip.js +95 -0
  265. package/dist/esm/Components/OptionChip/OptionChipProps.js +1 -0
  266. package/dist/esm/Components/OptionChip/optionInk.js +21 -0
  267. package/dist/esm/Components/OrderStatusTimeline/OrderStatusTimeline.js +55 -0
  268. package/dist/esm/Components/OrderStatusTimeline/OrderStatusTimelineProps.js +1 -0
  269. package/dist/esm/Components/OrderSummary/OrderSummary.js +58 -0
  270. package/dist/esm/Components/OrderSummary/OrderSummaryProps.js +1 -0
  271. package/dist/esm/Components/PaymentOption/PaymentOption.js +19 -0
  272. package/dist/esm/Components/PaymentOption/PaymentOptionGroup.js +5 -0
  273. package/dist/esm/Components/PaymentOption/PaymentOptionProps.js +1 -0
  274. package/dist/esm/Components/PincodeChecker/PincodeChecker.js +170 -0
  275. package/dist/esm/Components/PincodeChecker/PincodeCheckerProps.js +1 -0
  276. package/dist/esm/Components/PriceBlock/PriceBlock.js +39 -0
  277. package/dist/esm/Components/PriceBlock/PriceBlockProps.js +1 -0
  278. package/dist/esm/Components/ProductBadges/ProductBadges.js +59 -0
  279. package/dist/esm/Components/ProductBadges/ProductBadgesProps.js +1 -0
  280. package/dist/esm/Components/ProductCard/ProductCard.js +105 -54
  281. package/dist/esm/Components/ProductCard/ProductCardAction.js +60 -0
  282. package/dist/esm/Components/ProductCard/ProductCardGrid.js +18 -0
  283. package/dist/esm/Components/ProductCard/ProductCardMedia.js +33 -0
  284. package/dist/esm/Components/ProductCard/ProductCardSkeleton.js +12 -0
  285. package/dist/esm/Components/ProductCard/ProductCardSwatches.js +35 -0
  286. package/dist/esm/Components/ProductCard/QuickAddSheet.js +71 -0
  287. package/dist/esm/Components/ProductCard/QuickAddSheetProps.js +1 -0
  288. package/dist/esm/Components/ProductCard/cardLabels.js +13 -0
  289. package/dist/esm/Components/ProductCard/cardMetrics.js +52 -0
  290. package/dist/esm/Components/ProductCard/productCardFixtures.js +58 -0
  291. package/dist/esm/Components/ProductCard/productCardModel.js +65 -0
  292. package/dist/esm/Components/ProductCard/useMinWidth.js +16 -0
  293. package/dist/esm/Components/ProductDetails/ProductDetails.js +210 -34
  294. package/dist/esm/Components/ProductDetails/productDetailsModel.js +35 -0
  295. package/dist/esm/Components/ProductDetails/useInViewport.js +14 -0
  296. package/dist/esm/Components/QuantityStepper/QuantityStepper.js +57 -0
  297. package/dist/esm/Components/QuantityStepper/QuantityStepperProps.js +1 -0
  298. package/dist/esm/Components/Rating/Rating.js +79 -0
  299. package/dist/esm/Components/Rating/RatingProps.js +1 -0
  300. package/dist/esm/Components/ReviewList/ReviewList.js +89 -0
  301. package/dist/esm/Components/ReviewList/ReviewListProps.js +1 -0
  302. package/dist/esm/Components/ReviewSummary/ReviewSummary.js +42 -0
  303. package/dist/esm/Components/ReviewSummary/ReviewSummaryProps.js +1 -0
  304. package/dist/esm/Components/SegmentedControl/SegmentedControl.js +19 -7
  305. package/dist/esm/Components/SegmentedControl/segmentedInk.js +2 -0
  306. package/dist/esm/Components/SegmentedControl/useSlidingPill.js +6 -1
  307. package/dist/esm/Components/SideBar/SecondaryBar.js +14 -9
  308. package/dist/esm/Components/SideBar/components/MenuItemBox.js +14 -10
  309. package/dist/esm/Components/SideBar/components/MenuPopoverContent.js +4 -3
  310. package/dist/esm/Components/SpecTable/SpecTable.js +34 -0
  311. package/dist/esm/Components/SpecTable/SpecTableProps.js +1 -0
  312. package/dist/esm/Components/Spinner/Spinner.js +2 -2
  313. package/dist/esm/Components/StageProgress/StepperStage.js +2 -1
  314. package/dist/esm/Components/StatCard/StatCard.js +2 -2
  315. package/dist/esm/Components/StickyBuyBar/StickyBuyBar.js +80 -0
  316. package/dist/esm/Components/StickyBuyBar/StickyBuyBarProps.js +1 -0
  317. package/dist/esm/Components/StockStatus/StockStatus.js +29 -0
  318. package/dist/esm/Components/StockStatus/StockStatusProps.js +1 -0
  319. package/dist/esm/Components/Table/Table.js +2 -1
  320. package/dist/esm/Components/Table/columnLabel.js +21 -0
  321. package/dist/esm/Components/Table/components/TableBody.js +5 -1
  322. package/dist/esm/Components/Table/components/TableHeader.js +3 -2
  323. package/dist/esm/Components/Table/filters/ActiveFilters.js +2 -1
  324. package/dist/esm/Components/Table/filters/TableFilters.js +2 -1
  325. package/dist/esm/Components/Table/hooks/useTable.js +3 -2
  326. package/dist/esm/Components/Table/settings/ManageColumns.js +4 -3
  327. package/dist/esm/Components/Table/settings/TableSettings.js +2 -1
  328. package/dist/esm/Components/TrustBadges/TrustBadges.js +22 -0
  329. package/dist/esm/Components/TrustBadges/TrustBadgesProps.js +1 -0
  330. package/dist/esm/Components/VariantSelector/VariantSelector.js +118 -0
  331. package/dist/esm/Components/VariantSelector/VariantSelectorProps.js +1 -0
  332. package/dist/esm/Components/VariantSelector/variantSelection.js +19 -0
  333. package/dist/esm/Components/WishlistToggle/WishlistToggle.js +63 -0
  334. package/dist/esm/Components/WishlistToggle/WishlistToggleProps.js +1 -0
  335. package/dist/esm/Theme/assertPalette.js +1 -1
  336. package/dist/esm/Theme/tokens/brands/index.js +2 -0
  337. package/dist/esm/Theme/tokens/builders/buildDarkPalette.js +2 -0
  338. package/dist/esm/Theme/tokens/builders/index.js +1 -0
  339. package/dist/esm/Theme/tokens/builders/rechartsTheme.js +37 -0
  340. package/dist/esm/Theme/tokens/builders/star.js +4 -0
  341. package/dist/esm/Theme/tokens/primitives/controlSizes.js +1 -1
  342. package/dist/esm/Theme/useChartTheme.js +8 -0
  343. package/dist/esm/Utils/price.js +27 -0
  344. package/dist/esm/index.js +36 -0
  345. package/dist/index.d.ts +66 -0
  346. package/dist/index.js +86 -4
  347. package/package.json +1 -1
  348. package/dist/Components/ProductCard/ProductLabel.d.ts +0 -7
  349. package/dist/Components/ProductCard/ProductLabel.js +0 -20
  350. package/dist/Components/ProductCard/ProductPrice.d.ts +0 -10
  351. package/dist/Components/ProductCard/ProductPrice.js +0 -126
  352. package/dist/Components/ProductCard/ProductReview.d.ts +0 -8
  353. package/dist/Components/ProductCard/ProductReview.js +0 -30
  354. package/dist/Components/ProductCard/ProductTags.d.ts +0 -8
  355. package/dist/Components/ProductCard/ProductTags.js +0 -53
  356. package/dist/Components/ProductDetails/ProductDtlPrice.d.ts +0 -7
  357. package/dist/Components/ProductDetails/ProductDtlPrice.js +0 -24
  358. package/dist/Components/ProductDetails/ProductImageSlider.d.ts +0 -13
  359. package/dist/Components/ProductDetails/ProductImageSlider.js +0 -240
  360. package/dist/esm/Components/ProductCard/ProductLabel.js +0 -18
  361. package/dist/esm/Components/ProductCard/ProductPrice.js +0 -121
  362. package/dist/esm/Components/ProductCard/ProductReview.js +0 -28
  363. package/dist/esm/Components/ProductCard/ProductTags.js +0 -48
  364. package/dist/esm/Components/ProductDetails/ProductDtlPrice.js +0 -22
  365. package/dist/esm/Components/ProductDetails/ProductImageSlider.js +0 -204
@@ -0,0 +1,45 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.clampQuantity = exports.quantityCeiling = exports.soldOutEverywhere = exports.firstUnpickedAxis = exports.packUnitPrice = exports.activeMediaIds = exports.resolveVariants = exports.DEFAULT_MAX_QUANTITY = void 0;
4
+ const commerceVariants_1 = require("../Commerce/commerceVariants");
5
+ const price_1 = require("../../Utils/price");
6
+ exports.DEFAULT_MAX_QUANTITY = 10;
7
+ /** A product without variants sells as one variant at its own price. */
8
+ const resolveVariants = (product) => product.variants.length > 0
9
+ ? product.variants
10
+ : [{ id: "default", options: {}, price: product.price, mrp: product.mrp }];
11
+ exports.resolveVariants = resolveVariants;
12
+ /** A variant's own frames win; otherwise the frames of each picked option, in axis order. */
13
+ const activeMediaIds = (product, selection, variant) => {
14
+ if ((variant === null || variant === void 0 ? void 0 : variant.mediaIds) && variant.mediaIds.length > 0)
15
+ return variant.mediaIds;
16
+ const byOption = product.mediaIdsByOption;
17
+ if (!byOption)
18
+ return undefined;
19
+ const ids = product.axes.flatMap((axis) => { var _a; return (_a = byOption[`${axis.id}:${selection[axis.id]}`]) !== null && _a !== void 0 ? _a : []; });
20
+ return ids.length > 0 ? [...new Set(ids)] : undefined;
21
+ };
22
+ exports.activeMediaIds = activeMediaIds;
23
+ const packUnitPrice = (product, selection, price) => {
24
+ if (!product.unit)
25
+ return null;
26
+ const axis = product.axes.find((candidate) => candidate.type === "pack");
27
+ const picked = axis === null || axis === void 0 ? void 0 : axis.values.find((value) => value.id === selection[axis.id]);
28
+ if (!(picked === null || picked === void 0 ? void 0 : picked.quantity))
29
+ return null;
30
+ return (0, price_1.unitPrice)(price, picked.quantity, product.unit.unit, product.unit.per);
31
+ };
32
+ exports.packUnitPrice = packUnitPrice;
33
+ const firstUnpickedAxis = (axes, selection) => axes.find((axis) => selection[axis.id] === undefined);
34
+ exports.firstUnpickedAxis = firstUnpickedAxis;
35
+ const soldOutEverywhere = (variants) => variants.length > 0 && variants.every((variant) => (0, commerceVariants_1.stockState)(variant) === "out-of-stock");
36
+ exports.soldOutEverywhere = soldOutEverywhere;
37
+ /** Real remaining stock caps the order; backorder and untracked stock fall back to the per-order ceiling. */
38
+ const quantityCeiling = (variant, maxQuantity) => {
39
+ if ((variant === null || variant === void 0 ? void 0 : variant.stock) === undefined || variant.backorder)
40
+ return maxQuantity;
41
+ return Math.max(0, Math.min(variant.stock, maxQuantity));
42
+ };
43
+ exports.quantityCeiling = quantityCeiling;
44
+ const clampQuantity = (value, ceiling) => Math.max(1, Math.min(value, Math.max(1, ceiling)));
45
+ exports.clampQuantity = clampQuantity;
@@ -0,0 +1,3 @@
1
+ import type { RefObject } from "react";
2
+ /** Whether the element is on screen; true until an observer reports otherwise, and always true where IntersectionObserver is missing. */
3
+ export declare const useInViewport: (ref: RefObject<Element>, enabled?: boolean) => boolean;
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.useInViewport = void 0;
4
+ const react_1 = require("react");
5
+ /** Whether the element is on screen; true until an observer reports otherwise, and always true where IntersectionObserver is missing. */
6
+ const useInViewport = (ref, enabled = true) => {
7
+ const [inView, setInView] = (0, react_1.useState)(true);
8
+ (0, react_1.useEffect)(() => {
9
+ const node = ref.current;
10
+ if (!enabled || !node || typeof IntersectionObserver === "undefined")
11
+ return undefined;
12
+ const observer = new IntersectionObserver(([entry]) => setInView(entry.isIntersecting));
13
+ observer.observe(node);
14
+ return () => observer.disconnect();
15
+ }, [ref, enabled]);
16
+ return inView;
17
+ };
18
+ exports.useInViewport = useInViewport;
@@ -0,0 +1,4 @@
1
+ import type { QuantityStepperProps } from "./QuantityStepperProps";
2
+ /** Pill stepper for quantities: soft or outline, trash at the floor on cart lines, limits announced via aria-disabled. */
3
+ declare const QuantityStepper: ({ value, defaultValue, onValueChange, min, max, step, size, variant, removable, onRemove, disabled, itemLabel, "data-testid": testId, }: QuantityStepperProps) => import("react/jsx-runtime").JSX.Element;
4
+ export default QuantityStepper;
@@ -0,0 +1,59 @@
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 lucide_react_1 = require("lucide-react");
7
+ const useCustomTheme_1 = require("../../Theme/useCustomTheme");
8
+ const controlSizes_1 = require("../../Theme/tokens/primitives/controlSizes");
9
+ const motion_1 = require("../../Theme/tokens/primitives/motion");
10
+ const motion_2 = require("../../Theme/chakra/motion");
11
+ const focusRing_styles_1 = require("../../Theme/chakra/focusRing.styles");
12
+ const MIN_HIT = "2.75rem";
13
+ const LIMIT_OPACITY = 0.4;
14
+ const clamp = (n, min, max) => Math.max(min, max === undefined ? n : Math.min(max, n));
15
+ /** Pill stepper for quantities: soft or outline, trash at the floor on cart lines, limits announced via aria-disabled. */
16
+ const QuantityStepper = ({ value, defaultValue, onValueChange, min = 1, max, step = 1, size = "md", variant = "soft", removable = false, onRemove, disabled = false, itemLabel, "data-testid": testId, }) => {
17
+ const { colors } = (0, useCustomTheme_1.useCustomTheme)();
18
+ const spec = controlSizes_1.BUTTON_SIZES[size];
19
+ const [inner, setInner] = (0, react_1.useState)(defaultValue !== null && defaultValue !== void 0 ? defaultValue : min);
20
+ const current = value !== null && value !== void 0 ? value : inner;
21
+ const atMin = current <= min;
22
+ const atMax = max !== undefined && current >= max;
23
+ const trash = removable && atMin;
24
+ const subject = itemLabel ? ` of ${itemLabel}` : "";
25
+ const change = (direction) => {
26
+ const next = clamp(current + direction * step, min, max);
27
+ if (next === current)
28
+ return;
29
+ if (value === undefined)
30
+ setInner(next);
31
+ onValueChange === null || onValueChange === void 0 ? void 0 : onValueChange(next);
32
+ };
33
+ const surface = variant === "outline"
34
+ ? { bg: "transparent", boxShadow: `inset 0 0 0 1px ${colors.boxborder[500]}` }
35
+ : { bg: colors.background[100], boxShadow: "none" };
36
+ const button = (kind) => {
37
+ const limited = kind === "dec" ? atMin && !trash : atMax;
38
+ const Icon = kind === "inc" ? lucide_react_1.Plus : trash ? lucide_react_1.Trash2 : lucide_react_1.Minus;
39
+ const label = kind === "inc" ? `Increase quantity${subject}` : trash ? `Remove${itemLabel ? ` ${itemLabel}` : ""}` : `Decrease quantity${subject}`;
40
+ return ((0, jsx_runtime_1.jsx)(react_2.Box, { as: "button", type: "button", "aria-label": label, "aria-disabled": limited || undefined, disabled: disabled, "data-testid": testId ? `${testId}-${kind}` : undefined, onClick: () => {
41
+ if (limited)
42
+ return;
43
+ if (kind === "dec" && trash)
44
+ onRemove === null || onRemove === void 0 ? void 0 : onRemove();
45
+ else
46
+ change(kind === "inc" ? 1 : -1);
47
+ }, position: "relative", display: "inline-flex", alignItems: "center", justifyContent: "center", flexShrink: 0, boxSize: spec.height, borderRadius: "full", color: colors.header[900], opacity: limited || disabled ? LIMIT_OPACITY : 1, cursor: limited || disabled ? "not-allowed" : "pointer", transition: (0, motion_1.transitionFor)(["background-color", "transform", "opacity"]), _hover: limited || disabled ? undefined : { bg: colors.background[200] }, _active: limited || disabled ? undefined : { transform: "scale(0.96)" }, sx: {
48
+ ...(0, focusRing_styles_1.focusVisibleStyles)(colors),
49
+ ...(0, motion_2.reducedMotionSx)({ "&:active": { transform: "none" } }),
50
+ "&::before": {
51
+ content: '""',
52
+ position: "absolute",
53
+ inset: `max(0px, calc((${MIN_HIT} - ${spec.height}) / -2))`,
54
+ },
55
+ }, children: (0, jsx_runtime_1.jsx)(Icon, { size: spec.iconSize, "aria-hidden": true }) }));
56
+ };
57
+ return ((0, jsx_runtime_1.jsxs)(react_2.Flex, { role: "group", "aria-label": `Quantity${subject}`, display: "inline-flex", align: "center", h: spec.height, borderRadius: "full", ...surface, "data-testid": testId, children: [button("dec"), (0, jsx_runtime_1.jsx)(react_2.Text, { as: "span", "aria-live": "polite", "aria-atomic": "true", minW: "1.75rem", textAlign: "center", fontSize: spec.fontSize, fontWeight: 600, color: colors.header[900], sx: { fontVariantNumeric: "tabular-nums" }, children: current }), button("inc")] }));
58
+ };
59
+ exports.default = QuantityStepper;
@@ -0,0 +1,24 @@
1
+ /** sm 32px, md 40px, lg 48px high, matching the button scale; the hit area is padded to 44px. */
2
+ export type QuantityStepperSize = "sm" | "md" | "lg";
3
+ /** soft is a tonal fill; outline is a 1px control border on any surface. */
4
+ export type QuantityStepperVariant = "soft" | "outline";
5
+ /** Compact − qty + control. Display only: the number is never typed, which keeps it fast on mobile. */
6
+ export interface QuantityStepperProps {
7
+ value?: number;
8
+ defaultValue?: number;
9
+ onValueChange?: (value: number) => void;
10
+ /** Lowest value; defaults to 1. At the floor the minus button is aria-disabled. */
11
+ min?: number;
12
+ /** Highest value; omit for no ceiling. At the ceiling the plus button is aria-disabled. */
13
+ max?: number;
14
+ step?: number;
15
+ size?: QuantityStepperSize;
16
+ variant?: QuantityStepperVariant;
17
+ /** At `min` the minus becomes a trash button that calls onRemove, for cart lines. */
18
+ removable?: boolean;
19
+ onRemove?: () => void;
20
+ disabled?: boolean;
21
+ /** Product name, so the group reads "Quantity of Slim-Fit Denim Jacket". */
22
+ itemLabel?: string;
23
+ "data-testid"?: string;
24
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,4 @@
1
+ import type { RatingProps } from "./RatingProps";
2
+ /** Star rating with fractional fill; becomes a radio group for "write a review" when `onValueChange` is set. */
3
+ declare const Rating: ({ value, defaultValue, max, size, showValue, count, compactCount, locale, onValueChange, isDisabled, "aria-label": ariaLabel, "data-testid": testId, }: RatingProps) => import("react/jsx-runtime").JSX.Element;
4
+ export default Rating;
@@ -0,0 +1,81 @@
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 lucide_react_1 = require("lucide-react");
7
+ const useCustomTheme_1 = require("../../Theme/useCustomTheme");
8
+ const motion_1 = require("../../Theme/tokens/primitives/motion");
9
+ const motion_2 = require("../../Theme/chakra/motion");
10
+ const focusRing_styles_1 = require("../../Theme/chakra/focusRing.styles");
11
+ const price_1 = require("../../Utils/price");
12
+ const STAR_PX = { xs: 12, sm: 14, md: 18, lg: 24 };
13
+ const HIT_PX = { xs: 24, sm: 28, md: 44, lg: 44 };
14
+ const TEXT_SIZE = { xs: "xs", sm: "xs", md: "sm", lg: "md" };
15
+ const GAP_PX = { xs: 1, sm: 1, md: 2, lg: 2 };
16
+ const clamp = (n, lo, hi) => Math.min(hi, Math.max(lo, n));
17
+ const tenth = (n) => Math.round(n * 10) / 10;
18
+ const StarGlyph = ({ px, fillPercent, filled, empty }) => ((0, jsx_runtime_1.jsxs)(react_2.Box, { as: "span", "aria-hidden": true, position: "relative", display: "inline-flex", boxSize: `${px}px`, flexShrink: 0, color: empty, children: [(0, jsx_runtime_1.jsx)(lucide_react_1.Star, { size: px, fill: "currentColor", strokeWidth: 1.5 }), fillPercent > 0 && ((0, jsx_runtime_1.jsx)(react_2.Box, { as: "span", "data-fill": fillPercent, position: "absolute", inset: 0, color: filled, sx: {
19
+ clipPath: `inset(0 ${100 - fillPercent}% 0 0)`,
20
+ "[dir=rtl] &": { clipPath: `inset(0 0 0 ${100 - fillPercent}%)` },
21
+ }, children: (0, jsx_runtime_1.jsx)(lucide_react_1.Star, { size: px, fill: "currentColor", strokeWidth: 1.5 }) }))] }));
22
+ const fillOf = (index, value) => clamp(value - index, 0, 1) * 100;
23
+ /** Star rating with fractional fill; becomes a radio group for "write a review" when `onValueChange` is set. */
24
+ const Rating = ({ value, defaultValue = 0, max = 5, size = "sm", showValue = true, count, compactCount = false, locale = price_1.DEFAULT_LOCALE, onValueChange, isDisabled = false, "aria-label": ariaLabel, "data-testid": testId, }) => {
25
+ const { colors } = (0, useCustomTheme_1.useCustomTheme)();
26
+ const [inner, setInner] = (0, react_1.useState)(defaultValue);
27
+ const [hover, setHover] = (0, react_1.useState)(null);
28
+ const reduced = (0, motion_2.usePrefersReducedMotion)();
29
+ const refs = (0, react_1.useRef)([]);
30
+ const interactive = !!onValueChange;
31
+ const current = tenth(clamp(value !== null && value !== void 0 ? value : (interactive ? inner : 0), 0, max));
32
+ const px = STAR_PX[size];
33
+ const nf = new Intl.NumberFormat(locale);
34
+ const valueText = new Intl.NumberFormat(locale, { minimumFractionDigits: 1, maximumFractionDigits: 1 }).format(current);
35
+ const countText = count === undefined
36
+ ? null
37
+ : compactCount
38
+ ? new Intl.NumberFormat(locale, { notation: "compact", maximumFractionDigits: 1 }).format(count)
39
+ : nf.format(count);
40
+ const summary = ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [showValue && current > 0 && ((0, jsx_runtime_1.jsx)(react_2.Text, { as: "span", fontSize: TEXT_SIZE[size], fontWeight: 600, color: colors.header[900], sx: { fontVariantNumeric: "tabular-nums" }, children: valueText })), countText !== null && ((0, jsx_runtime_1.jsxs)(react_2.Text, { as: "span", fontSize: TEXT_SIZE[size], color: colors.textMuted, sx: { fontVariantNumeric: "tabular-nums" }, children: ["(", countText, ")"] }))] }));
41
+ if (!interactive) {
42
+ const label = ariaLabel !== null && ariaLabel !== void 0 ? ariaLabel : (current === 0 && !count
43
+ ? "Not rated yet"
44
+ : `Rated ${valueText} out of ${nf.format(max)}${count ? ` from ${nf.format(count)} ${count === 1 ? "rating" : "ratings"}` : ""}`);
45
+ return ((0, jsx_runtime_1.jsxs)(react_2.Flex, { as: "span", role: "img", "aria-label": label, "data-testid": testId, display: "inline-flex", align: "center", gap: 1.5, verticalAlign: "middle", children: [(0, jsx_runtime_1.jsx)(react_2.Flex, { as: "span", "aria-hidden": true, gap: `${GAP_PX[size]}px`, children: Array.from({ length: max }, (_, i) => ((0, jsx_runtime_1.jsx)(StarGlyph, { px: px, fillPercent: fillOf(i, current), filled: colors.star, empty: colors.boxborder[300] }, i))) }), summary] }));
46
+ }
47
+ const select = (next) => {
48
+ if (isDisabled)
49
+ return;
50
+ if (value === undefined)
51
+ setInner(next);
52
+ onValueChange(next);
53
+ };
54
+ const chosen = Math.round(current);
55
+ const focusStop = chosen > 0 ? chosen : 1;
56
+ const shown = hover !== null && hover !== void 0 ? hover : chosen;
57
+ const onKeyDown = (e) => {
58
+ var _a;
59
+ const move = {
60
+ ArrowRight: chosen + 1,
61
+ ArrowUp: chosen + 1,
62
+ ArrowLeft: chosen - 1,
63
+ ArrowDown: chosen - 1,
64
+ Home: 1,
65
+ End: max,
66
+ };
67
+ if (!(e.key in move))
68
+ return;
69
+ e.preventDefault();
70
+ const next = clamp(move[e.key], 1, max);
71
+ select(next);
72
+ (_a = refs.current[next - 1]) === null || _a === void 0 ? void 0 : _a.focus();
73
+ };
74
+ return ((0, jsx_runtime_1.jsxs)(react_2.Flex, { as: "span", display: "inline-flex", align: "center", gap: 1.5, "data-testid": testId, children: [(0, jsx_runtime_1.jsx)(react_2.Flex, { as: "span", role: "radiogroup", "aria-label": ariaLabel !== null && ariaLabel !== void 0 ? ariaLabel : "Rating", "aria-disabled": isDisabled || undefined, gap: `${GAP_PX[size]}px`, onMouseLeave: () => setHover(null), children: Array.from({ length: max }, (_, i) => {
75
+ const n = i + 1;
76
+ return ((0, jsx_runtime_1.jsx)(react_2.Box, { as: "button", type: "button", role: "radio", ref: (el) => {
77
+ refs.current[i] = el;
78
+ }, "aria-checked": n === chosen, "aria-label": `${n} ${n === 1 ? "star" : "stars"}`, tabIndex: n === focusStop && !isDisabled ? 0 : -1, disabled: isDisabled, onClick: () => select(n), onKeyDown: onKeyDown, onMouseEnter: () => !isDisabled && setHover(n), display: "inline-flex", alignItems: "center", justifyContent: "center", boxSize: `${HIT_PX[size]}px`, mx: `-${(HIT_PX[size] - px) / 2 - 1}px`, borderRadius: "full", cursor: isDisabled ? "not-allowed" : "pointer", opacity: isDisabled ? 0.5 : 1, transition: (0, motion_1.transitionFor)(["transform"]), _active: isDisabled || reduced ? undefined : { transform: "scale(0.88)" }, sx: { ...(0, focusRing_styles_1.focusVisibleStyles)(colors), ...(0, motion_2.reducedMotionSx)() }, children: (0, jsx_runtime_1.jsx)(StarGlyph, { px: px, fillPercent: fillOf(i, shown), filled: colors.star, empty: colors.boxborder[300] }) }, n));
79
+ }) }), summary] }));
80
+ };
81
+ exports.default = Rating;
@@ -0,0 +1,27 @@
1
+ /** Star sizes: 12, 14, 18 and 24 px glyphs. */
2
+ export type RatingSize = "xs" | "sm" | "md" | "lg";
3
+ /** Star rating: read-only display by default, a keyboard-operable radio group when `onValueChange` is set. */
4
+ export interface RatingProps {
5
+ /** Rating from 0 to `max`, rounded to one decimal; fractions fill a star partially and 5.0 fills all five. Controls the selection in interactive mode. */
6
+ value?: number;
7
+ /** Initial selection for an interactive rating that is not controlled with `value`. */
8
+ defaultValue?: number;
9
+ /** Number of stars. */
10
+ max?: number;
11
+ size?: RatingSize;
12
+ /** Shows the numeric value ("4.6") after the stars. */
13
+ showValue?: boolean;
14
+ /** Number of ratings, shown in brackets after the value and read out in the accessible name. */
15
+ count?: number;
16
+ /** Abbreviates the visible count ("1.3K"); the accessible name always carries the full figure. */
17
+ compactCount?: boolean;
18
+ /** Locale for number formatting; defaults to en-IN. */
19
+ locale?: string;
20
+ /** Makes the rating interactive (radio group, arrow keys) and fires with the chosen whole-star value. */
21
+ onValueChange?: (value: number) => void;
22
+ /** Interactive mode only: stops selection and removes the stars from the tab order. */
23
+ isDisabled?: boolean;
24
+ /** Overrides the accessible name; the group name in interactive mode, the "Rated 4.6 out of 5" text otherwise. */
25
+ "aria-label"?: string;
26
+ "data-testid"?: string;
27
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,4 @@
1
+ import type { ReviewListProps } from "./ReviewListProps";
2
+ /** Customer reviews: stars, clamped body, verified marker, helpful vote and load-more paging, with a slot for sorting. */
3
+ declare const ReviewList: ({ reviews, onHelpful, clampChars, sortSlot, hasMore, onLoadMore, isLoading, isLoadingMore, emptyState, locale, labels, "data-testid": testId, }: ReviewListProps) => import("react/jsx-runtime").JSX.Element;
4
+ export default ReviewList;
@@ -0,0 +1,94 @@
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 motion_1 = require("../../Theme/tokens/primitives/motion");
12
+ const motion_2 = require("../../Theme/chakra/motion");
13
+ const focusRing_styles_1 = require("../../Theme/chakra/focusRing.styles");
14
+ const price_1 = require("../../Utils/price");
15
+ const Button_1 = __importDefault(require("../Button/Button"));
16
+ const Rating_1 = __importDefault(require("../Rating/Rating"));
17
+ const Skeletons_1 = __importDefault(require("../Skeletons/Skeletons"));
18
+ const DEFAULT_LABELS = {
19
+ verified: "Verified purchase",
20
+ helpful: (count) => `Helpful (${count})`,
21
+ readMore: "Read more",
22
+ readLess: "Read less",
23
+ loadMore: "Load more reviews",
24
+ loadingMore: "Loading more reviews…",
25
+ emptyTitle: "No reviews yet",
26
+ emptyBody: "Reviews from verified buyers will show up here.",
27
+ purchasedSize: (size) => `Size ${size}`,
28
+ loadingReviews: "Loading reviews",
29
+ moreLoaded: (count) => `${count} more ${count === 1 ? "review" : "reviews"} loaded`,
30
+ photoAlt: (author) => `Photo from ${author}'s review`,
31
+ };
32
+ const DATE_ONLY = /^(\d{4})-(\d{2})-(\d{2})$/;
33
+ const tabular = { fontVariantNumeric: "tabular-nums" };
34
+ const SKELETON_ROWS = [0, 1, 2];
35
+ const makeFormatter = (locale) => {
36
+ const options = { day: "numeric", month: "short", year: "numeric" };
37
+ try {
38
+ return new Intl.DateTimeFormat(locale, options);
39
+ }
40
+ catch {
41
+ return new Intl.DateTimeFormat(price_1.DEFAULT_LOCALE, options);
42
+ }
43
+ };
44
+ const formatDate = (raw, fmt) => {
45
+ const dateOnly = DATE_ONLY.exec(raw);
46
+ const parsed = dateOnly ? new Date(Number(dateOnly[1]), Number(dateOnly[2]) - 1, Number(dateOnly[3])) : new Date(raw);
47
+ if (Number.isNaN(parsed.getTime()))
48
+ return { text: raw, valid: false };
49
+ return { text: fmt.format(parsed), valid: true };
50
+ };
51
+ const Dot = () => ((0, jsx_runtime_1.jsx)(react_2.Text, { as: "span", "aria-hidden": true, children: "\u00B7" }));
52
+ const ReviewRow = ({ review, index, clampChars, fmt, labels, pressed, expanded, onToggleHelpful, onToggleExpanded }) => {
53
+ var _a;
54
+ const { colors } = (0, useCustomTheme_1.useCustomTheme)();
55
+ const bodyId = (0, react_1.useId)();
56
+ const isLong = review.body.length > clampChars;
57
+ const date = formatDate(review.date, fmt);
58
+ const count = ((_a = review.helpful) !== null && _a !== void 0 ? _a : 0) + (pressed ? 1 : 0);
59
+ const showHelpful = review.helpful !== undefined || pressed;
60
+ return ((0, jsx_runtime_1.jsxs)(react_2.Box, { as: "li", listStyleType: "none", "data-testid": `review-${review.id}`, children: [index > 0 && (0, jsx_runtime_1.jsx)(react_2.Box, { "aria-hidden": true, h: "1px", bg: colors.background[100] }), (0, jsx_runtime_1.jsxs)(react_2.Flex, { direction: "column", gap: 2.5, py: 6, children: [(0, jsx_runtime_1.jsxs)(react_2.Flex, { align: "center", gap: 2, wrap: "wrap", children: [(0, jsx_runtime_1.jsx)(Rating_1.default, { value: review.rating, size: "sm", showValue: false }), review.title && ((0, jsx_runtime_1.jsx)(react_2.Text, { as: "h3", fontSize: "md", fontWeight: 600, lineHeight: 1.4, color: colors.header[900], children: review.title }))] }), (0, jsx_runtime_1.jsxs)(react_2.Box, { children: [(0, jsx_runtime_1.jsx)(react_2.Text, { id: bodyId, fontSize: "sm", lineHeight: 1.6, color: colors.text[700], noOfLines: isLong && !expanded ? 4 : undefined, children: review.body }), isLong && ((0, jsx_runtime_1.jsx)(react_2.Box, { as: "button", type: "button", mt: 1, fontSize: "sm", fontWeight: 600, color: colors.accentText, "aria-expanded": expanded, "aria-controls": bodyId, onClick: () => onToggleExpanded(review.id), borderRadius: "sm", transition: (0, motion_1.transitionFor)(["opacity"]), _hover: { opacity: 0.8 }, sx: { ...(0, focusRing_styles_1.focusVisibleStyles)(colors), ...(0, motion_2.reducedMotionSx)() }, children: expanded ? labels.readLess : labels.readMore }))] }), review.media && review.media.length > 0 && ((0, jsx_runtime_1.jsx)(react_2.Flex, { gap: 2, wrap: "wrap", children: review.media.map((m) => {
61
+ var _a;
62
+ return ((0, jsx_runtime_1.jsx)(react_2.Box, { boxSize: "72px", borderRadius: "12px", overflow: "hidden", bg: colors.background[100], flexShrink: 0, children: (0, jsx_runtime_1.jsx)("img", { src: m.src, alt: (_a = m.alt) !== null && _a !== void 0 ? _a : labels.photoAlt(review.author), loading: "lazy", style: { width: "100%", height: "100%", objectFit: "cover" } }) }, m.id));
63
+ }) })), (0, jsx_runtime_1.jsxs)(react_2.Flex, { align: "center", gap: 2, wrap: "wrap", fontSize: "xs", color: colors.textMuted, sx: tabular, children: [(0, jsx_runtime_1.jsx)(react_2.Text, { as: "span", fontWeight: 600, color: colors.header[900], children: review.author }), review.city && ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(Dot, {}), (0, jsx_runtime_1.jsx)(react_2.Text, { as: "span", children: review.city })] })), (0, jsx_runtime_1.jsx)(Dot, {}), date.valid ? ((0, jsx_runtime_1.jsx)("time", { dateTime: review.date, children: date.text })) : ((0, jsx_runtime_1.jsx)(react_2.Text, { as: "span", children: date.text })), review.purchasedSize && ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(Dot, {}), (0, jsx_runtime_1.jsx)(react_2.Text, { as: "span", children: labels.purchasedSize(review.purchasedSize) })] })), review.verified && ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(Dot, {}), (0, jsx_runtime_1.jsxs)(react_2.Flex, { as: "span", align: "center", gap: 1, fontWeight: 600, color: colors.semanticText.success, children: [(0, jsx_runtime_1.jsx)(lucide_react_1.BadgeCheck, { size: 14, "aria-hidden": true, focusable: "false" }), labels.verified] })] }))] }), showHelpful && ((0, jsx_runtime_1.jsx)(react_2.Box, { children: (0, jsx_runtime_1.jsx)(Button_1.default, { variant: "ghost", size: "sm", "aria-pressed": pressed, onClick: () => onToggleHelpful(review), leftIcon: (0, jsx_runtime_1.jsx)(lucide_react_1.ThumbsUp, { size: 14, "aria-hidden": true, fill: pressed ? "currentColor" : "none" }), sx: { color: pressed ? colors.header[900] : colors.textMuted, fontVariantNumeric: "tabular-nums" }, children: labels.helpful(count) }) }))] })] }));
64
+ };
65
+ const SkeletonRow = () => ((0, jsx_runtime_1.jsx)(react_2.Box, { as: "li", listStyleType: "none", "aria-hidden": true, py: 6, children: (0, jsx_runtime_1.jsxs)(react_2.Flex, { direction: "column", gap: 3, children: [(0, jsx_runtime_1.jsx)(Skeletons_1.default, { type: "skeleton", width: "80px", height: "14px", borderRadius: "sm" }), (0, jsx_runtime_1.jsxs)(react_2.Flex, { direction: "column", gap: 2, children: [(0, jsx_runtime_1.jsx)(Skeletons_1.default, { type: "skeleton", width: "100%", height: "12px", borderRadius: "sm" }), (0, jsx_runtime_1.jsx)(Skeletons_1.default, { type: "skeleton", width: "94%", height: "12px", borderRadius: "sm" }), (0, jsx_runtime_1.jsx)(Skeletons_1.default, { type: "skeleton", width: "60%", height: "12px", borderRadius: "sm" })] }), (0, jsx_runtime_1.jsx)(Skeletons_1.default, { type: "skeleton", width: "180px", height: "12px", borderRadius: "sm" })] }) }));
66
+ /** Customer reviews: stars, clamped body, verified marker, helpful vote and load-more paging, with a slot for sorting. */
67
+ const ReviewList = ({ reviews, onHelpful, clampChars = 220, sortSlot, hasMore = false, onLoadMore, isLoading = false, isLoadingMore = false, emptyState, locale = price_1.DEFAULT_LOCALE, labels, "data-testid": testId, }) => {
68
+ const { colors } = (0, useCustomTheme_1.useCustomTheme)();
69
+ const copy = { ...DEFAULT_LABELS, ...labels };
70
+ const fmt = (0, react_1.useMemo)(() => makeFormatter(locale), [locale]);
71
+ const [pressed, setPressed] = (0, react_1.useState)({});
72
+ const [expanded, setExpanded] = (0, react_1.useState)({});
73
+ const [announcement, setAnnouncement] = (0, react_1.useState)("");
74
+ const previousCount = (0, react_1.useRef)(reviews.length);
75
+ const moreLoaded = copy.moreLoaded;
76
+ (0, react_1.useEffect)(() => {
77
+ const added = reviews.length - previousCount.current;
78
+ const hadReviews = previousCount.current > 0;
79
+ previousCount.current = reviews.length;
80
+ setAnnouncement(!isLoading && hadReviews && added > 0 ? moreLoaded(added) : "");
81
+ }, [reviews.length, isLoading, moreLoaded]);
82
+ const toggleHelpful = (review) => {
83
+ const next = !pressed[review.id];
84
+ setPressed((prev) => ({ ...prev, [review.id]: next }));
85
+ if (next)
86
+ onHelpful === null || onHelpful === void 0 ? void 0 : onHelpful(review.id);
87
+ };
88
+ const toggleExpanded = (id) => setExpanded((prev) => ({ ...prev, [id]: !prev[id] }));
89
+ const isEmpty = !isLoading && reviews.length === 0;
90
+ return ((0, jsx_runtime_1.jsxs)(react_2.Box, { as: "section", "data-testid": testId, children: [sortSlot && ((0, jsx_runtime_1.jsx)(react_2.Flex, { justify: "flex-end", mb: 4, children: sortSlot })), isEmpty ? ((emptyState !== null && emptyState !== void 0 ? emptyState : ((0, jsx_runtime_1.jsxs)(react_2.Flex, { direction: "column", align: "center", gap: 1, py: 12, textAlign: "center", children: [(0, jsx_runtime_1.jsx)(react_2.Text, { fontSize: "md", fontWeight: 600, color: colors.header[900], children: copy.emptyTitle }), (0, jsx_runtime_1.jsx)(react_2.Text, { fontSize: "sm", color: colors.textMuted, children: copy.emptyBody })] })))) : ((0, jsx_runtime_1.jsx)(react_2.Box, { as: "ul", m: 0, p: 0, "aria-busy": isLoading || undefined, children: isLoading
91
+ ? SKELETON_ROWS.map((n) => (0, jsx_runtime_1.jsx)(SkeletonRow, {}, n))
92
+ : reviews.map((review, index) => ((0, jsx_runtime_1.jsx)(ReviewRow, { review: review, index: index, clampChars: clampChars, fmt: fmt, labels: copy, pressed: !!pressed[review.id], expanded: !!expanded[review.id], onToggleHelpful: toggleHelpful, onToggleExpanded: toggleExpanded }, review.id))) })), hasMore && !isLoading && !isEmpty && ((0, jsx_runtime_1.jsx)(react_2.Flex, { justify: "center", mt: 4, children: (0, jsx_runtime_1.jsx)(Button_1.default, { variant: "outline", size: "md", onClick: onLoadMore, isDisabled: isLoadingMore, "aria-busy": isLoadingMore || undefined, children: isLoadingMore ? copy.loadingMore : copy.loadMore }) })), (0, jsx_runtime_1.jsx)(react_2.VisuallyHidden, { role: "status", "aria-live": "polite", children: isLoading ? copy.loadingReviews : announcement })] }));
93
+ };
94
+ exports.default = ReviewList;
@@ -0,0 +1,68 @@
1
+ import type { ReactNode } from "react";
2
+ /** A photo attached to a review. */
3
+ export interface ReviewMedia {
4
+ id: string;
5
+ src: string;
6
+ alt?: string;
7
+ }
8
+ /** One customer review. */
9
+ export interface ReviewItem {
10
+ id: string;
11
+ author: string;
12
+ city?: string;
13
+ /** Whole stars, 1 to 5. */
14
+ rating: number;
15
+ /** ISO date such as "2026-09-21"; formatted per `locale`, and shown as given when it is not a valid date. */
16
+ date: string;
17
+ title?: string;
18
+ body: string;
19
+ /** Adds the "Verified purchase" marker. */
20
+ verified?: boolean;
21
+ /** Helpful votes so far. */
22
+ helpful?: number;
23
+ /** Variant the reviewer bought, e.g. "M". */
24
+ purchasedSize?: string;
25
+ media?: ReviewMedia[];
26
+ }
27
+ /** Every string the list renders; override all of them for another language. */
28
+ export interface ReviewListLabels {
29
+ verified: string;
30
+ /** Button name, given the vote count. */
31
+ helpful: (count: number) => string;
32
+ readMore: string;
33
+ readLess: string;
34
+ loadMore: string;
35
+ loadingMore: string;
36
+ emptyTitle: string;
37
+ emptyBody: string;
38
+ /** Detail line, given the size the reviewer bought. */
39
+ purchasedSize: (size: string) => string;
40
+ /** Screen-reader text while skeleton rows show. */
41
+ loadingReviews?: string;
42
+ /** Polite announcement when a page is appended, given how many reviews arrived. */
43
+ moreLoaded?: (count: number) => string;
44
+ /** Fallback alt text for a photo without one, given the reviewer's name. */
45
+ photoAlt?: (author: string) => string;
46
+ }
47
+ /** Customer reviews with verified marker, helpful votes, clamped long bodies, a sort slot and load-more paging. */
48
+ export interface ReviewListProps {
49
+ reviews: ReviewItem[];
50
+ /** Fires with the review id when "Helpful" is pressed; the button then shows as pressed and the count rises by one. */
51
+ onHelpful?: (reviewId: string) => void;
52
+ /** Bodies longer than this many characters are clamped to four lines behind a "Read more" toggle. */
53
+ clampChars?: number;
54
+ /** Rendered above the list, typically a `Select` for sorting. */
55
+ sortSlot?: ReactNode;
56
+ /** Shows the "Load more" button. */
57
+ hasMore?: boolean;
58
+ onLoadMore?: () => void;
59
+ /** Shows skeleton rows in place of the reviews. */
60
+ isLoading?: boolean;
61
+ /** Disables "Load more" and shows `labels.loadingMore` while the next page loads. */
62
+ isLoadingMore?: boolean;
63
+ /** Replaces the default empty state. */
64
+ emptyState?: ReactNode;
65
+ locale?: string;
66
+ labels?: Partial<ReviewListLabels>;
67
+ "data-testid"?: string;
68
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,4 @@
1
+ import type { ReviewSummaryProps } from "./ReviewSummaryProps";
2
+ /** Average rating, count and a five-row distribution; scales down to a thin summary or an invitation when there is little or no evidence. */
3
+ declare const ReviewSummary: ({ rating, count, breakdown, minRatingsForBars, onWriteReview, id, locale, labels, "data-testid": testId, }: ReviewSummaryProps) => import("react/jsx-runtime").JSX.Element;
4
+ export default ReviewSummary;
@@ -0,0 +1,47 @@
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("@chakra-ui/react");
8
+ const lucide_react_1 = require("lucide-react");
9
+ const useCustomTheme_1 = require("../../Theme/useCustomTheme");
10
+ const price_1 = require("../../Utils/price");
11
+ const Rating_1 = __importDefault(require("../Rating/Rating"));
12
+ const Button_1 = __importDefault(require("../Button/Button"));
13
+ const STARS = [5, 4, 3, 2, 1];
14
+ const DEFAULT_MIN_RATINGS_FOR_BARS = 10;
15
+ const tabular = { fontVariantNumeric: "tabular-nums" };
16
+ const defaultLabels = (locale) => ({
17
+ heading: "Ratings & reviews",
18
+ writeReview: "Write a review",
19
+ ratings: (count) => `${new Intl.NumberFormat(locale).format(count)} ${count === 1 ? "rating" : "ratings"}`,
20
+ emptyTitle: "No reviews yet",
21
+ emptyBody: "Bought this? Be the first to say how it fits.",
22
+ bar: (stars, percent) => `${stars} ${stars === 1 ? "star" : "stars"}, ${percent}%`,
23
+ });
24
+ const percentages = (breakdown) => {
25
+ const total = STARS.reduce((sum, stars) => sum + breakdown[stars], 0);
26
+ return (stars) => (total > 0 ? Math.round((breakdown[stars] / total) * 100) : 0);
27
+ };
28
+ /** Average rating, count and a five-row distribution; scales down to a thin summary or an invitation when there is little or no evidence. */
29
+ const ReviewSummary = ({ rating, count, breakdown, minRatingsForBars = DEFAULT_MIN_RATINGS_FOR_BARS, onWriteReview, id, locale = price_1.DEFAULT_LOCALE, labels, "data-testid": testId, }) => {
30
+ const { colors } = (0, useCustomTheme_1.useCustomTheme)();
31
+ const copy = { ...defaultLabels(locale), ...labels };
32
+ const empty = count <= 0 || rating <= 0;
33
+ const showBars = !empty && !!breakdown && count >= minRatingsForBars;
34
+ const average = Math.min(5, Math.max(0, rating));
35
+ const averageText = new Intl.NumberFormat(locale, { minimumFractionDigits: 1, maximumFractionDigits: 1 }).format(average);
36
+ const nf = new Intl.NumberFormat(locale);
37
+ const writeButton = onWriteReview ? ((0, jsx_runtime_1.jsx)(Button_1.default, { variant: "outline", onClick: onWriteReview, children: copy.writeReview })) : null;
38
+ const distribution = (counts) => {
39
+ const percentOf = percentages(counts);
40
+ return ((0, jsx_runtime_1.jsx)(react_1.Flex, { direction: "column", gap: 2, flex: "1", minW: 0, maxW: "26rem", w: "100%", children: STARS.map((stars) => {
41
+ const percent = percentOf(stars);
42
+ return ((0, jsx_runtime_1.jsxs)(react_1.Box, { display: "grid", gridTemplateColumns: "2.25rem minmax(0, 1fr) 3.5rem", alignItems: "center", columnGap: 3, children: [(0, jsx_runtime_1.jsxs)(react_1.Flex, { "aria-hidden": true, align: "center", gap: 1, fontSize: "sm", color: colors.text[800], sx: tabular, children: [(0, jsx_runtime_1.jsx)("span", { children: stars }), (0, jsx_runtime_1.jsx)(lucide_react_1.Star, { size: 12, fill: "currentColor", strokeWidth: 1.5 })] }), (0, jsx_runtime_1.jsx)(react_1.Box, { role: "meter", "aria-label": copy.bar(stars, percent), "aria-valuemin": 0, "aria-valuemax": 100, "aria-valuenow": percent, h: "0.5rem", borderRadius: "full", bg: colors.background[200], overflow: "hidden", children: (0, jsx_runtime_1.jsx)(react_1.Box, { h: "100%", w: `${percent}%`, borderRadius: "full", bg: colors.star }) }), (0, jsx_runtime_1.jsx)(react_1.Text, { "aria-hidden": true, fontSize: "sm", textAlign: "right", color: colors.textMuted, sx: tabular, children: nf.format(counts[stars]) })] }, stars));
43
+ }) }));
44
+ };
45
+ return ((0, jsx_runtime_1.jsxs)(react_1.Box, { as: "section", "aria-labelledby": id, "data-testid": testId, children: [(0, jsx_runtime_1.jsx)(react_1.Text, { as: "h2", id: id, fontSize: "lg", fontWeight: 700, lineHeight: 1.3, color: colors.header[900], children: copy.heading }), empty ? ((0, jsx_runtime_1.jsxs)(react_1.Flex, { direction: "column", align: "flex-start", gap: 1, mt: 4, children: [(0, jsx_runtime_1.jsx)(react_1.Text, { fontSize: "md", fontWeight: 600, color: colors.header[900], children: copy.emptyTitle }), (0, jsx_runtime_1.jsx)(react_1.Text, { fontSize: "sm", color: colors.textMuted, children: copy.emptyBody }), writeButton ? (0, jsx_runtime_1.jsx)(react_1.Box, { mt: 3, children: writeButton }) : null] })) : ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsxs)(react_1.Flex, { direction: { base: "column", sm: "row" }, align: { base: "flex-start", sm: "center" }, gap: { base: 5, sm: 10 }, mt: 4, children: [(0, jsx_runtime_1.jsxs)(react_1.Flex, { direction: "column", align: "flex-start", gap: 1.5, flexShrink: 0, children: [(0, jsx_runtime_1.jsx)(react_1.Text, { fontSize: "3rem", lineHeight: 1, fontWeight: 700, letterSpacing: "-0.02em", color: colors.header[900], sx: tabular, children: averageText }), (0, jsx_runtime_1.jsx)(Rating_1.default, { value: average, size: "md", showValue: false }), (0, jsx_runtime_1.jsx)(react_1.Text, { fontSize: "sm", color: colors.textMuted, sx: tabular, children: copy.ratings(count) })] }), showBars && breakdown ? distribution(breakdown) : null] }), writeButton ? (0, jsx_runtime_1.jsx)(react_1.Box, { mt: 5, children: writeButton }) : null] }))] }));
46
+ };
47
+ exports.default = ReviewSummary;
@@ -0,0 +1,31 @@
1
+ /** Ratings per star count, 1 to 5. */
2
+ export type RatingBreakdown = Record<1 | 2 | 3 | 4 | 5, number>;
3
+ /** Every string the summary renders; override all of them for another language. */
4
+ export interface ReviewSummaryLabels {
5
+ heading: string;
6
+ writeReview: string;
7
+ /** Count line, given the total number of ratings. */
8
+ ratings: (count: number) => string;
9
+ emptyTitle: string;
10
+ emptyBody: string;
11
+ /** Accessible name of one bar, given the star level and the share as a whole percentage. */
12
+ bar: (stars: number, percent: number) => string;
13
+ }
14
+ /** Average rating, count and a five-row distribution; scales down to an invitation when there are no ratings. */
15
+ export interface ReviewSummaryProps {
16
+ /** Average rating from 0 to 5. */
17
+ rating: number;
18
+ /** Total number of ratings. */
19
+ count: number;
20
+ /** Counts per star; the bars show each row's share of their sum. */
21
+ breakdown?: RatingBreakdown;
22
+ /** The distribution only appears at or above this many ratings, because bars on a handful of ratings mislead. */
23
+ minRatingsForBars?: number;
24
+ /** Shows a "Write a review" button when provided. */
25
+ onWriteReview?: () => void;
26
+ /** Heading element id, so a "4.6 (412)" link elsewhere can scroll here and a region can be labelled by it. */
27
+ id?: string;
28
+ locale?: string;
29
+ labels?: Partial<ReviewSummaryLabels>;
30
+ "data-testid"?: string;
31
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -15,7 +15,7 @@ export type SearchProps = {
15
15
  onClear?: () => void;
16
16
  /** @deprecated Use `onClear` — same behaviour, consistent casing. */
17
17
  onclose?: () => void;
18
- /** Height on the field control scale (xs 24 · sm 38 · md 40 · lg 48px). Defaults to `sm`. */
18
+ /** Height on the field control scale (xs 32 · sm 38 · md 40 · lg 48px). Defaults to `sm`. */
19
19
  size?: ControlSize;
20
20
  name?: string;
21
21
  /** Disables the input and hides the clear button; the hotkey still focuses it. */
@@ -38,7 +38,7 @@ export type SearchSelectProps = {
38
38
  width?: string | number;
39
39
  /** Only sets the insideSelect segment's height, not the main field's — that's driven by `size`. */
40
40
  height?: string | number;
41
- /** Height on the field control scale (xs 24 · sm 38 · md 40 · lg 48px). Defaults to `sm`. */
41
+ /** Height on the field control scale (xs 32 · sm 38 · md 40 · lg 48px). Defaults to `sm`. */
42
42
  size?: "xs" | "sm" | "md" | "lg";
43
43
  /** Blocks opening, typing, chip removal and clearing; renders the shared disabled field look. */
44
44
  isDisabled?: boolean;
@@ -1,3 +1,3 @@
1
1
  import { SegmentedControlProps } from "./SegmentedControlProps";
2
2
  /** Renders role="radiogroup" of role="radio" buttons with roving tabindex, not a native form radio group; shares variant with Toggle/TableToggle (see MODULE.md). */
3
- export default function SegmentedControl<T extends string = string>({ options, value, onChange, size, isFullWidth, variant, surface, "aria-label": ariaLabel, }: SegmentedControlProps<T>): import("react/jsx-runtime").JSX.Element;
3
+ export default function SegmentedControl<T extends string = string>({ options, value, onChange, size, isFullWidth, variant, orientation, surface, "aria-label": ariaLabel, }: SegmentedControlProps<T>): import("react/jsx-runtime").JSX.Element;