@cellarnode/ui 0.17.4 → 0.19.1
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.
- package/dist/chat/unified-timeline.d.ts +15 -0
- package/dist/chat/unified-timeline.d.ts.map +1 -1
- package/dist/chat/unified-timeline.js.map +1 -1
- package/dist/index.d.ts +8 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +6 -0
- package/dist/index.js.map +1 -1
- package/dist/offer/attachments-card.d.ts +9 -0
- package/dist/offer/attachments-card.d.ts.map +1 -0
- package/dist/offer/attachments-card.js +16 -0
- package/dist/offer/attachments-card.js.map +1 -0
- package/dist/offer/attachments-card.stories.d.ts +17 -0
- package/dist/offer/attachments-card.stories.d.ts.map +1 -0
- package/dist/offer/attachments-card.stories.js +24 -0
- package/dist/offer/attachments-card.stories.js.map +1 -0
- package/dist/offer/buyer-notes-card.d.ts +7 -0
- package/dist/offer/buyer-notes-card.d.ts.map +1 -0
- package/dist/offer/buyer-notes-card.js +6 -0
- package/dist/offer/buyer-notes-card.js.map +1 -0
- package/dist/offer/buyer-notes-card.stories.d.ts +16 -0
- package/dist/offer/buyer-notes-card.stories.d.ts.map +1 -0
- package/dist/offer/buyer-notes-card.stories.js +25 -0
- package/dist/offer/buyer-notes-card.stories.js.map +1 -0
- package/dist/offer/counter-slide-over.d.ts +44 -0
- package/dist/offer/counter-slide-over.d.ts.map +1 -0
- package/dist/offer/counter-slide-over.js +81 -0
- package/dist/offer/counter-slide-over.js.map +1 -0
- package/dist/offer/counter-slide-over.stories.d.ts +23 -0
- package/dist/offer/counter-slide-over.stories.d.ts.map +1 -0
- package/dist/offer/counter-slide-over.stories.js +235 -0
- package/dist/offer/counter-slide-over.stories.js.map +1 -0
- package/dist/offer/facts-card.d.ts +32 -0
- package/dist/offer/facts-card.d.ts.map +1 -0
- package/dist/offer/facts-card.js +87 -0
- package/dist/offer/facts-card.js.map +1 -0
- package/dist/offer/facts-card.stories.d.ts +25 -0
- package/dist/offer/facts-card.stories.d.ts.map +1 -0
- package/dist/offer/facts-card.stories.js +177 -0
- package/dist/offer/facts-card.stories.js.map +1 -0
- package/dist/offer/index.d.ts +39 -0
- package/dist/offer/index.d.ts.map +1 -1
- package/dist/offer/index.js +21 -0
- package/dist/offer/index.js.map +1 -1
- package/dist/offer/inline-counter-form.d.ts +16 -0
- package/dist/offer/inline-counter-form.d.ts.map +1 -1
- package/dist/offer/inline-counter-form.js +8 -0
- package/dist/offer/inline-counter-form.js.map +1 -1
- package/dist/offer/match-compatibility-card.d.ts +16 -0
- package/dist/offer/match-compatibility-card.d.ts.map +1 -0
- package/dist/offer/match-compatibility-card.js +27 -0
- package/dist/offer/match-compatibility-card.js.map +1 -0
- package/dist/offer/match-compatibility-card.stories.d.ts +19 -0
- package/dist/offer/match-compatibility-card.stories.d.ts.map +1 -0
- package/dist/offer/match-compatibility-card.stories.js +111 -0
- package/dist/offer/match-compatibility-card.stories.js.map +1 -0
- package/dist/offer/match-glyph.d.ts +14 -0
- package/dist/offer/match-glyph.d.ts.map +1 -0
- package/dist/offer/match-glyph.js +40 -0
- package/dist/offer/match-glyph.js.map +1 -0
- package/dist/offer/match-glyph.stories.d.ts +26 -0
- package/dist/offer/match-glyph.stories.d.ts.map +1 -0
- package/dist/offer/match-glyph.stories.js +26 -0
- package/dist/offer/match-glyph.stories.js.map +1 -0
- package/dist/offer/match-headline-bar.d.ts +11 -0
- package/dist/offer/match-headline-bar.d.ts.map +1 -0
- package/dist/offer/match-headline-bar.js +28 -0
- package/dist/offer/match-headline-bar.js.map +1 -0
- package/dist/offer/match-headline-bar.stories.d.ts +17 -0
- package/dist/offer/match-headline-bar.stories.d.ts.map +1 -0
- package/dist/offer/match-headline-bar.stories.js +39 -0
- package/dist/offer/match-headline-bar.stories.js.map +1 -0
- package/dist/offer/match-preview.d.ts +18 -0
- package/dist/offer/match-preview.d.ts.map +1 -0
- package/dist/offer/match-preview.js +13 -0
- package/dist/offer/match-preview.js.map +1 -0
- package/dist/offer/match-preview.stories.d.ts +18 -0
- package/dist/offer/match-preview.stories.d.ts.map +1 -0
- package/dist/offer/match-preview.stories.js +103 -0
- package/dist/offer/match-preview.stories.js.map +1 -0
- package/dist/offer/negotiation-section.d.ts +11 -0
- package/dist/offer/negotiation-section.d.ts.map +1 -0
- package/dist/offer/negotiation-section.js +99 -0
- package/dist/offer/negotiation-section.js.map +1 -0
- package/dist/offer/negotiation-section.stories.d.ts +18 -0
- package/dist/offer/negotiation-section.stories.d.ts.map +1 -0
- package/dist/offer/negotiation-section.stories.js +156 -0
- package/dist/offer/negotiation-section.stories.js.map +1 -0
- package/dist/offer/new-activity-pill.d.ts +7 -0
- package/dist/offer/new-activity-pill.d.ts.map +1 -0
- package/dist/offer/new-activity-pill.js +8 -0
- package/dist/offer/new-activity-pill.js.map +1 -0
- package/dist/offer/new-activity-pill.stories.d.ts +17 -0
- package/dist/offer/new-activity-pill.stories.d.ts.map +1 -0
- package/dist/offer/new-activity-pill.stories.js +22 -0
- package/dist/offer/new-activity-pill.stories.js.map +1 -0
- package/dist/offer/offer-document.d.ts +33 -0
- package/dist/offer/offer-document.d.ts.map +1 -0
- package/dist/offer/offer-document.js +125 -0
- package/dist/offer/offer-document.js.map +1 -0
- package/dist/offer/offer-document.stories.d.ts +25 -0
- package/dist/offer/offer-document.stories.d.ts.map +1 -0
- package/dist/offer/offer-document.stories.js +168 -0
- package/dist/offer/offer-document.stories.js.map +1 -0
- package/dist/offer/offer-export-button.d.ts +8 -0
- package/dist/offer/offer-export-button.d.ts.map +1 -0
- package/dist/offer/offer-export-button.js +11 -0
- package/dist/offer/offer-export-button.js.map +1 -0
- package/dist/offer/offer-export-button.stories.d.ts +15 -0
- package/dist/offer/offer-export-button.stories.d.ts.map +1 -0
- package/dist/offer/offer-export-button.stories.js +11 -0
- package/dist/offer/offer-export-button.stories.js.map +1 -0
- package/dist/offer/offer-product-card.d.ts +32 -0
- package/dist/offer/offer-product-card.d.ts.map +1 -0
- package/dist/offer/offer-product-card.js +10 -0
- package/dist/offer/offer-product-card.js.map +1 -0
- package/dist/offer/offer-product-card.stories.d.ts +16 -0
- package/dist/offer/offer-product-card.stories.d.ts.map +1 -0
- package/dist/offer/offer-product-card.stories.js +40 -0
- package/dist/offer/offer-product-card.stories.js.map +1 -0
- package/dist/offer/opportunity-card.d.ts +16 -0
- package/dist/offer/opportunity-card.d.ts.map +1 -0
- package/dist/offer/opportunity-card.js +9 -0
- package/dist/offer/opportunity-card.js.map +1 -0
- package/dist/offer/opportunity-card.stories.d.ts +16 -0
- package/dist/offer/opportunity-card.stories.d.ts.map +1 -0
- package/dist/offer/opportunity-card.stories.js +33 -0
- package/dist/offer/opportunity-card.stories.js.map +1 -0
- package/dist/offer/parties-card.d.ts +11 -0
- package/dist/offer/parties-card.d.ts.map +1 -0
- package/dist/offer/parties-card.js +14 -0
- package/dist/offer/parties-card.js.map +1 -0
- package/dist/offer/parties-card.stories.d.ts +17 -0
- package/dist/offer/parties-card.stories.d.ts.map +1 -0
- package/dist/offer/parties-card.stories.js +37 -0
- package/dist/offer/parties-card.stories.js.map +1 -0
- package/dist/offer/terms-card.d.ts +17 -0
- package/dist/offer/terms-card.d.ts.map +1 -0
- package/dist/offer/terms-card.js +50 -0
- package/dist/offer/terms-card.js.map +1 -0
- package/dist/offer/terms-card.stories.d.ts +17 -0
- package/dist/offer/terms-card.stories.d.ts.map +1 -0
- package/dist/offer/terms-card.stories.js +42 -0
- package/dist/offer/terms-card.stories.js.map +1 -0
- package/dist/offer/timeline-event.d.ts +12 -0
- package/dist/offer/timeline-event.d.ts.map +1 -0
- package/dist/offer/timeline-event.js +57 -0
- package/dist/offer/timeline-event.js.map +1 -0
- package/dist/offer/timeline-event.stories.d.ts +21 -0
- package/dist/offer/timeline-event.stories.d.ts.map +1 -0
- package/dist/offer/timeline-event.stories.js +57 -0
- package/dist/offer/timeline-event.stories.js.map +1 -0
- package/dist/offer/types.d.ts +118 -0
- package/dist/offer/types.d.ts.map +1 -1
- package/dist/opportunities/__a11y__/opportunity-card-actions-menu.a11y.test.d.ts +2 -0
- package/dist/opportunities/__a11y__/opportunity-card-actions-menu.a11y.test.d.ts.map +1 -0
- package/dist/opportunities/__a11y__/opportunity-card-actions-menu.a11y.test.js +40 -0
- package/dist/opportunities/__a11y__/opportunity-card-actions-menu.a11y.test.js.map +1 -0
- package/dist/opportunities/__a11y__/opportunity-celebration.a11y.test.d.ts +2 -0
- package/dist/opportunities/__a11y__/opportunity-celebration.a11y.test.d.ts.map +1 -0
- package/dist/opportunities/__a11y__/opportunity-celebration.a11y.test.js +31 -0
- package/dist/opportunities/__a11y__/opportunity-celebration.a11y.test.js.map +1 -0
- package/dist/opportunities/__a11y__/opportunity-detail-panel.a11y.test.d.ts +2 -0
- package/dist/opportunities/__a11y__/opportunity-detail-panel.a11y.test.d.ts.map +1 -0
- package/dist/opportunities/__a11y__/opportunity-detail-panel.a11y.test.js +42 -0
- package/dist/opportunities/__a11y__/opportunity-detail-panel.a11y.test.js.map +1 -0
- package/dist/opportunities/__a11y__/opportunity-filter-bar.a11y.test.d.ts +2 -0
- package/dist/opportunities/__a11y__/opportunity-filter-bar.a11y.test.d.ts.map +1 -0
- package/dist/opportunities/__a11y__/opportunity-filter-bar.a11y.test.js +59 -0
- package/dist/opportunities/__a11y__/opportunity-filter-bar.a11y.test.js.map +1 -0
- package/dist/opportunities/__a11y__/opportunity-stacked-card.a11y.test.d.ts +2 -0
- package/dist/opportunities/__a11y__/opportunity-stacked-card.a11y.test.d.ts.map +1 -0
- package/dist/opportunities/__a11y__/opportunity-stacked-card.a11y.test.js +54 -0
- package/dist/opportunities/__a11y__/opportunity-stacked-card.a11y.test.js.map +1 -0
- package/dist/opportunities/__a11y__/opportunity-stacked-list.a11y.test.d.ts +2 -0
- package/dist/opportunities/__a11y__/opportunity-stacked-list.a11y.test.d.ts.map +1 -0
- package/dist/opportunities/__a11y__/opportunity-stacked-list.a11y.test.js +40 -0
- package/dist/opportunities/__a11y__/opportunity-stacked-list.a11y.test.js.map +1 -0
- package/dist/opportunities/__tests__/opportunity-add-to-journey-button.test.d.ts +2 -0
- package/dist/opportunities/__tests__/opportunity-add-to-journey-button.test.d.ts.map +1 -0
- package/dist/opportunities/__tests__/opportunity-add-to-journey-button.test.js +40 -0
- package/dist/opportunities/__tests__/opportunity-add-to-journey-button.test.js.map +1 -0
- package/dist/opportunities/__tests__/opportunity-card-actions-menu.test.d.ts +2 -0
- package/dist/opportunities/__tests__/opportunity-card-actions-menu.test.d.ts.map +1 -0
- package/dist/opportunities/__tests__/opportunity-card-actions-menu.test.js +74 -0
- package/dist/opportunities/__tests__/opportunity-card-actions-menu.test.js.map +1 -0
- package/dist/opportunities/__tests__/opportunity-celebration.test.d.ts +2 -0
- package/dist/opportunities/__tests__/opportunity-celebration.test.d.ts.map +1 -0
- package/dist/opportunities/__tests__/opportunity-celebration.test.js +46 -0
- package/dist/opportunities/__tests__/opportunity-celebration.test.js.map +1 -0
- package/dist/opportunities/__tests__/opportunity-filter-bar-drawer.test.d.ts +2 -0
- package/dist/opportunities/__tests__/opportunity-filter-bar-drawer.test.d.ts.map +1 -0
- package/dist/opportunities/__tests__/opportunity-filter-bar-drawer.test.js +77 -0
- package/dist/opportunities/__tests__/opportunity-filter-bar-drawer.test.js.map +1 -0
- package/dist/opportunities/__tests__/opportunity-filter-bar.test.d.ts +2 -0
- package/dist/opportunities/__tests__/opportunity-filter-bar.test.d.ts.map +1 -0
- package/dist/opportunities/__tests__/opportunity-filter-bar.test.js +107 -0
- package/dist/opportunities/__tests__/opportunity-filter-bar.test.js.map +1 -0
- package/dist/opportunities/__tests__/opportunity-reopen-button.test.d.ts +2 -0
- package/dist/opportunities/__tests__/opportunity-reopen-button.test.d.ts.map +1 -0
- package/dist/opportunities/__tests__/opportunity-reopen-button.test.js +29 -0
- package/dist/opportunities/__tests__/opportunity-reopen-button.test.js.map +1 -0
- package/dist/opportunities/__tests__/opportunity-republish-button.test.d.ts +2 -0
- package/dist/opportunities/__tests__/opportunity-republish-button.test.d.ts.map +1 -0
- package/dist/opportunities/__tests__/opportunity-republish-button.test.js +29 -0
- package/dist/opportunities/__tests__/opportunity-republish-button.test.js.map +1 -0
- package/dist/opportunities/__tests__/opportunity-resume-draft-button.test.d.ts +2 -0
- package/dist/opportunities/__tests__/opportunity-resume-draft-button.test.d.ts.map +1 -0
- package/dist/opportunities/__tests__/opportunity-resume-draft-button.test.js +19 -0
- package/dist/opportunities/__tests__/opportunity-resume-draft-button.test.js.map +1 -0
- package/dist/opportunities/__tests__/opportunity-view-offers-button.test.d.ts +2 -0
- package/dist/opportunities/__tests__/opportunity-view-offers-button.test.d.ts.map +1 -0
- package/dist/opportunities/__tests__/opportunity-view-offers-button.test.js +23 -0
- package/dist/opportunities/__tests__/opportunity-view-offers-button.test.js.map +1 -0
- package/dist/opportunities/index.d.ts +51 -1
- package/dist/opportunities/index.d.ts.map +1 -1
- package/dist/opportunities/index.js +35 -0
- package/dist/opportunities/index.js.map +1 -1
- package/dist/opportunities/opportunities-table.d.ts +4 -0
- package/dist/opportunities/opportunities-table.d.ts.map +1 -1
- package/dist/opportunities/opportunities-table.js +4 -0
- package/dist/opportunities/opportunities-table.js.map +1 -1
- package/dist/opportunities/opportunity-add-to-journey-button.d.ts +12 -0
- package/dist/opportunities/opportunity-add-to-journey-button.d.ts.map +1 -0
- package/dist/opportunities/opportunity-add-to-journey-button.js +42 -0
- package/dist/opportunities/opportunity-add-to-journey-button.js.map +1 -0
- package/dist/opportunities/opportunity-card-actions-menu.d.ts +9 -0
- package/dist/opportunities/opportunity-card-actions-menu.d.ts.map +1 -0
- package/dist/opportunities/opportunity-card-actions-menu.js +33 -0
- package/dist/opportunities/opportunity-card-actions-menu.js.map +1 -0
- package/dist/opportunities/opportunity-card-actions-menu.stories.d.ts +14 -0
- package/dist/opportunities/opportunity-card-actions-menu.stories.d.ts.map +1 -0
- package/dist/opportunities/opportunity-card-actions-menu.stories.js +12 -0
- package/dist/opportunities/opportunity-card-actions-menu.stories.js.map +1 -0
- package/dist/opportunities/opportunity-celebration.d.ts +8 -0
- package/dist/opportunities/opportunity-celebration.d.ts.map +1 -0
- package/dist/opportunities/opportunity-celebration.js +17 -0
- package/dist/opportunities/opportunity-celebration.js.map +1 -0
- package/dist/opportunities/opportunity-celebration.stories.d.ts +17 -0
- package/dist/opportunities/opportunity-celebration.stories.d.ts.map +1 -0
- package/dist/opportunities/opportunity-celebration.stories.js +30 -0
- package/dist/opportunities/opportunity-celebration.stories.js.map +1 -0
- package/dist/opportunities/opportunity-filter-bar-drawer.d.ts +10 -0
- package/dist/opportunities/opportunity-filter-bar-drawer.d.ts.map +1 -0
- package/dist/opportunities/opportunity-filter-bar-drawer.js +54 -0
- package/dist/opportunities/opportunity-filter-bar-drawer.js.map +1 -0
- package/dist/opportunities/opportunity-filter-bar.d.ts +14 -0
- package/dist/opportunities/opportunity-filter-bar.d.ts.map +1 -0
- package/dist/opportunities/opportunity-filter-bar.js +65 -0
- package/dist/opportunities/opportunity-filter-bar.js.map +1 -0
- package/dist/opportunities/opportunity-filter-bar.stories.d.ts +25 -0
- package/dist/opportunities/opportunity-filter-bar.stories.d.ts.map +1 -0
- package/dist/opportunities/opportunity-filter-bar.stories.js +63 -0
- package/dist/opportunities/opportunity-filter-bar.stories.js.map +1 -0
- package/dist/opportunities/opportunity-reopen-button.d.ts +11 -0
- package/dist/opportunities/opportunity-reopen-button.d.ts.map +1 -0
- package/dist/opportunities/opportunity-reopen-button.js +20 -0
- package/dist/opportunities/opportunity-reopen-button.js.map +1 -0
- package/dist/opportunities/opportunity-republish-button.d.ts +7 -0
- package/dist/opportunities/opportunity-republish-button.d.ts.map +1 -0
- package/dist/opportunities/opportunity-republish-button.js +14 -0
- package/dist/opportunities/opportunity-republish-button.js.map +1 -0
- package/dist/opportunities/opportunity-resume-draft-button.d.ts +7 -0
- package/dist/opportunities/opportunity-resume-draft-button.d.ts.map +1 -0
- package/dist/opportunities/opportunity-resume-draft-button.js +7 -0
- package/dist/opportunities/opportunity-resume-draft-button.js.map +1 -0
- package/dist/opportunities/opportunity-stacked-list.d.ts.map +1 -1
- package/dist/opportunities/opportunity-stacked-list.js +3 -1
- package/dist/opportunities/opportunity-stacked-list.js.map +1 -1
- package/dist/opportunities/opportunity-view-offers-button.d.ts +7 -0
- package/dist/opportunities/opportunity-view-offers-button.d.ts.map +1 -0
- package/dist/opportunities/opportunity-view-offers-button.js +8 -0
- package/dist/opportunities/opportunity-view-offers-button.js.map +1 -0
- package/dist/opportunities/two-column-section.d.ts.map +1 -1
- package/dist/opportunities/two-column-section.js +4 -3
- package/dist/opportunities/two-column-section.js.map +1 -1
- package/dist/opportunities/wizard/__a11y__/opportunity-wizard.a11y.test.d.ts +2 -0
- package/dist/opportunities/wizard/__a11y__/opportunity-wizard.a11y.test.d.ts.map +1 -0
- package/dist/opportunities/wizard/__a11y__/opportunity-wizard.a11y.test.js +53 -0
- package/dist/opportunities/wizard/__a11y__/opportunity-wizard.a11y.test.js.map +1 -0
- package/dist/opportunities/wizard/__a11y__/wizard-stepper.a11y.test.d.ts +2 -0
- package/dist/opportunities/wizard/__a11y__/wizard-stepper.a11y.test.d.ts.map +1 -0
- package/dist/opportunities/wizard/__a11y__/wizard-stepper.a11y.test.js +32 -0
- package/dist/opportunities/wizard/__a11y__/wizard-stepper.a11y.test.js.map +1 -0
- package/dist/opportunities/wizard/__tests__/opportunity-wizard.test.d.ts +2 -0
- package/dist/opportunities/wizard/__tests__/opportunity-wizard.test.d.ts.map +1 -0
- package/dist/opportunities/wizard/__tests__/opportunity-wizard.test.js +127 -0
- package/dist/opportunities/wizard/__tests__/opportunity-wizard.test.js.map +1 -0
- package/dist/opportunities/wizard/__tests__/step-opportunities.test.d.ts +2 -0
- package/dist/opportunities/wizard/__tests__/step-opportunities.test.d.ts.map +1 -0
- package/dist/opportunities/wizard/__tests__/step-opportunities.test.js +93 -0
- package/dist/opportunities/wizard/__tests__/step-opportunities.test.js.map +1 -0
- package/dist/opportunities/wizard/__tests__/step-pricing-timeline.test.d.ts +2 -0
- package/dist/opportunities/wizard/__tests__/step-pricing-timeline.test.d.ts.map +1 -0
- package/dist/opportunities/wizard/__tests__/step-pricing-timeline.test.js +141 -0
- package/dist/opportunities/wizard/__tests__/step-pricing-timeline.test.js.map +1 -0
- package/dist/opportunities/wizard/__tests__/step-review.test.d.ts +2 -0
- package/dist/opportunities/wizard/__tests__/step-review.test.d.ts.map +1 -0
- package/dist/opportunities/wizard/__tests__/step-review.test.js +80 -0
- package/dist/opportunities/wizard/__tests__/step-review.test.js.map +1 -0
- package/dist/opportunities/wizard/__tests__/step-tender-basics.test.d.ts +2 -0
- package/dist/opportunities/wizard/__tests__/step-tender-basics.test.d.ts.map +1 -0
- package/dist/opportunities/wizard/__tests__/step-tender-basics.test.js +76 -0
- package/dist/opportunities/wizard/__tests__/step-tender-basics.test.js.map +1 -0
- package/dist/opportunities/wizard/__tests__/use-wizard-draft.test.d.ts +2 -0
- package/dist/opportunities/wizard/__tests__/use-wizard-draft.test.d.ts.map +1 -0
- package/dist/opportunities/wizard/__tests__/use-wizard-draft.test.js +192 -0
- package/dist/opportunities/wizard/__tests__/use-wizard-draft.test.js.map +1 -0
- package/dist/opportunities/wizard/__tests__/wizard-stepper.test.d.ts +2 -0
- package/dist/opportunities/wizard/__tests__/wizard-stepper.test.d.ts.map +1 -0
- package/dist/opportunities/wizard/__tests__/wizard-stepper.test.js +61 -0
- package/dist/opportunities/wizard/__tests__/wizard-stepper.test.js.map +1 -0
- package/dist/opportunities/wizard/opportunity-wizard.d.ts +29 -0
- package/dist/opportunities/wizard/opportunity-wizard.d.ts.map +1 -0
- package/dist/opportunities/wizard/opportunity-wizard.js +196 -0
- package/dist/opportunities/wizard/opportunity-wizard.js.map +1 -0
- package/dist/opportunities/wizard/opportunity-wizard.stories.d.ts +12 -0
- package/dist/opportunities/wizard/opportunity-wizard.stories.d.ts.map +1 -0
- package/dist/opportunities/wizard/opportunity-wizard.stories.js +49 -0
- package/dist/opportunities/wizard/opportunity-wizard.stories.js.map +1 -0
- package/dist/opportunities/wizard/step-opportunities.d.ts +9 -0
- package/dist/opportunities/wizard/step-opportunities.d.ts.map +1 -0
- package/dist/opportunities/wizard/step-opportunities.js +80 -0
- package/dist/opportunities/wizard/step-opportunities.js.map +1 -0
- package/dist/opportunities/wizard/step-pricing-timeline.d.ts +9 -0
- package/dist/opportunities/wizard/step-pricing-timeline.d.ts.map +1 -0
- package/dist/opportunities/wizard/step-pricing-timeline.js +64 -0
- package/dist/opportunities/wizard/step-pricing-timeline.js.map +1 -0
- package/dist/opportunities/wizard/step-review.d.ts +9 -0
- package/dist/opportunities/wizard/step-review.d.ts.map +1 -0
- package/dist/opportunities/wizard/step-review.js +34 -0
- package/dist/opportunities/wizard/step-review.js.map +1 -0
- package/dist/opportunities/wizard/step-tender-basics.d.ts +16 -0
- package/dist/opportunities/wizard/step-tender-basics.d.ts.map +1 -0
- package/dist/opportunities/wizard/step-tender-basics.js +39 -0
- package/dist/opportunities/wizard/step-tender-basics.js.map +1 -0
- package/dist/opportunities/wizard/use-wizard-draft.d.ts +41 -0
- package/dist/opportunities/wizard/use-wizard-draft.d.ts.map +1 -0
- package/dist/opportunities/wizard/use-wizard-draft.js +214 -0
- package/dist/opportunities/wizard/use-wizard-draft.js.map +1 -0
- package/dist/opportunities/wizard/wizard-stepper.d.ts +20 -0
- package/dist/opportunities/wizard/wizard-stepper.d.ts.map +1 -0
- package/dist/opportunities/wizard/wizard-stepper.js +26 -0
- package/dist/opportunities/wizard/wizard-stepper.js.map +1 -0
- package/dist/opportunities/wizard/wizard-stepper.stories.d.ts +22 -0
- package/dist/opportunities/wizard/wizard-stepper.stories.d.ts.map +1 -0
- package/dist/opportunities/wizard/wizard-stepper.stories.js +47 -0
- package/dist/opportunities/wizard/wizard-stepper.stories.js.map +1 -0
- package/dist/opportunities/wizard/wizard.types.d.ts +176 -0
- package/dist/opportunities/wizard/wizard.types.d.ts.map +1 -0
- package/dist/opportunities/wizard/wizard.types.js +62 -0
- package/dist/opportunities/wizard/wizard.types.js.map +1 -0
- package/package.json +13 -4
- package/src/offer/offer-document.print.css +72 -0
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { OpportunityWizard } from "./opportunity-wizard";
|
|
3
|
+
const meta = {
|
|
4
|
+
title: "Opportunities/Wizard/OpportunityWizard",
|
|
5
|
+
component: OpportunityWizard,
|
|
6
|
+
tags: ["autodocs"],
|
|
7
|
+
};
|
|
8
|
+
export default meta;
|
|
9
|
+
const mockCallbacks = {
|
|
10
|
+
createDraft: async () => ({ id: "mock-draft", version: 1 }),
|
|
11
|
+
patchDraft: async () => ({ version: 2 }),
|
|
12
|
+
publishDraft: async () => ({ tenderId: "mock-tender" }),
|
|
13
|
+
saveEdit: async () => ({ version: 3 }),
|
|
14
|
+
onClose: () => console.warn("close"),
|
|
15
|
+
onPublished: (id) => console.warn("published", id),
|
|
16
|
+
};
|
|
17
|
+
export const DraftMode = {
|
|
18
|
+
args: {
|
|
19
|
+
mode: "draft",
|
|
20
|
+
...mockCallbacks,
|
|
21
|
+
},
|
|
22
|
+
render: (args) => (_jsx("div", { className: "h-[700px] border border-border", children: _jsx(OpportunityWizard, { ...args }) })),
|
|
23
|
+
};
|
|
24
|
+
export const EditMode = {
|
|
25
|
+
args: {
|
|
26
|
+
mode: "edit",
|
|
27
|
+
initialDraft: {
|
|
28
|
+
id: "existing-1",
|
|
29
|
+
name: "Existing Tender",
|
|
30
|
+
targetCountry: "SE",
|
|
31
|
+
instructions: "Already-published tender being edited.",
|
|
32
|
+
opportunities: [{
|
|
33
|
+
clientId: "c1",
|
|
34
|
+
name: "Existing opportunity",
|
|
35
|
+
category: "wine",
|
|
36
|
+
countryOfOrigin: "FR",
|
|
37
|
+
volume: 5000,
|
|
38
|
+
priceMin: 8,
|
|
39
|
+
priceMax: 12,
|
|
40
|
+
currency: "EUR",
|
|
41
|
+
submissionDeadline: new Date("2026-06-01"),
|
|
42
|
+
}],
|
|
43
|
+
},
|
|
44
|
+
initialVersion: 1,
|
|
45
|
+
...mockCallbacks,
|
|
46
|
+
},
|
|
47
|
+
render: (args) => (_jsx("div", { className: "h-[700px] border border-border", children: _jsx(OpportunityWizard, { ...args }) })),
|
|
48
|
+
};
|
|
49
|
+
//# sourceMappingURL=opportunity-wizard.stories.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"opportunity-wizard.stories.js","sourceRoot":"","sources":["../../../src/opportunities/wizard/opportunity-wizard.stories.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAEzD,MAAM,IAAI,GAAG;IACX,KAAK,EAAE,wCAAwC;IAC/C,SAAS,EAAE,iBAAiB;IAC5B,IAAI,EAAE,CAAC,UAAU,CAAC;CACsB,CAAC;AAC3C,eAAe,IAAI,CAAC;AAGpB,MAAM,aAAa,GAAG;IACpB,WAAW,EAAE,KAAK,IAAI,EAAE,CAAC,CAAC,EAAE,EAAE,EAAE,YAAY,EAAE,OAAO,EAAE,CAAC,EAAE,CAAC;IAC3D,UAAU,EAAE,KAAK,IAAI,EAAE,CAAC,CAAC,EAAE,OAAO,EAAE,CAAC,EAAE,CAAC;IACxC,YAAY,EAAE,KAAK,IAAI,EAAE,CAAC,CAAC,EAAE,QAAQ,EAAE,aAAa,EAAE,CAAC;IACvD,QAAQ,EAAE,KAAK,IAAI,EAAE,CAAC,CAAC,EAAE,OAAO,EAAE,CAAC,EAAE,CAAC;IACtC,OAAO,EAAE,GAAG,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC;IACpC,WAAW,EAAE,CAAC,EAAU,EAAE,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,WAAW,EAAE,EAAE,CAAC;CAC3D,CAAC;AAEF,MAAM,CAAC,MAAM,SAAS,GAAU;IAC9B,IAAI,EAAE;QACJ,IAAI,EAAE,OAAO;QACb,GAAG,aAAa;KACjB;IACD,MAAM,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,CAChB,cAAK,SAAS,EAAC,gCAAgC,YAC7C,KAAC,iBAAiB,OAAK,IAAI,GAAI,GAC3B,CACP;CACF,CAAC;AAEF,MAAM,CAAC,MAAM,QAAQ,GAAU;IAC7B,IAAI,EAAE;QACJ,IAAI,EAAE,MAAM;QACZ,YAAY,EAAE;YACZ,EAAE,EAAE,YAAY;YAChB,IAAI,EAAE,iBAAiB;YACvB,aAAa,EAAE,IAAI;YACnB,YAAY,EAAE,wCAAwC;YACtD,aAAa,EAAE,CAAC;oBACd,QAAQ,EAAE,IAAI;oBACd,IAAI,EAAE,sBAAsB;oBAC5B,QAAQ,EAAE,MAAM;oBAChB,eAAe,EAAE,IAAI;oBACrB,MAAM,EAAE,IAAI;oBACZ,QAAQ,EAAE,CAAC;oBACX,QAAQ,EAAE,EAAE;oBACZ,QAAQ,EAAE,KAAK;oBACf,kBAAkB,EAAE,IAAI,IAAI,CAAC,YAAY,CAAC;iBAC3C,CAAC;SACH;QACD,cAAc,EAAE,CAAC;QACjB,GAAG,aAAa;KACjB;IACD,MAAM,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,CAChB,cAAK,SAAS,EAAC,gCAAgC,YAC7C,KAAC,iBAAiB,OAAK,IAAI,GAAI,GAC3B,CACP;CACF,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { OpportunityDraft } from "./wizard.types";
|
|
2
|
+
export interface StepOpportunitiesProps {
|
|
3
|
+
items: OpportunityDraft[];
|
|
4
|
+
onChange: (next: OpportunityDraft[]) => void;
|
|
5
|
+
onValidityChange?: (valid: boolean) => void;
|
|
6
|
+
className?: string;
|
|
7
|
+
}
|
|
8
|
+
export declare function StepOpportunities({ items, onChange, onValidityChange, className }: StepOpportunitiesProps): import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
//# sourceMappingURL=step-opportunities.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"step-opportunities.d.ts","sourceRoot":"","sources":["../../../src/opportunities/wizard/step-opportunities.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAIvD,MAAM,WAAW,sBAAsB;IACrC,KAAK,EAAE,gBAAgB,EAAE,CAAC;IAC1B,QAAQ,EAAE,CAAC,IAAI,EAAE,gBAAgB,EAAE,KAAK,IAAI,CAAC;IAC7C,gBAAgB,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI,CAAC;IAC5C,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AASD,wBAAgB,iBAAiB,CAAC,EAAE,KAAK,EAAE,QAAQ,EAAE,gBAAgB,EAAE,SAAS,EAAE,EAAE,sBAAsB,2CA6EzG"}
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
import { useVirtualizer } from "@tanstack/react-virtual";
|
|
4
|
+
import { Plus, Trash2 } from "lucide-react";
|
|
5
|
+
import { cn } from "../../lib/utils";
|
|
6
|
+
const VIRTUALIZE_THRESHOLD = 20;
|
|
7
|
+
function makeNewOpportunity() {
|
|
8
|
+
return {
|
|
9
|
+
clientId: crypto.randomUUID(),
|
|
10
|
+
name: "",
|
|
11
|
+
};
|
|
12
|
+
}
|
|
13
|
+
export function StepOpportunities({ items, onChange, onValidityChange, className }) {
|
|
14
|
+
const [expandedSet, setExpandedSet] = React.useState(() => new Set(items.map(i => i.clientId)));
|
|
15
|
+
const updateItem = (clientId, patch) => {
|
|
16
|
+
onChange(items.map(it => (it.clientId === clientId ? { ...it, ...patch } : it)));
|
|
17
|
+
};
|
|
18
|
+
const addItem = () => {
|
|
19
|
+
const next = makeNewOpportunity();
|
|
20
|
+
onChange([...items, next]);
|
|
21
|
+
setExpandedSet(prev => new Set([...prev, next.clientId]));
|
|
22
|
+
};
|
|
23
|
+
const removeItem = (clientId) => {
|
|
24
|
+
onChange(items.filter(it => it.clientId !== clientId));
|
|
25
|
+
setExpandedSet(prev => { const s = new Set(prev); s.delete(clientId); return s; });
|
|
26
|
+
};
|
|
27
|
+
const toggle = (clientId) => {
|
|
28
|
+
setExpandedSet(prev => {
|
|
29
|
+
const s = new Set(prev);
|
|
30
|
+
if (s.has(clientId))
|
|
31
|
+
s.delete(clientId);
|
|
32
|
+
else
|
|
33
|
+
s.add(clientId);
|
|
34
|
+
return s;
|
|
35
|
+
});
|
|
36
|
+
};
|
|
37
|
+
React.useEffect(() => {
|
|
38
|
+
const valid = items.length >= 1 && items.every(i => (i.name ?? "").trim().length > 0);
|
|
39
|
+
onValidityChange?.(valid);
|
|
40
|
+
}, [items, onValidityChange]);
|
|
41
|
+
if (items.length >= VIRTUALIZE_THRESHOLD) {
|
|
42
|
+
return (_jsx(VirtualizedList, { items: items, expandedSet: expandedSet, onToggle: toggle, onUpdateItem: updateItem, onRemoveItem: removeItem, onAddItem: addItem, className: className }));
|
|
43
|
+
}
|
|
44
|
+
return (_jsxs("div", { className: cn("flex flex-col gap-3", className), children: [_jsxs("div", { className: "flex items-center justify-between", children: [_jsxs("div", { className: "text-xs text-muted-foreground", children: [items.length, " opportunit", items.length === 1 ? "y" : "ies"] }), items.length >= 3 ? (_jsx("button", { type: "button", className: "text-xs underline underline-offset-2 text-muted-foreground", onClick: () => setExpandedSet(new Set(items.map(i => i.clientId))), children: "Expand all" })) : null] }), items.map(it => (_jsx(OpportunityCard, { opp: it, expanded: expandedSet.has(it.clientId), onToggle: () => toggle(it.clientId), onUpdate: (p) => updateItem(it.clientId, p), onRemove: items.length > 1 ? () => removeItem(it.clientId) : undefined }, it.clientId))), _jsxs("button", { type: "button", onClick: addItem, className: "inline-flex items-center gap-1 self-start rounded-md border border-dashed border-border px-3 py-2 text-sm text-muted-foreground hover:bg-accent", children: [_jsx(Plus, { "aria-hidden": true, className: "size-4" }), " Add another opportunity"] })] }));
|
|
45
|
+
}
|
|
46
|
+
function VirtualizedList(props) {
|
|
47
|
+
const parentRef = React.useRef(null);
|
|
48
|
+
// eslint-disable-next-line react-hooks/incompatible-library -- TanStack Virtual's useVirtualizer is a known exception; memoization is handled internally
|
|
49
|
+
const rowVirtualizer = useVirtualizer({
|
|
50
|
+
count: props.items.length,
|
|
51
|
+
getScrollElement: () => parentRef.current,
|
|
52
|
+
estimateSize: (i) => (props.expandedSet.has(props.items[i].clientId) ? 420 : 72),
|
|
53
|
+
overscan: 5,
|
|
54
|
+
});
|
|
55
|
+
return (_jsxs("div", { className: cn("flex flex-col gap-3", props.className), children: [_jsx("div", { className: "flex items-center justify-between", children: _jsxs("div", { className: "text-xs text-muted-foreground", children: [props.items.length, " opportunities \u00B7 virtualized"] }) }), _jsx("div", { ref: parentRef, className: "max-h-[60vh] overflow-auto", children: _jsx("div", { style: { height: `${rowVirtualizer.getTotalSize()}px`, position: "relative" }, children: rowVirtualizer.getVirtualItems().map(row => {
|
|
56
|
+
const it = props.items[row.index];
|
|
57
|
+
return (_jsx("div", { style: { position: "absolute", top: 0, left: 0, right: 0, transform: `translateY(${row.start}px)` }, children: _jsx(OpportunityCard, { opp: it, expanded: props.expandedSet.has(it.clientId), onToggle: () => props.onToggle(it.clientId), onUpdate: (p) => props.onUpdateItem(it.clientId, p), onRemove: props.items.length > 1 ? () => props.onRemoveItem(it.clientId) : undefined }) }, it.clientId));
|
|
58
|
+
}) }) }), _jsxs("button", { type: "button", onClick: props.onAddItem, className: "inline-flex items-center gap-1 self-start rounded-md border border-dashed border-border px-3 py-2 text-sm text-muted-foreground hover:bg-accent", children: [_jsx(Plus, { "aria-hidden": true, className: "size-4" }), " Add another opportunity"] })] }));
|
|
59
|
+
}
|
|
60
|
+
function OpportunityCard({ opp, expanded, onToggle, onUpdate, onRemove, }) {
|
|
61
|
+
return (_jsxs("div", { className: "rounded-lg border border-border bg-card p-3", children: [_jsxs("div", { className: "flex items-center justify-between", children: [_jsxs("button", { type: "button", onClick: onToggle, className: "text-left flex-1", "aria-expanded": expanded, children: [_jsx("div", { className: "text-sm font-semibold", children: opp.name?.trim() || "Untitled opportunity" }), _jsxs("div", { className: "text-xs text-muted-foreground", children: [opp.category ?? "-", " \u00B7 ", opp.countryOfOrigin ?? "-", " \u00B7 ", opp.volume ?? "-", " bottles"] })] }), onRemove ? (_jsx("button", { type: "button", onClick: onRemove, "aria-label": "Remove opportunity", className: "ml-2 rounded-xs p-1 text-muted-foreground hover:bg-red-50 hover:text-red-700", children: _jsx(Trash2, { "aria-hidden": true, className: "size-4" }) })) : null] }), expanded ? (_jsxs("div", { className: "mt-3 grid grid-cols-1 gap-3 md:grid-cols-2", children: [_jsx(LabeledInput, { label: "Name", value: opp.name ?? "", onChange: (v) => onUpdate({ name: v }), required: true }), _jsx(LabeledInput, { label: "Category", value: opp.category ?? "", onChange: (v) => onUpdate({ category: v }) }), _jsx(LabeledInput, { label: "Subtype", value: opp.subtype ?? "", onChange: (v) => onUpdate({ subtype: v }) }), _jsx(LabeledInput, { label: "Country of origin (ISO-2)", value: opp.countryOfOrigin ?? "", onChange: (v) => onUpdate({ countryOfOrigin: v.toUpperCase() }) }), _jsx(LabeledInput, { label: "Packaging", value: opp.packaging ?? "", onChange: (v) => onUpdate({ packaging: v }) }), _jsx(LabeledInput, { label: "Closure", value: opp.closure ?? "", onChange: (v) => onUpdate({ closure: v }) }), _jsx(LabeledInput, { label: "Volume (bottles)", type: "number", value: opp.volume ?? "", onChange: (v) => onUpdate({ volume: v ? Number(v) : undefined }) })] })) : null] }));
|
|
62
|
+
}
|
|
63
|
+
function LabeledInput({ label, value, onChange, type = "text", required, }) {
|
|
64
|
+
const [internal, setInternal] = React.useState(String(value ?? ""));
|
|
65
|
+
// Sync from parent when value changes externally (e.g. item replaced)
|
|
66
|
+
const prevValueRef = React.useRef(String(value ?? ""));
|
|
67
|
+
React.useEffect(() => {
|
|
68
|
+
const next = String(value ?? "");
|
|
69
|
+
if (next !== prevValueRef.current) {
|
|
70
|
+
// eslint-disable-next-line @eslint-react/set-state-in-effect -- idempotent: only updates when value differs from previous
|
|
71
|
+
setInternal(next);
|
|
72
|
+
prevValueRef.current = next;
|
|
73
|
+
}
|
|
74
|
+
}, [value]);
|
|
75
|
+
return (_jsxs("label", { className: "block text-sm", children: [_jsxs("span", { className: "block font-medium", children: [label, required ? " *" : ""] }), _jsx("input", { type: type, value: internal, onChange: (e) => {
|
|
76
|
+
setInternal(e.target.value);
|
|
77
|
+
onChange(e.target.value);
|
|
78
|
+
}, required: required, className: "mt-1 w-full rounded-xs border border-border bg-background px-3 py-2 text-sm" })] }));
|
|
79
|
+
}
|
|
80
|
+
//# sourceMappingURL=step-opportunities.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"step-opportunities.js","sourceRoot":"","sources":["../../../src/opportunities/wizard/step-opportunities.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AACzD,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAC5C,OAAO,EAAE,EAAE,EAAE,MAAM,iBAAiB,CAAC;AAGrC,MAAM,oBAAoB,GAAG,EAAE,CAAC;AAShC,SAAS,kBAAkB;IACzB,OAAO;QACL,QAAQ,EAAE,MAAM,CAAC,UAAU,EAAE;QAC7B,IAAI,EAAE,EAAE;KACT,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,iBAAiB,CAAC,EAAE,KAAK,EAAE,QAAQ,EAAE,gBAAgB,EAAE,SAAS,EAA0B;IACxG,MAAM,CAAC,WAAW,EAAE,cAAc,CAAC,GAAG,KAAK,CAAC,QAAQ,CAAc,GAAG,EAAE,CAAC,IAAI,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC;IAE7G,MA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,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { OpportunityDraft } from "./wizard.types";
|
|
2
|
+
export interface StepPricingTimelineProps {
|
|
3
|
+
items: OpportunityDraft[];
|
|
4
|
+
onChange: (next: OpportunityDraft[]) => void;
|
|
5
|
+
onValidityChange?: (valid: boolean) => void;
|
|
6
|
+
className?: string;
|
|
7
|
+
}
|
|
8
|
+
export declare function StepPricingTimeline({ items, onChange, onValidityChange, className }: StepPricingTimelineProps): import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
//# sourceMappingURL=step-pricing-timeline.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"step-pricing-timeline.d.ts","sourceRoot":"","sources":["../../../src/opportunities/wizard/step-pricing-timeline.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,gBAAgB,EAAgB,MAAM,gBAAgB,CAAC;AAErE,MAAM,WAAW,wBAAwB;IACvC,KAAK,EAAE,gBAAgB,EAAE,CAAC;IAC1B,QAAQ,EAAE,CAAC,IAAI,EAAE,gBAAgB,EAAE,KAAK,IAAI,CAAC;IAC7C,gBAAgB,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI,CAAC;IAC5C,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAeD,wBAAgB,mBAAmB,CAAC,EAAE,KAAK,EAAE,QAAQ,EAAE,gBAAgB,EAAE,SAAS,EAAE,EAAE,wBAAwB,2CA8F7G"}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
import * as Tabs from "@radix-ui/react-tabs";
|
|
4
|
+
import { cn } from "../../lib/utils";
|
|
5
|
+
const pricingKeys = ["priceMin", "priceMax", "currency", "targetMargin", "distributionRequirements", "submissionDeadline", "sampleDeadline", "launchDate"];
|
|
6
|
+
function isComplete(it) {
|
|
7
|
+
return (it.priceMin != null &&
|
|
8
|
+
it.priceMax != null &&
|
|
9
|
+
it.priceMin <= it.priceMax &&
|
|
10
|
+
!!it.submissionDeadline &&
|
|
11
|
+
(!it.sampleDeadline || it.sampleDeadline <= it.submissionDeadline) &&
|
|
12
|
+
(!it.launchDate || it.launchDate >= it.submissionDeadline));
|
|
13
|
+
}
|
|
14
|
+
export function StepPricingTimeline({ items, onChange, onValidityChange, className }) {
|
|
15
|
+
const firstId = items[0]?.clientId;
|
|
16
|
+
const [activeId, setActiveId] = React.useState(firstId ?? "");
|
|
17
|
+
React.useEffect(() => {
|
|
18
|
+
if (!items.some(i => i.clientId === activeId)) {
|
|
19
|
+
// eslint-disable-next-line @eslint-react/set-state-in-effect -- idempotent: only updates when activeId is stale (not in items)
|
|
20
|
+
setActiveId(items[0]?.clientId ?? "");
|
|
21
|
+
}
|
|
22
|
+
}, [items, activeId]);
|
|
23
|
+
const updateItem = (clientId, patch) => {
|
|
24
|
+
onChange(items.map(it => it.clientId === clientId ? { ...it, ...patch } : it));
|
|
25
|
+
};
|
|
26
|
+
const fillFromFirst = () => {
|
|
27
|
+
if (items.length < 2)
|
|
28
|
+
return;
|
|
29
|
+
const src = items[0];
|
|
30
|
+
const confirmed = window.confirm(`Apply opportunity 1's pricing and timeline to all ${items.length - 1} other opportunit${items.length - 1 === 1 ? "y" : "ies"}?`);
|
|
31
|
+
if (!confirmed)
|
|
32
|
+
return;
|
|
33
|
+
const copyFields = {};
|
|
34
|
+
for (const k of pricingKeys) {
|
|
35
|
+
copyFields[k] = src[k];
|
|
36
|
+
}
|
|
37
|
+
onChange(items.map((it, i) => i === 0 ? it : { ...it, ...copyFields }));
|
|
38
|
+
};
|
|
39
|
+
React.useEffect(() => {
|
|
40
|
+
const allValid = items.length > 0 && items.every(isComplete);
|
|
41
|
+
onValidityChange?.(allValid);
|
|
42
|
+
}, [items, onValidityChange]);
|
|
43
|
+
if (items.length === 0) {
|
|
44
|
+
return _jsx("p", { className: "text-sm text-muted-foreground", children: "Add at least one opportunity in Step 2 to configure pricing." });
|
|
45
|
+
}
|
|
46
|
+
return (_jsxs("div", { className: cn("flex flex-col gap-4", className), children: [items.length > 1 ? (_jsxs("div", { className: "flex items-center justify-between", children: [_jsxs("p", { className: "text-xs text-muted-foreground", children: [items.length, " opportunities"] }), _jsx("button", { type: "button", onClick: fillFromFirst, className: "rounded-md border border-border bg-background px-3 py-1.5 text-xs hover:bg-accent", children: "Fill from opportunity 1" })] })) : null, items.length === 1 ? (_jsx(PricingFields, { opp: items[0], onUpdate: (p) => updateItem(items[0].clientId, p) }, items[0].clientId)) : (_jsxs(Tabs.Root, { value: activeId, onValueChange: setActiveId, activationMode: "manual", children: [_jsx(Tabs.List, { className: "flex flex-wrap gap-1 border-b border-border overflow-x-auto", "aria-label": "Opportunities pricing tabs", children: items.map((it, idx) => {
|
|
47
|
+
const complete = isComplete(it);
|
|
48
|
+
const title = it.name?.trim() || `Opportunity ${idx + 1}`;
|
|
49
|
+
return (_jsxs(Tabs.Trigger, { value: it.clientId, className: "inline-flex items-center gap-1 rounded-t-md px-3 py-2 text-xs font-medium data-[state=active]:bg-accent focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-emerald-500", children: [_jsx("span", { "aria-hidden": true, className: cn("size-2 rounded-full", complete ? "bg-emerald-600" : "bg-amber-400") }), title] }, it.clientId));
|
|
50
|
+
}) }), items.map(it => (_jsx(Tabs.Content, { value: it.clientId, className: "pt-4", children: _jsx(PricingFields, { opp: it, onUpdate: (p) => updateItem(it.clientId, p) }, it.clientId) }, it.clientId)))] }))] }));
|
|
51
|
+
}
|
|
52
|
+
function PricingFields({ opp, onUpdate }) {
|
|
53
|
+
// Local state mirrors props so validation errors show immediately on user input
|
|
54
|
+
// even when the parent's onChange is a no-op (e.g., in tests or uncontrolled usage).
|
|
55
|
+
const [local, setLocal] = React.useState({});
|
|
56
|
+
// Merge: props win unless local has an explicit override (tracked by key presence).
|
|
57
|
+
const merged = { ...opp, ...local };
|
|
58
|
+
const update = (patch) => {
|
|
59
|
+
setLocal(prev => ({ ...prev, ...patch }));
|
|
60
|
+
onUpdate(patch);
|
|
61
|
+
};
|
|
62
|
+
return (_jsxs("div", { className: "grid grid-cols-1 gap-4 md:grid-cols-2", children: [_jsxs("label", { className: "block text-sm", children: [_jsx("span", { className: "block font-medium", children: "Price min" }), _jsx("input", { "aria-label": "Price min", type: "number", min: "0", step: "0.01", value: merged.priceMin ?? "", onChange: (e) => update({ priceMin: e.target.value === "" ? undefined : Number(e.target.value) }), className: "mt-1 w-full rounded-md border border-border bg-background px-3 py-2 text-sm" })] }), _jsxs("label", { className: "block text-sm", children: [_jsx("span", { className: "block font-medium", children: "Price max" }), _jsx("input", { "aria-label": "Price max", type: "number", min: "0", step: "0.01", value: merged.priceMax ?? "", onChange: (e) => update({ priceMax: e.target.value === "" ? undefined : Number(e.target.value) }), className: "mt-1 w-full rounded-md border border-border bg-background px-3 py-2 text-sm" }), merged.priceMin != null && merged.priceMax != null && merged.priceMin > merged.priceMax ? (_jsx("p", { className: "mt-1 text-xs text-red-700", children: "Maximum price must be at least the minimum." })) : null] }), _jsxs("label", { className: "block text-sm", children: [_jsx("span", { className: "block font-medium", children: "Currency" }), _jsxs("select", { "aria-label": "Currency", value: merged.currency ?? "", onChange: (e) => update({ currency: (e.target.value || undefined) }), className: "mt-1 w-full rounded-md border border-border bg-background px-3 py-2 text-sm", children: [_jsx("option", { value: "", children: "Select..." }), ["EUR", "USD", "SEK", "NOK", "DKK", "GBP", "CHF", "JPY"].map(c => _jsx("option", { value: c, children: c }, c))] })] }), _jsxs("label", { className: "block text-sm", children: [_jsx("span", { className: "block font-medium", children: "Target margin (0-1)" }), _jsx("input", { "aria-label": "Target margin", type: "number", min: "0", max: "1", step: "0.01", value: merged.targetMargin ?? "", onChange: (e) => update({ targetMargin: e.target.value === "" ? undefined : Number(e.target.value) }), className: "mt-1 w-full rounded-md border border-border bg-background px-3 py-2 text-sm" })] }), _jsxs("label", { className: "block text-sm md:col-span-2", children: [_jsx("span", { className: "block font-medium", children: "Distribution requirements (optional)" }), _jsx("textarea", { "aria-label": "Distribution requirements", rows: 3, value: merged.distributionRequirements ?? "", onChange: (e) => update({ distributionRequirements: e.target.value }), className: "mt-1 w-full rounded-md border border-border bg-background px-3 py-2 text-sm" })] }), _jsxs("label", { className: "block text-sm", children: [_jsx("span", { className: "block font-medium", children: "Submission deadline *" }), _jsx("input", { "aria-label": "Submission deadline", type: "date", value: merged.submissionDeadline ? merged.submissionDeadline.toISOString().slice(0, 10) : "", onChange: (e) => update({ submissionDeadline: e.target.value ? new Date(e.target.value) : undefined }), className: "mt-1 w-full rounded-md border border-border bg-background px-3 py-2 text-sm" })] }), _jsxs("label", { className: "block text-sm", children: [_jsx("span", { className: "block font-medium", children: "Sample deadline (optional)" }), _jsx("input", { "aria-label": "Sample deadline", type: "date", value: merged.sampleDeadline ? merged.sampleDeadline.toISOString().slice(0, 10) : "", onChange: (e) => update({ sampleDeadline: e.target.value ? new Date(e.target.value) : undefined }), className: "mt-1 w-full rounded-md border border-border bg-background px-3 py-2 text-sm" }), merged.sampleDeadline && merged.submissionDeadline && merged.sampleDeadline > merged.submissionDeadline ? (_jsx("p", { className: "mt-1 text-xs text-red-700", children: "Sample deadline must be on or before the submission deadline." })) : null] }), _jsxs("label", { className: "block text-sm", children: [_jsx("span", { className: "block font-medium", children: "Launch date (optional)" }), _jsx("input", { "aria-label": "Launch date", type: "date", value: merged.launchDate ? merged.launchDate.toISOString().slice(0, 10) : "", onChange: (e) => update({ launchDate: e.target.value ? new Date(e.target.value) : undefined }), className: "mt-1 w-full rounded-md border border-border bg-background px-3 py-2 text-sm" }), merged.launchDate && merged.submissionDeadline && merged.launchDate < merged.submissionDeadline ? (_jsx("p", { className: "mt-1 text-xs text-red-700", children: "Launch date must be on or after the submission deadline." })) : null] })] }));
|
|
63
|
+
}
|
|
64
|
+
//# sourceMappingURL=step-pricing-timeline.js.map
|
|
@@ -0,0 +1 @@
|
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C,CAAC,IAAI,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,SAAS,EAAE,CAAC,EAClG,SAAS,EAAC,6EAA6E,GACvF,EACD,MAAM,CAAC,cAAc,IAAI,MAAM,CAAC,kBAAkB,IAAI,MAAM,CAAC,cAAc,GAAG,MAAM,CAAC,kBAAkB,CAAC,CAAC,CAAC,CACzG,YAAG,SAAS,EAAC,2BAA2B,8EAAkE,CAC3G,CAAC,CAAC,CAAC,IAAI,IACF,EACR,iBAAO,SAAS,EAAC,eAAe,aAC9B,eAAM,SAAS,EAAC,mBAAmB,uCAA8B,EACjE,8BACa,aAAa,EACxB,IAAI,EAAC,MAAM,EACX,KAAK,EAAE,MAAM,CAAC,UAAU,CAAC,CAAC,CAAC,MAAM,CAAC,UAAU,CAAC,WAAW,EAAE,CAAC,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,EAC5E,QAAQ,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,MAAM,CAAC,EAAE,UAAU,EAAE,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,SAAS,EAAE,CAAC,EAC9F,SAAS,EAAC,6EAA6E,GACvF,EACD,MAAM,CAAC,UAAU,IAAI,MAAM,CAAC,kBAAkB,IAAI,MAAM,CAAC,UAAU,GAAG,MAAM,CAAC,kBAAkB,CAAC,CAAC,CAAC,CACjG,YAAG,SAAS,EAAC,2BAA2B,yEAA6D,CACtG,CAAC,CAAC,CAAC,IAAI,IACF,IACJ,CACP,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { TenderDraft, OpportunityDraft } from "./wizard.types";
|
|
2
|
+
import type { OpportunityView } from "../types";
|
|
3
|
+
export interface StepReviewProps {
|
|
4
|
+
tender: Partial<TenderDraft>;
|
|
5
|
+
className?: string;
|
|
6
|
+
}
|
|
7
|
+
export declare function draftToView(tenderName: string, targetCountry: string, opp: OpportunityDraft): OpportunityView;
|
|
8
|
+
export declare function StepReview({ tender, className }: StepReviewProps): import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
//# sourceMappingURL=step-review.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"step-review.d.ts","sourceRoot":"","sources":["../../../src/opportunities/wizard/step-review.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,WAAW,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AACpE,OAAO,KAAK,EAAE,eAAe,EAAgB,MAAM,UAAU,CAAC;AAE9D,MAAM,WAAW,eAAe;IAC9B,MAAM,EAAE,OAAO,CAAC,WAAW,CAAC,CAAC;IAC7B,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,wBAAgB,WAAW,CAAC,UAAU,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,EAAE,GAAG,EAAE,gBAAgB,GAAG,eAAe,CAe7G;AAED,wBAAgB,UAAU,CAAC,EAAE,MAAM,EAAE,SAAS,EAAE,EAAE,eAAe,2CAsDhE"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { OpportunityStackedCard } from "../opportunity-stacked-card";
|
|
3
|
+
import { ChannelBadge } from "../opportunity-channel-badge";
|
|
4
|
+
import { CountdownPill } from "../../components/countdown-pill";
|
|
5
|
+
import { cn } from "../../lib/utils";
|
|
6
|
+
export function draftToView(tenderName, targetCountry, opp) {
|
|
7
|
+
const subtitleFacts = [];
|
|
8
|
+
if (opp.category)
|
|
9
|
+
subtitleFacts.push({ type: "text", text: opp.category });
|
|
10
|
+
if (opp.volume != null)
|
|
11
|
+
subtitleFacts.push({ type: "count", value: opp.volume, suffix: "bottles" });
|
|
12
|
+
return {
|
|
13
|
+
id: opp.clientId,
|
|
14
|
+
tenderId: "draft",
|
|
15
|
+
productName: opp.name?.trim() || "Untitled opportunity",
|
|
16
|
+
buyerName: tenderName || "Your tender",
|
|
17
|
+
countryCode: opp.countryOfOrigin ?? targetCountry ?? "",
|
|
18
|
+
subtitleFacts,
|
|
19
|
+
deadline: opp.submissionDeadline ?? null,
|
|
20
|
+
status: "open",
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
export function StepReview({ tender, className }) {
|
|
24
|
+
const opps = tender.opportunities ?? [];
|
|
25
|
+
return (_jsxs("div", { className: cn("flex flex-col gap-5", className), children: [_jsxs("section", { className: "rounded-lg border border-border bg-card p-4", children: [_jsx("h3", { className: "text-sm font-semibold", children: "Tender summary" }), _jsxs("dl", { className: "mt-3 grid grid-cols-1 gap-x-6 gap-y-2 text-sm md:grid-cols-2", children: [_jsxs("div", { children: [_jsx("dt", { className: "text-xs font-medium uppercase tracking-wide text-muted-foreground", children: "Name" }), _jsx("dd", { className: "mt-0.5", children: tender.name || "-" })] }), _jsxs("div", { children: [_jsx("dt", { className: "text-xs font-medium uppercase tracking-wide text-muted-foreground", children: "Target country" }), _jsx("dd", { className: "mt-0.5", children: tender.targetCountry || "-" })] }), tender.instructions ? (_jsxs("div", { className: "md:col-span-2", children: [_jsx("dt", { className: "text-xs font-medium uppercase tracking-wide text-muted-foreground", children: "Instructions" }), _jsx("dd", { className: "mt-0.5 whitespace-pre-wrap", children: tender.instructions })] })) : null] })] }), _jsxs("section", { children: [_jsx("h3", { className: "text-sm font-semibold mb-2", children: "Opportunities producers will see" }), opps.length === 0 ? (_jsx("p", { className: "text-sm text-muted-foreground", children: "No opportunities yet - go back to Step 2." })) : (_jsx("div", { className: "flex flex-col gap-2", children: opps.map(opp => {
|
|
26
|
+
const view = draftToView(tender.name ?? "", tender.targetCountry ?? "", opp);
|
|
27
|
+
return (_jsx(OpportunityStackedCard, { opportunity: view, leftBadge: _jsx(ChannelBadge, { channel: "importer" }), metaRight: _jsx(CountdownPill, { date: view.deadline }), primaryAction: null, readOnly: true, tabs: [{
|
|
28
|
+
id: "overview",
|
|
29
|
+
label: "Overview",
|
|
30
|
+
content: _jsx("div", { className: "p-3 text-xs text-muted-foreground", children: "Producers see the full detail here." }),
|
|
31
|
+
}] }, opp.clientId));
|
|
32
|
+
}) }))] })] }));
|
|
33
|
+
}
|
|
34
|
+
//# sourceMappingURL=step-review.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"step-review.js","sourceRoot":"","sources":["../../../src/opportunities/wizard/step-review.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAC;AACrE,OAAO,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAC;AAC5D,OAAO,EAAE,aAAa,EAAE,MAAM,iCAAiC,CAAC;AAChE,OAAO,EAAE,EAAE,EAAE,MAAM,iBAAiB,CAAC;AASrC,MAAM,UAAU,WAAW,CAAC,UAAkB,EAAE,aAAqB,EAAE,GAAqB;IAC1F,MAAM,aAAa,GAAmB,EAAE,CAAC;IACzC,IAAI,GAAG,CAAC,QAAQ;QAAE,aAAa,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,GAAG,CAAC,QAAQ,EAAE,CAAC,CAAC;IAC3E,IAAI,GAAG,CAAC,MAAM,IAAI,IAAI;QAAE,aAAa,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,CAAC,CAAC;IAEpG,OAAO;QACL,EAAE,EAAE,GAAG,CAAC,QAAQ;QAChB,QAAQ,EAAE,OAAO;QACjB,WAAW,EAAE,GAAG,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,sBAAsB;QACvD,SAAS,EAAE,UAAU,IAAI,aAAa;QACtC,WAAW,EAAE,GAAG,CAAC,eAAe,IAAI,aAAa,IAAI,EAAE;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AAE,EAAE,GAAG,CAAC,CAAC;4BAC7E,OAAO,CACL,KAAC,sBAAsB,IAErB,WAAW,EAAE,IAAI,EACjB,SAAS,EAAE,KAAC,YAAY,IAAC,OAAO,EAAC,UAAU,GAAG,EAC9C,SAAS,EAAE,KAAC,aAAa,IAAC,IAAI,EAAE,IAAI,CAAC,QAAQ,GAAI,EACjD,aAAa,EAAE,IAAI,EACnB,QAAQ,QACR,IAAI,EAAE,CAAC;wCACL,EAAE,EAAE,UAAU;wCACd,KAAK,EAAE,UAAU;wCACjB,OAAO,EAAE,cAAK,SAAS,EAAC,mCAAmC,oDAA0C;qCACtG,CAAC,IAVG,GAAG,CAAC,QAAQ,CAWjB,CACH,CAAC;wBACJ,CAAC,CAAC,GACE,CACP,IACO,IACN,CACP,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
declare const stepSchema: z.ZodObject<{
|
|
3
|
+
name: z.ZodString;
|
|
4
|
+
targetCountry: z.ZodString;
|
|
5
|
+
instructions: z.ZodOptional<z.ZodString>;
|
|
6
|
+
}, z.core.$strip>;
|
|
7
|
+
export type StepTenderBasicsValues = z.infer<typeof stepSchema>;
|
|
8
|
+
export interface StepTenderBasicsProps {
|
|
9
|
+
initialValues?: Partial<StepTenderBasicsValues>;
|
|
10
|
+
onChange: (partial: Partial<StepTenderBasicsValues>) => void;
|
|
11
|
+
onValidityChange?: (valid: boolean) => void;
|
|
12
|
+
className?: string;
|
|
13
|
+
}
|
|
14
|
+
export declare function StepTenderBasics({ initialValues, onChange, onValidityChange, className }: StepTenderBasicsProps): import("react/jsx-runtime").JSX.Element;
|
|
15
|
+
export {};
|
|
16
|
+
//# sourceMappingURL=step-tender-basics.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"step-tender-basics.d.ts","sourceRoot":"","sources":["../../../src/opportunities/wizard/step-tender-basics.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,QAAA,MAAM,UAAU;;;;iBAId,CAAC;AACH,MAAM,MAAM,sBAAsB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,UAAU,CAAC,CAAC;AAEhE,MAAM,WAAW,qBAAqB;IACpC,aAAa,CAAC,EAAE,OAAO,CAAC,sBAAsB,CAAC,CAAC;IAChD,QAAQ,EAAE,CAAC,OAAO,EAAE,OAAO,CAAC,sBAAsB,CAAC,KAAK,IAAI,CAAC;IAC7D,gBAAgB,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI,CAAC;IAC5C,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,wBAAgB,gBAAgB,CAAC,EAAE,aAAa,EAAE,QAAQ,EAAE,gBAAgB,EAAE,SAAS,EAAE,EAAE,qBAAqB,2CA8E/G"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
import { useForm } from "react-hook-form";
|
|
4
|
+
import { zodResolver } from "@hookform/resolvers/zod";
|
|
5
|
+
import { z } from "zod";
|
|
6
|
+
import { CountryFlag } from "../../components/country-flag";
|
|
7
|
+
import { cn } from "../../lib/utils";
|
|
8
|
+
const stepSchema = z.object({
|
|
9
|
+
name: z.string().min(2, "Give the tender a name (min 2 chars).").max(200, "Name must be 200 chars or fewer."),
|
|
10
|
+
targetCountry: z.string().length(2, "Select a 2-letter ISO country code."),
|
|
11
|
+
instructions: z.string().max(2000).optional(),
|
|
12
|
+
});
|
|
13
|
+
export function StepTenderBasics({ initialValues, onChange, onValidityChange, className }) {
|
|
14
|
+
const { register, watch, formState } = useForm({
|
|
15
|
+
resolver: zodResolver(stepSchema),
|
|
16
|
+
defaultValues: {
|
|
17
|
+
name: initialValues?.name ?? "",
|
|
18
|
+
targetCountry: initialValues?.targetCountry ?? "",
|
|
19
|
+
instructions: initialValues?.instructions ?? "",
|
|
20
|
+
},
|
|
21
|
+
mode: "onBlur",
|
|
22
|
+
});
|
|
23
|
+
// Emit changes upward on every field change (for autosave at parent level).
|
|
24
|
+
React.useEffect(() => {
|
|
25
|
+
// eslint-disable-next-line react-hooks/incompatible-library -- react-hook-form's watch() is a known exception; it returns a subscription not a memoized function
|
|
26
|
+
const sub = watch((values) => {
|
|
27
|
+
onChange({
|
|
28
|
+
name: values.name,
|
|
29
|
+
targetCountry: values.targetCountry,
|
|
30
|
+
instructions: values.instructions,
|
|
31
|
+
});
|
|
32
|
+
});
|
|
33
|
+
return () => sub.unsubscribe();
|
|
34
|
+
}, [watch, onChange]);
|
|
35
|
+
React.useEffect(() => { onValidityChange?.(formState.isValid); }, [formState.isValid, onValidityChange]);
|
|
36
|
+
const currentCountry = watch("targetCountry");
|
|
37
|
+
return (_jsxs("form", { className: cn("flex flex-col gap-5 max-w-xl", className), onSubmit: (e) => e.preventDefault(), children: [_jsxs("div", { children: [_jsx("label", { htmlFor: "tender-name", className: "block text-sm font-medium", children: "Tender name" }), _jsx("input", { id: "tender-name", type: "text", ...register("name"), "aria-invalid": !!formState.errors.name || undefined, "aria-describedby": formState.errors.name ? "tender-name-err" : undefined, className: "mt-1 w-full rounded-md border border-border bg-background px-3 py-2 text-sm", placeholder: "e.g. Systembolaget Q2 2026 RFP" }), formState.errors.name ? _jsx("p", { id: "tender-name-err", className: "mt-1 text-xs text-red-700", children: formState.errors.name.message }) : null] }), _jsxs("div", { children: [_jsx("label", { htmlFor: "tender-country", className: "block text-sm font-medium", children: "Target country (ISO-3166)" }), _jsxs("div", { className: "mt-1 flex items-center gap-2", children: [_jsx("input", { id: "tender-country", type: "text", maxLength: 2, ...register("targetCountry", { setValueAs: (v) => (v ? v.toUpperCase() : "") }), "aria-invalid": !!formState.errors.targetCountry || undefined, "aria-describedby": formState.errors.targetCountry ? "tender-country-err" : undefined, className: "w-20 rounded-md border border-border bg-background px-3 py-2 text-sm uppercase", placeholder: "SE" }), currentCountry && currentCountry.length === 2 ? _jsx(CountryFlag, { code: currentCountry }) : null] }), formState.errors.targetCountry ? _jsx("p", { id: "tender-country-err", className: "mt-1 text-xs text-red-700", children: formState.errors.targetCountry.message }) : null] }), _jsxs("div", { children: [_jsx("label", { htmlFor: "tender-instructions", className: "block text-sm font-medium", children: "Instructions (optional)" }), _jsx("textarea", { id: "tender-instructions", rows: 5, ...register("instructions"), className: "mt-1 w-full rounded-md border border-border bg-background px-3 py-2 text-sm", placeholder: "Describe the procurement round - submission expectations, contact points, volumes, etc." }), _jsx("p", { className: "mt-1 text-xs text-muted-foreground", children: "Up to 2000 characters. Supports plain text." })] })] }));
|
|
38
|
+
}
|
|
39
|
+
//# sourceMappingURL=step-tender-basics.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"step-tender-basics.js","sourceRoot":"","sources":["../../../src/opportunities/wizard/step-tender-basics.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAC1C,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AACtD,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,WAAW,EAAE,MAAM,+BAA+B,CAAC;AAC5D,OAAO,EAAE,EAAE,EAAE,MAAM,iBAAiB,CAAC;AAErC,MAAM,UAAU,GAAG,CAAC,CAAC,MAAM,CAAC;IAC1B,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,EAAE,uCAAuC,CAAC,CAAC,GAAG,CAAC,GAAG,EAAE,kCAAkC,CAAC;IAC7G,aAAa,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,MAAM,CAAC,CAAC,EAAE,qCAAqC,CAAC;IAC1E,YAAY,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,IAAI,CAAC,C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IAAC,IAAI,EAAE,cAAc,GAAI,CAAC,CAAC,CAAC,IAAI,IACzF,EACL,SAAS,CAAC,MAAM,CAAC,aAAa,CAAC,CAAC,CAAC,YAAG,EAAE,EAAC,oBAAoB,EAAC,SAAS,EAAC,2BAA2B,YAAE,SAAS,CAAC,MAAM,CAAC,aAAa,CAAC,OAAO,GAAK,CAAC,CAAC,CAAC,IAAI,IAClJ,EAEN,0BACE,gBAAO,OAAO,EAAC,qBAAqB,EAAC,SAAS,EAAC,2BAA2B,wCAAgC,EAC1G,mBACE,EAAE,EAAC,qBAAqB,EACxB,IAAI,EAAE,CAAC,KACH,QAAQ,CAAC,cAAc,CAAC,EAC5B,SAAS,EAAC,6EAA6E,EACvF,WAAW,EAAC,yFAAyF,GACrG,EACF,YAAG,SAAS,EAAC,oCAAoC,4DAAgD,IAC7F,IACD,CACR,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import type { DraftState, TenderDraft } from "./wizard.types";
|
|
2
|
+
export interface UseWizardDraftOptions {
|
|
3
|
+
/** Create a fresh draft on the server. Returns the new draft id + version. */
|
|
4
|
+
create: (initial: Partial<TenderDraft>) => Promise<{
|
|
5
|
+
id: string;
|
|
6
|
+
version: number;
|
|
7
|
+
}>;
|
|
8
|
+
/** PATCH an existing draft. Pass current version for If-Match. Should throw an error with
|
|
9
|
+
* `status === 409` (or similar) on optimistic-lock conflict. Resolves with the new version. */
|
|
10
|
+
patch: (id: string, fields: Partial<TenderDraft>, version: number) => Promise<{
|
|
11
|
+
version: number;
|
|
12
|
+
}>;
|
|
13
|
+
/** If resuming an existing draft, pass its id (and initial state). */
|
|
14
|
+
initialDraftId?: string;
|
|
15
|
+
initialDraft?: Partial<TenderDraft>;
|
|
16
|
+
initialVersion?: number;
|
|
17
|
+
autosaveDebounceMs?: number;
|
|
18
|
+
/** When true, local changes are staged but NEVER auto-PATCHed. Used by edit-mode. */
|
|
19
|
+
disableAutosave?: boolean;
|
|
20
|
+
/** Optional resume payload from localStorage. When present, hook sets
|
|
21
|
+
* `resumeSuggestion: "local"` so the UI can show a "Keep local / Use server" banner. */
|
|
22
|
+
localStorageSnapshot?: {
|
|
23
|
+
draft: Partial<TenderDraft>;
|
|
24
|
+
updatedAt: number;
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
export interface UseWizardDraftReturn {
|
|
28
|
+
state: DraftState;
|
|
29
|
+
draft: Partial<TenderDraft>;
|
|
30
|
+
applyChange: (fields: Partial<TenderDraft>) => void;
|
|
31
|
+
flush: () => Promise<void>;
|
|
32
|
+
retryCount: number;
|
|
33
|
+
localOnly: boolean;
|
|
34
|
+
conflictDetected: boolean;
|
|
35
|
+
acceptServerConflict: (serverDraft: Partial<TenderDraft>, serverVersion: number) => void;
|
|
36
|
+
resumeSuggestion: "local" | null;
|
|
37
|
+
acceptLocalResume: () => void;
|
|
38
|
+
dismissLocalResume: () => void;
|
|
39
|
+
}
|
|
40
|
+
export declare function useWizardDraft(options: UseWizardDraftOptions): UseWizardDraftReturn;
|
|
41
|
+
//# sourceMappingURL=use-wizard-draft.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-wizard-draft.d.ts","sourceRoot":"","sources":["../../../src/opportunities/wizard/use-wizard-draft.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAQ9D,MAAM,WAAW,qBAAqB;IACpC,8EAA8E;IAC9E,MAAM,EAAE,CAAC,OAAO,EAAE,OAAO,CAAC,WAAW,CAAC,KAAK,OAAO,CAAC;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IACpF;oGACgG;IAChG,KAAK,EAAE,CAAC,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,CAAC,WAAW,CAAC,EAAE,OAAO,EAAE,MAAM,KAAK,OAAO,CAAC;QAAE,OA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