Repository navigation
feat: map kit — map tokens and style, map pieces (tokens 0.2.0, ui 0.8.0) - #9
Merged
Merged
Conversation
Eleven map tokens, light and dark (--u-map-*, hexColors), and a new entry point, @unitae/tokens/map-style: mapStyle() paints Protomaps vector tiles with them for MapLibre. Only the app's pins wear colour: no places, shields, one-way arrows or house numbers, and no icon, so no sprite. Labels use the IBM Plex glyph stacks in MAP_FONTS; MAP_ATTRIBUTION holds the credits to show. @protomaps/basemaps is an optional peer. Tests check both modes: labels reach 4.5:1 on their halo, a pin reaches 3:1, the style uses only map tokens and no fill is more than a hint of colour.
MapPin, MapDot, MapCluster, MapControls (with MapControlGroup and MapControlButton), MapCaption, MapCard, MapAttribution and MapStatus: the pieces drawn over a map, independent of the map engine. Pins and controls reach 44 px on a touch screen; the card leaves the attribution visible and closes on Escape.
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.
The map kit for MapLibre: the map's colours and style in
@unitae/tokens, the pieces drawn over a map in@unitae/ui. It replaces the Google look on every on-screen map with a quiet grey ground where only the app's pins wear colour.@unitae/tokens0.2.0--u-map-*and inhexColors.@unitae/tokens/map-style(new entry point, optional peer@protomaps/basemaps):mapStyle({ mode, tiles, glyphs, lang })returns a MapLibre style for Protomaps vector tiles, every colour taken from a map token.MAP_FONTS: labels use IBM Plex Sans Regular, Medium and Italic glyph stacks. Names written in Devanagari keep the Noto face Protomaps asks for.MAP_ATTRIBUTION: the Protomaps and OpenStreetMap credits to show wherever the map is.@unitae/ui0.8.0The pieces drawn over a map. They know nothing of the map engine: the app places them (as MapLibre markers or inside the map's frame) and wires their callbacks to the map.
MapPinMapDotMapClusterMapControlsMapControlGroup/MapControlButtonfor moreMapCaptionMapCardMapAttributionMapStatuspointer-coarse:).uistill accepts@unitae/tokens0.1 as a peer (^0.1.0 || ^0.2.0).Test plan
pnpm test:lint,pnpm test:typecheck,pnpm test(tokens 108, ui 47),pnpm buildMapCardEscape test; keeping the town icons fails the no-sprite testReleasing
@unitae/tokens(this repository,release.yml). The package has not been published through the workflow yet; without it the first run fails on publish.tokens-v0.2.0andui-v0.8.0once the pieces have been checked in the app.