@cellarnode/ui 0.3.2 → 0.5.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/__storybook__/mock-data.d.ts +16 -0
- package/dist/__storybook__/mock-data.d.ts.map +1 -0
- package/dist/__storybook__/mock-data.js +162 -0
- package/dist/__storybook__/mock-data.js.map +1 -0
- package/dist/chat/chat-toggle-button.stories.d.ts +33 -0
- package/dist/chat/chat-toggle-button.stories.d.ts.map +1 -0
- package/dist/chat/chat-toggle-button.stories.js +50 -0
- package/dist/chat/chat-toggle-button.stories.js.map +1 -0
- package/dist/chat/communication-hub-widget.d.ts.map +1 -1
- package/dist/chat/communication-hub-widget.js +3 -1
- package/dist/chat/communication-hub-widget.js.map +1 -1
- package/dist/chat/communication-hub-widget.stories.d.ts +18 -0
- package/dist/chat/communication-hub-widget.stories.d.ts.map +1 -0
- package/dist/chat/communication-hub-widget.stories.js +99 -0
- package/dist/chat/communication-hub-widget.stories.js.map +1 -0
- package/dist/chat/communication-panel.d.ts.map +1 -1
- package/dist/chat/communication-panel.js +3 -1
- package/dist/chat/communication-panel.js.map +1 -1
- package/dist/chat/communication-panel.stories.d.ts +21 -0
- package/dist/chat/communication-panel.stories.d.ts.map +1 -0
- package/dist/chat/communication-panel.stories.js +173 -0
- package/dist/chat/communication-panel.stories.js.map +1 -0
- package/dist/chat/global-chat-widget.stories.d.ts +34 -0
- package/dist/chat/global-chat-widget.stories.d.ts.map +1 -0
- package/dist/chat/global-chat-widget.stories.js +158 -0
- package/dist/chat/global-chat-widget.stories.js.map +1 -0
- package/dist/chat/messenger-layout.d.ts.map +1 -1
- package/dist/chat/messenger-layout.js +3 -1
- package/dist/chat/messenger-layout.js.map +1 -1
- package/dist/chat/messenger-layout.stories.d.ts +18 -0
- package/dist/chat/messenger-layout.stories.d.ts.map +1 -0
- package/dist/chat/messenger-layout.stories.js +97 -0
- package/dist/chat/messenger-layout.stories.js.map +1 -0
- package/dist/chat/negotiation-event-card.d.ts.map +1 -1
- package/dist/chat/negotiation-event-card.js.map +1 -1
- package/dist/chat/negotiation-event-card.stories.d.ts +19 -0
- package/dist/chat/negotiation-event-card.stories.d.ts.map +1 -0
- package/dist/chat/negotiation-event-card.stories.js +104 -0
- package/dist/chat/negotiation-event-card.stories.js.map +1 -0
- package/dist/chat/unified-timeline.js +4 -4
- package/dist/chat/unified-timeline.js.map +1 -1
- package/dist/chat/unified-timeline.stories.d.ts +18 -0
- package/dist/chat/unified-timeline.stories.d.ts.map +1 -0
- package/dist/chat/unified-timeline.stories.js +168 -0
- package/dist/chat/unified-timeline.stories.js.map +1 -0
- package/dist/chat/use-chat.js +10 -10
- package/dist/chat/use-chat.js.map +1 -1
- package/dist/components/accordion.stories.d.ts +7 -0
- package/dist/components/accordion.stories.d.ts.map +1 -0
- package/dist/components/accordion.stories.js +16 -0
- package/dist/components/accordion.stories.js.map +1 -0
- package/dist/components/alert.stories.d.ts +8 -0
- package/dist/components/alert.stories.d.ts.map +1 -0
- package/dist/components/alert.stories.js +26 -0
- package/dist/components/alert.stories.js.map +1 -0
- package/dist/components/animated-list.d.ts.map +1 -1
- package/dist/components/animated-list.js +3 -1
- package/dist/components/animated-list.js.map +1 -1
- package/dist/components/animated-list.stories.d.ts +18 -0
- package/dist/components/animated-list.stories.d.ts.map +1 -0
- package/dist/components/animated-list.stories.js +61 -0
- package/dist/components/animated-list.stories.js.map +1 -0
- package/dist/components/avatar.d.ts +7 -5
- package/dist/components/avatar.d.ts.map +1 -1
- package/dist/components/avatar.js +2 -3
- package/dist/components/avatar.js.map +1 -1
- package/dist/components/avatar.stories.d.ts +16 -0
- package/dist/components/avatar.stories.d.ts.map +1 -0
- package/dist/components/avatar.stories.js +28 -0
- package/dist/components/avatar.stories.js.map +1 -0
- package/dist/components/badge.d.ts +7 -5
- package/dist/components/badge.d.ts.map +1 -1
- package/dist/components/badge.js +2 -3
- package/dist/components/badge.js.map +1 -1
- package/dist/components/badge.stories.d.ts +17 -0
- package/dist/components/badge.stories.d.ts.map +1 -0
- package/dist/components/badge.stories.js +25 -0
- package/dist/components/badge.stories.js.map +1 -0
- package/dist/components/button.d.ts +4 -2
- package/dist/components/button.d.ts.map +1 -1
- package/dist/components/button.js +2 -3
- package/dist/components/button.js.map +1 -1
- package/dist/components/card.d.ts +18 -6
- package/dist/components/card.d.ts.map +1 -1
- package/dist/components/card.js +18 -13
- package/dist/components/card.js.map +1 -1
- package/dist/components/card.stories.d.ts +16 -0
- package/dist/components/card.stories.d.ts.map +1 -0
- package/dist/components/card.stories.js +20 -0
- package/dist/components/card.stories.js.map +1 -0
- package/dist/components/checkbox.stories.d.ts +19 -0
- package/dist/components/checkbox.stories.d.ts.map +1 -0
- package/dist/components/checkbox.stories.js +34 -0
- package/dist/components/checkbox.stories.js.map +1 -0
- package/dist/components/classification-select.d.ts.map +1 -1
- package/dist/components/classification-select.js +1 -0
- package/dist/components/classification-select.js.map +1 -1
- package/dist/components/classification-select.stories.d.ts +17 -0
- package/dist/components/classification-select.stories.d.ts.map +1 -0
- package/dist/components/classification-select.stories.js +100 -0
- package/dist/components/classification-select.stories.js.map +1 -0
- package/dist/components/combobox.stories.d.ts +15 -0
- package/dist/components/combobox.stories.d.ts.map +1 -0
- package/dist/components/combobox.stories.js +45 -0
- package/dist/components/combobox.stories.js.map +1 -0
- package/dist/components/command.stories.d.ts +9 -0
- package/dist/components/command.stories.d.ts.map +1 -0
- package/dist/components/command.stories.js +22 -0
- package/dist/components/command.stories.js.map +1 -0
- package/dist/components/description-list.stories.d.ts +15 -0
- package/dist/components/description-list.stories.d.ts.map +1 -0
- package/dist/components/description-list.stories.js +16 -0
- package/dist/components/description-list.stories.js.map +1 -0
- package/dist/components/dialog.stories.d.ts +8 -0
- package/dist/components/dialog.stories.d.ts.map +1 -0
- package/dist/components/dialog.stories.js +26 -0
- package/dist/components/dialog.stories.js.map +1 -0
- package/dist/components/divider.stories.d.ts +15 -0
- package/dist/components/divider.stories.d.ts.map +1 -0
- package/dist/components/divider.stories.js +16 -0
- package/dist/components/divider.stories.js.map +1 -0
- package/dist/components/drawer.d.ts +12 -4
- package/dist/components/drawer.d.ts.map +1 -1
- package/dist/components/drawer.js +12 -9
- package/dist/components/drawer.js.map +1 -1
- package/dist/components/drawer.stories.d.ts +8 -0
- package/dist/components/drawer.stories.d.ts.map +1 -0
- package/dist/components/drawer.stories.js +27 -0
- package/dist/components/drawer.stories.js.map +1 -0
- package/dist/components/dropdown-menu.stories.d.ts +8 -0
- package/dist/components/dropdown-menu.stories.d.ts.map +1 -0
- package/dist/components/dropdown-menu.stories.js +17 -0
- package/dist/components/dropdown-menu.stories.js.map +1 -0
- package/dist/components/dropdown.d.ts.map +1 -1
- package/dist/components/dropdown.js +8 -5
- package/dist/components/dropdown.js.map +1 -1
- package/dist/components/dropdown.stories.d.ts +8 -0
- package/dist/components/dropdown.stories.d.ts.map +1 -0
- package/dist/components/dropdown.stories.js +16 -0
- package/dist/components/dropdown.stories.js.map +1 -0
- package/dist/components/fieldset.stories.d.ts +9 -0
- package/dist/components/fieldset.stories.d.ts.map +1 -0
- package/dist/components/fieldset.stories.js +24 -0
- package/dist/components/fieldset.stories.js.map +1 -0
- package/dist/components/form.d.ts.map +1 -1
- package/dist/components/form.js +5 -4
- package/dist/components/form.js.map +1 -1
- package/dist/components/form.stories.d.ts +7 -0
- package/dist/components/form.stories.d.ts.map +1 -0
- package/dist/components/form.stories.js +46 -0
- package/dist/components/form.stories.js.map +1 -0
- package/dist/components/heading.stories.d.ts +16 -0
- package/dist/components/heading.stories.d.ts.map +1 -0
- package/dist/components/heading.stories.js +23 -0
- package/dist/components/heading.stories.js.map +1 -0
- package/dist/components/input.d.ts +4 -3
- package/dist/components/input.d.ts.map +1 -1
- package/dist/components/input.js +2 -3
- package/dist/components/input.js.map +1 -1
- package/dist/components/input.stories.d.ts +11 -0
- package/dist/components/input.stories.d.ts.map +1 -0
- package/dist/components/input.stories.js +44 -0
- package/dist/components/input.stories.js.map +1 -0
- package/dist/components/kanban-board.d.ts +4 -4
- package/dist/components/kanban-board.d.ts.map +1 -1
- package/dist/components/kanban-board.js.map +1 -1
- package/dist/components/kanban-board.stories.js +1 -1
- package/dist/components/kanban-board.stories.js.map +1 -1
- package/dist/components/kanban-card.stories.d.ts +16 -0
- package/dist/components/kanban-card.stories.d.ts.map +1 -0
- package/dist/components/kanban-card.stories.js +30 -0
- package/dist/components/kanban-card.stories.js.map +1 -0
- package/dist/components/kanban-dnd-board.d.ts +1 -1
- package/dist/components/kanban-dnd-board.d.ts.map +1 -1
- package/dist/components/kanban-dnd-board.js +2 -2
- package/dist/components/kanban-dnd-board.js.map +1 -1
- package/dist/components/kanban-dnd-board.stories.d.ts +15 -0
- package/dist/components/kanban-dnd-board.stories.d.ts.map +1 -0
- package/dist/components/kanban-dnd-board.stories.js +112 -0
- package/dist/components/kanban-dnd-board.stories.js.map +1 -0
- package/dist/components/label.stories.d.ts +16 -0
- package/dist/components/label.stories.d.ts.map +1 -0
- package/dist/components/label.stories.js +21 -0
- package/dist/components/label.stories.js.map +1 -0
- package/dist/components/link.d.ts +3 -2
- package/dist/components/link.d.ts.map +1 -1
- package/dist/components/link.js +2 -3
- package/dist/components/link.js.map +1 -1
- package/dist/components/link.stories.d.ts +15 -0
- package/dist/components/link.stories.d.ts.map +1 -0
- package/dist/components/link.stories.js +19 -0
- package/dist/components/link.stories.js.map +1 -0
- package/dist/components/listbox.stories.d.ts +8 -0
- package/dist/components/listbox.stories.d.ts.map +1 -0
- package/dist/components/listbox.stories.js +46 -0
- package/dist/components/listbox.stories.js.map +1 -0
- package/dist/components/pagination.stories.d.ts +9 -0
- package/dist/components/pagination.stories.d.ts.map +1 -0
- package/dist/components/pagination.stories.js +19 -0
- package/dist/components/pagination.stories.js.map +1 -0
- package/dist/components/popover.stories.d.ts +8 -0
- package/dist/components/popover.stories.d.ts.map +1 -0
- package/dist/components/popover.stories.js +17 -0
- package/dist/components/popover.stories.js.map +1 -0
- package/dist/components/radio.stories.d.ts +15 -0
- package/dist/components/radio.stories.d.ts.map +1 -0
- package/dist/components/radio.stories.js +32 -0
- package/dist/components/radio.stories.js.map +1 -0
- package/dist/components/scroll-area.stories.d.ts +14 -0
- package/dist/components/scroll-area.stories.d.ts.map +1 -0
- package/dist/components/scroll-area.stories.js +27 -0
- package/dist/components/scroll-area.stories.js.map +1 -0
- package/dist/components/select.d.ts +3 -2
- package/dist/components/select.d.ts.map +1 -1
- package/dist/components/select.js +2 -3
- package/dist/components/select.js.map +1 -1
- package/dist/components/select.stories.d.ts +10 -0
- package/dist/components/select.stories.d.ts.map +1 -0
- package/dist/components/select.stories.js +25 -0
- package/dist/components/select.stories.js.map +1 -0
- package/dist/components/separator.stories.d.ts +15 -0
- package/dist/components/separator.stories.d.ts.map +1 -0
- package/dist/components/separator.stories.js +16 -0
- package/dist/components/separator.stories.js.map +1 -0
- package/dist/components/shadcn-badge.stories.d.ts +15 -0
- package/dist/components/shadcn-badge.stories.d.ts.map +1 -0
- package/dist/components/shadcn-badge.stories.js +16 -0
- package/dist/components/shadcn-badge.stories.js.map +1 -0
- package/dist/components/shadcn-button.stories.d.ts +17 -0
- package/dist/components/shadcn-button.stories.d.ts.map +1 -0
- package/dist/components/shadcn-button.stories.js +22 -0
- package/dist/components/shadcn-button.stories.js.map +1 -0
- package/dist/components/shadcn-dialog.stories.d.ts +15 -0
- package/dist/components/shadcn-dialog.stories.d.ts.map +1 -0
- package/dist/components/shadcn-dialog.stories.js +26 -0
- package/dist/components/shadcn-dialog.stories.js.map +1 -0
- package/dist/components/shadcn-input.stories.d.ts +16 -0
- package/dist/components/shadcn-input.stories.d.ts.map +1 -0
- package/dist/components/shadcn-input.stories.js +22 -0
- package/dist/components/shadcn-input.stories.js.map +1 -0
- package/dist/components/shadcn-select.stories.d.ts +16 -0
- package/dist/components/shadcn-select.stories.d.ts.map +1 -0
- package/dist/components/shadcn-select.stories.js +19 -0
- package/dist/components/shadcn-select.stories.js.map +1 -0
- package/dist/components/shadcn-textarea.stories.d.ts +16 -0
- package/dist/components/shadcn-textarea.stories.d.ts.map +1 -0
- package/dist/components/shadcn-textarea.stories.js +27 -0
- package/dist/components/shadcn-textarea.stories.js.map +1 -0
- package/dist/components/sheet.d.ts +13 -5
- package/dist/components/sheet.d.ts.map +1 -1
- package/dist/components/sheet.js +12 -9
- package/dist/components/sheet.js.map +1 -1
- package/dist/components/sheet.stories.d.ts +8 -0
- package/dist/components/sheet.stories.d.ts.map +1 -0
- package/dist/components/sheet.stories.js +17 -0
- package/dist/components/sheet.stories.js.map +1 -0
- package/dist/components/sidebar.js +5 -5
- package/dist/components/sidebar.js.map +1 -1
- package/dist/components/sidebar.stories.d.ts +8 -0
- package/dist/components/sidebar.stories.d.ts.map +1 -0
- package/dist/components/sidebar.stories.js +31 -0
- package/dist/components/sidebar.stories.js.map +1 -0
- package/dist/components/skeleton.stories.d.ts +16 -0
- package/dist/components/skeleton.stories.d.ts.map +1 -0
- package/dist/components/skeleton.stories.js +21 -0
- package/dist/components/skeleton.stories.js.map +1 -0
- package/dist/components/slider.d.ts +3 -1
- package/dist/components/slider.d.ts.map +1 -1
- package/dist/components/slider.js +3 -3
- package/dist/components/slider.js.map +1 -1
- package/dist/components/slider.stories.d.ts +10 -0
- package/dist/components/slider.stories.d.ts.map +1 -0
- package/dist/components/slider.stories.js +43 -0
- package/dist/components/slider.stories.js.map +1 -0
- package/dist/components/sonner.stories.d.ts +16 -0
- package/dist/components/sonner.stories.d.ts.map +1 -0
- package/dist/components/sonner.stories.js +29 -0
- package/dist/components/sonner.stories.js.map +1 -0
- package/dist/components/stat-card.stories.d.ts +17 -0
- package/dist/components/stat-card.stories.d.ts.map +1 -0
- package/dist/components/stat-card.stories.js +46 -0
- package/dist/components/stat-card.stories.js.map +1 -0
- package/dist/components/switch.stories.d.ts +12 -0
- package/dist/components/switch.stories.d.ts.map +1 -0
- package/dist/components/switch.stories.js +51 -0
- package/dist/components/switch.stories.js.map +1 -0
- package/dist/components/table.js +7 -7
- package/dist/components/table.js.map +1 -1
- package/dist/components/table.stories.d.ts +9 -0
- package/dist/components/table.stories.d.ts.map +1 -0
- package/dist/components/table.stories.js +26 -0
- package/dist/components/table.stories.js.map +1 -0
- package/dist/components/tabs.stories.d.ts +8 -0
- package/dist/components/tabs.stories.d.ts.map +1 -0
- package/dist/components/tabs.stories.js +16 -0
- package/dist/components/tabs.stories.js.map +1 -0
- package/dist/components/text.stories.d.ts +17 -0
- package/dist/components/text.stories.d.ts.map +1 -0
- package/dist/components/text.stories.js +27 -0
- package/dist/components/text.stories.js.map +1 -0
- package/dist/components/textarea.d.ts +3 -2
- package/dist/components/textarea.d.ts.map +1 -1
- package/dist/components/textarea.js +2 -3
- package/dist/components/textarea.js.map +1 -1
- package/dist/components/textarea.stories.d.ts +10 -0
- package/dist/components/textarea.stories.d.ts.map +1 -0
- package/dist/components/textarea.stories.js +36 -0
- package/dist/components/textarea.stories.js.map +1 -0
- package/dist/components/toast.d.ts +20 -7
- package/dist/components/toast.d.ts.map +1 -1
- package/dist/components/toast.js +17 -14
- package/dist/components/toast.js.map +1 -1
- package/dist/components/tooltip.d.ts +3 -1
- package/dist/components/tooltip.d.ts.map +1 -1
- package/dist/components/tooltip.js +3 -3
- package/dist/components/tooltip.js.map +1 -1
- package/dist/components/tooltip.stories.d.ts +9 -0
- package/dist/components/tooltip.stories.d.ts.map +1 -0
- package/dist/components/tooltip.stories.js +20 -0
- package/dist/components/tooltip.stories.js.map +1 -0
- package/dist/globe/electron-arc.d.ts +1 -1
- package/dist/globe/electron-arc.d.ts.map +1 -1
- package/dist/globe/electron-arc.js +16 -5
- package/dist/globe/electron-arc.js.map +1 -1
- package/dist/globe/globe-canvas.d.ts +40 -0
- package/dist/globe/globe-canvas.d.ts.map +1 -0
- package/dist/globe/globe-canvas.js +139 -0
- package/dist/globe/globe-canvas.js.map +1 -0
- package/dist/globe/globe-halo.d.ts +8 -0
- package/dist/globe/globe-halo.d.ts.map +1 -0
- package/dist/globe/globe-halo.js +39 -0
- package/dist/globe/globe-halo.js.map +1 -0
- package/dist/globe/globe-loading-skeleton.stories.d.ts +16 -0
- package/dist/globe/globe-loading-skeleton.stories.d.ts.map +1 -0
- package/dist/globe/globe-loading-skeleton.stories.js +22 -0
- package/dist/globe/globe-loading-skeleton.stories.js.map +1 -0
- package/dist/globe/globe-scene.d.ts +43 -0
- package/dist/globe/globe-scene.d.ts.map +1 -0
- package/dist/globe/globe-scene.js +442 -0
- package/dist/globe/globe-scene.js.map +1 -0
- package/dist/globe/globe-stats-fallback.d.ts +12 -0
- package/dist/globe/globe-stats-fallback.d.ts.map +1 -0
- package/dist/globe/globe-stats-fallback.js +43 -0
- package/dist/globe/globe-stats-fallback.js.map +1 -0
- package/dist/globe/globe-stats-fallback.stories.d.ts +17 -0
- package/dist/globe/globe-stats-fallback.stories.d.ts.map +1 -0
- package/dist/globe/globe-stats-fallback.stories.js +152 -0
- package/dist/globe/globe-stats-fallback.stories.js.map +1 -0
- package/dist/globe/globe-theme.js.map +1 -1
- package/dist/globe/globe-tooltip.d.ts +9 -0
- package/dist/globe/globe-tooltip.d.ts.map +1 -0
- package/dist/globe/globe-tooltip.js +51 -0
- package/dist/globe/globe-tooltip.js.map +1 -0
- package/dist/globe/globe-types.d.ts +12 -0
- package/dist/globe/globe-types.d.ts.map +1 -1
- package/dist/globe/globe-view.d.ts +4 -3
- package/dist/globe/globe-view.d.ts.map +1 -1
- package/dist/globe/globe-view.js +27 -589
- package/dist/globe/globe-view.js.map +1 -1
- package/dist/globe/globe-worker.d.ts +2 -0
- package/dist/globe/globe-worker.d.ts.map +1 -0
- package/dist/globe/globe-worker.js +5 -0
- package/dist/globe/globe-worker.js.map +1 -0
- package/dist/globe/index.d.ts +4 -7
- package/dist/globe/index.d.ts.map +1 -1
- package/dist/globe/index.js +3 -4
- package/dist/globe/index.js.map +1 -1
- package/dist/globe/map/map-geometry.d.ts.map +1 -1
- package/dist/globe/map/map-geometry.js.map +1 -1
- package/dist/globe/scene-extras.d.ts +0 -6
- package/dist/globe/scene-extras.d.ts.map +1 -1
- package/dist/globe/scene-extras.js +0 -61
- package/dist/globe/scene-extras.js.map +1 -1
- package/dist/hooks/use-mobile.d.ts.map +1 -1
- package/dist/hooks/use-mobile.js +1 -0
- package/dist/hooks/use-mobile.js.map +1 -1
- package/dist/hooks/use-toast.d.ts +4 -11
- package/dist/hooks/use-toast.d.ts.map +1 -1
- package/dist/hooks/use-toast.js +0 -6
- package/dist/hooks/use-toast.js.map +1 -1
- package/dist/nav/app-shell.js.map +1 -1
- package/dist/nav/app-shell.stories.d.ts +21 -0
- package/dist/nav/app-shell.stories.d.ts.map +1 -0
- package/dist/nav/app-shell.stories.js +29 -0
- package/dist/nav/app-shell.stories.js.map +1 -0
- package/dist/nav/app-sidebar.stories.d.ts +11 -0
- package/dist/nav/app-sidebar.stories.d.ts.map +1 -0
- package/dist/nav/app-sidebar.stories.js +52 -0
- package/dist/nav/app-sidebar.stories.js.map +1 -0
- package/dist/nav/expandable-nav-item.d.ts.map +1 -1
- package/dist/nav/expandable-nav-item.js +1 -0
- package/dist/nav/expandable-nav-item.js.map +1 -1
- package/dist/nav/expandable-nav-item.stories.d.ts +12 -0
- package/dist/nav/expandable-nav-item.stories.d.ts.map +1 -0
- package/dist/nav/expandable-nav-item.stories.js +43 -0
- package/dist/nav/expandable-nav-item.stories.js.map +1 -0
- package/dist/offer/attachments-folder.stories.d.ts +17 -0
- package/dist/offer/attachments-folder.stories.d.ts.map +1 -0
- package/dist/offer/attachments-folder.stories.js +83 -0
- package/dist/offer/attachments-folder.stories.js.map +1 -0
- package/dist/offer/beverage-details.stories.d.ts +17 -0
- package/dist/offer/beverage-details.stories.d.ts.map +1 -0
- package/dist/offer/beverage-details.stories.js +59 -0
- package/dist/offer/beverage-details.stories.js.map +1 -0
- package/dist/offer/composition-list.stories.d.ts +18 -0
- package/dist/offer/composition-list.stories.d.ts.map +1 -0
- package/dist/offer/composition-list.stories.js +52 -0
- package/dist/offer/composition-list.stories.js.map +1 -0
- package/dist/offer/confirm-action-dialog.stories.d.ts +17 -0
- package/dist/offer/confirm-action-dialog.stories.d.ts.map +1 -0
- package/dist/offer/confirm-action-dialog.stories.js +41 -0
- package/dist/offer/confirm-action-dialog.stories.js.map +1 -0
- package/dist/offer/inline-counter-form.stories.d.ts +17 -0
- package/dist/offer/inline-counter-form.stories.d.ts.map +1 -0
- package/dist/offer/inline-counter-form.stories.js +49 -0
- package/dist/offer/inline-counter-form.stories.js.map +1 -0
- package/dist/offer/negotiation-event-card.d.ts.map +1 -1
- package/dist/offer/negotiation-event-card.js.map +1 -1
- package/dist/offer/negotiation-event-card.stories.d.ts +19 -0
- package/dist/offer/negotiation-event-card.stories.d.ts.map +1 -0
- package/dist/offer/negotiation-event-card.stories.js +90 -0
- package/dist/offer/negotiation-event-card.stories.js.map +1 -0
- package/dist/offer/offer-status-badge.stories.d.ts +15 -0
- package/dist/offer/offer-status-badge.stories.d.ts.map +1 -0
- package/dist/offer/offer-status-badge.stories.js +33 -0
- package/dist/offer/offer-status-badge.stories.js.map +1 -0
- package/dist/offer/opportunity-requirements.stories.d.ts +18 -0
- package/dist/offer/opportunity-requirements.stories.d.ts.map +1 -0
- package/dist/offer/opportunity-requirements.stories.js +75 -0
- package/dist/offer/opportunity-requirements.stories.js.map +1 -0
- package/dist/offer/org-banner.stories.d.ts +18 -0
- package/dist/offer/org-banner.stories.d.ts.map +1 -0
- package/dist/offer/org-banner.stories.js +51 -0
- package/dist/offer/org-banner.stories.js.map +1 -0
- package/dist/offer/reviews-summary.d.ts +3 -0
- package/dist/offer/reviews-summary.d.ts.map +1 -1
- package/dist/offer/reviews-summary.js +12 -1
- package/dist/offer/reviews-summary.js.map +1 -1
- package/dist/offer/reviews-summary.stories.d.ts +18 -0
- package/dist/offer/reviews-summary.stories.d.ts.map +1 -0
- package/dist/offer/reviews-summary.stories.js +104 -0
- package/dist/offer/reviews-summary.stories.js.map +1 -0
- package/dist/offer/sensory-profile.stories.d.ts +17 -0
- package/dist/offer/sensory-profile.stories.d.ts.map +1 -0
- package/dist/offer/sensory-profile.stories.js +84 -0
- package/dist/offer/sensory-profile.stories.js.map +1 -0
- package/dist/opportunities/opportunities-table.d.ts.map +1 -1
- package/dist/opportunities/opportunities-table.js +7 -2
- package/dist/opportunities/opportunities-table.js.map +1 -1
- package/dist/opportunities/opportunities-table.stories.d.ts +24 -0
- package/dist/opportunities/opportunities-table.stories.d.ts.map +1 -0
- package/dist/opportunities/opportunities-table.stories.js +34 -0
- package/dist/opportunities/opportunities-table.stories.js.map +1 -0
- package/dist/profile/profile.stories.d.ts +15 -0
- package/dist/profile/profile.stories.d.ts.map +1 -0
- package/dist/profile/profile.stories.js +33 -0
- package/dist/profile/profile.stories.js.map +1 -0
- package/package.json +12 -23
package/dist/globe/globe-view.js
CHANGED
|
@@ -1,601 +1,39 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
3
|
-
import * as THREE from "three";
|
|
4
|
-
import * as topojson from "topojson-client";
|
|
5
|
-
import { cn } from "../lib/utils";
|
|
6
|
-
import { numericToAlpha2 } from "./map/country-code-map";
|
|
7
|
-
import { COUNTRY_GEO_MAP } from "./data/country-geo";
|
|
2
|
+
import { useState, useMemo, useRef, lazy, Suspense } from "react";
|
|
8
3
|
import { resolveTheme } from "./globe-theme";
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
// ---------------------------------------------------------------------------
|
|
16
|
-
// Constants
|
|
17
|
-
// ---------------------------------------------------------------------------
|
|
18
|
-
const CDN_TOPOJSON_URL = "https://cdn.jsdelivr.net/npm/world-atlas@2/countries-50m.json";
|
|
19
|
-
const DEFAULT_POV = { lat: 30, lng: 10, altitude: 2.5 };
|
|
20
|
-
const AUTO_ROTATE_SPEED = 0.3;
|
|
21
|
-
const IDLE_RESUME_MS = 3000;
|
|
22
|
-
function deriveTooltipStyles(theme) {
|
|
23
|
-
// Parse atmosphere color to derive accent
|
|
24
|
-
const c = new THREE.Color(theme.atmosphere);
|
|
25
|
-
const isLight = c.r + c.g + c.b > 1.5; // rough lightness check
|
|
26
|
-
if (theme.starfieldOpacity === 0 && isLight) {
|
|
27
|
-
// Light theme tooltip
|
|
28
|
-
return {
|
|
29
|
-
bg: "rgba(255,255,255,0.95)",
|
|
30
|
-
border: `rgba(${Math.round(c.r * 255)},${Math.round(c.g * 255)},${Math.round(c.b * 255)},0.2)`,
|
|
31
|
-
text: "#0f172a",
|
|
32
|
-
muted: "#64748b",
|
|
33
|
-
accent: theme.atmosphere,
|
|
34
|
-
shadow: "0 4px 24px rgba(0,0,0,0.12), 0 1px 3px rgba(0,0,0,0.08)",
|
|
35
|
-
};
|
|
36
|
-
}
|
|
37
|
-
// Dark theme tooltip
|
|
38
|
-
return {
|
|
39
|
-
bg: "rgba(6,12,20,0.94)",
|
|
40
|
-
border: `rgba(${Math.round(c.r * 255)},${Math.round(c.g * 255)},${Math.round(c.b * 255)},0.2)`,
|
|
41
|
-
text: "#f1f5f9",
|
|
42
|
-
muted: "#94a3b8",
|
|
43
|
-
accent: theme.atmosphere,
|
|
44
|
-
shadow: "0 4px 24px rgba(0,0,0,0.5), 0 1px 3px rgba(0,0,0,0.3)",
|
|
45
|
-
};
|
|
46
|
-
}
|
|
47
|
-
/**
|
|
48
|
-
* Build a theme-aware glassmorphic tooltip.
|
|
49
|
-
* Consistent across all globe layers — arcs, countries, points, hex dots.
|
|
50
|
-
* Works on both dark and light themes.
|
|
51
|
-
*/
|
|
52
|
-
function buildTooltip(styles, eyebrow, title, details) {
|
|
53
|
-
// Reset float-tooltip-kap's default grey box styling
|
|
54
|
-
return `<style>.float-tooltip-kap{background:none!important;padding:0!important;border-radius:0!important;max-width:none!important;font:inherit!important}</style><div style="
|
|
55
|
-
background: ${styles.bg};
|
|
56
|
-
backdrop-filter: blur(12px);
|
|
57
|
-
-webkit-backdrop-filter: blur(12px);
|
|
58
|
-
border: 1px solid ${styles.border};
|
|
59
|
-
border-left: 3px solid ${styles.accent};
|
|
60
|
-
border-radius: 10px;
|
|
61
|
-
padding: 10px 14px 10px 12px;
|
|
62
|
-
color: ${styles.text};
|
|
63
|
-
font-family: system-ui, -apple-system, sans-serif;
|
|
64
|
-
line-height: 1.35;
|
|
65
|
-
max-width: 260px;
|
|
66
|
-
pointer-events: none;
|
|
67
|
-
box-shadow: ${styles.shadow};
|
|
68
|
-
">
|
|
69
|
-
<div style="
|
|
70
|
-
color: ${styles.accent};
|
|
71
|
-
font-size: 10px;
|
|
72
|
-
font-weight: 600;
|
|
73
|
-
text-transform: uppercase;
|
|
74
|
-
letter-spacing: 0.08em;
|
|
75
|
-
margin-bottom: 3px;
|
|
76
|
-
">${eyebrow}</div>
|
|
77
|
-
<div style="
|
|
78
|
-
font-weight: 600;
|
|
79
|
-
font-size: 14px;
|
|
80
|
-
line-height: 1.3;
|
|
81
|
-
">${title}</div>
|
|
82
|
-
${details ? `<div style="
|
|
83
|
-
margin-top: 4px;
|
|
84
|
-
color: ${styles.muted};
|
|
85
|
-
font-size: 12px;
|
|
86
|
-
line-height: 1.3;
|
|
87
|
-
">${details}</div>` : ""}
|
|
88
|
-
</div>`;
|
|
89
|
-
}
|
|
90
|
-
// ---------------------------------------------------------------------------
|
|
91
|
-
// WebGL detection
|
|
92
|
-
// ---------------------------------------------------------------------------
|
|
93
|
-
function isWebGLAvailable() {
|
|
4
|
+
import { getVignetteStyle } from "./scene-extras";
|
|
5
|
+
import { GlobeTooltip } from "./globe-tooltip";
|
|
6
|
+
import { GlobeStatsFallback } from "./globe-stats-fallback";
|
|
7
|
+
import { GlobeLoadingSkeleton } from "./globe-loading-skeleton";
|
|
8
|
+
const LazyGlobeCanvas = lazy(() => import("./globe-canvas").then((m) => ({ default: m.GlobeCanvas })));
|
|
9
|
+
function detectOffscreenSupport() {
|
|
94
10
|
try {
|
|
95
|
-
|
|
96
|
-
|
|
11
|
+
if (typeof OffscreenCanvas === "undefined")
|
|
12
|
+
return false;
|
|
13
|
+
const canvas = new OffscreenCanvas(1, 1);
|
|
14
|
+
const gl = canvas.getContext("webgl2") ?? canvas.getContext("webgl");
|
|
15
|
+
return gl !== null;
|
|
97
16
|
}
|
|
98
17
|
catch {
|
|
99
18
|
return false;
|
|
100
19
|
}
|
|
101
20
|
}
|
|
102
|
-
function
|
|
103
|
-
const [features, setFeatures] = useState([]);
|
|
104
|
-
useEffect(() => {
|
|
105
|
-
let cancelled = false;
|
|
106
|
-
async function load() {
|
|
107
|
-
try {
|
|
108
|
-
const url = topoJsonUrl ?? CDN_TOPOJSON_URL;
|
|
109
|
-
const resp = await fetch(url);
|
|
110
|
-
const topo = await resp.json();
|
|
111
|
-
const countriesGeo = topojson.feature(topo, topo.objects.countries);
|
|
112
|
-
if (!cancelled) {
|
|
113
|
-
setFeatures(countriesGeo.features);
|
|
114
|
-
}
|
|
115
|
-
}
|
|
116
|
-
catch (err) {
|
|
117
|
-
console.error("[GlobeView] Failed to load country GeoJSON:", err);
|
|
118
|
-
}
|
|
119
|
-
}
|
|
120
|
-
load();
|
|
121
|
-
return () => {
|
|
122
|
-
cancelled = true;
|
|
123
|
-
};
|
|
124
|
-
}, [topoJsonUrl]);
|
|
125
|
-
return features;
|
|
126
|
-
}
|
|
127
|
-
// ---------------------------------------------------------------------------
|
|
128
|
-
// Component
|
|
129
|
-
// ---------------------------------------------------------------------------
|
|
130
|
-
export function GlobeView({ arcs, points, countryData, selectedCountryCode, selectedArcId, onCountryClick, onArcClick, onHover, theme, preset = "darkTeal", autoRotate = true, electronFrequency = 800, selectedBoostFactor = 4, initialPov, topoJsonUrl, className, height, }) {
|
|
131
|
-
const globeRef = useRef(undefined);
|
|
21
|
+
export function GlobeView({ arcs, points, countryData, selectedCountryCode, selectedArcId, onCountryClick, onArcClick, onHover, theme: themeOverrides, preset = "darkTeal", autoRotate = true, electronFrequency = 800, selectedBoostFactor, initialPov, topoJsonUrl, className, height = "clamp(450px, 60vw, 700px)", fallbackLabels, }) {
|
|
132
22
|
const containerRef = useRef(null);
|
|
133
|
-
const [
|
|
134
|
-
const
|
|
135
|
-
|
|
136
|
-
//
|
|
137
|
-
const
|
|
138
|
-
? window.matchMedia("(prefers-reduced-motion: reduce)").matches
|
|
139
|
-
: false;
|
|
140
|
-
// Stable refs for callbacks (avoid stale closures)
|
|
141
|
-
const onCountryClickRef = useRef(onCountryClick);
|
|
142
|
-
const onArcClickRef = useRef(onArcClick);
|
|
143
|
-
const onHoverRef = useRef(onHover);
|
|
144
|
-
onCountryClickRef.current = onCountryClick;
|
|
145
|
-
onArcClickRef.current = onArcClick;
|
|
146
|
-
onHoverRef.current = onHover;
|
|
147
|
-
// -- WebGL check --
|
|
148
|
-
const [webglOk] = useState(() => isWebGLAvailable());
|
|
149
|
-
// -- Theme resolution --
|
|
150
|
-
const resolvedTheme = useMemo(() => resolveTheme(preset, containerRef.current, theme), [preset, theme]);
|
|
151
|
-
// Tooltip styles derived from theme — works on dark and light
|
|
152
|
-
const tooltipStyles = useMemo(() => deriveTooltipStyles(resolvedTheme), [resolvedTheme]);
|
|
153
|
-
// Hollow globe: no globe material needed (showGlobe={false})
|
|
154
|
-
// -- Load country polygons --
|
|
155
|
-
const countryFeatures = useCountryFeatures(topoJsonUrl);
|
|
156
|
-
// -- Electron arc system --
|
|
157
|
-
const arcsData = useElectronEmitter(arcs ?? [], resolvedTheme, electronFrequency, selectedCountryCode, selectedArcId, selectedBoostFactor, reducedMotion);
|
|
158
|
-
// -- ResizeObserver --
|
|
159
|
-
useEffect(() => {
|
|
160
|
-
const el = containerRef.current;
|
|
161
|
-
if (!el)
|
|
162
|
-
return;
|
|
163
|
-
const ro = new ResizeObserver((entries) => {
|
|
164
|
-
for (const entry of entries) {
|
|
165
|
-
const { width, height: h } = entry.contentRect;
|
|
166
|
-
if (width > 0 && h > 0) {
|
|
167
|
-
setDimensions({
|
|
168
|
-
width: Math.floor(width),
|
|
169
|
-
height: Math.floor(h),
|
|
170
|
-
});
|
|
171
|
-
}
|
|
172
|
-
}
|
|
173
|
-
});
|
|
174
|
-
ro.observe(el);
|
|
175
|
-
// Trigger initial measurement
|
|
176
|
-
const { clientWidth, clientHeight } = el;
|
|
177
|
-
if (clientWidth > 0 && clientHeight > 0) {
|
|
178
|
-
setDimensions({ width: clientWidth, height: clientHeight });
|
|
179
|
-
}
|
|
180
|
-
return () => ro.disconnect();
|
|
181
|
-
}, []);
|
|
182
|
-
// -- IntersectionObserver -- pause rendering when off-screen --
|
|
183
|
-
useEffect(() => {
|
|
184
|
-
const el = containerRef.current;
|
|
185
|
-
if (!el)
|
|
186
|
-
return;
|
|
187
|
-
const io = new IntersectionObserver(([entry]) => {
|
|
188
|
-
setIsVisible(entry.isIntersecting);
|
|
189
|
-
}, { threshold: 0.1 });
|
|
190
|
-
io.observe(el);
|
|
191
|
-
return () => io.disconnect();
|
|
192
|
-
}, []);
|
|
193
|
-
useEffect(() => {
|
|
194
|
-
const globe = globeRef.current;
|
|
195
|
-
if (!globe)
|
|
196
|
-
return;
|
|
197
|
-
if (isVisible) {
|
|
198
|
-
globe.resumeAnimation();
|
|
199
|
-
}
|
|
200
|
-
else {
|
|
201
|
-
globe.pauseAnimation();
|
|
202
|
-
}
|
|
203
|
-
}, [isVisible]);
|
|
204
|
-
// -- Fly-to-country on selection --
|
|
205
|
-
useEffect(() => {
|
|
206
|
-
if (!selectedCountryCode || !globeRef.current)
|
|
207
|
-
return;
|
|
208
|
-
const entry = COUNTRY_GEO_MAP.get(selectedCountryCode);
|
|
209
|
-
if (!entry)
|
|
210
|
-
return;
|
|
211
|
-
globeRef.current.pointOfView({ lat: entry.lat, lng: entry.lng, altitude: 1.8 }, 1000);
|
|
212
|
-
}, [selectedCountryCode]);
|
|
213
|
-
// -- onGlobeReady: set initial POV, material, starfield, halo, controls --
|
|
214
|
-
const handleGlobeReady = useCallback(() => {
|
|
215
|
-
const globe = globeRef.current;
|
|
216
|
-
if (!globe)
|
|
217
|
-
return;
|
|
218
|
-
// Set initial point of view immediately (no animation)
|
|
219
|
-
const pov = initialPov ?? DEFAULT_POV;
|
|
220
|
-
globe.pointOfView(pov, 0);
|
|
221
|
-
// Add halo glow around the hollow globe
|
|
222
|
-
const scene = globe.scene();
|
|
223
|
-
if (scene) {
|
|
224
|
-
const globeRadius = globe.getGlobeRadius?.() ?? 100;
|
|
225
|
-
addHalo(scene, globeRadius, resolvedTheme);
|
|
226
|
-
}
|
|
227
|
-
// Configure OrbitControls for premium feel
|
|
228
|
-
try {
|
|
229
|
-
const controls = globe.controls();
|
|
230
|
-
if (controls) {
|
|
231
|
-
controls.enableDamping = true;
|
|
232
|
-
controls.dampingFactor = 0.12;
|
|
233
|
-
controls.rotateSpeed = 0.5;
|
|
234
|
-
controls.zoomSpeed = 0.8;
|
|
235
|
-
controls.enablePan = false;
|
|
236
|
-
controls.minDistance = 120;
|
|
237
|
-
controls.maxDistance = 500;
|
|
238
|
-
controls.minPolarAngle = Math.PI * 0.15;
|
|
239
|
-
controls.maxPolarAngle = Math.PI * 0.85;
|
|
240
|
-
if (autoRotate && !reducedMotion) {
|
|
241
|
-
controls.autoRotate = true;
|
|
242
|
-
controls.autoRotateSpeed = AUTO_ROTATE_SPEED;
|
|
243
|
-
}
|
|
244
|
-
}
|
|
245
|
-
}
|
|
246
|
-
catch {
|
|
247
|
-
// controls may not be ready yet
|
|
248
|
-
}
|
|
249
|
-
}, [reducedMotion, autoRotate, initialPov, resolvedTheme]);
|
|
250
|
-
// -- Interaction handlers: pause/resume auto-rotate --
|
|
251
|
-
const handleInteractionStart = useCallback(() => {
|
|
252
|
-
if (reducedMotion || !autoRotate)
|
|
253
|
-
return;
|
|
254
|
-
const globe = globeRef.current;
|
|
255
|
-
if (!globe)
|
|
256
|
-
return;
|
|
257
|
-
try {
|
|
258
|
-
const controls = globe.controls();
|
|
259
|
-
if (controls)
|
|
260
|
-
controls.autoRotate = false;
|
|
261
|
-
}
|
|
262
|
-
catch {
|
|
263
|
-
// ignore
|
|
264
|
-
}
|
|
265
|
-
if (idleTimerRef.current)
|
|
266
|
-
clearTimeout(idleTimerRef.current);
|
|
267
|
-
}, [reducedMotion, autoRotate]);
|
|
268
|
-
const handleInteractionEnd = useCallback(() => {
|
|
269
|
-
if (reducedMotion || !autoRotate)
|
|
270
|
-
return;
|
|
271
|
-
if (idleTimerRef.current)
|
|
272
|
-
clearTimeout(idleTimerRef.current);
|
|
273
|
-
idleTimerRef.current = setTimeout(() => {
|
|
274
|
-
const globe = globeRef.current;
|
|
275
|
-
if (!globe)
|
|
276
|
-
return;
|
|
277
|
-
try {
|
|
278
|
-
const controls = globe.controls();
|
|
279
|
-
if (controls)
|
|
280
|
-
controls.autoRotate = true;
|
|
281
|
-
}
|
|
282
|
-
catch {
|
|
283
|
-
// ignore
|
|
284
|
-
}
|
|
285
|
-
}, IDLE_RESUME_MS);
|
|
286
|
-
}, [reducedMotion, autoRotate]);
|
|
287
|
-
// Cleanup idle timer on unmount
|
|
288
|
-
useEffect(() => {
|
|
289
|
-
return () => {
|
|
290
|
-
if (idleTimerRef.current)
|
|
291
|
-
clearTimeout(idleTimerRef.current);
|
|
292
|
-
};
|
|
293
|
-
}, []);
|
|
294
|
-
// -- Zoom handler --
|
|
295
|
-
const handleZoom = useCallback(() => {
|
|
296
|
-
handleInteractionStart();
|
|
297
|
-
handleInteractionEnd();
|
|
298
|
-
}, [handleInteractionStart, handleInteractionEnd]);
|
|
299
|
-
// ---------------------------------------------------------------------------
|
|
300
|
-
// Polygon layer: country geometries with selection highlighting
|
|
301
|
-
// ---------------------------------------------------------------------------
|
|
302
|
-
const polygonData = useMemo(() => {
|
|
303
|
-
if (countryFeatures.length === 0)
|
|
304
|
-
return [];
|
|
305
|
-
return countryFeatures.map((f) => ({
|
|
306
|
-
...f,
|
|
307
|
-
_alpha2: numericToAlpha2(String(f.id ?? "")),
|
|
308
|
-
}));
|
|
309
|
-
}, [countryFeatures]);
|
|
310
|
-
const getPolygonCapColor = useCallback((obj) => {
|
|
311
|
-
const feat = obj;
|
|
312
|
-
const code = feat._alpha2;
|
|
313
|
-
if (!code)
|
|
314
|
-
return resolvedTheme.countryDefault;
|
|
315
|
-
if (code === selectedCountryCode)
|
|
316
|
-
return resolvedTheme.countrySelected;
|
|
317
|
-
// Heatmap: countries glow from within against the void
|
|
318
|
-
if (countryData && countryData.length > 0) {
|
|
319
|
-
const datum = countryData.find((d) => d.countryCode === code);
|
|
320
|
-
if (datum) {
|
|
321
|
-
const maxVal = Math.max(1, ...countryData.map((d) => d.value));
|
|
322
|
-
const normalized = datum.value / maxVal;
|
|
323
|
-
// Glow from dark teal (low) to bright cyan (high)
|
|
324
|
-
const alpha = 0.35 + normalized * 0.55;
|
|
325
|
-
const r = Math.round(10 + normalized * 24);
|
|
326
|
-
const g = Math.round(80 + normalized * 131);
|
|
327
|
-
const b = Math.round(80 + normalized * 158);
|
|
328
|
-
return `rgba(${r}, ${g}, ${b}, ${alpha})`;
|
|
329
|
-
}
|
|
330
|
-
}
|
|
331
|
-
// Dim non-selected countries when one is selected
|
|
332
|
-
if (selectedCountryCode)
|
|
333
|
-
return resolvedTheme.countryDim;
|
|
334
|
-
return resolvedTheme.countryDefault;
|
|
335
|
-
}, [selectedCountryCode, countryData, resolvedTheme]);
|
|
336
|
-
const getPolygonSideColor = useCallback(() => {
|
|
337
|
-
// Slightly transparent version of theme stroke
|
|
338
|
-
return resolvedTheme.countryDim;
|
|
339
|
-
}, [resolvedTheme.countryDim]);
|
|
340
|
-
const getPolygonStrokeColor = useCallback(() => resolvedTheme.countryStroke, [resolvedTheme.countryStroke]);
|
|
341
|
-
const getPolygonAltitude = useCallback((obj) => {
|
|
342
|
-
const feat = obj;
|
|
343
|
-
return feat._alpha2 === selectedCountryCode ? 0.01 : 0.005;
|
|
344
|
-
}, [selectedCountryCode]);
|
|
345
|
-
const handlePolygonClick = useCallback((polygon) => {
|
|
346
|
-
const feat = polygon;
|
|
347
|
-
if (feat._alpha2)
|
|
348
|
-
onCountryClickRef.current?.(feat._alpha2);
|
|
349
|
-
}, []);
|
|
350
|
-
const handlePolygonHover = useCallback((polygon) => {
|
|
351
|
-
if (!polygon) {
|
|
352
|
-
onHoverRef.current?.(null);
|
|
353
|
-
return;
|
|
354
|
-
}
|
|
355
|
-
const feat = polygon;
|
|
356
|
-
const code = feat._alpha2;
|
|
357
|
-
if (!code)
|
|
358
|
-
return;
|
|
359
|
-
onHoverRef.current?.({
|
|
360
|
-
type: "country",
|
|
361
|
-
countryCode: code,
|
|
362
|
-
label: feat.properties?.name,
|
|
363
|
-
});
|
|
364
|
-
}, []);
|
|
365
|
-
// ---------------------------------------------------------------------------
|
|
366
|
-
// Arc layer: electron emission pattern (ghost + electrons from hook)
|
|
367
|
-
// ---------------------------------------------------------------------------
|
|
368
|
-
const handleArcClick = useCallback((arc) => {
|
|
369
|
-
const a = arc;
|
|
370
|
-
// Find the original GlobeArc by id
|
|
371
|
-
const original = (arcs ?? []).find((x) => x.id === a.id);
|
|
372
|
-
if (original)
|
|
373
|
-
onArcClickRef.current?.(original);
|
|
374
|
-
}, [arcs]);
|
|
375
|
-
const handleArcHover = useCallback((arc) => {
|
|
376
|
-
if (!arc) {
|
|
377
|
-
onHoverRef.current?.(null);
|
|
378
|
-
return;
|
|
379
|
-
}
|
|
380
|
-
const a = arc;
|
|
381
|
-
const original = (arcs ?? []).find((x) => x.id === a.id);
|
|
382
|
-
if (original)
|
|
383
|
-
onHoverRef.current?.({ type: "arc", arc: original });
|
|
384
|
-
}, [arcs]);
|
|
385
|
-
// ---------------------------------------------------------------------------
|
|
386
|
-
// Points layer
|
|
387
|
-
// ---------------------------------------------------------------------------
|
|
388
|
-
const pointsData = useMemo(() => {
|
|
389
|
-
const result = [];
|
|
390
|
-
// Explicit points from consumer
|
|
391
|
-
if (points && points.length > 0) {
|
|
392
|
-
const maxVal = Math.max(1, ...points.map((p) => p.value ?? 1));
|
|
393
|
-
for (const p of points) {
|
|
394
|
-
result.push({
|
|
395
|
-
lat: p.lat,
|
|
396
|
-
lng: p.lng,
|
|
397
|
-
size: 0.2 + ((p.value ?? 1) / maxVal) * 0.8,
|
|
398
|
-
color: resolvedTheme.pointColor,
|
|
399
|
-
_sourcePoint: p,
|
|
400
|
-
});
|
|
401
|
-
}
|
|
402
|
-
}
|
|
403
|
-
// Auto-generated endpoint dots from active arcs — pulsing markers
|
|
404
|
-
const seenEndpoints = new Set();
|
|
405
|
-
for (const arc of arcsData) {
|
|
406
|
-
const oKey = `${arc.originLat},${arc.originLng}`;
|
|
407
|
-
if (!seenEndpoints.has(oKey)) {
|
|
408
|
-
seenEndpoints.add(oKey);
|
|
409
|
-
result.push({
|
|
410
|
-
lat: arc.originLat,
|
|
411
|
-
lng: arc.originLng,
|
|
412
|
-
size: 0.25,
|
|
413
|
-
color: resolvedTheme.pointColor,
|
|
414
|
-
_sourcePoint: { id: oKey, lat: arc.originLat, lng: arc.originLng },
|
|
415
|
-
});
|
|
416
|
-
}
|
|
417
|
-
const dKey = `${arc.destLat},${arc.destLng}`;
|
|
418
|
-
if (!seenEndpoints.has(dKey)) {
|
|
419
|
-
seenEndpoints.add(dKey);
|
|
420
|
-
result.push({
|
|
421
|
-
lat: arc.destLat,
|
|
422
|
-
lng: arc.destLng,
|
|
423
|
-
size: 0.3,
|
|
424
|
-
color: resolvedTheme.ringColor,
|
|
425
|
-
_sourcePoint: { id: dKey, lat: arc.destLat, lng: arc.destLng },
|
|
426
|
-
});
|
|
427
|
-
}
|
|
428
|
-
}
|
|
429
|
-
return result;
|
|
430
|
-
}, [points, arcsData, resolvedTheme.pointColor, resolvedTheme.ringColor]);
|
|
431
|
-
const handlePointClick = useCallback((point) => {
|
|
432
|
-
const p = point;
|
|
433
|
-
// Points don't have a dedicated click handler in the generic API,
|
|
434
|
-
// but we can emit a hover-style event or use the country click
|
|
435
|
-
// if the point has location metadata
|
|
436
|
-
const meta = p._sourcePoint.metadata;
|
|
437
|
-
const countryCode = meta?.countryCode;
|
|
438
|
-
if (countryCode)
|
|
439
|
-
onCountryClickRef.current?.(countryCode);
|
|
440
|
-
}, []);
|
|
441
|
-
const handlePointHover = useCallback((point) => {
|
|
442
|
-
if (!point) {
|
|
443
|
-
onHoverRef.current?.(null);
|
|
444
|
-
return;
|
|
445
|
-
}
|
|
446
|
-
const p = point;
|
|
447
|
-
onHoverRef.current?.({ type: "point", point: p._sourcePoint });
|
|
448
|
-
}, []);
|
|
449
|
-
// ---------------------------------------------------------------------------
|
|
450
|
-
// Rings layer: ripple at electron arc destinations
|
|
451
|
-
// ---------------------------------------------------------------------------
|
|
452
|
-
const ringsData = useMemo(() => {
|
|
453
|
-
// Rings pulse at destination endpoints of all visible arcs
|
|
454
|
-
const seen = new Set();
|
|
455
|
-
const rings = [];
|
|
456
|
-
for (const arc of arcsData) {
|
|
457
|
-
// Only ring at destinations of recently-arrived arcs (not settled)
|
|
458
|
-
if (arc._settled)
|
|
459
|
-
continue;
|
|
460
|
-
const key = `${arc.destLat},${arc.destLng}`;
|
|
461
|
-
if (!seen.has(key)) {
|
|
462
|
-
seen.add(key);
|
|
463
|
-
rings.push({ lat: arc.destLat, lng: arc.destLng });
|
|
464
|
-
}
|
|
465
|
-
}
|
|
466
|
-
return rings;
|
|
467
|
-
}, [arcsData]);
|
|
468
|
-
const getRingColor = useCallback(() => {
|
|
469
|
-
// Parse the ring color from theme to RGB components
|
|
470
|
-
const c = new THREE.Color(resolvedTheme.ringColor);
|
|
471
|
-
const r = Math.round(c.r * 255);
|
|
472
|
-
const g = Math.round(c.g * 255);
|
|
473
|
-
const b = Math.round(c.b * 255);
|
|
474
|
-
return (t) => `rgba(${r}, ${g}, ${b}, ${Math.pow(1 - t, 2).toFixed(2)})`;
|
|
475
|
-
}, [resolvedTheme.ringColor]);
|
|
476
|
-
// ---------------------------------------------------------------------------
|
|
477
|
-
// Hex polygon layer: dot overlay when countryData is provided
|
|
478
|
-
// ---------------------------------------------------------------------------
|
|
479
|
-
const hexPolygonData = useMemo(() => {
|
|
480
|
-
if (!countryData || countryData.length === 0)
|
|
481
|
-
return [];
|
|
482
|
-
return polygonData.filter((feat) => {
|
|
483
|
-
if (!feat._alpha2)
|
|
484
|
-
return false;
|
|
485
|
-
return countryData.some((d) => d.countryCode === feat._alpha2);
|
|
486
|
-
});
|
|
487
|
-
}, [countryData, polygonData]);
|
|
488
|
-
const getHexPolygonColor = useCallback((obj) => {
|
|
489
|
-
const feat = obj;
|
|
490
|
-
const code = feat._alpha2;
|
|
491
|
-
if (!code || !countryData)
|
|
492
|
-
return resolvedTheme.countryDefault;
|
|
493
|
-
const datum = countryData.find((d) => d.countryCode === code);
|
|
494
|
-
if (datum) {
|
|
495
|
-
const maxVal = Math.max(1, ...countryData.map((d) => d.value));
|
|
496
|
-
const normalized = datum.value / maxVal;
|
|
497
|
-
const alpha = 0.2 + normalized * 0.6;
|
|
498
|
-
const c = new THREE.Color(resolvedTheme.atmosphere);
|
|
499
|
-
const r = Math.round(c.r * 255);
|
|
500
|
-
const g = Math.round(c.g * 255);
|
|
501
|
-
const b = Math.round(c.b * 255);
|
|
502
|
-
return `rgba(${r}, ${g}, ${b}, ${alpha})`;
|
|
503
|
-
}
|
|
504
|
-
return resolvedTheme.countryDefault;
|
|
505
|
-
}, [countryData, resolvedTheme]);
|
|
506
|
-
// ---------------------------------------------------------------------------
|
|
507
|
-
// Vignette overlay
|
|
508
|
-
// ---------------------------------------------------------------------------
|
|
23
|
+
const [tooltip] = useState(null);
|
|
24
|
+
const canOffscreen = useMemo(() => detectOffscreenSupport(), []);
|
|
25
|
+
// Note: CSS custom property resolution from containerRef is deferred to
|
|
26
|
+
// the canvas worker; resolveTheme here uses preset + overrides only.
|
|
27
|
+
const resolvedTheme = useMemo(() => resolveTheme(preset, null, themeOverrides), [preset, themeOverrides]);
|
|
509
28
|
const vignetteStyle = useMemo(() => getVignetteStyle(resolvedTheme), [resolvedTheme]);
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
return (_jsxs("div", { ref: containerRef, className: cn("relative overflow-hidden", className), style: { height: height ?? "clamp(450px, 60vw, 700px)" }, role: "img", "aria-label": "Interactive 3D globe visualization", onPointerDown: handleInteractionStart, onPointerUp: handleInteractionEnd, children: [dimensions.width > 0 && dimensions.height > 0 && (_jsx(Suspense, { fallback: _jsx("div", { className: "flex size-full items-center justify-center bg-slate-900 text-slate-400 text-sm", children: "Loading globe..." }), children: _jsx(Globe, { ref: globeRef, width: dimensions.width, height: dimensions.height, backgroundColor: "rgba(0,0,0,0)",
|
|
520
|
-
// --- HOLLOW GLOBE: no solid sphere, just floating polygons ---
|
|
521
|
-
showGlobe: false, showAtmosphere: false, showGraticules: false, animateIn: !reducedMotion, onGlobeReady: handleGlobeReady, rendererConfig: {
|
|
522
|
-
antialias: true,
|
|
523
|
-
alpha: true,
|
|
524
|
-
powerPreference: "high-performance",
|
|
525
|
-
},
|
|
526
|
-
// -- Polygon layer: holographic country outlines --
|
|
527
|
-
polygonsData: polygonData, polygonGeoJsonGeometry: "geometry", polygonCapColor: getPolygonCapColor, polygonSideColor: () => "rgba(0,0,0,0)", polygonStrokeColor: getPolygonStrokeColor, polygonAltitude: getPolygonAltitude, polygonLabel: (d) => {
|
|
528
|
-
const feat = d;
|
|
529
|
-
const code = feat._alpha2;
|
|
530
|
-
if (!code)
|
|
531
|
-
return "";
|
|
532
|
-
const name = feat.properties?.name ?? code;
|
|
533
|
-
// Heatmap mode: show rich data
|
|
534
|
-
if (countryData && countryData.length > 0) {
|
|
535
|
-
const datum = countryData.find((c) => c.countryCode === code);
|
|
536
|
-
if (datum) {
|
|
537
|
-
const meta = datum.metadata ?? {};
|
|
538
|
-
const count = meta.opportunityCount;
|
|
539
|
-
const open = meta.openCount;
|
|
540
|
-
const type = meta.type ?? "demand";
|
|
541
|
-
const eyebrow = type === "sourcing" ? "Sourcing Origin" : "Market Demand";
|
|
542
|
-
let details = `Intensity: ${Math.round(datum.value * 100)}%`;
|
|
543
|
-
if (count != null) {
|
|
544
|
-
details = `${count} opportunities${open != null ? ` · ${open} open` : ""}`;
|
|
545
|
-
}
|
|
546
|
-
return buildTooltip(tooltipStyles, eyebrow, datum.label ?? name, details);
|
|
547
|
-
}
|
|
548
|
-
}
|
|
549
|
-
// Default: just country name + code
|
|
550
|
-
return buildTooltip(tooltipStyles, "Country", name, code !== name ? code : undefined);
|
|
551
|
-
}, polygonsTransitionDuration: reducedMotion ? 0 : 300, onPolygonClick: handlePolygonClick, onPolygonHover: handlePolygonHover,
|
|
552
|
-
// -- Arc layer --
|
|
553
|
-
arcsData: arcsData, arcStartLat: "originLat", arcStartLng: "originLng", arcEndLat: "destLat", arcEndLng: "destLng", arcDashLength: "_dashLength", arcDashGap: "_dashGap", arcDashAnimateTime: "_dashAnimateTime", arcStroke: "_stroke", arcColor: (d) => d._color, arcAltitudeAutoScale: 0.35, arcLabel: (d) => {
|
|
554
|
-
const arc = d;
|
|
555
|
-
if (!arc.label)
|
|
556
|
-
return "";
|
|
557
|
-
const eyebrow = arc.category === "secondary" ? "Match Flow" : "Opportunity Flow";
|
|
558
|
-
const details = arc.value ? `${arc.value} ${arc.category === "secondary" ? "matches" : "opportunities"}` : undefined;
|
|
559
|
-
return buildTooltip(tooltipStyles, eyebrow, arc.label, details);
|
|
560
|
-
}, arcsTransitionDuration: 0, onArcClick: handleArcClick, onArcHover: handleArcHover,
|
|
561
|
-
// -- Points layer --
|
|
562
|
-
pointsData: pointsData, pointLat: "lat", pointLng: "lng", pointRadius: "size", pointColor: "color", pointLabel: (d) => {
|
|
563
|
-
const p = d;
|
|
564
|
-
const src = p._sourcePoint;
|
|
565
|
-
if (!src.label)
|
|
566
|
-
return "";
|
|
567
|
-
const meta = src.metadata ?? {};
|
|
568
|
-
const producers = meta.producerCount;
|
|
569
|
-
const importers = meta.importerCount;
|
|
570
|
-
let details = src.value != null ? `${src.value} total` : "";
|
|
571
|
-
if (producers != null && importers != null) {
|
|
572
|
-
details = `${producers} producers · ${importers} importers`;
|
|
573
|
-
}
|
|
574
|
-
return buildTooltip(tooltipStyles, "Organization", src.label, details || undefined);
|
|
575
|
-
}, pointAltitude: 0.01, pointsMerge: false, pointsTransitionDuration: reducedMotion ? 0 : 500, onPointClick: handlePointClick, onPointHover: handlePointHover,
|
|
576
|
-
// -- Rings layer --
|
|
577
|
-
ringsData: ringsData, ringLat: "lat", ringLng: "lng", ringColor: getRingColor, ringMaxRadius: reducedMotion ? 1 : 4, ringPropagationSpeed: reducedMotion ? 0 : 2, ringRepeatPeriod: reducedMotion ? 0 : 1800,
|
|
578
|
-
// -- Hex polygon layer (data density dots) --
|
|
579
|
-
hexPolygonsData: hexPolygonData, hexPolygonGeoJsonGeometry: "geometry", hexPolygonColor: getHexPolygonColor, hexPolygonMargin: 0.7, hexPolygonAltitude: 0.002, hexPolygonResolution: 3, hexPolygonUseDots: true, hexPolygonLabel: (d) => {
|
|
580
|
-
const feat = d;
|
|
581
|
-
const code = feat._alpha2;
|
|
582
|
-
if (!code || !countryData)
|
|
583
|
-
return "";
|
|
584
|
-
const datum = countryData.find((c) => c.countryCode === code);
|
|
585
|
-
if (!datum)
|
|
586
|
-
return "";
|
|
587
|
-
const meta = datum.metadata ?? {};
|
|
588
|
-
const count = meta.opportunityCount;
|
|
589
|
-
const open = meta.openCount;
|
|
590
|
-
const type = meta.type ?? "demand";
|
|
591
|
-
const eyebrow = type === "sourcing" ? "Sourcing Origin" : "Market Demand";
|
|
592
|
-
let details = `Intensity: ${Math.round(datum.value * 100)}%`;
|
|
593
|
-
if (count != null) {
|
|
594
|
-
details = `${count} opportunities${open != null ? ` · ${open} open` : ""}`;
|
|
595
|
-
}
|
|
596
|
-
return buildTooltip(tooltipStyles, eyebrow, datum.label ?? code, details + " · Click to focus");
|
|
597
|
-
}, hexPolygonsTransitionDuration: reducedMotion ? 0 : 500,
|
|
598
|
-
// -- Interaction --
|
|
599
|
-
onZoom: handleZoom, enablePointerInteraction: true }) })), vignetteStyle && (_jsx("div", { className: "pointer-events-none absolute inset-0", style: vignetteStyle }))] }));
|
|
29
|
+
const reducedMotion = useMemo(() => typeof window !== "undefined" &&
|
|
30
|
+
window.matchMedia?.("(prefers-reduced-motion: reduce)")?.matches, []);
|
|
31
|
+
return (_jsxs("div", { ref: containerRef, className: className, style: { position: "relative", width: "100%", height }, role: "img", "aria-label": "Interactive 3D globe visualization", children: [canOffscreen ? (_jsx(Suspense, { fallback: _jsx(GlobeLoadingSkeleton, { height: height }), children: _jsx(LazyGlobeCanvas, { arcs: arcs, points: points, countryData: countryData, selectedCountryCode: selectedCountryCode, selectedArcId: selectedArcId, onCountryClick: onCountryClick, onArcClick: onArcClick, onHover: onHover, theme: themeOverrides, preset: preset, autoRotate: autoRotate, electronFrequency: electronFrequency, selectedBoostFactor: selectedBoostFactor, initialPov: initialPov, topoJsonUrl: topoJsonUrl, reducedMotion: reducedMotion, height: height }) })) : (_jsx(GlobeStatsFallback, { arcs: arcs, points: points, countryData: countryData, fallbackLabels: fallbackLabels, height: height })), _jsx(GlobeTooltip, { tooltip: tooltip, theme: resolvedTheme }), vignetteStyle && (_jsx("div", { style: {
|
|
32
|
+
...vignetteStyle,
|
|
33
|
+
position: "absolute",
|
|
34
|
+
inset: 0,
|
|
35
|
+
pointerEvents: "none",
|
|
36
|
+
borderRadius: "inherit",
|
|
37
|
+
} }))] }));
|
|
600
38
|
}
|
|
601
39
|
//# sourceMappingURL=globe-view.js.map
|