@voyant-travel/inventory-react 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (564) hide show
  1. package/LICENSE +201 -0
  2. package/dist/admin/index.d.ts +91 -0
  3. package/dist/admin/index.d.ts.map +1 -0
  4. package/dist/admin/index.js +132 -0
  5. package/dist/admin/pages/product-detail-page.d.ts +18 -0
  6. package/dist/admin/pages/product-detail-page.d.ts.map +1 -0
  7. package/dist/admin/pages/product-detail-page.js +63 -0
  8. package/dist/admin/product-categories-host.d.ts +7 -0
  9. package/dist/admin/product-categories-host.d.ts.map +1 -0
  10. package/dist/admin/product-categories-host.js +11 -0
  11. package/dist/admin/product-detail-api.d.ts +22 -0
  12. package/dist/admin/product-detail-api.d.ts.map +1 -0
  13. package/dist/admin/product-detail-api.js +58 -0
  14. package/dist/admin/products-host.d.ts +11 -0
  15. package/dist/admin/products-host.d.ts.map +1 -0
  16. package/dist/admin/products-host.js +17 -0
  17. package/dist/admin/products-list-skeleton.d.ts +10 -0
  18. package/dist/admin/products-list-skeleton.d.ts.map +1 -0
  19. package/dist/admin/products-list-skeleton.js +23 -0
  20. package/dist/client.d.ts +16 -0
  21. package/dist/client.d.ts.map +1 -0
  22. package/dist/client.js +79 -0
  23. package/dist/components/option-unit-dialog.d.ts +11 -0
  24. package/dist/components/option-unit-dialog.d.ts.map +1 -0
  25. package/dist/components/option-unit-dialog.js +17 -0
  26. package/dist/components/option-unit-form.d.ts +17 -0
  27. package/dist/components/option-unit-form.d.ts.map +1 -0
  28. package/dist/components/option-unit-form.js +123 -0
  29. package/dist/components/product-action-ledger-card.d.ts +17 -0
  30. package/dist/components/product-action-ledger-card.d.ts.map +1 -0
  31. package/dist/components/product-action-ledger-card.js +73 -0
  32. package/dist/components/product-catalog-card.d.ts +14 -0
  33. package/dist/components/product-catalog-card.d.ts.map +1 -0
  34. package/dist/components/product-catalog-card.js +44 -0
  35. package/dist/components/product-categories-page.d.ts +7 -0
  36. package/dist/components/product-categories-page.d.ts.map +1 -0
  37. package/dist/components/product-categories-page.js +9 -0
  38. package/dist/components/product-category-combobox.d.ts +10 -0
  39. package/dist/components/product-category-combobox.d.ts.map +1 -0
  40. package/dist/components/product-category-combobox.js +47 -0
  41. package/dist/components/product-category-dialog.d.ts +9 -0
  42. package/dist/components/product-category-dialog.d.ts.map +1 -0
  43. package/dist/components/product-category-dialog.js +17 -0
  44. package/dist/components/product-category-form.d.ts +15 -0
  45. package/dist/components/product-category-form.d.ts.map +1 -0
  46. package/dist/components/product-category-form.js +82 -0
  47. package/dist/components/product-category-list.d.ts +5 -0
  48. package/dist/components/product-category-list.d.ts.map +1 -0
  49. package/dist/components/product-category-list.js +48 -0
  50. package/dist/components/product-combobox.d.ts +13 -0
  51. package/dist/components/product-combobox.d.ts.map +1 -0
  52. package/dist/components/product-combobox.js +23 -0
  53. package/dist/components/product-contract-template-combobox.d.ts +9 -0
  54. package/dist/components/product-contract-template-combobox.d.ts.map +1 -0
  55. package/dist/components/product-contract-template-combobox.js +97 -0
  56. package/dist/components/product-day-dialog.d.ts +20 -0
  57. package/dist/components/product-day-dialog.d.ts.map +1 -0
  58. package/dist/components/product-day-dialog.js +20 -0
  59. package/dist/components/product-day-form.d.ts +19 -0
  60. package/dist/components/product-day-form.d.ts.map +1 -0
  61. package/dist/components/product-day-form.js +77 -0
  62. package/dist/components/product-day-media-tray.d.ts +11 -0
  63. package/dist/components/product-day-media-tray.d.ts.map +1 -0
  64. package/dist/components/product-day-media-tray.js +74 -0
  65. package/dist/components/product-day-service-dialog.d.ts +14 -0
  66. package/dist/components/product-day-service-dialog.d.ts.map +1 -0
  67. package/dist/components/product-day-service-dialog.js +19 -0
  68. package/dist/components/product-day-service-form.d.ts +44 -0
  69. package/dist/components/product-day-service-form.d.ts.map +1 -0
  70. package/dist/components/product-day-service-form.js +152 -0
  71. package/dist/components/product-detail/commerce-client.d.ts +314 -0
  72. package/dist/components/product-detail/commerce-client.d.ts.map +1 -0
  73. package/dist/components/product-detail/commerce-client.js +261 -0
  74. package/dist/components/product-detail/host.d.ts +54 -0
  75. package/dist/components/product-detail/host.d.ts.map +1 -0
  76. package/dist/components/product-detail/host.js +27 -0
  77. package/dist/components/product-detail/index.d.ts +6 -0
  78. package/dist/components/product-detail/index.d.ts.map +1 -0
  79. package/dist/components/product-detail/index.js +5 -0
  80. package/dist/components/product-detail/product-activity-section.d.ts +4 -0
  81. package/dist/components/product-detail/product-activity-section.d.ts.map +1 -0
  82. package/dist/components/product-detail/product-activity-section.js +37 -0
  83. package/dist/components/product-detail/product-day-sheet.d.ts +14 -0
  84. package/dist/components/product-detail/product-day-sheet.d.ts.map +1 -0
  85. package/dist/components/product-detail/product-day-sheet.js +75 -0
  86. package/dist/components/product-detail/product-day-translation.d.ts +41 -0
  87. package/dist/components/product-detail/product-day-translation.d.ts.map +1 -0
  88. package/dist/components/product-detail/product-day-translation.js +111 -0
  89. package/dist/components/product-detail/product-departure-dialog.d.ts +11 -0
  90. package/dist/components/product-detail/product-departure-dialog.d.ts.map +1 -0
  91. package/dist/components/product-detail/product-departure-dialog.js +10 -0
  92. package/dist/components/product-detail/product-departure-form.d.ts +25 -0
  93. package/dist/components/product-detail/product-departure-form.d.ts.map +1 -0
  94. package/dist/components/product-detail/product-departure-form.js +241 -0
  95. package/dist/components/product-detail/product-departure-pricing-override-dialog.d.ts +8 -0
  96. package/dist/components/product-detail/product-departure-pricing-override-dialog.d.ts.map +1 -0
  97. package/dist/components/product-detail/product-departure-pricing-override-dialog.js +126 -0
  98. package/dist/components/product-detail/product-detail-availability-sections.d.ts +19 -0
  99. package/dist/components/product-detail/product-detail-availability-sections.d.ts.map +1 -0
  100. package/dist/components/product-detail/product-detail-availability-sections.js +29 -0
  101. package/dist/components/product-detail/product-detail-channel-section.d.ts +8 -0
  102. package/dist/components/product-detail/product-detail-channel-section.d.ts.map +1 -0
  103. package/dist/components/product-detail/product-detail-channel-section.js +16 -0
  104. package/dist/components/product-detail/product-detail-day-row.d.ts +14 -0
  105. package/dist/components/product-detail/product-detail-day-row.d.ts.map +1 -0
  106. package/dist/components/product-detail/product-detail-day-row.js +43 -0
  107. package/dist/components/product-detail/product-detail-dialog.d.ts +10 -0
  108. package/dist/components/product-detail/product-detail-dialog.d.ts.map +1 -0
  109. package/dist/components/product-detail/product-detail-dialog.js +10 -0
  110. package/dist/components/product-detail/product-detail-form.d.ts +22 -0
  111. package/dist/components/product-detail/product-detail-form.d.ts.map +1 -0
  112. package/dist/components/product-detail/product-detail-form.js +205 -0
  113. package/dist/components/product-detail/product-detail-header.d.ts +12 -0
  114. package/dist/components/product-detail/product-detail-header.d.ts.map +1 -0
  115. package/dist/components/product-detail/product-detail-header.js +19 -0
  116. package/dist/components/product-detail/product-detail-itinerary-section.d.ts +4 -0
  117. package/dist/components/product-detail/product-detail-itinerary-section.d.ts.map +1 -0
  118. package/dist/components/product-detail/product-detail-itinerary-section.js +201 -0
  119. package/dist/components/product-detail/product-detail-media-sections.d.ts +15 -0
  120. package/dist/components/product-detail/product-detail-media-sections.d.ts.map +1 -0
  121. package/dist/components/product-detail/product-detail-media-sections.js +19 -0
  122. package/dist/components/product-detail/product-detail-organize-section.d.ts +6 -0
  123. package/dist/components/product-detail/product-detail-organize-section.d.ts.map +1 -0
  124. package/dist/components/product-detail/product-detail-organize-section.js +18 -0
  125. package/dist/components/product-detail/product-detail-page.d.ts +4 -0
  126. package/dist/components/product-detail/product-detail-page.d.ts.map +1 -0
  127. package/dist/components/product-detail/product-detail-page.js +95 -0
  128. package/dist/components/product-detail/product-detail-section-shell.d.ts +19 -0
  129. package/dist/components/product-detail/product-detail-section-shell.d.ts.map +1 -0
  130. package/dist/components/product-detail/product-detail-section-shell.js +23 -0
  131. package/dist/components/product-detail/product-detail-sections.d.ts +7 -0
  132. package/dist/components/product-detail/product-detail-sections.d.ts.map +1 -0
  133. package/dist/components/product-detail/product-detail-sections.js +6 -0
  134. package/dist/components/product-detail/product-detail-shared.d.ts +264 -0
  135. package/dist/components/product-detail/product-detail-shared.d.ts.map +1 -0
  136. package/dist/components/product-detail/product-detail-shared.js +157 -0
  137. package/dist/components/product-detail/product-detail-skeleton.d.ts +9 -0
  138. package/dist/components/product-detail/product-detail-skeleton.d.ts.map +1 -0
  139. package/dist/components/product-detail/product-detail-skeleton.js +53 -0
  140. package/dist/components/product-detail/product-detail-summary-section.d.ts +6 -0
  141. package/dist/components/product-detail/product-detail-summary-section.d.ts.map +1 -0
  142. package/dist/components/product-detail/product-detail-summary-section.js +66 -0
  143. package/dist/components/product-detail/product-extra-dialog.d.ts +21 -0
  144. package/dist/components/product-detail/product-extra-dialog.d.ts.map +1 -0
  145. package/dist/components/product-detail/product-extra-dialog.js +131 -0
  146. package/dist/components/product-detail/product-itinerary-form.d.ts +16 -0
  147. package/dist/components/product-detail/product-itinerary-form.d.ts.map +1 -0
  148. package/dist/components/product-detail/product-itinerary-form.js +38 -0
  149. package/dist/components/product-detail/product-market-rules-section.d.ts +6 -0
  150. package/dist/components/product-detail/product-market-rules-section.d.ts.map +1 -0
  151. package/dist/components/product-detail/product-market-rules-section.js +81 -0
  152. package/dist/components/product-detail/product-media-gallery.d.ts +19 -0
  153. package/dist/components/product-detail/product-media-gallery.d.ts.map +1 -0
  154. package/dist/components/product-detail/product-media-gallery.js +114 -0
  155. package/dist/components/product-detail/product-option-price-rule-dialog.d.ts +12 -0
  156. package/dist/components/product-detail/product-option-price-rule-dialog.d.ts.map +1 -0
  157. package/dist/components/product-detail/product-option-price-rule-dialog.js +10 -0
  158. package/dist/components/product-detail/product-option-price-rule-form.d.ts +29 -0
  159. package/dist/components/product-detail/product-option-price-rule-form.d.ts.map +1 -0
  160. package/dist/components/product-detail/product-option-price-rule-form.js +122 -0
  161. package/dist/components/product-detail/product-option-pricing-grid.d.ts +16 -0
  162. package/dist/components/product-detail/product-option-pricing-grid.d.ts.map +1 -0
  163. package/dist/components/product-detail/product-option-pricing-grid.js +236 -0
  164. package/dist/components/product-detail/product-options-extra-price-rules.d.ts +8 -0
  165. package/dist/components/product-detail/product-options-extra-price-rules.d.ts.map +1 -0
  166. package/dist/components/product-detail/product-options-extra-price-rules.js +123 -0
  167. package/dist/components/product-detail/product-options-pricing-helpers.d.ts +14 -0
  168. package/dist/components/product-detail/product-options-pricing-helpers.d.ts.map +1 -0
  169. package/dist/components/product-detail/product-options-pricing-helpers.js +49 -0
  170. package/dist/components/product-detail/product-options-pricing-panel.d.ts +17 -0
  171. package/dist/components/product-detail/product-options-pricing-panel.d.ts.map +1 -0
  172. package/dist/components/product-detail/product-options-pricing-panel.js +88 -0
  173. package/dist/components/product-detail/product-options-pricing.d.ts +5 -0
  174. package/dist/components/product-detail/product-options-pricing.d.ts.map +1 -0
  175. package/dist/components/product-detail/product-options-pricing.js +4 -0
  176. package/dist/components/product-detail/product-options-shared.d.ts +236 -0
  177. package/dist/components/product-detail/product-options-shared.d.ts.map +1 -0
  178. package/dist/components/product-detail/product-options-shared.js +57 -0
  179. package/dist/components/product-detail/product-options-traveler-category-dialog.d.ts +12 -0
  180. package/dist/components/product-detail/product-options-traveler-category-dialog.d.ts.map +1 -0
  181. package/dist/components/product-detail/product-options-traveler-category-dialog.js +132 -0
  182. package/dist/components/product-detail/product-options-unit-price-matrix.d.ts +10 -0
  183. package/dist/components/product-detail/product-options-unit-price-matrix.d.ts.map +1 -0
  184. package/dist/components/product-detail/product-options-unit-price-matrix.js +103 -0
  185. package/dist/components/product-detail/product-payment-policy-section.d.ts +17 -0
  186. package/dist/components/product-detail/product-payment-policy-section.d.ts.map +1 -0
  187. package/dist/components/product-detail/product-payment-policy-section.js +58 -0
  188. package/dist/components/product-detail/product-schedule-dialog.d.ts +11 -0
  189. package/dist/components/product-detail/product-schedule-dialog.d.ts.map +1 -0
  190. package/dist/components/product-detail/product-schedule-dialog.js +10 -0
  191. package/dist/components/product-detail/product-schedule-form.d.ts +17 -0
  192. package/dist/components/product-detail/product-schedule-form.d.ts.map +1 -0
  193. package/dist/components/product-detail/product-schedule-form.js +223 -0
  194. package/dist/components/product-detail/product-service-dialog.d.ts +12 -0
  195. package/dist/components/product-detail/product-service-dialog.d.ts.map +1 -0
  196. package/dist/components/product-detail/product-service-dialog.js +10 -0
  197. package/dist/components/product-detail/product-service-form.d.ts +22 -0
  198. package/dist/components/product-detail/product-service-form.d.ts.map +1 -0
  199. package/dist/components/product-detail/product-service-form.js +154 -0
  200. package/dist/components/product-detail/product-translation-popover.d.ts +94 -0
  201. package/dist/components/product-detail/product-translation-popover.d.ts.map +1 -0
  202. package/dist/components/product-detail/product-translation-popover.js +238 -0
  203. package/dist/components/product-detail/product-unit-dialog.d.ts +14 -0
  204. package/dist/components/product-detail/product-unit-dialog.d.ts.map +1 -0
  205. package/dist/components/product-detail/product-unit-dialog.js +10 -0
  206. package/dist/components/product-detail/product-unit-form.d.ts +34 -0
  207. package/dist/components/product-detail/product-unit-form.d.ts.map +1 -0
  208. package/dist/components/product-detail/product-unit-form.js +139 -0
  209. package/dist/components/product-detail/product-unit-price-rule-dialog.d.ts +17 -0
  210. package/dist/components/product-detail/product-unit-price-rule-dialog.d.ts.map +1 -0
  211. package/dist/components/product-detail/product-unit-price-rule-dialog.js +10 -0
  212. package/dist/components/product-detail/product-unit-price-rule-form.d.ts +29 -0
  213. package/dist/components/product-detail/product-unit-price-rule-form.d.ts.map +1 -0
  214. package/dist/components/product-detail/product-unit-price-rule-form.js +144 -0
  215. package/dist/components/product-detail/rrule-labels.d.ts +2 -0
  216. package/dist/components/product-detail/rrule-labels.d.ts.map +1 -0
  217. package/dist/components/product-detail/rrule-labels.js +65 -0
  218. package/dist/components/product-detail/timezone-options.d.ts +9 -0
  219. package/dist/components/product-detail/timezone-options.d.ts.map +1 -0
  220. package/dist/components/product-detail/timezone-options.js +28 -0
  221. package/dist/components/product-detail/use-product-detail-data.d.ts +41 -0
  222. package/dist/components/product-detail/use-product-detail-data.d.ts.map +1 -0
  223. package/dist/components/product-detail/use-product-detail-data.js +143 -0
  224. package/dist/components/product-detail/use-product-detail-dialogs.d.ts +24 -0
  225. package/dist/components/product-detail/use-product-detail-dialogs.d.ts.map +1 -0
  226. package/dist/components/product-detail/use-product-detail-dialogs.js +40 -0
  227. package/dist/components/product-detail/zod-resolver.d.ts +4 -0
  228. package/dist/components/product-detail/zod-resolver.d.ts.map +1 -0
  229. package/dist/components/product-detail/zod-resolver.js +39 -0
  230. package/dist/components/product-detail-page.d.ts +57 -0
  231. package/dist/components/product-detail-page.d.ts.map +1 -0
  232. package/dist/components/product-detail-page.js +118 -0
  233. package/dist/components/product-detail.d.ts +2 -0
  234. package/dist/components/product-detail.d.ts.map +1 -0
  235. package/dist/components/product-detail.js +1 -0
  236. package/dist/components/product-dialog.d.ts +9 -0
  237. package/dist/components/product-dialog.d.ts.map +1 -0
  238. package/dist/components/product-dialog.js +13 -0
  239. package/dist/components/product-facility-combobox.d.ts +9 -0
  240. package/dist/components/product-facility-combobox.d.ts.map +1 -0
  241. package/dist/components/product-facility-combobox.js +94 -0
  242. package/dist/components/product-form.d.ts +14 -0
  243. package/dist/components/product-form.d.ts.map +1 -0
  244. package/dist/components/product-form.js +191 -0
  245. package/dist/components/product-itinerary-day-row.d.ts +22 -0
  246. package/dist/components/product-itinerary-day-row.d.ts.map +1 -0
  247. package/dist/components/product-itinerary-day-row.js +17 -0
  248. package/dist/components/product-itinerary-dialog.d.ts +16 -0
  249. package/dist/components/product-itinerary-dialog.d.ts.map +1 -0
  250. package/dist/components/product-itinerary-dialog.js +85 -0
  251. package/dist/components/product-itinerary-section.d.ts +16 -0
  252. package/dist/components/product-itinerary-section.d.ts.map +1 -0
  253. package/dist/components/product-itinerary-section.js +105 -0
  254. package/dist/components/product-list.d.ts +7 -0
  255. package/dist/components/product-list.d.ts.map +1 -0
  256. package/dist/components/product-list.js +155 -0
  257. package/dist/components/product-media-dialog.d.ts +11 -0
  258. package/dist/components/product-media-dialog.d.ts.map +1 -0
  259. package/dist/components/product-media-dialog.js +17 -0
  260. package/dist/components/product-media-form.d.ts +17 -0
  261. package/dist/components/product-media-form.d.ts.map +1 -0
  262. package/dist/components/product-media-form.js +101 -0
  263. package/dist/components/product-media-lightbox.d.ts +7 -0
  264. package/dist/components/product-media-lightbox.d.ts.map +1 -0
  265. package/dist/components/product-media-lightbox.js +31 -0
  266. package/dist/components/product-media-section.d.ts +27 -0
  267. package/dist/components/product-media-section.d.ts.map +1 -0
  268. package/dist/components/product-media-section.js +130 -0
  269. package/dist/components/product-media-tile.d.ts +17 -0
  270. package/dist/components/product-media-tile.d.ts.map +1 -0
  271. package/dist/components/product-media-tile.js +16 -0
  272. package/dist/components/product-option-dialog.d.ts +11 -0
  273. package/dist/components/product-option-dialog.d.ts.map +1 -0
  274. package/dist/components/product-option-dialog.js +17 -0
  275. package/dist/components/product-option-form.d.ts +17 -0
  276. package/dist/components/product-option-form.d.ts.map +1 -0
  277. package/dist/components/product-option-form.js +91 -0
  278. package/dist/components/product-options-section.d.ts +13 -0
  279. package/dist/components/product-options-section.d.ts.map +1 -0
  280. package/dist/components/product-options-section.js +200 -0
  281. package/dist/components/product-quick-view-sheet.d.ts +23 -0
  282. package/dist/components/product-quick-view-sheet.d.ts.map +1 -0
  283. package/dist/components/product-quick-view-sheet.js +65 -0
  284. package/dist/components/product-tag-dialog.d.ts +9 -0
  285. package/dist/components/product-tag-dialog.d.ts.map +1 -0
  286. package/dist/components/product-tag-dialog.js +17 -0
  287. package/dist/components/product-tag-form.d.ts +15 -0
  288. package/dist/components/product-tag-form.d.ts.map +1 -0
  289. package/dist/components/product-tag-form.js +48 -0
  290. package/dist/components/product-tag-list.d.ts +5 -0
  291. package/dist/components/product-tag-list.d.ts.map +1 -0
  292. package/dist/components/product-tag-list.js +44 -0
  293. package/dist/components/product-tags-page.d.ts +7 -0
  294. package/dist/components/product-tags-page.d.ts.map +1 -0
  295. package/dist/components/product-tags-page.js +9 -0
  296. package/dist/components/product-tax-class-combobox.d.ts +9 -0
  297. package/dist/components/product-tax-class-combobox.d.ts.map +1 -0
  298. package/dist/components/product-tax-class-combobox.js +100 -0
  299. package/dist/components/product-translations-card.d.ts +7 -0
  300. package/dist/components/product-translations-card.d.ts.map +1 -0
  301. package/dist/components/product-translations-card.js +188 -0
  302. package/dist/components/product-type-combobox.d.ts +9 -0
  303. package/dist/components/product-type-combobox.d.ts.map +1 -0
  304. package/dist/components/product-type-combobox.js +48 -0
  305. package/dist/components/product-types-page.d.ts +6 -0
  306. package/dist/components/product-types-page.d.ts.map +1 -0
  307. package/dist/components/product-types-page.js +103 -0
  308. package/dist/components/product-version-dialog.d.ts +8 -0
  309. package/dist/components/product-version-dialog.d.ts.map +1 -0
  310. package/dist/components/product-version-dialog.js +39 -0
  311. package/dist/components/product-versions-section.d.ts +7 -0
  312. package/dist/components/product-versions-section.d.ts.map +1 -0
  313. package/dist/components/product-versions-section.js +19 -0
  314. package/dist/components/products-page.d.ts +8 -0
  315. package/dist/components/products-page.d.ts.map +1 -0
  316. package/dist/components/products-page.js +8 -0
  317. package/dist/extras/client.d.ts +14 -0
  318. package/dist/extras/client.d.ts.map +1 -0
  319. package/dist/extras/client.js +58 -0
  320. package/dist/extras/components/extra-catalog-card.d.ts +13 -0
  321. package/dist/extras/components/extra-catalog-card.d.ts.map +1 -0
  322. package/dist/extras/components/extra-catalog-card.js +52 -0
  323. package/dist/extras/components/product-combobox.d.ts +9 -0
  324. package/dist/extras/components/product-combobox.d.ts.map +1 -0
  325. package/dist/extras/components/product-combobox.js +46 -0
  326. package/dist/extras/hooks/index.d.ts +4 -0
  327. package/dist/extras/hooks/index.d.ts.map +1 -0
  328. package/dist/extras/hooks/index.js +3 -0
  329. package/dist/extras/hooks/use-product-extra-mutation.d.ts +70 -0
  330. package/dist/extras/hooks/use-product-extra-mutation.d.ts.map +1 -0
  331. package/dist/extras/hooks/use-product-extra-mutation.js +38 -0
  332. package/dist/extras/hooks/use-product-extra.d.ts +24 -0
  333. package/dist/extras/hooks/use-product-extra.d.ts.map +1 -0
  334. package/dist/extras/hooks/use-product-extra.js +12 -0
  335. package/dist/extras/hooks/use-product-extras.d.ts +30 -0
  336. package/dist/extras/hooks/use-product-extras.d.ts.map +1 -0
  337. package/dist/extras/hooks/use-product-extras.js +12 -0
  338. package/dist/extras/i18n/en.d.ts +52 -0
  339. package/dist/extras/i18n/en.d.ts.map +1 -0
  340. package/dist/extras/i18n/en.js +51 -0
  341. package/dist/extras/i18n/index.d.ts +5 -0
  342. package/dist/extras/i18n/index.d.ts.map +1 -0
  343. package/dist/extras/i18n/index.js +3 -0
  344. package/dist/extras/i18n/messages.d.ts +37 -0
  345. package/dist/extras/i18n/messages.d.ts.map +1 -0
  346. package/dist/extras/i18n/messages.js +1 -0
  347. package/dist/extras/i18n/provider.d.ts +126 -0
  348. package/dist/extras/i18n/provider.d.ts.map +1 -0
  349. package/dist/extras/i18n/provider.js +44 -0
  350. package/dist/extras/i18n/ro.d.ts +52 -0
  351. package/dist/extras/i18n/ro.d.ts.map +1 -0
  352. package/dist/extras/i18n/ro.js +51 -0
  353. package/dist/extras/index.d.ts +7 -0
  354. package/dist/extras/index.d.ts.map +1 -0
  355. package/dist/extras/index.js +6 -0
  356. package/dist/extras/provider.d.ts +2 -0
  357. package/dist/extras/provider.d.ts.map +1 -0
  358. package/dist/extras/provider.js +1 -0
  359. package/dist/extras/query-keys.d.ts +16 -0
  360. package/dist/extras/query-keys.d.ts.map +1 -0
  361. package/dist/extras/query-keys.js +8 -0
  362. package/dist/extras/query-options.d.ts +455 -0
  363. package/dist/extras/query-options.d.ts.map +1 -0
  364. package/dist/extras/query-options.js +44 -0
  365. package/dist/extras/schemas.d.ts +416 -0
  366. package/dist/extras/schemas.d.ts.map +1 -0
  367. package/dist/extras/schemas.js +89 -0
  368. package/dist/extras/ui.d.ts +3 -0
  369. package/dist/extras/ui.d.ts.map +1 -0
  370. package/dist/extras/ui.js +2 -0
  371. package/dist/extras-compat.d.ts +3 -0
  372. package/dist/extras-compat.d.ts.map +1 -0
  373. package/dist/extras-compat.js +1 -0
  374. package/dist/extras.d.ts +10 -0
  375. package/dist/extras.d.ts.map +1 -0
  376. package/dist/extras.js +9 -0
  377. package/dist/hooks/index.d.ts +36 -0
  378. package/dist/hooks/index.d.ts.map +1 -0
  379. package/dist/hooks/index.js +35 -0
  380. package/dist/hooks/use-duplicate-product-option-mutation.d.ts +19 -0
  381. package/dist/hooks/use-duplicate-product-option-mutation.d.ts.map +1 -0
  382. package/dist/hooks/use-duplicate-product-option-mutation.js +65 -0
  383. package/dist/hooks/use-option-unit-mutation.d.ts +60 -0
  384. package/dist/hooks/use-option-unit-mutation.d.ts.map +1 -0
  385. package/dist/hooks/use-option-unit-mutation.js +41 -0
  386. package/dist/hooks/use-option-unit.d.ts +21 -0
  387. package/dist/hooks/use-option-unit.d.ts.map +1 -0
  388. package/dist/hooks/use-option-unit.js +12 -0
  389. package/dist/hooks/use-option-units.d.ts +27 -0
  390. package/dist/hooks/use-option-units.d.ts.map +1 -0
  391. package/dist/hooks/use-option-units.js +12 -0
  392. package/dist/hooks/use-product-action-ledger.d.ts +48 -0
  393. package/dist/hooks/use-product-action-ledger.d.ts.map +1 -0
  394. package/dist/hooks/use-product-action-ledger.js +12 -0
  395. package/dist/hooks/use-product-categories.d.ts +32 -0
  396. package/dist/hooks/use-product-categories.d.ts.map +1 -0
  397. package/dist/hooks/use-product-categories.js +29 -0
  398. package/dist/hooks/use-product-category-mutation.d.ts +65 -0
  399. package/dist/hooks/use-product-category-mutation.d.ts.map +1 -0
  400. package/dist/hooks/use-product-category-mutation.js +39 -0
  401. package/dist/hooks/use-product-category.d.ts +26 -0
  402. package/dist/hooks/use-product-category.d.ts.map +1 -0
  403. package/dist/hooks/use-product-category.js +18 -0
  404. package/dist/hooks/use-product-day-mutation.d.ts +43 -0
  405. package/dist/hooks/use-product-day-mutation.d.ts.map +1 -0
  406. package/dist/hooks/use-product-day-mutation.js +54 -0
  407. package/dist/hooks/use-product-day-service-mutation.d.ts +66 -0
  408. package/dist/hooks/use-product-day-service-mutation.d.ts.map +1 -0
  409. package/dist/hooks/use-product-day-service-mutation.js +41 -0
  410. package/dist/hooks/use-product-day-services.d.ts +21 -0
  411. package/dist/hooks/use-product-day-services.d.ts.map +1 -0
  412. package/dist/hooks/use-product-day-services.js +12 -0
  413. package/dist/hooks/use-product-day-translation-mutation.d.ts +49 -0
  414. package/dist/hooks/use-product-day-translation-mutation.d.ts.map +1 -0
  415. package/dist/hooks/use-product-day-translation-mutation.js +38 -0
  416. package/dist/hooks/use-product-day-translations.d.ts +19 -0
  417. package/dist/hooks/use-product-day-translations.d.ts.map +1 -0
  418. package/dist/hooks/use-product-day-translations.js +20 -0
  419. package/dist/hooks/use-product-days.d.ts +16 -0
  420. package/dist/hooks/use-product-days.d.ts.map +1 -0
  421. package/dist/hooks/use-product-days.js +12 -0
  422. package/dist/hooks/use-product-itineraries.d.ts +15 -0
  423. package/dist/hooks/use-product-itineraries.d.ts.map +1 -0
  424. package/dist/hooks/use-product-itineraries.js +12 -0
  425. package/dist/hooks/use-product-itinerary-days.d.ts +16 -0
  426. package/dist/hooks/use-product-itinerary-days.d.ts.map +1 -0
  427. package/dist/hooks/use-product-itinerary-days.js +12 -0
  428. package/dist/hooks/use-product-itinerary-mutation.d.ts +54 -0
  429. package/dist/hooks/use-product-itinerary-mutation.d.ts.map +1 -0
  430. package/dist/hooks/use-product-itinerary-mutation.js +63 -0
  431. package/dist/hooks/use-product-media-mutation.d.ts +101 -0
  432. package/dist/hooks/use-product-media-mutation.d.ts.map +1 -0
  433. package/dist/hooks/use-product-media-mutation.js +69 -0
  434. package/dist/hooks/use-product-media.d.ts +26 -0
  435. package/dist/hooks/use-product-media.d.ts.map +1 -0
  436. package/dist/hooks/use-product-media.js +12 -0
  437. package/dist/hooks/use-product-mutation.d.ts +121 -0
  438. package/dist/hooks/use-product-mutation.d.ts.map +1 -0
  439. package/dist/hooks/use-product-mutation.js +44 -0
  440. package/dist/hooks/use-product-option-mutation.d.ts +49 -0
  441. package/dist/hooks/use-product-option-mutation.d.ts.map +1 -0
  442. package/dist/hooks/use-product-option-mutation.js +39 -0
  443. package/dist/hooks/use-product-option.d.ts +18 -0
  444. package/dist/hooks/use-product-option.d.ts.map +1 -0
  445. package/dist/hooks/use-product-option.js +12 -0
  446. package/dist/hooks/use-product-options.d.ts +24 -0
  447. package/dist/hooks/use-product-options.d.ts.map +1 -0
  448. package/dist/hooks/use-product-options.js +12 -0
  449. package/dist/hooks/use-product-tag-mutation.d.ts +25 -0
  450. package/dist/hooks/use-product-tag-mutation.d.ts.map +1 -0
  451. package/dist/hooks/use-product-tag-mutation.js +39 -0
  452. package/dist/hooks/use-product-tag.d.ts +10 -0
  453. package/dist/hooks/use-product-tag.d.ts.map +1 -0
  454. package/dist/hooks/use-product-tag.js +18 -0
  455. package/dist/hooks/use-product-tags.d.ts +16 -0
  456. package/dist/hooks/use-product-tags.d.ts.map +1 -0
  457. package/dist/hooks/use-product-tags.js +25 -0
  458. package/dist/hooks/use-product-translation-mutation.d.ts +52 -0
  459. package/dist/hooks/use-product-translation-mutation.d.ts.map +1 -0
  460. package/dist/hooks/use-product-translation-mutation.js +47 -0
  461. package/dist/hooks/use-product-translations.d.ts +28 -0
  462. package/dist/hooks/use-product-translations.d.ts.map +1 -0
  463. package/dist/hooks/use-product-translations.js +24 -0
  464. package/dist/hooks/use-product-type-mutation.d.ts +50 -0
  465. package/dist/hooks/use-product-type-mutation.d.ts.map +1 -0
  466. package/dist/hooks/use-product-type-mutation.js +47 -0
  467. package/dist/hooks/use-product-type.d.ts +15 -0
  468. package/dist/hooks/use-product-type.d.ts.map +1 -0
  469. package/dist/hooks/use-product-type.js +12 -0
  470. package/dist/hooks/use-product-types.d.ts +21 -0
  471. package/dist/hooks/use-product-types.d.ts.map +1 -0
  472. package/dist/hooks/use-product-types.js +9 -0
  473. package/dist/hooks/use-product-version-mutation.d.ts +16 -0
  474. package/dist/hooks/use-product-version-mutation.d.ts.map +1 -0
  475. package/dist/hooks/use-product-version-mutation.js +22 -0
  476. package/dist/hooks/use-product-versions.d.ts +15 -0
  477. package/dist/hooks/use-product-versions.d.ts.map +1 -0
  478. package/dist/hooks/use-product-versions.js +12 -0
  479. package/dist/hooks/use-product.d.ts +45 -0
  480. package/dist/hooks/use-product.d.ts.map +1 -0
  481. package/dist/hooks/use-product.js +23 -0
  482. package/dist/hooks/use-products.d.ts +51 -0
  483. package/dist/hooks/use-products.d.ts.map +1 -0
  484. package/dist/hooks/use-products.js +38 -0
  485. package/dist/i18n/en-catalog.d.ts +199 -0
  486. package/dist/i18n/en-catalog.d.ts.map +1 -0
  487. package/dist/i18n/en-catalog.js +198 -0
  488. package/dist/i18n/en-core.d.ts +323 -0
  489. package/dist/i18n/en-core.d.ts.map +1 -0
  490. package/dist/i18n/en-core.js +322 -0
  491. package/dist/i18n/en-operations.d.ts +287 -0
  492. package/dist/i18n/en-operations.d.ts.map +1 -0
  493. package/dist/i18n/en-operations.js +286 -0
  494. package/dist/i18n/en.d.ts +803 -0
  495. package/dist/i18n/en.d.ts.map +1 -0
  496. package/dist/i18n/en.js +8 -0
  497. package/dist/i18n/index.d.ts +5 -0
  498. package/dist/i18n/index.d.ts.map +1 -0
  499. package/dist/i18n/index.js +3 -0
  500. package/dist/i18n/message-shared.d.ts +6 -0
  501. package/dist/i18n/message-shared.d.ts.map +1 -0
  502. package/dist/i18n/message-shared.js +1 -0
  503. package/dist/i18n/messages-catalog.d.ts +199 -0
  504. package/dist/i18n/messages-catalog.d.ts.map +1 -0
  505. package/dist/i18n/messages-catalog.js +1 -0
  506. package/dist/i18n/messages-core.d.ts +304 -0
  507. package/dist/i18n/messages-core.d.ts.map +1 -0
  508. package/dist/i18n/messages-core.js +1 -0
  509. package/dist/i18n/messages-operations.d.ts +287 -0
  510. package/dist/i18n/messages-operations.d.ts.map +1 -0
  511. package/dist/i18n/messages-operations.js +1 -0
  512. package/dist/i18n/messages.d.ts +6 -0
  513. package/dist/i18n/messages.d.ts.map +1 -0
  514. package/dist/i18n/messages.js +1 -0
  515. package/dist/i18n/provider.d.ts +1628 -0
  516. package/dist/i18n/provider.d.ts.map +1 -0
  517. package/dist/i18n/provider.js +44 -0
  518. package/dist/i18n/ro-catalog.d.ts +199 -0
  519. package/dist/i18n/ro-catalog.d.ts.map +1 -0
  520. package/dist/i18n/ro-catalog.js +198 -0
  521. package/dist/i18n/ro-core.d.ts +323 -0
  522. package/dist/i18n/ro-core.d.ts.map +1 -0
  523. package/dist/i18n/ro-core.js +322 -0
  524. package/dist/i18n/ro-operations.d.ts +287 -0
  525. package/dist/i18n/ro-operations.d.ts.map +1 -0
  526. package/dist/i18n/ro-operations.js +286 -0
  527. package/dist/i18n/ro.d.ts +803 -0
  528. package/dist/i18n/ro.d.ts.map +1 -0
  529. package/dist/i18n/ro.js +8 -0
  530. package/dist/i18n-en.d.ts +2 -0
  531. package/dist/i18n-en.d.ts.map +1 -0
  532. package/dist/i18n-en.js +1 -0
  533. package/dist/i18n-ro.d.ts +2 -0
  534. package/dist/i18n-ro.d.ts.map +1 -0
  535. package/dist/i18n-ro.js +1 -0
  536. package/dist/i18n.d.ts +2 -0
  537. package/dist/i18n.d.ts.map +1 -0
  538. package/dist/i18n.js +1 -0
  539. package/dist/index.d.ts +9 -0
  540. package/dist/index.d.ts.map +1 -0
  541. package/dist/index.js +8 -0
  542. package/dist/operations.d.ts +53 -0
  543. package/dist/operations.d.ts.map +1 -0
  544. package/dist/operations.js +13 -0
  545. package/dist/provider.d.ts +2 -0
  546. package/dist/provider.d.ts.map +1 -0
  547. package/dist/provider.js +1 -0
  548. package/dist/query-keys.d.ts +114 -0
  549. package/dist/query-keys.d.ts.map +1 -0
  550. package/dist/query-keys.js +34 -0
  551. package/dist/query-options-action-ledger.d.ts +194 -0
  552. package/dist/query-options-action-ledger.d.ts.map +1 -0
  553. package/dist/query-options-action-ledger.js +20 -0
  554. package/dist/query-options.d.ts +1313 -0
  555. package/dist/query-options.d.ts.map +1 -0
  556. package/dist/query-options.js +281 -0
  557. package/dist/schemas.d.ts +1098 -0
  558. package/dist/schemas.d.ts.map +1 -0
  559. package/dist/schemas.js +320 -0
  560. package/dist/ui.d.ts +44 -0
  561. package/dist/ui.d.ts.map +1 -0
  562. package/dist/ui.js +42 -0
  563. package/package.json +159 -0
  564. package/src/styles.css +12 -0
@@ -0,0 +1,131 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { Button, Checkbox, Dialog, DialogBody, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogTitle, Input, Label, Select, SelectContent, SelectItem, SelectTrigger, SelectValue, Textarea, } from "@voyant-travel/ui/components";
3
+ import * as React from "react";
4
+ import { useProductExtraMutation } from "../../extras-compat.js";
5
+ import { useProductDetailMessages } from "./host.js";
6
+ const selectionTypes = ["optional", "required", "default_selected", "unavailable"];
7
+ const pricingModes = [
8
+ "included",
9
+ "per_person",
10
+ "per_booking",
11
+ "quantity_based",
12
+ "on_request",
13
+ "free",
14
+ ];
15
+ const emptyForm = {
16
+ name: "",
17
+ code: "",
18
+ description: "",
19
+ selectionType: "optional",
20
+ pricingMode: "per_booking",
21
+ pricedPerPerson: false,
22
+ minQuantity: "",
23
+ maxQuantity: "",
24
+ defaultQuantity: "",
25
+ active: true,
26
+ };
27
+ function formFromExtra(extra) {
28
+ return {
29
+ name: extra.name,
30
+ code: extra.code ?? "",
31
+ description: extra.description ?? "",
32
+ selectionType: extra.selectionType,
33
+ pricingMode: extra.pricingMode,
34
+ pricedPerPerson: extra.pricedPerPerson,
35
+ minQuantity: extra.minQuantity == null ? "" : String(extra.minQuantity),
36
+ maxQuantity: extra.maxQuantity == null ? "" : String(extra.maxQuantity),
37
+ defaultQuantity: extra.defaultQuantity == null ? "" : String(extra.defaultQuantity),
38
+ active: extra.active,
39
+ };
40
+ }
41
+ function parseNullableInt(value) {
42
+ const parsed = Number.parseInt(value, 10);
43
+ return Number.isFinite(parsed) ? parsed : null;
44
+ }
45
+ function getSelectionTypeLabel(value, messages) {
46
+ switch (value) {
47
+ case "optional":
48
+ return messages.selectionOptional;
49
+ case "required":
50
+ return messages.selectionRequired;
51
+ case "default_selected":
52
+ return messages.selectionDefaultSelected;
53
+ case "unavailable":
54
+ return messages.selectionUnavailable;
55
+ default:
56
+ return value;
57
+ }
58
+ }
59
+ export function getExtraPricingModeLabel(value, messages) {
60
+ switch (value) {
61
+ case "included":
62
+ return messages.pricingIncluded;
63
+ case "per_person":
64
+ return messages.pricingPerPerson;
65
+ case "per_booking":
66
+ return messages.pricingPerBooking;
67
+ case "quantity_based":
68
+ return messages.pricingQuantityBased;
69
+ case "on_request":
70
+ return messages.pricingOnRequest;
71
+ case "free":
72
+ return messages.pricingFree;
73
+ default:
74
+ return value;
75
+ }
76
+ }
77
+ /**
78
+ * Create / edit the *definition* of a product extra (name, selection,
79
+ * pricing mode, quantities). The extra's actual price is set separately, per
80
+ * booking option, via the extra-price-rule editor.
81
+ */
82
+ export function ProductExtraDialog({ open, onOpenChange, productId, extra, nextSortOrder = 0, onSuccess, }) {
83
+ const messages = useProductDetailMessages();
84
+ const extraMessages = messages.products.operations.extras;
85
+ const { create, update } = useProductExtraMutation();
86
+ const [form, setForm] = React.useState(emptyForm);
87
+ const isEditing = !!extra;
88
+ React.useEffect(() => {
89
+ if (open)
90
+ setForm(extra ? formFromExtra(extra) : emptyForm);
91
+ }, [open, extra]);
92
+ const save = async () => {
93
+ const payload = {
94
+ productId,
95
+ name: form.name.trim(),
96
+ code: form.code.trim() || null,
97
+ description: form.description.trim() || null,
98
+ selectionType: form.selectionType,
99
+ pricingMode: form.pricingMode,
100
+ pricedPerPerson: form.pricedPerPerson,
101
+ minQuantity: parseNullableInt(form.minQuantity),
102
+ maxQuantity: parseNullableInt(form.maxQuantity),
103
+ defaultQuantity: parseNullableInt(form.defaultQuantity),
104
+ active: form.active,
105
+ sortOrder: extra?.sortOrder ?? nextSortOrder,
106
+ };
107
+ if (!payload.name)
108
+ return;
109
+ if (extra)
110
+ await update.mutateAsync({ id: extra.id, input: payload });
111
+ else
112
+ await create.mutateAsync(payload);
113
+ onSuccess();
114
+ };
115
+ return (_jsx(Dialog, { open: open, onOpenChange: onOpenChange, children: _jsxs(DialogContent, { size: "lg", children: [_jsxs(DialogHeader, { children: [_jsx(DialogTitle, { children: isEditing ? extraMessages.editTitle : extraMessages.newTitle }), _jsx(DialogDescription, { children: extraMessages.dialogDescription })] }), _jsxs(DialogBody, { className: "grid gap-4", children: [_jsxs("div", { className: "grid gap-3 md:grid-cols-2", children: [_jsx(Field, { label: extraMessages.nameLabel, children: _jsx(Input, { value: form.name, onChange: (event) => setForm({ ...form, name: event.target.value }) }) }), _jsx(Field, { label: extraMessages.codeLabel, children: _jsx(Input, { value: form.code, onChange: (event) => setForm({ ...form, code: event.target.value }) }) })] }), _jsx(Field, { label: extraMessages.descriptionLabel, children: _jsx(Textarea, { value: form.description, onChange: (event) => setForm({ ...form, description: event.target.value }) }) }), _jsxs("div", { className: "grid gap-3 md:grid-cols-3", children: [_jsx(Field, { label: extraMessages.selectionLabel, children: _jsxs(Select, { value: form.selectionType, onValueChange: (value) => setForm({
116
+ ...form,
117
+ selectionType: (value ?? "optional"),
118
+ }), items: selectionTypes.map((type) => ({
119
+ value: type,
120
+ label: getSelectionTypeLabel(type, extraMessages),
121
+ })), children: [_jsx(SelectTrigger, { className: "w-full", children: _jsx(SelectValue, {}) }), _jsx(SelectContent, { children: selectionTypes.map((type) => (_jsx(SelectItem, { value: type, children: getSelectionTypeLabel(type, extraMessages) }, type))) })] }) }), _jsx(Field, { label: extraMessages.pricingLabel, children: _jsxs(Select, { value: form.pricingMode, onValueChange: (value) => setForm({
122
+ ...form,
123
+ pricingMode: (value ?? "per_booking"),
124
+ }), items: pricingModes.map((mode) => ({
125
+ value: mode,
126
+ label: getExtraPricingModeLabel(mode, extraMessages),
127
+ })), children: [_jsx(SelectTrigger, { className: "w-full", children: _jsx(SelectValue, {}) }), _jsx(SelectContent, { children: pricingModes.map((mode) => (_jsx(SelectItem, { value: mode, children: getExtraPricingModeLabel(mode, extraMessages) }, mode))) })] }) }), _jsx(Field, { label: extraMessages.defaultQuantityLabel, children: _jsx(Input, { value: form.defaultQuantity, type: "number", min: "0", onChange: (event) => setForm({ ...form, defaultQuantity: event.target.value }) }) }), _jsx(Field, { label: extraMessages.minQuantityLabel, children: _jsx(Input, { value: form.minQuantity, type: "number", min: "0", onChange: (event) => setForm({ ...form, minQuantity: event.target.value }) }) }), _jsx(Field, { label: extraMessages.maxQuantityLabel, children: _jsx(Input, { value: form.maxQuantity, type: "number", min: "0", onChange: (event) => setForm({ ...form, maxQuantity: event.target.value }) }) })] }), _jsxs("div", { className: "flex flex-wrap items-center gap-6", children: [_jsxs("div", { className: "flex items-center gap-2 text-sm", children: [_jsx(Checkbox, { id: "product-extra-priced-per-person", checked: form.pricedPerPerson, onCheckedChange: (checked) => setForm({ ...form, pricedPerPerson: checked === true }) }), _jsx(Label, { htmlFor: "product-extra-priced-per-person", children: extraMessages.perTravelerLabel })] }), _jsxs("div", { className: "flex items-center gap-2 text-sm", children: [_jsx(Checkbox, { id: "product-extra-active", checked: form.active, onCheckedChange: (checked) => setForm({ ...form, active: checked === true }) }), _jsx(Label, { htmlFor: "product-extra-active", children: extraMessages.activeLabel })] })] })] }), _jsxs(DialogFooter, { className: "-mx-6 -mb-6", children: [_jsx(Button, { variant: "ghost", onClick: () => onOpenChange(false), children: extraMessages.cancel }), _jsx(Button, { onClick: () => void save(), disabled: !form.name.trim(), children: isEditing ? extraMessages.saveChanges : extraMessages.create })] })] }) }));
128
+ }
129
+ function Field({ label, children }) {
130
+ return (_jsxs("div", { className: "flex flex-col gap-1.5", children: [_jsx(Label, { children: label }), children] }));
131
+ }
@@ -0,0 +1,16 @@
1
+ export type ItineraryData = {
2
+ id: string;
3
+ name: string;
4
+ isDefault: boolean;
5
+ };
6
+ export interface ProductItineraryFormProps {
7
+ itinerary?: ItineraryData;
8
+ isFirstItinerary?: boolean;
9
+ onSubmit: (values: {
10
+ name: string;
11
+ isDefault: boolean;
12
+ }) => Promise<void> | void;
13
+ onCancel?: () => void;
14
+ }
15
+ export declare function ProductItineraryForm({ itinerary, isFirstItinerary, onSubmit, onCancel, }: ProductItineraryFormProps): import("react/jsx-runtime").JSX.Element;
16
+ //# sourceMappingURL=product-itinerary-form.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"product-itinerary-form.d.ts","sourceRoot":"","sources":["../../../src/components/product-detail/product-itinerary-form.tsx"],"names":[],"mappings":"AAsBA,MAAM,MAAM,aAAa,GAAG;IAC1B,EAAE,EAAE,MAAM,CAAA;IACV,IAAI,EAAE,MAAM,CAAA;IACZ,SAAS,EAAE,OAAO,CAAA;CACnB,CAAA;AAED,MAAM,WAAW,yBAAyB;IACxC,SAAS,CAAC,EAAE,aAAa,CAAA;IACzB,gBAAgB,CAAC,EAAE,OAAO,CAAA;IAC1B,QAAQ,EAAE,CAAC,MAAM,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,SAAS,EAAE,OAAO,CAAA;KAAE,KAAK,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI,CAAA;IAChF,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAA;CACtB;AAED,wBAAgB,oBAAoB,CAAC,EACnC,SAAS,EACT,gBAAwB,EACxB,QAAQ,EACR,QAAQ,GACT,EAAE,yBAAyB,2CA6E3B"}
@@ -0,0 +1,38 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { Button, Checkbox, Input, Label } from "@voyant-travel/ui/components";
3
+ import { Loader2 } from "lucide-react";
4
+ import { useEffect } from "react";
5
+ import { useForm } from "react-hook-form";
6
+ import { z } from "zod/v4";
7
+ import { useProductDetailMessages } from "./host.js";
8
+ import { zodResolver } from "./zod-resolver.js";
9
+ const buildItineraryFormSchema = (messages) => z.object({
10
+ name: z.string().min(1, messages.validationNameRequired).max(255),
11
+ isDefault: z.boolean(),
12
+ });
13
+ export function ProductItineraryForm({ itinerary, isFirstItinerary = false, onSubmit, onCancel, }) {
14
+ const messages = useProductDetailMessages();
15
+ const itineraryMessages = messages.products.operations.itineraries;
16
+ const isEditing = !!itinerary;
17
+ const schema = buildItineraryFormSchema(itineraryMessages);
18
+ const form = useForm({
19
+ resolver: zodResolver(schema),
20
+ defaultValues: itinerary
21
+ ? { name: itinerary.name, isDefault: itinerary.isDefault }
22
+ : { name: "", isDefault: isFirstItinerary },
23
+ });
24
+ useEffect(() => {
25
+ if (itinerary) {
26
+ form.reset({ name: itinerary.name, isDefault: itinerary.isDefault });
27
+ }
28
+ else {
29
+ form.reset({ name: "", isDefault: isFirstItinerary });
30
+ }
31
+ }, [itinerary, isFirstItinerary, form]);
32
+ const isDefault = form.watch("isDefault");
33
+ const defaultLocked = isEditing && itinerary?.isDefault === true;
34
+ const handleSubmit = async (values) => {
35
+ await onSubmit(values);
36
+ };
37
+ return (_jsxs("form", { onSubmit: form.handleSubmit(handleSubmit), className: "flex flex-col gap-4", children: [_jsxs("div", { className: "grid gap-4", children: [_jsxs("div", { className: "flex flex-col gap-2", children: [_jsx(Label, { htmlFor: "product-itinerary-name", children: itineraryMessages.nameLabel }), _jsx(Input, { id: "product-itinerary-name", autoFocus: true, placeholder: itineraryMessages.namePlaceholder, ...form.register("name") }), form.formState.errors.name && (_jsx("p", { className: "text-xs text-destructive", children: form.formState.errors.name.message }))] }), _jsxs("div", { className: "flex items-start gap-2", children: [_jsx(Checkbox, { id: "product-itinerary-default", checked: isDefault, disabled: defaultLocked || isFirstItinerary, onCheckedChange: (checked) => form.setValue("isDefault", checked === true, { shouldDirty: true }) }), _jsxs("div", { className: "flex flex-col gap-1", children: [_jsx(Label, { htmlFor: "product-itinerary-default", className: "text-sm font-normal", children: itineraryMessages.setDefaultLabel }), defaultLocked ? (_jsx("p", { className: "text-xs text-muted-foreground", children: itineraryMessages.defaultLockHint })) : isFirstItinerary ? (_jsx("p", { className: "text-xs text-muted-foreground", children: itineraryMessages.firstDefaultHint })) : null] })] })] }), _jsxs("div", { className: "flex items-center justify-end gap-2", children: [onCancel ? (_jsx(Button, { type: "button", variant: "ghost", onClick: onCancel, children: itineraryMessages.cancel })) : null, _jsxs(Button, { type: "submit", disabled: form.formState.isSubmitting, children: [form.formState.isSubmitting && _jsx(Loader2, { className: "mr-2 h-4 w-4 animate-spin" }), isEditing ? itineraryMessages.save : itineraryMessages.create] })] })] }));
38
+ }
@@ -0,0 +1,6 @@
1
+ interface ProductMarketRulesSectionProps {
2
+ productId: string;
3
+ }
4
+ export declare function ProductMarketRulesSection({ productId }: ProductMarketRulesSectionProps): import("react/jsx-runtime").JSX.Element;
5
+ export {};
6
+ //# sourceMappingURL=product-market-rules-section.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"product-market-rules-section.d.ts","sourceRoot":"","sources":["../../../src/components/product-detail/product-market-rules-section.tsx"],"names":[],"mappings":"AAwCA,UAAU,8BAA8B;IACtC,SAAS,EAAE,MAAM,CAAA;CAClB;AAED,wBAAgB,yBAAyB,CAAC,EAAE,SAAS,EAAE,EAAE,8BAA8B,2CAuItF"}
@@ -0,0 +1,81 @@
1
+ "use client";
2
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
+ import { formatMessage } from "@voyant-travel/i18n";
4
+ import { Badge, Button, Card, CardContent, CardHeader, CardTitle, } from "@voyant-travel/ui/components";
5
+ import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue, } from "@voyant-travel/ui/components/select";
6
+ import { Globe2, Loader2, Plus, Trash2 } from "lucide-react";
7
+ import { useMemo, useState } from "react";
8
+ import { toast } from "sonner";
9
+ import { useMarketProductRuleMutation, useMarketProductRules, useMarkets, } from "./commerce-client.js";
10
+ import { useProductDetailMessages } from "./host.js";
11
+ const SELLABILITY = ["sellable", "on_request", "unavailable"];
12
+ const VISIBILITY = ["public", "private", "hidden"];
13
+ export function ProductMarketRulesSection({ productId }) {
14
+ const t = useProductDetailMessages().products.operations.marketRules;
15
+ const marketsQuery = useMarkets({ status: "active", limit: 100 });
16
+ const rulesQuery = useMarketProductRules({ productId, limit: 200 });
17
+ const mutations = useMarketProductRuleMutation();
18
+ const markets = marketsQuery.data?.data ?? [];
19
+ const productRules = (rulesQuery.data?.data ?? []).filter((rule) => !rule.optionId);
20
+ const marketById = useMemo(() => new Map(markets.map((market) => [market.id, market])), [markets]);
21
+ const existingMarketIds = new Set(productRules.map((rule) => rule.marketId));
22
+ const availableMarkets = markets.filter((market) => !existingMarketIds.has(market.id));
23
+ const [selectedMarketId, setSelectedMarketId] = useState("");
24
+ const isLoading = marketsQuery.isPending || rulesQuery.isPending;
25
+ const isMutating = mutations.create.isPending || mutations.update.isPending || mutations.remove.isPending;
26
+ const addRule = async () => {
27
+ if (!selectedMarketId)
28
+ return;
29
+ try {
30
+ await mutations.create.mutateAsync({
31
+ marketId: selectedMarketId,
32
+ productId,
33
+ optionId: null,
34
+ priceCatalogId: null,
35
+ visibility: "public",
36
+ sellability: "sellable",
37
+ channelScope: "all",
38
+ active: true,
39
+ availableFrom: null,
40
+ availableTo: null,
41
+ notes: null,
42
+ });
43
+ setSelectedMarketId("");
44
+ }
45
+ catch (error) {
46
+ toast.error(error instanceof Error ? error.message : t.addFailed);
47
+ }
48
+ };
49
+ const updateRule = async (rule, input) => {
50
+ try {
51
+ await mutations.update.mutateAsync({ id: rule.id, input });
52
+ }
53
+ catch (error) {
54
+ toast.error(error instanceof Error ? error.message : t.updateFailed);
55
+ }
56
+ };
57
+ const removeRule = async (rule) => {
58
+ const marketName = marketById.get(rule.marketId)?.name ?? rule.marketId;
59
+ if (!confirm(formatMessage(t.removeConfirm, { market: marketName })))
60
+ return;
61
+ try {
62
+ await mutations.remove.mutateAsync(rule.id);
63
+ }
64
+ catch (error) {
65
+ toast.error(error instanceof Error ? error.message : t.removeFailed);
66
+ }
67
+ };
68
+ return (_jsxs(Card, { children: [_jsx(CardHeader, { children: _jsxs("div", { className: "flex items-center justify-between gap-3", children: [_jsxs("div", { children: [_jsxs(CardTitle, { className: "flex items-center gap-2", children: [_jsx(Globe2, { className: "h-4 w-4" }), t.title] }), _jsx("p", { className: "mt-1 text-muted-foreground text-sm", children: t.description })] }), isLoading ? _jsx(Loader2, { className: "h-4 w-4 animate-spin text-muted-foreground" }) : null] }) }), _jsxs(CardContent, { className: "flex flex-col gap-4", children: [_jsxs("div", { className: "grid gap-2 sm:grid-cols-[minmax(0,1fr)_auto]", children: [_jsxs(Select, { value: selectedMarketId, onValueChange: (value) => setSelectedMarketId(value ?? ""), children: [_jsx(SelectTrigger, { className: "w-full", children: _jsx(SelectValue, { placeholder: t.addMarketPlaceholder }) }), _jsx(SelectContent, { children: availableMarkets.map((market) => (_jsxs(SelectItem, { value: market.id, children: [market.name, " \u00B7 ", market.defaultLanguageTag] }, market.id))) })] }), _jsxs(Button, { type: "button", onClick: () => void addRule(), disabled: !selectedMarketId || isMutating, children: [mutations.create.isPending ? (_jsx(Loader2, { className: "mr-2 h-4 w-4 animate-spin" })) : (_jsx(Plus, { className: "mr-2 h-4 w-4" })), t.addMarketButton] })] }), productRules.length === 0 ? (_jsx("div", { className: "rounded-md border border-dashed p-4 text-muted-foreground text-sm", children: t.empty })) : (_jsxs("div", { className: "rounded-md border", children: [_jsxs("div", { className: "hidden gap-3 border-b px-3 py-2 text-muted-foreground text-xs font-medium md:grid md:grid-cols-[minmax(0,1fr)_160px_150px_130px_40px] md:items-center", children: [_jsx("span", {}), _jsx("span", { children: t.sellabilityLabel }), _jsx("span", { children: t.visibilityLabel }), _jsx("span", { children: t.statusLabel }), _jsx("span", {})] }), _jsx("div", { className: "divide-y", children: productRules.map((rule) => (_jsx(MarketRuleRow, { rule: rule, marketName: marketById.get(rule.marketId)?.name ?? rule.marketId, languageTag: marketById.get(rule.marketId)?.defaultLanguageTag ?? null, disabled: isMutating, onUpdate: updateRule, onRemove: removeRule, messages: t }, rule.id))) })] }))] })] }));
69
+ }
70
+ function MarketRuleRow({ rule, marketName, languageTag, disabled, onUpdate, onRemove, messages, }) {
71
+ return (_jsxs("div", { className: "grid gap-3 p-3 md:grid-cols-[minmax(0,1fr)_160px_150px_130px_40px] md:items-center", children: [_jsxs("div", { className: "min-w-0", children: [_jsx("div", { className: "truncate font-medium text-sm", children: marketName }), _jsxs("div", { className: "mt-1 flex flex-wrap items-center gap-2", children: [languageTag ? _jsx(Badge, { variant: "secondary", children: languageTag }) : null, _jsx(Badge, { variant: rule.active ? "default" : "outline", children: rule.active ? messages.activeBadge : messages.inactiveBadge })] })] }), _jsxs(Select, { value: rule.sellability, onValueChange: (value) => {
72
+ if (value)
73
+ onUpdate(rule, { sellability: value });
74
+ }, disabled: disabled, children: [_jsx(SelectTrigger, { className: "w-full", children: _jsx(SelectValue, {}) }), _jsx(SelectContent, { children: SELLABILITY.map((value) => (_jsx(SelectItem, { value: value, children: messages.sellabilityOptions[value] }, value))) })] }), _jsxs(Select, { value: rule.visibility, onValueChange: (value) => {
75
+ if (value)
76
+ onUpdate(rule, { visibility: value });
77
+ }, disabled: disabled, children: [_jsx(SelectTrigger, { className: "w-full", children: _jsx(SelectValue, {}) }), _jsx(SelectContent, { children: VISIBILITY.map((value) => (_jsx(SelectItem, { value: value, children: messages.visibilityOptions[value] }, value))) })] }), _jsxs(Select, { value: rule.active ? "active" : "inactive", onValueChange: (value) => {
78
+ if (value)
79
+ onUpdate(rule, { active: value === "active" });
80
+ }, disabled: disabled, children: [_jsx(SelectTrigger, { className: "w-full", children: _jsx(SelectValue, {}) }), _jsxs(SelectContent, { children: [_jsx(SelectItem, { value: "active", children: messages.activeStatus }), _jsx(SelectItem, { value: "inactive", children: messages.inactiveStatus })] })] }), _jsx(Button, { type: "button", variant: "ghost", size: "icon", onClick: () => onRemove(rule), disabled: disabled, children: _jsx(Trash2, { className: "h-4 w-4" }) })] }));
81
+ }
@@ -0,0 +1,19 @@
1
+ import type { ProductMediaItem } from "./product-detail-shared.js";
2
+ interface ProductMediaGalleryProps {
3
+ productId: string;
4
+ media: ProductMediaItem[];
5
+ isUploading: boolean;
6
+ onUpload: (file: File) => void;
7
+ onSetCover: (mediaId: string) => void;
8
+ onDelete: (mediaId: string) => void;
9
+ onReorderLocal?: (items: ProductMediaItem[]) => void;
10
+ }
11
+ /**
12
+ * Media block for product + itinerary-day photos.
13
+ * - Featured carousel with prev/next, click-to-lightbox
14
+ * - Reorder-mode toggle exposes draggable thumbnail row (motion Reorder)
15
+ * - Per-tile actions: set cover, delete
16
+ */
17
+ export declare function ProductMediaGallery({ productId, media, isUploading, onUpload, onSetCover, onDelete, onReorderLocal, }: ProductMediaGalleryProps): import("react/jsx-runtime").JSX.Element;
18
+ export {};
19
+ //# sourceMappingURL=product-media-gallery.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"product-media-gallery.d.ts","sourceRoot":"","sources":["../../../src/components/product-detail/product-media-gallery.tsx"],"names":[],"mappings":"AA4BA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAA;AAElE,UAAU,wBAAwB;IAChC,SAAS,EAAE,MAAM,CAAA;IACjB,KAAK,EAAE,gBAAgB,EAAE,CAAA;IACzB,WAAW,EAAE,OAAO,CAAA;IACpB,QAAQ,EAAE,CAAC,IAAI,EAAE,IAAI,KAAK,IAAI,CAAA;IAC9B,UAAU,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAA;IACrC,QAAQ,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAA;IACnC,cAAc,CAAC,EAAE,CAAC,KAAK,EAAE,gBAAgB,EAAE,KAAK,IAAI,CAAA;CACrD;AAED;;;;;GAKG;AACH,wBAAgB,mBAAmB,CAAC,EAClC,SAAS,EACT,KAAK,EACL,WAAW,EACX,QAAQ,EACR,UAAU,EACV,QAAQ,EACR,cAAc,GACf,EAAE,wBAAwB,2CAyM1B"}
@@ -0,0 +1,114 @@
1
+ "use client";
2
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
3
+ import { useMutation } from "@tanstack/react-query";
4
+ import { formatMessage } from "@voyant-travel/i18n";
5
+ import { Button } from "@voyant-travel/ui/components";
6
+ import { Carousel, CarouselContent, CarouselItem, CarouselNext, CarouselPrevious, } from "@voyant-travel/ui/components/carousel";
7
+ import { Dialog, DialogContent, DialogTitle } from "@voyant-travel/ui/components/dialog";
8
+ import { cn } from "@voyant-travel/ui/lib/utils";
9
+ import { ChevronLeft, ChevronRight, GripVertical, Loader2, Star, Trash2, Upload, X, } from "lucide-react";
10
+ import { Reorder } from "motion/react";
11
+ import { useEffect, useRef, useState } from "react";
12
+ import { useProductDetailApi, useProductDetailMessages } from "./host.js";
13
+ /**
14
+ * Media block for product + itinerary-day photos.
15
+ * - Featured carousel with prev/next, click-to-lightbox
16
+ * - Reorder-mode toggle exposes draggable thumbnail row (motion Reorder)
17
+ * - Per-tile actions: set cover, delete
18
+ */
19
+ export function ProductMediaGallery({ productId, media, isUploading, onUpload, onSetCover, onDelete, onReorderLocal, }) {
20
+ const messages = useProductDetailMessages();
21
+ const api = useProductDetailApi();
22
+ const mediaMessages = messages.products.operations.media;
23
+ const fileInputRef = useRef(null);
24
+ const [carouselApi, setCarouselApi] = useState();
25
+ const [active, setActive] = useState(0);
26
+ const [lightboxIndex, setLightboxIndex] = useState(null);
27
+ const [reorderMode, setReorderMode] = useState(false);
28
+ const [localOrder, setLocalOrder] = useState(media);
29
+ // Keep local order in sync with props unless we're actively reordering.
30
+ useEffect(() => {
31
+ if (!reorderMode)
32
+ setLocalOrder(media);
33
+ }, [media, reorderMode]);
34
+ useEffect(() => {
35
+ if (!carouselApi)
36
+ return;
37
+ const onSelect = () => setActive(carouselApi.selectedScrollSnap());
38
+ onSelect();
39
+ carouselApi.on("select", onSelect);
40
+ return () => {
41
+ carouselApi.off("select", onSelect);
42
+ };
43
+ }, [carouselApi]);
44
+ const reorderMutation = useMutation({
45
+ mutationFn: (items) => api_post_reorder(api, productId, items),
46
+ });
47
+ const commitReorder = () => {
48
+ const items = localOrder.map((m, i) => ({ id: m.id, sortOrder: i }));
49
+ reorderMutation.mutate(items, {
50
+ onSuccess: () => {
51
+ setReorderMode(false);
52
+ onReorderLocal?.(localOrder);
53
+ },
54
+ });
55
+ };
56
+ const cancelReorder = () => {
57
+ setLocalOrder(media);
58
+ setReorderMode(false);
59
+ };
60
+ return (_jsxs(_Fragment, { children: [_jsxs("div", { className: "flex items-center justify-between", children: [_jsx("div", { className: "text-xs text-muted-foreground", children: media.length === 0
61
+ ? mediaMessages.emptySummary
62
+ : formatMessage(mediaMessages.itemCount, {
63
+ count: media.length,
64
+ suffix: media.length === 1 ? "" : "s",
65
+ }) }), _jsxs("div", { className: "flex items-center gap-2", children: [media.length > 1 ? (reorderMode ? (_jsxs(_Fragment, { children: [_jsx(Button, { type: "button", variant: "ghost", size: "sm", className: "h-8 text-xs", onClick: cancelReorder, disabled: reorderMutation.isPending, children: mediaMessages.cancelReorder }), _jsxs(Button, { type: "button", size: "sm", className: "h-8 text-xs", onClick: commitReorder, disabled: reorderMutation.isPending, children: [reorderMutation.isPending ? (_jsx(Loader2, { className: "mr-1.5 h-3.5 w-3.5 animate-spin" })) : null, mediaMessages.saveOrder] })] })) : (_jsxs(Button, { type: "button", variant: "ghost", size: "sm", className: "h-8 text-xs", onClick: () => setReorderMode(true), children: [_jsx(GripVertical, { className: "mr-1.5 h-3.5 w-3.5" }), mediaMessages.reorder] }))) : null, _jsxs(Button, { type: "button", variant: "outline", size: "sm", className: "h-8 text-xs", disabled: isUploading || reorderMode, onClick: () => fileInputRef.current?.click(), children: [isUploading ? (_jsx(Loader2, { className: "mr-1.5 h-3.5 w-3.5 animate-spin" })) : (_jsx(Upload, { className: "mr-1.5 h-3.5 w-3.5" })), mediaMessages.upload] }), _jsx("input", { ref: fileInputRef, type: "file", accept: "image/*,video/*", className: "hidden", onChange: (event) => {
66
+ const file = event.target.files?.[0];
67
+ if (file) {
68
+ onUpload(file);
69
+ event.target.value = "";
70
+ }
71
+ } })] })] }), media.length === 0 ? (_jsx("div", { className: "flex h-40 items-center justify-center rounded-lg border border-dashed text-sm text-muted-foreground", children: mediaMessages.emptyState })) : reorderMode ? (_jsx(ReorderGrid, { items: localOrder, onReorder: setLocalOrder, mediaMessages: mediaMessages })) : (_jsxs("div", { className: "flex flex-col gap-3", children: [_jsxs(Carousel, { setApi: setCarouselApi, opts: { align: "start" }, className: "w-full", children: [_jsx(CarouselContent, { children: media.map((item, idx) => (_jsx(CarouselItem, { children: _jsx(MediaPreview, { item: item, onOpen: () => setLightboxIndex(idx), onSetCover: onSetCover, onDelete: onDelete, mediaMessages: mediaMessages }) }, item.id))) }), media.length > 1 ? (_jsxs(_Fragment, { children: [_jsx(CarouselPrevious, { className: "left-2 size-8" }), _jsx(CarouselNext, { className: "right-2 size-8" })] })) : null] }), media.length > 1 ? (_jsx("div", { className: "flex gap-2 overflow-x-auto pb-1", children: media.map((item, idx) => (_jsxs("button", { type: "button", onClick: () => carouselApi?.scrollTo(idx), className: cn("relative size-16 flex-shrink-0 overflow-hidden rounded border transition-all", idx === active
72
+ ? "border-primary ring-2 ring-primary/30"
73
+ : "border-border opacity-60 hover:opacity-100"), children: [item.mediaType === "image" ? (_jsx("img", { src: item.url, alt: item.altText ?? item.name, className: "h-full w-full object-cover" })) : (_jsx("div", { className: "flex h-full w-full items-center justify-center bg-muted text-[9px] uppercase text-muted-foreground", children: item.mediaType })), item.isCover ? (_jsx(Star, { className: "absolute left-0.5 top-0.5 h-3 w-3 fill-yellow-400 text-yellow-400" })) : null] }, item.id))) })) : null] })), _jsx(Lightbox, { media: media, index: lightboxIndex, onClose: () => setLightboxIndex(null), mediaMessages: mediaMessages })] }));
74
+ }
75
+ function MediaPreview({ item, onOpen, onSetCover, onDelete, mediaMessages, }) {
76
+ return (_jsxs("div", { className: "group relative aspect-[16/9] w-full overflow-hidden rounded-lg border bg-muted", children: [item.mediaType === "image" ? (_jsx("button", { type: "button", onClick: onOpen, className: "h-full w-full", children: _jsx("img", { src: item.url, alt: item.altText ?? item.name, className: "h-full w-full cursor-zoom-in object-cover" }) })) : item.mediaType === "video" ? (_jsx("video", { src: item.url, controls: true, className: "h-full w-full object-cover" })) : (_jsx("div", { className: "flex h-full w-full items-center justify-center text-xs uppercase text-muted-foreground", children: item.mediaType })), item.isCover ? (_jsxs("div", { className: "pointer-events-none absolute left-3 top-3 flex items-center gap-1 rounded-full bg-black/70 px-2.5 py-1 text-[11px] font-medium text-white", children: [_jsx(Star, { className: "h-3 w-3 fill-yellow-400 text-yellow-400" }), mediaMessages.cover] })) : null, _jsxs("div", { className: "pointer-events-none absolute inset-0 flex items-end justify-end gap-1.5 bg-gradient-to-t from-black/60 via-black/0 to-black/0 p-3 opacity-0 transition-opacity group-hover:opacity-100", children: [!item.isCover && item.mediaType === "image" ? (_jsxs(Button, { type: "button", size: "sm", variant: "secondary", className: "pointer-events-auto h-8 text-xs", onClick: (e) => {
77
+ e.stopPropagation();
78
+ onSetCover(item.id);
79
+ }, children: [_jsx(Star, { className: "mr-1 h-3 w-3" }), mediaMessages.setCover] })) : null, _jsxs(Button, { type: "button", size: "sm", variant: "destructive", className: "pointer-events-auto h-8 text-xs", onClick: (e) => {
80
+ e.stopPropagation();
81
+ if (confirm(mediaMessages.deleteConfirm))
82
+ onDelete(item.id);
83
+ }, children: [_jsx(Trash2, { className: "mr-1 h-3 w-3" }), mediaMessages.delete] })] })] }));
84
+ }
85
+ function ReorderGrid({ items, onReorder, mediaMessages, }) {
86
+ return (_jsx(Reorder.Group, { axis: "x", values: items, onReorder: onReorder, as: "ul", className: "flex flex-wrap gap-3", children: items.map((item) => (_jsxs(Reorder.Item, { value: item, as: "li", className: "relative size-28 cursor-grab overflow-hidden rounded-lg border bg-muted active:cursor-grabbing", whileDrag: { scale: 1.05, zIndex: 10 }, children: [item.mediaType === "image" ? (_jsx("img", { src: item.url, alt: item.altText ?? item.name, draggable: false, className: "pointer-events-none h-full w-full object-cover" })) : (_jsx("div", { className: "flex h-full w-full items-center justify-center bg-muted text-[10px] uppercase text-muted-foreground", children: item.mediaType })), item.isCover ? (_jsx("div", { className: "pointer-events-none absolute left-1 top-1 rounded-full bg-black/70 p-1", children: _jsx(Star, { className: "h-3 w-3 fill-yellow-400 text-yellow-400" }) })) : null, _jsxs("div", { className: "pointer-events-none absolute inset-x-0 bottom-0 flex items-center justify-center gap-1 bg-black/60 py-1 text-[10px] text-white", children: [_jsx(GripVertical, { className: "h-3 w-3" }), mediaMessages.drag] })] }, item.id))) }));
87
+ }
88
+ function Lightbox({ media, index, onClose, mediaMessages, }) {
89
+ const [current, setCurrent] = useState(index ?? 0);
90
+ useEffect(() => {
91
+ if (index != null)
92
+ setCurrent(index);
93
+ }, [index]);
94
+ const item = media[current];
95
+ const open = index != null && item != null;
96
+ const canPrev = current > 0;
97
+ const canNext = current < media.length - 1;
98
+ useEffect(() => {
99
+ if (!open)
100
+ return;
101
+ const onKey = (e) => {
102
+ if (e.key === "ArrowLeft" && canPrev)
103
+ setCurrent((c) => c - 1);
104
+ if (e.key === "ArrowRight" && canNext)
105
+ setCurrent((c) => c + 1);
106
+ };
107
+ window.addEventListener("keydown", onKey);
108
+ return () => window.removeEventListener("keydown", onKey);
109
+ }, [open, canPrev, canNext]);
110
+ return (_jsx(Dialog, { open: open, onOpenChange: (o) => !o && onClose(), children: _jsxs(DialogContent, { className: "h-screen w-screen max-w-none translate-x-0 translate-y-0 top-0 left-0 gap-0 rounded-none border-0 bg-black/90 p-0 shadow-none ring-0 sm:max-w-none", showCloseButton: false, children: [_jsx(DialogTitle, { className: "sr-only", children: mediaMessages.viewerTitle }), item ? (_jsxs("div", { className: "relative flex h-full w-full items-center justify-center", children: [_jsx("button", { type: "button", onClick: onClose, className: "absolute right-2 top-2 z-10 rounded-full bg-black/60 p-2 text-white hover:bg-black/80", "aria-label": mediaMessages.close, children: _jsx(X, { className: "h-5 w-5" }) }), canPrev ? (_jsx("button", { type: "button", onClick: () => setCurrent((c) => c - 1), className: "absolute left-2 z-10 rounded-full bg-black/60 p-2 text-white hover:bg-black/80", "aria-label": mediaMessages.previous, children: _jsx(ChevronLeft, { className: "h-6 w-6" }) })) : null, canNext ? (_jsx("button", { type: "button", onClick: () => setCurrent((c) => c + 1), className: "absolute right-2 z-10 rounded-full bg-black/60 p-2 text-white hover:bg-black/80", "aria-label": mediaMessages.next, children: _jsx(ChevronRight, { className: "h-6 w-6" }) })) : null, item.mediaType === "image" ? (_jsx("img", { src: item.url, alt: item.altText ?? item.name, className: "max-h-[95vh] max-w-[95vw] object-contain" })) : item.mediaType === "video" ? (_jsx("video", { src: item.url, controls: true, autoPlay: true, className: "max-h-[95vh] max-w-[95vw]" })) : (_jsx("div", { className: "rounded-lg bg-background p-8 text-sm text-muted-foreground", children: item.name }))] })) : null] }) }));
111
+ }
112
+ async function api_post_reorder(api, productId, items) {
113
+ return api.post(`/v1/products/${productId}/media/reorder`, { items });
114
+ }
@@ -0,0 +1,12 @@
1
+ import { type OptionPriceRuleData } from "./product-option-price-rule-form.js";
2
+ export type { OptionPriceRuleData };
3
+ type OptionPriceRuleDialogProps = {
4
+ open: boolean;
5
+ onOpenChange: (open: boolean) => void;
6
+ productId: string;
7
+ optionId: string;
8
+ rule?: OptionPriceRuleData;
9
+ onSuccess: () => void;
10
+ };
11
+ export declare function OptionPriceRuleDialog({ open, onOpenChange, productId, optionId, rule, onSuccess, }: OptionPriceRuleDialogProps): import("react/jsx-runtime").JSX.Element;
12
+ //# sourceMappingURL=product-option-price-rule-dialog.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"product-option-price-rule-dialog.d.ts","sourceRoot":"","sources":["../../../src/components/product-detail/product-option-price-rule-dialog.tsx"],"names":[],"mappings":"AASA,OAAO,EAAE,KAAK,mBAAmB,EAAuB,MAAM,qCAAqC,CAAA;AAEnG,YAAY,EAAE,mBAAmB,EAAE,CAAA;AAEnC,KAAK,0BAA0B,GAAG;IAChC,IAAI,EAAE,OAAO,CAAA;IACb,YAAY,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAA;IACrC,SAAS,EAAE,MAAM,CAAA;IACjB,QAAQ,EAAE,MAAM,CAAA;IAChB,IAAI,CAAC,EAAE,mBAAmB,CAAA;IAC1B,SAAS,EAAE,MAAM,IAAI,CAAA;CACtB,CAAA;AAED,wBAAgB,qBAAqB,CAAC,EACpC,IAAI,EACJ,YAAY,EACZ,SAAS,EACT,QAAQ,EACR,IAAI,EACJ,SAAS,GACV,EAAE,0BAA0B,2CAyB5B"}
@@ -0,0 +1,10 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { Sheet, SheetBody, SheetContent, SheetHeader, SheetTitle, } from "@voyant-travel/ui/components";
3
+ import { useProductDetailMessages } from "./host.js";
4
+ import { OptionPriceRuleForm } from "./product-option-price-rule-form.js";
5
+ export function OptionPriceRuleDialog({ open, onOpenChange, productId, optionId, rule, onSuccess, }) {
6
+ const messages = useProductDetailMessages();
7
+ const priceRuleMessages = messages.products.operations.priceRules;
8
+ const isEditing = !!rule;
9
+ return (_jsx(Sheet, { open: open, onOpenChange: onOpenChange, children: _jsxs(SheetContent, { side: "right", size: "lg", children: [_jsx(SheetHeader, { children: _jsx(SheetTitle, { children: isEditing ? priceRuleMessages.editTitle : priceRuleMessages.newTitle }) }), _jsx(SheetBody, { children: _jsx(OptionPriceRuleForm, { productId: productId, optionId: optionId, rule: rule, onSuccess: onSuccess, onCancel: () => onOpenChange(false) }) })] }) }));
10
+ }
@@ -0,0 +1,29 @@
1
+ export type OptionPriceRuleData = {
2
+ id: string;
3
+ productId: string;
4
+ optionId: string;
5
+ priceCatalogId: string;
6
+ priceScheduleId: string | null;
7
+ cancellationPolicyId: string | null;
8
+ name: string;
9
+ code: string | null;
10
+ description: string | null;
11
+ pricingMode: "per_person" | "per_booking" | "starting_from" | "free" | "on_request";
12
+ baseSellAmountCents: number | null;
13
+ baseCostAmountCents: number | null;
14
+ minPerBooking: number | null;
15
+ maxPerBooking: number | null;
16
+ allPricingCategories: boolean;
17
+ isDefault: boolean;
18
+ active: boolean;
19
+ notes: string | null;
20
+ };
21
+ export interface OptionPriceRuleFormProps {
22
+ productId: string;
23
+ optionId: string;
24
+ rule?: OptionPriceRuleData;
25
+ onSuccess: () => void;
26
+ onCancel?: () => void;
27
+ }
28
+ export declare function OptionPriceRuleForm({ productId, optionId, rule, onSuccess, onCancel, }: OptionPriceRuleFormProps): import("react/jsx-runtime").JSX.Element;
29
+ //# sourceMappingURL=product-option-price-rule-form.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"product-option-price-rule-form.d.ts","sourceRoot":"","sources":["../../../src/components/product-detail/product-option-price-rule-form.tsx"],"names":[],"mappings":"AAoDA,MAAM,MAAM,mBAAmB,GAAG;IAChC,EAAE,EAAE,MAAM,CAAA;IACV,SAAS,EAAE,MAAM,CAAA;IACjB,QAAQ,EAAE,MAAM,CAAA;IAChB,cAAc,EAAE,MAAM,CAAA;IACtB,eAAe,EAAE,MAAM,GAAG,IAAI,CAAA;IAC9B,oBAAoB,EAAE,MAAM,GAAG,IAAI,CAAA;IACnC,IAAI,EAAE,MAAM,CAAA;IACZ,IAAI,EAAE,MAAM,GAAG,IAAI,CAAA;IACnB,WAAW,EAAE,MAAM,GAAG,IAAI,CAAA;IAC1B,WAAW,EAAE,YAAY,GAAG,aAAa,GAAG,eAAe,GAAG,MAAM,GAAG,YAAY,CAAA;IACnF,mBAAmB,EAAE,MAAM,GAAG,IAAI,CAAA;IAClC,mBAAmB,EAAE,MAAM,GAAG,IAAI,CAAA;IAClC,aAAa,EAAE,MAAM,GAAG,IAAI,CAAA;IAC5B,aAAa,EAAE,MAAM,GAAG,IAAI,CAAA;IAC5B,oBAAoB,EAAE,OAAO,CAAA;IAC7B,SAAS,EAAE,OAAO,CAAA;IAClB,MAAM,EAAE,OAAO,CAAA;IACf,KAAK,EAAE,MAAM,GAAG,IAAI,CAAA;CACrB,CAAA;AAED,MAAM,WAAW,wBAAwB;IACvC,SAAS,EAAE,MAAM,CAAA;IACjB,QAAQ,EAAE,MAAM,CAAA;IAChB,IAAI,CAAC,EAAE,mBAAmB,CAAA;IAC1B,SAAS,EAAE,MAAM,IAAI,CAAA;IACrB,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAA;CACtB;AAyCD,wBAAgB,mBAAmB,CAAC,EAClC,SAAS,EACT,QAAQ,EACR,IAAI,EACJ,SAAS,EACT,QAAQ,GACT,EAAE,wBAAwB,2CA+M1B"}