@sdxc/ui 2026.11.18 → 2026.11.22

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.
Files changed (233) hide show
  1. package/README.md +133 -1
  2. package/dist/app/index.d.ts +1 -0
  3. package/dist/app/index.js +1 -0
  4. package/dist/app/mixins/command-palette.js +10 -2
  5. package/dist/app/mixins/log-viewer.js +17 -14
  6. package/dist/app/mixins/route-dialog.d.ts +17 -0
  7. package/dist/app/mixins/route-dialog.js +53 -0
  8. package/dist/app/optimistic-toggle.js +6 -0
  9. package/dist/app/route-dialog.d.ts +38 -0
  10. package/dist/app/route-dialog.js +49 -0
  11. package/dist/audio/equalizer.d.ts +24 -0
  12. package/dist/audio/equalizer.js +57 -0
  13. package/dist/audio/index.d.ts +16 -0
  14. package/dist/audio/index.js +16 -0
  15. package/dist/audio/media-tile.d.ts +38 -0
  16. package/dist/audio/media-tile.js +98 -0
  17. package/dist/audio/player-bar.d.ts +108 -0
  18. package/dist/audio/player-bar.js +338 -0
  19. package/dist/audio/queue-list.d.ts +56 -0
  20. package/dist/audio/queue-list.js +102 -0
  21. package/dist/audio/track-list.d.ts +91 -0
  22. package/dist/audio/track-list.js +226 -0
  23. package/dist/audio/utils/media-session.d.ts +44 -0
  24. package/dist/audio/utils/media-session.js +87 -0
  25. package/dist/audio/utils/play-queue.d.ts +98 -0
  26. package/dist/audio/utils/play-queue.js +149 -0
  27. package/dist/audio/utils/track-time.d.ts +28 -0
  28. package/dist/audio/utils/track-time.js +36 -0
  29. package/dist/chat/composer-format.d.ts +35 -0
  30. package/dist/chat/composer-format.js +84 -0
  31. package/dist/chat/index.d.ts +6 -0
  32. package/dist/chat/index.js +6 -0
  33. package/dist/chat/mention-menu.d.ts +43 -0
  34. package/dist/chat/mention-menu.js +70 -0
  35. package/dist/chat/message-group.d.ts +92 -0
  36. package/dist/chat/message-group.js +222 -0
  37. package/dist/chat/mixins/composer-format.d.ts +28 -0
  38. package/dist/chat/mixins/composer-format.js +80 -0
  39. package/dist/chat/mixins/composer-send.d.ts +2 -2
  40. package/dist/chat/mixins/composer-send.js +4 -2
  41. package/dist/chat/mixins/mention-menu.d.ts +41 -0
  42. package/dist/chat/mixins/mention-menu.js +213 -0
  43. package/dist/chat/mixins/reaction-sync.d.ts +47 -0
  44. package/dist/chat/mixins/reaction-sync.js +172 -0
  45. package/dist/chat/reaction-bar.d.ts +70 -0
  46. package/dist/chat/reaction-bar.js +108 -0
  47. package/dist/chat/typing-indicator.d.ts +42 -0
  48. package/dist/chat/typing-indicator.js +68 -0
  49. package/dist/chat/utils/composer-text.d.ts +38 -0
  50. package/dist/chat/utils/composer-text.js +86 -0
  51. package/dist/chat/utils/markdown-format.d.ts +30 -0
  52. package/dist/chat/utils/markdown-format.js +158 -0
  53. package/dist/chat/utils/mention-query.d.ts +55 -0
  54. package/dist/chat/utils/mention-query.js +60 -0
  55. package/dist/commerce/cart-drawer.d.ts +69 -0
  56. package/dist/commerce/cart-drawer.js +163 -0
  57. package/dist/commerce/cart-line.d.ts +32 -0
  58. package/dist/commerce/cart-line.js +43 -0
  59. package/dist/commerce/checkout-layout.d.ts +32 -0
  60. package/dist/commerce/checkout-layout.js +51 -0
  61. package/dist/commerce/facet-filters.d.ts +121 -0
  62. package/dist/commerce/facet-filters.js +318 -0
  63. package/dist/commerce/fulfilment-note.d.ts +28 -0
  64. package/dist/commerce/fulfilment-note.js +26 -0
  65. package/dist/commerce/index.d.ts +27 -0
  66. package/dist/commerce/index.js +27 -0
  67. package/dist/commerce/item-options-dialog.d.ts +67 -0
  68. package/dist/commerce/item-options-dialog.js +150 -0
  69. package/dist/commerce/menu-item-card.d.ts +37 -0
  70. package/dist/commerce/menu-item-card.js +96 -0
  71. package/dist/commerce/option-group.d.ts +62 -0
  72. package/dist/commerce/option-group.js +121 -0
  73. package/dist/commerce/order-summary.d.ts +42 -0
  74. package/dist/commerce/order-summary.js +76 -0
  75. package/dist/commerce/order-tracker.d.ts +80 -0
  76. package/dist/commerce/order-tracker.js +178 -0
  77. package/dist/commerce/price.d.ts +52 -0
  78. package/dist/commerce/price.js +108 -0
  79. package/dist/commerce/product-card.d.ts +53 -0
  80. package/dist/commerce/product-card.js +127 -0
  81. package/dist/commerce/product-gallery.d.ts +70 -0
  82. package/dist/commerce/product-gallery.js +186 -0
  83. package/dist/commerce/promo-code.d.ts +56 -0
  84. package/dist/commerce/promo-code.js +101 -0
  85. package/dist/commerce/quantity-stepper.d.ts +42 -0
  86. package/dist/commerce/quantity-stepper.js +53 -0
  87. package/dist/commerce/question-list.d.ts +53 -0
  88. package/dist/commerce/question-list.js +92 -0
  89. package/dist/commerce/shipping-estimate.d.ts +53 -0
  90. package/dist/commerce/shipping-estimate.js +39 -0
  91. package/dist/commerce/sort-select.d.ts +38 -0
  92. package/dist/commerce/sort-select.js +38 -0
  93. package/dist/commerce/variant-picker.d.ts +75 -0
  94. package/dist/commerce/variant-picker.js +135 -0
  95. package/dist/components/amount.d.ts +46 -0
  96. package/dist/components/amount.js +34 -0
  97. package/dist/components/autocomplete.d.ts +82 -0
  98. package/dist/components/autocomplete.js +114 -0
  99. package/dist/components/carousel.d.ts +31 -1
  100. package/dist/components/carousel.js +66 -3
  101. package/dist/components/index.d.ts +11 -0
  102. package/dist/components/index.js +11 -0
  103. package/dist/components/letterbox.d.ts +47 -0
  104. package/dist/components/letterbox.js +56 -0
  105. package/dist/components/lightbox.d.ts +88 -0
  106. package/dist/components/lightbox.js +224 -0
  107. package/dist/components/media-grid.d.ts +53 -0
  108. package/dist/components/media-grid.js +89 -0
  109. package/dist/components/range-months.d.ts +100 -0
  110. package/dist/components/range-months.js +274 -0
  111. package/dist/components/rating-input.d.ts +33 -0
  112. package/dist/components/rating-input.js +63 -0
  113. package/dist/components/rating.d.ts +38 -0
  114. package/dist/components/rating.js +66 -0
  115. package/dist/components/review-card.d.ts +39 -0
  116. package/dist/components/review-card.js +59 -0
  117. package/dist/components/section-bar.d.ts +57 -0
  118. package/dist/components/section-bar.js +140 -0
  119. package/dist/components/step-indicator.d.ts +46 -0
  120. package/dist/components/step-indicator.js +96 -0
  121. package/dist/finance/index.d.ts +10 -0
  122. package/dist/finance/index.js +10 -0
  123. package/dist/finance/ledger.d.ts +60 -0
  124. package/dist/finance/ledger.js +93 -0
  125. package/dist/finance/payment-card.d.ts +49 -0
  126. package/dist/finance/payment-card.js +115 -0
  127. package/dist/map/engine.d.ts +49 -0
  128. package/dist/map/engine.js +591 -0
  129. package/dist/map/index.d.ts +12 -0
  130. package/dist/map/index.js +12 -0
  131. package/dist/map/map-canvas.d.ts +101 -0
  132. package/dist/map/map-canvas.js +275 -0
  133. package/dist/map/map.d.ts +217 -0
  134. package/dist/map/map.js +598 -0
  135. package/dist/map/mixins/map-link.d.ts +30 -0
  136. package/dist/map/mixins/map-link.js +116 -0
  137. package/dist/map/utils/basemap.d.ts +88 -0
  138. package/dist/map/utils/basemap.js +84 -0
  139. package/dist/map/utils/cluster.d.ts +43 -0
  140. package/dist/map/utils/cluster.js +80 -0
  141. package/dist/map/utils/mercator.d.ts +66 -0
  142. package/dist/map/utils/mercator.js +92 -0
  143. package/dist/map/utils/stage.d.ts +24 -0
  144. package/dist/map/utils/stage.js +49 -0
  145. package/dist/mixins/autocomplete.d.ts +28 -0
  146. package/dist/mixins/autocomplete.js +283 -0
  147. package/dist/mixins/carousel-controls.d.ts +14 -3
  148. package/dist/mixins/carousel-controls.js +89 -30
  149. package/dist/mixins/index.d.ts +2 -0
  150. package/dist/mixins/index.js +2 -0
  151. package/dist/mixins/lightbox-controls.d.ts +34 -0
  152. package/dist/mixins/lightbox-controls.js +176 -0
  153. package/dist/schedule/agenda.d.ts +63 -0
  154. package/dist/schedule/agenda.js +221 -0
  155. package/dist/schedule/day-strip.d.ts +50 -0
  156. package/dist/schedule/day-strip.js +136 -0
  157. package/dist/schedule/free-busy.d.ts +96 -0
  158. package/dist/schedule/free-busy.js +285 -0
  159. package/dist/schedule/index.d.ts +15 -0
  160. package/dist/schedule/index.js +15 -0
  161. package/dist/schedule/mixins/day-strip-scroll.d.ts +16 -0
  162. package/dist/schedule/mixins/day-strip-scroll.js +40 -0
  163. package/dist/schedule/mixins/time-grid-drag.d.ts +24 -0
  164. package/dist/schedule/mixins/time-grid-drag.js +532 -0
  165. package/dist/schedule/month-view.d.ts +68 -0
  166. package/dist/schedule/month-view.js +301 -0
  167. package/dist/schedule/time-grid.d.ts +168 -0
  168. package/dist/schedule/time-grid.js +417 -0
  169. package/dist/schedule/utils/time-grid-layout.d.ts +50 -0
  170. package/dist/schedule/utils/time-grid-layout.js +93 -0
  171. package/dist/schedule/year-view.d.ts +46 -0
  172. package/dist/schedule/year-view.js +142 -0
  173. package/dist/styles/index.d.ts +1 -0
  174. package/dist/styles/index.js +1 -0
  175. package/dist/styles/typewriter-text.d.ts +20 -0
  176. package/dist/styles/typewriter-text.js +23 -0
  177. package/dist/test/map.d.ts +18 -0
  178. package/dist/test/map.js +96 -0
  179. package/dist/test/reels.d.ts +30 -0
  180. package/dist/test/reels.js +41 -0
  181. package/dist/test/stories.d.ts +31 -0
  182. package/dist/test/stories.js +66 -0
  183. package/dist/travel/boarding-pass.d.ts +107 -0
  184. package/dist/travel/boarding-pass.js +293 -0
  185. package/dist/travel/car-offer.d.ts +70 -0
  186. package/dist/travel/car-offer.js +127 -0
  187. package/dist/travel/fare-calendar.d.ts +85 -0
  188. package/dist/travel/fare-calendar.js +233 -0
  189. package/dist/travel/fare-options.d.ts +84 -0
  190. package/dist/travel/fare-options.js +142 -0
  191. package/dist/travel/flight-itinerary.d.ts +84 -0
  192. package/dist/travel/flight-itinerary.js +112 -0
  193. package/dist/travel/flight-option.d.ts +58 -0
  194. package/dist/travel/flight-option.js +111 -0
  195. package/dist/travel/flight-segment.d.ts +105 -0
  196. package/dist/travel/flight-segment.js +174 -0
  197. package/dist/travel/index.d.ts +20 -0
  198. package/dist/travel/index.js +20 -0
  199. package/dist/travel/package-savings.d.ts +74 -0
  200. package/dist/travel/package-savings.js +128 -0
  201. package/dist/travel/price-breakdown.d.ts +66 -0
  202. package/dist/travel/price-breakdown.js +102 -0
  203. package/dist/travel/rating-breakdown.d.ts +81 -0
  204. package/dist/travel/rating-breakdown.js +132 -0
  205. package/dist/travel/seat-map.d.ts +108 -0
  206. package/dist/travel/seat-map.js +371 -0
  207. package/dist/travel/trip-timeline.d.ts +84 -0
  208. package/dist/travel/trip-timeline.js +212 -0
  209. package/dist/utils/gamepad-presses.d.ts +21 -0
  210. package/dist/utils/gamepad-presses.js +28 -0
  211. package/dist/utils/index.d.ts +5 -0
  212. package/dist/utils/index.js +5 -0
  213. package/dist/utils/move-focus.d.ts +20 -0
  214. package/dist/utils/move-focus.js +28 -0
  215. package/dist/utils/range-months.d.ts +54 -0
  216. package/dist/utils/range-months.js +98 -0
  217. package/dist/utils/swipe-direction.d.ts +23 -0
  218. package/dist/utils/swipe-direction.js +27 -0
  219. package/dist/utils/typewriter.d.ts +49 -0
  220. package/dist/utils/typewriter.js +171 -0
  221. package/dist/video/index.d.ts +6 -2
  222. package/dist/video/index.js +6 -2
  223. package/dist/video/mixins/reel-feed-sync.d.ts +41 -0
  224. package/dist/video/mixins/reel-feed-sync.js +430 -0
  225. package/dist/video/mixins/story-viewer-sync.d.ts +31 -0
  226. package/dist/video/mixins/story-viewer-sync.js +391 -0
  227. package/dist/video/reel-feed.d.ts +95 -0
  228. package/dist/video/reel-feed.js +124 -0
  229. package/dist/video/story-ring.d.ts +32 -0
  230. package/dist/video/story-ring.js +42 -0
  231. package/dist/video/story-viewer.d.ts +85 -0
  232. package/dist/video/story-viewer.js +250 -0
  233. package/package.json +21 -2
@@ -0,0 +1,598 @@
1
+ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "remix/component/jsx-runtime";
2
+ import { CompassIcon, LocateFixedIcon, MaximizeIcon, MinusIcon, PlusIcon } from "@sdxc/icons";
3
+ import { mergeMix, raw } from "@sdxc/u/general";
4
+ import { motionReduce, motionSafe } from "@sdxc/u/responsive";
5
+ import { when } from "@sdxc/u/state";
6
+ import { clientEntry, Fragment } from "remix/component";
7
+ import { startEngine } from "./engine.js";
8
+ import { mapLink } from "./mixins/map-link.js";
9
+ import { BASEMAP_PAINT, featureKind, geometryPath, KIND_ORDER, placeLabels, ROAD_WIDTH, } from "./utils/basemap.js";
10
+ import { clusterLabel, clusterPoints } from "./utils/cluster.js";
11
+ import { clampZoom, formatBounds, formatLngLat, lngLatAt, offsetFrom, roundTo, viewBounds, } from "./utils/mercator.js";
12
+ import { anchorFor, offsetStyle, routePathData } from "./utils/stage.js";
13
+ /** Controls a map shows when the caller names none. */
14
+ const DEFAULT_CONTROLS = ["zoom"];
15
+ /**
16
+ * OpenFreeMap's free vector styles, a quiet light one and its dark twin, which need no key.
17
+ * Their style, tiles, glyphs and sprites all load from `tiles.openfreemap.org`, the one host a
18
+ * page's CSP must allow in `connect-src` and `img-src` (with `blob:`) to draw them.
19
+ */
20
+ export const OPEN_FREE_MAP = {
21
+ kind: "style",
22
+ light: "https://tiles.openfreemap.org/styles/positron",
23
+ dark: "https://tiles.openfreemap.org/styles/dark",
24
+ };
25
+ /** Lowest zoom a map reaches when the caller names none. */
26
+ const DEFAULT_MIN_ZOOM = 0;
27
+ /** Highest zoom a map reaches when the caller names none. */
28
+ const DEFAULT_MAX_ZOOM = 20;
29
+ /** Distance in pixels under which markers gather into one bubble. */
30
+ const DEFAULT_CLUSTER_RADIUS = 44;
31
+ /** Stage size in pixels the server assumes when it writes the bounds a search area submits. */
32
+ const DEFAULT_VIEWPORT = [1024, 768];
33
+ /** Zoom steps a cluster's link moves in by. */
34
+ const CLUSTER_ZOOM_STEP = 2;
35
+ /** Tone a marker paints with when the caller names none. */
36
+ const DEFAULT_TONE = "neutral";
37
+ /** Height in pixels of the tail under a marker, whose tip sits on the marker's point. */
38
+ const PIN_TAIL = 6;
39
+ /** Names of the fields a search area fills when the caller names none. */
40
+ const DEFAULT_AREA_NAMES = { bounds: "bounds", center: "center", zoom: "zoom" };
41
+ /** The key a marker is known by in a cluster, from its point and record key. */
42
+ function markerKey(at, mapKey) {
43
+ return `${at[0]},${at[1]},${mapKey ?? ""}`;
44
+ }
45
+ /** True for a Remix element of component `type`. */
46
+ function isElementOf(node, type) {
47
+ return typeof node === "object" && node !== null && "type" in node && node.type === type;
48
+ }
49
+ /**
50
+ * Collects the props of every element of `type` among `node`, looking through arrays and
51
+ * fragments, so the stage can cluster markers before they render.
52
+ */
53
+ function collect(node, type, found = []) {
54
+ if (Array.isArray(node)) {
55
+ for (let child of node)
56
+ collect(child, type, found);
57
+ return found;
58
+ }
59
+ if (isElementOf(node, type))
60
+ found.push(node.props);
61
+ else if (isElementOf(node, Fragment))
62
+ collect(node.props.children, type, found);
63
+ return found;
64
+ }
65
+ /** Reads the stage's context; outside a stage, a world view with nothing clustered. */
66
+ function stageOf(handle) {
67
+ let context = handle.context.get(GeoMap);
68
+ return (context ?? {
69
+ id: "",
70
+ view: { center: [0, 0], zoom: 0 },
71
+ minZoom: DEFAULT_MIN_ZOOM,
72
+ maxZoom: DEFAULT_MAX_ZOOM,
73
+ viewport: DEFAULT_VIEWPORT,
74
+ clustered: new Set(),
75
+ });
76
+ }
77
+ /** Clamps a share to 0–1, reading anything that is not a number as 0. */
78
+ function clampShare(value) {
79
+ if (!Number.isFinite(value))
80
+ return 0;
81
+ return Math.min(1, Math.max(0, value));
82
+ }
83
+ /** Styles one round control: a 44px target on a raised surface. */
84
+ function controlStyle() {
85
+ return [
86
+ raw({
87
+ display: "grid",
88
+ placeItems: "center",
89
+ inlineSize: "2.75rem",
90
+ blockSize: "2.75rem",
91
+ padding: "0",
92
+ border: "0",
93
+ borderRadius: "var(--ui-radius-lg, 0.5rem)",
94
+ background: "var(--ui-surface-raised, Canvas)",
95
+ color: "var(--ui-neutral-fg-emphasis, CanvasText)",
96
+ boxShadow: "var(--ui-shadow-ring), 0 2px 6px -2px rgb(0 0 0 / 0.2)",
97
+ cursor: "pointer",
98
+ textDecoration: "none",
99
+ "&[hidden]": { display: "none" },
100
+ "&:hover": { background: "var(--ui-neutral-bg-tint-hover, Canvas)" },
101
+ '&[aria-disabled="true"]': { color: "var(--ui-neutral-fg-muted)", cursor: "default" },
102
+ '&[aria-pressed="true"]': { color: "var(--ui-brand-fg, LinkText)" },
103
+ "@media (forced-colors: active)": { border: "1px solid ButtonText" },
104
+ }),
105
+ when("&:focus-visible", raw({ outline: "2px solid var(--ui-brand-ring, Highlight)" })),
106
+ ];
107
+ }
108
+ /**
109
+ * The map stage: a region at the full size of its parent (20rem tall at least) that draws the
110
+ * basemap as SVG, writes place names, clusters close markers into bubbles and shows the
111
+ * controls, then hands the stage to the island, which mounts MapLibre in it when WebGL works.
112
+ *
113
+ * @example
114
+ * <GeoMap id="stays-map" label="Stays in Lisbon" center={[-9.14, 38.72]} zoom={12} labels={labels} navigation={{ href: (view) => `?zoom=${view.zoom}&center=${view.center}` }}>
115
+ * <GeoMap.Marker at={[-9.15, 38.71]} label="$182" href="/stays/1" mapKey="1" />
116
+ * </GeoMap>
117
+ */
118
+ export function GeoMap(handle) {
119
+ return () => {
120
+ let { basemap = OPEN_FREE_MAP, center, children, clusterRadius, controls, id, label, labels, maxZoom, minZoom, mix, navigation, viewport, workerUrl, zoom, ...rest } = handle.props;
121
+ let min = minZoom ?? DEFAULT_MIN_ZOOM;
122
+ let max = maxZoom ?? DEFAULT_MAX_ZOOM;
123
+ let view = { center, zoom: clampZoom(zoom, min, max) };
124
+ let radius = clusterRadius ?? DEFAULT_CLUSTER_RADIUS;
125
+ let shown = controls ?? DEFAULT_CONTROLS;
126
+ let markers = collect(children, GeoMap.Marker);
127
+ let groups = clusterPoints(markers.map((marker) => {
128
+ let [x, y] = offsetFrom(view, marker.at);
129
+ return { x, y, alone: marker.current === true };
130
+ }), radius).filter((group) => group.members.length > 1);
131
+ let clustered = new Set(groups.flatMap((group) => group.members.map((index) => markerKey(markers[index].at, markers[index].mapKey))));
132
+ handle.context.set({
133
+ id,
134
+ view,
135
+ minZoom: min,
136
+ maxZoom: max,
137
+ viewport: viewport ?? DEFAULT_VIEWPORT,
138
+ clustered,
139
+ });
140
+ let ground = basemap?.kind === "geojson" && basemap.ground === "water" ? "water" : "land";
141
+ let project = (point) => offsetFrom(view, [point[0] ?? 0, point[1] ?? 0]);
142
+ let places = basemap?.kind === "geojson" ? placeLabels(basemap.data) : [];
143
+ return (_jsxs("div", { role: "region", "aria-label": label, ...rest, id: id, "data-slot": "map", "data-ground": ground, mix: mergeMix([
144
+ raw({
145
+ position: "relative",
146
+ isolation: "isolate",
147
+ overflow: "clip",
148
+ inlineSize: "100%",
149
+ minInlineSize: "0",
150
+ blockSize: "100%",
151
+ minBlockSize: "var(--ui-map-min-height, 20rem)",
152
+ borderRadius: "var(--ui-map-radius, 0.75rem)",
153
+ background: BASEMAP_PAINT.land,
154
+ "--ui-map-halo": BASEMAP_PAINT.land,
155
+ '&[data-ground="water"]': {
156
+ background: BASEMAP_PAINT.water,
157
+ "--ui-map-halo": BASEMAP_PAINT.water,
158
+ },
159
+ '&[data-engine="live"] > [data-slot="map-basemap"], &[data-engine="live"] > [data-slot="map-fallback"]': { visibility: "hidden" },
160
+ "&:fullscreen": { borderRadius: "0" },
161
+ }),
162
+ ], mix), children: [basemap?.kind === "geojson" ? (_jsx("svg", { "aria-hidden": "true", focusable: "false", "data-slot": "map-basemap", width: "1", height: "1", mix: [
163
+ raw({
164
+ position: "absolute",
165
+ insetInlineStart: "50%",
166
+ insetBlockStart: "50%",
167
+ overflow: "visible",
168
+ pointerEvents: "none",
169
+ }),
170
+ ], children: KIND_ORDER.map((kind) => {
171
+ let features = basemap.data.features.filter((feature) => featureKind(feature) === kind);
172
+ if (kind !== "road") {
173
+ let d = features.map((feature) => geometryPath(feature.geometry, project)).join("");
174
+ if (d === "")
175
+ return null;
176
+ return (_jsx("path", { d: d, "fill-rule": "evenodd", "data-kind": kind, mix: [raw({ fill: BASEMAP_PAINT[kind], stroke: "none" })] }));
177
+ }
178
+ return [false, true].map((major) => {
179
+ let d = features
180
+ .filter((feature) => (feature.properties?.major === true) === major)
181
+ .map((feature) => geometryPath(feature.geometry, project))
182
+ .join("");
183
+ if (d === "")
184
+ return null;
185
+ return (_jsx("path", { d: d, "data-kind": major ? "road-major" : "road", "stroke-width": String(major ? ROAD_WIDTH.major : ROAD_WIDTH.minor), mix: [
186
+ raw({
187
+ fill: "none",
188
+ stroke: BASEMAP_PAINT.road,
189
+ strokeLinecap: "round",
190
+ strokeLinejoin: "round",
191
+ }),
192
+ ] }));
193
+ });
194
+ }) })) : null, basemap?.kind === "style" && basemap.fallback !== undefined ? (_jsx("div", { "aria-hidden": "true", "data-slot": "map-fallback", mix: [raw({ position: "absolute", inset: "0", pointerEvents: "none" })], children: basemap.fallback })) : null, places.map((place) => {
195
+ let [lng = 0, lat = 0] = place.at;
196
+ return (_jsx("span", { "aria-hidden": "true", "data-slot": "map-place", "data-lng": String(lng), "data-lat": String(lat), style: offsetStyle(project(place.at)), mix: [
197
+ raw({
198
+ position: "absolute",
199
+ zIndex: "1",
200
+ translate: "-50% -50%",
201
+ fontSize: "0.75rem",
202
+ fontWeight: "600",
203
+ letterSpacing: "0.02em",
204
+ whiteSpace: "nowrap",
205
+ pointerEvents: "none",
206
+ color: BASEMAP_PAINT.label,
207
+ textShadow: "0 0 2px var(--ui-map-halo), 0 0 4px var(--ui-map-halo), 0 0 6px var(--ui-map-halo)",
208
+ }),
209
+ ], children: place.name }));
210
+ }), children, groups.map((group) => {
211
+ let at = lngLatAt(view, [group.x, group.y]);
212
+ let count = group.members.length;
213
+ let next = clampZoom(view.zoom + CLUSTER_ZOOM_STEP, min, max);
214
+ return (_jsx(ClusterBubble, { at: at, offset: [group.x, group.y], count: count, label: clusterLabel(labels.cluster, count), href: navigation?.href({ center: at, zoom: next }) }));
215
+ }), _jsx(ClusterBubble, { at: center, offset: [0, 0], count: 0, label: "", template: true }), _jsxs("div", { "data-slot": "map-controls", mix: [
216
+ raw({
217
+ position: "absolute",
218
+ zIndex: "6",
219
+ insetBlockStart: "0.75rem",
220
+ insetInlineEnd: "0.75rem",
221
+ display: "flex",
222
+ flexDirection: "column",
223
+ gap: "0.375rem",
224
+ "&:not(:has(> :not([hidden])))": { display: "none" },
225
+ }),
226
+ ], children: [shown.includes("zoom") ? (_jsxs(_Fragment, { children: [_jsx(ZoomControl, { control: "zoom-in", label: labels.zoomIn, view: { center, zoom: view.zoom + 1 }, disabled: view.zoom >= max, navigation: navigation, children: _jsx(PlusIcon, { "aria-hidden": "true", size: 18 }) }), _jsx(ZoomControl, { control: "zoom-out", label: labels.zoomOut, view: { center, zoom: view.zoom - 1 }, disabled: view.zoom <= min, navigation: navigation, children: _jsx(MinusIcon, { "aria-hidden": "true", size: 18 }) })] })) : null, shown.includes("reset") ? (_jsx("button", { type: "button", hidden: true, "aria-label": labels.reset, "data-map-control": "reset", mix: controlStyle(), children: _jsx(CompassIcon, { "aria-hidden": "true", size: 18 }) })) : null, shown.includes("locate") ? (_jsx("button", { type: "button", hidden: true, "aria-label": labels.locate, "data-map-control": "locate", mix: controlStyle(), children: _jsx(LocateFixedIcon, { "aria-hidden": "true", size: 18 }) })) : null, shown.includes("fullscreen") ? (_jsx("button", { type: "button", hidden: true, "aria-label": labels.fullscreen, "aria-pressed": "false", "data-map-control": "fullscreen", mix: controlStyle(), children: _jsx(MaximizeIcon, { "aria-hidden": "true", size: 18 }) })) : null] }), _jsx(GeoMapEngine, { root: id, label: label, center: center, zoom: view.zoom, minZoom: min, maxZoom: max, clusterRadius: radius, clusterLabel: labels.cluster, gestureHint: labels.gestureHint, workerUrl: workerUrl ?? null, basemap: engineBasemap(basemap) })] }));
227
+ };
228
+ }
229
+ /** The basemap as the island receives it: plain data, with the server-only fallback left out. */
230
+ function engineBasemap(basemap) {
231
+ if (basemap === undefined)
232
+ return null;
233
+ if (basemap.kind === "geojson")
234
+ return { kind: "geojson", data: basemap.data };
235
+ return { kind: "style", light: basemap.light, dark: basemap.dark ?? basemap.light };
236
+ }
237
+ /**
238
+ * A zoom step: a link to the next view when the map has navigation, so it zooms without
239
+ * script, and otherwise a button the island reveals. At the zoom limit the link has no address.
240
+ */
241
+ function ZoomControl(handle) {
242
+ return () => {
243
+ let { children, control, disabled, label, navigation, view } = handle.props;
244
+ if (navigation === undefined) {
245
+ return (_jsx("button", { type: "button", hidden: true, "aria-label": label, "data-map-control": control, "aria-disabled": disabled ? "true" : undefined, mix: controlStyle(), children: children }));
246
+ }
247
+ return (_jsx("a", { href: disabled ? undefined : navigation.href(view), role: disabled ? "link" : undefined, "aria-label": label, "aria-disabled": disabled ? "true" : undefined, "data-map-control": control, mix: controlStyle(), children: children }));
248
+ };
249
+ }
250
+ /**
251
+ * A round bubble counting the markers it stands for: a link to a closer view when the map has
252
+ * navigation, a button the island zooms with otherwise.
253
+ */
254
+ function ClusterBubble(handle) {
255
+ return () => {
256
+ let { at, count, href, label, offset, template = false } = handle.props;
257
+ let shared = {
258
+ "aria-label": template ? undefined : label,
259
+ "data-slot": "map-cluster",
260
+ "data-cluster-template": template ? "" : undefined,
261
+ "data-lng": String(at[0]),
262
+ "data-lat": String(at[1]),
263
+ hidden: template,
264
+ style: offsetStyle(offset),
265
+ mix: [
266
+ raw({
267
+ position: "absolute",
268
+ zIndex: "3",
269
+ display: "grid",
270
+ placeItems: "center",
271
+ minInlineSize: "2.5rem",
272
+ blockSize: "2.5rem",
273
+ paddingInline: "0.5rem",
274
+ border: "0",
275
+ borderRadius: "9999px",
276
+ translate: "-50% -50%",
277
+ font: "inherit",
278
+ fontSize: "0.875rem",
279
+ fontWeight: "700",
280
+ fontVariantNumeric: "tabular-nums",
281
+ textDecoration: "none",
282
+ cursor: "pointer",
283
+ background: "var(--ui-brand-bg-solid, Highlight)",
284
+ color: "var(--ui-brand-fg-on-solid, HighlightText)",
285
+ boxShadow: "0 0 0 4px color-mix(in oklab, var(--ui-brand-bg-solid, Highlight) 28%, transparent), 0 2px 8px -2px rgb(0 0 0 / 0.3)",
286
+ "&[hidden]": { display: "none" },
287
+ "&:hover, &[data-highlighted]": {
288
+ zIndex: "4",
289
+ boxShadow: "0 0 0 6px color-mix(in oklab, var(--ui-brand-bg-solid, Highlight) 40%, transparent), 0 4px 12px -4px rgb(0 0 0 / 0.35)",
290
+ },
291
+ "@media (forced-colors: active)": { border: "2px solid ButtonText" },
292
+ }),
293
+ when("&:focus-visible", raw({ outline: "2px solid var(--ui-brand-ring, Highlight)" })),
294
+ motionSafe(raw({
295
+ transition: "scale 140ms ease-out",
296
+ "&:hover, &[data-highlighted]": { scale: "1.08" },
297
+ })),
298
+ ],
299
+ };
300
+ if (href !== undefined) {
301
+ return (_jsx("a", { ...shared, href: href, children: String(count) }));
302
+ }
303
+ return (_jsx("button", { type: "button", ...shared, children: template ? null : String(count) }));
304
+ };
305
+ }
306
+ /**
307
+ * One marker: a pill whose tail tips onto its point, as a link with `href` or a button
308
+ * otherwise. A {@link GeoMap.Popup} child opens from the button natively, or on hover and focus
309
+ * of a link once the island runs. Inside a cluster it renders `hidden` behind the bubble.
310
+ *
311
+ * @example <GeoMap.Marker at={[-9.15, 38.71]} label="$182" href="/stays/7" mapKey="7" current />
312
+ */
313
+ GeoMap.Marker = function GeoMapMarker(handle) {
314
+ return () => {
315
+ let { at, children, current = false, highlighted = false, href, label, mapKey, mix, tone, ...rest } = handle.props;
316
+ let stage = stageOf(handle);
317
+ let popupId = `${stage.id || "map"}-popup-${handle.id.replace(/[^\w-]/g, "-")}`;
318
+ let anchor = anchorFor(popupId);
319
+ let hasPopup = collect(children, GeoMap.Popup).length > 0;
320
+ handle.context.set({ popupId, anchor });
321
+ let shared = {
322
+ "aria-current": current ? "true" : undefined,
323
+ "data-slot": "map-marker",
324
+ "data-lng": String(at[0]),
325
+ "data-lat": String(at[1]),
326
+ "data-tone": tone ?? DEFAULT_TONE,
327
+ "data-current": current ? "" : undefined,
328
+ "data-highlighted": highlighted ? "" : undefined,
329
+ "data-map-popup": hasPopup && href !== undefined ? popupId : undefined,
330
+ hidden: stage.clustered.has(markerKey(at, mapKey)),
331
+ style: { ...offsetStyle(offsetFrom(stage.view, at)), anchorName: anchor },
332
+ mix: mergeMix([
333
+ raw({
334
+ position: "absolute",
335
+ zIndex: "3",
336
+ display: "inline-flex",
337
+ alignItems: "center",
338
+ gap: "0.25rem",
339
+ minBlockSize: "1.75rem",
340
+ paddingInline: "0.625rem",
341
+ border: "0",
342
+ borderRadius: "9999px",
343
+ font: "inherit",
344
+ fontSize: "0.8125rem",
345
+ fontWeight: "600",
346
+ lineHeight: "1",
347
+ whiteSpace: "nowrap",
348
+ fontVariantNumeric: "tabular-nums",
349
+ textDecoration: "none",
350
+ cursor: "pointer",
351
+ translate: `-50% calc(-100% - ${PIN_TAIL}px)`,
352
+ transformOrigin: `50% calc(100% + ${PIN_TAIL}px)`,
353
+ background: "var(--ui-surface-raised, Canvas)",
354
+ color: "var(--ui-neutral-fg-emphasis, CanvasText)",
355
+ boxShadow: "var(--ui-shadow-ring), 0 2px 6px -3px rgb(0 0 0 / 0.25)",
356
+ "&[hidden]": { display: "none" },
357
+ "&::after": {
358
+ content: '""',
359
+ position: "absolute",
360
+ insetBlockStart: "100%",
361
+ insetInlineStart: "50%",
362
+ inlineSize: `${PIN_TAIL * 2}px`,
363
+ blockSize: `${PIN_TAIL}px`,
364
+ translate: "-50% -0.5px",
365
+ clipPath: "polygon(0 0, 100% 0, 50% 100%)",
366
+ background: "inherit",
367
+ },
368
+ '&[data-tone="brand"]': {
369
+ background: "var(--ui-brand-bg-solid)",
370
+ color: "var(--ui-brand-fg-on-solid)",
371
+ },
372
+ "&[aria-current]": {
373
+ zIndex: "4",
374
+ background: "var(--ui-neutral-bg-solid)",
375
+ color: "var(--ui-neutral-fg-on-solid)",
376
+ },
377
+ '&[data-tone="brand"][aria-current]': {
378
+ background: "var(--ui-surface-raised, Canvas)",
379
+ color: "var(--ui-brand-fg-emphasis)",
380
+ boxShadow: "0 0 0 2px var(--ui-brand-bg-solid)",
381
+ },
382
+ "&:hover, &:focus-visible, &[data-highlighted]": {
383
+ zIndex: "5",
384
+ boxShadow: "var(--ui-shadow-ring-hover), 0 4px 12px -4px rgb(0 0 0 / 0.3)",
385
+ },
386
+ "&[data-highlighted]:not([aria-current])": {
387
+ background: "var(--ui-neutral-bg-solid)",
388
+ color: "var(--ui-neutral-fg-on-solid)",
389
+ },
390
+ "@media (forced-colors: active)": { border: "1px solid CanvasText" },
391
+ }),
392
+ when("&:focus-visible", raw({ outline: "2px solid var(--ui-brand-ring)" })),
393
+ motionSafe(raw({
394
+ transition: "scale 140ms ease-out",
395
+ "&:hover, &:focus-visible, &[data-highlighted]": { scale: "1.08" },
396
+ })),
397
+ ...(mapKey === undefined ? [] : [mapLink(mapKey)]),
398
+ ], mix),
399
+ };
400
+ let pin = href !== undefined ? (_jsx("a", { ...rest, ...shared, href: href, children: label })) : (_jsx("button", { type: "button", popovertarget: hasPopup ? popupId : undefined, ...rest, ...shared, children: label }));
401
+ return (_jsxs(_Fragment, { children: [pin, children] }));
402
+ };
403
+ };
404
+ /**
405
+ * A card a marker opens, anchored above its pin with CSS anchor positioning and flipped below
406
+ * when the top has no room. It is an `auto` popover, so a click outside or Escape closes it.
407
+ *
408
+ * @example <GeoMap.Popup><StayCard stay={stay} /></GeoMap.Popup>
409
+ */
410
+ GeoMap.Popup = function GeoMapPopup(handle) {
411
+ return () => {
412
+ let { children, mix, ...rest } = handle.props;
413
+ let marker = handle.context.get(GeoMap.Marker);
414
+ return (_jsx("div", { ...rest, popover: "auto", id: marker?.popupId, "data-slot": "map-popup", style: { positionAnchor: marker?.anchor }, mix: mergeMix([
415
+ raw({
416
+ inset: "auto",
417
+ margin: "0",
418
+ marginBlock: "0.75rem",
419
+ positionArea: "top",
420
+ positionTryFallbacks: "flip-block",
421
+ inlineSize: "min(18rem, calc(100vw - 2rem))",
422
+ maxBlockSize: "calc(100dvh - 2rem)",
423
+ overflow: "auto",
424
+ padding: "0",
425
+ border: "0",
426
+ borderRadius: "var(--ui-radius-xl, 0.75rem)",
427
+ background: "var(--ui-surface-raised, Canvas)",
428
+ color: "var(--ui-fg, CanvasText)",
429
+ boxShadow: "var(--ui-shadow-stage)",
430
+ "@media (forced-colors: active)": { border: "1px solid CanvasText" },
431
+ }),
432
+ motionSafe(raw({
433
+ transition: "opacity 140ms ease-out, translate 140ms ease-out, display 140ms allow-discrete, overlay 140ms allow-discrete",
434
+ "&:popover-open": { opacity: "1", translate: "0 0" },
435
+ "@starting-style": { "&:popover-open": { opacity: "0", translate: "0 4px" } },
436
+ })),
437
+ motionReduce(raw({ transition: "none" })),
438
+ ], mix), children: children }));
439
+ };
440
+ };
441
+ /**
442
+ * Draws a route along real coordinates: a light casing, the whole line dashed and the
443
+ * travelled share solid on top. The solid part keeps `pathLength="1"` and a
444
+ * `stroke-dasharray` of `"<share> 2"`, so a live script moves it by rewriting that attribute.
445
+ *
446
+ * @example <GeoMap.Route path={[[-9.16, 38.70], [-9.14, 38.71]]} progress={0.4}><GeoMap.RouteMarker /></GeoMap.Route>
447
+ */
448
+ GeoMap.Route = function GeoMapRoute(handle) {
449
+ return () => {
450
+ let { children, mix, path, progress, ...rest } = handle.props;
451
+ let stage = stageOf(handle);
452
+ let d = routePathData(path, (point) => offsetFrom(stage.view, point));
453
+ let share = clampShare(progress ?? 0);
454
+ handle.context.set({ d, progress: share });
455
+ let line = {
456
+ fill: "none",
457
+ strokeLinecap: "round",
458
+ strokeLinejoin: "round",
459
+ };
460
+ return (_jsxs("svg", { ...rest, "aria-hidden": "true", focusable: "false", width: "1", height: "1", "data-slot": "map-route", "data-path": JSON.stringify(path), mix: mergeMix([
461
+ raw({
462
+ position: "absolute",
463
+ zIndex: "2",
464
+ insetInlineStart: "50%",
465
+ insetBlockStart: "50%",
466
+ overflow: "visible",
467
+ pointerEvents: "none",
468
+ }),
469
+ ], mix), children: [_jsx("path", { d: d, "data-route-part": "casing", mix: [
470
+ raw({
471
+ ...line,
472
+ stroke: "var(--ui-map-route-casing, var(--ui-surface-raised, Canvas))",
473
+ strokeWidth: "var(--ui-map-route-casing-width, 8)",
474
+ }),
475
+ ] }), _jsx("path", { d: d, "data-route-part": "ahead", mix: [
476
+ raw({
477
+ ...line,
478
+ stroke: "var(--ui-map-route-color, var(--ui-brand-bg-solid))",
479
+ strokeOpacity: "0.55",
480
+ strokeWidth: "var(--ui-map-route-width, 4)",
481
+ strokeDasharray: "var(--ui-map-route-dash, 2 8)",
482
+ }),
483
+ ] }), _jsx("path", { d: d, pathLength: "1", "data-route-part": "done", "stroke-dasharray": `${share} 2`, mix: [
484
+ raw({
485
+ ...line,
486
+ stroke: "var(--ui-map-route-color, var(--ui-brand-bg-solid))",
487
+ strokeWidth: "var(--ui-map-route-width, 4)",
488
+ }),
489
+ ] }), children] }));
490
+ };
491
+ };
492
+ /**
493
+ * Places a glyph along its route with CSS motion paths. At `progress` it reads
494
+ * `--ui-map-progress` and carries `data-map-marker`, so a live script moves it with
495
+ * `el.style.setProperty("--ui-map-progress", "0.6")` and it glides there, or jumps under
496
+ * reduced motion. The island keeps its path in step with panning and zooming.
497
+ *
498
+ * @example <GeoMap.RouteMarker at="progress"><circle r="8" /></GeoMap.RouteMarker>
499
+ */
500
+ GeoMap.RouteMarker = function GeoMapRouteMarker(handle) {
501
+ return () => {
502
+ let { at = "progress", children, mix, ...rest } = handle.props;
503
+ let route = handle.context.get(GeoMap.Route) ?? {
504
+ d: "",
505
+ progress: 0,
506
+ };
507
+ let share = routeShare(at, route.progress);
508
+ return (_jsx("g", { ...rest, "data-slot": "map-route-marker", "data-map-marker": at === "progress" ? "" : undefined, style: {
509
+ "--ui-map-progress": String(share),
510
+ offsetPath: `path(${JSON.stringify(route.d)})`,
511
+ }, mix: mergeMix([
512
+ raw({
513
+ offsetDistance: "calc(var(--ui-map-progress) * 100%)",
514
+ offsetRotate: "0deg",
515
+ offsetAnchor: "0 0",
516
+ }),
517
+ motionSafe(raw({ transition: "offset-distance 400ms ease-out" })),
518
+ motionReduce(raw({ transition: "none" })),
519
+ ], mix), children: children ?? (_jsxs(_Fragment, { children: [_jsx("circle", { r: "12", "fill-opacity": "0.22", mix: [raw({ fill: "var(--ui-map-marker-color, var(--ui-brand-bg-solid))" })] }), _jsx("circle", { r: "6", mix: [
520
+ raw({
521
+ fill: "var(--ui-map-marker-color, var(--ui-brand-bg-solid))",
522
+ stroke: "var(--ui-surface-raised, Canvas)",
523
+ strokeWidth: "2",
524
+ }),
525
+ ] })] })) }));
526
+ };
527
+ };
528
+ /** The share of its route a route marker sits at. */
529
+ function routeShare(at, progress) {
530
+ if (at === "start")
531
+ return 0;
532
+ if (at === "end")
533
+ return 1;
534
+ if (typeof at === "number")
535
+ return clampShare(at);
536
+ return progress;
537
+ }
538
+ /**
539
+ * A "Search this area" button for a search form: hidden fields carry the bounds, middle and
540
+ * zoom the page was drawn at, and once the visitor pans or zooms, the island rewrites them and
541
+ * reveals the button, which submits the form named by `form`.
542
+ *
543
+ * @example <GeoMap.Area form="stay-search" label="Search this area" />
544
+ */
545
+ GeoMap.Area = function GeoMapArea(handle) {
546
+ return () => {
547
+ let { centerName, form, label, mix, name, zoomName, ...rest } = handle.props;
548
+ let stage = stageOf(handle);
549
+ let bounds = viewBounds(stage.view, stage.viewport);
550
+ return (_jsxs(_Fragment, { children: [_jsx("input", { type: "hidden", form: form, name: name ?? DEFAULT_AREA_NAMES.bounds, value: formatBounds(bounds), "data-map-area": "bounds" }), _jsx("input", { type: "hidden", form: form, name: centerName ?? DEFAULT_AREA_NAMES.center, value: formatLngLat(stage.view.center), "data-map-area": "center" }), _jsx("input", { type: "hidden", form: form, name: zoomName ?? DEFAULT_AREA_NAMES.zoom, value: String(roundTo(stage.view.zoom, 2)), "data-map-area": "zoom" }), _jsx("button", { ...rest, type: "submit", form: form, hidden: true, "data-slot": "map-area", mix: mergeMix([
551
+ raw({
552
+ position: "absolute",
553
+ zIndex: "6",
554
+ insetBlockStart: "0.75rem",
555
+ insetInlineStart: "50%",
556
+ translate: "-50% 0",
557
+ display: "inline-flex",
558
+ alignItems: "center",
559
+ minBlockSize: "2.75rem",
560
+ paddingInline: "1rem",
561
+ border: "0",
562
+ borderRadius: "9999px",
563
+ font: "inherit",
564
+ fontSize: "0.875rem",
565
+ fontWeight: "600",
566
+ whiteSpace: "nowrap",
567
+ cursor: "pointer",
568
+ background: "var(--ui-surface-raised, Canvas)",
569
+ color: "var(--ui-neutral-fg-emphasis, CanvasText)",
570
+ boxShadow: "var(--ui-shadow-ring), 0 4px 12px -4px rgb(0 0 0 / 0.3)",
571
+ "&[hidden]": { display: "none" },
572
+ "@media (forced-colors: active)": { border: "1px solid ButtonText" },
573
+ }),
574
+ when("&:focus-visible", raw({ outline: "2px solid var(--ui-brand-ring, Highlight)" })),
575
+ ], mix), children: label })] }));
576
+ };
577
+ };
578
+ /**
579
+ * The island every map stage renders: it finds the stage by id and hands it to the browser
580
+ * engine, then passes on new props after a re-render such as a frame swap, so the camera
581
+ * follows a server-chosen view. It draws nothing itself.
582
+ */
583
+ export const GeoMapEngine = clientEntry("@sdxc/ui/map/map#GeoMapEngine", function GeoMapEngine(handle) {
584
+ let session;
585
+ handle.queueTask(async () => {
586
+ let stage = document.getElementById(handle.props.root);
587
+ if (stage === null)
588
+ return;
589
+ let controller = new AbortController();
590
+ handle.signal.addEventListener("abort", () => controller.abort(), { once: true });
591
+ session = await startEngine(stage, { ...handle.props }, controller.signal);
592
+ session?.sync({ ...handle.props });
593
+ });
594
+ return () => {
595
+ handle.queueTask(() => session?.sync({ ...handle.props }));
596
+ return _jsx("span", { hidden: true, "data-slot": "map-engine" });
597
+ };
598
+ });
@@ -0,0 +1,30 @@
1
+ /**
2
+ * Links every element that shares one `data-map-key` across a page, so pointing at or focusing a
3
+ * listing row lights up its pin on a map and the reverse. Without script nothing is lit and
4
+ * each row and pin still works as its own link or button.
5
+ *
6
+ * @author [Sergio Xalambrí](https://sergiodxa.com)
7
+ * @copyright Sergio Xalambrí 2026
8
+ */
9
+ /** Attribute naming the record a row or pin stands for. */
10
+ export declare const MAP_KEY_ATTRIBUTE = "data-map-key";
11
+ /** Attribute present on every element of the record under the pointer or focus. */
12
+ export declare const MAP_HIGHLIGHTED_ATTRIBUTE = "data-highlighted";
13
+ /**
14
+ * Lights every element sharing `key` while the host is pointed at or holds focus, and keeps
15
+ * them lit until both the pointer and the focus have left it. The host gets `data-map-key`
16
+ * too, so a row and a pin each carrying `mapLink` light one another.
17
+ *
18
+ * @param key Record key, such as a listing id.
19
+ * @example <li mix={mapLink(stay.id)}><a href={stay.url}>{stay.name}</a></li>
20
+ * @example <MapCanvas.Pin x={120} y={80} label="$182" mapKey={stay.id} />
21
+ */
22
+ export declare const mapLink: import("remix/component").MixinFactory<HTMLElement, [key: string], import("remix/component").ElementProps>;
23
+ /**
24
+ * Links every `data-map-key` row and pin in the host's document at once, by listening on the
25
+ * document, so markup rendered on the server lights up without each row being an island. The
26
+ * listeners go when the host leaves the page.
27
+ *
28
+ * @example <span hidden mix={mapLinks()} />
29
+ */
30
+ export declare const mapLinks: import("remix/component").MixinFactory<HTMLElement, [], import("remix/component").ElementProps>;