@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,81 @@
1
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
+ import { useCallback, useEffect, useMemo, useRef, useState } from "react";
3
+ import { Dialog, DialogBackdrop, DialogPanel, DialogTitle } from "@headlessui/react";
4
+ import { X, Send, AlertCircle } from "lucide-react";
5
+ import { cn } from "../lib/utils";
6
+ import { ShadcnButton as Button } from "../components/shadcn-button";
7
+ import { ShadcnInput as Input } from "../components/shadcn-input";
8
+ import { ShadcnTextarea as Textarea } from "../components/shadcn-textarea";
9
+ import { Label } from "../components/label";
10
+ import { ShadcnSelect as Select, ShadcnSelectContent as SelectContent, ShadcnSelectItem as SelectItem, ShadcnSelectTrigger as SelectTrigger, ShadcnSelectValue as SelectValue, } from "../components/shadcn-select";
11
+ import { MatchPreview } from "./match-preview";
12
+ function formatDelta(current, baseline, unit) {
13
+ const delta = current - baseline;
14
+ if (delta === 0)
15
+ return null;
16
+ const sign = delta > 0 ? "+" : "";
17
+ return `${sign}${delta.toFixed(2)}${unit ? ` ${unit}` : ""}`;
18
+ }
19
+ export function CounterSlideOver({ open, onClose, offerId: _offerId, round, allowedIncoterms, baselineTerms, initialMatchEvaluation, onSubmit, onEvaluateDraft, banner, className, }) {
20
+ const initial = useMemo(() => ({
21
+ price: baselineTerms.price,
22
+ volume: baselineTerms.volume,
23
+ incoterms: baselineTerms.incoterms ?? "",
24
+ paymentTerms: baselineTerms.paymentTerms ?? "",
25
+ deliveryDate: baselineTerms.deliveryDate ?? "",
26
+ validUntil: baselineTerms.validUntil ?? "",
27
+ message: "",
28
+ attachmentIds: [],
29
+ }), [baselineTerms]);
30
+ const [draft, setDraft] = useState(initial);
31
+ const [evaluation, setEvaluation] = useState(initialMatchEvaluation);
32
+ const [submitting, setSubmitting] = useState(false);
33
+ const priceInputRef = useRef(null);
34
+ useEffect(() => {
35
+ // eslint-disable-next-line @eslint-react/set-state-in-effect -- syncs draft to baseline on open transition; intentional controlled reset
36
+ if (open)
37
+ setDraft(initial);
38
+ }, [open, initial]);
39
+ useEffect(() => {
40
+ // eslint-disable-next-line @eslint-react/set-state-in-effect -- derives evaluation from draft; must stay in sync on every draft change
41
+ setEvaluation(onEvaluateDraft(draft));
42
+ }, [draft, onEvaluateDraft]);
43
+ const handleSubmit = useCallback(async () => {
44
+ if (banner?.kind === "round_cap")
45
+ return;
46
+ setSubmitting(true);
47
+ try {
48
+ await onSubmit(draft);
49
+ }
50
+ finally {
51
+ setSubmitting(false);
52
+ }
53
+ }, [banner, draft, onSubmit]);
54
+ useEffect(() => {
55
+ function handleKey(e) {
56
+ if (!open)
57
+ return;
58
+ if (e.key === "Escape")
59
+ onClose();
60
+ if ((e.metaKey || e.ctrlKey) && e.key === "Enter") {
61
+ e.preventDefault();
62
+ void handleSubmit();
63
+ }
64
+ }
65
+ document.addEventListener("keydown", handleKey);
66
+ return () => document.removeEventListener("keydown", handleKey);
67
+ }, [open, onClose, handleSubmit]);
68
+ const isRoundOne = round === 1;
69
+ const baselineLabel = isRoundOne ? "vs initial proposal" : "vs counterparty's last proposal";
70
+ return (_jsxs(Dialog, { open: open, onClose: onClose,
71
+ // Blocker B2 — Headless UI's `initialFocus` prop points to the ref we
72
+ // want focused on open. Spec §7.6: "Focus trap on open; returns focus
73
+ // to the triggering button on close." Without this prop Headless UI
74
+ // focuses the first focusable child it finds (the Close button), which
75
+ // does not match the spec or the accompanying aria-live announcement.
76
+ initialFocus: priceInputRef, className: cn("relative z-50", className), "aria-labelledby": "counter-title", "aria-describedby": "counter-baseline-label", children: [_jsx(DialogBackdrop, { className: "fixed inset-0 bg-background/60 backdrop-blur-xs motion-safe:transition-opacity motion-reduce:transition-none" }), _jsx("div", { className: "fixed inset-0 flex md:justify-end", children: _jsxs(DialogPanel, { className: cn("flex h-full w-full flex-col overflow-hidden bg-card shadow-xl", "md:w-[520px] md:rounded-l-2xl", "motion-safe:transition-transform motion-reduce:transition-none"), children: [_jsxs("div", { className: "flex items-center justify-between border-b border-border/60 px-5 py-3", children: [_jsxs("div", { children: [_jsxs(DialogTitle, { id: "counter-title", className: "text-base/6 font-semibold", children: ["Counter \u2014 R", round] }), _jsx("div", { id: "counter-baseline-label", className: "text-xs text-muted-foreground", children: baselineLabel })] }), _jsx("button", { type: "button", onClick: onClose, "aria-label": "Close counter composer", className: "flex size-8 items-center justify-center rounded-lg border border-border/60 hover:bg-accent/30", children: _jsx(X, { "aria-hidden": true, className: "size-4" }) })] }), banner && (_jsxs("div", { role: "alert", className: cn("flex items-start gap-2 border-b border-border/60 px-5 py-3 text-sm", banner.kind === "round_cap" && "bg-amber-50 text-amber-900", banner.kind === "version_conflict" && "bg-amber-50 text-amber-900", banner.kind === "rate_limit" && "bg-amber-50 text-amber-900", banner.kind === "validation" && "bg-rose-50 text-rose-900", banner.kind === "incoming_counter" && "bg-sky-50 text-sky-900"), children: [_jsx(AlertCircle, { "aria-hidden": true, className: "size-4 shrink-0" }), _jsxs("div", { className: "flex-1", children: [banner.kind === "round_cap" && "Round 4 is the final counter. Accept, decline, or wait for the counterparty to respond.", banner.kind === "version_conflict" && "The counterparty acted while you were drafting. Reload to see their latest.", banner.kind === "rate_limit" && `Slow down — you can submit another counter in ${banner.retryAfterSeconds}s.`, banner.kind === "validation" && banner.message, banner.kind === "incoming_counter" && (_jsxs(_Fragment, { children: ["The counterparty just sent a new counter \u2014 R", banner.roundN, ": ", banner.headline, ". Your draft is based on the previous round."] }))] }), banner.kind === "incoming_counter" && (_jsxs("div", { className: "flex gap-2", children: [_jsx(Button, { size: "sm", variant: "ghost", onClick: banner.onDismiss, children: "Dismiss" }), _jsx(Button, { size: "sm", onClick: banner.onReset, children: "Reset from new round" })] })), banner.kind === "version_conflict" && (_jsx(Button, { size: "sm", onClick: banner.onReload, children: "Reload" }))] })), _jsxs("form", { onSubmit: (e) => {
77
+ e.preventDefault();
78
+ void handleSubmit();
79
+ }, className: "flex flex-1 flex-col overflow-y-auto px-5 py-4 gap-4", children: [_jsxs("div", { className: "grid grid-cols-2 gap-3", children: [_jsxs("div", { children: [_jsxs(Label, { htmlFor: "cs-price", className: "text-xs", children: ["Price (", baselineTerms.currency, ")"] }), _jsxs("div", { className: "flex items-center gap-2", children: [_jsx(Input, { ref: priceInputRef, id: "cs-price", type: "number", step: "0.01", required: true, min: 0, value: draft.price, onChange: (e) => setDraft((d) => ({ ...d, price: Number(e.target.value) })) }), formatDelta(draft.price, baselineTerms.price, baselineTerms.currency) && (_jsx("span", { "aria-label": `price ${draft.price > baselineTerms.price ? "increased" : "decreased"} by ${Math.abs(draft.price - baselineTerms.price).toFixed(2)} ${baselineTerms.currency}`, className: "rounded-full border border-border/60 bg-muted/50 px-2 py-0.5 text-xs", children: formatDelta(draft.price, baselineTerms.price, baselineTerms.currency) }))] })] }), _jsxs("div", { children: [_jsx(Label, { htmlFor: "cs-volume", className: "text-xs", children: "Volume (L)" }), _jsxs("div", { className: "flex items-center gap-2", children: [_jsx(Input, { id: "cs-volume", type: "number", required: true, min: 1, value: draft.volume, onChange: (e) => setDraft((d) => ({ ...d, volume: Number(e.target.value) })) }), formatDelta(draft.volume, baselineTerms.volume, "L") && (_jsx("span", { "aria-label": `volume ${draft.volume > baselineTerms.volume ? "increased" : "decreased"} by ${Math.abs(draft.volume - baselineTerms.volume)} L`, className: "rounded-full border border-border/60 bg-muted/50 px-2 py-0.5 text-xs", children: formatDelta(draft.volume, baselineTerms.volume, "L") }))] })] }), _jsxs("div", { children: [_jsx(Label, { htmlFor: "cs-incoterms", className: "text-xs", children: "Incoterms" }), _jsxs(Select, { value: draft.incoterms, onValueChange: (v) => setDraft((d) => ({ ...d, incoterms: v })), children: [_jsx(SelectTrigger, { id: "cs-incoterms", children: _jsx(SelectValue, { placeholder: "Select" }) }), _jsx(SelectContent, { children: allowedIncoterms.map((i) => (_jsx(SelectItem, { value: i, children: i }, i))) })] })] }), _jsxs("div", { children: [_jsx(Label, { htmlFor: "cs-payment", className: "text-xs", children: "Payment terms" }), _jsx(Input, { id: "cs-payment", required: true, value: draft.paymentTerms, onChange: (e) => setDraft((d) => ({ ...d, paymentTerms: e.target.value })) })] }), _jsxs("div", { children: [_jsx(Label, { htmlFor: "cs-delivery", className: "text-xs", children: "Delivery date" }), _jsx(Input, { id: "cs-delivery", type: "date", required: true, value: draft.deliveryDate, onChange: (e) => setDraft((d) => ({ ...d, deliveryDate: e.target.value })) })] }), _jsxs("div", { children: [_jsx(Label, { htmlFor: "cs-valid", className: "text-xs", children: "Valid until" }), _jsx(Input, { id: "cs-valid", type: "date", required: true, value: draft.validUntil, onChange: (e) => setDraft((d) => ({ ...d, validUntil: e.target.value })) })] })] }), _jsxs("div", { children: [_jsx(Label, { htmlFor: "cs-message", className: "text-xs", children: "Message (optional)" }), _jsx(Textarea, { id: "cs-message", rows: 3, value: draft.message, onChange: (e) => setDraft((d) => ({ ...d, message: e.target.value })) })] }), _jsx(MatchPreview, { evaluation: evaluation }), _jsxs("div", { className: "mt-auto flex items-center justify-end gap-2 border-t border-border/60 pt-3", children: [_jsx(Button, { type: "button", variant: "ghost", onClick: onClose, children: "Cancel" }), _jsxs(Button, { type: "submit", disabled: submitting || banner?.kind === "round_cap" || banner?.kind === "version_conflict" || banner?.kind === "rate_limit", children: [_jsx(Send, { "aria-hidden": true, className: "size-4" }), "Submit counter (Cmd+Enter)"] })] })] })] }) })] }));
80
+ }
81
+ //# sourceMappingURL=counter-slide-over.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"counter-slide-over.js","sourceRoot":"","sources":["../../src/offer/counter-slide-over.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAC1E,OAAO,EAAE,MAAM,EAAE,cAAc,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AACrF,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AACpD,OAAO,EAAE,EAAE,EAAE,MAAM,cAAc,CAAC;AAClC,OAAO,EAAE,YAAY,IAAI,MAAM,EAAE,MAAM,6BAA6B,CAAC;AACrE,OAAO,EAAE,WAAW,IAAI,KAAK,EAAE,MAAM,4BAA4B,CAAC;AAClE,OAAO,EAAE,cAAc,IAAI,QAAQ,EAAE,MAAM,+BAA+B,CAAC;AAC3E,OAAO,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAC5C,OAAO,EACL,YAAY,IAAI,MAAM,EACtB,mBAAmB,IAAI,aAAa,EACpC,gBAAgB,IAAI,UAAU,EAC9B,mBAAmB,IAAI,aAAa,EACpC,iBAAiB,IAAI,WAAW,GACjC,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAmC/C,SAAS,WAAW,CAAC,OAAe,EAAE,QAAgB,EAAE,IAAa;IACnE,MAAM,KAAK,GAAG,OAAO,GAAG,QAAQ,CAAC;IACjC,IAAI,KAAK,KAAK,CAAC;QAAE,OAAO,IAAI,CAAC;IAC7B,MAAM,IAAI,GAAG,KAAK,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC;IAClC,OAAO,GAAG,IAAI,GAAG,KA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Y,IAAC,UAAU,EAAE,UAAU,GAAI,EAExC,eAAK,SAAS,EAAC,4EAA4E,aACzF,KAAC,MAAM,IAAC,IAAI,EAAC,QAAQ,EAAC,OAAO,EAAC,OAAO,EAAC,OAAO,EAAE,OAAO,uBAAiB,EACvE,MAAC,MAAM,IACL,IAAI,EAAC,QAAQ,EACb,QAAQ,EAAE,UAAU,IAAI,MAAM,EAAE,IAAI,KAAK,WAAW,IAAI,MAAM,EAAE,IAAI,KAAK,kBAAkB,IAAI,MAAM,EAAE,IAAI,KAAK,YAAY,aAE5H,KAAC,IAAI,yBAAa,SAAS,EAAC,QAAQ,GAAG,kCAEhC,IACL,IACD,IACK,GACV,IACC,CACV,CAAC;AACJ,CAAC"}
@@ -0,0 +1,23 @@
1
+ import type { StoryObj } from "@storybook/react-vite";
2
+ import { CounterSlideOver } from "./counter-slide-over";
3
+ declare const meta: {
4
+ title: string;
5
+ component: typeof CounterSlideOver;
6
+ tags: string[];
7
+ parameters: {
8
+ layout: string;
9
+ };
10
+ };
11
+ export default meta;
12
+ type Story = StoryObj<typeof meta>;
13
+ export declare const Round1PreFill: Story;
14
+ export declare const Round2PreFill: Story;
15
+ export declare const MidComposeDiffBanner: Story;
16
+ export declare const RoundCap409: Story;
17
+ export declare const VersionConflict409: Story;
18
+ export declare const RateLimit429: Story;
19
+ export declare const ValidationError: Story;
20
+ export declare const FocusTrapAndReturn: Story;
21
+ export declare const MatchEvaluatorContractFixture: Story;
22
+ export declare const MobileBottomSheet: Story;
23
+ //# sourceMappingURL=counter-slide-over.stories.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"counter-slide-over.stories.d.ts","sourceRoot":"","sources":["../../src/offer/counter-slide-over.stories.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAQ,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAIxD,QAAA,MAAM,IAAI;;;;;;;CAK+B,CAAC;AAE1C,eAAe,IAAI,CAAC;AACpB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,IAAI,CAAC,CAAC;AA4DnC,eAAO,MAAM,aAAa,EAAE,KAG3B,CAAC;AAEF,eAAO,MAAM,aAAa,EAAE,KAG3B,CAAC;AAEF,eAAO,MAAM,oBAAoB,EAAE,KAGlC,CAAC;AAEF,eAAO,MAAM,WAAW,EAAE,KAGzB,CAAC;AAEF,eAAO,MAAM,kBAAkB,EAAE,KAGhC,CAAC;AAEF,eAAO,MAAM,YAAY,EAAE,KAG1B,CAAC;AAEF,eAAO,MAAM,eAAe,EAAE,KAG7B,CAAC;AAuCF,eAAO,MAAM,kBAAkB,EAAE,KAuDhC,CAAC;AAsEF,eAAO,MAAM,6BAA6B,EAAE,KA6B3C,CAAC;AAKF,eAAO,MAAM,iBAAiB,EAAE,KAe/B,CAAC"}
@@ -0,0 +1,235 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { useState } from "react";
3
+ import { CounterSlideOver } from "./counter-slide-over";
4
+ import { ShadcnButton as Button } from "../components/shadcn-button";
5
+ const meta = {
6
+ title: "Offer/CounterSlideOver",
7
+ component: CounterSlideOver,
8
+ tags: ["autodocs"],
9
+ parameters: { layout: "fullscreen" },
10
+ };
11
+ export default meta;
12
+ const baseTerms = {
13
+ price: 4.1,
14
+ currency: "EUR",
15
+ volume: 20000,
16
+ volumeUnit: "L",
17
+ incoterms: "FOB",
18
+ paymentTerms: "Net 30",
19
+ deliveryDate: "2026-08-15",
20
+ validUntil: "2026-05-22",
21
+ };
22
+ const strong = {
23
+ headline: "strong",
24
+ headlineSummary: "All requirements met",
25
+ criteria: [
26
+ { id: "price", label: "Price", state: "ok", offered: 4.1, required: 4.2, viewerAdvantage: "improved" },
27
+ ],
28
+ freeTextFields: [],
29
+ hiddenReasons: [],
30
+ };
31
+ function Wrapper(props) {
32
+ const [open, setOpen] = useState(true);
33
+ return (_jsxs("div", { className: "relative min-h-screen bg-muted/20 p-8", children: [_jsx(Button, { onClick: () => setOpen(true), children: "Open counter composer" }), _jsx(CounterSlideOver, { open: open, onClose: () => setOpen(false), offerId: "offer-1", round: props.round, allowedIncoterms: ["FOB", "CIF", "EXW"], baselineTerms: props.previousTerms, initialMatchEvaluation: strong, onSubmit: async () => { }, onEvaluateDraft: (_draft) => strong, banner: props.bannerKind === "incoming_counter"
34
+ ? { kind: "incoming_counter", roundN: props.round + 1, headline: "R3: €4.15", onReset: () => { }, onDismiss: () => { } }
35
+ : props.bannerKind === "round_cap"
36
+ ? { kind: "round_cap" }
37
+ : props.bannerKind === "version_conflict"
38
+ ? { kind: "version_conflict", onReload: () => { } }
39
+ : props.bannerKind === "rate_limit"
40
+ ? { kind: "rate_limit", retryAfterSeconds: 28 }
41
+ : props.bannerKind === "validation"
42
+ ? { kind: "validation", message: "Price must be a positive number." }
43
+ : undefined })] }));
44
+ }
45
+ export const Round1PreFill = {
46
+ args: { open: true, onClose: () => { }, offerId: "o", round: 1, allowedIncoterms: [], baselineTerms: baseTerms, initialMatchEvaluation: strong, onSubmit: async () => { }, onEvaluateDraft: () => strong },
47
+ render: () => _jsx(Wrapper, { round: 1, previousTerms: baseTerms }),
48
+ };
49
+ export const Round2PreFill = {
50
+ args: { open: true, onClose: () => { }, offerId: "o", round: 2, allowedIncoterms: [], baselineTerms: baseTerms, initialMatchEvaluation: strong, onSubmit: async () => { }, onEvaluateDraft: () => strong },
51
+ render: () => _jsx(Wrapper, { round: 2, previousTerms: { ...baseTerms, price: 3.95 } }),
52
+ };
53
+ export const MidComposeDiffBanner = {
54
+ args: { open: true, onClose: () => { }, offerId: "o", round: 2, allowedIncoterms: [], baselineTerms: baseTerms, initialMatchEvaluation: strong, onSubmit: async () => { }, onEvaluateDraft: () => strong },
55
+ render: () => _jsx(Wrapper, { round: 2, previousTerms: baseTerms, bannerKind: "incoming_counter" }),
56
+ };
57
+ export const RoundCap409 = {
58
+ args: { open: true, onClose: () => { }, offerId: "o", round: 4, allowedIncoterms: [], baselineTerms: baseTerms, initialMatchEvaluation: strong, onSubmit: async () => { }, onEvaluateDraft: () => strong },
59
+ render: () => _jsx(Wrapper, { round: 4, previousTerms: baseTerms, bannerKind: "round_cap" }),
60
+ };
61
+ export const VersionConflict409 = {
62
+ args: { open: true, onClose: () => { }, offerId: "o", round: 2, allowedIncoterms: [], baselineTerms: baseTerms, initialMatchEvaluation: strong, onSubmit: async () => { }, onEvaluateDraft: () => strong },
63
+ render: () => _jsx(Wrapper, { round: 2, previousTerms: baseTerms, bannerKind: "version_conflict" }),
64
+ };
65
+ export const RateLimit429 = {
66
+ args: { open: true, onClose: () => { }, offerId: "o", round: 2, allowedIncoterms: [], baselineTerms: baseTerms, initialMatchEvaluation: strong, onSubmit: async () => { }, onEvaluateDraft: () => strong },
67
+ render: () => _jsx(Wrapper, { round: 2, previousTerms: baseTerms, bannerKind: "rate_limit" }),
68
+ };
69
+ export const ValidationError = {
70
+ args: { open: true, onClose: () => { }, offerId: "o", round: 2, allowedIncoterms: [], baselineTerms: baseTerms, initialMatchEvaluation: strong, onSubmit: async () => { }, onEvaluateDraft: () => strong },
71
+ render: () => _jsx(Wrapper, { round: 2, previousTerms: baseTerms, bannerKind: "validation" }),
72
+ };
73
+ function FocusTrapAndReturnDemo() {
74
+ const [open, setOpen] = useState(false);
75
+ return (_jsxs("div", { className: "relative min-h-screen bg-muted/20 p-8", children: [_jsx(Button, { "data-testid": "opener", onClick: () => setOpen(true), children: "Open counter composer" }), _jsx(CounterSlideOver, { open: open, onClose: () => setOpen(false), offerId: "offer-1", round: 2, allowedIncoterms: ["FOB", "CIF", "EXW"], baselineTerms: baseTerms, initialMatchEvaluation: strong, onSubmit: async () => { }, onEvaluateDraft: (draft) => ({
76
+ ...strong,
77
+ // Regrade headline based on draft.price so aria-live has
78
+ // something new to announce.
79
+ headline: draft.price > baseTerms.price ? "partial" : "strong",
80
+ headlineSummary: draft.price > baseTerms.price
81
+ ? `Price now ${draft.price.toFixed(2)} — above baseline`
82
+ : "All requirements met",
83
+ }) })] }));
84
+ }
85
+ // Blocker B2 — focus-trap + focus-return + aria-live announcement. Prose
86
+ // claims in the plan are not enforceable — a play function is. Verifies:
87
+ // (a) on open, document.activeElement === priceInputRef.current,
88
+ // (b) Tab cycles through dialog-internal focusable controls only (stays in),
89
+ // (c) close returns focus to the opener button,
90
+ // (d) typing into the price input updates MatchPreview's aria-live region.
91
+ export const FocusTrapAndReturn = {
92
+ name: "Focus trap + return + aria-live",
93
+ args: {
94
+ open: false, // start closed so we can test open/close transitions
95
+ onClose: () => { },
96
+ offerId: "o",
97
+ round: 2,
98
+ allowedIncoterms: ["FOB", "CIF", "EXW"],
99
+ baselineTerms: baseTerms,
100
+ initialMatchEvaluation: strong,
101
+ onSubmit: async () => { },
102
+ onEvaluateDraft: () => strong,
103
+ },
104
+ render: () => _jsx(FocusTrapAndReturnDemo, {}),
105
+ play: async ({ canvasElement, step }) => {
106
+ const { within, userEvent } = await import("storybook/test");
107
+ const { expect } = await import("vitest");
108
+ const canvas = within(canvasElement);
109
+ let opener;
110
+ await step("(a) Open dialog; initial focus lands on the price input", async () => {
111
+ opener = canvas.getByTestId("opener");
112
+ await userEvent.click(opener);
113
+ // Headless UI renders into a portal — query the whole document.
114
+ const priceInput = await within(document.body).findByLabelText(/Price \(/);
115
+ await expect(document.activeElement).toBe(priceInput);
116
+ });
117
+ await step("(b) Tab cycles through dialog-internal focusable controls only", async () => {
118
+ const initial = document.activeElement;
119
+ const dialogRoot = initial.closest('[role="dialog"]');
120
+ // Cycle Tab several times; after each press, the active element must
121
+ // still be inside the dialog root (focus trap honours).
122
+ for (let i = 0; i < 12; i++) {
123
+ await userEvent.tab();
124
+ const active = document.activeElement;
125
+ await expect(dialogRoot.contains(active)).toBe(true);
126
+ }
127
+ });
128
+ await step("(d) Typing into price input updates MatchPreview aria-live", async () => {
129
+ // MatchPreview has role="status" + aria-live="polite" in Task 3.7.
130
+ // Its text should include the new headline summary after regrade.
131
+ const priceInput = within(document.body).getByLabelText(/Price \(/);
132
+ await userEvent.clear(priceInput);
133
+ await userEvent.type(priceInput, "5.00");
134
+ const status = await within(document.body).findByRole("status");
135
+ await expect(status).toHaveTextContent(/Price now 5\.00/i);
136
+ });
137
+ await step("(c) Close dialog; focus returns to the opener button", async () => {
138
+ await userEvent.keyboard("{Escape}");
139
+ await expect(document.activeElement).toBe(opener);
140
+ });
141
+ },
142
+ };
143
+ // The fixture that the backend evaluator MUST emit for the `draft` below.
144
+ // Keep this literal — do not derive from live data. Update deliberately.
145
+ const CONTRACT_EXPECTED_EVALUATION = {
146
+ headline: "partial",
147
+ headlineSummary: "Price is 4.7% over ceiling",
148
+ criteria: [
149
+ {
150
+ id: "price",
151
+ label: "Price",
152
+ state: "partial",
153
+ offered: 4.4,
154
+ required: 4.2,
155
+ reason: "4.7% above ceiling",
156
+ viewerAdvantage: "improved",
157
+ },
158
+ {
159
+ id: "volume",
160
+ label: "Volume",
161
+ state: "ok",
162
+ offered: 20000,
163
+ required: 20000,
164
+ viewerAdvantage: "neutral",
165
+ },
166
+ ],
167
+ freeTextFields: [],
168
+ hiddenReasons: [],
169
+ };
170
+ function MatchEvaluatorContractFixtureDemo() {
171
+ const [open, setOpen] = useState(true);
172
+ const [lastDraft, setLastDraft] = useState(null);
173
+ const [lastEvaluation, setLastEvaluation] = useState(null);
174
+ return (_jsxs("div", { className: "relative min-h-screen bg-muted/20 p-8", children: [_jsx(CounterSlideOver, { open: open, onClose: () => setOpen(false), offerId: "offer-fixture", round: 2, allowedIncoterms: ["FOB", "CIF", "EXW"], baselineTerms: { ...baseTerms, price: 4.4 }, initialMatchEvaluation: CONTRACT_EXPECTED_EVALUATION, onSubmit: async () => { }, onEvaluateDraft: (draft) => {
175
+ setLastDraft({ ...baseTerms, price: draft.price, volume: draft.volume });
176
+ setLastEvaluation(CONTRACT_EXPECTED_EVALUATION);
177
+ return CONTRACT_EXPECTED_EVALUATION;
178
+ } }), _jsx("pre", { "data-testid": "contract-fixture-json", className: "mt-4 rounded-lg border border-border/60 bg-card p-3 text-xs", children: JSON.stringify({ draft: lastDraft, evaluation: lastEvaluation, expected: CONTRACT_EXPECTED_EVALUATION }, null, 2) })] }));
179
+ }
180
+ // Blocker B4 — contract test: the prop `onEvaluateDraft(draft)` passed into
181
+ // CounterSlideOver must produce a MatchEvaluation structurally identical to
182
+ // the real backend evaluator's response. This story pins a fixture so any
183
+ // drift in the shape (field names, nullability, viewerAdvantage per
184
+ // criterion) breaks the story. When Plan 2 ships the real evaluator, a CI
185
+ // contract test should import THIS fixture and assert the backend emits the
186
+ // same JSON for the same input. Until then, the fixture is the contract.
187
+ export const MatchEvaluatorContractFixture = {
188
+ name: "Contract fixture — onEvaluateDraft shape",
189
+ args: {
190
+ open: true,
191
+ onClose: () => { },
192
+ offerId: "offer-fixture",
193
+ round: 2,
194
+ allowedIncoterms: ["FOB", "CIF", "EXW"],
195
+ baselineTerms: baseTerms,
196
+ initialMatchEvaluation: strong,
197
+ onSubmit: async () => { },
198
+ onEvaluateDraft: () => strong,
199
+ },
200
+ render: () => _jsx(MatchEvaluatorContractFixtureDemo, {}),
201
+ play: async ({ canvasElement, step }) => {
202
+ const { within } = await import("storybook/test");
203
+ const { expect } = await import("vitest");
204
+ const canvas = within(canvasElement);
205
+ await step("evaluation is structurally identical to the expected fixture", async () => {
206
+ // The JSON blob contains both `evaluation` (what onEvaluateDraft
207
+ // returned) and `expected` (the hard-coded backend response). If the
208
+ // two diverge, the story fails — flagging drift the moment the consumer
209
+ // wires the real backend.
210
+ const pre = canvas.getByTestId("contract-fixture-json");
211
+ const parsed = JSON.parse(pre.textContent ?? "{}");
212
+ await expect(parsed.evaluation).toEqual(parsed.expected);
213
+ });
214
+ },
215
+ };
216
+ // Responsive coverage per spec §5.5 — CounterSlideOver ships a bottom-
217
+ // sheet variant below 768px. Rendering at `mobile1` (360×640) catches
218
+ // layout-shift + focus-trap regressions on narrow viewports.
219
+ export const MobileBottomSheet = {
220
+ name: "Responsive — mobile bottom sheet",
221
+ args: {
222
+ open: true,
223
+ onClose: () => { },
224
+ offerId: "o",
225
+ round: 2,
226
+ allowedIncoterms: ["FOB", "CIF", "EXW"],
227
+ baselineTerms: baseTerms,
228
+ initialMatchEvaluation: strong,
229
+ onSubmit: async () => { },
230
+ onEvaluateDraft: () => strong,
231
+ },
232
+ parameters: { viewport: { defaultViewport: "mobile1" } },
233
+ render: () => _jsx(Wrapper, { round: 2, previousTerms: baseTerms }),
234
+ };
235
+ //# sourceMappingURL=counter-slide-over.stories.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"counter-slide-over.stories.js","sourceRoot":"","sources":["../../src/offer/counter-slide-over.stories.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAEjC,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AACxD,OAAO,EAAE,YAAY,IAAI,MAAM,EAAE,MAAM,6BAA6B,CAAC;AAGrE,MAAM,IAAI,GAAG;IACX,KAAK,EAAE,wBAAwB;IAC/B,SAAS,EAAE,gBAAgB;IAC3B,IAAI,EAAE,CAAC,UAAU,CAAC;IAClB,UAAU,EAAE,EAAE,MAAM,EAAE,YAAY,EAAE;CACG,CAAC;AAE1C,eAAe,IAAI,CAAC;AAGpB,MAAM,SAAS,GAAe;IAC5B,KAAK,EAAE,GAAG;IACV,QAAQ,EAAE,KAAK;IACf,MAAM,EAAE,KAAK;IACb,UAAU,EAAE,GAAG;IACf,SAAS,EAAE,KAAK;IAChB,YAAY,EAAE,QAAQ;IACtB,YAAY,EAAE,YAAY;IAC1B,UAAU,EAAE,YAAY;CACzB,CAAC;AAEF,MAAM,MAAM,GAAoB;IAC9B,QAAQ,EAAE,QAAQ;IAClB,eAAe,EAAE,sBAAsB;IACvC,QAAQ,EAAE;QACR,EAAE,EAAE,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,OAAO,EAAE,GAA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ACpF,iEAAiE;YACjE,qEAAqE;YACrE,wEAAwE;YACxE,0BAA0B;YAC1B,MAAM,GAAG,GAAG,MAAM,CAAC,WAAW,CAAC,uBAAuB,CAAC,CAAC;YACxD,MAAM,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,WAAW,IAAI,IAAI,CAAC,CAAC;YACnD,MAAM,MAAM,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;QAC3D,CAAC,CAAC,CAAC;IACL,CAAC;CACF,CAAC;AAEF,uEAAuE;AACvE,sEAAsE;AACtE,6DAA6D;AAC7D,MAAM,CAAC,MAAM,iBAAiB,GAAU;IACtC,IAAI,EAAE,kCAAkC;IACxC,IAAI,EAAE;QACJ,IAAI,EAAE,IAAI;QACV,OAAO,EAAE,GAAG,EAAE,GAAE,CAAC;QACjB,OAAO,EAAE,GAAG;QACZ,KAAK,EAAE,CAAC;QACR,gBAAgB,EAAE,CAAC,KAAK,EAAE,KAAK,EAAE,KAAK,CAAC;QACvC,aAAa,EAAE,SAAS;QACxB,sBAAsB,EAAE,MAAM;QAC9B,QAAQ,EAAE,KAAK,IAAI,EAAE,GAAE,CAAC;QACxB,eAAe,EAAE,GAAG,EAAE,CAAC,MAAM;KAC9B;IACD,UAAU,EAAE,EAAE,QAAQ,EAAE,EAAE,eAAe,EAAE,SAAS,EAAE,EAAE;IACxD,MAAM,EAAE,GAAG,EAAE,CAAC,KAAC,OAAO,IAAC,KAAK,EAAE,CAAC,EAAE,aAAa,EAAE,SAAS,GAAI;CAC9D,CAAC"}
@@ -0,0 +1,32 @@
1
+ import type { OfferFxInfo, OfferPresenceEntry, OfferTerms, Perspective, ViewerAdvantage } from "./types";
2
+ export type FactsCardStatus = "proposed" | "counter_pending" | "accepted" | "declined" | "expired" | "withdrawn";
3
+ export interface FactsCardProps {
4
+ status: FactsCardStatus;
5
+ round: number;
6
+ terms: OfferTerms;
7
+ /** Price at previous round, used to render strikethrough + delta chip. */
8
+ previousPrice?: number;
9
+ /**
10
+ * Viewer advantage for the **top-line price delta chip** only. Derived
11
+ * from the backend `price` criterion's own `viewerAdvantage` — NOT a
12
+ * page-wide constant (blocker B3, spec §11). Other per-field deltas are
13
+ * each rendered by their own per-criterion polarity upstream.
14
+ */
15
+ viewerAdvantage: ViewerAdvantage;
16
+ /**
17
+ * Viewer perspective. Used to compose aria-labels and by consumers that
18
+ * need to distinguish producer- vs importer-framed copy. Color polarity
19
+ * itself derives from `viewerAdvantage` (and per-criterion advantage in
20
+ * other cards), not from `perspective` directly (blocker B3).
21
+ */
22
+ perspective?: Perspective;
23
+ presence: OfferPresenceEntry[];
24
+ fx?: OfferFxInfo;
25
+ tenderCurrency?: string;
26
+ condensed?: boolean;
27
+ onExport?: () => void;
28
+ onToggleDetails?: () => void;
29
+ className?: string;
30
+ }
31
+ export declare function FactsCard({ status, round, terms, previousPrice, viewerAdvantage, perspective, presence, fx, tenderCurrency, condensed, onExport, onToggleDetails, className, }: FactsCardProps): import("react/jsx-runtime").JSX.Element;
32
+ //# sourceMappingURL=facts-card.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"facts-card.d.ts","sourceRoot":"","sources":["../../src/offer/facts-card.tsx"],"names":[],"mappings":"AAMA,OAAO,KAAK,EACV,WAAW,EACX,kBAAkB,EAClB,UAAU,EACV,WAAW,EACX,eAAe,EAChB,MAAM,SAAS,CAAC;AAEjB,MAAM,MAAM,eAAe,GACvB,UAAU,GACV,iBAAiB,GACjB,UAAU,GACV,UAAU,GACV,SAAS,GACT,WAAW,CAAC;AAEhB,MAAM,WAAW,cAAc;IAC7B,MAAM,EAAE,eAAe,CAAC;IACxB,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,UAAU,CAAC;IAClB,0EAA0E;IAC1E,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB;;;;;OAKG;IACH,eAAe,EAAE,eAAe,CAAC;IACjC;;;;;OAKG;IACH,WAAW,CAAC,EAAE,WAAW,CAAC;IAC1B,QAAQ,EAAE,kBAAkB,EAAE,CAAC;IAC/B,EAAE,CAAC,EAAE,WAAW,CAAC;IACjB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;IACtB,eAAe,CAAC,EAAE,MAAM,IAAI,CAAC;IAC7B,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAoDD,wBAAgB,SAAS,CAAC,EACxB,MAAM,EACN,KAAK,EACL,KAAK,EACL,aAAa,EACb,eAAe,EACf,WAAW,EACX,QAAQ,EACR,EAAE,EACF,cAAc,EACd,SAAiB,EACjB,QAAQ,EACR,eAAe,EACf,SAAS,GACV,EAAE,cAAc,2CAqJhB"}
@@ -0,0 +1,87 @@
1
+ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { useEffect, useMemo, useState } from "react";
3
+ import { ArrowDown, ArrowUp, ChevronDown, Printer } from "lucide-react";
4
+ import { formatDistanceToNowStrict } from "date-fns";
5
+ import { cn } from "../lib/utils";
6
+ import { ShadcnBadge as Badge } from "../components/shadcn-badge";
7
+ import { ShadcnButton as Button } from "../components/shadcn-button";
8
+ const STATUS_LABEL = {
9
+ proposed: "Proposed",
10
+ counter_pending: "Counter pending",
11
+ accepted: "Accepted",
12
+ declined: "Declined",
13
+ expired: "Expired",
14
+ withdrawn: "Withdrawn",
15
+ };
16
+ const ADVANTAGE_TONE = {
17
+ improved: "bg-emerald-100 text-emerald-800 dark:bg-emerald-900 dark:text-emerald-100",
18
+ neutral: "bg-muted text-foreground",
19
+ worsened: "bg-rose-100 text-rose-800 dark:bg-rose-900 dark:text-rose-100",
20
+ };
21
+ function fmtMoney(amount, currency) {
22
+ try {
23
+ return new Intl.NumberFormat("en-US", {
24
+ style: "currency",
25
+ currency,
26
+ maximumFractionDigits: 2,
27
+ }).format(amount);
28
+ }
29
+ catch {
30
+ return `${amount.toFixed(2)} ${currency}`;
31
+ }
32
+ }
33
+ /**
34
+ * Spec §19: Composes the screen-reader announcement sentence.
35
+ * Defined outside the component so it is a stable reference and does not
36
+ * need to be listed as a useEffect dependency.
37
+ */
38
+ function buildAnnouncement(p, s, r, price, currency, dl) {
39
+ const parts = [];
40
+ if (p)
41
+ parts.push(`${p === "producer" ? "Producer" : "Importer"} view`);
42
+ parts.push(STATUS_LABEL[s]);
43
+ parts.push(`Round ${r}`);
44
+ parts.push(`Price ${fmtMoney(price, currency)}`);
45
+ if (dl)
46
+ parts.push(`delta ${dl}`);
47
+ return parts.join(" · ");
48
+ }
49
+ export function FactsCard({ status, round, terms, previousPrice, viewerAdvantage, perspective, presence, fx, tenderCurrency, condensed = false, onExport, onToggleDetails, className, }) {
50
+ const validityText = useMemo(() => {
51
+ if (!terms.validUntil)
52
+ return null;
53
+ if (status !== "proposed" && status !== "counter_pending")
54
+ return null;
55
+ const d = new Date(terms.validUntil);
56
+ if (Number.isNaN(d.getTime()))
57
+ return null;
58
+ return `Valid for ${formatDistanceToNowStrict(d)}`;
59
+ }, [terms.validUntil, status]);
60
+ const delta = previousPrice != null ? terms.price - previousPrice : 0;
61
+ const deltaLabel = delta === 0
62
+ ? null
63
+ : `${delta > 0 ? "+" : ""}${fmtMoney(delta, terms.currency)}`;
64
+ /**
65
+ * Spec §19: `aria-live="polite"` updates must be debounced at 1s to
66
+ * avoid spamming screen readers. We store the composed announcement string
67
+ * in state and update it 1s after the underlying values settle — the
68
+ * visible price still updates immediately; only the ANNOUNCED copy is
69
+ * debounced.
70
+ */
71
+ const [liveAnnouncement, setLiveAnnouncement] = useState(() => buildAnnouncement(perspective, status, round, terms.price, terms.currency, deltaLabel));
72
+ useEffect(() => {
73
+ // Debounce at 1s so screen-reader announcements don't spam on rapid updates (spec §19).
74
+ const h = setTimeout(() => setLiveAnnouncement(buildAnnouncement(perspective, status, round, terms.price, terms.currency, deltaLabel)), 1000);
75
+ return () => clearTimeout(h);
76
+ }, [perspective, status, round, terms.price, terms.currency, deltaLabel]);
77
+ return (_jsxs("div", { role: "region", "aria-label": "Offer key facts",
78
+ // Note: the outer region is NOT aria-live. Making the whole card live
79
+ // causes screen readers to re-announce unrelated elements on every
80
+ // state change. Spec §19 mandates debounced announcements — routed
81
+ // through the dedicated <div role="status"> below.
82
+ className: cn("sticky top-0 z-20 rounded-2xl border border-border/60 bg-card/95 p-4 shadow-sm backdrop-blur", condensed ? "max-h-18" : "max-h-30", className), children: [_jsx("div", { role: "status", "aria-live": "polite", className: "sr-only", children: liveAnnouncement }), _jsxs("div", { className: "flex flex-wrap items-center gap-3", children: [_jsxs(Badge, { variant: "ghost", className: "status-pill", children: [STATUS_LABEL[status], (status === "counter_pending" || status === "proposed") && (_jsxs(_Fragment, { children: [" \u00B7 R", round] }))] }), validityText && (_jsx(Badge, { variant: "ghost", className: "text-xs", children: validityText })), _jsxs("div", { className: "flex items-baseline gap-2", children: [previousPrice != null && previousPrice !== terms.price && (_jsx("span", { className: "text-sm/6 text-muted-foreground line-through", children: fmtMoney(previousPrice, terms.currency) })), _jsx("span", { className: "text-xl font-semibold", children: fmtMoney(terms.price, terms.currency) }), deltaLabel && (_jsxs("span", { "aria-label": `Price ${delta > 0 ? "increased" : "decreased"} by ${fmtMoney(Math.abs(delta), terms.currency)}`, className: cn(
83
+ // Direction icon + color — not color-only. Colorblind
84
+ // sighted users must see direction via shape, not hue.
85
+ "inline-flex items-center gap-1 rounded-full px-2 py-0.5 text-xs font-medium", ADVANTAGE_TONE[viewerAdvantage]), children: [delta > 0 ? (_jsx(ArrowUp, { "aria-hidden": true, className: "size-3" })) : (_jsx(ArrowDown, { "aria-hidden": true, className: "size-3" })), deltaLabel] }))] }), !condensed && (_jsxs(_Fragment, { children: [_jsxs("div", { className: "text-sm/6 text-muted-foreground", children: [terms.volume.toLocaleString(), " ", terms.volumeUnit ?? "L", " \u00B7 total ", fmtMoney(terms.price * terms.volume, terms.currency)] }), _jsx("div", { className: "text-xs text-muted-foreground", children: [terms.incoterms, terms.paymentTerms].filter(Boolean).join(" · ") })] })), _jsxs("div", { className: "ml-auto flex items-center gap-2", children: [presence.map((p) => (_jsxs(Badge, { variant: "ghost", className: "text-xs", children: [p.orgRole === "producer" ? "Producer" : "Importer", " ", p.typing ? "typing" : p.state] }, p.orgRole))), onExport && (_jsxs(Button, { variant: "ghost", size: "sm", onClick: onExport, "aria-label": "Export offer as PDF", children: [_jsx(Printer, { "aria-hidden": true, className: "size-4" }), "Export"] }))] })] }), fx && tenderCurrency && (_jsxs("div", { className: "mt-1 text-xs text-muted-foreground", children: ["\u2248 ", fmtMoney(terms.price * fx.rate, tenderCurrency), " @ ", fx.rate, fx.stale && (_jsx("span", { className: "ml-1 text-amber-700", children: "(cached, may be stale)" }))] })), condensed && onToggleDetails && (_jsxs("button", { type: "button", onClick: onToggleDetails, className: "absolute right-4 top-4 flex items-center gap-1 text-xs text-muted-foreground", "aria-label": "Show condensed details", children: ["Show details", _jsx(ChevronDown, { "aria-hidden": true, className: "size-3" })] }))] }));
86
+ }
87
+ //# sourceMappingURL=facts-card.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"facts-card.js","sourceRoot":"","sources":["../../src/offer/facts-card.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACrD,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,WAAW,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACxE,OAAO,EAAE,yBAAyB,EAAE,MAAM,UAAU,CAAC;AACrD,OAAO,EAAE,EAAE,EAAE,MAAM,cAAc,CAAC;AAClC,OAAO,EAAE,WAAW,IAAI,KAAK,EAAE,MAAM,4BAA4B,CAAC;AAClE,OAAO,EAAE,YAAY,IAAI,MAAM,EAAE,MAAM,6BAA6B,CAAC;AA8CrE,MAAM,YAAY,GAAoC;IACpD,QAAQ,EAAE,UAAU;IAC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KAAK,IAAiB,OAAO,EAAC,OAAO,EAAC,SAAS,EAAC,SAAS,aACvD,CAAC,CAAC,OAAO,KAAK,UAAU,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,UAAU,EAAE,GAAG,EACvD,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,KAFpB,CAAC,CAAC,OAAO,CAGb,CACT,CAAC,EACD,QAAQ,IAAI,CACX,MAAC,MAAM,IACL,OAAO,EAAC,OAAO,EACf,IAAI,EAAC,IAAI,EACT,OAAO,EAAE,QAAQ,gBACN,qBAAqB,aAEhC,KAAC,OAAO,yBAAa,SAAS,EAAC,QAAQ,GAAG,cAEnC,CACV,IACG,IACF,EACL,EAAE,IAAI,cAAc,IAAI,CACvB,eAAK,SAAS,EAAC,oCAAoC,wBAC9C,QAAQ,CAAC,KAAK,CAAC,KAAK,GAAG,EAAE,CAAC,IAAI,EAAE,cAAc,CAAC,SAAK,EAAE,CAAC,IAAI,EAC7D,EAAE,CAAC,KAAK,IAAI,CACX,eAAM,SAAS,EAAC,qBAAqB,uCAA8B,CACpE,IACG,CACP,EACA,SAAS,IAAI,eAAe,IAAI,CAC/B,kBACE,IAAI,EAAC,QAAQ,EACb,OAAO,EAAE,eAAe,EACxB,SAAS,EAAC,8EAA8E,gBAC7E,wBAAwB,6BAGnC,KAAC,WAAW,yBAAa,SAAS,EAAC,QAAQ,GAAG,IACvC,CACV,IACG,CACP,CAAC;AACJ,CAAC"}
@@ -0,0 +1,25 @@
1
+ import type { StoryObj } from "@storybook/react-vite";
2
+ import { FactsCard } from "./facts-card";
3
+ declare const meta: {
4
+ title: string;
5
+ component: typeof FactsCard;
6
+ tags: string[];
7
+ parameters: {
8
+ layout: string;
9
+ };
10
+ };
11
+ export default meta;
12
+ type Story = StoryObj<typeof meta>;
13
+ export declare const Proposed: Story;
14
+ export declare const CounterPending: Story;
15
+ export declare const Accepted: Story;
16
+ export declare const Declined: Story;
17
+ export declare const Expired: Story;
18
+ export declare const Withdrawn: Story;
19
+ export declare const WithFxConversion: Story;
20
+ export declare const WithStaleFx: Story;
21
+ export declare const CondensedMobile: Story;
22
+ export declare const ResponsiveSmall: Story;
23
+ export declare const DebouncedAriaLive: Story;
24
+ export declare const PrintMedia: Story;
25
+ //# sourceMappingURL=facts-card.stories.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"facts-card.stories.d.ts","sourceRoot":"","sources":["../../src/offer/facts-card.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAQ,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAEzC,QAAA,MAAM,IAAI;;;;;;;CAKwB,CAAC;AAEnC,eAAe,IAAI,CAAC;AACpB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,IAAI,CAAC,CAAC;AAYnC,eAAO,MAAM,QAAQ,EAAE,KAYtB,CAAC;AAEF,eAAO,MAAM,cAAc,EAAE,KAa5B,CAAC;AAEF,eAAO,MAAM,QAAQ,EAAE,KAStB,CAAC;AAEF,eAAO,MAAM,QAAQ,EAAE,KAEtB,CAAC;AAEF,eAAO,MAAM,OAAO,EAAE,KAErB,CAAC;AAEF,eAAO,MAAM,SAAS,EAAE,KAEvB,CAAC;AAEF,eAAO,MAAM,gBAAgB,EAAE,KAiB9B,CAAC;AAEF,eAAO,MAAM,WAAW,EAAE,KAkBzB,CAAC;AAEF,eAAO,MAAM,eAAe,EAAE,KAa7B,CAAC;AAKF,eAAO,MAAM,eAAe,EAAE,KAU7B,CAAC;AAKF,eAAO,MAAM,iBAAiB,EAAE,KAyB/B,CAAC;AAKF,eAAO,MAAM,UAAU,EAAE,KAgBxB,CAAC"}