@cellarnode/ui 0.17.1 → 0.17.4
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/global-chat-widget.js +2 -2
- package/dist/chat/global-chat-widget.js.map +1 -1
- package/dist/chat/global-chat-widget.test.d.ts +2 -0
- package/dist/chat/global-chat-widget.test.d.ts.map +1 -0
- package/dist/chat/global-chat-widget.test.js +167 -0
- package/dist/chat/global-chat-widget.test.js.map +1 -0
- package/dist/chat/index.d.ts +0 -1
- package/dist/chat/index.d.ts.map +1 -1
- package/dist/chat/index.js +0 -1
- package/dist/chat/index.js.map +1 -1
- package/dist/components/__tests__/countdown-pill.test.d.ts +2 -0
- package/dist/components/__tests__/countdown-pill.test.d.ts.map +1 -0
- package/dist/components/__tests__/countdown-pill.test.js +28 -0
- package/dist/components/__tests__/countdown-pill.test.js.map +1 -0
- package/dist/components/__tests__/country-flag.test.d.ts +2 -0
- package/dist/components/__tests__/country-flag.test.d.ts.map +1 -0
- package/dist/components/__tests__/country-flag.test.js +20 -0
- package/dist/components/__tests__/country-flag.test.js.map +1 -0
- package/dist/components/__tests__/status-pill.test.d.ts +2 -0
- package/dist/components/__tests__/status-pill.test.d.ts.map +1 -0
- package/dist/components/__tests__/status-pill.test.js +24 -0
- package/dist/components/__tests__/status-pill.test.js.map +1 -0
- package/dist/components/bottle-extract-dialog.test.d.ts +2 -0
- package/dist/components/bottle-extract-dialog.test.d.ts.map +1 -0
- package/dist/components/bottle-extract-dialog.test.js +99 -0
- package/dist/components/bottle-extract-dialog.test.js.map +1 -0
- package/dist/components/branch-edit-banner.js +1 -1
- package/dist/components/branch-edit-banner.js.map +1 -1
- package/dist/components/branch-overview-panel.d.ts.map +1 -1
- package/dist/components/branch-overview-panel.js +8 -0
- package/dist/components/branch-overview-panel.js.map +1 -1
- package/dist/components/branch-overview-panel.stories.d.ts +8 -0
- package/dist/components/branch-overview-panel.stories.d.ts.map +1 -1
- package/dist/components/branch-overview-panel.stories.js.map +1 -1
- package/dist/components/branch-resolution-modal.d.ts.map +1 -1
- package/dist/components/branch-resolution-modal.js +9 -0
- package/dist/components/branch-resolution-modal.js.map +1 -1
- package/dist/components/branch-resolution-modal.stories.d.ts +9 -0
- package/dist/components/branch-resolution-modal.stories.d.ts.map +1 -1
- package/dist/components/branch-resolution-modal.stories.js.map +1 -1
- package/dist/components/branch-resolution-modal.test.js +9 -0
- package/dist/components/branch-resolution-modal.test.js.map +1 -1
- package/dist/components/card.js +2 -2
- package/dist/components/card.js.map +1 -1
- package/dist/components/celebration-pulse.d.ts.map +1 -1
- package/dist/components/celebration-pulse.js +1 -1
- package/dist/components/celebration-pulse.js.map +1 -1
- package/dist/components/confirmation-dialog.stories.d.ts +26 -0
- package/dist/components/confirmation-dialog.stories.d.ts.map +1 -0
- package/dist/components/confirmation-dialog.stories.js +94 -0
- package/dist/components/confirmation-dialog.stories.js.map +1 -0
- package/dist/components/countdown-pill.d.ts +7 -0
- package/dist/components/countdown-pill.d.ts.map +1 -0
- package/dist/components/countdown-pill.js +27 -0
- package/dist/components/countdown-pill.js.map +1 -0
- package/dist/components/countdown-pill.stories.d.ts +15 -0
- package/dist/components/countdown-pill.stories.d.ts.map +1 -0
- package/dist/components/countdown-pill.stories.js +14 -0
- package/dist/components/countdown-pill.stories.js.map +1 -0
- package/dist/components/country-flag.d.ts +6 -0
- package/dist/components/country-flag.d.ts.map +1 -0
- package/dist/components/country-flag.js +31 -0
- package/dist/components/country-flag.js.map +1 -0
- package/dist/components/country-flag.stories.d.ts +14 -0
- package/dist/components/country-flag.stories.d.ts.map +1 -0
- package/dist/components/country-flag.stories.js +16 -0
- package/dist/components/country-flag.stories.js.map +1 -0
- package/dist/components/drawer.js +1 -1
- package/dist/components/drawer.js.map +1 -1
- package/dist/components/journey-card.js +2 -2
- package/dist/components/journey-card.js.map +1 -1
- package/dist/components/journey-card.test.d.ts +2 -0
- package/dist/components/journey-card.test.d.ts.map +1 -0
- package/dist/components/journey-card.test.js +82 -0
- package/dist/components/journey-card.test.js.map +1 -0
- package/dist/components/kanban-board.stories.d.ts.map +1 -1
- package/dist/components/kanban-board.stories.js +13 -3
- package/dist/components/kanban-board.stories.js.map +1 -1
- package/dist/components/kanban-dnd-board.stories.d.ts.map +1 -1
- package/dist/components/kanban-dnd-board.stories.js +7 -4
- package/dist/components/kanban-dnd-board.stories.js.map +1 -1
- package/dist/components/label.js +1 -1
- package/dist/components/label.js.map +1 -1
- package/dist/components/offer-card.js +1 -1
- package/dist/components/offer-card.js.map +1 -1
- package/dist/components/offer-card.test.d.ts +2 -0
- package/dist/components/offer-card.test.d.ts.map +1 -0
- package/dist/components/offer-card.test.js +73 -0
- package/dist/components/offer-card.test.js.map +1 -0
- package/dist/components/period-select.stories.d.ts +29 -0
- package/dist/components/period-select.stories.d.ts.map +1 -0
- package/dist/components/period-select.stories.js +65 -0
- package/dist/components/period-select.stories.js.map +1 -0
- package/dist/components/product-card.js +1 -1
- package/dist/components/product-card.js.map +1 -1
- package/dist/components/product-card.stories.js +2 -2
- package/dist/components/product-card.stories.js.map +1 -1
- package/dist/components/reason-pill.js +1 -1
- package/dist/components/reason-pill.js.map +1 -1
- package/dist/components/score-chip.js +1 -1
- package/dist/components/score-chip.js.map +1 -1
- package/dist/components/shadcn-dialog.js +1 -1
- package/dist/components/shadcn-dialog.js.map +1 -1
- package/dist/components/sidebar/context.d.ts +24 -0
- package/dist/components/sidebar/context.d.ts.map +1 -0
- package/dist/components/sidebar/context.js +73 -0
- package/dist/components/sidebar/context.js.map +1 -0
- package/dist/components/sidebar/index.d.ts +9 -0
- package/dist/components/sidebar/index.d.ts.map +1 -0
- package/dist/components/sidebar/index.js +9 -0
- package/dist/components/sidebar/index.js.map +1 -0
- package/dist/components/sidebar/sidebar-group.d.ts +10 -0
- package/dist/components/sidebar/sidebar-group.d.ts.map +1 -0
- package/dist/components/sidebar/sidebar-group.js +21 -0
- package/dist/components/sidebar/sidebar-group.js.map +1 -0
- package/dist/components/sidebar/sidebar-inset.d.ts +3 -0
- package/dist/components/sidebar/sidebar-inset.d.ts.map +1 -0
- package/dist/components/sidebar/sidebar-inset.js +7 -0
- package/dist/components/sidebar/sidebar-inset.js.map +1 -0
- package/dist/components/sidebar/sidebar-menu-sub.d.ts +9 -0
- package/dist/components/sidebar/sidebar-menu-sub.d.ts.map +1 -0
- package/dist/components/sidebar/sidebar-menu-sub.js +15 -0
- package/dist/components/sidebar/sidebar-menu-sub.js.map +1 -0
- package/dist/components/sidebar/sidebar-menu.d.ts +23 -0
- package/dist/components/sidebar/sidebar-menu.d.ts.map +1 -0
- package/dist/components/sidebar/sidebar-menu.js +63 -0
- package/dist/components/sidebar/sidebar-menu.js.map +1 -0
- package/dist/components/sidebar/sidebar-sections.d.ts +8 -0
- package/dist/components/sidebar/sidebar-sections.d.ts.map +1 -0
- package/dist/components/sidebar/sidebar-sections.js +20 -0
- package/dist/components/sidebar/sidebar-sections.js.map +1 -0
- package/dist/components/sidebar/sidebar-trigger.d.ts +4 -0
- package/dist/components/sidebar/sidebar-trigger.d.ts.map +1 -0
- package/dist/components/sidebar/sidebar-trigger.js +17 -0
- package/dist/components/sidebar/sidebar-trigger.js.map +1 -0
- package/dist/components/sidebar/sidebar.d.ts +7 -0
- package/dist/components/sidebar/sidebar.d.ts.map +1 -0
- package/dist/components/sidebar/sidebar.js +26 -0
- package/dist/components/sidebar/sidebar.js.map +1 -0
- package/dist/components/status-pill.d.ts +7 -0
- package/dist/components/status-pill.d.ts.map +1 -0
- package/dist/components/status-pill.js +14 -0
- package/dist/components/status-pill.js.map +1 -0
- package/dist/components/status-pill.stories.d.ts +21 -0
- package/dist/components/status-pill.stories.d.ts.map +1 -0
- package/dist/components/status-pill.stories.js +18 -0
- package/dist/components/status-pill.stories.js.map +1 -0
- package/dist/components/toast.stories.d.ts +25 -0
- package/dist/components/toast.stories.d.ts.map +1 -0
- package/dist/components/toast.stories.js +38 -0
- package/dist/components/toast.stories.js.map +1 -0
- package/dist/components/toaster.stories.d.ts +19 -0
- package/dist/components/toaster.stories.d.ts.map +1 -0
- package/dist/components/toaster.stories.js +27 -0
- package/dist/components/toaster.stories.js.map +1 -0
- package/dist/components/variant-picker-dialog.stories.js +1 -1
- package/dist/components/variant-picker-dialog.stories.js.map +1 -1
- package/dist/globe/globe-scene-camera.d.ts +25 -0
- package/dist/globe/globe-scene-camera.d.ts.map +1 -0
- package/dist/globe/globe-scene-camera.js +59 -0
- package/dist/globe/globe-scene-camera.js.map +1 -0
- package/dist/globe/globe-scene-channel.d.ts +27 -0
- package/dist/globe/globe-scene-channel.d.ts.map +1 -0
- package/dist/globe/globe-scene-channel.js +60 -0
- package/dist/globe/globe-scene-channel.js.map +1 -0
- package/dist/globe/globe-scene-controls.d.ts +38 -0
- package/dist/globe/globe-scene-controls.d.ts.map +1 -0
- package/dist/globe/globe-scene-controls.js +62 -0
- package/dist/globe/globe-scene-controls.js.map +1 -0
- package/dist/globe/globe-scene-data.d.ts +16 -0
- package/dist/globe/globe-scene-data.d.ts.map +1 -0
- package/dist/globe/globe-scene-data.js +51 -0
- package/dist/globe/globe-scene-data.js.map +1 -0
- package/dist/globe/globe-scene-interactions.d.ts +11 -0
- package/dist/globe/globe-scene-interactions.d.ts.map +1 -0
- package/dist/globe/globe-scene-interactions.js +54 -0
- package/dist/globe/globe-scene-interactions.js.map +1 -0
- package/dist/globe/globe-scene-layers.d.ts +22 -0
- package/dist/globe/globe-scene-layers.d.ts.map +1 -0
- package/dist/globe/globe-scene-layers.js +170 -0
- package/dist/globe/globe-scene-layers.js.map +1 -0
- package/dist/globe/globe-scene-props.d.ts +32 -0
- package/dist/globe/globe-scene-props.d.ts.map +1 -0
- package/dist/globe/globe-scene-props.js +8 -0
- package/dist/globe/globe-scene-props.js.map +1 -0
- package/dist/globe/globe-scene-types.d.ts +34 -0
- package/dist/globe/globe-scene-types.d.ts.map +1 -0
- package/dist/globe/globe-scene-types.js +14 -0
- package/dist/globe/globe-scene-types.js.map +1 -0
- package/dist/globe/globe-scene.d.ts +10 -25
- package/dist/globe/globe-scene.d.ts.map +1 -1
- package/dist/globe/globe-scene.js +54 -349
- package/dist/globe/globe-scene.js.map +1 -1
- package/dist/hooks/__tests__/use-animated-number.test.d.ts +2 -0
- package/dist/hooks/__tests__/use-animated-number.test.d.ts.map +1 -0
- package/dist/hooks/__tests__/use-animated-number.test.js +58 -0
- package/dist/hooks/__tests__/use-animated-number.test.js.map +1 -0
- package/dist/hooks/index.d.ts +3 -0
- package/dist/hooks/index.d.ts.map +1 -0
- package/dist/hooks/index.js +2 -0
- package/dist/hooks/index.js.map +1 -0
- package/dist/hooks/use-animated-number.d.ts +6 -0
- package/dist/hooks/use-animated-number.d.ts.map +1 -0
- package/dist/hooks/use-animated-number.js +56 -0
- package/dist/hooks/use-animated-number.js.map +1 -0
- package/dist/index.d.ts +0 -9
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +0 -6
- package/dist/index.js.map +1 -1
- package/dist/nav/app-sidebar.js +1 -1
- package/dist/nav/app-sidebar.js.map +1 -1
- package/dist/notifications/notification-badge.stories.d.ts +42 -0
- package/dist/notifications/notification-badge.stories.d.ts.map +1 -0
- package/dist/notifications/notification-badge.stories.js +42 -0
- package/dist/notifications/notification-badge.stories.js.map +1 -0
- package/dist/{components/kanban-card.stories.d.ts → notifications/notification-empty-state.stories.d.ts} +5 -5
- package/dist/notifications/notification-empty-state.stories.d.ts.map +1 -0
- package/dist/notifications/notification-empty-state.stories.js +22 -0
- package/dist/notifications/notification-empty-state.stories.js.map +1 -0
- package/dist/notifications/notification-item.stories.d.ts +41 -0
- package/dist/notifications/notification-item.stories.d.ts.map +1 -0
- package/dist/notifications/notification-item.stories.js +110 -0
- package/dist/notifications/notification-item.stories.js.map +1 -0
- package/dist/notifications/notification-list.stories.d.ts +25 -0
- package/dist/notifications/notification-list.stories.d.ts.map +1 -0
- package/dist/notifications/notification-list.stories.js +148 -0
- package/dist/notifications/notification-list.stories.js.map +1 -0
- package/dist/{components/classification-select.stories.d.ts → notifications/notification-page.stories.d.ts} +8 -5
- package/dist/notifications/notification-page.stories.d.ts.map +1 -0
- package/dist/notifications/notification-page.stories.js +140 -0
- package/dist/notifications/notification-page.stories.js.map +1 -0
- package/dist/notifications/notification-tray.stories.d.ts +21 -0
- package/dist/notifications/notification-tray.stories.d.ts.map +1 -0
- package/dist/notifications/notification-tray.stories.js +123 -0
- package/dist/notifications/notification-tray.stories.js.map +1 -0
- package/dist/notifications/push-prompt-banner.stories.d.ts +27 -0
- package/dist/notifications/push-prompt-banner.stories.d.ts.map +1 -0
- package/dist/notifications/push-prompt-banner.stories.js +33 -0
- package/dist/notifications/push-prompt-banner.stories.js.map +1 -0
- package/dist/offer/__tests__/opportunity-requirements.test.d.ts +2 -0
- package/dist/offer/__tests__/opportunity-requirements.test.d.ts.map +1 -0
- package/dist/offer/__tests__/opportunity-requirements.test.js +33 -0
- package/dist/offer/__tests__/opportunity-requirements.test.js.map +1 -0
- package/dist/offer/index.d.ts +1 -3
- package/dist/offer/index.d.ts.map +1 -1
- package/dist/offer/index.js +5 -2
- package/dist/offer/index.js.map +1 -1
- package/dist/offer/negotiation-event-card.stories.d.ts +1 -1
- package/dist/offer/negotiation-event-card.stories.d.ts.map +1 -1
- package/dist/offer/negotiation-event-card.stories.js +3 -1
- package/dist/offer/negotiation-event-card.stories.js.map +1 -1
- package/dist/offer/offer-detail-header.stories.d.ts +19 -0
- package/dist/offer/offer-detail-header.stories.d.ts.map +1 -0
- package/dist/offer/offer-detail-header.stories.js +59 -0
- package/dist/offer/offer-detail-header.stories.js.map +1 -0
- package/dist/offer/offer-detail-shell.stories.d.ts +17 -0
- package/dist/offer/offer-detail-shell.stories.d.ts.map +1 -0
- package/dist/offer/offer-detail-shell.stories.js +69 -0
- package/dist/offer/offer-detail-shell.stories.js.map +1 -0
- package/dist/offer/offer-detail-tabs.stories.d.ts +17 -0
- package/dist/offer/offer-detail-tabs.stories.d.ts.map +1 -0
- package/dist/offer/offer-detail-tabs.stories.js +66 -0
- package/dist/offer/offer-detail-tabs.stories.js.map +1 -0
- package/dist/offer/opportunity-requirements.d.ts.map +1 -1
- package/dist/offer/opportunity-requirements.js +4 -0
- package/dist/offer/opportunity-requirements.js.map +1 -1
- package/dist/opportunities/__tests__/opportunity-channel-badge.test.d.ts +2 -0
- package/dist/opportunities/__tests__/opportunity-channel-badge.test.d.ts.map +1 -0
- package/dist/opportunities/__tests__/opportunity-channel-badge.test.js +23 -0
- package/dist/opportunities/__tests__/opportunity-channel-badge.test.js.map +1 -0
- package/dist/opportunities/__tests__/opportunity-detail-panel.test.d.ts +2 -0
- package/dist/opportunities/__tests__/opportunity-detail-panel.test.d.ts.map +1 -0
- package/dist/opportunities/__tests__/opportunity-detail-panel.test.js +50 -0
- package/dist/opportunities/__tests__/opportunity-detail-panel.test.js.map +1 -0
- package/dist/opportunities/__tests__/opportunity-empty-state.test.d.ts +2 -0
- package/dist/opportunities/__tests__/opportunity-empty-state.test.d.ts.map +1 -0
- package/dist/opportunities/__tests__/opportunity-empty-state.test.js +19 -0
- package/dist/opportunities/__tests__/opportunity-empty-state.test.js.map +1 -0
- package/dist/opportunities/__tests__/opportunity-offers-count-chip.test.d.ts +2 -0
- package/dist/opportunities/__tests__/opportunity-offers-count-chip.test.d.ts.map +1 -0
- package/dist/opportunities/__tests__/opportunity-offers-count-chip.test.js +25 -0
- package/dist/opportunities/__tests__/opportunity-offers-count-chip.test.js.map +1 -0
- package/dist/opportunities/__tests__/opportunity-stacked-card.test.d.ts +2 -0
- package/dist/opportunities/__tests__/opportunity-stacked-card.test.d.ts.map +1 -0
- package/dist/opportunities/__tests__/opportunity-stacked-card.test.js +99 -0
- package/dist/opportunities/__tests__/opportunity-stacked-card.test.js.map +1 -0
- package/dist/opportunities/__tests__/opportunity-stacked-list.test.d.ts +2 -0
- package/dist/opportunities/__tests__/opportunity-stacked-list.test.d.ts.map +1 -0
- package/dist/opportunities/__tests__/opportunity-stacked-list.test.js +98 -0
- package/dist/opportunities/__tests__/opportunity-stacked-list.test.js.map +1 -0
- package/dist/opportunities/__tests__/section-field.test.d.ts +2 -0
- package/dist/opportunities/__tests__/section-field.test.d.ts.map +1 -0
- package/dist/opportunities/__tests__/section-field.test.js +28 -0
- package/dist/opportunities/__tests__/section-field.test.js.map +1 -0
- package/dist/opportunities/__tests__/two-column-section.test.d.ts +2 -0
- package/dist/opportunities/__tests__/two-column-section.test.d.ts.map +1 -0
- package/dist/opportunities/__tests__/two-column-section.test.js +25 -0
- package/dist/opportunities/__tests__/two-column-section.test.js.map +1 -0
- package/dist/opportunities/opportunities-table.js +1 -1
- package/dist/opportunities/opportunities-table.js.map +1 -1
- package/dist/opportunities/opportunities-table.test.d.ts +2 -0
- package/dist/opportunities/opportunities-table.test.d.ts.map +1 -0
- package/dist/opportunities/opportunities-table.test.js +87 -0
- package/dist/opportunities/opportunities-table.test.js.map +1 -0
- package/dist/opportunities/opportunity-channel-badge.d.ts +7 -0
- package/dist/opportunities/opportunity-channel-badge.d.ts.map +1 -0
- package/dist/opportunities/opportunity-channel-badge.js +13 -0
- package/dist/opportunities/opportunity-channel-badge.js.map +1 -0
- package/dist/opportunities/opportunity-channel-badge.stories.d.ts +13 -0
- package/dist/opportunities/opportunity-channel-badge.stories.d.ts.map +1 -0
- package/dist/opportunities/opportunity-channel-badge.stories.js +11 -0
- package/dist/opportunities/opportunity-channel-badge.stories.js.map +1 -0
- package/dist/opportunities/opportunity-detail-panel.d.ts +13 -0
- package/dist/opportunities/opportunity-detail-panel.d.ts.map +1 -0
- package/dist/opportunities/opportunity-detail-panel.js +19 -0
- package/dist/opportunities/opportunity-detail-panel.js.map +1 -0
- package/dist/opportunities/opportunity-detail-panel.stories.d.ts +14 -0
- package/dist/opportunities/opportunity-detail-panel.stories.d.ts.map +1 -0
- package/dist/opportunities/opportunity-detail-panel.stories.js +53 -0
- package/dist/opportunities/opportunity-detail-panel.stories.js.map +1 -0
- package/dist/opportunities/opportunity-empty-state.d.ts +10 -0
- package/dist/opportunities/opportunity-empty-state.d.ts.map +1 -0
- package/dist/opportunities/opportunity-empty-state.js +6 -0
- package/dist/opportunities/opportunity-empty-state.js.map +1 -0
- package/dist/opportunities/opportunity-empty-state.stories.d.ts +13 -0
- package/dist/opportunities/opportunity-empty-state.stories.d.ts.map +1 -0
- package/dist/opportunities/opportunity-empty-state.stories.js +13 -0
- package/dist/opportunities/opportunity-empty-state.stories.js.map +1 -0
- package/dist/opportunities/opportunity-offers-count-chip.d.ts +6 -0
- package/dist/opportunities/opportunity-offers-count-chip.d.ts.map +1 -0
- package/dist/opportunities/opportunity-offers-count-chip.js +8 -0
- package/dist/opportunities/opportunity-offers-count-chip.js.map +1 -0
- package/dist/opportunities/opportunity-offers-count-chip.stories.d.ts +13 -0
- package/dist/opportunities/opportunity-offers-count-chip.stories.d.ts.map +1 -0
- package/dist/opportunities/opportunity-offers-count-chip.stories.js +11 -0
- package/dist/opportunities/opportunity-offers-count-chip.stories.js.map +1 -0
- package/dist/opportunities/opportunity-stacked-card.d.ts +20 -0
- package/dist/opportunities/opportunity-stacked-card.d.ts.map +1 -0
- package/dist/opportunities/opportunity-stacked-card.js +48 -0
- package/dist/opportunities/opportunity-stacked-card.js.map +1 -0
- package/dist/opportunities/opportunity-stacked-card.stories.d.ts +23 -0
- package/dist/opportunities/opportunity-stacked-card.stories.d.ts.map +1 -0
- package/dist/opportunities/opportunity-stacked-card.stories.js +143 -0
- package/dist/opportunities/opportunity-stacked-card.stories.js.map +1 -0
- package/dist/opportunities/opportunity-stacked-list.d.ts +28 -0
- package/dist/opportunities/opportunity-stacked-list.d.ts.map +1 -0
- package/dist/opportunities/opportunity-stacked-list.js +49 -0
- package/dist/opportunities/opportunity-stacked-list.js.map +1 -0
- package/dist/opportunities/opportunity-stacked-list.stories.d.ts +16 -0
- package/dist/opportunities/opportunity-stacked-list.stories.d.ts.map +1 -0
- package/dist/opportunities/opportunity-stacked-list.stories.js +38 -0
- package/dist/opportunities/opportunity-stacked-list.stories.js.map +1 -0
- package/dist/opportunities/section-field.d.ts +8 -0
- package/dist/opportunities/section-field.d.ts.map +1 -0
- package/dist/opportunities/section-field.js +9 -0
- package/dist/opportunities/section-field.js.map +1 -0
- package/dist/opportunities/section-field.stories.d.ts +13 -0
- package/dist/opportunities/section-field.stories.d.ts.map +1 -0
- package/dist/opportunities/section-field.stories.js +15 -0
- package/dist/opportunities/section-field.stories.js.map +1 -0
- package/dist/opportunities/two-column-section.d.ts +10 -0
- package/dist/opportunities/two-column-section.d.ts.map +1 -0
- package/dist/opportunities/two-column-section.js +21 -0
- package/dist/opportunities/two-column-section.js.map +1 -0
- package/dist/opportunities/two-column-section.stories.d.ts +12 -0
- package/dist/opportunities/two-column-section.stories.d.ts.map +1 -0
- package/dist/opportunities/two-column-section.stories.js +26 -0
- package/dist/opportunities/two-column-section.stories.js.map +1 -0
- package/dist/opportunities/types.d.ts +76 -0
- package/dist/opportunities/types.d.ts.map +1 -0
- package/dist/opportunities/types.js +2 -0
- package/dist/opportunities/types.js.map +1 -0
- package/dist/org/invite-member-dialog.stories.d.ts +24 -0
- package/dist/org/invite-member-dialog.stories.d.ts.map +1 -0
- package/dist/org/invite-member-dialog.stories.js +34 -0
- package/dist/org/invite-member-dialog.stories.js.map +1 -0
- package/dist/org/team-hero-banner.stories.d.ts +25 -0
- package/dist/org/team-hero-banner.stories.d.ts.map +1 -0
- package/dist/org/team-hero-banner.stories.js +53 -0
- package/dist/org/team-hero-banner.stories.js.map +1 -0
- package/dist/org/team-member-menu.stories.d.ts +19 -0
- package/dist/org/team-member-menu.stories.d.ts.map +1 -0
- package/dist/org/team-member-menu.stories.js +27 -0
- package/dist/org/team-member-menu.stories.js.map +1 -0
- package/dist/org/team-member-row.stories.d.ts +26 -0
- package/dist/org/team-member-row.stories.d.ts.map +1 -0
- package/dist/org/team-member-row.stories.js +61 -0
- package/dist/org/team-member-row.stories.js.map +1 -0
- package/dist/org/team-pending-row.stories.d.ts +23 -0
- package/dist/org/team-pending-row.stories.d.ts.map +1 -0
- package/dist/org/team-pending-row.stories.js +45 -0
- package/dist/org/team-pending-row.stories.js.map +1 -0
- package/dist/skeleton/__tests__/provider.test.js +11 -1
- package/dist/skeleton/__tests__/provider.test.js.map +1 -1
- package/dist/skeleton/provider.d.ts +11 -1
- package/dist/skeleton/provider.d.ts.map +1 -1
- package/dist/skeleton/provider.js +2 -2
- package/dist/skeleton/provider.js.map +1 -1
- package/package.json +1 -1
- package/src/theme/tokens.css +78 -0
- package/dist/chat/messenger-chat-header.d.ts +0 -14
- package/dist/chat/messenger-chat-header.d.ts.map +0 -1
- package/dist/chat/messenger-chat-header.js +0 -25
- package/dist/chat/messenger-chat-header.js.map +0 -1
- package/dist/components/asset-list.d.ts +0 -34
- package/dist/components/asset-list.d.ts.map +0 -1
- package/dist/components/asset-list.js +0 -34
- package/dist/components/asset-list.js.map +0 -1
- package/dist/components/asset-list.stories.d.ts +0 -20
- package/dist/components/asset-list.stories.d.ts.map +0 -1
- package/dist/components/asset-list.stories.js +0 -50
- package/dist/components/asset-list.stories.js.map +0 -1
- package/dist/components/classification-select.d.ts +0 -24
- package/dist/components/classification-select.d.ts.map +0 -1
- package/dist/components/classification-select.js +0 -51
- package/dist/components/classification-select.js.map +0 -1
- package/dist/components/classification-select.stories.d.ts.map +0 -1
- package/dist/components/classification-select.stories.js +0 -100
- package/dist/components/classification-select.stories.js.map +0 -1
- package/dist/components/completed-offer-card.d.ts +0 -34
- package/dist/components/completed-offer-card.d.ts.map +0 -1
- package/dist/components/completed-offer-card.js +0 -20
- package/dist/components/completed-offer-card.js.map +0 -1
- package/dist/components/completed-offer-card.stories.d.ts +0 -17
- package/dist/components/completed-offer-card.stories.d.ts.map +0 -1
- package/dist/components/completed-offer-card.stories.js +0 -75
- package/dist/components/completed-offer-card.stories.js.map +0 -1
- package/dist/components/kanban-card.d.ts +0 -8
- package/dist/components/kanban-card.d.ts.map +0 -1
- package/dist/components/kanban-card.js +0 -13
- package/dist/components/kanban-card.js.map +0 -1
- package/dist/components/kanban-card.stories.d.ts.map +0 -1
- package/dist/components/kanban-card.stories.js +0 -30
- package/dist/components/kanban-card.stories.js.map +0 -1
- package/dist/components/price-comparison.d.ts +0 -13
- package/dist/components/price-comparison.d.ts.map +0 -1
- package/dist/components/price-comparison.js +0 -60
- package/dist/components/price-comparison.js.map +0 -1
- package/dist/components/price-comparison.stories.d.ts +0 -11
- package/dist/components/price-comparison.stories.d.ts.map +0 -1
- package/dist/components/price-comparison.stories.js +0 -56
- package/dist/components/price-comparison.stories.js.map +0 -1
- package/dist/components/pricing-reference-card.d.ts +0 -13
- package/dist/components/pricing-reference-card.d.ts.map +0 -1
- package/dist/components/pricing-reference-card.js +0 -38
- package/dist/components/pricing-reference-card.js.map +0 -1
- package/dist/components/pricing-reference-card.stories.d.ts +0 -11
- package/dist/components/pricing-reference-card.stories.d.ts.map +0 -1
- package/dist/components/pricing-reference-card.stories.js +0 -54
- package/dist/components/pricing-reference-card.stories.js.map +0 -1
- package/dist/components/pricing-reference-card.test.d.ts +0 -2
- package/dist/components/pricing-reference-card.test.d.ts.map +0 -1
- package/dist/components/pricing-reference-card.test.js +0 -31
- package/dist/components/pricing-reference-card.test.js.map +0 -1
- package/dist/components/sidebar.d.ts +0 -68
- package/dist/components/sidebar.d.ts.map +0 -1
- package/dist/components/sidebar.js +0 -208
- package/dist/components/sidebar.js.map +0 -1
- package/dist/offer/negotiation-event-card.d.ts +0 -9
- package/dist/offer/negotiation-event-card.d.ts.map +0 -1
- package/dist/offer/negotiation-event-card.js +0 -39
- package/dist/offer/negotiation-event-card.js.map +0 -1
- package/dist/offer/org-banner.d.ts +0 -11
- package/dist/offer/org-banner.d.ts.map +0 -1
- package/dist/offer/org-banner.js +0 -19
- package/dist/offer/org-banner.js.map +0 -1
- package/dist/offer/org-banner.stories.d.ts +0 -18
- package/dist/offer/org-banner.stories.d.ts.map +0 -1
- package/dist/offer/org-banner.stories.js +0 -51
- package/dist/offer/org-banner.stories.js.map +0 -1
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { StoryObj } from "@storybook/react-vite";
|
|
2
|
+
import { StatusPill } from "./status-pill";
|
|
3
|
+
declare const meta: {
|
|
4
|
+
title: string;
|
|
5
|
+
component: typeof StatusPill;
|
|
6
|
+
tags: string[];
|
|
7
|
+
argTypes: {
|
|
8
|
+
status: {
|
|
9
|
+
control: "select";
|
|
10
|
+
options: string[];
|
|
11
|
+
};
|
|
12
|
+
};
|
|
13
|
+
};
|
|
14
|
+
export default meta;
|
|
15
|
+
type Story = StoryObj<typeof meta>;
|
|
16
|
+
export declare const Open: Story;
|
|
17
|
+
export declare const Closed: Story;
|
|
18
|
+
export declare const Expired: Story;
|
|
19
|
+
export declare const Draft: Story;
|
|
20
|
+
export declare const AllVariants: Story;
|
|
21
|
+
//# sourceMappingURL=status-pill.stories.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"status-pill.stories.d.ts","sourceRoot":"","sources":["../../src/components/status-pill.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAQ,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAE3C,QAAA,MAAM,IAAI;;;;;;;;;;CAKyB,CAAC;AAEpC,eAAe,IAAI,CAAC;AACpB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,IAAI,CAAC,CAAC;AAEnC,eAAO,MAAM,IAAI,EAAE,KAAoC,CAAC;AACxD,eAAO,MAAM,MAAM,EAAE,KAAsC,CAAC;AAC5D,eAAO,MAAM,OAAO,EAAE,KAAuC,CAAC;AAC9D,eAAO,MAAM,KAAK,EAAE,KAAqC,CAAC;AAC1D,eAAO,MAAM,WAAW,EAAE,KAUzB,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { StatusPill } from "./status-pill";
|
|
3
|
+
const meta = {
|
|
4
|
+
title: "Components/StatusPill",
|
|
5
|
+
component: StatusPill,
|
|
6
|
+
tags: ["autodocs"],
|
|
7
|
+
argTypes: { status: { control: "select", options: ["open", "closed", "expired", "draft"] } },
|
|
8
|
+
};
|
|
9
|
+
export default meta;
|
|
10
|
+
export const Open = { args: { status: "open" } };
|
|
11
|
+
export const Closed = { args: { status: "closed" } };
|
|
12
|
+
export const Expired = { args: { status: "expired" } };
|
|
13
|
+
export const Draft = { args: { status: "draft" } };
|
|
14
|
+
export const AllVariants = {
|
|
15
|
+
args: { status: "open" },
|
|
16
|
+
render: () => (_jsxs("div", { className: "flex flex-wrap gap-2", children: [_jsx(StatusPill, { status: "open" }), _jsx(StatusPill, { status: "closed" }), _jsx(StatusPill, { status: "expired" }), _jsx(StatusPill, { status: "draft" })] })),
|
|
17
|
+
};
|
|
18
|
+
//# sourceMappingURL=status-pill.stories.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"status-pill.stories.js","sourceRoot":"","sources":["../../src/components/status-pill.stories.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAE3C,MAAM,IAAI,GAAG;IACX,KAAK,EAAE,uBAAuB;IAC9B,SAAS,EAAE,UAAU;IACrB,IAAI,EAAE,CAAC,UAAU,CAAC;IAClB,QAAQ,EAAE,EAAE,MAAM,EAAE,EAAE,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,CAAC,MAAM,EAAE,QAAQ,EAAE,SAAS,EAAE,OAAO,CAAC,EAAE,EAAE;CAC3D,CAAC;AAEpC,eAAe,IAAI,CAAC;AAGpB,MAAM,CAAC,MAAM,IAAI,GAAU,EAAE,IAAI,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,EAAE,CAAC;AACxD,MAAM,CAAC,MAAM,MAAM,GAAU,EAAE,IAAI,EAAE,EAAE,MAAM,EAAE,QAAQ,EAAE,EAAE,CAAC;AAC5D,MAAM,CAAC,MAAM,OAAO,GAAU,EAAE,IAAI,EAAE,EAAE,MAAM,EAAE,SAAS,EAAE,EAAE,CAAC;AAC9D,MAAM,CAAC,MAAM,KAAK,GAAU,EAAE,IAAI,EAAE,EAAE,MAAM,EAAE,OAAO,EAAE,EAAE,CAAC;AAC1D,MAAM,CAAC,MAAM,WAAW,GAAU;IAChC,IAAI,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE;IACxB,MAAM,EAAE,GAAG,EAAE,CAAC,CACZ,eAAK,SAAS,EAAC,sBAAsB,aACnC,KAAC,UAAU,IAAC,MAAM,EAAC,MAAM,GAAG,EAC5B,KAAC,UAAU,IAAC,MAAM,EAAC,QAAQ,GAAG,EAC9B,KAAC,UAAU,IAAC,MAAM,EAAC,SAAS,GAAG,EAC/B,KAAC,UAAU,IAAC,MAAM,EAAC,OAAO,GAAG,IACzB,CACP;CACF,CAAC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { StoryObj } from "@storybook/react-vite";
|
|
2
|
+
import { Toast } from "./toast";
|
|
3
|
+
declare const meta: {
|
|
4
|
+
title: string;
|
|
5
|
+
component: typeof Toast;
|
|
6
|
+
tags: string[];
|
|
7
|
+
parameters: {
|
|
8
|
+
layout: string;
|
|
9
|
+
};
|
|
10
|
+
argTypes: {
|
|
11
|
+
variant: {
|
|
12
|
+
control: {
|
|
13
|
+
type: "select";
|
|
14
|
+
};
|
|
15
|
+
options: string[];
|
|
16
|
+
};
|
|
17
|
+
};
|
|
18
|
+
};
|
|
19
|
+
export default meta;
|
|
20
|
+
type Story = StoryObj<typeof meta>;
|
|
21
|
+
export declare const Default: Story;
|
|
22
|
+
export declare const Destructive: Story;
|
|
23
|
+
export declare const WithAction: Story;
|
|
24
|
+
export declare const TitleOnly: Story;
|
|
25
|
+
//# sourceMappingURL=toast.stories.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"toast.stories.d.ts","sourceRoot":"","sources":["../../src/components/toast.stories.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAQ,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,EACL,KAAK,EAON,MAAM,SAAS,CAAC;AAGjB,QAAA,MAAM,IAAI;;;;;;;;;;;;;;;CAWoB,CAAC;AAE/B,eAAe,IAAI,CAAC;AACpB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,IAAI,CAAC,CAAC;AAgCnC,eAAO,MAAM,OAAO,EAAE,KASrB,CAAC;AAEF,eAAO,MAAM,WAAW,EAAE,KASzB,CAAC;AAEF,eAAO,MAAM,UAAU,EAAE,KASxB,CAAC;AAEF,eAAO,MAAM,SAAS,EAAE,KAGvB,CAAC"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useState } from "react";
|
|
3
|
+
import { Toast, ToastAction, ToastClose, ToastDescription, ToastProvider, ToastTitle, ToastViewport, } from "./toast";
|
|
4
|
+
import { Button } from "./button";
|
|
5
|
+
const meta = {
|
|
6
|
+
title: "Components/Toast",
|
|
7
|
+
component: Toast,
|
|
8
|
+
tags: ["autodocs"],
|
|
9
|
+
parameters: { layout: "fullscreen" },
|
|
10
|
+
argTypes: {
|
|
11
|
+
variant: {
|
|
12
|
+
control: { type: "select" },
|
|
13
|
+
options: ["default", "destructive"],
|
|
14
|
+
},
|
|
15
|
+
},
|
|
16
|
+
};
|
|
17
|
+
export default meta;
|
|
18
|
+
function ToastDemo({ variant = "default", title, description, action, }) {
|
|
19
|
+
const [open, setOpen] = useState(true);
|
|
20
|
+
return (_jsxs(ToastProvider, { swipeDirection: "right", children: [_jsx("div", { className: "flex min-h-[260px] items-center justify-center p-8", children: _jsx(Button, { onClick: () => setOpen(true), children: "Show toast" }) }), _jsxs(Toast, { open: open, onOpenChange: setOpen, variant: variant, children: [_jsxs("div", { className: "grid gap-1", children: [_jsx(ToastTitle, { children: title }), description && _jsx(ToastDescription, { children: description })] }), action, _jsx(ToastClose, {})] }), _jsx(ToastViewport, {})] }));
|
|
21
|
+
}
|
|
22
|
+
export const Default = {
|
|
23
|
+
args: { variant: "default" },
|
|
24
|
+
render: (args) => (_jsx(ToastDemo, { variant: args.variant ?? "default", title: "Offer sent", description: "Your proposal to Systembolaget is now in their queue." })),
|
|
25
|
+
};
|
|
26
|
+
export const Destructive = {
|
|
27
|
+
args: { variant: "destructive" },
|
|
28
|
+
render: () => (_jsx(ToastDemo, { variant: "destructive", title: "Failed to send offer", description: "Check your connection and try again." })),
|
|
29
|
+
};
|
|
30
|
+
export const WithAction = {
|
|
31
|
+
args: { variant: "default" },
|
|
32
|
+
render: () => (_jsx(ToastDemo, { title: "Draft saved", description: "Your changes to Solera Brandy Reserva are safe.", action: _jsx(ToastAction, { altText: "Undo save", children: "Undo" }) })),
|
|
33
|
+
};
|
|
34
|
+
export const TitleOnly = {
|
|
35
|
+
args: { variant: "default" },
|
|
36
|
+
render: () => _jsx(ToastDemo, { title: "Copied to clipboard" }),
|
|
37
|
+
};
|
|
38
|
+
//# sourceMappingURL=toast.stories.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"toast.stories.js","sourceRoot":"","sources":["../../src/components/toast.stories.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAEjC,OAAO,EACL,KAAK,EACL,WAAW,EACX,UAAU,EACV,gBAAgB,EAChB,aAAa,EACb,UAAU,EACV,aAAa,GACd,MAAM,SAAS,CAAC;AACjB,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAElC,MAAM,IAAI,GAAG;IACX,KAAK,EAAE,kBAAkB;IACzB,SAAS,EAAE,KAAK;IAChB,IAAI,EAAE,CAAC,UAAU,CAAC;IAClB,UAAU,EAAE,EAAE,MAAM,EAAE,YAAY,EAAE;IACpC,QAAQ,EAAE;QACR,OAAO,EAAE;YACP,OAAO,EAAE,EAAE,IAAI,EAAE,QAA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AAC,sCAAsC,GAClD,CACH;CACF,CAAC;AAEF,MAAM,CAAC,MAAM,UAAU,GAAU;IAC/B,IAAI,EAAE,EAAE,OAAO,EAAE,SAAS,EAAE;IAC5B,MAAM,EAAE,GAAG,EAAE,CAAC,CACZ,KAAC,SAAS,IACR,KAAK,EAAC,aAAa,EACnB,WAAW,EAAC,iDAAiD,EAC7D,MAAM,EAAE,KAAC,WAAW,IAAC,OAAO,EAAC,WAAW,qBAAmB,GAC3D,CACH;CACF,CAAC;AAEF,MAAM,CAAC,MAAM,SAAS,GAAU;IAC9B,IAAI,EAAE,EAAE,OAAO,EAAE,SAAS,EAAE;IAC5B,MAAM,EAAE,GAAG,EAAE,CAAC,KAAC,SAAS,IAAC,KAAK,EAAC,qBAAqB,GAAG;CACxD,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { StoryObj } from "@storybook/react-vite";
|
|
2
|
+
import { Toaster } from "./toaster";
|
|
3
|
+
declare const meta: {
|
|
4
|
+
title: string;
|
|
5
|
+
component: typeof Toaster;
|
|
6
|
+
tags: string[];
|
|
7
|
+
parameters: {
|
|
8
|
+
layout: string;
|
|
9
|
+
};
|
|
10
|
+
};
|
|
11
|
+
export default meta;
|
|
12
|
+
type Story = StoryObj<typeof meta>;
|
|
13
|
+
/**
|
|
14
|
+
* The `Toaster` reads from a module-level store driven by the `toast()`
|
|
15
|
+
* helper from `use-toast`. Mount `<Toaster />` once near the app root and
|
|
16
|
+
* call `toast(...)` anywhere to enqueue a notification.
|
|
17
|
+
*/
|
|
18
|
+
export declare const Default: Story;
|
|
19
|
+
//# sourceMappingURL=toaster.stories.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"toaster.stories.d.ts","sourceRoot":"","sources":["../../src/components/toaster.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAQ,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAIpC,QAAA,MAAM,IAAI;;;;;;;CAKsB,CAAC;AAEjC,eAAe,IAAI,CAAC;AACpB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,IAAI,CAAC,CAAC;AAEnC;;;;GAIG;AACH,eAAO,MAAM,OAAO,EAAE,KAkCrB,CAAC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Toaster } from "./toaster";
|
|
3
|
+
import { Button } from "./button";
|
|
4
|
+
import { toast } from "../hooks/use-toast";
|
|
5
|
+
const meta = {
|
|
6
|
+
title: "Components/Toaster",
|
|
7
|
+
component: Toaster,
|
|
8
|
+
tags: ["autodocs"],
|
|
9
|
+
parameters: { layout: "fullscreen" },
|
|
10
|
+
};
|
|
11
|
+
export default meta;
|
|
12
|
+
/**
|
|
13
|
+
* The `Toaster` reads from a module-level store driven by the `toast()`
|
|
14
|
+
* helper from `use-toast`. Mount `<Toaster />` once near the app root and
|
|
15
|
+
* call `toast(...)` anywhere to enqueue a notification.
|
|
16
|
+
*/
|
|
17
|
+
export const Default = {
|
|
18
|
+
render: () => (_jsxs("div", { className: "relative flex min-h-[320px] flex-col items-center justify-center gap-3 p-10", children: [_jsx("p", { className: "text-sm text-muted-foreground", children: "Click a button to enqueue a toast. The viewport renders fixed in the corner of the page." }), _jsxs("div", { className: "flex flex-wrap gap-3", children: [_jsx(Button, { onClick: () => toast({
|
|
19
|
+
title: "Offer sent",
|
|
20
|
+
description: "Proposal delivered to Systembolaget.",
|
|
21
|
+
}), children: "Default toast" }), _jsx(Button, { color: "red", onClick: () => toast({
|
|
22
|
+
variant: "destructive",
|
|
23
|
+
title: "Send failed",
|
|
24
|
+
description: "Check your connection and try again.",
|
|
25
|
+
}), children: "Destructive toast" })] }), _jsx(Toaster, {})] })),
|
|
26
|
+
};
|
|
27
|
+
//# sourceMappingURL=toaster.stories.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"toaster.stories.js","sourceRoot":"","sources":["../../src/components/toaster.stories.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAE3C,MAAM,IAAI,GAAG;IACX,KAAK,EAAE,oBAAoB;IAC3B,SAAS,EAAE,OAAO;IAClB,IAAI,EAAE,CAAC,UAAU,CAAC;IAClB,UAAU,EAAE,EAAE,MAAM,EAAE,YAAY,EAAE;CACN,CAAC;AAEjC,eAAe,IAAI,CAAC;AAGpB;;;;GAIG;AACH,MAAM,CAAC,MAAM,OAAO,GAAU;IAC5B,MAAM,EAAE,GAAG,EAAE,CAAC,CACZ,eAAK,SAAS,EAAC,6EAA6E,aAC1F,YAAG,SAAS,EAAC,+BAA+B,yGAGxC,EACJ,eAAK,SAAS,EAAC,sBAAsB,aACnC,KAAC,MAAM,IACL,OAAO,EAAE,GAAG,EAAE,CACZ,KAAK,CAAC;4BACJ,KAAK,EAAE,YAAY;4BACnB,WAAW,EAAE,sCAAsC;yBACpD,CAAC,8BAIG,EACT,KAAC,MAAM,IACL,KAAK,EAAC,KAAK,EACX,OAAO,EAAE,GAAG,EAAE,CACZ,KAAK,CAAC;4BACJ,OAAO,EAAE,aAAa;4BACtB,KAAK,EAAE,aAAa;4BACpB,WAAW,EAAE,sCAAsC;yBACpD,CAAC,kCAIG,IACL,EACN,KAAC,OAAO,KAAG,IACP,CACP;CACF,CAAC"}
|
|
@@ -83,7 +83,7 @@ const crossCategory = [
|
|
|
83
83
|
];
|
|
84
84
|
function Wrapper(args) {
|
|
85
85
|
const [search, setSearch] = useState(args.searchValue);
|
|
86
|
-
return (_jsx("div", { className: "min-h-
|
|
86
|
+
return (_jsx("div", { className: "min-h-dvh bg-background p-6", children: _jsx(VariantPickerDialog, { ...args, searchValue: search, onSearchChange: setSearch }) }));
|
|
87
87
|
}
|
|
88
88
|
export const WithMatches = {
|
|
89
89
|
render: (args) => _jsx(Wrapper, { ...args }),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"variant-picker-dialog.stories.js","sourceRoot":"","sources":["../../src/components/variant-picker-dialog.stories.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACjC,OAAO,EAAE,EAAE,EAAE,MAAM,gBAAgB,CAAC;AACpC,OAAO,EACL,mBAAmB,GAGpB,MAAM,yBAAyB,CAAC;AAEjC,MAAM,IAAI,GAAG;IACX,KAAK,EAAE,4BAA4B;IACnC,SAAS,EAAE,mBAAmB;IAC9B,IAAI,EAAE,CAAC,UAAU,CAAC;IAClB,UAAU,EAAE,EAAE,MAAM,EAAE,YAAY,EAAE;CACM,CAAC;AAE7C,eAAe,IAAI,CAAC;AAGpB,MAAM,QAAQ,GAA2B;IACvC;QACE,EAAE,EAAE,IAAI;QACR,UAAU,EAAE,IAAI;QAChB,YAAY,EAAE,uBAAuB;QACrC,OAAO,EAAE,IAAI;QACb,SAAS,EAAE,cAAc;QACzB,eAAe,EAAE,OAAO;QACxB,QAAQ,EAAE,SAAS;QACnB,OAAO,EAAE,QAAQ;QACjB,eAAe,EAAE,OAAO;QACxB,MAAM,EAAE,OAAO;QACf,KAAK,EAAE,EAAE;QACT,IAAI,EAAE,KAAK;QACX,OAAO,EAAE;YACP,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,KAAK,EAAE,QAAQ,EAAE;YAClD,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,KAAK,EAAE,OAAO,EAAE;YACjD,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,UAAU,EAAE,KAAK,EAAE,UAAU,EAAE;SACtD;KACF;IACD;QACE,EAAE,EAAE,IAAI;QACR,UAAU,EAAE,IAAI;QAChB,YAA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QACT,IAAI,EAAE,MAAM;QACZ,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,KAAK,EAAE,UAAU,EAAE,CAAC;KAClE;CACF,CAAC;AAEF,SAAS,OAAO,CAAC,IAA8B;IAC7C,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,GAAG,QAAQ,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;IACvD,OAAO,CACL,cAAK,SAAS,EAAC,
|
|
1
|
+
{"version":3,"file":"variant-picker-dialog.stories.js","sourceRoot":"","sources":["../../src/components/variant-picker-dialog.stories.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACjC,OAAO,EAAE,EAAE,EAAE,MAAM,gBAAgB,CAAC;AACpC,OAAO,EACL,mBAAmB,GAGpB,MAAM,yBAAyB,CAAC;AAEjC,MAAM,IAAI,GAAG;IACX,KAAK,EAAE,4BAA4B;IACnC,SAAS,EAAE,mBAAmB;IAC9B,IAAI,EAAE,CAAC,UAAU,CAAC;IAClB,UAAU,EAAE,EAAE,MAAM,EAAE,YAAY,EAAE;CACM,CAAC;AAE7C,eAAe,IAAI,CAAC;AAGpB,MAAM,QAAQ,GAA2B;IACvC;QACE,EAAE,EAAE,IAAI;QACR,UAAU,EAAE,IAAI;QAChB,YAAY,EAAE,uBAAuB;QACrC,OAAO,EAAE,IAAI;QACb,SAAS,EAAE,cAAc;QACzB,eAAe,EAAE,OAAO;QACxB,QAAQ,EAAE,SAAS;QACnB,OAAO,EAAE,QAAQ;QACjB,eAAe,EAAE,OAAO;QACxB,MAAM,EAAE,OAAO;QACf,KAAK,EAAE,EAAE;QACT,IAAI,EAAE,KAAK;QACX,OAAO,EAAE;YACP,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,KAAK,EAAE,QAAQ,EAAE;YAClD,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,SAA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EAAE;YACb,aAAa,EAAE,kBAAkB;YACjC,WAAW,EAAE,6BAA6B;SAC3C;KACF;CACF,CAAC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Camera helpers for GlobeScene: initial POV placement + fly-to-country
|
|
3
|
+
* animation.
|
|
4
|
+
*
|
|
5
|
+
* Both helpers convert lat/lng/altitude to Cartesian coordinates using the
|
|
6
|
+
* same sphere radius convention as r3f-globe (GLOBE_RADIUS * altitude).
|
|
7
|
+
*/
|
|
8
|
+
import * as THREE from "three";
|
|
9
|
+
/**
|
|
10
|
+
* Place the camera at the supplied point-of-view (lat/lng/altitude).
|
|
11
|
+
*
|
|
12
|
+
* Altitude is expressed as a multiplier of the globe radius — 2.5 means the
|
|
13
|
+
* camera sits at 2.5x the radius away from the origin.
|
|
14
|
+
*/
|
|
15
|
+
export declare function applyInitialPov(camera: THREE.Camera, pov?: {
|
|
16
|
+
lat: number;
|
|
17
|
+
lng: number;
|
|
18
|
+
altitude: number;
|
|
19
|
+
}): void;
|
|
20
|
+
/**
|
|
21
|
+
* Hook: fly the camera to the selected country over ~1s with an ease-out
|
|
22
|
+
* cubic curve. No-op if no country is selected or if the code is unknown.
|
|
23
|
+
*/
|
|
24
|
+
export declare function useFlyToCountry(selectedCountryCode: string | null | undefined, camera: THREE.Camera, invalidate: () => void): void;
|
|
25
|
+
//# sourceMappingURL=globe-scene-camera.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"globe-scene-camera.d.ts","sourceRoot":"","sources":["../../src/globe/globe-scene-camera.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAK/B;;;;;GAKG;AACH,wBAAgB,eAAe,CAC7B,MAAM,EAAE,KAAK,CAAC,MAAM,EACpB,GAAG,GAAE;IAAE,GAAG,EAAE,MAAM,CAAC;IAAC,GAAG,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAA;CAAgB,GAChE,IAAI,CAUN;AAED;;;GAGG;AACH,wBAAgB,eAAe,CAC7B,mBAAmB,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,EAC9C,MAAM,EAAE,KAAK,CAAC,MAAM,EACpB,UAAU,EAAE,MAAM,IAAI,GACrB,IAAI,CAoCN"}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Camera helpers for GlobeScene: initial POV placement + fly-to-country
|
|
3
|
+
* animation.
|
|
4
|
+
*
|
|
5
|
+
* Both helpers convert lat/lng/altitude to Cartesian coordinates using the
|
|
6
|
+
* same sphere radius convention as r3f-globe (GLOBE_RADIUS * altitude).
|
|
7
|
+
*/
|
|
8
|
+
import { useEffect } from "react";
|
|
9
|
+
import * as THREE from "three";
|
|
10
|
+
import { COUNTRY_GEO_MAP } from "./data/country-geo";
|
|
11
|
+
import { DEFAULT_POV, GLOBE_RADIUS } from "./globe-scene-types";
|
|
12
|
+
/**
|
|
13
|
+
* Place the camera at the supplied point-of-view (lat/lng/altitude).
|
|
14
|
+
*
|
|
15
|
+
* Altitude is expressed as a multiplier of the globe radius — 2.5 means the
|
|
16
|
+
* camera sits at 2.5x the radius away from the origin.
|
|
17
|
+
*/
|
|
18
|
+
export function applyInitialPov(camera, pov = DEFAULT_POV) {
|
|
19
|
+
const phi = (90 - pov.lat) * (Math.PI / 180);
|
|
20
|
+
const theta = (pov.lng + 180) * (Math.PI / 180);
|
|
21
|
+
const dist = GLOBE_RADIUS * pov.altitude;
|
|
22
|
+
camera.position.set(-dist * Math.sin(phi) * Math.cos(theta), dist * Math.cos(phi), dist * Math.sin(phi) * Math.sin(theta));
|
|
23
|
+
camera.lookAt(0, 0, 0);
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Hook: fly the camera to the selected country over ~1s with an ease-out
|
|
27
|
+
* cubic curve. No-op if no country is selected or if the code is unknown.
|
|
28
|
+
*/
|
|
29
|
+
export function useFlyToCountry(selectedCountryCode, camera, invalidate) {
|
|
30
|
+
useEffect(() => {
|
|
31
|
+
if (!selectedCountryCode)
|
|
32
|
+
return;
|
|
33
|
+
const entry = COUNTRY_GEO_MAP.get(selectedCountryCode);
|
|
34
|
+
if (!entry)
|
|
35
|
+
return;
|
|
36
|
+
const phi = (90 - entry.lat) * (Math.PI / 180);
|
|
37
|
+
const theta = entry.lng * (Math.PI / 180);
|
|
38
|
+
const dist = GLOBE_RADIUS * 1.8;
|
|
39
|
+
const target = new THREE.Vector3(dist * Math.sin(phi) * Math.sin(theta), dist * Math.cos(phi), dist * Math.sin(phi) * Math.cos(theta));
|
|
40
|
+
// Animate camera over ~1 second using requestAnimationFrame-driven LERP
|
|
41
|
+
const start = camera.position.clone();
|
|
42
|
+
const startTime = Date.now();
|
|
43
|
+
const duration = 1000;
|
|
44
|
+
const animateCamera = () => {
|
|
45
|
+
const elapsed = Date.now() - startTime;
|
|
46
|
+
const t = Math.min(elapsed / duration, 1);
|
|
47
|
+
// Ease out cubic
|
|
48
|
+
const ease = 1 - Math.pow(1 - t, 3);
|
|
49
|
+
camera.position.lerpVectors(start, target, ease);
|
|
50
|
+
camera.lookAt(0, 0, 0);
|
|
51
|
+
invalidate();
|
|
52
|
+
if (t < 1) {
|
|
53
|
+
requestAnimationFrame(animateCamera);
|
|
54
|
+
}
|
|
55
|
+
};
|
|
56
|
+
requestAnimationFrame(animateCamera);
|
|
57
|
+
}, [selectedCountryCode, camera, invalidate]);
|
|
58
|
+
}
|
|
59
|
+
//# sourceMappingURL=globe-scene-camera.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"globe-scene-camera.js","sourceRoot":"","sources":["../../src/globe/globe-scene-camera.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAClC,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAE,eAAe,EAAE,MAAM,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AAC,aAAa,CAAC,CAAC;IACvC,CAAC,EAAE,CAAC,mBAAmB,EAAE,MAAM,EAAE,UAAU,CAAC,CAAC,CAAC;AAChD,CAAC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* BroadcastChannel bridge hooks for the offscreen worker pattern.
|
|
3
|
+
*
|
|
4
|
+
* The main thread ships props into the worker on the "globe-data" channel
|
|
5
|
+
* (or a caller-supplied channelId) as `{ type: "globe-props", payload }`.
|
|
6
|
+
* Events flow back on the same channel under typed event names.
|
|
7
|
+
*
|
|
8
|
+
* Both sides handle the race where the worker boots before the first
|
|
9
|
+
* postMessage: the worker emits `{ type: "globe-ready" }` once its listener
|
|
10
|
+
* is wired and the main thread re-sends its props on receipt.
|
|
11
|
+
*/
|
|
12
|
+
import type { GlobeSceneProps } from "./globe-scene-props";
|
|
13
|
+
/**
|
|
14
|
+
* Hook: read data from BroadcastChannel (main thread -> worker).
|
|
15
|
+
*
|
|
16
|
+
* Silently no-ops in environments without BroadcastChannel so SSR / test
|
|
17
|
+
* harnesses don't explode.
|
|
18
|
+
*/
|
|
19
|
+
export declare function useChannelData(channelId: string): GlobeSceneProps;
|
|
20
|
+
/**
|
|
21
|
+
* Hook: send events back to main thread.
|
|
22
|
+
*
|
|
23
|
+
* Returns a stable callback; the underlying channel is held in a ref so the
|
|
24
|
+
* callback identity doesn't churn on every render.
|
|
25
|
+
*/
|
|
26
|
+
export declare function useSendEvent(channelId: string): (eventType: string, payload: unknown) => void;
|
|
27
|
+
//# sourceMappingURL=globe-scene-channel.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"globe-scene-channel.d.ts","sourceRoot":"","sources":["../../src/globe/globe-scene-channel.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAIH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAE3D;;;;;GAKG;AACH,wBAAgB,cAAc,CAAC,SAAS,EAAE,MAAM,GAAG,eAAe,CAuBjE;AAED;;;;;GAKG;AACH,wBAAgB,YAAY,CAAC,SAAS,EAAE,MAAM,eAYb,MAAM,WAAW,OAAO,UAGxD"}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* BroadcastChannel bridge hooks for the offscreen worker pattern.
|
|
3
|
+
*
|
|
4
|
+
* The main thread ships props into the worker on the "globe-data" channel
|
|
5
|
+
* (or a caller-supplied channelId) as `{ type: "globe-props", payload }`.
|
|
6
|
+
* Events flow back on the same channel under typed event names.
|
|
7
|
+
*
|
|
8
|
+
* Both sides handle the race where the worker boots before the first
|
|
9
|
+
* postMessage: the worker emits `{ type: "globe-ready" }` once its listener
|
|
10
|
+
* is wired and the main thread re-sends its props on receipt.
|
|
11
|
+
*/
|
|
12
|
+
import { useCallback, useEffect, useRef, useState } from "react";
|
|
13
|
+
/**
|
|
14
|
+
* Hook: read data from BroadcastChannel (main thread -> worker).
|
|
15
|
+
*
|
|
16
|
+
* Silently no-ops in environments without BroadcastChannel so SSR / test
|
|
17
|
+
* harnesses don't explode.
|
|
18
|
+
*/
|
|
19
|
+
export function useChannelData(channelId) {
|
|
20
|
+
const [data, setData] = useState({});
|
|
21
|
+
useEffect(() => {
|
|
22
|
+
// BroadcastChannel may not exist in all environments; guard silently
|
|
23
|
+
if (typeof BroadcastChannel === "undefined")
|
|
24
|
+
return;
|
|
25
|
+
const channel = new BroadcastChannel(channelId);
|
|
26
|
+
channel.onmessage = (e) => {
|
|
27
|
+
if (e.data?.type === "globe-props") {
|
|
28
|
+
setData(e.data.payload);
|
|
29
|
+
}
|
|
30
|
+
};
|
|
31
|
+
// Signal to the main thread that we're ready to receive props.
|
|
32
|
+
// This closes the startup race: if the main thread sent the initial
|
|
33
|
+
// message before this listener was set up, it will resend on "globe-ready".
|
|
34
|
+
channel.postMessage({ type: "globe-ready" });
|
|
35
|
+
return () => channel.close();
|
|
36
|
+
}, [channelId]);
|
|
37
|
+
return data;
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Hook: send events back to main thread.
|
|
41
|
+
*
|
|
42
|
+
* Returns a stable callback; the underlying channel is held in a ref so the
|
|
43
|
+
* callback identity doesn't churn on every render.
|
|
44
|
+
*/
|
|
45
|
+
export function useSendEvent(channelId) {
|
|
46
|
+
const channelRef = useRef(null);
|
|
47
|
+
useEffect(() => {
|
|
48
|
+
if (typeof BroadcastChannel === "undefined")
|
|
49
|
+
return;
|
|
50
|
+
channelRef.current = new BroadcastChannel(channelId);
|
|
51
|
+
return () => {
|
|
52
|
+
channelRef.current?.close();
|
|
53
|
+
channelRef.current = null;
|
|
54
|
+
};
|
|
55
|
+
}, [channelId]);
|
|
56
|
+
return useCallback((eventType, payload) => {
|
|
57
|
+
channelRef.current?.postMessage({ type: eventType, payload });
|
|
58
|
+
}, []);
|
|
59
|
+
}
|
|
60
|
+
//# sourceMappingURL=globe-scene-channel.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"globe-scene-channel.js","sourceRoot":"","sources":["../../src/globe/globe-scene-channel.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAIjE;;;;;GAKG;AACH,MAAM,UAAU,cAAc,CAAC,SAAiB;IAC9C,MAAM,CAAC,IAAI,EAAE,OAAO,CAAC,GAAG,QAAQ,CAAkB,EAAE,CAAC,CAAC;IAEtD,SAAS,CAAC,GAAG,EAAE;QACb,qEAAqE;QACrE,IAAI,OAAO,gBAAgB,KAAK,WAAW;YAAE,OAAO;QAEpD,MAAM,OAAO,GAAG,IAAI,gBAAgB,CAAC,SAAS,CAAC,CAAC;QAChD,OAAO,CAAC,SAAS,GAAG,CAAC,CAAe,EAAE,EAAE;YACtC,IAAI,CAAC,CAAC,IAAI,EAAE,IAAI,KAAK,aAAa,EAAE,CAAC;gBACnC,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,OAA0B,CAAC,CAAC;YAC7C,CAAC;QACH,CAAC,CAAC;QAEF,+DAA+D;QAC/D,oEAAoE;QACpE,4EAA4E;QAC5E,OAAO,CAAC,WAAW,CAAC,EAAE,IAAI,EAAE,aAAa,EAAE,CAAC,CAAC;QAE7C,OAAO,GAAG,EAAE,CAAC,OAAO,CAAC,KAAK,EAAE,CAAC;IAC/B,CAAC,EAAE,CAAC,SAAS,CAAC,CAAC,CAAC;IAEhB,OAAO,IAAI,CAAC;AACd,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,YAAY,CAAC,SAAiB;IAC5C,MAAM,UAAU,GAAG,MAAM,CAA0B,IAAI,CAAC,CAAC;IAEzD,SAAS,CAAC,GAAG,EAAE;QACb,IAAI,OAAO,gBAAgB,KAAK,WAAW;YAAE,OAAO;QACpD,UAAU,CAAC,OAAO,GAAG,IAAI,gBAAgB,CAAC,SAAS,CAAC,CAAC;QACrD,OAAO,GAAG,EAAE;YACV,UAAU,CAAC,OAAO,EAAE,KAAK,EAAE,CAAC;YAC5B,UAAU,CAAC,OAAO,GAAG,IAAI,CAAC;QAC5B,CAAC,CAAC;IACJ,CAAC,EAAE,CAAC,SAAS,CAAC,CAAC,CAAC;IAEhB,OAAO,WAAW,CAAC,CAAC,SAAiB,EAAE,OAAgB,EAAE,EAAE;QACzD,UAAU,CAAC,OAAO,EAAE,WAAW,CAAC,EAAE,IAAI,EAAE,SAAS,EAAE,OAAO,EAAE,CAAC,CAAC;IAChE,CAAC,EAAE,EAAE,CAAC,CAAC;AACT,CAAC"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* OrbitControls auto-rotate + idle resume helpers.
|
|
3
|
+
*
|
|
4
|
+
* Extracted from GlobeScene so the composition root stays focused on wiring.
|
|
5
|
+
*
|
|
6
|
+
* Behaviour:
|
|
7
|
+
* - While the user interacts (drag / pinch / wheel), auto-rotate is paused.
|
|
8
|
+
* - After IDLE_RESUME_MS of inactivity, auto-rotate resumes.
|
|
9
|
+
* - When `reducedMotion` is true or `autoRotate` is false, no rotation is
|
|
10
|
+
* applied.
|
|
11
|
+
* - `onChange` always triggers a re-render via `invalidate()` so the demand
|
|
12
|
+
* rendering loop paints updates without idle ticks.
|
|
13
|
+
*/
|
|
14
|
+
import { type MutableRefObject } from "react";
|
|
15
|
+
export interface OrbitControlsLike {
|
|
16
|
+
autoRotate?: boolean;
|
|
17
|
+
update: () => void;
|
|
18
|
+
}
|
|
19
|
+
export interface OrbitControlHandlers {
|
|
20
|
+
onChange: () => void;
|
|
21
|
+
onStart: () => void;
|
|
22
|
+
onEnd: () => void;
|
|
23
|
+
}
|
|
24
|
+
export declare function useOrbitControlHandlers(opts: {
|
|
25
|
+
controlsRef: MutableRefObject<any>;
|
|
26
|
+
idleTimerRef: MutableRefObject<ReturnType<typeof setTimeout> | null>;
|
|
27
|
+
invalidate: () => void;
|
|
28
|
+
reducedMotion: boolean;
|
|
29
|
+
autoRotate: boolean;
|
|
30
|
+
}): OrbitControlHandlers;
|
|
31
|
+
/**
|
|
32
|
+
* Hook: drive OrbitControls.update() every frame while autoRotate is on.
|
|
33
|
+
*
|
|
34
|
+
* r3f-globe's demand rendering won't tick on its own, so this hook both
|
|
35
|
+
* updates the controls and invalidates to request the next frame.
|
|
36
|
+
*/
|
|
37
|
+
export declare function useAutoRotateFrame(controlsRef: MutableRefObject<any>, invalidate: () => void): void;
|
|
38
|
+
//# sourceMappingURL=globe-scene-controls.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"globe-scene-controls.d.ts","sourceRoot":"","sources":["../../src/globe/globe-scene-controls.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,EAAwB,KAAK,gBAAgB,EAAE,MAAM,OAAO,CAAC;AAKpE,MAAM,WAAW,iBAAiB;IAChC,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,MAAM,EAAE,MAAM,IAAI,CAAC;CACpB;AAED,MAAM,WAAW,oBAAoB;IACnC,QAAQ,EAAE,MAAM,IAAI,CAAC;IACrB,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,KAAK,EAAE,MAAM,IAAI,CAAC;CACnB;AAED,wBAAgB,uBAAuB,CAAC,IAAI,EAAE;IAE5C,WAAW,EAAE,gBAAgB,CAAC,GAAG,CAAC,CAAC;IACnC,YAAY,EAAE,gBAAgB,CAAC,UAAU,CAAC,OAAO,UAAU,CAAC,GAAG,IAAI,CAAC,CAAC;IACrE,UAAU,EAAE,MAAM,IAAI,CAAC;IACvB,aAAa,EAAE,OAAO,CAAC;IACvB,UAAU,EAAE,OAAO,CAAC;CACrB,GAAG,oBAAoB,CA0BvB;AAED;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAEhC,WAAW,EAAE,gBAAgB,CAAC,GAAG,CAAC,EAClC,UAAU,EAAE,MAAM,IAAI,GACrB,IAAI,CAQN"}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* OrbitControls auto-rotate + idle resume helpers.
|
|
3
|
+
*
|
|
4
|
+
* Extracted from GlobeScene so the composition root stays focused on wiring.
|
|
5
|
+
*
|
|
6
|
+
* Behaviour:
|
|
7
|
+
* - While the user interacts (drag / pinch / wheel), auto-rotate is paused.
|
|
8
|
+
* - After IDLE_RESUME_MS of inactivity, auto-rotate resumes.
|
|
9
|
+
* - When `reducedMotion` is true or `autoRotate` is false, no rotation is
|
|
10
|
+
* applied.
|
|
11
|
+
* - `onChange` always triggers a re-render via `invalidate()` so the demand
|
|
12
|
+
* rendering loop paints updates without idle ticks.
|
|
13
|
+
*/
|
|
14
|
+
import { useCallback, useMemo } from "react";
|
|
15
|
+
import { useFrame } from "@react-three/fiber";
|
|
16
|
+
import { IDLE_RESUME_MS } from "./globe-scene-types";
|
|
17
|
+
export function useOrbitControlHandlers(opts) {
|
|
18
|
+
const { controlsRef, idleTimerRef, invalidate, reducedMotion, autoRotate } = opts;
|
|
19
|
+
const onChange = useCallback(() => {
|
|
20
|
+
invalidate();
|
|
21
|
+
}, [invalidate]);
|
|
22
|
+
const onStart = useCallback(() => {
|
|
23
|
+
if (reducedMotion || !autoRotate)
|
|
24
|
+
return;
|
|
25
|
+
const controls = controlsRef.current;
|
|
26
|
+
if (controls)
|
|
27
|
+
controls.autoRotate = false;
|
|
28
|
+
if (idleTimerRef.current)
|
|
29
|
+
clearTimeout(idleTimerRef.current);
|
|
30
|
+
}, [reducedMotion, autoRotate, controlsRef, idleTimerRef]);
|
|
31
|
+
const onEnd = useCallback(() => {
|
|
32
|
+
if (reducedMotion || !autoRotate)
|
|
33
|
+
return;
|
|
34
|
+
if (idleTimerRef.current)
|
|
35
|
+
clearTimeout(idleTimerRef.current);
|
|
36
|
+
idleTimerRef.current = setTimeout(() => {
|
|
37
|
+
const controls = controlsRef.current;
|
|
38
|
+
if (controls)
|
|
39
|
+
controls.autoRotate = true;
|
|
40
|
+
invalidate();
|
|
41
|
+
}, IDLE_RESUME_MS);
|
|
42
|
+
}, [reducedMotion, autoRotate, invalidate, controlsRef, idleTimerRef]);
|
|
43
|
+
return useMemo(() => ({ onChange, onStart, onEnd }), [onChange, onStart, onEnd]);
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Hook: drive OrbitControls.update() every frame while autoRotate is on.
|
|
47
|
+
*
|
|
48
|
+
* r3f-globe's demand rendering won't tick on its own, so this hook both
|
|
49
|
+
* updates the controls and invalidates to request the next frame.
|
|
50
|
+
*/
|
|
51
|
+
export function useAutoRotateFrame(
|
|
52
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
53
|
+
controlsRef, invalidate) {
|
|
54
|
+
useFrame(() => {
|
|
55
|
+
const controls = controlsRef.current;
|
|
56
|
+
if (controls?.autoRotate) {
|
|
57
|
+
controls.update();
|
|
58
|
+
invalidate();
|
|
59
|
+
}
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
//# sourceMapp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AAC;YACrC,IAAI,QAAQ;gBAAE,QAAQ,CAAC,UAAU,GAAG,IAAI,CAAC;YACzC,UAAU,EAAE,CAAC;QACf,CAAC,EAAE,cAAc,CAAC,CAAC;IACrB,CAAC,EAAE,CAAC,aAAa,EAAE,UAAU,EAAE,UAAU,EAAE,WAAW,EAAE,YAAY,CAAC,CAAC,CAAC;IAEvE,OAAO,OAAO,CAAC,GAAG,EAAE,CAAC,CAAC,EAAE,QAAQ,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC,EAAE,CAAC,QAAQ,EAAE,OAAO,EAAE,KAAK,CAAC,CAAC,CAAC;AACnF,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,kBAAkB;AAChC,8DAA8D;AAC9D,WAAkC,EAClC,UAAsB;IAEtB,QAAQ,CAAC,GAAG,EAAE;QACZ,MAAM,QAAQ,GAAG,WAAW,CAAC,OAAO,CAAC;QACrC,IAAI,QAAQ,EAAE,UAAU,EAAE,CAAC;YACzB,QAAQ,CAAC,MAAM,EAAE,CAAC;YAClB,UAAU,EAAE,CAAC;QACf,CAAC;IACH,CAAC,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Progressive TopoJSON loader for country polygons.
|
|
3
|
+
*
|
|
4
|
+
* Fetches the coarse 110m dataset first (fast first paint), then upgrades to
|
|
5
|
+
* the 50m dataset unless the consumer supplies a custom URL.
|
|
6
|
+
*/
|
|
7
|
+
import { type CountryFeature } from "./globe-scene-types";
|
|
8
|
+
/**
|
|
9
|
+
* Hook: load country features from TopoJSON (progressive: 110m then 50m).
|
|
10
|
+
*
|
|
11
|
+
* If `topoJsonUrl` is provided, only that single URL is loaded; otherwise the
|
|
12
|
+
* coarse CDN dataset is fetched first and swapped for the detailed one once
|
|
13
|
+
* available.
|
|
14
|
+
*/
|
|
15
|
+
export declare function useCountryFeatures(topoJsonUrl?: string): CountryFeature[];
|
|
16
|
+
//# sourceMappingURL=globe-scene-data.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"globe-scene-data.d.ts","sourceRoot":"","sources":["../../src/globe/globe-scene-data.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAMH,OAAO,EAGL,KAAK,cAAc,EACpB,MAAM,qBAAqB,CAAC;AAY7B;;;;;;GAMG;AACH,wBAAgB,kBAAkB,CAAC,WAAW,CAAC,EAAE,MAAM,GAAG,cAAc,EAAE,CA6BzE"}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Progressive TopoJSON loader for country polygons.
|
|
3
|
+
*
|
|
4
|
+
* Fetches the coarse 110m dataset first (fast first paint), then upgrades to
|
|
5
|
+
* the 50m dataset unless the consumer supplies a custom URL.
|
|
6
|
+
*/
|
|
7
|
+
import { useEffect, useState } from "react";
|
|
8
|
+
import * as topojson from "topojson-client";
|
|
9
|
+
import { CDN_TOPOJSON_110M, CDN_TOPOJSON_50M, } from "./globe-scene-types";
|
|
10
|
+
async function loadTopo(url) {
|
|
11
|
+
const resp = await fetch(url);
|
|
12
|
+
const topo = await resp.json();
|
|
13
|
+
const geo = topojson.feature(topo, topo.objects.countries);
|
|
14
|
+
return geo.features;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Hook: load country features from TopoJSON (progressive: 110m then 50m).
|
|
18
|
+
*
|
|
19
|
+
* If `topoJsonUrl` is provided, only that single URL is loaded; otherwise the
|
|
20
|
+
* coarse CDN dataset is fetched first and swapped for the detailed one once
|
|
21
|
+
* available.
|
|
22
|
+
*/
|
|
23
|
+
export function useCountryFeatures(topoJsonUrl) {
|
|
24
|
+
const [features, setFeatures] = useState([]);
|
|
25
|
+
useEffect(() => {
|
|
26
|
+
let cancelled = false;
|
|
27
|
+
async function load() {
|
|
28
|
+
try {
|
|
29
|
+
// Progressive: load 110m first (fast)
|
|
30
|
+
const coarse = await loadTopo(topoJsonUrl ?? CDN_TOPOJSON_110M);
|
|
31
|
+
if (!cancelled)
|
|
32
|
+
setFeatures(coarse);
|
|
33
|
+
// Then upgrade to 50m (detailed) unless custom URL provided
|
|
34
|
+
if (!topoJsonUrl) {
|
|
35
|
+
const fine = await loadTopo(CDN_TOPOJSON_50M);
|
|
36
|
+
if (!cancelled)
|
|
37
|
+
setFeatures(fine);
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
catch (err) {
|
|
41
|
+
console.error("[GlobeScene] Failed to load country GeoJSON:", err);
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
load();
|
|
45
|
+
return () => {
|
|
46
|
+
cancelled = true;
|
|
47
|
+
};
|
|
48
|
+
}, [topoJsonUrl]);
|
|
49
|
+
return features;
|
|
50
|
+
}
|
|
51
|
+
//# sourceMappingURL=globe-scene-data.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"globe-scene-data.js","sourceRoot":"","sources":["../../src/globe/globe-scene-data.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAC5C,OAAO,KAAK,QAAQ,MAAM,iBAAiB,CAAC;AAG5C,OAAO,EACL,iBAAiB,EACjB,gBAAgB,GAEjB,MAAM,qBAAqB,CAAC;AAE7B,KAAK,UAAU,QAAQ,CAAC,GAAW;IACjC,MAAM,IAAI,GAAG,MAAM,KAAK,CAAC,GAAG,CAAC,CAAC;IAC9B,MAAM,IAAI,GAAa,MAAM,IAAI,CAAC,IAAI,EAAE,CAAC;IACzC,MAAM,GAAG,GAAG,QAAQ,CAAC,OAAO,CAC1B,IAAI,EACJ,IAAI,CAAC,OAAO,CAAC,SAA+B,CAC7C,CAAC;IACF,OAAQ,GAAsC,CAAC,QAAQ,CAAC;AAC1D,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,kBAAkB,CAAC,WAAoB;IACrD,MAAM,CAAC,QAAQ,EAAE,WAAW,CAAC,GAAG,QAAQ,CAAmB,EAAE,CAAC,CAAC;IAE/D,SAAS,CAAC,GAAG,EAAE;QACb,IAAI,SAAS,GAAG,KAAK,CAAC;QAEtB,KAAK,UAAU,IAAI;YACjB,IAAI,CAAC;gBACH,sCAAsC;gBACtC,MAAM,MAAM,GAAG,MAAM,QAAQ,CAAC,WAAW,IAAI,iBAAiB,CAAC,CAAC;gBAChE,IAAI,CAAC,SAAS;oBAAE,WAAW,CAAC,MAAM,CAAC,CAAC;gBAEpC,4DAA4D;gBAC5D,IAAI,CAAC,WAAW,EAAE,CAAC;oBACjB,MAAM,IAAI,GAAG,MAAM,QAAQ,CAAC,gBAAgB,CAAC,CAAC;oBAC9C,IAAI,CAAC,SAAS;wBAAE,WAAW,CAAC,IAAI,CAAC,CAAC;gBACpC,CAAC;YACH,CAAC;YAAC,OAAO,GAAG,EAAE,CAAC;gBACb,OAAO,CAAC,KAAK,CAAC,8CAA8C,EAAE,GAAG,CAAC,CAAC;YACrE,CAAC;QACH,CAAC;QAED,IAAI,EAAE,CAAC;QACP,OAAO,GAAG,EAAE;YACV,SAAS,GAAG,IAAI,CAAC;QACnB,CAAC,CAAC;IACJ,CAAC,EAAE,CAAC,WAAW,CAAC,CAAC,CAAC;IAElB,OAAO,QAAQ,CAAC;AAClB,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* r3f-globe click and hover dispatchers.
|
|
3
|
+
*
|
|
4
|
+
* These inspect the layer string r3f-globe passes alongside the hit datum and
|
|
5
|
+
* normalize it into typed events (country-click, arc-click, point-click,
|
|
6
|
+
* hover) that the scene forwards to the main thread via `emitEvent`.
|
|
7
|
+
*/
|
|
8
|
+
export type EmitEventFn = (eventType: string, payload: unknown) => void;
|
|
9
|
+
export declare function createGlobeClickHandler(emitEvent: EmitEventFn): (layer: string, data: object | undefined) => void;
|
|
10
|
+
export declare function createGlobeHoverHandler(emitEvent: EmitEventFn): (layer: string | undefined, data: object | undefined) => void;
|
|
11
|
+
//# sourceMappingURL=globe-scene-interactions.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"globe-scene-interactions.d.ts","sourceRoot":"","sources":["../../src/globe/globe-scene-interactions.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAKH,MAAM,MAAM,WAAW,GAAG,CAAC,SAAS,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,KAAK,IAAI,CAAC;AAExE,wBAAgB,uBAAuB,CAAC,SAAS,EAAE,WAAW,IACpD,OAAO,MAAM,EAAE,MAAM,MAAM,GAAG,SAAS,UAgBhD;AAED,wBAAgB,uBAAuB,CAAC,SAAS,EAAE,WAAW,IACpD,OAAO,MAAM,GAAG,SAAS,EAAE,MAAM,MAAM,GAAG,SAAS,UAuB5D"}
|