Repository navigation
✨ feat: A2UI map components (MapView, LocationCard, PlaceList, RouteMap) and StockTicker - #42
Merged
Merged
Conversation
Quote header with symbol, name, price, change and percent change, a sparkline (SparkAreaChart) with a dashed baseline at the first price, key stats and a sample-data badge. Layout follows the CopilotKit a2ui-playground StockTicker (MIT); colours are LobeHub tokens.
…ariants) - Shared map layer (src/common/map): MapCanvas draws numbered markers or a route with plain MapLibre GL, fits every coordinate, follows the active marker and restyles in place when the theme changes. No geocoding, no routing calls, no API keys. - maplibre-gl is an optional peer dependency, loaded with a dynamic import (and its stylesheet) when the first map mounts; placeholder while it loads, a clear 'Map unavailable' state when it is missing or its worker cannot start. setMapLibreWorkerUrl points MapLibre 6 at its bundled worker. - Basemaps: OpenFreeMap (positron for the default look, a softened liberty for a2ui, a lifted dark in dark mode); CARTO_STYLES kept as a documented fallback through mapStyle. - MapView: header with place count, numbered pins, chip row linked to the markers both ways, popup on the active marker. Layout follows the CopilotKit a2ui-playground MapView (MIT); colours are LobeHub tokens.
Single place with a static mini map, name, address, category, rating, hours and Directions / Open map links (token-styled links, so no ConfigProvider is needed). Liberty tuning for the a2ui look now also hides points of interest and one-way arrows and flattens 3D buildings. Layout follows the CopilotKit a2ui-playground LocationCard (MIT).
Ranked list of places next to a map: hovering a row pans to its marker, clicking a row flies to it, clicking a marker selects and scrolls to its row; a preselected row keeps every place in view. Stacks with the map on top below 540 px (container query). Liberty labels in the a2ui look are smaller and slate. Layout follows the CopilotKit a2ui-playground PlaceList (MIT).
Draws a route through given [lon, lat] coordinates (no routing calls) as a glow, casing and gradient line from the start colour to the accent, with start / end pins, from -> to header, distance / duration chips over the map and a legend with the waypoint count. Layout follows the CopilotKit a2ui-playground RouteMap (MIT); colours are LobeHub tokens.
|
Thank you for raising your pull request and contributing to our Community. 非常感谢您提出拉取请求并为我们的社区做出贡献,请确保您已经遵循了我们的贡献指南,我们会尽快审查它。 |
commit: |
|
❤️ Great PR @lobehub-coder ❤️ The growth of project is inseparable from user feedback and contribution, thanks for your contribution! 项目的成长离不开用户反馈和贡献,感谢您的贡献! |
lobe-tsukumo Bot
pushed a commit
that referenced
this pull request
Nov 27, 2026
## [Version 6.3.0](v6.2.0...v6.3.0) <sup>Released on **2026-11-27**</sup> #### ✨ Features - **misc**: A2UI map components (MapView, LocationCard, PlaceList, RouteMap) and StockTicker. <br/> <details> <summary><kbd>Improvements and Fixes</kbd></summary> #### What's improved * **misc**: A2UI map components (MapView, LocationCard, PlaceList, RouteMap) and StockTicker, closes [#42](#42) ([cafdd80](cafdd80)) </details> <div align="right"> [](#readme-top) </div>
|
🎉 This PR is included in version 6.3.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds the official A2UI playground's four map components and its
StockTicker. Each takesvariant?: 'default' | 'a2ui'(default'default'), with colours from LobeHub tokens and dark mode from the theme. Layout follows CopilotKit a2ui-playground (MIT); the source files say so.Components
StockTickerSparkAreaChart) with a dashed line at the first price, key stats,samplebadgeMapViewLocationCardPlaceListRouteMap[[lon, lat], ...]as glow + casing + gradient line, start / end pins, from → to header, distance / duration chips, legendThe props follow the official schemas (
catalog.json). The maps draw only the coordinates they are given: no geocoding, no routing calls, no API keys.The
defaultlook is an outlined LobeHub block with LobeHub type.a2uiis the official card. In both, markers and the route usecolor, or the first colour of the theme colour range; the route start usescolorSuccess.StockTickerusescolorSuccess/colorError, and its sample badge uses the warning tokens.MapLibre is an optional peer
maplibre-gl(^5 || ^6) is inpeerDependenciesand marked optional inpeerDependenciesMeta.src/common/map/loader.tsis the only place that imports it, with a dynamicimport()of the module and its CSS the first time a map mounts.unavailableTextoverrides the message.setMapLibreWorkerUrl(url): Vite?url, webpack/Nextnew URL(..., import.meta.url). MapLibre 5 needs nothing. The docs site sets it indocs/maps.ts.es/):AreaCharthas no MapLibre code.MapViewgets MapLibre as its own lazy chunk (1.1 MB JS + 71 kB CSS), not inindex.maplibre-gl; unused map modules are skipped because the package is side-effect free.Basemaps
basemap="auto"shows Dark in dark mode. In light mode it shows Positron for the default look and Liberty for a2ui, since Liberty is closest to the official Voyager.autostyles are tuned in place for a card:liberty,bright,positron,dark,fiord) are left as they are.mapStyletakes any MapLibre style URL or object, or{ light, dark }.CARTO_STYLESis exported as the documented fallback.New exports
MapView,LocationCard,PlaceList,RouteMap,StockTicker, their props types,MapMarker,Place,StockTickerStat,MapPoint,LngLat,MapBasemap,MapStyleInput,ThemedMapStyle,OPENFREEMAP_STYLES,CARTO_STYLES,setMapLibreWorkerUrl.Not matched
geekblue, LobeHub primary) instead of the official violet.MapViewadds a small popup on the active marker (name + description). The official only uses a native title. It appears only on interaction.Checks
lint:circular,vitest run(92 tests; MapLibre mocked),tsdownbuild andlobedocs buildall pass.