@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,76 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { describe, it, expect, vi } from "vitest";
3
+ import { render, screen, waitFor } from "@testing-library/react";
4
+ import userEvent from "@testing-library/user-event";
5
+ import { StepTenderBasics } from "../step-tender-basics";
6
+ describe("StepTenderBasics", () => {
7
+ it("renders name, targetCountry, instructions inputs", () => {
8
+ render(_jsx(StepTenderBasics, { onChange: () => { } }));
9
+ expect(screen.getByLabelText(/tender name/i)).toBeInTheDocument();
10
+ expect(screen.getByLabelText(/target country/i)).toBeInTheDocument();
11
+ expect(screen.getByLabelText(/instructions/i)).toBeInTheDocument();
12
+ });
13
+ it("typing in name input emits onChange with the new name", async () => {
14
+ const user = userEvent.setup();
15
+ const onChange = vi.fn();
16
+ render(_jsx(StepTenderBasics, { onChange: onChange }));
17
+ const nameInput = screen.getByLabelText(/tender name/i);
18
+ await user.type(nameInput, "Q2 RFP");
19
+ // After typing, most recent onChange should carry name: "Q2 RFP"
20
+ await waitFor(() => {
21
+ const lastCall = onChange.mock.calls.at(-1)?.[0];
22
+ expect(lastCall?.name).toBe("Q2 RFP");
23
+ });
24
+ });
25
+ it("uppercases targetCountry input from 'se' to 'SE'", async () => {
26
+ const user = userEvent.setup();
27
+ const onChange = vi.fn();
28
+ render(_jsx(StepTenderBasics, { onChange: onChange }));
29
+ const countryInput = screen.getByLabelText(/target country/i);
30
+ await user.type(countryInput, "se");
31
+ // Either the input value becomes "SE" OR the onChange emits targetCountry: "SE"
32
+ await waitFor(() => {
33
+ const lastCall = onChange.mock.calls.at(-1)?.[0];
34
+ expect(lastCall?.targetCountry).toBe("SE");
35
+ });
36
+ });
37
+ it("surfaces 'min 2 chars' error when name is too short after blur", async () => {
38
+ const user = userEvent.setup();
39
+ render(_jsx(StepTenderBasics, { onChange: () => { } }));
40
+ const nameInput = screen.getByLabelText(/tender name/i);
41
+ await user.type(nameInput, "a");
42
+ await user.tab(); // blur
43
+ await waitFor(() => {
44
+ expect(screen.getByText(/min 2 chars/i)).toBeInTheDocument();
45
+ });
46
+ });
47
+ it("fires onValidityChange(true) once all required fields are valid + blurred", async () => {
48
+ const user = userEvent.setup();
49
+ const onValidityChange = vi.fn();
50
+ render(_jsx(StepTenderBasics, { onChange: () => { }, onValidityChange: onValidityChange }));
51
+ await user.type(screen.getByLabelText(/tender name/i), "My Tender");
52
+ await user.type(screen.getByLabelText(/target country/i), "SE");
53
+ await user.tab(); // blur final field
54
+ await waitFor(() => {
55
+ expect(onValidityChange).toHaveBeenCalledWith(true);
56
+ });
57
+ });
58
+ it("initialValues prefills the form fields", () => {
59
+ render(_jsx(StepTenderBasics, { initialValues: { name: "Existing", targetCountry: "NO", instructions: "Already here" }, onChange: () => { } }));
60
+ expect(screen.getByLabelText(/tender name/i)).toHaveValue("Existing");
61
+ expect(screen.getByLabelText(/target country/i)).toHaveValue("NO");
62
+ expect(screen.getByLabelText(/instructions/i)).toHaveValue("Already here");
63
+ });
64
+ it("does NOT submit the form on Enter (keeps the parent wizard in control via 'Continue' button)", async () => {
65
+ const user = userEvent.setup();
66
+ const onSubmit = vi.fn();
67
+ // Render with an explicit <form onSubmit> wrapper — StepTenderBasics's inner form should call e.preventDefault().
68
+ render(_jsx("form", { onSubmit: onSubmit, children: _jsx(StepTenderBasics, { onChange: () => { } }) }));
69
+ const nameInput = screen.getByLabelText(/tender name/i);
70
+ await user.type(nameInput, "Test{Enter}");
71
+ // If the form submits, onSubmit fires. StepTenderBasics uses its own inner <form onSubmit={preventDefault}>,
72
+ // so the outer onSubmit should NOT fire.
73
+ expect(onSubmit).not.toHaveBeenCalled();
74
+ });
75
+ });
76
+ //# sourceMappingURL=step-tender-basics.test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"step-tender-basics.test.js","sourceRoot":"","sources":["../../../../src/opportunities/wizard/__tests__/step-tender-basics.test.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,QAAQ,CAAC;AAClD,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AACjE,OAAO,SAAS,MAAM,6BAA6B,CAAC;AACpD,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAEzD,QAAQ,CAAC,kBAAkB,EAAE,GAAG,EAAE;IAChC,EAAE,CAAC,kDAAkD,EAAE,GAAG,EAAE;QAC1D,MAAM,CAAC,KAAC,gBAAgB,IAAC,QAAQ,EAAE,GAAG,EAAE,GAAE,CAAC,GAAI,CAAC,CAAC;QACjD,MAAM,CAAC,MAAM,CAAC,cAAc,CAAC,cAAc,CAAC,CAAC,CAAC,iBAAiB,EAAE,CAAC;QAClE,MAAM,CAAC,MAAM,CAAC,cAAc,CAAC,iBAAiB,CAAC,CAAC,CAAC,iBAAiB,EAAE,CAAC;QACrE,MAAM,CAAC,MAAM,CAAC,cAAc,CAAC,eAAe,CAAC,CAAC,CAAC,iBAAiB,EAAE,CAAC;IACrE,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,uDAAuD,EAAE,KAAK,IAAI,EAAE;QACrE,MAAM,IAAI,GAAG,SAAS,CAAC,KAAK,EAAE,CAAC;QAC/B,MAAM,QAAQ,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@@
1
+ {"version":3,"file":"use-wizard-draft.test.d.ts","sourceRoot":"","sources":["../../../../src/opportunities/wizard/__tests__/use-wizard-draft.test.tsx"],"names":[],"mappings":""}
@@ -0,0 +1,192 @@
1
+ import { describe, it, expect, vi, beforeEach, afterEach } from "vitest";
2
+ import { renderHook, act, waitFor } from "@testing-library/react";
3
+ import { useWizardDraft } from "../use-wizard-draft";
4
+ // Node 25+ provides a stub `localStorage` on the global scope that has no methods
5
+ // and shadows jsdom's implementation. Install a working in-memory polyfill before
6
+ // each test so the hook has a real Storage to write to.
7
+ function installMemoryLocalStorage() {
8
+ const store = new Map();
9
+ const memLocalStorage = {
10
+ get length() { return store.size; },
11
+ clear() { store.clear(); },
12
+ getItem(key) { return store.has(key) ? store.get(key) : null; },
13
+ key(index) { return Array.from(store.keys())[index] ?? null; },
14
+ removeItem(key) { store.delete(key); },
15
+ setItem(key, value) { store.set(key, String(value)); },
16
+ };
17
+ Object.defineProperty(globalThis, "localStorage", {
18
+ value: memLocalStorage,
19
+ configurable: true,
20
+ writable: true,
21
+ });
22
+ Object.defineProperty(window, "localStorage", {
23
+ value: memLocalStorage,
24
+ configurable: true,
25
+ writable: true,
26
+ });
27
+ }
28
+ describe("useWizardDraft", () => {
29
+ beforeEach(() => {
30
+ installMemoryLocalStorage();
31
+ vi.useFakeTimers({ shouldAdvanceTime: true });
32
+ });
33
+ afterEach(() => {
34
+ vi.useRealTimers();
35
+ vi.unstubAllGlobals();
36
+ });
37
+ it("starts in idle phase when no draftId is provided", () => {
38
+ const create = vi.fn();
39
+ const patch = vi.fn();
40
+ const { result } = renderHook(() => useWizardDraft({ create, patch }));
41
+ expect(result.current.state.phase).toBe("idle");
42
+ });
43
+ it("transitions idle → creating → created on first applyChange", async () => {
44
+ const create = vi.fn().mockResolvedValue({ id: "draft-1", version: 1 });
45
+ const patch = vi.fn().mockResolvedValue({ version: 2 });
46
+ const { result } = renderHook(() => useWizardDraft({ create, patch }));
47
+ act(() => { result.current.applyChange({ name: "My Tender" }); });
48
+ expect(result.current.state.phase).toBe("creating");
49
+ await waitFor(() => expect(result.current.state.phase).toBe("created"));
50
+ });
51
+ it("coalesces rapid changes during creating phase into one PATCH after POST resolves", async () => {
52
+ let resolveCreate = () => { };
53
+ const create = vi.fn(() => new Promise(r => { resolveCreate = r; }));
54
+ const patch = vi.fn().mockResolvedValue({ version: 2 });
55
+ const { result } = renderHook(() => useWizardDraft({ create, patch, autosaveDebounceMs: 100 }));
56
+ act(() => { result.current.applyChange({ name: "First" }); });
57
+ expect(create).toHaveBeenCalledTimes(1);
58
+ act(() => { result.current.applyChange({ name: "Second" }); });
59
+ act(() => { result.current.applyChange({ name: "Third" }); });
60
+ expect(create).toHaveBeenCalledTimes(1); // still one POST in flight
61
+ await act(async () => { resolveCreate({ id: "draft-1", version: 1 }); await Promise.resolve(); });
62
+ act(() => { vi.advanceTimersByTime(100); });
63
+ await waitFor(() => expect(patch).toHaveBeenCalled());
64
+ // Merged PATCH payload should have name: "Third"
65
+ expect(patch).toHaveBeenCalledWith("draft-1", expect.objectContaining({ name: "Third" }), expect.any(Number));
66
+ });
67
+ it("snapshots to localStorage on every applyChange when in created phase", () => {
68
+ const create = vi.fn().mockResolvedValue({ id: "draft-1", version: 1 });
69
+ const patch = vi.fn();
70
+ const { result } = renderHook(() => useWizardDraft({ create, patch, initialDraftId: "draft-1" }));
71
+ act(() => { result.current.applyChange({ name: "Hello" }); });
72
+ const stored = localStorage.getItem("wizard-draft-draft-1");
73
+ expect(stored).toBeTruthy();
74
+ const parsed = JSON.parse(stored);
75
+ expect(parsed.draft.name).toBe("Hello");
76
+ });
77
+ it("LRU-evicts oldest drafts when more than 5 exist in localStorage", () => {
78
+ for (let i = 0; i < 5; i++) {
79
+ localStorage.setItem(`wizard-draft-d${i}`, JSON.stringify({ draft: { id: `d${i}` }, updatedAt: Date.now() - (5 - i) * 1000 }));
80
+ }
81
+ const create = vi.fn().mockResolvedValue({ id: "d-new", version: 1 });
82
+ const patch = vi.fn();
83
+ const { result } = renderHook(() => useWizardDraft({ create, patch, initialDraftId: "d-new" }));
84
+ act(() => { result.current.applyChange({ name: "new" }); });
85
+ // Oldest d0 should have been evicted.
86
+ expect(localStorage.getItem("wizard-draft-d0")).toBeNull();
87
+ expect(localStorage.getItem("wizard-draft-d-new")).toBeTruthy();
88
+ });
89
+ it("surfaces 409 conflict via conflictDetected + does NOT retry with backoff", async () => {
90
+ const create = vi.fn().mockResolvedValue({ id: "d-1", version: 1 });
91
+ const patch = vi.fn().mockRejectedValue(Object.assign(new Error("conflict"), { status: 409 }));
92
+ const { result } = renderHook(() => useWizardDraft({ create, patch, initialDraftId: "d-1", autosaveDebounceMs: 10 }));
93
+ act(() => { result.current.applyChange({ name: "changed" }); });
94
+ act(() => { vi.advanceTimersByTime(10); });
95
+ await waitFor(() => expect(patch).toHaveBeenCalledTimes(1));
96
+ await waitFor(() => expect(result.current.conflictDetected).toBe(true));
97
+ // Advance past any backoff window — no second patch should fire.
98
+ act(() => { vi.advanceTimersByTime(60_000); });
99
+ expect(patch).toHaveBeenCalledTimes(1);
100
+ });
101
+ it("acceptServerConflict clears conflictDetected + replaces draft + bumps version", async () => {
102
+ const create = vi.fn().mockResolvedValue({ id: "d-1", version: 1 });
103
+ const patch = vi.fn().mockRejectedValue(Object.assign(new Error("conflict"), { status: 409 }));
104
+ const { result } = renderHook(() => useWizardDraft({ create, patch, initialDraftId: "d-1", autosaveDebounceMs: 10 }));
105
+ act(() => { result.current.applyChange({ name: "local" }); });
106
+ act(() => { vi.advanceTimersByTime(10); });
107
+ await waitFor(() => expect(result.current.conflictDetected).toBe(true));
108
+ act(() => { result.current.acceptServerConflict({ name: "server" }, 5); });
109
+ await waitFor(() => expect(result.current.conflictDetected).toBe(false));
110
+ expect(result.current.draft.name).toBe("server");
111
+ expect(result.current.state.phase === "created" && result.current.state.version).toBe(5);
112
+ });
113
+ it("exponential backoff progresses through 1s → 2s → 4s → 8s → 16s → localOnly", async () => {
114
+ const create = vi.fn().mockResolvedValue({ id: "d-1", version: 1 });
115
+ const patch = vi.fn().mockRejectedValue(new Error("5xx"));
116
+ const { result } = renderHook(() => useWizardDraft({ create, patch, initialDraftId: "d-1", autosaveDebounceMs: 10 }));
117
+ act(() => { result.current.applyChange({ name: "x" }); });
118
+ act(() => { vi.advanceTimersByTime(10); });
119
+ await waitFor(() => expect(patch).toHaveBeenCalledTimes(1));
120
+ const delays = [1000, 2000, 4000, 8000, 16000];
121
+ for (let i = 0; i < delays.length; i++) {
122
+ act(() => { vi.advanceTimersByTime(delays[i]); });
123
+ await waitFor(() => expect(patch).toHaveBeenCalledTimes(i + 2));
124
+ }
125
+ // One more tick → should stop retrying and flip to localOnly.
126
+ act(() => { vi.advanceTimersByTime(32_000); });
127
+ await waitFor(() => expect(result.current.localOnly).toBe(true));
128
+ });
129
+ it("flush() is called on beforeunload and writes to localStorage", () => {
130
+ const create = vi.fn().mockResolvedValue({ id: "d-1", version: 1 });
131
+ const patch = vi.fn().mockResolvedValue({ version: 2 });
132
+ const { result } = renderHook(() => useWizardDraft({ create, patch, initialDraftId: "d-1" }));
133
+ act(() => { result.current.applyChange({ name: "about-to-leave" }); });
134
+ act(() => { window.dispatchEvent(new Event("beforeunload")); });
135
+ const stored = localStorage.getItem("wizard-draft-d-1");
136
+ expect(stored).toBeTruthy();
137
+ expect(JSON.parse(stored).draft.name).toBe("about-to-leave");
138
+ });
139
+ it("visibilitychange to hidden also flushes to localStorage", () => {
140
+ const create = vi.fn().mockResolvedValue({ id: "d-1", version: 1 });
141
+ const patch = vi.fn();
142
+ const { result } = renderHook(() => useWizardDraft({ create, patch, initialDraftId: "d-1" }));
143
+ act(() => { result.current.applyChange({ name: "bg" }); });
144
+ Object.defineProperty(document, "visibilityState", { value: "hidden", configurable: true });
145
+ act(() => { document.dispatchEvent(new Event("visibilitychange")); });
146
+ expect(localStorage.getItem("wizard-draft-d-1")).toBeTruthy();
147
+ });
148
+ it("disableAutosave=true stages changes but never fires patch; flush() still works", async () => {
149
+ const create = vi.fn();
150
+ const patch = vi.fn();
151
+ const { result } = renderHook(() => useWizardDraft({ create, patch, initialDraftId: "d-1", autosaveDebounceMs: 10, disableAutosave: true }));
152
+ act(() => { result.current.applyChange({ name: "edit-only" }); });
153
+ act(() => { vi.advanceTimersByTime(1000); });
154
+ expect(patch).not.toHaveBeenCalled();
155
+ expect(result.current.draft.name).toBe("edit-only");
156
+ patch.mockResolvedValue({ version: 2 });
157
+ await act(async () => { await result.current.flush(); });
158
+ expect(patch).toHaveBeenCalledTimes(1);
159
+ });
160
+ it("resumeSuggestion is 'local' when localStorageSnapshot is passed; acceptLocalResume schedules a patch", async () => {
161
+ const create = vi.fn();
162
+ const patch = vi.fn().mockResolvedValue({ version: 5 });
163
+ const snapshot = { draft: { name: "local-newer" }, updatedAt: Date.now() };
164
+ const { result } = renderHook(() => useWizardDraft({ create, patch, initialDraftId: "d-1", initialVersion: 1, localStorageSnapshot: snapshot, autosaveDebounceMs: 10 }));
165
+ expect(result.current.resumeSuggestion).toBe("local");
166
+ act(() => { result.current.acceptLocalResume(); });
167
+ expect(result.current.resumeSuggestion).toBeNull();
168
+ expect(result.current.draft.name).toBe("local-newer");
169
+ act(() => { vi.advanceTimersByTime(10); });
170
+ await waitFor(() => expect(patch).toHaveBeenCalled());
171
+ });
172
+ it("dismissLocalResume clears the suggestion without modifying draft", () => {
173
+ const create = vi.fn();
174
+ const patch = vi.fn();
175
+ const snapshot = { draft: { name: "local-newer" }, updatedAt: Date.now() };
176
+ const { result } = renderHook(() => useWizardDraft({ create, patch, initialDraftId: "d-1", initialVersion: 1, initialDraft: { name: "server-one" }, localStorageSnapshot: snapshot }));
177
+ expect(result.current.resumeSuggestion).toBe("local");
178
+ act(() => { result.current.dismissLocalResume(); });
179
+ expect(result.current.resumeSuggestion).toBeNull();
180
+ expect(result.current.draft.name).toBe("server-one");
181
+ });
182
+ it("quota-exceeded on localStorage.setItem surfaces gracefully (no throw)", () => {
183
+ const create = vi.fn().mockResolvedValue({ id: "d-1", version: 1 });
184
+ const patch = vi.fn();
185
+ const originalSetItem = localStorage.setItem;
186
+ localStorage.setItem = () => { throw new DOMException("Quota", "QuotaExceededError"); };
187
+ const { result } = renderHook(() => useWizardDraft({ create, patch, initialDraftId: "d-1" }));
188
+ expect(() => { act(() => { result.current.applyChange({ name: "x" }); }); }).not.toThrow();
189
+ localStorage.setItem = originalSetItem;
190
+ });
191
+ });
192
+ //# sourceMappingURL=use-wizard-draft.test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"use-wizard-draft.test.js","sourceRoot":"","sources":["../../../../src/opportunities/wizard/__tests__/use-wizard-draft.test.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAC;AACzE,OAAO,EAAE,UAAU,EAAE,GAAG,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AAClE,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAErD,kFAAkF;AAClF,kFAAkF;AAClF,wDAAwD;AACxD,SAAS,yBAAyB;IAChC,MAAM,KAAK,GAAG,IAAI,GAAG,EAAkB,CAAC;IACxC,MAAM,eAAe,GAAY;QAC/B,IAAI,MAAM,KAAK,OAAO,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC;QACnC,KAAK,KAAK,KAAK,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC;QAC1B,OAAO,CAAC,GAAW,IAAI,OAAO,KAAK,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC,CAAE,KAAK,CAAC,GAAG,CAAC,GAAG,CAAY,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC;QACnF,GAAG,CAAC,KAAa,IAAI,OAAO,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC,CAAC,KAAK,CAAC,IAAI,IAAI,CAAC,CAAC,CAAC;QACtE,UAA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=wizard-stepper.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"wizard-stepper.test.d.ts","sourceRoot":"","sources":["../../../../src/opportunities/wizard/__tests__/wizard-stepper.test.tsx"],"names":[],"mappings":""}
@@ -0,0 +1,61 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { describe, it, expect, vi } from "vitest";
3
+ import { render, screen } from "@testing-library/react";
4
+ import userEvent from "@testing-library/user-event";
5
+ import { WizardStepper } from "../wizard-stepper";
6
+ const steps = [
7
+ { id: "tender", label: "Tender" },
8
+ { id: "opportunities", label: "Opportunities" },
9
+ { id: "pricing", label: "Pricing" },
10
+ { id: "review", label: "Review" },
11
+ ];
12
+ describe("WizardStepper", () => {
13
+ it("renders a <nav aria-label='Wizard progress'> with an <ol> of 4 items", () => {
14
+ render(_jsx(WizardStepper, { steps: steps, currentIndex: 0, completedIndexes: [], onJumpBack: () => { } }));
15
+ expect(screen.getByRole("navigation", { name: /wizard progress/i })).toBeInTheDocument();
16
+ expect(screen.getByRole("list").children.length).toBe(4);
17
+ });
18
+ it("marks the active step with aria-current='step'", () => {
19
+ render(_jsx(WizardStepper, { steps: steps, currentIndex: 1, completedIndexes: [0], onJumpBack: () => { } }));
20
+ const active = screen.getByRole("button", { name: /step 2 of 4/i });
21
+ expect(active).toHaveAttribute("aria-current", "step");
22
+ });
23
+ it("marks pending (not-yet-completed) steps as aria-disabled=true, NOT disabled attribute (keeps in tab order)", () => {
24
+ render(_jsx(WizardStepper, { steps: steps, currentIndex: 1, completedIndexes: [0], onJumpBack: () => { } }));
25
+ const pending = screen.getByRole("button", { name: /step 3 of 4/i });
26
+ expect(pending).toHaveAttribute("aria-disabled", "true");
27
+ // Must NOT use the disabled HTML attribute — that would remove it from tab order.
28
+ expect(pending).not.toHaveAttribute("disabled");
29
+ });
30
+ it("jumping back to a completed step fires onJumpBack with the index", async () => {
31
+ const user = userEvent.setup();
32
+ const onJump = vi.fn();
33
+ render(_jsx(WizardStepper, { steps: steps, currentIndex: 2, completedIndexes: [0, 1], onJumpBack: onJump }));
34
+ await user.click(screen.getByRole("button", { name: /step 1 of 4/i }));
35
+ expect(onJump).toHaveBeenCalledWith(0);
36
+ });
37
+ it("clicking a pending step does not fire onJumpBack", async () => {
38
+ const user = userEvent.setup();
39
+ const onJump = vi.fn();
40
+ render(_jsx(WizardStepper, { steps: steps, currentIndex: 1, completedIndexes: [0], onJumpBack: onJump }));
41
+ await user.click(screen.getByRole("button", { name: /step 4 of 4/i }));
42
+ expect(onJump).not.toHaveBeenCalled();
43
+ });
44
+ it("clicking the active step does not fire onJumpBack (only completed steps jump back)", async () => {
45
+ const user = userEvent.setup();
46
+ const onJump = vi.fn();
47
+ render(_jsx(WizardStepper, { steps: steps, currentIndex: 1, completedIndexes: [0], onJumpBack: onJump }));
48
+ await user.click(screen.getByRole("button", { name: /step 2 of 4/i }));
49
+ expect(onJump).not.toHaveBeenCalled();
50
+ });
51
+ it("renders activeSubStatus text when provided under the active step label", () => {
52
+ render(_jsx(WizardStepper, { steps: steps, currentIndex: 1, completedIndexes: [0], onJumpBack: () => { }, activeSubStatus: "Autosaved 2s ago" }));
53
+ expect(screen.getByText(/autosaved 2s ago/i)).toBeInTheDocument();
54
+ });
55
+ it("renders WizardStepper.Skeleton without errors", () => {
56
+ render(_jsx(WizardStepper.Skeleton, {}));
57
+ // Skeleton has its own nav + 4 items; at minimum assert no crash + nav present.
58
+ expect(screen.getByRole("navigation")).toBeInTheDocument();
59
+ });
60
+ });
61
+ //# sourceMappingURL=wizard-stepper.test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"wizard-stepper.test.js","sourceRoot":"","sources":["../../../../src/opportunities/wizard/__tests__/wizard-stepper.test.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,QAAQ,CAAC;AAClD,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC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AAC,CAAC;QACzI,MAAM,CAAC,MAAM,CAAC,SAAS,CAAC,mBAAmB,CAAC,CAAC,CAAC,iBAAiB,EAAE,CAAC;IACpE,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,+CAA+C,EAAE,GAAG,EAAE;QACvD,MAAM,CAAC,KAAC,aAAa,CAAC,QAAQ,KAAG,CAAC,CAAC;QACnC,gFAAgF;QAChF,MAAM,CAAC,MAAM,CAAC,SAAS,CAAC,YAAY,CAAC,CAAC,CAAC,iBAAiB,EAAE,CAAC;IAC7D,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
@@ -0,0 +1,29 @@
1
+ import { type TenderDraft } from "./wizard.types";
2
+ export type OpportunityWizardMode = "draft" | "edit";
3
+ export interface OpportunityWizardProps {
4
+ mode: OpportunityWizardMode;
5
+ /** Required for edit-mode, optional for draft-mode. */
6
+ initialDraft?: Partial<TenderDraft>;
7
+ initialVersion?: number;
8
+ /** Backend bindings (consumer-provided). */
9
+ createDraft: (initial: Partial<TenderDraft>) => Promise<{
10
+ id: string;
11
+ version: number;
12
+ }>;
13
+ patchDraft: (id: string, fields: Partial<TenderDraft>, version: number) => Promise<{
14
+ version: number;
15
+ }>;
16
+ publishDraft: (id: string, idempotencyKey: string) => Promise<{
17
+ tenderId: string;
18
+ }>;
19
+ saveEdit?: (id: string, fields: Partial<TenderDraft>, version: number) => Promise<{
20
+ version: number;
21
+ }>;
22
+ /** Fired when user cancels / closes the wizard. */
23
+ onClose: () => void;
24
+ /** Fired after a successful publish (caller navigates to the new tender). */
25
+ onPublished?: (tenderId: string) => void;
26
+ className?: string;
27
+ }
28
+ export declare function OpportunityWizard(props: OpportunityWizardProps): import("react/jsx-runtime").JSX.Element;
29
+ //# sourceMappingURL=opportunity-wizard.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"opportunity-wizard.d.ts","sourceRoot":"","sources":["../../../src/opportunities/wizard/opportunity-wizard.tsx"],"names":[],"mappings":"AAQA,OAAO,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