From d0415944296bc8cb4a05db78dba6b84f285caa25 Mon Sep 17 00:00:00 2001 From: codecalm Date: Sun, 4 Oct 2026 22:27:08 +0200 Subject: [PATCH] Add the Map blocks page and its screenshot pages --- .changeset/map-blocks.md | 6 + docs/content/ui/components/map.mdx | 4 + preview/pages/map-blocks.astro | 29 +++++ preview/pages/maps.astro | 18 --- screenshots/layouts/ScreenshotAppLayout.astro | 20 ++- screenshots/layouts/ScreenshotLayout.astro | 20 ++- screenshots/pages/map-delivery-tracker.astro | 13 ++ screenshots/pages/map-live-users.astro | 12 ++ screenshots/pages/map-store-locator.astro | 12 ++ .../components/cards/MapDeliveryTracker.astro | 87 +++++++++++++ shared/components/cards/MapLiveUsers.astro | 86 +++++++++++++ shared/components/cards/MapStoreLocator.astro | 114 ++++++++++++++++++ .../components/cards/MapUsersByCountry.astro | 65 ++++++++++ shared/components/demo/Map.astro | 8 +- shared/components/demo/MapPalette.astro | 17 +++ shared/data/menu.json | 5 + 16 files changed, 489 insertions(+), 27 deletions(-) create mode 100644 .changeset/map-blocks.md create mode 100644 preview/pages/map-blocks.astro create mode 100644 screenshots/pages/map-delivery-tracker.astro create mode 100644 screenshots/pages/map-live-users.astro create mode 100644 screenshots/pages/map-store-locator.astro create mode 100644 shared/components/cards/MapDeliveryTracker.astro create mode 100644 shared/components/cards/MapLiveUsers.astro create mode 100644 shared/components/cards/MapStoreLocator.astro create mode 100644 shared/components/cards/MapUsersByCountry.astro diff --git a/.changeset/map-blocks.md b/.changeset/map-blocks.md new file mode 100644 index 000000000..191aaa759 --- /dev/null +++ b/.changeset/map-blocks.md @@ -0,0 +1,6 @@ +--- +"@tabler/preview": minor +"@tabler/docs": patch +--- + +Added the Map blocks page: a store locator, a delivery tracker, a live users map and a users by country card. diff --git a/docs/content/ui/components/map.mdx b/docs/content/ui/components/map.mdx index b40d110eb..243d7c80f 100644 --- a/docs/content/ui/components/map.mdx +++ b/docs/content/ui/components/map.mdx @@ -521,6 +521,10 @@ Drop the card body to let the map fill the whole card. Add `rounded` to the cont Live versions of these maps are on the [maps preview page](https://preview.tabler.io/maps.html). +### Blocks + +The [map blocks preview page](https://preview.tabler.io/map-blocks.html) has larger examples that pair a map with other components: a store locator with a searchable list, a delivery tracker with a route and a status card over the map, a world map of live users, and a vector map of users by country next to a table. + ## Using Mapbox GL JS MapLibre GL JS started as a fork of Mapbox GL JS, so the two share most of their API. To use Mapbox instead, load its script and stylesheet, replace `maplibregl` with `mapboxgl`, set `mapboxgl.accessToken` to your public token, and use a `mapbox://` style URL. diff --git a/preview/pages/map-blocks.astro b/preview/pages/map-blocks.astro new file mode 100644 index 000000000..4fbecb22e --- /dev/null +++ b/preview/pages/map-blocks.astro @@ -0,0 +1,29 @@ +--- +import DefaultLayout from '@shared/layouts/DefaultLayout.astro' +import MapPalette from '@components/demo/MapPalette.astro' +import MapStoreLocator from '@components/cards/MapStoreLocator.astro' +import MapDeliveryTracker from '@components/cards/MapDeliveryTracker.astro' +import MapLiveUsers from '@components/cards/MapLiveUsers.astro' +import MapUsersByCountry from '@components/cards/MapUsersByCountry.astro' +import DocsLink from '@ui/DocsLink.astro' +--- + + + + + +
+
+ +
+
+ +
+
+ +
+
+ +
+
+
diff --git a/preview/pages/maps.astro b/preview/pages/maps.astro index 0f5279d31..ef8ac355f 100644 --- a/preview/pages/maps.astro +++ b/preview/pages/maps.astro @@ -80,24 +80,6 @@ const places = [ - - -
{ mapEntries.map(([mapId, data]) => diff --git a/screenshots/layouts/ScreenshotAppLayout.astro b/screenshots/layouts/ScreenshotAppLayout.astro index f671dfc55..611410472 100644 --- a/screenshots/layouts/ScreenshotAppLayout.astro +++ b/screenshots/layouts/ScreenshotAppLayout.astro @@ -92,12 +92,13 @@ const libModules = pageLibEntries.flatMap(([, lib]) => (lib.module ? [`import * + {/* Library styles first, so the Tabler overrides in tabler-vendors.css win (same order as BaseLayout) */} + {libCssFiles.map((href) => )} + {stylePlugins.map((plugin) => )} - {libCssFiles.map((href) => )} -