@instockng/storefront-ui 1.0.74 → 1.0.76

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 (254) hide show
  1. package/dist/components/ProductAddOns.d.ts +3 -1
  2. package/dist/components/ProductAddOns.d.ts.map +1 -1
  3. package/dist/components/RecommendedProducts.d.ts.map +1 -1
  4. package/dist/components/VariantPickerModal.d.ts +28 -0
  5. package/dist/components/VariantPickerModal.d.ts.map +1 -0
  6. package/dist/index.d.ts +2 -0
  7. package/dist/index.d.ts.map +1 -1
  8. package/dist/index.mjs +104 -102
  9. package/dist/index10.mjs +162 -121
  10. package/dist/index100.mjs +20 -69
  11. package/dist/index101.mjs +55 -34
  12. package/dist/index102.mjs +32 -42
  13. package/dist/index103.mjs +2 -2
  14. package/dist/index104.mjs +2 -28
  15. package/dist/index105.mjs +20 -17
  16. package/dist/index106.mjs +54 -213
  17. package/dist/index107.mjs +28 -179
  18. package/dist/index108.mjs +6 -21
  19. package/dist/index109.mjs +50 -21
  20. package/dist/index11.mjs +116 -88
  21. package/dist/index110.mjs +6 -33
  22. package/dist/index111.mjs +11 -155
  23. package/dist/index112.mjs +7 -20
  24. package/dist/index113.mjs +28 -31
  25. package/dist/index114.mjs +2 -84
  26. package/dist/index115.mjs +68 -36
  27. package/dist/index116.mjs +163 -141
  28. package/dist/index117.mjs +2 -55
  29. package/dist/index118.mjs +26 -21
  30. package/dist/index119.mjs +11 -20
  31. package/dist/index12.mjs +86 -90
  32. package/dist/index120.mjs +211 -19
  33. package/dist/index121.mjs +174 -19
  34. package/dist/index122.mjs +15 -14
  35. package/dist/index123.mjs +16 -15
  36. package/dist/index124.mjs +26 -14
  37. package/dist/index125.mjs +147 -56
  38. package/dist/index126.mjs +10 -8
  39. package/dist/index127.mjs +22 -30
  40. package/dist/index128.mjs +77 -17
  41. package/dist/index129.mjs +30 -26
  42. package/dist/index13.mjs +83 -185
  43. package/dist/index130.mjs +140 -22
  44. package/dist/index131.mjs +50 -14
  45. package/dist/index132.mjs +17 -15
  46. package/dist/index133.mjs +18 -38
  47. package/dist/index134.mjs +17 -17
  48. package/dist/index135.mjs +19 -262
  49. package/dist/index136.mjs +13 -62
  50. package/dist/index137.mjs +21 -7
  51. package/dist/index138.mjs +21 -2
  52. package/dist/index139.mjs +65 -2
  53. package/dist/index14.mjs +196 -94
  54. package/dist/index140.mjs +12 -27
  55. package/dist/index141.mjs +39 -2
  56. package/dist/index142.mjs +24 -2
  57. package/dist/index143.mjs +33 -20
  58. package/dist/index144.mjs +25 -54
  59. package/dist/index145.mjs +18 -28
  60. package/dist/index146.mjs +20 -6
  61. package/dist/index147.mjs +44 -49
  62. package/dist/index148.mjs +23 -6
  63. package/dist/index149.mjs +267 -11
  64. package/dist/index15.mjs +82 -713
  65. package/dist/index150.mjs +70 -7
  66. package/dist/index151.mjs +8 -28
  67. package/dist/index152.mjs +2 -2
  68. package/dist/index153.mjs +2 -70
  69. package/dist/index154.mjs +30 -164
  70. package/dist/index155.mjs +2 -2
  71. package/dist/index159.mjs +1 -1
  72. package/dist/index16.mjs +722 -53
  73. package/dist/index160.mjs +1 -1
  74. package/dist/index161.mjs +1 -1
  75. package/dist/index162.mjs +1 -1
  76. package/dist/index163.mjs +1 -1
  77. package/dist/index165.mjs +3 -3
  78. package/dist/index166.mjs +1 -1
  79. package/dist/index168.mjs +3 -3
  80. package/dist/index169.mjs +1 -1
  81. package/dist/index17.mjs +58 -60
  82. package/dist/index174.mjs +2 -2
  83. package/dist/index176.mjs +1 -1
  84. package/dist/index178.mjs +2 -2
  85. package/dist/index179.mjs +5 -5
  86. package/dist/index18.mjs +60 -22
  87. package/dist/index182.mjs +1 -1
  88. package/dist/index185.mjs +1 -1
  89. package/dist/index188.mjs +3 -3
  90. package/dist/index189.mjs +1 -1
  91. package/dist/index19.mjs +22 -107
  92. package/dist/index193.mjs +2 -2
  93. package/dist/index195.mjs +2 -2
  94. package/dist/index199.mjs +1 -1
  95. package/dist/index2.mjs +2 -2
  96. package/dist/index20.mjs +105 -38
  97. package/dist/index201.mjs +2 -2
  98. package/dist/index21.mjs +37 -37
  99. package/dist/index210.mjs +2 -2
  100. package/dist/index212.mjs +1 -1
  101. package/dist/index213.mjs +1 -1
  102. package/dist/index214.mjs +31 -2
  103. package/dist/index215.mjs +11 -2
  104. package/dist/index216.mjs +4 -2
  105. package/dist/index217.mjs +4 -2
  106. package/dist/index218.mjs +13 -108
  107. package/dist/index219.mjs +7 -2
  108. package/dist/index22.mjs +42 -71
  109. package/dist/index220.mjs +12 -2
  110. package/dist/index221.mjs +4 -36
  111. package/dist/index222.mjs +33 -2
  112. package/dist/index223.mjs +31 -2
  113. package/dist/index224.mjs +28 -2
  114. package/dist/index225.mjs +61 -2
  115. package/dist/index226.mjs +2 -2
  116. package/dist/index227.mjs +2 -2
  117. package/dist/index228.mjs +2 -2
  118. package/dist/index229.mjs +2 -244
  119. package/dist/index23.mjs +67 -28
  120. package/dist/index231.mjs +2 -33
  121. package/dist/index232.mjs +2 -65
  122. package/dist/index233.mjs +31 -19
  123. package/dist/index234.mjs +2 -2
  124. package/dist/index235.mjs +2 -2
  125. package/dist/index237.mjs +244 -2
  126. package/dist/index238.mjs +2 -2
  127. package/dist/index239.mjs +33 -2
  128. package/dist/index24.mjs +29 -6
  129. package/dist/index240.mjs +65 -2
  130. package/dist/index241.mjs +25 -2
  131. package/dist/index243.mjs +2 -2
  132. package/dist/index244.mjs +108 -4
  133. package/dist/index245.mjs +2 -31
  134. package/dist/index246.mjs +2 -11
  135. package/dist/index247.mjs +2 -4
  136. package/dist/index248.mjs +2 -4
  137. package/dist/index249.mjs +2 -13
  138. package/dist/index25.mjs +8 -21
  139. package/dist/index250.mjs +2 -7
  140. package/dist/index251.mjs +2 -12
  141. package/dist/index252.mjs +2 -5
  142. package/dist/index253.mjs +2 -33
  143. package/dist/index254.mjs +2 -31
  144. package/dist/index255.mjs +2 -28
  145. package/dist/index256.mjs +2 -61
  146. package/dist/index257.mjs +4 -2
  147. package/dist/index258.mjs +3 -2
  148. package/dist/index259.mjs +2 -18
  149. package/dist/index26.mjs +19 -34
  150. package/dist/index260.mjs +2 -47
  151. package/dist/index261.mjs +17 -2
  152. package/dist/index262.mjs +13 -2
  153. package/dist/index263.mjs +6 -2
  154. package/dist/index264.mjs +30 -2
  155. package/dist/index265.mjs +2 -91
  156. package/dist/index266.mjs +2 -2
  157. package/dist/index267.mjs +18 -3
  158. package/dist/index268.mjs +47 -2
  159. package/dist/index269.mjs +2 -2
  160. package/dist/index27.mjs +34 -37
  161. package/dist/index270.mjs +2 -17
  162. package/dist/index271.mjs +2 -13
  163. package/dist/index272.mjs +91 -6
  164. package/dist/index273.mjs +2 -30
  165. package/dist/index274.mjs +2 -2
  166. package/dist/index276.mjs +2 -2
  167. package/dist/index277.mjs +5 -0
  168. package/dist/index28.mjs +28 -103
  169. package/dist/index29.mjs +104 -20
  170. package/dist/index3.mjs +5 -5
  171. package/dist/index30.mjs +29 -9
  172. package/dist/index31.mjs +9 -9
  173. package/dist/index32.mjs +11 -116
  174. package/dist/index33.mjs +116 -25
  175. package/dist/index34.mjs +25 -81
  176. package/dist/index35.mjs +81 -112
  177. package/dist/index36.mjs +109 -8
  178. package/dist/index37.mjs +9 -33
  179. package/dist/index38.mjs +27 -20
  180. package/dist/index39.mjs +26 -9
  181. package/dist/index4.mjs +1 -1
  182. package/dist/index40.mjs +10 -122
  183. package/dist/index41.mjs +114 -380
  184. package/dist/index42.mjs +384 -20
  185. package/dist/index43.mjs +24 -31
  186. package/dist/index44.mjs +32 -7
  187. package/dist/index45.mjs +6 -1432
  188. package/dist/index46.mjs +1432 -69
  189. package/dist/index47.mjs +70 -2
  190. package/dist/index48.mjs +2 -60
  191. package/dist/index49.mjs +57 -48
  192. package/dist/index5.mjs +1 -1
  193. package/dist/index50.mjs +51 -33
  194. package/dist/index51.mjs +33 -15
  195. package/dist/index52.mjs +12 -2260
  196. package/dist/index53.mjs +2263 -36
  197. package/dist/index54.mjs +36 -44
  198. package/dist/index55.mjs +44 -99
  199. package/dist/index56.mjs +99 -81
  200. package/dist/index57.mjs +75 -13
  201. package/dist/index58.mjs +15 -125
  202. package/dist/index59.mjs +93 -89
  203. package/dist/index6.mjs +1 -1
  204. package/dist/index60.mjs +102 -56
  205. package/dist/index61.mjs +55 -89
  206. package/dist/index62.mjs +82 -76
  207. package/dist/index63.mjs +100 -13
  208. package/dist/index64.mjs +17 -92
  209. package/dist/index65.mjs +70 -56
  210. package/dist/index66.mjs +62 -44
  211. package/dist/index67.mjs +47 -46
  212. package/dist/index68.mjs +48 -121
  213. package/dist/index69.mjs +133 -22
  214. package/dist/index7.mjs +6 -6
  215. package/dist/index70.mjs +24 -2
  216. package/dist/index71.mjs +2 -153
  217. package/dist/index72.mjs +4 -22
  218. package/dist/index73.mjs +22 -4
  219. package/dist/index74.mjs +149 -71
  220. package/dist/index75.mjs +74 -14
  221. package/dist/index76.mjs +14 -62
  222. package/dist/index77.mjs +63 -2
  223. package/dist/index78.mjs +234 -5
  224. package/dist/index79.mjs +5 -1133
  225. package/dist/index8.mjs +4 -4
  226. package/dist/index80.mjs +131 -17
  227. package/dist/index81.mjs +67 -54
  228. package/dist/index82.mjs +84 -30
  229. package/dist/index83.mjs +29 -2
  230. package/dist/index84.mjs +9 -235
  231. package/dist/index85.mjs +74 -5
  232. package/dist/index86.mjs +3 -133
  233. package/dist/index87.mjs +2 -68
  234. package/dist/index88.mjs +79 -83
  235. package/dist/index89.mjs +52 -27
  236. package/dist/index9.mjs +3 -3
  237. package/dist/index90.mjs +5 -8
  238. package/dist/index91.mjs +4 -74
  239. package/dist/index92.mjs +178 -3
  240. package/dist/index93.mjs +53 -2
  241. package/dist/index94.mjs +68 -82
  242. package/dist/index95.mjs +33 -53
  243. package/dist/index96.mjs +42 -5
  244. package/dist/index97.mjs +2 -5
  245. package/dist/index98.mjs +5 -178
  246. package/dist/index99.mjs +1134 -53
  247. package/dist/styles.css +1 -1
  248. package/package.json +1 -1
  249. package/src/components/ProductAddOns.stories.tsx +10 -3
  250. package/src/components/ProductAddOns.tsx +167 -112
  251. package/src/components/RecommendedProducts.tsx +130 -88
  252. package/src/components/ShoppingCart.tsx +1 -1
  253. package/src/components/VariantPickerModal.tsx +154 -0
  254. package/src/index.ts +3 -0
@@ -13,9 +13,11 @@ export interface ProductAddOnsProps {
13
13
  onToggle?: (product: AddOnProduct, isSelected: boolean) => void;
14
14
  /** Manual selection list (list of product IDs) */
15
15
  selectedProductIds?: string[];
16
+ /** Callback when product card is clicked (for navigation) */
17
+ onProductClick?: (product: AddOnProduct) => void;
16
18
  className?: string;
17
19
  title?: string;
18
20
  limit?: number;
19
21
  }
20
- export declare function ProductAddOns({ slug, products: manualProducts, onToggle: manualOnToggle, selectedProductIds: manualSelectedIds, className, title, limit, }: ProductAddOnsProps): import("react/jsx-runtime").JSX.Element | null;
22
+ export declare function ProductAddOns({ slug, products: manualProducts, onToggle: manualOnToggle, selectedProductIds: manualSelectedIds, onProductClick, className, title, limit, }: ProductAddOnsProps): import("react/jsx-runtime").JSX.Element | null;
21
23
  //# sourceMappingURL=ProductAddOns.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ProductAddOns.d.ts","sourceRoot":"","sources":["../../src/components/ProductAddOns.tsx"],"names":[],"mappings":"AAOA,OAAO,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AAKnD,MAAM,WAAW,YAAa,SAAQ,kBAAkB;IACpD,IAAI,EAAE,MAAM,CAAC;IACb,cAAc,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC/B,gBAAgB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CACpC;AAED,MAAM,WAAW,kBAAkB;IAC/B,wCAAwC;IACxC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,oDAAoD;IACpD,QAAQ,CAAC,EAAE,YAAY,EAAE,CAAC;IAC1B,4BAA4B;IAC5B,QAAQ,CAAC,EAAE,CAAC,OAAO,EAAE,YAAY,EAAE,UAAU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AAI,EACJ,QAAQ,EAAE,cAAc,EACxB,QAAQ,EAAE,cAAc,EACxB,kBAAkB,EAAE,iBAAiB,EACrC,cAAc,EACd,SAAS,EACT,KAAyB,EACzB,KAAS,GACZ,EAAE,kBAAkB,kDA2PpB"}
@@ -1 +1 @@
1
- {"version":3,"file":"RecommendedProducts.d.ts","sourceRoot":"","sources":["../../src/components/RecommendedProducts.tsx"],"names":[],"mappings":"AAiBA,MAAM,WAAW,wBAAwB;IACvC,yCAAyC;IACzC,KAAK,EAAE,MAAM,CAAC;IACd,wBAAwB;IACxB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,wBAAgB,mBAAmB,CAAC,EAClC,KAAK,EACL,SAAS,GACV,EAAE,wBAAwB,kDA8J1B"}
1
+ {"version":3,"file":"RecommendedProducts.d.ts","sourceRoot":"","sources":["../../src/components/RecommendedProducts.tsx"],"names":[],"mappings":"AAkBA,MAAM,WAAW,wBAAwB;IACvC,yCAAyC;IACzC,KAAK,EAAE,MAAM,CAAC;IACd,wBAAwB;IACxB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,wBAAgB,mBAAmB,CAAC,EAClC,KAAK,EACL,SAAS,GACV,EAAE,wBAAwB,kDAsM1B"}
@@ -0,0 +1,28 @@
1
+ export interface Variant {
2
+ id: string;
3
+ name?: string | null;
4
+ price: number;
5
+ sku: string;
6
+ thumbnailUrl?: string | null;
7
+ }
8
+ export interface VariantPickerProduct {
9
+ id: string;
10
+ name: string;
11
+ slug: string;
12
+ thumbnailUrl?: string | null;
13
+ variants: Variant[];
14
+ }
15
+ export interface VariantPickerModalProps {
16
+ /** Controls modal visibility */
17
+ isOpen: boolean;
18
+ /** Callback when modal should close */
19
+ onClose: () => void;
20
+ /** Product to select variant for */
21
+ product: VariantPickerProduct | null;
22
+ /** Callback when variant is selected and confirmed */
23
+ onConfirm: (product: VariantPickerProduct, variant: Variant) => void;
24
+ /** Whether add operation is in progress */
25
+ isLoading?: boolean;
26
+ }
27
+ export declare function VariantPickerModal({ isOpen, onClose, product, onConfirm, isLoading, }: VariantPickerModalProps): import("react/jsx-runtime").JSX.Element | null;
28
+ //# sourceMappingURL=VariantPickerModal.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"VariantPickerModal.d.ts","sourceRoot":"","sources":["../../src/components/VariantPickerModal.tsx"],"names":[],"mappings":"AAeA,MAAM,WAAW,OAAO;IACpB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,KAAK,EAAE,MAAM,CAAC;IACd,GAAG,EAAE,MAAM,CAAC;IACZ,YAAY,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAChC;AAED,MAAM,WAAW,oBAAoB;IACjC,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,YAAY,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B,QAAQ,EAAE,OAAO,EAAE,CAAC;CACvB;AAED,MAAM,WAAW,uBAAuB;IACpC,gCAAgC;IAChC,MAAM,EAAE,OAAO,CAAC;IAChB,uCAAuC;IACvC,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,oCAAoC;IACpC,OAAO,EAAE,oBAAoB,GAAG,IAAI,CAAC;IACrC,sDAAsD;IACtD,SAAS,EAAE,CAAC,OAAO,EAAE,oBAAoB,EAAE,OAAO,EAAE,OAAO,KAAK,IAAI,CAAC;IACrE,2CAA2C;IAC3C,SAAS,CAAC,EAAE,OAAO,CAAC;CACvB;AAED,wBAAgB,kBAAkB,CAAC,EAC/B,MAAM,EACN,OAAO,EACP,OAAO,EACP,SAAS,EACT,SAAiB,GACpB,EAAE,uBAAuB,kDAuGzB"}
package/dist/index.d.ts CHANGED
@@ -20,6 +20,8 @@ export { ProductAddOns } from './components/ProductAddOns';
20
20
  export type { ProductAddOnsProps, AddOnProduct } from './components/ProductAddOns';
21
21
  export { RecommendedProducts } from './components/RecommendedProducts';
22
22
  export type { RecommendedProductsProps } from './components/RecommendedProducts';
23
+ export { VariantPickerModal } from './components/VariantPickerModal';
24
+ export type { VariantPickerModalProps, VariantPickerProduct, Variant } from './components/VariantPickerModal';
23
25
  export { CartItem } from './components/CartItem';
24
26
  export type { CartItemProps } from './components/CartItem';
25
27
  export { ShoppingCart } from './components/ShoppingCart';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAC;AACpE,YAAY,EAAE,uBAAuB,EAAE,MAAM,gCAAgC,CAAC;AAG9E,OAAO,EAAE,YAAY,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AAG/D,OAAO,EAAE,YAAY,EAAE,iBAAiB,EAAE,MAAM,+BAA+B,CAAC;AAChF,YAAY,EAAE,sBAAsB,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AAG1F,OAAO,EAAE,cAAc,EAAE,mBAAmB,EAAE,MAAM,iCAAiC,CAAC;AAGtF,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAG1D,OAAO,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAC;AACnE,YAAY,EAAE,sBAAsB,EAAE,MAAM,gCAAgC,CAAC;AAE7E,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AACvD,YAAY,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AAErF,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AACvD,YAAY,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAEjE,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAC3D,YAAY,EAAE,kBAAkB,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAEnF,OAAO,EAAE,mBAAmB,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EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AACzD,YAAY,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AAEnE,OAAO,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAC;AACnE,YAAY,EAAE,sBAAsB,EAAE,MAAM,gCAAgC,CAAC;AAE7E,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AACjD,YAAY,EAAE,aAAa,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAG7E,OAAO,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAChD,OAAO,EAAE,IAAI,EAAE,WAAW,EAAE,UAAU,EAAE,SAAS,EAAE,eAAe,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAC7G,OAAO,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AAC9C,OAAO,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AAC9C,YAAY,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AACxD,OAAO,EAAE,SAAS,EAAE,MAAM,4BAA4B,CAAC;AACvD,YAAY,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AACjE,OAAO,EAAE,UAAU,EAAE,MAAM,6BAA6B,CAAC;AACzD,YAAY,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AAGnE,OAAO,EAAE,EAAE,EAAE,cAAc,EAAE,UAAU,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAI7F,cAAc,uBAAuB,CAAC"}
package/dist/index.mjs CHANGED
@@ -6,121 +6,123 @@ import { TikTokPixelProvider as s, useTikTokPixel as c } from "./index5.mjs";
6
6
  import { usePageTracking as x } from "./index6.mjs";
7
7
  import { OrderConfirmation as P } from "./index7.mjs";
8
8
  import { ProductCard as A } from "./index8.mjs";
9
- import { ProductGrid as G } from "./index9.mjs";
10
- import { ProductAddOns as k } from "./index10.mjs";
9
+ import { ProductGrid as v } from "./index9.mjs";
10
+ import { ProductAddOns as R } from "./index10.mjs";
11
11
  import { RecommendedProducts as D } from "./index11.mjs";
12
- import { CartItem as g } from "./index12.mjs";
13
- import { ShoppingCart as B } from "./index13.mjs";
14
- import { DiscountCodeInput as S } from "./index14.mjs";
15
- import { Checkout as M } from "./index15.mjs";
16
- import { Button as U } from "./index16.mjs";
17
- import { Card as b, CardContent as q, CardDescription as z, CardFooter as K, CardHeader as $, CardTitle as j } from "./index17.mjs";
18
- import { Badge as E } from "./index18.mjs";
19
- import { Modal as L } from "./index19.mjs";
20
- import { FormInput as Q } from "./index20.mjs";
21
- import { FormSelect as W } from "./index21.mjs";
22
- import { cn as Y, formatCurrency as _, formatDate as ee, formatDateTime as re, getStatusColor as te } from "./index22.mjs";
23
- import { ApiClientProvider as me, useApiClientContext as ae } from "./index23.mjs";
24
- import { useApiConfig as de } from "./index24.mjs";
25
- import { getApiClient as ue, initializeApiClient as ne, resetApiClient as fe } from "./index25.mjs";
26
- import { authHeaders as ce, createAdminRpcClients as Ce, createRpcClients as xe } from "./index26.mjs";
27
- import { fetchProductAddons as Pe, fetchProductBySlug as he, fetchProductRecommendations as Ae, fetchProductsByBrand as ve } from "./index27.mjs";
28
- import { addCartItem as Re, applyDiscount as ke, checkoutCart as ye, createCart as De, fetchCart as Ie, fetchCartRecommendations as ge, initiateCheckout as Oe, removeCartItem as Be, removeDiscount as Te, updateCart as Se, updateCartItem as Fe } from "./index28.mjs";
29
- import { confirmOrder as He, fetchOrder as Ue, fetchOrderRecommendations as Ze } from "./index29.mjs";
30
- import { fetchDeliveryZones as qe } from "./index30.mjs";
31
- import { fetchBrandBySlug as Ke } from "./index31.mjs";
32
- import { queryKeys as je } from "./index32.mjs";
33
- import * as e from "./index33.mjs";
34
- import * as r from "./index34.mjs";
35
- import { useAddCartItem as Ee, useApplyDiscount as Je, useCheckoutCart as Le, useCreateCart as Ne, useGetCart as Qe, useGetCartRecommendations as Ve, useInitiateCheckout as We, useRemoveCartItem as Xe, useRemoveDiscount as Ye, useUpdateCart as _e, useUpdateCartItem as er } from "./index35.mjs";
36
- import { useGetBrand as tr } from "./index36.mjs";
37
- import { useGetProduct as mr, useGetProductAddOns as ar, useGetProductRecommendations as ir, useGetProducts as dr } from "./index37.mjs";
38
- import { useConfirmOrder as ur, useGetOrder as nr, useGetOrderRecommendations as fr } from "./index38.mjs";
39
- import { useGetDeliveryZones as cr } from "./index39.mjs";
12
+ import { VariantPickerModal as g } from "./index12.mjs";
13
+ import { CartItem as B } from "./index13.mjs";
14
+ import { ShoppingCart as S } from "./index14.mjs";
15
+ import { DiscountCodeInput as F } from "./index15.mjs";
16
+ import { Checkout as U } from "./index16.mjs";
17
+ import { Button as b } from "./index17.mjs";
18
+ import { Card as z, CardContent as K, CardDescription as V, CardFooter as $, CardHeader as j, CardTitle as w } from "./index18.mjs";
19
+ import { Badge as J } from "./index19.mjs";
20
+ import { Modal as N } from "./index20.mjs";
21
+ import { FormInput as W } from "./index21.mjs";
22
+ import { FormSelect as Y } from "./index22.mjs";
23
+ import { cn as ee, formatCurrency as re, formatDate as te, formatDateTime as oe, getStatusColor as me } from "./index23.mjs";
24
+ import { ApiClientProvider as ie, useApiClientContext as de } from "./index24.mjs";
25
+ import { useApiConfig as ue } from "./index25.mjs";
26
+ import { getApiClient as fe, initializeApiClient as se, resetApiClient as ce } from "./index26.mjs";
27
+ import { authHeaders as xe, createAdminRpcClients as le, createRpcClients as Pe } from "./index27.mjs";
28
+ import { fetchProductAddons as Ae, fetchProductBySlug as ke, fetchProductRecommendations as ve, fetchProductsByBrand as Ge } from "./index28.mjs";
29
+ import { addCartItem as ye, applyDiscount as De, checkoutCart as Ie, createCart as ge, fetchCart as Oe, fetchCartRecommendations as Be, initiateCheckout as Te, removeCartItem as Se, removeDiscount as Me, updateCart as Fe, updateCartItem as He } from "./index29.mjs";
30
+ import { confirmOrder as Ze, fetchOrder as be, fetchOrderRecommendations as qe } from "./index30.mjs";
31
+ import { fetchDeliveryZones as Ke } from "./index31.mjs";
32
+ import { fetchBrandBySlug as $e } from "./index32.mjs";
33
+ import { queryKeys as we } from "./index33.mjs";
34
+ import * as e from "./index34.mjs";
35
+ import * as r from "./index35.mjs";
36
+ import { useAddCartItem as Je, useApplyDiscount as Le, useCheckoutCart as Ne, useCreateCart as Qe, useGetCart as We, useGetCartRecommendations as Xe, useInitiateCheckout as Ye, useRemoveCartItem as _e, useRemoveDiscount as er, useUpdateCart as rr, useUpdateCartItem as tr } from "./index36.mjs";
37
+ import { useGetBrand as mr } from "./index37.mjs";
38
+ import { useGetProduct as ir, useGetProductAddOns as dr, useGetProductRecommendations as pr, useGetProducts as ur } from "./index38.mjs";
39
+ import { useConfirmOrder as fr, useGetOrder as sr, useGetOrderRecommendations as cr } from "./index39.mjs";
40
+ import { useGetDeliveryZones as xr } from "./index40.mjs";
40
41
  export {
41
- me as ApiClientProvider,
42
- E as Badge,
43
- U as Button,
44
- b as Card,
45
- q as CardContent,
46
- z as CardDescription,
47
- K as CardFooter,
48
- $ as CardHeader,
49
- j as CardTitle,
50
- g as CartItem,
42
+ ie as ApiClientProvider,
43
+ J as Badge,
44
+ b as Button,
45
+ z as Card,
46
+ K as CardContent,
47
+ V as CardDescription,
48
+ $ as CardFooter,
49
+ j as CardHeader,
50
+ w as CardTitle,
51
+ B as CartItem,
51
52
  i as CartProvider,
52
- M as Checkout,
53
- S as DiscountCodeInput,
54
- Q as FormInput,
55
- W as FormSelect,
53
+ U as Checkout,
54
+ F as DiscountCodeInput,
55
+ W as FormInput,
56
+ Y as FormSelect,
56
57
  u as MetaPixelProvider,
57
- L as Modal,
58
+ N as Modal,
58
59
  P as OrderConfirmation,
59
- k as ProductAddOns,
60
+ R as ProductAddOns,
60
61
  A as ProductCard,
61
- G as ProductGrid,
62
+ v as ProductGrid,
62
63
  D as RecommendedProducts,
63
- B as ShoppingCart,
64
+ S as ShoppingCart,
64
65
  m as StorefrontProvider,
65
66
  s as TikTokPixelProvider,
66
- Re as addCartItem,
67
+ g as VariantPickerModal,
68
+ ye as addCartItem,
67
69
  r as adminApi,
68
- ke as applyDiscount,
69
- ce as authHeaders,
70
- ye as checkoutCart,
71
- Y as cn,
72
- He as confirmOrder,
73
- Ce as createAdminRpcClients,
74
- De as createCart,
75
- xe as createRpcClients,
76
- Ke as fetchBrandBySlug,
77
- Ie as fetchCart,
78
- ge as fetchCartRecommendations,
79
- qe as fetchDeliveryZones,
80
- Ue as fetchOrder,
81
- Ze as fetchOrderRecommendations,
82
- Pe as fetchProductAddons,
83
- he as fetchProductBySlug,
84
- Ae as fetchProductRecommendations,
85
- ve as fetchProductsByBrand,
86
- _ as formatCurrency,
87
- ee as formatDate,
88
- re as formatDateTime,
89
- ue as getApiClient,
90
- te as getStatusColor,
91
- ne as initializeApiClient,
92
- Oe as initiateCheckout,
70
+ De as applyDiscount,
71
+ xe as authHeaders,
72
+ Ie as checkoutCart,
73
+ ee as cn,
74
+ Ze as confirmOrder,
75
+ le as createAdminRpcClients,
76
+ ge as createCart,
77
+ Pe as createRpcClients,
78
+ $e as fetchBrandBySlug,
79
+ Oe as fetchCart,
80
+ Be as fetchCartRecommendations,
81
+ Ke as fetchDeliveryZones,
82
+ be as fetchOrder,
83
+ qe as fetchOrderRecommendations,
84
+ Ae as fetchProductAddons,
85
+ ke as fetchProductBySlug,
86
+ ve as fetchProductRecommendations,
87
+ Ge as fetchProductsByBrand,
88
+ re as formatCurrency,
89
+ te as formatDate,
90
+ oe as formatDateTime,
91
+ fe as getApiClient,
92
+ me as getStatusColor,
93
+ se as initializeApiClient,
94
+ Te as initiateCheckout,
93
95
  e as publicApi,
94
- je as queryKeys,
95
- Be as removeCartItem,
96
- Te as removeDiscount,
97
- fe as resetApiClient,
98
- Se as updateCart,
99
- Fe as updateCartItem,
100
- Ee as useAddCartItem,
101
- ae as useApiClientContext,
102
- de as useApiConfig,
103
- Je as useApplyDiscount,
96
+ we as queryKeys,
97
+ Se as removeCartItem,
98
+ Me as removeDiscount,
99
+ ce as resetApiClient,
100
+ Fe as updateCart,
101
+ He as updateCartItem,
102
+ Je as useAddCartItem,
103
+ de as useApiClientContext,
104
+ ue as useApiConfig,
105
+ Le as useApplyDiscount,
104
106
  d as useCart,
105
- Le as useCheckoutCart,
106
- ur as useConfirmOrder,
107
- Ne as useCreateCart,
108
- tr as useGetBrand,
109
- Qe as useGetCart,
110
- Ve as useGetCartRecommendations,
111
- cr as useGetDeliveryZones,
112
- nr as useGetOrder,
113
- fr as useGetOrderRecommendations,
114
- mr as useGetProduct,
115
- ar as useGetProductAddOns,
116
- ir as useGetProductRecommendations,
117
- dr as useGetProducts,
118
- We as useInitiateCheckout,
107
+ Ne as useCheckoutCart,
108
+ fr as useConfirmOrder,
109
+ Qe as useCreateCart,
110
+ mr as useGetBrand,
111
+ We as useGetCart,
112
+ Xe as useGetCartRecommendations,
113
+ xr as useGetDeliveryZones,
114
+ sr as useGetOrder,
115
+ cr as useGetOrderRecommendations,
116
+ ir as useGetProduct,
117
+ dr as useGetProductAddOns,
118
+ pr as useGetProductRecommendations,
119
+ ur as useGetProducts,
120
+ Ye as useInitiateCheckout,
119
121
  n as useMetaPixel,
120
122
  x as usePageTracking,
121
- Xe as useRemoveCartItem,
122
- Ye as useRemoveDiscount,
123
+ _e as useRemoveCartItem,
124
+ er as useRemoveDiscount,
123
125
  c as useTikTokPixel,
124
- _e as useUpdateCart,
125
- er as useUpdateCartItem
126
+ rr as useUpdateCart,
127
+ tr as useUpdateCartItem
126
128
  };
package/dist/index10.mjs CHANGED
@@ -1,37 +1,42 @@
1
1
  'use client';
2
- import { jsxs as n, jsx as t, Fragment as B } from "react/jsx-runtime";
3
- import { useRef as M, useState as E } from "react";
4
- import { ChevronLeft as F, ChevronRight as L } from "lucide-react";
5
- import { Switch as O } from "./index43.mjs";
6
- import { Badge as R } from "./index18.mjs";
7
- import { cn as u, formatCurrency as v } from "./index22.mjs";
8
- import "./index23.mjs";
2
+ import { jsxs as a, jsx as t, Fragment as C } from "react/jsx-runtime";
3
+ import { useState as f, useRef as V } from "react";
4
+ import { ChevronLeft as U, ChevronRight as z } from "lucide-react";
5
+ import { Switch as G } from "./index44.mjs";
6
+ import { Badge as T } from "./index19.mjs";
7
+ import { cn as P, formatCurrency as k } from "./index23.mjs";
8
+ import { VariantPickerModal as _ } from "./index12.mjs";
9
+ import "./index24.mjs";
9
10
  import "@tanstack/react-query";
10
- import { useGetProductAddOns as U } from "./index37.mjs";
11
- import { useCart as z } from "./index3.mjs";
12
- function Y({
13
- slug: d,
14
- products: m,
15
- onToggle: h,
16
- selectedProductIds: N,
17
- className: f,
18
- title: b = "Popular add-ons",
19
- limit: y = 6
11
+ import { useGetProductAddOns as $ } from "./index38.mjs";
12
+ import { useCart as q } from "./index3.mjs";
13
+ function le({
14
+ slug: g,
15
+ products: x,
16
+ onToggle: u,
17
+ selectedProductIds: A,
18
+ onProductClick: H,
19
+ className: p,
20
+ title: j = "Popular add-ons",
21
+ limit: D = 6
20
22
  }) {
21
- const { cart: i, addItem: w, removeItem: C } = z(), { data: P, isLoading: x } = U(d || "", y, {
22
- enabled: !!d && !m
23
- }), c = m || P || [], k = N || c.filter((e) => i == null ? void 0 : i.items.some((l) => {
24
- var r;
25
- return l.variant.id === ((r = e.variants[0]) == null ? void 0 : r.id);
26
- })).map((e) => e.id), A = async (e, l) => {
27
- if (h) {
28
- h(e, l);
23
+ const { cart: s, addItem: v, removeItem: I } = q(), { data: M, isLoading: N } = $(g || "", D, {
24
+ enabled: !!g && !x
25
+ }), c = x || M || [], W = A || c.filter((e) => s == null ? void 0 : s.items.some(
26
+ (n) => e.variants.some((r) => r.id === n.variant.id)
27
+ )).map((e) => e.id), [y, m] = f(null), [B, b] = f(!1), F = async (e, n) => {
28
+ if (u) {
29
+ u(e, n);
30
+ return;
31
+ }
32
+ if (n && e.variants.length > 1) {
33
+ m(e);
29
34
  return;
30
35
  }
31
36
  const r = e.variants[0];
32
37
  if (r)
33
- if (l)
34
- await w(
38
+ if (n)
39
+ await v(
35
40
  e.slug,
36
41
  e.name,
37
42
  r.price,
@@ -39,120 +44,156 @@ function Y({
39
44
  1
40
45
  );
41
46
  else {
42
- const a = i == null ? void 0 : i.items.find((s) => s.variant.id === r.id);
43
- a && await C(a.id);
47
+ const l = s == null ? void 0 : s.items.find(
48
+ (i) => e.variants.some((d) => d.id === i.variant.id)
49
+ );
50
+ l && await I(l.id);
44
51
  }
45
- }, o = M(null), [j, D] = E(0), I = () => {
52
+ }, S = async (e, n) => {
53
+ b(!0);
54
+ try {
55
+ await v(
56
+ e.slug,
57
+ e.name,
58
+ n.price,
59
+ n.sku,
60
+ 1
61
+ ), m(null);
62
+ } finally {
63
+ b(!1);
64
+ }
65
+ }, o = V(null), [L, O] = f(0), E = () => {
46
66
  if (o.current) {
47
- const { scrollLeft: e, scrollWidth: l, clientWidth: r } = o.current, a = e / (l - r);
48
- D(a || 0);
67
+ const { scrollLeft: e, scrollWidth: n, clientWidth: r } = o.current, l = e / (n - r);
68
+ O(l || 0);
49
69
  }
50
- }, g = (e) => {
70
+ }, w = (e) => {
51
71
  if (o.current) {
52
- const { clientWidth: l } = o.current, r = l * 0.9;
72
+ const { clientWidth: n } = o.current, r = n * 0.9;
53
73
  o.current.scrollBy({
54
74
  left: e === "left" ? -r : r,
55
75
  behavior: "smooth"
56
76
  });
57
77
  }
58
78
  };
59
- return (!c || c.length === 0) && !x ? null : x ? /* @__PURE__ */ n("div", { className: u("w-full py-8 space-y-4 animate-pulse", f), style: { maxWidth: "calc(100vw - calc(var(--spacing) * 7))" }, children: [
79
+ return (!c || c.length === 0) && !N ? null : N ? /* @__PURE__ */ a("div", { className: P("w-full py-8 space-y-4 animate-pulse", p), style: { maxWidth: "calc(100vw - calc(var(--spacing) * 7))" }, children: [
60
80
  /* @__PURE__ */ t("div", { className: "h-4 w-32 bg-gray-200 rounded px-1 mb-6" }),
61
- /* @__PURE__ */ n("div", { className: "flex gap-4 overflow-x-hidden", children: [
81
+ /* @__PURE__ */ a("div", { className: "flex gap-4 overflow-x-hidden", children: [
62
82
  /* @__PURE__ */ t("div", { className: "min-w-[90%] h-[90px] bg-gray-100 rounded-[2rem]" }),
63
83
  /* @__PURE__ */ t("div", { className: "min-w-[90%] h-[90px] bg-gray-100 rounded-[2rem]" })
64
84
  ] })
65
- ] }) : /* @__PURE__ */ n("div", { className: f, children: [
66
- /* @__PURE__ */ t("div", { className: "px-1 mb-3", children: /* @__PURE__ */ t("h3", { className: "text-lg font-bold tracking-tight text-gray-900", children: b }) }),
67
- /* @__PURE__ */ t("div", { className: "relative", children: /* @__PURE__ */ t(
68
- "div",
69
- {
70
- ref: o,
71
- onScroll: I,
72
- className: "flex gap-4 overflow-x-auto scrollbar-hide snap-x snap-mandatory px-1",
73
- style: { scrollbarWidth: "none", msOverflowStyle: "none", maxWidth: "calc(100vw - calc(var(--spacing) * 7))" },
74
- children: c.map((e) => {
75
- const l = k.includes(e.id), r = e.variants[0], a = (r == null ? void 0 : r.price) || 0, s = e.compareAtPrice || r.compareAtPrice, p = s && s > a, S = p ? Math.round((s - a) / s * 100) : 0;
76
- return /* @__PURE__ */ n(
85
+ ] }) : /* @__PURE__ */ a(C, { children: [
86
+ /* @__PURE__ */ a("div", { className: p, children: [
87
+ /* @__PURE__ */ t("div", { className: "px-1 mb-3", children: /* @__PURE__ */ t("h3", { className: "text-lg font-bold tracking-tight text-gray-900", children: j }) }),
88
+ /* @__PURE__ */ t("div", { className: "relative", children: /* @__PURE__ */ t(
89
+ "div",
90
+ {
91
+ ref: o,
92
+ onScroll: E,
93
+ className: "flex gap-4 overflow-x-auto scrollbar-hide snap-x snap-mandatory px-1",
94
+ style: { scrollbarWidth: "none", msOverflowStyle: "none", maxWidth: "calc(100vw - calc(var(--spacing) * 7))" },
95
+ children: c.map((e) => {
96
+ const n = W.includes(e.id), r = e.variants[0], l = (r == null ? void 0 : r.price) || 0, i = e.compareAtPrice || r.compareAtPrice, d = i && i > l, R = d ? Math.round((i - l) / i * 100) : 0;
97
+ return /* @__PURE__ */ a(
98
+ "div",
99
+ {
100
+ className: "relative flex min-w-[90%] md:min-w-[420px] snap-start items-center gap-4 rounded-xl bg-[#EBEBEB] p-3 transition-all",
101
+ children: [
102
+ /* @__PURE__ */ a(
103
+ "a",
104
+ {
105
+ href: `/product/${e.slug}`,
106
+ className: "flex flex-1 items-center gap-4 min-w-0",
107
+ children: [
108
+ /* @__PURE__ */ t("div", { className: "h-16 w-16 flex-shrink-0 overflow-hidden rounded-xl bg-white/40 flex items-center justify-center", children: e.thumbnailUrl ? /* @__PURE__ */ t(
109
+ "img",
110
+ {
111
+ src: e.thumbnailUrl,
112
+ alt: e.name,
113
+ className: "h-full w-full object-cover",
114
+ loading: "lazy"
115
+ }
116
+ ) : /* @__PURE__ */ t("div", { className: "flex h-full w-full items-center justify-center text-[10px] text-gray-400", children: "No Img" }) }),
117
+ /* @__PURE__ */ a("div", { className: "flex flex-1 flex-col justify-center min-w-0", children: [
118
+ /* @__PURE__ */ t("h4", { className: "text-md font-bold text-[#333] truncate pr-2", title: e.name, children: e.name }),
119
+ e.addonDescription && /* @__PURE__ */ t("p", { className: "text-[11px] text-gray-500 line-clamp-3 italic mb-1", children: e.addonDescription }),
120
+ /* @__PURE__ */ a("div", { className: "flex items-center gap-2 mt-1", children: [
121
+ /* @__PURE__ */ t("span", { className: "text-md font-bold text-[#333]", children: k(l) }),
122
+ d && /* @__PURE__ */ a(C, { children: [
123
+ /* @__PURE__ */ t("span", { className: "text-sm text-[#DC143C] line-through", children: k(i) }),
124
+ /* @__PURE__ */ a(T, { className: "bg-[#DC143C]/10 hover:bg-[#DC143C]/20 text-[#DC143C] border-none text-[10px] font-bold px-2 py-0.5 rounded-lg uppercase tracking-tight", children: [
125
+ R,
126
+ "% OFF"
127
+ ] })
128
+ ] })
129
+ ] })
130
+ ] })
131
+ ]
132
+ }
133
+ ),
134
+ /* @__PURE__ */ t("div", { className: "pl-2", onClick: (h) => h.stopPropagation(), children: /* @__PURE__ */ t(
135
+ G,
136
+ {
137
+ checked: n,
138
+ onCheckedChange: (h) => F(e, h),
139
+ className: "scale-125"
140
+ }
141
+ ) })
142
+ ]
143
+ },
144
+ e.id
145
+ );
146
+ })
147
+ }
148
+ ) }),
149
+ /* @__PURE__ */ a("div", { className: "flex items-center justify-between px-2 mt-2", children: [
150
+ /* @__PURE__ */ t("div", { className: "flex gap-1.5 focus:outline-none", children: Array.from({ length: Math.min(c.length, 6) }).map((e, n) => {
151
+ const r = Math.round(L * (Math.min(c.length, 6) - 1)) === n;
152
+ return /* @__PURE__ */ t(
77
153
  "div",
78
154
  {
79
- className: "relative flex min-w-[90%] md:min-w-[420px] snap-start items-center gap-4 rounded-xl bg-[#EBEBEB] p-3 transition-all",
80
- children: [
81
- /* @__PURE__ */ t("div", { className: "h-16 w-16 flex-shrink-0 overflow-hidden rounded-xl bg-white/40 flex items-center justify-center", children: e.thumbnailUrl ? /* @__PURE__ */ t(
82
- "img",
83
- {
84
- src: e.thumbnailUrl,
85
- alt: e.name,
86
- className: "h-full w-full object-cover",
87
- loading: "lazy"
88
- }
89
- ) : /* @__PURE__ */ t("div", { className: "flex h-full w-full items-center justify-center text-[10px] text-gray-400", children: "No Img" }) }),
90
- /* @__PURE__ */ n("div", { className: "flex flex-1 flex-col justify-center min-w-0", children: [
91
- /* @__PURE__ */ t("h4", { className: "text-md font-bold text-[#333] truncate pr-2", title: e.name, children: e.name }),
92
- e.addonDescription && /* @__PURE__ */ t("p", { className: "text-[11px] text-gray-500 line-clamp-3 italic mb-1", children: e.addonDescription }),
93
- /* @__PURE__ */ n("div", { className: "flex items-center gap-2 mt-1", children: [
94
- /* @__PURE__ */ t("span", { className: "text-md font-bold text-[#333]", children: v(a) }),
95
- p && /* @__PURE__ */ n(B, { children: [
96
- /* @__PURE__ */ t("span", { className: "text-sm text-[#DC143C] line-through", children: v(s) }),
97
- /* @__PURE__ */ n(R, { className: "bg-[#DC143C]/10 hover:bg-[#DC143C]/20 text-[#DC143C] border-none text-[10px] font-bold px-2 py-0.5 rounded-lg uppercase tracking-tight", children: [
98
- S,
99
- "% OFF"
100
- ] })
101
- ] })
102
- ] })
103
- ] }),
104
- /* @__PURE__ */ t("div", { className: "pl-2", children: /* @__PURE__ */ t(
105
- O,
106
- {
107
- checked: l,
108
- onCheckedChange: (W) => A(e, W),
109
- className: "scale-125"
110
- }
111
- ) })
112
- ]
155
+ className: P(
156
+ "h-2 w-2 rounded-full transition-all duration-300",
157
+ r ? "bg-gray-600 scale-110" : "bg-gray-300"
158
+ )
113
159
  },
114
- e.id
160
+ n
115
161
  );
116
- })
117
- }
118
- ) }),
119
- /* @__PURE__ */ n("div", { className: "flex items-center justify-between px-2 mt-2", children: [
120
- /* @__PURE__ */ t("div", { className: "flex gap-1.5 focus:outline-none", children: Array.from({ length: Math.min(c.length, 6) }).map((e, l) => {
121
- const r = Math.round(j * (Math.min(c.length, 6) - 1)) === l;
122
- return /* @__PURE__ */ t(
123
- "div",
124
- {
125
- className: u(
126
- "h-2 w-2 rounded-full transition-all duration-300",
127
- r ? "bg-gray-600 scale-110" : "bg-gray-300"
128
- )
129
- },
130
- l
131
- );
132
- }) }),
133
- /* @__PURE__ */ n("div", { className: "flex gap-4", children: [
134
- /* @__PURE__ */ t(
135
- "button",
136
- {
137
- onClick: () => g("left"),
138
- className: "text-gray-400 hover:text-gray-900 transition-colors",
139
- "aria-label": "Previous",
140
- children: /* @__PURE__ */ t(F, { className: "h-6 w-6 stroke-[2.5px]" })
141
- }
142
- ),
143
- /* @__PURE__ */ t(
144
- "button",
145
- {
146
- onClick: () => g("right"),
147
- className: "text-gray-400 hover:text-gray-900 transition-colors",
148
- "aria-label": "Next",
149
- children: /* @__PURE__ */ t(L, { className: "h-6 w-6 stroke-[2.5px]" })
150
- }
151
- )
162
+ }) }),
163
+ /* @__PURE__ */ a("div", { className: "flex gap-4", children: [
164
+ /* @__PURE__ */ t(
165
+ "button",
166
+ {
167
+ onClick: () => w("left"),
168
+ className: "text-gray-400 hover:text-gray-900 transition-colors",
169
+ "aria-label": "Previous",
170
+ children: /* @__PURE__ */ t(U, { className: "h-6 w-6 stroke-[2.5px]" })
171
+ }
172
+ ),
173
+ /* @__PURE__ */ t(
174
+ "button",
175
+ {
176
+ onClick: () => w("right"),
177
+ className: "text-gray-400 hover:text-gray-900 transition-colors",
178
+ "aria-label": "Next",
179
+ children: /* @__PURE__ */ t(z, { className: "h-6 w-6 stroke-[2.5px]" })
180
+ }
181
+ )
182
+ ] })
152
183
  ] })
153
- ] })
184
+ ] }),
185
+ /* @__PURE__ */ t(
186
+ _,
187
+ {
188
+ isOpen: !!y,
189
+ onClose: () => m(null),
190
+ product: y,
191
+ onConfirm: S,
192
+ isLoading: B
193
+ }
194
+ )
154
195
  ] });
155
196
  }
156
197
  export {
157
- Y as ProductAddOns
198
+ le as ProductAddOns
158
199
  };