@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,214 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
const LOCAL_STORAGE_PREFIX = "wizard-draft-";
|
|
3
|
+
const MAX_LOCAL_DRAFTS = 5;
|
|
4
|
+
const DEFAULT_DEBOUNCE_MS = 1500;
|
|
5
|
+
const BACKOFF_BASE_MS = 1000;
|
|
6
|
+
const BACKOFF_MAX_RETRIES = 5;
|
|
7
|
+
function collectWizardDraftKeys() {
|
|
8
|
+
const out = [];
|
|
9
|
+
const len = localStorage.length;
|
|
10
|
+
for (let i = 0; i < len; i++) {
|
|
11
|
+
const k = localStorage.key(i);
|
|
12
|
+
if (k && k.startsWith(LOCAL_STORAGE_PREFIX))
|
|
13
|
+
out.push(k);
|
|
14
|
+
}
|
|
15
|
+
return out;
|
|
16
|
+
}
|
|
17
|
+
function writeLocalStorageSnapshot(id, draft, version) {
|
|
18
|
+
try {
|
|
19
|
+
localStorage.setItem(`${LOCAL_STORAGE_PREFIX}${id}`, JSON.stringify({ draft, version, updatedAt: Date.now() }));
|
|
20
|
+
// LRU eviction
|
|
21
|
+
const keys = collectWizardDraftKeys();
|
|
22
|
+
if (keys.length > MAX_LOCAL_DRAFTS) {
|
|
23
|
+
const entries = keys
|
|
24
|
+
.map(k => {
|
|
25
|
+
try {
|
|
26
|
+
const parsed = JSON.parse(localStorage.getItem(k) ?? "{}");
|
|
27
|
+
return { k, ua: parsed?.updatedAt ?? 0 };
|
|
28
|
+
}
|
|
29
|
+
catch {
|
|
30
|
+
return { k, ua: 0 };
|
|
31
|
+
}
|
|
32
|
+
})
|
|
33
|
+
.sort((a, b) => a.ua - b.ua); // oldest first
|
|
34
|
+
const toEvict = entries.slice(0, entries.length - MAX_LOCAL_DRAFTS);
|
|
35
|
+
for (const { k } of toEvict)
|
|
36
|
+
localStorage.removeItem(k);
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
catch {
|
|
40
|
+
// QuotaExceededError — silently ignored; caller surfaces via localOnly state.
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
export function useWizardDraft(options) {
|
|
44
|
+
const { create, patch, initialDraftId, initialDraft = {}, initialVersion = 1, autosaveDebounceMs = DEFAULT_DEBOUNCE_MS, disableAutosave = false, localStorageSnapshot, } = options;
|
|
45
|
+
const [draft, setDraft] = React.useState(initialDraft);
|
|
46
|
+
const [state, setState] = React.useState(() => initialDraftId
|
|
47
|
+
? { phase: "created", draftId: initialDraftId, version: initialVersion, savingPhase: "idle", retryCount: 0 }
|
|
48
|
+
: { phase: "idle" });
|
|
49
|
+
const [localOnly, setLocalOnly] = React.useState(false);
|
|
50
|
+
const [conflictDetected, setConflictDetected] = React.useState(false);
|
|
51
|
+
const [resumeSuggestion, setResumeSuggestion] = React.useState(() => localStorageSnapshot && initialDraftId ? "local" : null);
|
|
52
|
+
// Refs to avoid stale closures and TDZ issues.
|
|
53
|
+
const draftRef = React.useRef(draft);
|
|
54
|
+
const stateRef = React.useRef(state);
|
|
55
|
+
const stagedFieldsRef = React.useRef({});
|
|
56
|
+
const debounceRef = React.useRef(null);
|
|
57
|
+
const backoffRef = React.useRef(null);
|
|
58
|
+
const flushInternalRef = React.useRef(async () => { });
|
|
59
|
+
React.useEffect(() => { draftRef.current = draft; }, [draft]);
|
|
60
|
+
React.useEffect(() => { stateRef.current = state; }, [state]);
|
|
61
|
+
const flushInternal = React.useCallback(async () => {
|
|
62
|
+
const s = stateRef.current;
|
|
63
|
+
if (s.phase !== "created")
|
|
64
|
+
return;
|
|
65
|
+
const staged = { ...stagedFieldsRef.current };
|
|
66
|
+
if (Object.keys(staged).length === 0)
|
|
67
|
+
return;
|
|
68
|
+
stagedFieldsRef.current = {};
|
|
69
|
+
setState({ ...s, savingPhase: "saving" });
|
|
70
|
+
try {
|
|
71
|
+
const { version: newVersion } = await patch(s.draftId, staged, s.version);
|
|
72
|
+
const nextState = { phase: "created", draftId: s.draftId, version: newVersion, savingPhase: "idle", retryCount: 0 };
|
|
73
|
+
stateRef.current = nextState;
|
|
74
|
+
setState(nextState);
|
|
75
|
+
setLocalOnly(false);
|
|
76
|
+
setConflictDetected(false);
|
|
77
|
+
writeLocalStorageSnapshot(s.draftId, draftRef.current, newVersion);
|
|
78
|
+
}
|
|
79
|
+
catch (err) {
|
|
80
|
+
const status = err?.status;
|
|
81
|
+
if (status === 409) {
|
|
82
|
+
// Optimistic-lock conflict — DO NOT retry. Re-stage so nothing is lost.
|
|
83
|
+
stagedFieldsRef.current = { ...staged, ...stagedFieldsRef.current };
|
|
84
|
+
setConflictDetected(true);
|
|
85
|
+
const errorState = { ...s, savingPhase: "error" };
|
|
86
|
+
stateRef.current = errorState;
|
|
87
|
+
setState(errorState);
|
|
88
|
+
return;
|
|
89
|
+
}
|
|
90
|
+
const newRetry = s.retryCount + 1;
|
|
91
|
+
if (newRetry > BACKOFF_MAX_RETRIES) {
|
|
92
|
+
const errorState = { ...s, savingPhase: "error", retryCount: newRetry };
|
|
93
|
+
stateRef.current = errorState;
|
|
94
|
+
setState(errorState);
|
|
95
|
+
setLocalOnly(true);
|
|
96
|
+
return;
|
|
97
|
+
}
|
|
98
|
+
stagedFieldsRef.current = { ...staged, ...stagedFieldsRef.current };
|
|
99
|
+
const backoff = BACKOFF_BASE_MS * Math.pow(2, newRetry - 1);
|
|
100
|
+
const errorState = { ...s, savingPhase: "error", retryCount: newRetry };
|
|
101
|
+
stateRef.current = errorState;
|
|
102
|
+
setState(errorState);
|
|
103
|
+
if (backoffRef.current)
|
|
104
|
+
clearTimeout(backoffRef.current);
|
|
105
|
+
backoffRef.current = setTimeout(() => void flushInternalRef.current(), backoff);
|
|
106
|
+
}
|
|
107
|
+
}, [patch]);
|
|
108
|
+
React.useEffect(() => { flushInternalRef.current = flushInternal; }, [flushInternal]);
|
|
109
|
+
const schedulePatch = React.useCallback(() => {
|
|
110
|
+
if (disableAutosave)
|
|
111
|
+
return;
|
|
112
|
+
if (debounceRef.current)
|
|
113
|
+
clearTimeout(debounceRef.current);
|
|
114
|
+
debounceRef.current = setTimeout(() => {
|
|
115
|
+
void flushInternalRef.current();
|
|
116
|
+
}, autosaveDebounceMs);
|
|
117
|
+
}, [autosaveDebounceMs, disableAutosave]);
|
|
118
|
+
const applyChange = React.useCallback((fields) => {
|
|
119
|
+
setDraft(prev => {
|
|
120
|
+
const next = { ...prev, ...fields };
|
|
121
|
+
draftRef.current = next;
|
|
122
|
+
return next;
|
|
123
|
+
});
|
|
124
|
+
stagedFieldsRef.current = { ...stagedFieldsRef.current, ...fields };
|
|
125
|
+
const s = stateRef.current;
|
|
126
|
+
if (s.phase === "idle") {
|
|
127
|
+
if (disableAutosave) {
|
|
128
|
+
// Edit mode: never POST. Edit-mode wizards always start in "created" with initialDraftId;
|
|
129
|
+
// if someone mistakenly lands here without an id, just stage locally and do nothing.
|
|
130
|
+
return;
|
|
131
|
+
}
|
|
132
|
+
const createPromise = create(fields).then(({ id, version }) => {
|
|
133
|
+
const nextState = { phase: "created", draftId: id, version, savingPhase: "idle", retryCount: 0 };
|
|
134
|
+
stateRef.current = nextState;
|
|
135
|
+
setState(nextState);
|
|
136
|
+
writeLocalStorageSnapshot(id, draftRef.current, version);
|
|
137
|
+
if (Object.keys(stagedFieldsRef.current).length > 0) {
|
|
138
|
+
schedulePatch();
|
|
139
|
+
}
|
|
140
|
+
return { id, version };
|
|
141
|
+
});
|
|
142
|
+
const creatingState = { phase: "creating", createPromise };
|
|
143
|
+
stateRef.current = creatingState;
|
|
144
|
+
setState(creatingState);
|
|
145
|
+
}
|
|
146
|
+
else if (s.phase === "creating") {
|
|
147
|
+
// Queue — drains on resolve.
|
|
148
|
+
}
|
|
149
|
+
else if (s.phase === "created") {
|
|
150
|
+
writeLocalStorageSnapshot(s.draftId, { ...draftRef.current, ...fields }, s.version);
|
|
151
|
+
schedulePatch();
|
|
152
|
+
}
|
|
153
|
+
}, [create, schedulePatch, disableAutosave]);
|
|
154
|
+
const flush = React.useCallback(async () => {
|
|
155
|
+
if (debounceRef.current) {
|
|
156
|
+
clearTimeout(debounceRef.current);
|
|
157
|
+
debounceRef.current = null;
|
|
158
|
+
}
|
|
159
|
+
await flushInternalRef.current();
|
|
160
|
+
}, []);
|
|
161
|
+
const acceptServerConflict = React.useCallback((serverDraft, serverVersion) => {
|
|
162
|
+
const s = stateRef.current;
|
|
163
|
+
if (s.phase !== "created")
|
|
164
|
+
return;
|
|
165
|
+
stagedFieldsRef.current = {};
|
|
166
|
+
setDraft(serverDraft);
|
|
167
|
+
draftRef.current = serverDraft;
|
|
168
|
+
const nextState = { phase: "created", draftId: s.draftId, version: serverVersion, savingPhase: "idle", retryCount: 0 };
|
|
169
|
+
stateRef.current = nextState;
|
|
170
|
+
setState(nextState);
|
|
171
|
+
setConflictDetected(false);
|
|
172
|
+
}, []);
|
|
173
|
+
const acceptLocalResume = React.useCallback(() => {
|
|
174
|
+
if (!localStorageSnapshot)
|
|
175
|
+
return;
|
|
176
|
+
setDraft(localStorageSnapshot.draft);
|
|
177
|
+
draftRef.current = localStorageSnapshot.draft;
|
|
178
|
+
stagedFieldsRef.current = { ...localStorageSnapshot.draft };
|
|
179
|
+
setResumeSuggestion(null);
|
|
180
|
+
schedulePatch();
|
|
181
|
+
}, [localStorageSnapshot, schedulePatch]);
|
|
182
|
+
const dismissLocalResume = React.useCallback(() => {
|
|
183
|
+
setResumeSuggestion(null);
|
|
184
|
+
}, []);
|
|
185
|
+
// beforeunload + visibilitychange → flush to localStorage synchronously.
|
|
186
|
+
React.useEffect(() => {
|
|
187
|
+
const handler = () => {
|
|
188
|
+
const s = stateRef.current;
|
|
189
|
+
if (s.phase === "created") {
|
|
190
|
+
writeLocalStorageSnapshot(s.draftId, draftRef.current, s.version);
|
|
191
|
+
}
|
|
192
|
+
};
|
|
193
|
+
const visHandler = () => {
|
|
194
|
+
if (document.visibilityState === "hidden")
|
|
195
|
+
handler();
|
|
196
|
+
};
|
|
197
|
+
window.addEventListener("beforeunload", handler);
|
|
198
|
+
document.addEventListener("visibilitychange", visHandler);
|
|
199
|
+
return () => {
|
|
200
|
+
window.removeEventListener("beforeunload", handler);
|
|
201
|
+
document.removeEventListener("visibilitychange", visHandler);
|
|
202
|
+
};
|
|
203
|
+
}, []);
|
|
204
|
+
const retryCount = state.phase === "created" ? state.retryCount : 0;
|
|
205
|
+
return {
|
|
206
|
+
state, draft, applyChange, flush, retryCount, localOnly,
|
|
207
|
+
conflictDetected,
|
|
208
|
+
acceptServerConflict,
|
|
209
|
+
resumeSuggestion,
|
|
210
|
+
acceptLocalResume,
|
|
211
|
+
dismissLocalResume,
|
|
212
|
+
};
|
|
213
|
+
}
|
|
214
|
+
//# sourceMappingURL=use-wizard-draft.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-wizard-draft.js","sourceRoot":"","sources":["../../../src/opportunities/wizard/use-wizard-draft.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,MAAM,oBAAoB,GAAG,eAAe,CAAC;AAC7C,MAAM,gBAAgB,GAAG,CAAC,CAAC;AAC3B,MAAM,mBAAmB,GAAG,IAAI,CAAC;AACjC,MAAM,eAAe,GAAG,IAAI,CAAC;AAC7B,MAAM,mBAAmB,GAAG,CAAC,CAAC;AAkC9B,SAAS,sBAAsB;IAC7B,MAAM,GAAG,GAAa,EAAE,CAAC;IACzB,MAAM,GAAG,GAAG,YAAY,CAAC,MAAM,CAAC;IAChC,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,GAAG,EAAE,CAAC,EAAE,EAAE,CAAC;QAC7B,MAAM,CAAC,GAAG,YAAY,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;QAC9B,IAAI,CAAC,IAAI,CAAC,CAAC,UAAU,CAAC,oBAAoB,CAAC;YAAE,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAC3D,CAAC;IACD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AC;QAC/D,CAAC,CAAC;IACJ,CAAC,EAAE,EAAE,CAAC,CAAC;IAEP,MAAM,UAAU,GAAG,KAAK,CAAC,KAAK,KAAK,SAAS,CAAC,CAAC,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC;IAEpE,OAAO;QACL,KAAK,EAAE,KAAK,EAAE,WAAW,EAAE,KAAK,EAAE,UAAU,EAAE,SAAS;QACvD,gBAAgB;QAChB,oBAAoB;QACpB,gBAAgB;QAChB,iBAAiB;QACjB,kBAAkB;KACnB,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
export interface WizardStep {
|
|
3
|
+
id: string;
|
|
4
|
+
label: string;
|
|
5
|
+
}
|
|
6
|
+
export interface WizardStepperProps {
|
|
7
|
+
steps: readonly WizardStep[];
|
|
8
|
+
currentIndex: number;
|
|
9
|
+
completedIndexes: readonly number[];
|
|
10
|
+
/** Optional sub-status under the active step label, e.g. "Autosaved 2s ago". */
|
|
11
|
+
activeSubStatus?: React.ReactNode;
|
|
12
|
+
onJumpBack: (index: number) => void;
|
|
13
|
+
className?: string;
|
|
14
|
+
}
|
|
15
|
+
type WizardStepperComponent = React.FC<WizardStepperProps> & {
|
|
16
|
+
Skeleton: React.FC;
|
|
17
|
+
};
|
|
18
|
+
export declare const WizardStepper: WizardStepperComponent;
|
|
19
|
+
export type { WizardStepperComponent };
|
|
20
|
+
//# sourceMappingURL=wizard-stepper.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"wizard-stepper.d.ts","sourceRoot":"","sources":["../../../src/opportunities/wizard/wizard-stepper.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAI/B,MAAM,WAAW,UAAU;IACzB,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,kBAAkB;IACjC,KAAK,EAAE,SAAS,UAAU,EAAE,CAAC;IAC7B,YAAY,EAAE,MAAM,CAAC;IACrB,gBAAgB,EAAE,SAAS,MAAM,EAAE,CAAC;IACpC,gFAAgF;IAChF,eAAe,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAClC,UAAU,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACpC,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AA+ED,KAAK,sBAAsB,GAAG,KAAK,CAAC,EAAE,CAAC,kBAAkB,CAAC,GAAG;IAC3D,QAAQ,EAAE,KAAK,CAAC,EAAE,CAAC;CACpB,CAAC;AACF,eAAO,MAAM,aAAa,EAAwB,sBAAsB,CAAC;AAEzE,YAAY,EAAE,sBAAsB,EAAE,CAAC"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Check } from "lucide-react";
|
|
3
|
+
import { cn } from "../../lib/utils";
|
|
4
|
+
function WizardStepperBase({ steps, currentIndex, completedIndexes, activeSubStatus, onJumpBack, className }) {
|
|
5
|
+
return (_jsx("nav", { "aria-label": "Wizard progress", className: className, children: _jsx("ol", { className: "flex w-full items-center gap-0 md:flex-row flex-col", children: steps.map((step, i) => {
|
|
6
|
+
const isComplete = completedIndexes.includes(i);
|
|
7
|
+
const isActive = i === currentIndex;
|
|
8
|
+
const isPending = !isComplete && !isActive;
|
|
9
|
+
const status = isComplete ? "complete" : isActive ? "active" : "pending";
|
|
10
|
+
const statusText = status === "complete" ? "complete" : status === "active" ? "in progress" : "not yet available";
|
|
11
|
+
const labelText = `Step ${i + 1} of ${steps.length}: ${step.label}, ${statusText}`;
|
|
12
|
+
return (_jsxs("li", { className: "flex flex-1 items-center", "data-status": status, children: [_jsxs("div", { className: "flex flex-col items-center", children: [_jsx("button", { type: "button", "aria-label": labelText, "aria-current": isActive ? "step" : undefined, "aria-disabled": isPending ? "true" : undefined, onClick: () => { if (isComplete)
|
|
13
|
+
onJumpBack(i); }, className: cn("size-10 rounded-full border text-sm font-semibold flex items-center justify-center transition-colors", isComplete && "bg-emerald-700 text-white border-emerald-700 hover:bg-emerald-800 cursor-pointer", isActive && "bg-background text-amber-700 border-amber-500 ring-3 ring-amber-300 motion-safe:animate-[wizard-stepper-active-glow_2s_ease-in-out_infinite]", isPending && "bg-muted text-muted-foreground border-border cursor-not-allowed"), "data-wizard-stepper-active": isActive || undefined, "data-wizard-stepper-complete": isComplete || undefined, children: isComplete ? _jsx(Check, { "aria-hidden": true, "data-wizard-checkmark": true, className: "size-5" }) : i + 1 }), _jsx("span", { className: "mt-1 text-xs font-medium text-foreground", children: step.label }), isActive && activeSubStatus ? _jsx("span", { className: "mt-0.5 text-[10px] text-muted-foreground", children: activeSubStatus }) : null] }), i < steps.length - 1 ? (_jsx("div", { className: "relative mx-2 h-0.5 flex-1 overflow-hidden rounded-full bg-[color:var(--color-wizard-connector-idle,theme(colors.slate.200))]", children: _jsx("div", { "data-wizard-connector-fill": true, style: {
|
|
14
|
+
"--connector-progress": Math.max(0, Math.min(1, currentIndex - i)).toString(),
|
|
15
|
+
transformOrigin: "left center",
|
|
16
|
+
transform: `scaleX(${Math.max(0, Math.min(1, currentIndex - i))})`,
|
|
17
|
+
}, className: "absolute inset-0 bg-[color:var(--color-wizard-connector-done,theme(colors.emerald.700))] transition-transform duration-[600ms] ease-[cubic-bezier(0.22,1,0.36,1)]" }) })) : null] }, step.id));
|
|
18
|
+
}) }) }));
|
|
19
|
+
}
|
|
20
|
+
/** Static .Skeleton — stepper is rendered from client state so this is mainly for Storybook; no cascade-index. */
|
|
21
|
+
function WizardStepperSkeleton() {
|
|
22
|
+
return (_jsx("nav", { "aria-label": "Wizard progress loading", className: "animate-pulse", children: _jsx("ol", { className: "flex items-center gap-0", children: [0, 1, 2, 3].map(i => (_jsxs("li", { className: "flex flex-1 items-center", children: [_jsxs("div", { className: "flex flex-col items-center", children: [_jsx("div", { className: "size-10 rounded-full bg-muted/60" }), _jsx("div", { className: "mt-1 h-3 w-12 rounded-xs bg-muted/40" })] }), i < 3 ? _jsx("div", { className: "mx-2 h-0.5 flex-1 rounded-full bg-muted/40" }) : null] }, i))) }) }));
|
|
23
|
+
}
|
|
24
|
+
export const WizardStepper = WizardStepperBase;
|
|
25
|
+
WizardStepper.Skeleton = WizardStepperSkeleton;
|
|
26
|
+
//# sourceMappingURL=wizard-stepper.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"wizard-stepper.js","sourceRoot":"","sources":["../../../src/opportunities/wizard/wizard-stepper.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,KAAK,EAAE,MAAM,cAAc,CAAC;AACrC,OAAO,EAAE,EAAE,EAAE,MAAM,iBAAiB,CAAC;AAiBrC,SAAS,iBAAiB,CAAC,EAAE,KAAK,EAAE,YAAY,EAAE,gBAAgB,EAAE,eAAe,EAAE,UAAU,EAAE,SAAS,EAAsB;IAC9H,OAAO,CACL,4BAAgB,iBAAiB,EAAC,SAAS,EAAE,SAAS,YACpD,aAAI,SAAS,EAAC,qDAAqD,YAChE,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,CAAC,EAAE,EAAE;gBACrB,MAAM,UAAU,GAAG,gBAAgB,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC;gBAChD,MAAM,QAAQ,GAAG,CAAC,KAAK,YAAY,CAAC;gBACpC,MAAM,SAAS,GAAG,CAAC,UAAU,IAAI,CAAC,QAAQ,CAAC;gBAC3C,MAAM,MAAM,GAAsC,UAAU,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,SAAS,CAAC;gBAC5G,MAAM,UAAU,GAAG,MAAM,KAAK,UAAU,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,MAAM,KAAK,QAAQ,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,C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AC,QAAQ,EAAE;oCAC7E,eAAe,EAAE,aAAa;oCAC9B,SAAS,EAAE,UAAU,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,YAAY,GAAG,CAAC,CAAC,CAAC,GAAG;iCAC5C,EACxB,SAAS,EAAC,mKAAmK,GAC7K,GACE,CACP,CAAC,CAAC,CAAC,IAAI,KApCD,IAAI,CAAC,EAAE,CAqCX,CACN,CAAC;YACJ,CAAC,CAAC,GACC,GACD,CACP,CAAC;AACJ,CAAC;AAED,kHAAkH;AAClH,SAAS,qBAAqB;IAC5B,OAAO,CACL,4BAAgB,yBAAyB,EAAC,SAAS,EAAC,eAAe,YACjE,aAAI,SAAS,EAAC,yBAAyB,YACpC,CAAC,CAAC,EAAC,CAAC,EAAC,CAAC,EAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAClB,cAAY,SAAS,EAAC,0BAA0B,aAC9C,eAAK,SAAS,EAAC,4BAA4B,aACzC,cAAK,SAAS,EAAC,kCAAkC,GAAG,EACpD,cAAK,SAAS,EAAC,sCAAsC,GAAG,IACpD,EACL,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,cAAK,SAAS,EAAC,4CAA4C,GAAG,CAAC,CAAC,CAAC,IAAI,KALvE,CAAC,CAML,CACN,CAAC,GACC,GACD,CACP,CAAC;AACJ,CAAC;AAKD,MAAM,CAAC,MAAM,aAAa,GAAG,iBAA2C,CAAC;AACzE,aAAa,CAAC,QAAQ,GAAG,qBAAqB,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { StoryObj } from "@storybook/react-vite";
|
|
2
|
+
declare const meta: {
|
|
3
|
+
title: string;
|
|
4
|
+
component: import("./wizard-stepper").WizardStepperComponent;
|
|
5
|
+
tags: string[];
|
|
6
|
+
};
|
|
7
|
+
export default meta;
|
|
8
|
+
type Story = StoryObj<typeof meta>;
|
|
9
|
+
export declare const AllPending: Story;
|
|
10
|
+
export declare const SecondActive: Story;
|
|
11
|
+
export declare const ThreeComplete: Story;
|
|
12
|
+
export declare const AllComplete: Story;
|
|
13
|
+
export declare const LoadingSkeleton: Story;
|
|
14
|
+
/**
|
|
15
|
+
* Wave (publish): sequentially marks all 4 steps complete to showcase the
|
|
16
|
+
* connector fill + check-mark draw when publish succeeds. Uses a setInterval
|
|
17
|
+
* so reviewers can watch the animation without any external trigger.
|
|
18
|
+
*/
|
|
19
|
+
export declare const Wave: Story;
|
|
20
|
+
/** Mobile vertical — narrow container reveals the flex-col fallback. */
|
|
21
|
+
export declare const MobileVertical: Story;
|
|
22
|
+
//# sourceMappingURL=wizard-stepper.stories.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"wizard-stepper.stories.d.ts","sourceRoot":"","sources":["../../../src/opportunities/wizard/wizard-stepper.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAQ,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAW5D,QAAA,MAAM,IAAI;;;;CAI4B,CAAC;AACvC,eAAe,IAAI,CAAC;AACpB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,IAAI,CAAC,CAAC;AAEnC,eAAO,MAAM,UAAU,EAAM,KAAwF,CAAC;AACtH,eAAO,MAAM,YAAY,EAAI,KAA8H,CAAC;AAC5J,eAAO,MAAM,aAAa,EAAG,KAA+F,CAAC;AAC7H,eAAO,MAAM,WAAW,EAAK,KAAkG,CAAC;AAChI,eAAO,MAAM,eAAe,EAAE,KAAkI,CAAC;AAgBjK;;;;GAIG;AACH,eAAO,MAAM,IAAI,EAAE,KAGlB,CAAC;AAEF,wEAAwE;AACxE,eAAO,MAAM,cAAc,EAAE,KAO5B,CAAC"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
import { WizardStepper } from "./wizard-stepper";
|
|
4
|
+
const steps = [
|
|
5
|
+
{ id: "tender", label: "Tender" },
|
|
6
|
+
{ id: "opportunities", label: "Opportunities" },
|
|
7
|
+
{ id: "pricing", label: "Pricing" },
|
|
8
|
+
{ id: "review", label: "Review" },
|
|
9
|
+
];
|
|
10
|
+
const meta = {
|
|
11
|
+
title: "Opportunities/Wizard/Stepper",
|
|
12
|
+
component: WizardStepper,
|
|
13
|
+
tags: ["autodocs"],
|
|
14
|
+
};
|
|
15
|
+
export default meta;
|
|
16
|
+
export const AllPending = { args: { steps, currentIndex: 0, completedIndexes: [], onJumpBack: () => { } } };
|
|
17
|
+
export const SecondActive = { args: { steps, currentIndex: 1, completedIndexes: [0], onJumpBack: () => { }, activeSubStatus: "Autosaved 2s ago" } };
|
|
18
|
+
export const ThreeComplete = { args: { steps, currentIndex: 3, completedIndexes: [0, 1, 2], onJumpBack: () => { } } };
|
|
19
|
+
export const AllComplete = { args: { steps, currentIndex: 3, completedIndexes: [0, 1, 2, 3], onJumpBack: () => { } } };
|
|
20
|
+
export const LoadingSkeleton = { args: { steps, currentIndex: 0, completedIndexes: [], onJumpBack: () => { } }, render: () => _jsx(WizardStepper.Skeleton, {}) };
|
|
21
|
+
function WaveDemo() {
|
|
22
|
+
const [done, setDone] = React.useState([]);
|
|
23
|
+
React.useEffect(() => {
|
|
24
|
+
// eslint-disable-next-line @eslint-react/set-state-in-effect -- intentional reset to [] on mount for animation replay
|
|
25
|
+
setDone([]);
|
|
26
|
+
const timers = [0, 400, 800, 1200].map((delay, i) =>
|
|
27
|
+
// eslint-disable-next-line @eslint-react/web-api/no-leaked-timeout -- timer cleared in cleanup via timers.forEach(clearTimeout)
|
|
28
|
+
setTimeout(() => setDone(prev => Array.from(new Set([...prev, i]))), delay));
|
|
29
|
+
return () => timers.forEach(clearTimeout);
|
|
30
|
+
}, []);
|
|
31
|
+
return _jsx(WizardStepper, { steps: steps, currentIndex: Math.min(done.length, 3), completedIndexes: done, onJumpBack: () => { } });
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Wave (publish): sequentially marks all 4 steps complete to showcase the
|
|
35
|
+
* connector fill + check-mark draw when publish succeeds. Uses a setInterval
|
|
36
|
+
* so reviewers can watch the animation without any external trigger.
|
|
37
|
+
*/
|
|
38
|
+
export const Wave = {
|
|
39
|
+
args: { steps, currentIndex: 0, completedIndexes: [], onJumpBack: () => { } },
|
|
40
|
+
render: () => _jsx(WaveDemo, {}),
|
|
41
|
+
};
|
|
42
|
+
/** Mobile vertical — narrow container reveals the flex-col fallback. */
|
|
43
|
+
export const MobileVertical = {
|
|
44
|
+
args: { steps, currentIndex: 1, completedIndexes: [0], onJumpBack: () => { } },
|
|
45
|
+
render: () => (_jsx("div", { className: "max-w-[320px]", children: _jsx(WizardStepper, { steps: steps, currentIndex: 1, completedIndexes: [0], onJumpBack: () => { }, activeSubStatus: "Autosaved just now" }) })),
|
|
46
|
+
};
|
|
47
|
+
//# sourceMappingURL=wizard-stepper.stories.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"wizard-stepper.stories.js","sourceRoot":"","sources":["../../../src/opportunities/wizard/wizard-stepper.stories.tsx"],"names":[],"mappings":";AACA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAEjD,MAAM,KAAK,GAAG;IACZ,EAAE,EAAE,EAAE,QAAQ,EAAS,KAAK,EAAE,QAAQ,EAAE;IACxC,EAAE,EAAE,EAAE,eAAe,EAAE,KAAK,EAAE,eAAe,EAAE;IAC/C,EAAE,EAAE,EAAE,SAAS,EAAQ,KAAK,EAAE,SAAS,EAAE;IACzC,EAAE,EAAE,EAAE,QAAQ,EAAS,KAAK,EAAE,QAAQ,EAAE;CACzC,CAAC;AAEF,MAAM,IAAI,GAAG;IACX,KAAK,EAAE,8BAA8B;IACrC,SAAS,EAAE,aAAa;IACxB,IAAI,EAAE,CAAC,UAAU,CAAC;CACkB,CAA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cAAK,SAAS,EAAC,eAAe,YAC5B,KAAC,aAAa,IAAC,KAAK,EAAE,KAAK,EAAE,YAAY,EAAE,CAAC,EAAE,gBAAgB,EAAE,CAAC,CAAC,CAAC,EAAE,UAAU,EAAE,GAAG,EAAE,GAAE,CAAC,EAAE,eAAe,EAAC,oBAAoB,GAAG,GAC9H,CACP;CACF,CAAC"}
|
|
@@ -0,0 +1,176 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
/** Currency codes accepted by the wizard. Extend on demand. */
|
|
3
|
+
export declare const currencyCodeSchema: z.ZodEnum<{
|
|
4
|
+
EUR: "EUR";
|
|
5
|
+
USD: "USD";
|
|
6
|
+
GBP: "GBP";
|
|
7
|
+
SEK: "SEK";
|
|
8
|
+
NOK: "NOK";
|
|
9
|
+
DKK: "DKK";
|
|
10
|
+
CHF: "CHF";
|
|
11
|
+
JPY: "JPY";
|
|
12
|
+
}>;
|
|
13
|
+
export type CurrencyCode = z.infer<typeof currencyCodeSchema>;
|
|
14
|
+
/** Packaging / closure codes — kept as loose strings for MVP; dashboards resolve labels via @cellarnode/beverage-utils. */
|
|
15
|
+
export declare const packagingCodeSchema: z.ZodString;
|
|
16
|
+
export declare const closureCodeSchema: z.ZodString;
|
|
17
|
+
export declare const categoryCodeSchema: z.ZodString;
|
|
18
|
+
export declare const subtypeCodeSchema: z.ZodString;
|
|
19
|
+
/** --- Opportunity-item schema (inside a tender) --- */
|
|
20
|
+
export declare const opportunityDraftSchema: z.ZodObject<{
|
|
21
|
+
clientId: z.ZodString;
|
|
22
|
+
id: z.ZodOptional<z.ZodString>;
|
|
23
|
+
name: z.ZodOptional<z.ZodString>;
|
|
24
|
+
category: z.ZodOptional<z.ZodString>;
|
|
25
|
+
subtype: z.ZodOptional<z.ZodString>;
|
|
26
|
+
countryOfOrigin: z.ZodOptional<z.ZodString>;
|
|
27
|
+
packaging: z.ZodOptional<z.ZodString>;
|
|
28
|
+
closure: z.ZodOptional<z.ZodString>;
|
|
29
|
+
volume: z.ZodOptional<z.ZodNumber>;
|
|
30
|
+
priceMin: z.ZodOptional<z.ZodNumber>;
|
|
31
|
+
priceMax: z.ZodOptional<z.ZodNumber>;
|
|
32
|
+
currency: z.ZodOptional<z.ZodEnum<{
|
|
33
|
+
EUR: "EUR";
|
|
34
|
+
USD: "USD";
|
|
35
|
+
GBP: "GBP";
|
|
36
|
+
SEK: "SEK";
|
|
37
|
+
NOK: "NOK";
|
|
38
|
+
DKK: "DKK";
|
|
39
|
+
CHF: "CHF";
|
|
40
|
+
JPY: "JPY";
|
|
41
|
+
}>>;
|
|
42
|
+
targetMargin: z.ZodOptional<z.ZodNumber>;
|
|
43
|
+
distributionRequirements: z.ZodOptional<z.ZodString>;
|
|
44
|
+
submissionDeadline: z.ZodOptional<z.ZodCoercedDate<unknown>>;
|
|
45
|
+
sampleDeadline: z.ZodOptional<z.ZodCoercedDate<unknown>>;
|
|
46
|
+
launchDate: z.ZodOptional<z.ZodCoercedDate<unknown>>;
|
|
47
|
+
}, z.core.$strip>;
|
|
48
|
+
export type OpportunityDraft = z.infer<typeof opportunityDraftSchema>;
|
|
49
|
+
/** --- Tender draft schema (for autosave PATCH) --- */
|
|
50
|
+
export declare const tenderDraftSchema: z.ZodObject<{
|
|
51
|
+
id: z.ZodOptional<z.ZodString>;
|
|
52
|
+
name: z.ZodOptional<z.ZodString>;
|
|
53
|
+
targetCountry: z.ZodOptional<z.ZodString>;
|
|
54
|
+
instructions: z.ZodOptional<z.ZodString>;
|
|
55
|
+
opportunities: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
56
|
+
clientId: z.ZodString;
|
|
57
|
+
id: z.ZodOptional<z.ZodString>;
|
|
58
|
+
name: z.ZodOptional<z.ZodString>;
|
|
59
|
+
category: z.ZodOptional<z.ZodString>;
|
|
60
|
+
subtype: z.ZodOptional<z.ZodString>;
|
|
61
|
+
countryOfOrigin: z.ZodOptional<z.ZodString>;
|
|
62
|
+
packaging: z.ZodOptional<z.ZodString>;
|
|
63
|
+
closure: z.ZodOptional<z.ZodString>;
|
|
64
|
+
volume: z.ZodOptional<z.ZodNumber>;
|
|
65
|
+
priceMin: z.ZodOptional<z.ZodNumber>;
|
|
66
|
+
priceMax: z.ZodOptional<z.ZodNumber>;
|
|
67
|
+
currency: z.ZodOptional<z.ZodEnum<{
|
|
68
|
+
EUR: "EUR";
|
|
69
|
+
USD: "USD";
|
|
70
|
+
GBP: "GBP";
|
|
71
|
+
SEK: "SEK";
|
|
72
|
+
NOK: "NOK";
|
|
73
|
+
DKK: "DKK";
|
|
74
|
+
CHF: "CHF";
|
|
75
|
+
JPY: "JPY";
|
|
76
|
+
}>>;
|
|
77
|
+
targetMargin: z.ZodOptional<z.ZodNumber>;
|
|
78
|
+
distributionRequirements: z.ZodOptional<z.ZodString>;
|
|
79
|
+
submissionDeadline: z.ZodOptional<z.ZodCoercedDate<unknown>>;
|
|
80
|
+
sampleDeadline: z.ZodOptional<z.ZodCoercedDate<unknown>>;
|
|
81
|
+
launchDate: z.ZodOptional<z.ZodCoercedDate<unknown>>;
|
|
82
|
+
}, z.core.$strip>>>;
|
|
83
|
+
draftCurrentStep: z.ZodOptional<z.ZodNumber>;
|
|
84
|
+
version: z.ZodOptional<z.ZodNumber>;
|
|
85
|
+
}, z.core.$strip>;
|
|
86
|
+
export type TenderDraft = z.infer<typeof tenderDraftSchema>;
|
|
87
|
+
/** --- Publish-strict schemas ---
|
|
88
|
+
* Zod v4: `code` defaults to "custom" on ctx.addIssue — omitted here.
|
|
89
|
+
* `.required({keys})` must come BEFORE `.superRefine()` — ZodEffects has no .required(). */
|
|
90
|
+
export declare const opportunityPublishSchema: z.ZodObject<{
|
|
91
|
+
clientId: z.ZodString;
|
|
92
|
+
id: z.ZodOptional<z.ZodString>;
|
|
93
|
+
name: z.ZodNonOptional<z.ZodOptional<z.ZodString>>;
|
|
94
|
+
category: z.ZodOptional<z.ZodString>;
|
|
95
|
+
subtype: z.ZodOptional<z.ZodString>;
|
|
96
|
+
countryOfOrigin: z.ZodOptional<z.ZodString>;
|
|
97
|
+
packaging: z.ZodOptional<z.ZodString>;
|
|
98
|
+
closure: z.ZodOptional<z.ZodString>;
|
|
99
|
+
volume: z.ZodOptional<z.ZodNumber>;
|
|
100
|
+
priceMin: z.ZodOptional<z.ZodNumber>;
|
|
101
|
+
priceMax: z.ZodOptional<z.ZodNumber>;
|
|
102
|
+
currency: z.ZodOptional<z.ZodEnum<{
|
|
103
|
+
EUR: "EUR";
|
|
104
|
+
USD: "USD";
|
|
105
|
+
GBP: "GBP";
|
|
106
|
+
SEK: "SEK";
|
|
107
|
+
NOK: "NOK";
|
|
108
|
+
DKK: "DKK";
|
|
109
|
+
CHF: "CHF";
|
|
110
|
+
JPY: "JPY";
|
|
111
|
+
}>>;
|
|
112
|
+
targetMargin: z.ZodOptional<z.ZodNumber>;
|
|
113
|
+
distributionRequirements: z.ZodOptional<z.ZodString>;
|
|
114
|
+
submissionDeadline: z.ZodNonOptional<z.ZodOptional<z.ZodCoercedDate<unknown>>>;
|
|
115
|
+
sampleDeadline: z.ZodOptional<z.ZodCoercedDate<unknown>>;
|
|
116
|
+
launchDate: z.ZodOptional<z.ZodCoercedDate<unknown>>;
|
|
117
|
+
}, z.core.$strip>;
|
|
118
|
+
export declare const tenderPublishSchema: z.ZodObject<{
|
|
119
|
+
id: z.ZodOptional<z.ZodString>;
|
|
120
|
+
instructions: z.ZodOptional<z.ZodString>;
|
|
121
|
+
draftCurrentStep: z.ZodOptional<z.ZodNumber>;
|
|
122
|
+
version: z.ZodOptional<z.ZodNumber>;
|
|
123
|
+
name: z.ZodString;
|
|
124
|
+
targetCountry: z.ZodString;
|
|
125
|
+
opportunities: z.ZodArray<z.ZodObject<{
|
|
126
|
+
clientId: z.ZodString;
|
|
127
|
+
id: z.ZodOptional<z.ZodString>;
|
|
128
|
+
name: z.ZodNonOptional<z.ZodOptional<z.ZodString>>;
|
|
129
|
+
category: z.ZodOptional<z.ZodString>;
|
|
130
|
+
subtype: z.ZodOptional<z.ZodString>;
|
|
131
|
+
countryOfOrigin: z.ZodOptional<z.ZodString>;
|
|
132
|
+
packaging: z.ZodOptional<z.ZodString>;
|
|
133
|
+
closure: z.ZodOptional<z.ZodString>;
|
|
134
|
+
volume: z.ZodOptional<z.ZodNumber>;
|
|
135
|
+
priceMin: z.ZodOptional<z.ZodNumber>;
|
|
136
|
+
priceMax: z.ZodOptional<z.ZodNumber>;
|
|
137
|
+
currency: z.ZodOptional<z.ZodEnum<{
|
|
138
|
+
EUR: "EUR";
|
|
139
|
+
USD: "USD";
|
|
140
|
+
GBP: "GBP";
|
|
141
|
+
SEK: "SEK";
|
|
142
|
+
NOK: "NOK";
|
|
143
|
+
DKK: "DKK";
|
|
144
|
+
CHF: "CHF";
|
|
145
|
+
JPY: "JPY";
|
|
146
|
+
}>>;
|
|
147
|
+
targetMargin: z.ZodOptional<z.ZodNumber>;
|
|
148
|
+
distributionRequirements: z.ZodOptional<z.ZodString>;
|
|
149
|
+
submissionDeadline: z.ZodNonOptional<z.ZodOptional<z.ZodCoercedDate<unknown>>>;
|
|
150
|
+
sampleDeadline: z.ZodOptional<z.ZodCoercedDate<unknown>>;
|
|
151
|
+
launchDate: z.ZodOptional<z.ZodCoercedDate<unknown>>;
|
|
152
|
+
}, z.core.$strip>>;
|
|
153
|
+
}, z.core.$strip>;
|
|
154
|
+
/** --- Draft-state machine types --- */
|
|
155
|
+
export type DraftState = {
|
|
156
|
+
phase: "idle";
|
|
157
|
+
} | {
|
|
158
|
+
phase: "creating";
|
|
159
|
+
createPromise: Promise<{
|
|
160
|
+
id: string;
|
|
161
|
+
version: number;
|
|
162
|
+
}>;
|
|
163
|
+
} | {
|
|
164
|
+
phase: "created";
|
|
165
|
+
draftId: string;
|
|
166
|
+
version: number;
|
|
167
|
+
savingPhase: "idle" | "saving" | "error";
|
|
168
|
+
retryCount: number;
|
|
169
|
+
conflictDetected?: boolean;
|
|
170
|
+
};
|
|
171
|
+
/** --- Wizard step identifier --- */
|
|
172
|
+
export declare const wizardStepIds: readonly ["tender", "opportunities", "pricing", "review"];
|
|
173
|
+
export type WizardStepId = (typeof wizardStepIds)[number];
|
|
174
|
+
/** --- Error codes the backend can return on publish --- */
|
|
175
|
+
export type PublishErrorCode = "VALIDATION" | "ALREADY_PUBLISHED" | "CONFLICT" | "SERVER" | "NETWORK";
|
|
176
|
+
//# sourceMappingURL=wizard.types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"wizard.types.d.ts","sourceRoot":"","sources":["../../../src/opportunities/wizard/wizard.types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,+DAA+D;AAC/D,eAAO,MAAM,kBAAkB;;;;;;;;;EAAmE,CAAC;AACnG,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC;AAE9D,2HAA2H;AAC3H,eAAO,MAAM,mBAAmB,aAA4B,CAAC;AAC7D,eAAO,MAAM,iBAAiB,aAA4B,CAAC;AAC3D,eAAO,MAAM,kBAAkB,aAA6B,CAAC;AAC7D,eAAO,MAAM,iBAAiB,aAA6B,CAAC;AAE5D,wDAAwD;AACxD,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAkBjC,CAAC;AACH,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,sBAAsB,CAAC,CAAC;AAEtE,uDAAuD;AACvD,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAQ5B,CAAC;AACH,MAAM,MAAM,WAAW,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAC;AAE5D;;6FAE6F;AAC7F,eAAO,MAAM,wBAAwB;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAYjC,CAAC;AAEL,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAI9B,CAAC;AAEH,wCAAwC;AACxC,MAAM,MAAM,UAAU,GAClB;IAAE,KAAK,EAAE,MAAM,CAAA;CAAE,GACjB;IAAE,KAAK,EAAE,UAAU,CAAC;IAAC,aAAa,EAAE,OAAO,CAAC;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAE,CAAC,CAAA;CAAE,GAC9E;IAAE,KAAK,EAAE,SAAS,CAAC;IAAC,OAAO,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAC;IAAC,WAAW,EAAE,MAAM,GAAG,QAAQ,GAAG,OAAO,CAAC;IAAC,UAAU,EAAE,MAAM,CAAC;IAAC,gBAAgB,CAAC,EAAE,OAAO,CAAA;CAAE,CAAC;AAErJ,qCAAqC;AACrC,eAAO,MAAM,aAAa,2DAA4D,CAAC;AACvF,MAAM,MAAM,YAAY,GAAG,CAAC,OAAO,aAAa,CAAC,CAAC,MAAM,CAAC,CAAC;AAE1D,4DAA4D;AAC5D,MAAM,MAAM,gBAAgB,GAAG,YAAY,GAAG,mBAAmB,GAAG,UAAU,GAAG,QAAQ,GAAG,SAAS,CAAC"}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
/** Currency codes accepted by the wizard. Extend on demand. */
|
|
3
|
+
export const currencyCodeSchema = z.enum(["EUR", "USD", "SEK", "NOK", "DKK", "GBP", "CHF", "JPY"]);
|
|
4
|
+
/** Packaging / closure codes — kept as loose strings for MVP; dashboards resolve labels via @cellarnode/beverage-utils. */
|
|
5
|
+
export const packagingCodeSchema = z.string().min(1).max(64);
|
|
6
|
+
export const closureCodeSchema = z.string().min(1).max(64);
|
|
7
|
+
export const categoryCodeSchema = z.string().min(1).max(128);
|
|
8
|
+
export const subtypeCodeSchema = z.string().min(1).max(128);
|
|
9
|
+
/** --- Opportunity-item schema (inside a tender) --- */
|
|
10
|
+
export const opportunityDraftSchema = z.object({
|
|
11
|
+
clientId: z.string(), // client-side uuid for keyed lists; not persisted
|
|
12
|
+
id: z.string().optional(), // server id once created
|
|
13
|
+
name: z.string().max(200).optional(),
|
|
14
|
+
category: categoryCodeSchema.optional(),
|
|
15
|
+
subtype: subtypeCodeSchema.optional(),
|
|
16
|
+
countryOfOrigin: z.string().length(2).optional(), // ISO-3166 alpha-2
|
|
17
|
+
packaging: packagingCodeSchema.optional(),
|
|
18
|
+
closure: closureCodeSchema.optional(),
|
|
19
|
+
volume: z.number().int().nonnegative().optional(),
|
|
20
|
+
priceMin: z.number().nonnegative().optional(),
|
|
21
|
+
priceMax: z.number().nonnegative().optional(),
|
|
22
|
+
currency: currencyCodeSchema.optional(),
|
|
23
|
+
targetMargin: z.number().min(0).max(1).optional(),
|
|
24
|
+
distributionRequirements: z.string().max(2000).optional(),
|
|
25
|
+
submissionDeadline: z.coerce.date().optional(),
|
|
26
|
+
sampleDeadline: z.coerce.date().optional(),
|
|
27
|
+
launchDate: z.coerce.date().optional(),
|
|
28
|
+
});
|
|
29
|
+
/** --- Tender draft schema (for autosave PATCH) --- */
|
|
30
|
+
export const tenderDraftSchema = z.object({
|
|
31
|
+
id: z.string().optional(),
|
|
32
|
+
name: z.string().max(200).optional(),
|
|
33
|
+
targetCountry: z.string().length(2).optional(),
|
|
34
|
+
instructions: z.string().max(2000).optional(),
|
|
35
|
+
opportunities: z.array(opportunityDraftSchema).optional(),
|
|
36
|
+
draftCurrentStep: z.number().int().min(0).max(3).optional(),
|
|
37
|
+
version: z.number().int().min(1).optional(), // optimistic locking
|
|
38
|
+
});
|
|
39
|
+
/** --- Publish-strict schemas ---
|
|
40
|
+
* Zod v4: `code` defaults to "custom" on ctx.addIssue — omitted here.
|
|
41
|
+
* `.required({keys})` must come BEFORE `.superRefine()` — ZodEffects has no .required(). */
|
|
42
|
+
export const opportunityPublishSchema = opportunityDraftSchema
|
|
43
|
+
.required({ name: true, submissionDeadline: true })
|
|
44
|
+
.superRefine((v, ctx) => {
|
|
45
|
+
if (v.priceMin != null && v.priceMax != null && v.priceMin > v.priceMax) {
|
|
46
|
+
ctx.addIssue({ code: "custom", path: ["priceMax"], message: "Maximum price must be greater than or equal to the minimum." });
|
|
47
|
+
}
|
|
48
|
+
if (v.sampleDeadline && v.submissionDeadline && v.sampleDeadline > v.submissionDeadline) {
|
|
49
|
+
ctx.addIssue({ code: "custom", path: ["sampleDeadline"], message: "Sample deadline must be on or before the submission deadline." });
|
|
50
|
+
}
|
|
51
|
+
if (v.launchDate && v.submissionDeadline && v.launchDate < v.submissionDeadline) {
|
|
52
|
+
ctx.addIssue({ code: "custom", path: ["launchDate"], message: "Launch date must be on or after the submission deadline." });
|
|
53
|
+
}
|
|
54
|
+
});
|
|
55
|
+
export const tenderPublishSchema = tenderDraftSchema.extend({
|
|
56
|
+
name: z.string().min(2).max(200),
|
|
57
|
+
targetCountry: z.string().length(2),
|
|
58
|
+
opportunities: z.array(opportunityPublishSchema).min(1, "Add at least one opportunity before publishing."),
|
|
59
|
+
});
|
|
60
|
+
/** --- Wizard step identifier --- */
|
|
61
|
+
export const wizardStepIds = ["tender", "opportunities", "pricing", "review"];
|
|
62
|
+
//# sourceMappingURL=wizard.types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"wizard.types.js","sourceRoot":"","sources":["../../../src/opportunities/wizard/wizard.types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,+DAA+D;AAC/D,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,CAAC,CAAC,CAAC;AAGnG,2HAA2H;AAC3H,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAA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