@cellarnode/ui 0.17.4 → 0.19.2

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 (375) hide show
  1. package/dist/chat/unified-timeline.d.ts +15 -0
  2. package/dist/chat/unified-timeline.d.ts.map +1 -1
  3. package/dist/chat/unified-timeline.js.map +1 -1
  4. package/dist/components/journey-card.d.ts +9 -1
  5. package/dist/components/journey-card.d.ts.map +1 -1
  6. package/dist/components/journey-card.js +13 -6
  7. package/dist/components/journey-card.js.map +1 -1
  8. package/dist/components/journey-card.stories.d.ts +2 -0
  9. package/dist/components/journey-card.stories.d.ts.map +1 -1
  10. package/dist/components/journey-card.stories.js +43 -0
  11. package/dist/components/journey-card.stories.js.map +1 -1
  12. package/dist/components/sortable-card-context.d.ts +18 -0
  13. package/dist/components/sortable-card-context.d.ts.map +1 -0
  14. package/dist/components/sortable-card-context.js +18 -0
  15. package/dist/components/sortable-card-context.js.map +1 -0
  16. package/dist/components/sortable-card-shell.d.ts +40 -21
  17. package/dist/components/sortable-card-shell.d.ts.map +1 -1
  18. package/dist/components/sortable-card-shell.js +46 -39
  19. package/dist/components/sortable-card-shell.js.map +1 -1
  20. package/dist/components/sortable-card-shell.stories.d.ts +1 -1
  21. package/dist/components/sortable-card-shell.stories.d.ts.map +1 -1
  22. package/dist/components/sortable-card-shell.stories.js +28 -15
  23. package/dist/components/sortable-card-shell.stories.js.map +1 -1
  24. package/dist/components/sortable-card-shell.test.js +57 -16
  25. package/dist/components/sortable-card-shell.test.js.map +1 -1
  26. package/dist/index.d.ts +8 -0
  27. package/dist/index.d.ts.map +1 -1
  28. package/dist/index.js +6 -0
  29. package/dist/index.js.map +1 -1
  30. package/dist/offer/attachments-card.d.ts +9 -0
  31. package/dist/offer/attachments-card.d.ts.map +1 -0
  32. package/dist/offer/attachments-card.js +16 -0
  33. package/dist/offer/attachments-card.js.map +1 -0
  34. package/dist/offer/attachments-card.stories.d.ts +17 -0
  35. package/dist/offer/attachments-card.stories.d.ts.map +1 -0
  36. package/dist/offer/attachments-card.stories.js +24 -0
  37. package/dist/offer/attachments-card.stories.js.map +1 -0
  38. package/dist/offer/buyer-notes-card.d.ts +7 -0
  39. package/dist/offer/buyer-notes-card.d.ts.map +1 -0
  40. package/dist/offer/buyer-notes-card.js +6 -0
  41. package/dist/offer/buyer-notes-card.js.map +1 -0
  42. package/dist/offer/buyer-notes-card.stories.d.ts +16 -0
  43. package/dist/offer/buyer-notes-card.stories.d.ts.map +1 -0
  44. package/dist/offer/buyer-notes-card.stories.js +25 -0
  45. package/dist/offer/buyer-notes-card.stories.js.map +1 -0
  46. package/dist/offer/counter-slide-over.d.ts +44 -0
  47. package/dist/offer/counter-slide-over.d.ts.map +1 -0
  48. package/dist/offer/counter-slide-over.js +81 -0
  49. package/dist/offer/counter-slide-over.js.map +1 -0
  50. package/dist/offer/counter-slide-over.stories.d.ts +23 -0
  51. package/dist/offer/counter-slide-over.stories.d.ts.map +1 -0
  52. package/dist/offer/counter-slide-over.stories.js +235 -0
  53. package/dist/offer/counter-slide-over.stories.js.map +1 -0
  54. package/dist/offer/facts-card.d.ts +32 -0
  55. package/dist/offer/facts-card.d.ts.map +1 -0
  56. package/dist/offer/facts-card.js +87 -0
  57. package/dist/offer/facts-card.js.map +1 -0
  58. package/dist/offer/facts-card.stories.d.ts +25 -0
  59. package/dist/offer/facts-card.stories.d.ts.map +1 -0
  60. package/dist/offer/facts-card.stories.js +177 -0
  61. package/dist/offer/facts-card.stories.js.map +1 -0
  62. package/dist/offer/index.d.ts +39 -0
  63. package/dist/offer/index.d.ts.map +1 -1
  64. package/dist/offer/index.js +21 -0
  65. package/dist/offer/index.js.map +1 -1
  66. package/dist/offer/inline-counter-form.d.ts +16 -0
  67. package/dist/offer/inline-counter-form.d.ts.map +1 -1
  68. package/dist/offer/inline-counter-form.js +8 -0
  69. package/dist/offer/inline-counter-form.js.map +1 -1
  70. package/dist/offer/match-compatibility-card.d.ts +16 -0
  71. package/dist/offer/match-compatibility-card.d.ts.map +1 -0
  72. package/dist/offer/match-compatibility-card.js +27 -0
  73. package/dist/offer/match-compatibility-card.js.map +1 -0
  74. package/dist/offer/match-compatibility-card.stories.d.ts +19 -0
  75. package/dist/offer/match-compatibility-card.stories.d.ts.map +1 -0
  76. package/dist/offer/match-compatibility-card.stories.js +111 -0
  77. package/dist/offer/match-compatibility-card.stories.js.map +1 -0
  78. package/dist/offer/match-glyph.d.ts +14 -0
  79. package/dist/offer/match-glyph.d.ts.map +1 -0
  80. package/dist/offer/match-glyph.js +40 -0
  81. package/dist/offer/match-glyph.js.map +1 -0
  82. package/dist/offer/match-glyph.stories.d.ts +26 -0
  83. package/dist/offer/match-glyph.stories.d.ts.map +1 -0
  84. package/dist/offer/match-glyph.stories.js +26 -0
  85. package/dist/offer/match-glyph.stories.js.map +1 -0
  86. package/dist/offer/match-headline-bar.d.ts +11 -0
  87. package/dist/offer/match-headline-bar.d.ts.map +1 -0
  88. package/dist/offer/match-headline-bar.js +28 -0
  89. package/dist/offer/match-headline-bar.js.map +1 -0
  90. package/dist/offer/match-headline-bar.stories.d.ts +17 -0
  91. package/dist/offer/match-headline-bar.stories.d.ts.map +1 -0
  92. package/dist/offer/match-headline-bar.stories.js +39 -0
  93. package/dist/offer/match-headline-bar.stories.js.map +1 -0
  94. package/dist/offer/match-preview.d.ts +18 -0
  95. package/dist/offer/match-preview.d.ts.map +1 -0
  96. package/dist/offer/match-preview.js +13 -0
  97. package/dist/offer/match-preview.js.map +1 -0
  98. package/dist/offer/match-preview.stories.d.ts +18 -0
  99. package/dist/offer/match-preview.stories.d.ts.map +1 -0
  100. package/dist/offer/match-preview.stories.js +103 -0
  101. package/dist/offer/match-preview.stories.js.map +1 -0
  102. package/dist/offer/negotiation-section.d.ts +11 -0
  103. package/dist/offer/negotiation-section.d.ts.map +1 -0
  104. package/dist/offer/negotiation-section.js +99 -0
  105. package/dist/offer/negotiation-section.js.map +1 -0
  106. package/dist/offer/negotiation-section.stories.d.ts +18 -0
  107. package/dist/offer/negotiation-section.stories.d.ts.map +1 -0
  108. package/dist/offer/negotiation-section.stories.js +156 -0
  109. package/dist/offer/negotiation-section.stories.js.map +1 -0
  110. package/dist/offer/new-activity-pill.d.ts +7 -0
  111. package/dist/offer/new-activity-pill.d.ts.map +1 -0
  112. package/dist/offer/new-activity-pill.js +8 -0
  113. package/dist/offer/new-activity-pill.js.map +1 -0
  114. package/dist/offer/new-activity-pill.stories.d.ts +17 -0
  115. package/dist/offer/new-activity-pill.stories.d.ts.map +1 -0
  116. package/dist/offer/new-activity-pill.stories.js +22 -0
  117. package/dist/offer/new-activity-pill.stories.js.map +1 -0
  118. package/dist/offer/offer-document.d.ts +33 -0
  119. package/dist/offer/offer-document.d.ts.map +1 -0
  120. package/dist/offer/offer-document.js +125 -0
  121. package/dist/offer/offer-document.js.map +1 -0
  122. package/dist/offer/offer-document.stories.d.ts +25 -0
  123. package/dist/offer/offer-document.stories.d.ts.map +1 -0
  124. package/dist/offer/offer-document.stories.js +168 -0
  125. package/dist/offer/offer-document.stories.js.map +1 -0
  126. package/dist/offer/offer-export-button.d.ts +8 -0
  127. package/dist/offer/offer-export-button.d.ts.map +1 -0
  128. package/dist/offer/offer-export-button.js +11 -0
  129. package/dist/offer/offer-export-button.js.map +1 -0
  130. package/dist/offer/offer-export-button.stories.d.ts +15 -0
  131. package/dist/offer/offer-export-button.stories.d.ts.map +1 -0
  132. package/dist/offer/offer-export-button.stories.js +11 -0
  133. package/dist/offer/offer-export-button.stories.js.map +1 -0
  134. package/dist/offer/offer-product-card.d.ts +32 -0
  135. package/dist/offer/offer-product-card.d.ts.map +1 -0
  136. package/dist/offer/offer-product-card.js +10 -0
  137. package/dist/offer/offer-product-card.js.map +1 -0
  138. package/dist/offer/offer-product-card.stories.d.ts +16 -0
  139. package/dist/offer/offer-product-card.stories.d.ts.map +1 -0
  140. package/dist/offer/offer-product-card.stories.js +40 -0
  141. package/dist/offer/offer-product-card.stories.js.map +1 -0
  142. package/dist/offer/opportunity-card.d.ts +16 -0
  143. package/dist/offer/opportunity-card.d.ts.map +1 -0
  144. package/dist/offer/opportunity-card.js +9 -0
  145. package/dist/offer/opportunity-card.js.map +1 -0
  146. package/dist/offer/opportunity-card.stories.d.ts +16 -0
  147. package/dist/offer/opportunity-card.stories.d.ts.map +1 -0
  148. package/dist/offer/opportunity-card.stories.js +33 -0
  149. package/dist/offer/opportunity-card.stories.js.map +1 -0
  150. package/dist/offer/parties-card.d.ts +11 -0
  151. package/dist/offer/parties-card.d.ts.map +1 -0
  152. package/dist/offer/parties-card.js +14 -0
  153. package/dist/offer/parties-card.js.map +1 -0
  154. package/dist/offer/parties-card.stories.d.ts +17 -0
  155. package/dist/offer/parties-card.stories.d.ts.map +1 -0
  156. package/dist/offer/parties-card.stories.js +37 -0
  157. package/dist/offer/parties-card.stories.js.map +1 -0
  158. package/dist/offer/terms-card.d.ts +17 -0
  159. package/dist/offer/terms-card.d.ts.map +1 -0
  160. package/dist/offer/terms-card.js +50 -0
  161. package/dist/offer/terms-card.js.map +1 -0
  162. package/dist/offer/terms-card.stories.d.ts +17 -0
  163. package/dist/offer/terms-card.stories.d.ts.map +1 -0
  164. package/dist/offer/terms-card.stories.js +42 -0
  165. package/dist/offer/terms-card.stories.js.map +1 -0
  166. package/dist/offer/timeline-event.d.ts +12 -0
  167. package/dist/offer/timeline-event.d.ts.map +1 -0
  168. package/dist/offer/timeline-event.js +57 -0
  169. package/dist/offer/timeline-event.js.map +1 -0
  170. package/dist/offer/timeline-event.stories.d.ts +21 -0
  171. package/dist/offer/timeline-event.stories.d.ts.map +1 -0
  172. package/dist/offer/timeline-event.stories.js +57 -0
  173. package/dist/offer/timeline-event.stories.js.map +1 -0
  174. package/dist/offer/types.d.ts +118 -0
  175. package/dist/offer/types.d.ts.map +1 -1
  176. package/dist/opportunities/__a11y__/opportunity-card-actions-menu.a11y.test.d.ts +2 -0
  177. package/dist/opportunities/__a11y__/opportunity-card-actions-menu.a11y.test.d.ts.map +1 -0
  178. package/dist/opportunities/__a11y__/opportunity-card-actions-menu.a11y.test.js +40 -0
  179. package/dist/opportunities/__a11y__/opportunity-card-actions-menu.a11y.test.js.map +1 -0
  180. package/dist/opportunities/__a11y__/opportunity-celebration.a11y.test.d.ts +2 -0
  181. package/dist/opportunities/__a11y__/opportunity-celebration.a11y.test.d.ts.map +1 -0
  182. package/dist/opportunities/__a11y__/opportunity-celebration.a11y.test.js +31 -0
  183. package/dist/opportunities/__a11y__/opportunity-celebration.a11y.test.js.map +1 -0
  184. package/dist/opportunities/__a11y__/opportunity-detail-panel.a11y.test.d.ts +2 -0
  185. package/dist/opportunities/__a11y__/opportunity-detail-panel.a11y.test.d.ts.map +1 -0
  186. package/dist/opportunities/__a11y__/opportunity-detail-panel.a11y.test.js +42 -0
  187. package/dist/opportunities/__a11y__/opportunity-detail-panel.a11y.test.js.map +1 -0
  188. package/dist/opportunities/__a11y__/opportunity-filter-bar.a11y.test.d.ts +2 -0
  189. package/dist/opportunities/__a11y__/opportunity-filter-bar.a11y.test.d.ts.map +1 -0
  190. package/dist/opportunities/__a11y__/opportunity-filter-bar.a11y.test.js +59 -0
  191. package/dist/opportunities/__a11y__/opportunity-filter-bar.a11y.test.js.map +1 -0
  192. package/dist/opportunities/__a11y__/opportunity-stacked-card.a11y.test.d.ts +2 -0
  193. package/dist/opportunities/__a11y__/opportunity-stacked-card.a11y.test.d.ts.map +1 -0
  194. package/dist/opportunities/__a11y__/opportunity-stacked-card.a11y.test.js +54 -0
  195. package/dist/opportunities/__a11y__/opportunity-stacked-card.a11y.test.js.map +1 -0
  196. package/dist/opportunities/__a11y__/opportunity-stacked-list.a11y.test.d.ts +2 -0
  197. package/dist/opportunities/__a11y__/opportunity-stacked-list.a11y.test.d.ts.map +1 -0
  198. package/dist/opportunities/__a11y__/opportunity-stacked-list.a11y.test.js +40 -0
  199. package/dist/opportunities/__a11y__/opportunity-stacked-list.a11y.test.js.map +1 -0
  200. package/dist/opportunities/__tests__/opportunity-add-to-journey-button.test.d.ts +2 -0
  201. package/dist/opportunities/__tests__/opportunity-add-to-journey-button.test.d.ts.map +1 -0
  202. package/dist/opportunities/__tests__/opportunity-add-to-journey-button.test.js +40 -0
  203. package/dist/opportunities/__tests__/opportunity-add-to-journey-button.test.js.map +1 -0
  204. package/dist/opportunities/__tests__/opportunity-card-actions-menu.test.d.ts +2 -0
  205. package/dist/opportunities/__tests__/opportunity-card-actions-menu.test.d.ts.map +1 -0
  206. package/dist/opportunities/__tests__/opportunity-card-actions-menu.test.js +74 -0
  207. package/dist/opportunities/__tests__/opportunity-card-actions-menu.test.js.map +1 -0
  208. package/dist/opportunities/__tests__/opportunity-celebration.test.d.ts +2 -0
  209. package/dist/opportunities/__tests__/opportunity-celebration.test.d.ts.map +1 -0
  210. package/dist/opportunities/__tests__/opportunity-celebration.test.js +46 -0
  211. package/dist/opportunities/__tests__/opportunity-celebration.test.js.map +1 -0
  212. package/dist/opportunities/__tests__/opportunity-filter-bar-drawer.test.d.ts +2 -0
  213. package/dist/opportunities/__tests__/opportunity-filter-bar-drawer.test.d.ts.map +1 -0
  214. package/dist/opportunities/__tests__/opportunity-filter-bar-drawer.test.js +77 -0
  215. package/dist/opportunities/__tests__/opportunity-filter-bar-drawer.test.js.map +1 -0
  216. package/dist/opportunities/__tests__/opportunity-filter-bar.test.d.ts +2 -0
  217. package/dist/opportunities/__tests__/opportunity-filter-bar.test.d.ts.map +1 -0
  218. package/dist/opportunities/__tests__/opportunity-filter-bar.test.js +107 -0
  219. package/dist/opportunities/__tests__/opportunity-filter-bar.test.js.map +1 -0
  220. package/dist/opportunities/__tests__/opportunity-reopen-button.test.d.ts +2 -0
  221. package/dist/opportunities/__tests__/opportunity-reopen-button.test.d.ts.map +1 -0
  222. package/dist/opportunities/__tests__/opportunity-reopen-button.test.js +29 -0
  223. package/dist/opportunities/__tests__/opportunity-reopen-button.test.js.map +1 -0
  224. package/dist/opportunities/__tests__/opportunity-republish-button.test.d.ts +2 -0
  225. package/dist/opportunities/__tests__/opportunity-republish-button.test.d.ts.map +1 -0
  226. package/dist/opportunities/__tests__/opportunity-republish-button.test.js +29 -0
  227. package/dist/opportunities/__tests__/opportunity-republish-button.test.js.map +1 -0
  228. package/dist/opportunities/__tests__/opportunity-resume-draft-button.test.d.ts +2 -0
  229. package/dist/opportunities/__tests__/opportunity-resume-draft-button.test.d.ts.map +1 -0
  230. package/dist/opportunities/__tests__/opportunity-resume-draft-button.test.js +19 -0
  231. package/dist/opportunities/__tests__/opportunity-resume-draft-button.test.js.map +1 -0
  232. package/dist/opportunities/__tests__/opportunity-view-offers-button.test.d.ts +2 -0
  233. package/dist/opportunities/__tests__/opportunity-view-offers-button.test.d.ts.map +1 -0
  234. package/dist/opportunities/__tests__/opportunity-view-offers-button.test.js +23 -0
  235. package/dist/opportunities/__tests__/opportunity-view-offers-button.test.js.map +1 -0
  236. package/dist/opportunities/index.d.ts +51 -1
  237. package/dist/opportunities/index.d.ts.map +1 -1
  238. package/dist/opportunities/index.js +35 -0
  239. package/dist/opportunities/index.js.map +1 -1
  240. package/dist/opportunities/opportunities-table.d.ts +4 -0
  241. package/dist/opportunities/opportunities-table.d.ts.map +1 -1
  242. package/dist/opportunities/opportunities-table.js +4 -0
  243. package/dist/opportunities/opportunities-table.js.map +1 -1
  244. package/dist/opportunities/opportunity-add-to-journey-button.d.ts +12 -0
  245. package/dist/opportunities/opportunity-add-to-journey-button.d.ts.map +1 -0
  246. package/dist/opportunities/opportunity-add-to-journey-button.js +42 -0
  247. package/dist/opportunities/opportunity-add-to-journey-button.js.map +1 -0
  248. package/dist/opportunities/opportunity-card-actions-menu.d.ts +9 -0
  249. package/dist/opportunities/opportunity-card-actions-menu.d.ts.map +1 -0
  250. package/dist/opportunities/opportunity-card-actions-menu.js +33 -0
  251. package/dist/opportunities/opportunity-card-actions-menu.js.map +1 -0
  252. package/dist/opportunities/opportunity-card-actions-menu.stories.d.ts +14 -0
  253. package/dist/opportunities/opportunity-card-actions-menu.stories.d.ts.map +1 -0
  254. package/dist/opportunities/opportunity-card-actions-menu.stories.js +12 -0
  255. package/dist/opportunities/opportunity-card-actions-menu.stories.js.map +1 -0
  256. package/dist/opportunities/opportunity-celebration.d.ts +8 -0
  257. package/dist/opportunities/opportunity-celebration.d.ts.map +1 -0
  258. package/dist/opportunities/opportunity-celebration.js +17 -0
  259. package/dist/opportunities/opportunity-celebration.js.map +1 -0
  260. package/dist/opportunities/opportunity-celebration.stories.d.ts +17 -0
  261. package/dist/opportunities/opportunity-celebration.stories.d.ts.map +1 -0
  262. package/dist/opportunities/opportunity-celebration.stories.js +30 -0
  263. package/dist/opportunities/opportunity-celebration.stories.js.map +1 -0
  264. package/dist/opportunities/opportunity-filter-bar-drawer.d.ts +10 -0
  265. package/dist/opportunities/opportunity-filter-bar-drawer.d.ts.map +1 -0
  266. package/dist/opportunities/opportunity-filter-bar-drawer.js +54 -0
  267. package/dist/opportunities/opportunity-filter-bar-drawer.js.map +1 -0
  268. package/dist/opportunities/opportunity-filter-bar.d.ts +14 -0
  269. package/dist/opportunities/opportunity-filter-bar.d.ts.map +1 -0
  270. package/dist/opportunities/opportunity-filter-bar.js +65 -0
  271. package/dist/opportunities/opportunity-filter-bar.js.map +1 -0
  272. package/dist/opportunities/opportunity-filter-bar.stories.d.ts +25 -0
  273. package/dist/opportunities/opportunity-filter-bar.stories.d.ts.map +1 -0
  274. package/dist/opportunities/opportunity-filter-bar.stories.js +63 -0
  275. package/dist/opportunities/opportunity-filter-bar.stories.js.map +1 -0
  276. package/dist/opportunities/opportunity-reopen-button.d.ts +11 -0
  277. package/dist/opportunities/opportunity-reopen-button.d.ts.map +1 -0
  278. package/dist/opportunities/opportunity-reopen-button.js +20 -0
  279. package/dist/opportunities/opportunity-reopen-button.js.map +1 -0
  280. package/dist/opportunities/opportunity-republish-button.d.ts +7 -0
  281. package/dist/opportunities/opportunity-republish-button.d.ts.map +1 -0
  282. package/dist/opportunities/opportunity-republish-button.js +14 -0
  283. package/dist/opportunities/opportunity-republish-button.js.map +1 -0
  284. package/dist/opportunities/opportunity-resume-draft-button.d.ts +7 -0
  285. package/dist/opportunities/opportunity-resume-draft-button.d.ts.map +1 -0
  286. package/dist/opportunities/opportunity-resume-draft-button.js +7 -0
  287. package/dist/opportunities/opportunity-resume-draft-button.js.map +1 -0
  288. package/dist/opportunities/opportunity-stacked-list.d.ts.map +1 -1
  289. package/dist/opportunities/opportunity-stacked-list.js +3 -1
  290. package/dist/opportunities/opportunity-stacked-list.js.map +1 -1
  291. package/dist/opportunities/opportunity-view-offers-button.d.ts +7 -0
  292. package/dist/opportunities/opportunity-view-offers-button.d.ts.map +1 -0
  293. package/dist/opportunities/opportunity-view-offers-button.js +8 -0
  294. package/dist/opportunities/opportunity-view-offers-button.js.map +1 -0
  295. package/dist/opportunities/two-column-section.d.ts.map +1 -1
  296. package/dist/opportunities/two-column-section.js +4 -3
  297. package/dist/opportunities/two-column-section.js.map +1 -1
  298. package/dist/opportunities/wizard/__a11y__/opportunity-wizard.a11y.test.d.ts +2 -0
  299. package/dist/opportunities/wizard/__a11y__/opportunity-wizard.a11y.test.d.ts.map +1 -0
  300. package/dist/opportunities/wizard/__a11y__/opportunity-wizard.a11y.test.js +53 -0
  301. package/dist/opportunities/wizard/__a11y__/opportunity-wizard.a11y.test.js.map +1 -0
  302. package/dist/opportunities/wizard/__a11y__/wizard-stepper.a11y.test.d.ts +2 -0
  303. package/dist/opportunities/wizard/__a11y__/wizard-stepper.a11y.test.d.ts.map +1 -0
  304. package/dist/opportunities/wizard/__a11y__/wizard-stepper.a11y.test.js +32 -0
  305. package/dist/opportunities/wizard/__a11y__/wizard-stepper.a11y.test.js.map +1 -0
  306. package/dist/opportunities/wizard/__tests__/opportunity-wizard.test.d.ts +2 -0
  307. package/dist/opportunities/wizard/__tests__/opportunity-wizard.test.d.ts.map +1 -0
  308. package/dist/opportunities/wizard/__tests__/opportunity-wizard.test.js +127 -0
  309. package/dist/opportunities/wizard/__tests__/opportunity-wizard.test.js.map +1 -0
  310. package/dist/opportunities/wizard/__tests__/step-opportunities.test.d.ts +2 -0
  311. package/dist/opportunities/wizard/__tests__/step-opportunities.test.d.ts.map +1 -0
  312. package/dist/opportunities/wizard/__tests__/step-opportunities.test.js +93 -0
  313. package/dist/opportunities/wizard/__tests__/step-opportunities.test.js.map +1 -0
  314. package/dist/opportunities/wizard/__tests__/step-pricing-timeline.test.d.ts +2 -0
  315. package/dist/opportunities/wizard/__tests__/step-pricing-timeline.test.d.ts.map +1 -0
  316. package/dist/opportunities/wizard/__tests__/step-pricing-timeline.test.js +141 -0
  317. package/dist/opportunities/wizard/__tests__/step-pricing-timeline.test.js.map +1 -0
  318. package/dist/opportunities/wizard/__tests__/step-review.test.d.ts +2 -0
  319. package/dist/opportunities/wizard/__tests__/step-review.test.d.ts.map +1 -0
  320. package/dist/opportunities/wizard/__tests__/step-review.test.js +80 -0
  321. package/dist/opportunities/wizard/__tests__/step-review.test.js.map +1 -0
  322. package/dist/opportunities/wizard/__tests__/step-tender-basics.test.d.ts +2 -0
  323. package/dist/opportunities/wizard/__tests__/step-tender-basics.test.d.ts.map +1 -0
  324. package/dist/opportunities/wizard/__tests__/step-tender-basics.test.js +76 -0
  325. package/dist/opportunities/wizard/__tests__/step-tender-basics.test.js.map +1 -0
  326. package/dist/opportunities/wizard/__tests__/use-wizard-draft.test.d.ts +2 -0
  327. package/dist/opportunities/wizard/__tests__/use-wizard-draft.test.d.ts.map +1 -0
  328. package/dist/opportunities/wizard/__tests__/use-wizard-draft.test.js +192 -0
  329. package/dist/opportunities/wizard/__tests__/use-wizard-draft.test.js.map +1 -0
  330. package/dist/opportunities/wizard/__tests__/wizard-stepper.test.d.ts +2 -0
  331. package/dist/opportunities/wizard/__tests__/wizard-stepper.test.d.ts.map +1 -0
  332. package/dist/opportunities/wizard/__tests__/wizard-stepper.test.js +61 -0
  333. package/dist/opportunities/wizard/__tests__/wizard-stepper.test.js.map +1 -0
  334. package/dist/opportunities/wizard/opportunity-wizard.d.ts +29 -0
  335. package/dist/opportunities/wizard/opportunity-wizard.d.ts.map +1 -0
  336. package/dist/opportunities/wizard/opportunity-wizard.js +196 -0
  337. package/dist/opportunities/wizard/opportunity-wizard.js.map +1 -0
  338. package/dist/opportunities/wizard/opportunity-wizard.stories.d.ts +12 -0
  339. package/dist/opportunities/wizard/opportunity-wizard.stories.d.ts.map +1 -0
  340. package/dist/opportunities/wizard/opportunity-wizard.stories.js +49 -0
  341. package/dist/opportunities/wizard/opportunity-wizard.stories.js.map +1 -0
  342. package/dist/opportunities/wizard/step-opportunities.d.ts +9 -0
  343. package/dist/opportunities/wizard/step-opportunities.d.ts.map +1 -0
  344. package/dist/opportunities/wizard/step-opportunities.js +80 -0
  345. package/dist/opportunities/wizard/step-opportunities.js.map +1 -0
  346. package/dist/opportunities/wizard/step-pricing-timeline.d.ts +9 -0
  347. package/dist/opportunities/wizard/step-pricing-timeline.d.ts.map +1 -0
  348. package/dist/opportunities/wizard/step-pricing-timeline.js +64 -0
  349. package/dist/opportunities/wizard/step-pricing-timeline.js.map +1 -0
  350. package/dist/opportunities/wizard/step-review.d.ts +9 -0
  351. package/dist/opportunities/wizard/step-review.d.ts.map +1 -0
  352. package/dist/opportunities/wizard/step-review.js +34 -0
  353. package/dist/opportunities/wizard/step-review.js.map +1 -0
  354. package/dist/opportunities/wizard/step-tender-basics.d.ts +16 -0
  355. package/dist/opportunities/wizard/step-tender-basics.d.ts.map +1 -0
  356. package/dist/opportunities/wizard/step-tender-basics.js +39 -0
  357. package/dist/opportunities/wizard/step-tender-basics.js.map +1 -0
  358. package/dist/opportunities/wizard/use-wizard-draft.d.ts +41 -0
  359. package/dist/opportunities/wizard/use-wizard-draft.d.ts.map +1 -0
  360. package/dist/opportunities/wizard/use-wizard-draft.js +214 -0
  361. package/dist/opportunities/wizard/use-wizard-draft.js.map +1 -0
  362. package/dist/opportunities/wizard/wizard-stepper.d.ts +20 -0
  363. package/dist/opportunities/wizard/wizard-stepper.d.ts.map +1 -0
  364. package/dist/opportunities/wizard/wizard-stepper.js +26 -0
  365. package/dist/opportunities/wizard/wizard-stepper.js.map +1 -0
  366. package/dist/opportunities/wizard/wizard-stepper.stories.d.ts +22 -0
  367. package/dist/opportunities/wizard/wizard-stepper.stories.d.ts.map +1 -0
  368. package/dist/opportunities/wizard/wizard-stepper.stories.js +47 -0
  369. package/dist/opportunities/wizard/wizard-stepper.stories.js.map +1 -0
  370. package/dist/opportunities/wizard/wizard.types.d.ts +176 -0
  371. package/dist/opportunities/wizard/wizard.types.d.ts.map +1 -0
  372. package/dist/opportunities/wizard/wizard.types.js +62 -0
  373. package/dist/opportunities/wizard/wizard.types.js.map +1 -0
  374. package/package.json +13 -4
  375. package/src/offer/offer-document.print.css +72 -0
@@ -0,0 +1,156 @@
1
+ import { NegotiationSection } from "./negotiation-section";
2
+ const meta = {
3
+ title: "Offer/NegotiationSection",
4
+ component: NegotiationSection,
5
+ tags: ["autodocs"],
6
+ parameters: { layout: "padded" },
7
+ };
8
+ export default meta;
9
+ const events = [
10
+ {
11
+ id: "e1",
12
+ kind: "propose",
13
+ createdAt: "2026-04-18T10:00:00Z",
14
+ actorOrgId: "org-prod",
15
+ actorRole: "producer",
16
+ round: 1,
17
+ terms: { price: 4.1, currency: "EUR", volume: 20000 },
18
+ },
19
+ {
20
+ id: "e2",
21
+ kind: "message",
22
+ createdAt: "2026-04-18T11:30:00Z",
23
+ actorOrgId: "org-imp",
24
+ actorRole: "importer",
25
+ content: "Can we see the certificates?",
26
+ },
27
+ {
28
+ id: "e3",
29
+ kind: "counter",
30
+ createdAt: "2026-04-19T09:15:00Z",
31
+ actorOrgId: "org-imp",
32
+ actorRole: "importer",
33
+ round: 2,
34
+ terms: { price: 3.95, currency: "EUR", volume: 20000 },
35
+ previousTerms: { price: 4.1, currency: "EUR", volume: 20000 },
36
+ },
37
+ ];
38
+ export const Default = {
39
+ args: {
40
+ events,
41
+ viewerOrgId: "org-prod",
42
+ onOpenComposer: () => { },
43
+ },
44
+ };
45
+ export const Empty = {
46
+ args: {
47
+ events: [],
48
+ viewerOrgId: "org-prod",
49
+ onOpenComposer: () => { },
50
+ },
51
+ };
52
+ export const ManyEvents = {
53
+ args: {
54
+ events: Array.from({ length: 60 }, (_, i) => ({
55
+ id: `e-${i}`,
56
+ kind: i % 2 === 0 ? "message" : "counter",
57
+ createdAt: new Date(Date.UTC(2026, 3, 10, i)).toISOString(),
58
+ actorOrgId: i % 2 === 0 ? "org-imp" : "org-prod",
59
+ actorRole: i % 2 === 0 ? "importer" : "producer",
60
+ round: Math.floor(i / 10) + 1,
61
+ ...(i % 2 === 0
62
+ ? { content: `Message ${i}` }
63
+ : {
64
+ terms: { price: 4 + i * 0.01, currency: "EUR", volume: 20000 },
65
+ }),
66
+ })),
67
+ viewerOrgId: "org-prod",
68
+ onOpenComposer: () => { },
69
+ },
70
+ };
71
+ // Blocker B8 — virtualize at least one of each of the 8 TimelineEventKind
72
+ // values so virtualization regressions surface. The ManyEvents story only
73
+ // covered "message" + "counter"; this story covers all 8 kinds in the
74
+ // virtualization layer (>50 events).
75
+ export const MixedKinds = {
76
+ args: {
77
+ events: Array.from({ length: 64 }, (_, i) => {
78
+ const base = {
79
+ id: `e-${i}`,
80
+ createdAt: new Date(Date.UTC(2026, 3, 10, i)).toISOString(),
81
+ actorOrgId: i % 2 === 0 ? "org-prod" : "org-imp",
82
+ actorRole: (i % 2 === 0 ? "producer" : "importer"),
83
+ round: Math.floor(i / 8) + 1,
84
+ };
85
+ // Cycle through all 8 kinds so the virtualizer renders each one
86
+ const kind = ["propose", "counter", "accept", "decline", "withdraw", "expire", "message", "attachment"][i % 8];
87
+ switch (kind) {
88
+ case "propose":
89
+ case "counter":
90
+ return {
91
+ ...base,
92
+ kind,
93
+ terms: { price: 4 + i * 0.01, currency: "EUR", volume: 20000 },
94
+ previousTerms: kind === "counter" ? { price: 4, currency: "EUR", volume: 20000 } : undefined,
95
+ };
96
+ case "accept":
97
+ case "decline":
98
+ case "withdraw":
99
+ return { ...base, kind, message: `Reason ${i}` };
100
+ case "expire":
101
+ return { ...base, kind, expiredAt: base.createdAt };
102
+ case "message":
103
+ return { ...base, kind, content: `Free-form message #${i}` };
104
+ case "attachment":
105
+ return {
106
+ ...base,
107
+ kind,
108
+ fileName: `file-${i}.pdf`,
109
+ mimeType: "application/pdf",
110
+ sizeBytes: 100_000 + i,
111
+ source: ["chat", "round", "formal"][i % 3],
112
+ };
113
+ }
114
+ }),
115
+ viewerOrgId: "org-prod",
116
+ onOpenComposer: () => { },
117
+ },
118
+ };
119
+ // Blocker B1 — explicit assertion that ArrowUp / ArrowDown move DOM focus
120
+ // (not just tabIndex). Without the useEffect on focusedIndex the previous
121
+ // implementation left document.activeElement stuck on the mounted element.
122
+ // Storybook play functions run under Vitest (via @storybook/addon-vitest).
123
+ export const ArrowKeyFocusMovement = {
124
+ args: {
125
+ events,
126
+ viewerOrgId: "org-prod",
127
+ onOpenComposer: () => { },
128
+ },
129
+ play: async ({ canvasElement, step }) => {
130
+ const { within, userEvent } = await import("storybook/test");
131
+ const { expect } = await import("vitest");
132
+ const canvas = within(canvasElement);
133
+ await step("Focus the first timeline event", async () => {
134
+ const items = canvas.getAllByRole("listitem");
135
+ items[0].focus();
136
+ await expect(document.activeElement).toBe(items[0]);
137
+ });
138
+ await step("ArrowDown moves DOM focus to the next event", async () => {
139
+ await userEvent.keyboard("{ArrowDown}");
140
+ const items = canvas.getAllByRole("listitem");
141
+ // Assert DOM focus actually moved — not just aria-activedescendant
142
+ await expect(document.activeElement).toBe(items[1]);
143
+ });
144
+ await step("ArrowUp returns focus to the first event", async () => {
145
+ await userEvent.keyboard("{ArrowUp}");
146
+ const items = canvas.getAllByRole("listitem");
147
+ await expect(document.activeElement).toBe(items[0]);
148
+ });
149
+ await step("End jumps to the last event", async () => {
150
+ await userEvent.keyboard("{End}");
151
+ const items = canvas.getAllByRole("listitem");
152
+ await expect(document.activeElement).toBe(items[items.length - 1]);
153
+ });
154
+ },
155
+ };
156
+ //# sourceMappingURL=negotiation-section.stories.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"negotiation-section.stories.js","sourceRoot":"","sources":["../../src/offer/negotiation-section.stories.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAG3D,MAAM,IAAI,GAAG;IACX,KAAK,EAAE,0BAA0B;IACjC,SAAS,EAAE,kBAAkB;IAC7B,IAAI,EAAE,CAAC,UAAU,CAAC;IAClB,UAAU,EAAE,EAAE,MAAM,EAAE,QAAQ,EAAE;CACS,CAAC;AAE5C,eAAe,IAAI,CAAC;AAGpB,MAAM,MAAM,GAAwB;IAClC;QACE,EAAE,EAAE,IAAI;QACR,IAAI,EAAE,SAAS;QACf,SAAS,EAAE,sBAAsB;QACjC,UAAU,EAAE,UAAU;QACtB,SAAS,EAAE,UAAU;QACrB,KAAK,EAAE,CAAC;QACR,KAAK,EAAE,EAAE,KAAK,EAAE,GAAG,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE;KACtD;IACD;QACE,EAAE,EAAE,IAAI;QACR,IAAI,EAAE,SAAS;QACf,SAAS,EAAE,sBAAsB;QACjC,UAAU,EAAE,SAAS;QACrB,SAAS,EAAE,UAAU;QACrB,OAAO,EAAE,8BAA8B;KACxC;IACD;QACE,EAAE,EAAE,IAAI;QACR,IAAI,EAAE,SAAS;QACf,SAAS,EAAE,sBAAsB;QACjC,UAAU,EAAE,SAAS;QACrB,SAAS,EAAE,UAAU;QACrB,KAAK,EAAE,CAAC;QACR,KAAK,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE;QACtD,aAAa,EAAE,EAAE,KAAK,EAAE,GAAG,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE;KAC9D;CACF,CAAC;AAEF,MAAM,CAAC,MAAM,OAAO,GAAU;IAC5B,IAAI,EAAE;QACJ,MAAM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AAQ,CAAC,OAAO,CAAC,CAAC;YAClC,MAAM,KAAK,GAAG,MAAM,CAAC,YAAY,CAAC,UAAU,CAAC,CAAC;YAC9C,MAAM,MAAM,CAAC,QAAQ,CAAC,aAAa,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC;QACrE,CAAC,CAAC,CAAC;IACL,CAAC;CACF,CAAC"}
@@ -0,0 +1,7 @@
1
+ export interface NewActivityPillProps {
2
+ count: number;
3
+ onClick: () => void;
4
+ className?: string;
5
+ }
6
+ export declare function NewActivityPill({ count, onClick, className }: NewActivityPillProps): import("react/jsx-runtime").JSX.Element;
7
+ //# sourceMappingURL=new-activity-pill.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"new-activity-pill.d.ts","sourceRoot":"","sources":["../../src/offer/new-activity-pill.tsx"],"names":[],"mappings":"AAGA,MAAM,WAAW,oBAAoB;IACnC,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,wBAAgB,eAAe,CAAC,EAAE,KAAK,EAAE,OAAO,EAAE,SAAS,EAAE,EAAE,oBAAoB,2CAgBlF"}
@@ -0,0 +1,8 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { ArrowDown } from "lucide-react";
3
+ import { cn } from "../lib/utils";
4
+ export function NewActivityPill({ count, onClick, className }) {
5
+ const display = count > 99 ? "99+" : count.toString();
6
+ return (_jsxs("button", { type: "button", onClick: onClick, "aria-label": `${count} new events — jump to timeline`, className: cn("inline-flex items-center gap-2 rounded-full border border-primary/30 bg-primary px-4 py-2 text-sm font-medium text-primary-foreground shadow-lg transition-opacity motion-safe:animate-in motion-safe:fade-in motion-reduce:transition-none", className), children: [_jsx(ArrowDown, { "aria-hidden": true, className: "size-4" }), display, " new event", count === 1 ? "" : "s", " \u00B7 jump to timeline"] }));
7
+ }
8
+ //# sourceMappingURL=new-activity-pill.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"new-activity-pill.js","sourceRoot":"","sources":["../../src/offer/new-activity-pill.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,EAAE,EAAE,EAAE,MAAM,cAAc,CAAC;AAQlC,MAAM,UAAU,eAAe,CAAC,EAAE,KAAK,EAAE,OAAO,EAAE,SAAS,EAAwB;IACjF,MAAM,OAAO,GAAG,KAAK,GAAG,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,QAAQ,EAAE,CAAC;IACtD,OAAO,CACL,kBACE,IAAI,EAAC,QAAQ,EACb,OAAO,EAAE,OAAO,gBACJ,GAAG,KAAK,gCAAgC,EACpD,SAAS,EAAE,EAAE,CACX,6OAA6O,EAC7O,SAAS,CACV,aAED,KAAC,SAAS,yBAAa,SAAS,EAAC,QAAQ,GAAG,EAC3C,OAAO,gBAAY,KAAK,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,gCACnC,CACV,CAAC;AACJ,CAAC"}
@@ -0,0 +1,17 @@
1
+ import type { StoryObj } from "@storybook/react-vite";
2
+ import { NewActivityPill } from "./new-activity-pill";
3
+ declare const meta: {
4
+ title: string;
5
+ component: typeof NewActivityPill;
6
+ tags: string[];
7
+ parameters: {
8
+ layout: string;
9
+ };
10
+ };
11
+ export default meta;
12
+ type Story = StoryObj<typeof meta>;
13
+ export declare const Count1: Story;
14
+ export declare const Count5: Story;
15
+ export declare const Count99Plus: Story;
16
+ export declare const ReducedMotion: Story;
17
+ //# sourceMappingURL=new-activity-pill.stories.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"new-activity-pill.stories.d.ts","sourceRoot":"","sources":["../../src/offer/new-activity-pill.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAQ,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAEtD,QAAA,MAAM,IAAI;;;;;;;CAK8B,CAAC;AAEzC,eAAe,IAAI,CAAC;AACpB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,IAAI,CAAC,CAAC;AAEnC,eAAO,MAAM,MAAM,EAAE,KAAiD,CAAC;AACvE,eAAO,MAAM,MAAM,EAAE,KAAiD,CAAC;AACvE,eAAO,MAAM,WAAW,EAAE,KAAmD,CAAC;AAC9E,eAAO,MAAM,aAAa,EAAE,KAS3B,CAAC"}
@@ -0,0 +1,22 @@
1
+ import { NewActivityPill } from "./new-activity-pill";
2
+ const meta = {
3
+ title: "Offer/NewActivityPill",
4
+ component: NewActivityPill,
5
+ tags: ["autodocs"],
6
+ parameters: { layout: "centered" },
7
+ };
8
+ export default meta;
9
+ export const Count1 = { args: { count: 1, onClick: () => { } } };
10
+ export const Count5 = { args: { count: 5, onClick: () => { } } };
11
+ export const Count99Plus = { args: { count: 132, onClick: () => { } } };
12
+ export const ReducedMotion = {
13
+ args: { count: 3, onClick: () => { } },
14
+ parameters: {
15
+ docs: {
16
+ description: {
17
+ story: "Respects prefers-reduced-motion — no fade animation.",
18
+ },
19
+ },
20
+ },
21
+ };
22
+ //# sourceMappingURL=new-activity-pill.stories.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"new-activity-pill.stories.js","sourceRoot":"","sources":["../../src/offer/new-activity-pill.stories.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAEtD,MAAM,IAAI,GAAG;IACX,KAAK,EAAE,uBAAuB;IAC9B,SAAS,EAAE,eAAe;IAC1B,IAAI,EAAE,CAAC,UAAU,CAAC;IAClB,UAAU,EAAE,EAAE,MAAM,EAAE,UAAU,EAAE;CACI,CAAC;AAEzC,eAAe,IAAI,CAAC;AAGpB,MAAM,CAAC,MAAM,MAAM,GAAU,EAAE,IAAI,EAAE,EAAE,KAAK,EAAE,CAAC,EAAE,OAAO,EAAE,GAAG,EAAE,GAAE,CAAC,EAAE,EAAE,CAAC;AACvE,MAAM,CAAC,MAAM,MAAM,GAAU,EAAE,IAAI,EAAE,EAAE,KAAK,EAAE,CAAC,EAAE,OAAO,EAAE,GAAG,EAAE,GAAE,CAAC,EAAE,EAAE,CAAC;AACvE,MAAM,CAAC,MAAM,WAAW,GAAU,EAAE,IAAI,EAAE,EAAE,KAAK,EAAE,GAAG,EAAE,OAAO,EAAE,GAAG,EAAE,GAAE,CAAC,EAAE,EAAE,CAAC;AAC9E,MAAM,CAAC,MAAM,aAAa,GAAU;IAClC,IAAI,EAAE,EAAE,KAAK,EAAE,CAAC,EAAE,OAAO,EAAE,GAAG,EAAE,GAAE,CAAC,EAAE;IACrC,UAAU,EAAE;QACV,IAAI,EAAE;YACJ,WAAW,EAAE;gBACX,KAAK,EAAE,sDAAsD;aAC9D;SACF;KACF;CACF,CAAC"}
@@ -0,0 +1,33 @@
1
+ import { type FactsCardStatus } from "./facts-card";
2
+ import { type OfferProductBeverage, type OfferProductVariant } from "./offer-product-card";
3
+ import { type OpportunityCardData } from "./opportunity-card";
4
+ import type { MatchEvaluation, OfferAttachmentItem, OfferFxInfo, OfferPartyInfo, OfferPresenceEntry, OfferSectionId, OfferTerms, Perspective, SectionOverride, TimelineEventData } from "./types";
5
+ export type OfferDocumentAction = "counter" | "accept" | "decline" | "withdraw" | "reopen" | "renew";
6
+ export interface OfferDocumentProps {
7
+ offerId: string;
8
+ status: FactsCardStatus;
9
+ round: number;
10
+ perspective: Perspective;
11
+ viewerOrgId: string;
12
+ producer: OfferPartyInfo;
13
+ importer: OfferPartyInfo;
14
+ opportunity: OpportunityCardData;
15
+ beverage: OfferProductBeverage;
16
+ variant: OfferProductVariant;
17
+ terms: OfferTerms;
18
+ previousTerms?: OfferTerms;
19
+ evaluation: MatchEvaluation;
20
+ attachments: OfferAttachmentItem[];
21
+ events: TimelineEventData[];
22
+ presence: OfferPresenceEntry[];
23
+ fx?: OfferFxInfo;
24
+ tenderCurrency?: string;
25
+ /** Per-section overrides (hide / reorder / override default-open). */
26
+ sections?: Partial<Record<OfferSectionId, SectionOverride>>;
27
+ onAction: (action: OfferDocumentAction) => void;
28
+ onOpenComposer?: () => void;
29
+ onOpenAttachment?: (a: OfferAttachmentItem) => void;
30
+ className?: string;
31
+ }
32
+ export declare function OfferDocument({ offerId, status, round, perspective, viewerOrgId, producer, importer, opportunity, beverage, variant, terms, previousTerms, evaluation, attachments, events, presence, fx, tenderCurrency, sections, onAction, onOpenComposer, onOpenAttachment, className, }: OfferDocumentProps): import("react/jsx-runtime").JSX.Element;
33
+ //# sourceMappingURL=offer-document.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"offer-document.d.ts","sourceRoot":"","sources":["../../src/offer/offer-document.tsx"],"names":[],"mappings":"AAKA,OAAO,EAAa,KAAK,eAAe,EAAE,MAAM,cAAc,CAAC;AAI/D,OAAO,EAAoB,KAAK,oBAAoB,EAAE,KAAK,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AAC7G,OAAO,EAAmB,KAAK,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AAG/E,OAAO,KAAK,EACV,eAAe,EACf,mBAAmB,EACnB,WAAW,EACX,cAAc,EACd,kBAAkB,EAClB,cAAc,EACd,UAAU,EACV,WAAW,EACX,eAAe,EACf,iBAAiB,EAElB,MAAM,SAAS,CAAC;AAEjB,MAAM,MAAM,mBAAmB,GAC3B,SAAS,GACT,QAAQ,GACR,SAAS,GACT,UAAU,GACV,QAAQ,GACR,OAAO,CAAC;AAEZ,MAAM,WAAW,kBAAkB;IACjC,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,eAAe,CAAC;IACxB,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,WAAW,CAAC;IACzB,WAAW,EAAE,MAAM,CAAC;IAEpB,QAAQ,EAAE,cAAc,CAAC;IACzB,QAAQ,EAAE,cAAc,CAAC;IACzB,WAAW,EAAE,mBAAmB,CAAC;IACjC,QAAQ,EAAE,oBAAoB,CAAC;IAC/B,OAAO,EAAE,mBAAmB,CAAC;IAC7B,KAAK,EAAE,UAAU,CAAC;IAClB,aAAa,CAAC,EAAE,UAAU,CAAC;IAC3B,UAAU,EAAE,eAAe,CAAC;IAC5B,WAAW,EAAE,mBAAmB,EAAE,CAAC;IACnC,MAAM,EAAE,iBAAiB,EAAE,CAAC;IAC5B,QAAQ,EAAE,kBAAkB,EAAE,CAAC;IAC/B,EAAE,CAAC,EAAE,WAAW,CAAC;IACjB,cAAc,CAAC,EAAE,MAAM,CAAC;IAExB,sEAAsE;IACtE,QAAQ,CAAC,EAAE,OAAO,CAAC,MAAM,CAAC,cAAc,EAAE,eAAe,CAAC,CAAC,CAAC;IAE5D,QAAQ,EAAE,CAAC,MAAM,EAAE,mBAAmB,KAAK,IAAI,CAAC;IAChD,cAAc,CAAC,EAAE,MAAM,IAAI,CAAC;IAC5B,gBAAgB,CAAC,EAAE,CAAC,CAAC,EAAE,mBAAmB,KAAK,IAAI,CAAC;IAEpD,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AA6ED,wBAAgB,aAAa,CAAC,EAC5B,OAAO,EACP,MAAM,EACN,KAAK,EACL,WAAW,EACX,WAAW,EACX,QAAQ,EACR,QAAQ,EACR,WAAW,EACX,QAAQ,EACR,OAAO,EACP,KAAK,EACL,aAAa,EACb,UAAU,EACV,WAAW,EACX,MAAM,EACN,QAAQ,EACR,EAAE,EACF,cAAc,EACd,QAAQ,EACR,QAAQ,EACR,cAAc,EACd,gBAAgB,EAChB,SAAS,GACV,EAAE,kBAAkB,2CAgMpB"}
@@ -0,0 +1,125 @@
1
+ import { jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
2
+ import { useMemo } from "react";
3
+ import { cn } from "../lib/utils";
4
+ import { ShadcnButton as Button } from "../components/shadcn-button";
5
+ import { AttachmentsCard } from "./attachments-card";
6
+ import { BuyerNotesCard } from "./buyer-notes-card";
7
+ import { FactsCard } from "./facts-card";
8
+ import { MatchCompatibilityCard } from "./match-compatibility-card";
9
+ import { NegotiationSection } from "./negotiation-section";
10
+ import { OfferExportButton } from "./offer-export-button";
11
+ import { OfferProductCard } from "./offer-product-card";
12
+ import { OpportunityCard } from "./opportunity-card";
13
+ import { PartiesCard } from "./parties-card";
14
+ import { TermsCard } from "./terms-card";
15
+ const DEFAULT_ORDER = [
16
+ "parties",
17
+ "opportunity",
18
+ "product",
19
+ "terms",
20
+ "match",
21
+ "notes",
22
+ "attachments",
23
+ "negotiation",
24
+ ];
25
+ function producerCtas(status, viewerInitiator) {
26
+ switch (status) {
27
+ case "proposed":
28
+ return viewerInitiator ? ["withdraw"] : ["counter", "accept", "decline"];
29
+ case "counter_pending":
30
+ return viewerInitiator ? ["withdraw"] : ["counter", "accept", "decline"];
31
+ case "accepted":
32
+ case "withdrawn":
33
+ return [];
34
+ case "declined":
35
+ return ["reopen"];
36
+ case "expired":
37
+ return ["renew"];
38
+ default:
39
+ return [];
40
+ }
41
+ }
42
+ // Blocker B9 — CTA aria-label composition. Screen-reader users should
43
+ // hear the full context ("Accept offer for Barolo DOCG 2020 from Fattoria
44
+ // San Marco") rather than a raw UUID ("Accept offer offer-1"). When the
45
+ // beverage or producer name is missing (defensive — this should not
46
+ // happen in practice), we fall back to the offer id segment.
47
+ const ACTION_VERB = {
48
+ counter: "Counter",
49
+ accept: "Accept",
50
+ decline: "Decline",
51
+ withdraw: "Withdraw",
52
+ reopen: "Reopen",
53
+ renew: "Renew",
54
+ };
55
+ function ctaAriaLabel(action, beverageName, producerName, offerId) {
56
+ const verb = ACTION_VERB[action];
57
+ if (beverageName && producerName) {
58
+ return `${verb} offer for ${beverageName} from ${producerName}`;
59
+ }
60
+ if (beverageName)
61
+ return `${verb} offer for ${beverageName}`;
62
+ // Defensive fallback — should never fire because OfferDocumentProps
63
+ // requires `beverage.name` and `producer.name`, but keeps the aria-label
64
+ // non-empty even if a consumer passes an empty string.
65
+ return `${verb} offer ${offerId}`;
66
+ }
67
+ // Blocker B9 / spec §19 — Screen-reader announcement on offer state
68
+ // transitions. The OfferDocument rail exposes a dedicated
69
+ // `role="status"` live region separate from FactsCard's price-focused
70
+ // live region. It emits a composed sentence like
71
+ // "Offer accepted — no further counters possible"
72
+ // whenever the `status` prop changes. This is the region that the
73
+ // `StateTransitionAnnouncement` story asserts against.
74
+ const STATE_TRANSITION_SENTENCE = {
75
+ proposed: "Offer proposed — awaiting counterparty response",
76
+ counter_pending: "Counter pending — awaiting review",
77
+ accepted: "Offer accepted — no further counters possible",
78
+ declined: "Offer declined",
79
+ expired: "Offer expired — validity window closed",
80
+ withdrawn: "Offer withdrawn by initiator",
81
+ };
82
+ export function OfferDocument({ offerId, status, round, perspective, viewerOrgId, producer, importer, opportunity, beverage, variant, terms, previousTerms, evaluation, attachments, events, presence, fx, tenderCurrency, sections, onAction, onOpenComposer, onOpenAttachment, className, }) {
83
+ const orderedIds = useMemo(() => {
84
+ const overrides = sections ?? {};
85
+ const active = DEFAULT_ORDER.filter((id) => !overrides[id]?.hidden);
86
+ return [...active].sort((a, b) => {
87
+ const oa = overrides[a]?.order ?? DEFAULT_ORDER.indexOf(a);
88
+ const ob = overrides[b]?.order ?? DEFAULT_ORDER.indexOf(b);
89
+ return oa - ob;
90
+ });
91
+ }, [sections]);
92
+ const viewerInitiator = (status === "proposed" && viewerOrgId === producer.orgId) ||
93
+ (status === "counter_pending" && events[events.length - 1]?.actorOrgId === viewerOrgId);
94
+ const ctas = producerCtas(status, viewerInitiator);
95
+ // Blocker B3 — viewerAdvantage is per-criterion and per-round. It must
96
+ // come from the backend evaluator (Plan 2) where each `MatchCriterion`
97
+ // carries its own `viewerAdvantage` scoped to the viewer. A flat
98
+ // page-level constant is wrong per spec §11: "Delta polarity: Producer:
99
+ // emerald · Importer: rose" describes a per-field rule, not a page-wide
100
+ // tone. We do NOT compute one here. Downstream cards that need the top-
101
+ // line viewer advantage (e.g. FactsCard price delta) derive it from the
102
+ // `price` criterion's own `viewerAdvantage`, with "neutral" as a safe
103
+ // fallback when the criterion is missing / FX-unavailable (§6.6).
104
+ const priceCriterion = evaluation.criteria.find((c) => c.id === "price");
105
+ const topLineAdvantage = priceCriterion?.viewerAdvantage ?? "neutral";
106
+ // Stable document-generation timestamp: captured once per mount, not on every re-render.
107
+ const printedAt = useMemo(() => new Date().toISOString(), []);
108
+ return (_jsxs("div", { "data-offer-document": true, "data-offer-id": offerId, "data-printed-at": printedAt, className: cn("mx-auto w-full max-w-6xl space-y-4 p-4", className), children: [_jsxs("div", { className: "flex items-center justify-between", children: [_jsxs("nav", { "data-offer-nav-chrome": true, "aria-label": "breadcrumb", className: "text-xs text-muted-foreground", children: [perspective === "producer" ? "Sprint board" : "Offers", " / Offer ", offerId.slice(0, 8)] }), _jsx(OfferExportButton, { offerId: offerId })] }), _jsx("div", { role: "status", "aria-live": "polite", className: "sr-only", children: STATE_TRANSITION_SENTENCE[status] }), _jsx("div", { "data-offer-facts-card": true, children: _jsx(FactsCard, { status: status, round: round, terms: terms, previousPrice: previousTerms?.price,
109
+ // Blocker B3 — derived from the `price` criterion's own
110
+ // `viewerAdvantage`, not a flat page-level constant. This keeps
111
+ // the price-delta chip polarity aligned with the backend's
112
+ // viewer-scoped evaluation (spec §11: "Delta polarity" per-field).
113
+ viewerAdvantage: topLineAdvantage, perspective: perspective, presence: presence, fx: fx, tenderCurrency: tenderCurrency, onExport: () => window.print() }) }), _jsxs("div", { className: "grid grid-cols-1 gap-4 lg:grid-cols-[minmax(0,1fr)_220px]", children: [_jsx("main", { className: "space-y-4", children: orderedIds.map((id) => (_jsxs("div", { "data-offer-section": true, "data-section-id": id, children: [id === "parties" && (_jsx(PartiesCard, { producer: producer, importer: importer, viewerOrgId: viewerOrgId, variant: sections?.parties?.defaultOpen ? "expanded" : "collapsed" })), id === "opportunity" && (_jsx(OpportunityCard, { opportunity: opportunity, variant: sections?.opportunity?.defaultOpen ? "expanded" : "collapsed" })), id === "product" && (_jsx(OfferProductCard, { variant: variant, beverage: beverage, variantDisplay: sections?.product?.defaultOpen === false ? "collapsed" : "expanded" })), id === "terms" && (_jsx(TermsCard, { terms: terms, previousTerms: previousTerms, variant: sections?.terms?.defaultOpen ? "expanded" : "collapsed",
114
+ // Blocker B3 — TermsCard now derives per-row polarity
115
+ // from `perspective` + each cell's delta direction rather
116
+ // than a single flat `viewerAdvantage` constant. Price up
117
+ // is emerald for a producer, rose for an importer, etc.
118
+ perspective: perspective })), id === "match" && (_jsx(MatchCompatibilityCard, { evaluation: evaluation,
119
+ // Blocker B3 — each criterion row derives its own colour
120
+ // from its own `viewerAdvantage` field. Passing
121
+ // `perspective` is informational (e.g. for accessible
122
+ // labels like "Producer: price improved").
123
+ perspective: perspective })), id === "notes" && _jsx(BuyerNotesCard, { notes: evaluation.freeTextFields }), id === "attachments" && (_jsx(AttachmentsCard, { attachments: attachments, onOpen: (a) => onOpenAttachment?.(a) })), id === "negotiation" && (_jsx(NegotiationSection, { events: events, viewerOrgId: viewerOrgId, viewerRole: perspective, onOpenComposer: onOpenComposer }))] }, id))) }), _jsx("aside", { "data-offer-rail": true, "aria-label": "Actions and meta", className: "hidden lg:block", children: _jsxs("div", { className: "sticky top-24 space-y-3", children: [_jsxs("div", { className: "rounded-xl border border-border/60 bg-card p-3", children: [_jsx("div", { className: "text-xs uppercase tracking-wide text-muted-foreground", children: "Actions" }), _jsxs("div", { className: "mt-2 flex flex-wrap gap-2", children: [ctas.length === 0 && (_jsx("span", { className: "text-xs text-muted-foreground", children: "No actions available." })), ctas.map((a) => (_jsx(Button, { size: "sm", "aria-label": ctaAriaLabel(a, beverage.name, producer.name, offerId), onClick: () => onAction(a), children: a }, a)))] })] }), _jsxs("div", { className: "rounded-xl border border-border/60 bg-card p-3 text-xs", children: [_jsx("div", { className: "uppercase tracking-wide text-muted-foreground", children: "Status" }), _jsx("div", { className: "mt-1 font-medium capitalize", children: status.replace("_", " ") }), _jsxs("div", { className: "mt-1 text-muted-foreground", children: ["R", round, " of 4 max"] })] }), _jsxs("div", { className: "rounded-xl border border-border/60 bg-card p-3 text-xs", children: [_jsx("div", { className: "uppercase tracking-wide text-muted-foreground", children: "Offer" }), _jsx("div", { className: "mt-1 font-mono", children: offerId }), _jsxs("div", { className: "mt-1 text-muted-foreground", children: [events.length, " events \u00B7 ", attachments.length, " files"] })] }), _jsxs("div", { className: "rounded-xl border border-border/60 bg-card p-3", children: [_jsx("div", { className: "text-xs uppercase tracking-wide text-muted-foreground", children: "Export" }), _jsx("div", { className: "mt-2", children: _jsx(OfferExportButton, { offerId: offerId }) })] })] }) })] })] }));
124
+ }
125
+ //# sourceMappingURL=offer-document.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"offer-document.js","sourceRoot":"","sources":["../../src/offer/offer-document.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAChC,OAAO,EAAE,EAAE,EAAE,MAAM,cAAc,CAAC;AAClC,OAAO,EAAE,YAAY,IAAI,MAAM,EAAE,MAAM,6BAA6B,CAAC;AACrE,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACpD,OAAO,EAAE,SAAS,EAAwB,MAAM,cAAc,CAAC;AAC/D,OAAO,EAAE,sBAAsB,EAAE,MAAM,4BAA4B,CAAC;AACpE,OAAO,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAC3D,OAAO,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAC1D,OAAO,EAAE,gBAAgB,EAAuD,MAAM,sBAAsB,CAAC;AAC7G,OAAO,EAAE,eAAe,EAA4B,MAAM,oBAAoB,CAAC;AAC/E,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAs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EAAC,+BAA+B,sCAA6B,CAC7E,EACA,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CACf,KAAC,MAAM,IAEL,IAAI,EAAC,IAAI,gBAOG,YAAY,CAAC,CAAC,EAAE,QAAQ,CAAC,IAAI,EAAE,QAAQ,CAAC,IAAI,EAAE,OAAO,CAAC,EAClE,OAAO,EAAE,GAAG,EAAE,CAAC,QAAQ,CAAC,CAAC,CAAC,YAEzB,CAAC,IAXG,CAAC,CAYC,CACV,CAAC,IACE,IACF,EACN,eAAK,SAAS,EAAC,wDAAwD,aACrE,cAAK,SAAS,EAAC,+CAA+C,uBAAa,EAC3E,cAAK,SAAS,EAAC,6BAA6B,YAAE,MAAM,CAAC,OAAO,CAAC,GAAG,EAAE,GAAG,CAAC,GAAO,EAC7E,eAAK,SAAS,EAAC,4BAA4B,kBAAG,KAAK,iBAAgB,IAC/D,EACN,eAAK,SAAS,EAAC,wDAAwD,aACrE,cAAK,SAAS,EAAC,+CAA+C,sBAAY,EAC1E,cAAK,SAAS,EAAC,gBAAgB,YAAE,OAAO,GAAO,EAC/C,eAAK,SAAS,EAAC,4BAA4B,aACxC,MAAM,CAAC,MAAM,qBAAY,WAAW,CAAC,MAAM,cACxC,IACF,EACN,eAAK,SAAS,EAAC,gDAAgD,aAC7D,cAAK,SAAS,EAAC,uDAAuD,uBAAa,EACnF,cAAK,SAAS,EAAC,MAAM,YACnB,KAAC,iBAAiB,IAAC,OAAO,EAAE,OAAO,GAAI,GACnC,IACF,IACF,GACA,IACJ,IACF,CACP,CAAC;AACJ,CAAC"}
@@ -0,0 +1,25 @@
1
+ import type { StoryObj } from "@storybook/react-vite";
2
+ import { OfferDocument } from "./offer-document";
3
+ declare const meta: {
4
+ title: string;
5
+ component: typeof OfferDocument;
6
+ tags: string[];
7
+ parameters: {
8
+ layout: string;
9
+ };
10
+ };
11
+ export default meta;
12
+ type Story = StoryObj<typeof meta>;
13
+ export declare const ProposedProducer: Story;
14
+ export declare const ProposedImporter: Story;
15
+ export declare const CounterPendingProducer: Story;
16
+ export declare const CounterPendingImporter: Story;
17
+ export declare const Accepted: Story;
18
+ export declare const Declined: Story;
19
+ export declare const Expired: Story;
20
+ export declare const Withdrawn: Story;
21
+ export declare const SectionHidden: Story;
22
+ export declare const SectionReordered: Story;
23
+ export declare const StateTransitionAnnouncement: Story;
24
+ export declare const ResponsiveMobile: Story;
25
+ //# sourceMappingURL=offer-document.stories.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"offer-document.stories.d.ts","sourceRoot":"","sources":["../../src/offer/offer-document.stories.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAQ,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AASjD,QAAA,MAAM,IAAI;;;;;;;CAK4B,CAAC;AAEvC,eAAe,IAAI,CAAC;AACpB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,IAAI,CAAC,CAAC;AA8EnC,eAAO,MAAM,gBAAgB,EAAE,KAA0B,CAAC;AAC1D,eAAO,MAAM,gBAAgB,EAAE,KAA2F,CAAC;AAC3H,eAAO,MAAM,sBAAsB,EAAE,KAA+E,CAAC;AACrH,eAAO,MAAM,sBAAsB,EAAE,KAAyI,CAAC;AAC/K,eAAO,MAAM,QAAQ,EAAE,KAA8D,CAAC;AACtF,eAAO,MAAM,QAAQ,EAAE,KAA8D,CAAC;AACtF,eAAO,MAAM,OAAO,EAAE,KAA6D,CAAC;AACpF,eAAO,MAAM,SAAS,EAAE,KAA+D,CAAC;AACxF,eAAO,MAAM,aAAa,EAAE,KAkB3B,CAAC;AACF,eAAO,MAAM,gBAAgB,EAAE,KA8B9B,CAAC;AAuBF,eAAO,MAAM,2BAA2B,EAAE,KAczC,CAAC;AAMF,eAAO,MAAM,gBAAgB,EAAE,KAG9B,CAAC"}
@@ -0,0 +1,168 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { useState } from "react";
3
+ import { OfferDocument } from "./offer-document";
4
+ const meta = {
5
+ title: "Offer/OfferDocument",
6
+ component: OfferDocument,
7
+ tags: ["autodocs"],
8
+ parameters: { layout: "fullscreen" },
9
+ };
10
+ export default meta;
11
+ const producer = {
12
+ orgId: "org-prod",
13
+ name: "Chianti Wines SRL",
14
+ location: "Tuscany, IT",
15
+ };
16
+ const importerParty = {
17
+ orgId: "org-imp",
18
+ name: "Maxwell Importers Ltd",
19
+ location: "London, UK",
20
+ };
21
+ const terms = {
22
+ price: 4.1,
23
+ currency: "EUR",
24
+ volume: 20000,
25
+ volumeUnit: "L",
26
+ incoterms: "FOB",
27
+ paymentTerms: "Net 30",
28
+ deliveryDate: "2026-08-15",
29
+ validUntil: "2026-05-22",
30
+ };
31
+ const evaluation = {
32
+ headline: "partial",
33
+ headlineSummary: "Price is 4% over the ceiling",
34
+ criteria: [
35
+ { id: "price", label: "Price", state: "partial", offered: 4.4, required: 4.2, reason: "4.7% over ceiling", viewerAdvantage: "improved" },
36
+ { id: "volume", label: "Volume", state: "ok", offered: 20000, required: 20000, viewerAdvantage: "neutral" },
37
+ { id: "alcoholRange", label: "ABV range", state: "ok", offered: 13.5, required: [12.5, 14], viewerAdvantage: "neutral" },
38
+ ],
39
+ freeTextFields: [
40
+ { id: "styleTasteProfile", label: "Style / taste profile", value: "Fruit-forward, balanced tannins." },
41
+ ],
42
+ hiddenReasons: [],
43
+ };
44
+ const events = [
45
+ { id: "t1", kind: "propose", createdAt: "2026-04-18T10:00:00Z", actorOrgId: "org-prod", actorRole: "producer", round: 1, terms },
46
+ { id: "t2", kind: "message", createdAt: "2026-04-18T11:00:00Z", actorOrgId: "org-imp", actorRole: "importer", content: "Can you attach your lab cert?" },
47
+ ];
48
+ const attachments = [
49
+ { id: "a1", fileName: "product-sheet.pdf", mimeType: "application/pdf", sizeBytes: 250_000, uploadedAt: "2026-04-18T10:00:00Z", source: "formal", sourceLabel: "formal attachment" },
50
+ ];
51
+ const opportunity = {
52
+ id: "opp-1",
53
+ title: "Bulk Chianti DOCG — Q3 2026",
54
+ closingDays: 12,
55
+ priceCeilingEuro: 4.2,
56
+ volumeOptions: [20000],
57
+ requirements: ["ABV 12.5–14%", "750ml glass bottles", "Organic certification required"],
58
+ };
59
+ const beverage = { id: "bev-1", name: "Chianti Riserva", producer: "Chianti Wines SRL", countryOfOrigin: "Italy", beverageType: { category: "wine", subtype: "red" } };
60
+ const variant = { id: "var-1", vintage: 2020, packaging: "750ml glass bottle", closure: "cork", abv: 13.5, residualSugar: 2.3, organic: true, fairtrade: false, sustainable: true, imageUrl: null };
61
+ const baseArgs = {
62
+ offerId: "offer-1",
63
+ status: "proposed",
64
+ round: 1,
65
+ perspective: "producer",
66
+ viewerOrgId: "org-prod",
67
+ producer,
68
+ importer: importerParty,
69
+ opportunity,
70
+ beverage,
71
+ variant,
72
+ terms,
73
+ evaluation,
74
+ attachments,
75
+ events,
76
+ presence: [],
77
+ onAction: () => { },
78
+ onOpenComposer: () => { },
79
+ };
80
+ export const ProposedProducer = { args: baseArgs };
81
+ export const ProposedImporter = { args: { ...baseArgs, perspective: "importer", viewerOrgId: "org-imp" } };
82
+ export const CounterPendingProducer = { args: { ...baseArgs, status: "counter_pending", round: 2 } };
83
+ export const CounterPendingImporter = { args: { ...baseArgs, status: "counter_pending", round: 2, perspective: "importer", viewerOrgId: "org-imp" } };
84
+ export const Accepted = { args: { ...baseArgs, status: "accepted" } };
85
+ export const Declined = { args: { ...baseArgs, status: "declined" } };
86
+ export const Expired = { args: { ...baseArgs, status: "expired" } };
87
+ export const Withdrawn = { args: { ...baseArgs, status: "withdrawn" } };
88
+ export const SectionHidden = {
89
+ args: {
90
+ ...baseArgs,
91
+ sections: { notes: { hidden: true } },
92
+ },
93
+ // Blocker B7 — assert the hidden section is actually absent from the DOM.
94
+ play: async ({ canvasElement }) => {
95
+ const { within } = await import("storybook/test");
96
+ const { expect } = await import("vitest");
97
+ const canvas = within(canvasElement);
98
+ // Every rendered section carries `data-section-id="<id>"` in Task 5.3.
99
+ const notes = canvas.queryByTestId?.("section-notes")
100
+ ?? canvasElement.querySelector('[data-section-id="notes"]');
101
+ await expect(notes).toBeNull();
102
+ // And other sections remain rendered
103
+ const match = canvasElement.querySelector('[data-section-id="match"]');
104
+ await expect(match).not.toBeNull();
105
+ },
106
+ };
107
+ export const SectionReordered = {
108
+ args: {
109
+ ...baseArgs,
110
+ sections: {
111
+ match: { order: 0, defaultOpen: true },
112
+ terms: { order: 1 },
113
+ },
114
+ },
115
+ // Blocker B7 — assert the actual DOM order reflects the `order` override.
116
+ // Without this assertion the `sections` prop's claim to accept stable ids
117
+ // for reordering is untested.
118
+ play: async ({ canvasElement }) => {
119
+ const { within: _within } = await import("storybook/test");
120
+ const { expect } = await import("vitest");
121
+ void _within;
122
+ const sections = Array.from(canvasElement.querySelectorAll("[data-section-id]"));
123
+ const ids = sections.map((el) => el.getAttribute("data-section-id"));
124
+ // With `match.order=0` + `terms.order=1`, match MUST precede terms,
125
+ // and BOTH must precede any unmodified section.
126
+ const matchIdx = ids.indexOf("match");
127
+ const termsIdx = ids.indexOf("terms");
128
+ await expect(matchIdx).toBeGreaterThanOrEqual(0);
129
+ await expect(termsIdx).toBeGreaterThan(matchIdx);
130
+ // Unmodified sections keep their default relative order after the
131
+ // overridden ones; `parties` defaults to index 0, so after override it
132
+ // should be AFTER the explicit order-0 `match`.
133
+ await expect(ids.indexOf("parties")).toBeGreaterThan(matchIdx);
134
+ },
135
+ };
136
+ function StateTransitionAnnouncementDemo() {
137
+ const [status, setStatus] = useState("proposed");
138
+ return (_jsxs("div", { children: [_jsxs("div", { className: "mb-2 flex gap-2", children: [_jsx("button", { "data-testid": "to-proposed", onClick: () => setStatus("proposed"), children: "Proposed" }), _jsx("button", { "data-testid": "to-accepted", onClick: () => setStatus("accepted"), children: "Accept" }), _jsx("button", { "data-testid": "to-declined", onClick: () => setStatus("declined"), children: "Decline" })] }), _jsx(OfferDocument, { ...baseArgs, status: status })] }));
139
+ }
140
+ // Spec §19: "Screen-reader announcement on offer state transitions". The
141
+ // rail should expose a <div role="status" aria-live="polite"> that emits
142
+ // composed strings like "Offer accepted — no further counters possible"
143
+ // when the status prop changes. This story swaps status mid-render and
144
+ // asserts the region updates.
145
+ export const StateTransitionAnnouncement = {
146
+ args: baseArgs,
147
+ render: () => _jsx(StateTransitionAnnouncementDemo, {}),
148
+ play: async ({ canvasElement, step }) => {
149
+ const { within, userEvent } = await import("storybook/test");
150
+ const { expect } = await import("vitest");
151
+ const canvas = within(canvasElement);
152
+ await step("transitioning to accepted announces the composed sentence", async () => {
153
+ await userEvent.click(canvas.getByTestId("to-accepted"));
154
+ const regions = canvas.getAllByRole("status");
155
+ const joined = regions.map((r) => r.textContent ?? "").join(" · ");
156
+ await expect(joined).toMatch(/accepted.*no further counters possible/i);
157
+ });
158
+ },
159
+ };
160
+ // Responsive coverage per spec §5.5 — OfferDocument is the page shell
161
+ // and must collapse its right-rail below the `lg:` breakpoint. This
162
+ // story renders at `mobile1` (360×640) so chromatic / visual regression
163
+ // catches rail-hide + section-stack regressions on narrow viewports.
164
+ export const ResponsiveMobile = {
165
+ args: { ...baseArgs },
166
+ parameters: { viewport: { defaultViewport: "mobile1" } },
167
+ };
168
+ //# sourceMappingURL=offer-document.stories.js.map