@mailwoman/react 9.4.0 → 10.0.0

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 (127) hide show
  1. package/lib/common/About.tsx +87 -71
  2. package/lib/common/index.ts +22 -0
  3. package/lib/index.ts +4 -99
  4. package/lib/map/BackendControl.tsx +7 -3
  5. package/lib/map/CompareToggle.tsx +3 -2
  6. package/lib/map/Geocoder.tsx +48 -28
  7. package/lib/map/GeocoderControls.tsx +258 -99
  8. package/lib/map/MapChipRow.tsx +77 -0
  9. package/lib/map/MapCompass.tsx +77 -0
  10. package/lib/map/MapControlStack.tsx +98 -0
  11. package/lib/map/MapFooter.tsx +115 -0
  12. package/lib/map/MapProgressBar.tsx +58 -0
  13. package/lib/map/MapSearchBar.tsx +68 -0
  14. package/lib/map/MapSheet.tsx +62 -0
  15. package/lib/map/index.ts +19 -0
  16. package/lib/map/types.ts +18 -4
  17. package/lib/map/useMapBearing.ts +56 -0
  18. package/lib/map/useMapLabelPick.ts +123 -0
  19. package/lib/pipeline/index.ts +36 -0
  20. package/lib/pipeline/useParsePipeline.ts +29 -18
  21. package/lib/poi/index.ts +39 -0
  22. package/lib/runtime/index.ts +16 -0
  23. package/out/common/About.d.ts +13 -4
  24. package/out/common/About.d.ts.map +1 -1
  25. package/out/common/About.js +5 -2
  26. package/out/common/About.js.map +1 -1
  27. package/out/common/index.d.ts +22 -0
  28. package/out/common/index.d.ts.map +1 -0
  29. package/out/common/index.js +15 -0
  30. package/out/common/index.js.map +1 -0
  31. package/out/index.d.ts +4 -59
  32. package/out/index.d.ts.map +1 -1
  33. package/out/index.js +4 -36
  34. package/out/index.js.map +1 -1
  35. package/out/map/BackendControl.d.ts.map +1 -1
  36. package/out/map/BackendControl.js +1 -1
  37. package/out/map/BackendControl.js.map +1 -1
  38. package/out/map/CompareToggle.d.ts.map +1 -1
  39. package/out/map/CompareToggle.js +1 -1
  40. package/out/map/CompareToggle.js.map +1 -1
  41. package/out/map/Geocoder.d.ts +11 -1
  42. package/out/map/Geocoder.d.ts.map +1 -1
  43. package/out/map/Geocoder.js +26 -26
  44. package/out/map/Geocoder.js.map +1 -1
  45. package/out/map/GeocoderControls.d.ts +29 -11
  46. package/out/map/GeocoderControls.d.ts.map +1 -1
  47. package/out/map/GeocoderControls.js +65 -16
  48. package/out/map/GeocoderControls.js.map +1 -1
  49. package/out/map/MapChipRow.d.ts +47 -0
  50. package/out/map/MapChipRow.d.ts.map +1 -0
  51. package/out/map/MapChipRow.js +12 -0
  52. package/out/map/MapChipRow.js.map +1 -0
  53. package/out/map/MapCompass.d.ts +42 -0
  54. package/out/map/MapCompass.d.ts.map +1 -0
  55. package/out/map/MapCompass.js +11 -0
  56. package/out/map/MapCompass.js.map +1 -0
  57. package/out/map/MapControlStack.d.ts +57 -0
  58. package/out/map/MapControlStack.d.ts.map +1 -0
  59. package/out/map/MapControlStack.js +15 -0
  60. package/out/map/MapControlStack.js.map +1 -0
  61. package/out/map/MapFooter.d.ts +40 -0
  62. package/out/map/MapFooter.d.ts.map +1 -0
  63. package/out/map/MapFooter.js +51 -0
  64. package/out/map/MapFooter.js.map +1 -0
  65. package/out/map/MapProgressBar.d.ts +34 -0
  66. package/out/map/MapProgressBar.d.ts.map +1 -0
  67. package/out/map/MapProgressBar.js +8 -0
  68. package/out/map/MapProgressBar.js.map +1 -0
  69. package/out/map/MapSearchBar.d.ts +49 -0
  70. package/out/map/MapSearchBar.d.ts.map +1 -0
  71. package/out/map/MapSearchBar.js +6 -0
  72. package/out/map/MapSearchBar.js.map +1 -0
  73. package/out/map/MapSheet.d.ts +32 -0
  74. package/out/map/MapSheet.d.ts.map +1 -0
  75. package/out/map/MapSheet.js +33 -0
  76. package/out/map/MapSheet.js.map +1 -0
  77. package/out/map/OverlayLayers.js +1 -1
  78. package/out/map/ResolvedPlaceLayers.js +1 -1
  79. package/out/map/ResultPanel.js +1 -1
  80. package/out/map/fake-runtime.js.map +1 -1
  81. package/out/map/index.d.ts +17 -0
  82. package/out/map/index.d.ts.map +1 -1
  83. package/out/map/index.js +10 -0
  84. package/out/map/index.js.map +1 -1
  85. package/out/map/map-debug.d.ts.map +1 -1
  86. package/out/map/map-debug.js.map +1 -1
  87. package/out/map/types.d.ts +20 -4
  88. package/out/map/types.d.ts.map +1 -1
  89. package/out/map/useMapBearing.d.ts +28 -0
  90. package/out/map/useMapBearing.d.ts.map +1 -0
  91. package/out/map/useMapBearing.js +35 -0
  92. package/out/map/useMapBearing.js.map +1 -0
  93. package/out/map/useMapLabelPick.d.ts +23 -0
  94. package/out/map/useMapLabelPick.d.ts.map +1 -0
  95. package/out/map/useMapLabelPick.js +104 -0
  96. package/out/map/useMapLabelPick.js.map +1 -0
  97. package/out/pipeline/CandidatePicker.js +1 -1
  98. package/out/pipeline/PipelineExplorer.js +1 -1
  99. package/out/pipeline/QueryForm.js +1 -1
  100. package/out/pipeline/ResolvedPlace.js +1 -1
  101. package/out/pipeline/TimingPanel.js +1 -1
  102. package/out/pipeline/index.d.ts +33 -0
  103. package/out/pipeline/index.d.ts.map +1 -0
  104. package/out/pipeline/index.js +21 -0
  105. package/out/pipeline/index.js.map +1 -0
  106. package/out/pipeline/useParsePipeline.d.ts +5 -2
  107. package/out/pipeline/useParsePipeline.d.ts.map +1 -1
  108. package/out/pipeline/useParsePipeline.js +6 -2
  109. package/out/pipeline/useParsePipeline.js.map +1 -1
  110. package/out/poi/LiveResultsBlock.js +1 -1
  111. package/out/poi/POIExplorer.js +1 -1
  112. package/out/poi/SubjectPanel.js +1 -1
  113. package/out/poi/index.d.ts +23 -0
  114. package/out/poi/index.d.ts.map +1 -0
  115. package/out/poi/index.js +15 -0
  116. package/out/poi/index.js.map +1 -0
  117. package/out/poi/runtime.d.ts.map +1 -1
  118. package/out/runtime/index.d.ts +9 -0
  119. package/out/runtime/index.d.ts.map +1 -0
  120. package/out/runtime/index.js +8 -0
  121. package/out/runtime/index.js.map +1 -0
  122. package/package.json +87 -6
  123. package/styleframe.config.ts +9 -1
  124. package/styles.css +948 -26
  125. package/tokens/index.css +2 -1
  126. package/tokens/tokens.json +7 -0
  127. package/tokens/tokens.resolver.json +1 -1
@@ -1,30 +1,79 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
1
+ import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ /**
3
+ * @copyright Sister Software
4
+ * @license AGPL-3.0
5
+ * @author Teffen Ellis, et al.
6
+ *
7
+ * The geocoder's chrome over the map: a search pill on top, example chips on one line beneath it, a control column
8
+ * down the right edge, and a result sheet that rises from the bottom when there is something to show.
9
+ *
10
+ * It replaces a 400px full-height panel that carried every control at once. The layout is the one the reference
11
+ * map apps use, and the reason is the map: chrome that floats over it leaves the map the page, where a slab makes
12
+ * the map the leftover third.
13
+ *
14
+ * NODE-SAFE: pure React + the shared units, no maplibre.
15
+ */
16
+ import { useCallback, useState } from "react";
17
+ import { useMapBearing } from "#map/useMapBearing";
18
+ import { useMapLabelPick } from "#map/useMapLabelPick";
2
19
  import { LoadingIndicator } from "../common/LoadingIndicator.js";
3
- import { PresetChips } from "../common/PresetChips.js";
4
- import { QueryForm } from "../pipeline/QueryForm.js";
5
20
  import { BackendControl } from "./BackendControl.js";
6
21
  import { CompareToggle } from "./CompareToggle.js";
22
+ import { MapChipRow } from "./MapChipRow.js";
23
+ import { MapCompass } from "./MapCompass.js";
24
+ import { MapControlButton, MapControlGroup, MapControlStack } from "./MapControlStack.js";
25
+ import { MapProgressBar } from "./MapProgressBar.js";
26
+ import { MapSearchBar } from "./MapSearchBar.js";
27
+ import { MapSheet } from "./MapSheet.js";
7
28
  import { PlaceAutocomplete } from "./PlaceAutocomplete.js";
8
29
  import { ResultPanel } from "./ResultPanel.js";
9
30
  import { VersionPicker } from "./VersionPicker.js";
10
31
  /**
11
- * The floating control panel.
32
+ * The chrome. Everything positioned here floats over the map; nothing occupies a column of the page.
12
33
  */
13
- export function GeocoderControls({ runtime, geocode, autocomplete, compare, panels, presets, placeholder, onSelectVersion, onForceWASMChange, }) {
34
+ export function GeocoderControls({ runtime, geocode, autocomplete, compare, panels, presets, placeholder, map = null, onSubmitQuery, onSelectVersion, onForceWASMChange, developer = false, }) {
14
35
  const versions = runtime.availableVersions ?? [];
15
36
  const { busy, result, selectedCandidate } = geocode;
16
37
  const loading = runtime.loading;
17
38
  const errorMessage = geocode.parseError ?? runtime.errorMessage ?? null;
18
- return (_jsxs("section", { className: "mw-demo-controls", children: [panels.header, panels.releaseInfo, _jsx(VersionPicker, { versions: versions, selected: runtime.selectedVersion ?? null, onSelect: onSelectVersion, disabled: busy }), _jsx(BackendControl, { activeBackend: runtime.activeBackend, forceWASM: runtime.forceWASM ?? false, onForceWASMChange: onForceWASMChange }), _jsx(CompareToggle, { versions: versions, primaryVersion: runtime.selectedVersion ?? null, compareMode: compare.compareMode, onCompareModeChange: compare.setCompareMode, compareVersion: compare.compareVersion, onCompareVersionChange: compare.setCompareVersion, disabled: busy }), _jsx(QueryForm, { value: geocode.text, onChange: geocode.setText, onSubmit: geocode.submit, disabled: !runtime.ready, busy: busy, placeholder: placeholder, onKeyDown: autocomplete.onInputKeyDown, inputProps: autocomplete.inputProps }), panels.bias, _jsx(PlaceAutocomplete, { suggestions: autocomplete.suggestions, activeIndex: autocomplete.activeIndex, onPick: autocomplete.pick, onHover: autocomplete.setActiveIndex, listboxID: autocomplete.listboxID, optionID: autocomplete.optionID }), _jsx(PresetChips, { presets: presets, disabled: !runtime.ready || busy, onPick: (value) => {
19
- geocode.setText(value);
20
- geocode.reset();
21
- }, trailing: panels.permalink ? panels.permalink(geocode.text) : null }), loading && !runtime.ready ? (_jsx(LoadingIndicator, { mode: "staged", steps: loading.stepLabels.length ? loading.stepLabels : undefined, activeStep: loading.stepIndex, label: loading.progress })) : null, errorMessage ? _jsx("p", { className: "mw-error", children: errorMessage }) : null, panels.aboveResult ? panels.aboveResult({ result }) : null, busy ? (_jsx("div", { className: "mw-result", children: _jsx(LoadingIndicator, { mode: "staged", steps: runtime.parseStageLabels, activeStep: geocode.parseStage }) })) : result ? (panels.result ? (panels.result({
22
- result,
23
- selectedCandidate,
24
- selectedCandidateIndex: geocode.selectedCandidateIndex,
25
- onSelectCandidate: geocode.selectCandidate,
26
- })) : (_jsx(ResultPanel, { result: result, selectedCandidate: selectedCandidate, selectedCandidateIndex: geocode.selectedCandidateIndex, onSelectCandidate: geocode.selectCandidate, extras: panels.extras, failure: panels.failure }))) : null, panels.compare
27
- ? panels.compare({ result, compareMode: compare.compareMode, compareVersion: compare.compareVersion })
28
- : null, panels.footer] }));
39
+ // One sheet at a time. Two open at once stack on the same edge, and on a phone each is the full panel.
40
+ const [openSheet, setOpenSheet] = useState(developer ? "developer" : null);
41
+ const { bearing, resetNorth } = useMapBearing(map);
42
+ const toggleSheet = (name) => setOpenSheet((current) => (current === name ? null : name));
43
+ const closeSheet = useCallback(() => setOpenSheet(null), []);
44
+ // Every path that starts a query goes through here, so the URL is written in exactly one place — the event that
45
+ // caused it, rather than an effect watching the result after the fact.
46
+ const runQuery = useCallback((query) => {
47
+ onSubmitQuery?.(query);
48
+ void geocode.submit(query);
49
+ }, [onSubmitQuery, geocode]);
50
+ // A label on the map is a search a visitor already typed by pointing at it.
51
+ const pickLabel = useCallback((name) => {
52
+ geocode.setText(name);
53
+ geocode.reset();
54
+ runQuery(name);
55
+ }, [geocode, runQuery]);
56
+ useMapLabelPick(map, pickLabel);
57
+ const chips = presets.map((preset) => ({ label: preset.label, value: preset.value }));
58
+ // The bundle load no longer opens the result sheet: it reports on the bar at the top of the viewport and in the
59
+ // footer, so an empty sheet does not sit over the map for the length of a 38 MB download.
60
+ const showSheet = Boolean(busy || result || errorMessage);
61
+ const bundleLoading = Boolean(loading && !runtime.ready);
62
+ const steps = loading?.stepLabels.length ?? 0;
63
+ return (_jsxs(_Fragment, { children: [_jsx(MapProgressBar, { active: bundleLoading, fraction: steps ? ((loading?.stepIndex ?? 0) + 1) / steps : null, label: "Loading the geocoder" }), _jsxs("div", { className: "mw-map-chrome mw-map-chrome--top", children: [_jsx("form", { className: "mw-map-chrome__search", onSubmit: (event) => {
64
+ event.preventDefault();
65
+ runQuery(geocode.text);
66
+ }, children: _jsx(MapSearchBar, { label: "Search addresses", leading: _jsx("span", { "aria-hidden": "true", children: "\u2315" }), busy: busy, children: _jsx("input", { id: "mw-pipeline-input", type: "search", "aria-label": "Address", value: geocode.text, onChange: (event) => geocode.setText(event.target.value), disabled: !runtime.ready, placeholder: placeholder, onKeyDown: autocomplete.onInputKeyDown, ...autocomplete.inputProps }) }) }), _jsx(PlaceAutocomplete, { suggestions: autocomplete.suggestions, activeIndex: autocomplete.activeIndex, onPick: autocomplete.pick, onHover: autocomplete.setActiveIndex, listboxID: autocomplete.listboxID, optionID: autocomplete.optionID }), _jsx(MapChipRow, { chips: chips, label: "Example addresses", activeValue: geocode.text, disabled: !runtime.ready || busy, onPick: (value) => {
67
+ geocode.setText(value);
68
+ geocode.reset();
69
+ runQuery(value);
70
+ } }), panels.bias] }), _jsxs(MapControlStack, { label: "Map controls", children: [_jsxs(MapControlGroup, { children: [_jsx(MapControlButton, { label: "About this geocoder", active: openSheet === "about", onPress: () => toggleSheet("about"), children: _jsx("span", { "aria-hidden": "true", children: "i" }) }), panels.layers ? (_jsx(MapControlButton, { label: "Map layers", active: openSheet === "layers", onPress: () => toggleSheet("layers"), children: _jsx("span", { "aria-hidden": "true", children: "\u2261" }) })) : null, _jsx(MapControlButton, { label: "Developer controls", active: openSheet === "developer", onPress: () => toggleSheet("developer"), children: _jsx("span", { "aria-hidden": "true", children: "\u2699" }) })] }), _jsx(MapControlGroup, { className: "mw-map-control-group--compass", children: _jsx(MapCompass, { bearing: bearing, onResetNorth: resetNorth }) })] }), openSheet === "about" ? (_jsx(MapSheet, { title: "About", onClose: closeSheet, children: panels.header })) : null, openSheet === "layers" ? (_jsx(MapSheet, { title: "Layers", onClose: closeSheet, children: panels.layers?.({ map }) })) : null, openSheet === "developer" ? (_jsxs(MapSheet, { title: "Developer", onClose: closeSheet, children: [panels.releaseInfo ? (_jsxs("div", { className: "mw-map-sheet__row", children: [_jsx("span", { className: "mw-map-sheet__label", children: "This release" }), panels.releaseInfo] })) : null, _jsx("div", { className: "mw-map-sheet__row", children: _jsx(VersionPicker, { versions: versions, selected: runtime.selectedVersion ?? null, onSelect: onSelectVersion, disabled: busy }) }), _jsx("div", { className: "mw-map-sheet__row", children: _jsx(BackendControl, { activeBackend: runtime.activeBackend, forceWASM: runtime.forceWASM ?? false, onForceWASMChange: onForceWASMChange }) }), _jsx("div", { className: "mw-map-sheet__row", children: _jsx(CompareToggle, { versions: versions, primaryVersion: runtime.selectedVersion ?? null, compareMode: compare.compareMode, onCompareModeChange: compare.setCompareMode, compareVersion: compare.compareVersion, onCompareVersionChange: compare.setCompareVersion, disabled: busy }) }), panels.developerExtras] })) : null, showSheet ? (_jsxs("section", { className: "mw-map-sheet mw-map-sheet--bottom", "aria-label": "Result", children: [_jsx("div", { className: "mw-map-sheet__handle", "aria-hidden": "true" }), errorMessage ? _jsx("p", { className: "mw-error", children: errorMessage }) : null, panels.aboveResult ? panels.aboveResult({ result }) : null, busy ? (_jsx("div", { className: "mw-result", children: _jsx(LoadingIndicator, { mode: "staged", steps: runtime.parseStageLabels, activeStep: geocode.parseStage }) })) : result ? (panels.result ? (panels.result({
71
+ result,
72
+ selectedCandidate,
73
+ selectedCandidateIndex: geocode.selectedCandidateIndex,
74
+ onSelectCandidate: geocode.selectCandidate,
75
+ })) : (_jsx(ResultPanel, { result: result, selectedCandidate: selectedCandidate, selectedCandidateIndex: geocode.selectedCandidateIndex, onSelectCandidate: geocode.selectCandidate, extras: panels.extras, failure: panels.failure }))) : null, panels.compare
76
+ ? panels.compare({ result, compareMode: compare.compareMode, compareVersion: compare.compareVersion })
77
+ : null, panels.permalink ? _jsx("div", { className: "mw-map-sheet__actions", children: panels.permalink(geocode.text) }) : null] })) : null, panels.footer] }));
29
78
  }
30
79
  //# sourceMappingURL=Geoc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,EAAC,QAAQ,EAAC,KAAK,EAAE,OAAO,CAAC,gBAAgB,EAAE,UAAU,EAAE,OAAO,CAAC,UAAU,GAAI,GAC9F,CACN,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CACZ,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,CACf,MAAM,CAAC,MAAM,CAAC;wBACb,MAAM;wBACN,iBAAiB;wBACjB,sBAAsB,EAAE,OAAO,CAAC,sBAAsB;wBACtD,iBAAiB,EAAE,OAAO,CAAC,eAAe;qBAC1C,CAAC,CACF,CAAC,CAAC,CAAC,CACH,KAAC,WAAW,IACX,MAAM,EAAE,MAAM,EACd,iBAAiB,EAAE,iBAAiB,EACpC,sBAAsB,EAAE,OAAO,CAAC,sBAAsB,EACtD,iBAAiB,EAAE,OAAO,CAAC,eAAe,EAC1C,MAAM,EAAE,MAAM,CAAC,MAAM,EACrB,OAAO,EAAE,MAAM,CAAC,OAAO,GACtB,CACF,CACD,CAAC,CAAC,CAAC,IAAI,EAEP,MAAM,CAAC,OAAO;wBACd,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,EAAE,MAAM,EAAE,WAAW,EAAE,OAAO,CAAC,WAAW,EAAE,cAAc,EAAE,OAAO,CAAC,cAAc,EAAE,CAAC;wBACtG,CAAC,CAAC,IAAI,EAEN,MAAM,CAAC,SAAS,CAAC,CAAC,CAAC,cAAK,SAAS,EAAC,uBAAuB,YAAE,MAAM,CAAC,SAAS,CAAC,OAAO,CAAC,IAAI,CAAC,GAAO,CAAC,CAAC,CAAC,IAAI,IAC/F,CACV,CAAC,CAAC,CAAC,IAAI,EAEP,MAAM,CAAC,MAAM,IACZ,CACH,CAAA;AACF,CAAC"}
@@ -0,0 +1,47 @@
1
+ /**
2
+ * @copyright Sister Software
3
+ * @license AGPL-3.0
4
+ * @author Teffen Ellis, et al.
5
+ *
6
+ * `<MapChipRow>` — the row of example queries under a search bar.
7
+ *
8
+ * It SCROLLS horizontally and never wraps. Earth's twelve examples wrapped down five ragged rows (3/3/2/1/1/1) and
9
+ * took a third of the panel; one scrolling line is the shape the reference map apps use, and it costs a fixed
10
+ * height whatever the number of examples.
11
+ *
12
+ * NODE-SAFE: pure React, no maplibre.
13
+ */
14
+ import type { ReactNode } from "react";
15
+ export interface MapChip {
16
+ /**
17
+ * What the chip reads.
18
+ */
19
+ label: string;
20
+ /**
21
+ * The query the chip stands for, handed back on press. Defaults to the label.
22
+ */
23
+ value?: string;
24
+ /**
25
+ * Rendered before the label — a category mark.
26
+ */
27
+ icon?: ReactNode;
28
+ }
29
+ export interface MapChipRowProps {
30
+ chips: MapChip[];
31
+ /**
32
+ * Fired with the chip's `value` (or its label) when one is pressed.
33
+ */
34
+ onPick: (value: string) => void;
35
+ /**
36
+ * The chip matching this value reads as pressed.
37
+ */
38
+ activeValue?: string;
39
+ disabled?: boolean;
40
+ className?: string;
41
+ /**
42
+ * Accessible name for the row, e.g. "Example addresses".
43
+ */
44
+ label?: string;
45
+ }
46
+ export declare function MapChipRow({ chips, onPick, activeValue, disabled, className, label }: MapChipRowProps): ReactNode;
47
+ //# sourceMappingURL=MapChipRow.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"MapChipRow.d.ts","sourceRoot":"","sources":["../../lib/map/MapChipRow.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAItC,MAAM,WAAW,OAAO;IACvB;;OAEG;IACH,KAAK,EAAE,MAAM,CAAA;IACb;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAA;IACd;;OAEG;IACH,IAAI,CAAC,EAAE,SAAS,CAAA;CAChB;AAED,MAAM,WAAW,eAAe;IAC/B,KAAK,EAAE,OAAO,EAAE,CAAA;IAChB;;OAEG;IACH,MAAM,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAA;IAC/B;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAA;CACd;AAED,wBAAgB,UAAU,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,WAAW,EAAE,QAAQ,EAAE,SAAS,EAAE,KAAK,EAAE,EAAE,eAAe,GAAG,SAAS,CAyBjH"}
@@ -0,0 +1,12 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { cx } from "#common/cx";
3
+ export function MapChipRow({ chips, onPick, activeValue, disabled, className, label }) {
4
+ if (!chips.length)
5
+ return null;
6
+ return (_jsx("div", { className: cx("mw-map-chiprow", className), role: "group", "aria-label": label, children: chips.map((chip) => {
7
+ const value = chip.value ?? chip.label;
8
+ const active = value === activeValue;
9
+ return (_jsxs("button", { type: "button", className: cx("mw-map-chip", active && "mw-map-chip--active"), "aria-pressed": active, disabled: disabled, onClick: () => onPick(value), children: [chip.icon ? _jsx("span", { className: "mw-map-chip__icon", children: chip.icon }) : null, chip.label] }, value));
10
+ }) }));
11
+ }
12
+ //# sourceMappingURL=MapChipRow.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"MapChipRow.js","sourceRoot":"","sources":["../../lib/map/MapChipRow.tsx"],"names":[],"mappings":";AAgBA,OAAO,EAAE,EAAE,EAAE,MAAM,YAAY,CAAA;AAmC/B,MAAM,UAAU,UAAU,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,WAAW,EAAE,QAAQ,EAAE,SAAS,EAAE,KAAK,EAAmB;IACrG,IAAI,CAAC,KAAK,CAAC,MAAM;QAAE,OAAO,IAAI,CAAA;IAE9B,OAAO,CACN,cAAK,SAAS,EAAE,EAAE,CAAC,gBAAgB,EAAE,SAAS,CAAC,EAAE,IAAI,EAAC,OAAO,gBAAa,KAAK,YAC7E,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE;YACnB,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,IAAI,IAAI,CAAC,KAAK,CAAA;YACtC,MAAM,MAAM,GAAG,KAAK,KAAK,WAAW,CAAA;YAEpC,OAAO,CACN,kBAEC,IAAI,EAAC,QAAQ,EACb,SAAS,EAAE,EAAE,CAAC,aAAa,EAAE,MAAM,IAAI,qBAAqB,CAAC,kBAC/C,MAAM,EACpB,QAAQ,EAAE,QAAQ,EAClB,OAAO,EAAE,GAAG,EAAE,CAAC,MAAM,CAAC,KAAK,CAAC,aAE3B,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,eAAM,SAAS,EAAC,mBAAmB,YAAE,IAAI,CAAC,IAAI,GAAQ,CAAC,CAAC,CAAC,IAAI,EACzE,IAAI,CAAC,KAAK,KARN,KAAK,CASF,CACT,CAAA;QACF,CAAC,CAAC,GACG,CACN,CAAA;AACF,CAAC"}
@@ -0,0 +1,42 @@
1
+ /**
2
+ * @copyright Sister Software
3
+ * @license AGPL-3.0
4
+ * @author Teffen Ellis, et al.
5
+ *
6
+ * `<MapCompass>` — the needle that appears when the map leaves north and fades out when it returns.
7
+ *
8
+ * It is a compass ROSE, the way the reference map apps draw it: a ringed dial carrying a two-tone needle whose red
9
+ * half points north and whose pale half points south. A single-color arrow cannot say which end is north, so a
10
+ * reader has to already know the convention to read it; two tones say it outright. There is no `N` on the dial —
11
+ * at this size the letter and the needle's north tip want the same few pixels, and the tip is the clearer of them.
12
+ *
13
+ * The whole dial counter-rotates the bearing, so the needle keeps pointing at true north while the map turns under
14
+ * it. Pressing it returns the map to north, which is why the control is a button rather than an ornament.
15
+ *
16
+ * It stays mounted through the fade rather than unmounting on the bearing crossing zero, because a control that
17
+ * vanishes mid-gesture is the thing that reads as a glitch. `HIDE_BELOW_DEGREES` is the dead zone: a map settled by
18
+ * a snap-to-north lands a fraction off zero, and a compass that lingers over that fraction never goes away.
19
+ *
20
+ * Under `prefers-reduced-motion` it appears and disappears with no transition, and the dial still rotates —
21
+ * rotation IS the information, not decoration.
22
+ *
23
+ * NODE-SAFE: pure React, no maplibre. The host reads the bearing off its own map and passes it in.
24
+ */
25
+ import type { ReactNode } from "react";
26
+ export interface MapCompassProps {
27
+ /**
28
+ * The map's bearing in degrees, as MapLibre reports it: 0 is north, positive is counter-clockwise.
29
+ */
30
+ bearing: number;
31
+ /**
32
+ * Fired when the compass is pressed — the host resets its map to north.
33
+ */
34
+ onResetNorth: () => void;
35
+ /**
36
+ * The control's accessible name. @default "Reset bearing to north"
37
+ */
38
+ label?: string;
39
+ className?: string;
40
+ }
41
+ export declare function MapCompass({ bearing, onResetNorth, label, className }: MapCompassProps): ReactNode;
42
+ //# sourceMappingURL=MapCompass.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"MapCompass.d.ts","sourceRoot":"","sources":["../../lib/map/MapCompass.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAStC,MAAM,WAAW,eAAe;IAC/B;;OAEG;IACH,OAAO,EAAE,MAAM,CAAA;IACf;;OAEG;IACH,YAAY,EAAE,MAAM,IAAI,CAAA;IACxB;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,SAAS,CAAC,EAAE,MAAM,CAAA;CAClB;AAED,wBAAgB,UAAU,CAAC,EAAE,OAAO,EAAE,YAAY,EAAE,KAAK,EAAE,SAAS,EAAE,EAAE,eAAe,GAAG,SAAS,CA0BlG"}
@@ -0,0 +1,11 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { cx } from "#common/cx";
3
+ /**
4
+ * Below this many degrees off north the compass is treated as pointing north and fades out.
5
+ */
6
+ const HIDE_BELOW_DEGREES = 0.5;
7
+ export function MapCompass({ bearing, onResetNorth, label, className }) {
8
+ const facingNorth = Math.abs(bearing) < HIDE_BELOW_DEGREES;
9
+ return (_jsx("button", { type: "button", className: cx("mw-map-compass", facingNorth && "mw-map-compass--north", className), "aria-label": label ?? "Reset bearing to north", title: label ?? "Reset bearing to north", "aria-hidden": facingNorth, tabIndex: facingNorth ? -1 : 0, onClick: onResetNorth, children: _jsx("svg", { viewBox: "0 0 32 32", width: "26", height: "26", "aria-hidden": "true", focusable: "false", children: _jsxs("g", { style: { transform: `rotate(${-bearing}deg)`, transformOrigin: "16px 16px" }, children: [_jsx("circle", { cx: "16", cy: "16", r: "12.5", className: "mw-map-compass__dial" }), _jsx("path", { d: "M16 5.5 L20.5 16 L16 16 Z M16 5.5 L11.5 16 L16 16 Z", className: "mw-map-compass__north" }), _jsx("path", { d: "M16 26.5 L20.5 16 L16 16 Z M16 26.5 L11.5 16 L16 16 Z", className: "mw-map-compass__south" })] }) }) }));
10
+ }
11
+ //# sourceMappingURL=MapCompass.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"MapCompass.js","sourceRoot":"","sources":["../../lib/map/MapCompass.tsx"],"names":[],"mappings":";AA2BA,OAAO,EAAE,EAAE,EAAE,MAAM,YAAY,CAAA;AAE/B;;GAEG;AACH,MAAM,kBAAkB,GAAG,GAAG,CAAA;AAkB9B,MAAM,UAAU,UAAU,CAAC,EAAE,OAAO,EAAE,YAAY,EAAE,KAAK,EAAE,SAAS,EAAmB;IACtF,MAAM,WAAW,GAAG,IAAI,CAAC,GAAG,CAAC,OAAO,CAAC,GAAG,kBAAkB,CAAA;IAE1D,OAAO,CACN,iBACC,IAAI,EAAC,QAAQ,EACb,SAAS,EAAE,EAAE,CAAC,gBAAgB,EAAE,WAAW,IAAI,uBAAuB,EAAE,SAAS,CAAC,gBACtE,KAAK,IAAI,wBAAwB,EAC7C,KAAK,EAAE,KAAK,IAAI,wBAAwB,iBAG3B,WAAW,EACxB,QAAQ,EAAE,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAC9B,OAAO,EAAE,YAAY,YAErB,cAAK,OAAO,EAAC,WAAW,EAAC,KAAK,EAAC,IAAI,EAAC,MAAM,EAAC,IAAI,iBAAa,MAAM,EAAC,SAAS,EAAC,OAAO,YACnF,aAAG,KAAK,EAAE,EAAE,SAAS,EAAE,UAAU,CAAC,OAAO,MAAM,EAAE,eAAe,EAAE,WAAW,EAAE,aAC9E,iBAAQ,EAAE,EAAC,IAAI,EAAC,EAAE,EAAC,IAAI,EAAC,CAAC,EAAC,MAAM,EAAC,SAAS,EAAC,sBAAsB,GAAG,EAGpE,eAAM,CAAC,EAAC,qDAAqD,EAAC,SAAS,EAAC,uBAAuB,GAAG,EAClG,eAAM,CAAC,EAAC,uDAAuD,EAAC,SAAS,EAAC,uBAAuB,GAAG,IACjG,GACC,GACE,CACT,CAAA;AACF,CAAC"}
@@ -0,0 +1,57 @@
1
+ /**
2
+ * @copyright Sister Software
3
+ * @license AGPL-3.0
4
+ * @author Teffen Ellis, et al.
5
+ *
6
+ * `<MapControlStack>` — the column of map controls down one edge, and `<MapControlButton>`, the control inside it.
7
+ *
8
+ * Controls sit in GROUPS: a group is one glass capsule with hairlines between its buttons, and separate groups are
9
+ * separate capsules with a gap. That grouping is the whole layout idea — related controls read as one object, and
10
+ * an unrelated one (a compass that comes and goes) does not join a capsule it would resize.
11
+ *
12
+ * NODE-SAFE: pure React, no maplibre.
13
+ */
14
+ import type { ReactNode } from "react";
15
+ export interface MapControlButtonProps {
16
+ /**
17
+ * The mark inside the control — an SVG icon or a single glyph.
18
+ */
19
+ children: ReactNode;
20
+ /**
21
+ * The control's accessible name. Required: the visible content is a mark, not a word.
22
+ */
23
+ label: string;
24
+ onPress: () => void;
25
+ /**
26
+ * Reads as active, for a control that toggles a layer or a mode.
27
+ */
28
+ active?: boolean;
29
+ disabled?: boolean;
30
+ className?: string;
31
+ }
32
+ export declare function MapControlButton({ children, label, onPress, active, disabled, className, }: MapControlButtonProps): ReactNode;
33
+ export interface MapControlGroupProps {
34
+ children: ReactNode;
35
+ className?: string;
36
+ }
37
+ /**
38
+ * One capsule. Put related controls in the same group; give an unrelated one its own.
39
+ */
40
+ export declare function MapControlGroup({ children, className }: MapControlGroupProps): ReactNode;
41
+ export interface MapControlStackProps {
42
+ /**
43
+ * Groups, top to bottom.
44
+ */
45
+ children: ReactNode;
46
+ /**
47
+ * Which edge the column sits against. @default "right"
48
+ */
49
+ side?: "left" | "right";
50
+ className?: string;
51
+ /**
52
+ * Accessible name for the column, e.g. "Map controls".
53
+ */
54
+ label?: string;
55
+ }
56
+ export declare function MapControlStack({ children, side, className, label }: MapControlStackProps): ReactNode;
57
+ //# sourceMappingURL=MapControlStack.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"MapControlStack.d.ts","sourceRoot":"","sources":["../../lib/map/MapControlStack.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAItC,MAAM,WAAW,qBAAqB;IACrC;;OAEG;IACH,QAAQ,EAAE,SAAS,CAAA;IACnB;;OAEG;IACH,KAAK,EAAE,MAAM,CAAA;IACb,OAAO,EAAE,MAAM,IAAI,CAAA;IACnB;;OAEG;IACH,MAAM,CAAC,EAAE,OAAO,CAAA;IAChB,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,SAAS,CAAC,EAAE,MAAM,CAAA;CAClB;AAED,wBAAgB,gBAAgB,CAAC,EAChC,QAAQ,EACR,KAAK,EACL,OAAO,EACP,MAAM,EACN,QAAQ,EACR,SAAS,GACT,EAAE,qBAAqB,GAAG,SAAS,CAcnC;AAED,MAAM,WAAW,oBAAoB;IACpC,QAAQ,EAAE,SAAS,CAAA;IACnB,SAAS,CAAC,EAAE,MAAM,CAAA;CAClB;AAED;;GAEG;AACH,wBAAgB,eAAe,CAAC,EAAE,QAAQ,EAAE,SAAS,EAAE,EAAE,oBAAoB,GAAG,SAAS,CAExF;AAED,MAAM,WAAW,oBAAoB;IACpC;;OAEG;IACH,QAAQ,EAAE,SAAS,CAAA;IACnB;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,GAAG,OAAO,CAAA;IACvB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAA;CACd;AAED,wBAAgB,eAAe,CAAC,EAAE,QAAQ,EAAE,IAAc,EAAE,SAAS,EAAE,KAAK,EAAE,EAAE,oBAAoB,GAAG,SAAS,CAU/G"}
@@ -0,0 +1,15 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { cx } from "#common/cx";
3
+ export function MapControlButton({ children, label, onPress, active, disabled, className, }) {
4
+ return (_jsx("button", { type: "button", className: cx("mw-map-control", active && "mw-map-control--active", className), "aria-label": label, "aria-pressed": active, title: label, disabled: disabled, onClick: onPress, children: children }));
5
+ }
6
+ /**
7
+ * One capsule. Put related controls in the same group; give an unrelated one its own.
8
+ */
9
+ export function MapControlGroup({ children, className }) {
10
+ return _jsx("div", { className: cx("mw-map-control-group", className), children: children });
11
+ }
12
+ export function MapControlStack({ children, side = "right", className, label }) {
13
+ return (_jsx("div", { className: cx("mw-map-control-stack", `mw-map-control-stack--${side}`, className), role: "group", "aria-label": label, children: children }));
14
+ }
15
+ //# sourceMappingURL=MapControlStack.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"MapControlStack.js","sourceRoot":"","sources":["../../lib/map/MapControlStack.tsx"],"names":[],"mappings":";AAgBA,OAAO,EAAE,EAAE,EAAE,MAAM,YAAY,CAAA;AAoB/B,MAAM,UAAU,gBAAgB,CAAC,EAChC,QAAQ,EACR,KAAK,EACL,OAAO,EACP,MAAM,EACN,QAAQ,EACR,SAAS,GACc;IACvB,OAAO,CACN,iBACC,IAAI,EAAC,QAAQ,EACb,SAAS,EAAE,EAAE,CAAC,gBAAgB,EAAE,MAAM,IAAI,wBAAwB,EAAE,SAAS,CAAC,gBAClE,KAAK,kBACH,MAAM,EACpB,KAAK,EAAE,KAAK,EACZ,QAAQ,EAAE,QAAQ,EAClB,OAAO,EAAE,OAAO,YAEf,QAAQ,GACD,CACT,CAAA;AACF,CAAC;AAOD;;GAEG;AACH,MAAM,UAAU,eAAe,CAAC,EAAE,QAAQ,EAAE,SAAS,EAAwB;IAC5E,OAAO,cAAK,SAAS,EAAE,EAAE,CAAC,sBAAsB,EAAE,SAAS,CAAC,YAAG,QAAQ,GAAO,CAAA;AAC/E,CAAC;AAkBD,MAAM,UAAU,eAAe,CAAC,EAAE,QAAQ,EAAE,IAAI,GAAG,OAAO,EAAE,SAAS,EAAE,KAAK,EAAwB;IACnG,OAAO,CACN,cACC,SAAS,EAAE,EAAE,CAAC,sBAAsB,EAAE,yBAAyB,IAAI,EAAE,EAAE,SAAS,CAAC,EACjF,IAAI,EAAC,OAAO,gBACA,KAAK,YAEhB,QAAQ,GACJ,CACN,CAAA;AACF,CAAC"}
@@ -0,0 +1,40 @@
1
+ /**
2
+ * @copyright Sister Software
3
+ * @license AGPL-3.0
4
+ * @author Teffen Ellis, et al.
5
+ *
6
+ * `<MapFooter>` — the strip along the bottom of a map: identity and load status on the left, an attribution button
7
+ * on the right.
8
+ *
9
+ * Attribution is a licence obligation for every source these apps draw, so it is a first-class slot rather than
10
+ * something an app remembers to add. It sits behind a button because the strip has to stay ONE line: spelled out, the
11
+ * credits ran three lines deep on a phone and covered the sheet above them. The button names the obligation, and
12
+ * pressing it shows every credit — which is the treatment the reference map apps use.
13
+ *
14
+ * The status slot is where the loader says WHAT it is fetching while the bar at the top of the viewport says how far
15
+ * along it is.
16
+ *
17
+ * NODE-SAFE: pure React, no maplibre.
18
+ */
19
+ import { type ReactNode } from "react";
20
+ export interface MapFooterProps {
21
+ /**
22
+ * The left side: a wordmark, a body name, a line saying what the page does.
23
+ */
24
+ identity?: ReactNode;
25
+ /**
26
+ * Beside the identity: what is loading right now. Absent when nothing is.
27
+ */
28
+ status?: ReactNode;
29
+ /**
30
+ * The credits, one entry per source. Shown in the popover the attribution button opens.
31
+ */
32
+ attribution?: ReactNode[];
33
+ /**
34
+ * What the attribution button reads. @default "Sources"
35
+ */
36
+ attributionLabel?: string;
37
+ className?: string;
38
+ }
39
+ export declare function MapFooter({ identity, status, attribution, attributionLabel, className, }: MapFooterProps): ReactNode;
40
+ //# sourceMappingURL=MapFooter.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"MapFooter.d.ts","sourceRoot":"","sources":["../../lib/map/MapFooter.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH,OAAO,EAAE,KAAK,SAAS,EAAsC,MAAM,OAAO,CAAA;AAI1E,MAAM,WAAW,cAAc;IAC9B;;OAEG;IACH,QAAQ,CAAC,EAAE,SAAS,CAAA;IACpB;;OAEG;IACH,MAAM,CAAC,EAAE,SAAS,CAAA;IAClB;;OAEG;IACH,WAAW,CAAC,EAAE,SAAS,EAAE,CAAA;IACzB;;OAEG;IACH,gBAAgB,CAAC,EAAE,MAAM,CAAA;IACzB,SAAS,CAAC,EAAE,MAAM,CAAA;CAClB;AAED,wBAAgB,SAAS,CAAC,EACzB,QAAQ,EACR,MAAM,EACN,WAAW,EACX,gBAA4B,EAC5B,SAAS,GACT,EAAE,cAAc,GAAG,SAAS,CAiE5B"}
@@ -0,0 +1,51 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ /**
3
+ * @copyright Sister Software
4
+ * @license AGPL-3.0
5
+ * @author Teffen Ellis, et al.
6
+ *
7
+ * `<MapFooter>` — the strip along the bottom of a map: identity and load status on the left, an attribution button
8
+ * on the right.
9
+ *
10
+ * Attribution is a licence obligation for every source these apps draw, so it is a first-class slot rather than
11
+ * something an app remembers to add. It sits behind a button because the strip has to stay ONE line: spelled out, the
12
+ * credits ran three lines deep on a phone and covered the sheet above them. The button names the obligation, and
13
+ * pressing it shows every credit — which is the treatment the reference map apps use.
14
+ *
15
+ * The status slot is where the loader says WHAT it is fetching while the bar at the top of the viewport says how far
16
+ * along it is.
17
+ *
18
+ * NODE-SAFE: pure React, no maplibre.
19
+ */
20
+ import { useEffect, useId, useRef, useState } from "react";
21
+ import { cx } from "#common/cx";
22
+ export function MapFooter({ identity, status, attribution, attributionLabel = "Sources", className, }) {
23
+ const [open, setOpen] = useState(false);
24
+ const popoverID = useId();
25
+ const root = useRef(null);
26
+ // A popover closes when the conversation moves elsewhere: a press outside it, or Escape.
27
+ useEffect(() => {
28
+ if (!open)
29
+ return;
30
+ const onPointerDown = (event) => {
31
+ if (!root.current?.contains(event.target)) {
32
+ setOpen(false);
33
+ }
34
+ };
35
+ const onKeyDown = (event) => {
36
+ if (event.key === "Escape") {
37
+ setOpen(false);
38
+ }
39
+ };
40
+ document.addEventListener("pointerdown", onPointerDown);
41
+ document.addEventListener("keydown", onKeyDown);
42
+ return () => {
43
+ document.removeEventListener("pointerdown", onPointerDown);
44
+ document.removeEventListener("keydown", onKeyDown);
45
+ };
46
+ }, [open]);
47
+ if (!identity && !status && !attribution?.length)
48
+ return null;
49
+ return (_jsxs("footer", { className: cx("mw-map-footer", className), ref: root, children: [_jsxs("div", { className: "mw-map-footer__identity", children: [identity, status ? _jsx("span", { className: "mw-map-footer__status", children: status }) : null] }), attribution?.length ? (_jsxs("div", { className: "mw-map-footer__sources", children: [open ? (_jsx("div", { className: "mw-map-footer__popover", id: popoverID, role: "group", "aria-label": "Map data sources", children: attribution.map((entry, index) => (_jsx("span", { className: "mw-map-footer__credit", children: entry }, index))) })) : null, _jsx("button", { type: "button", className: "mw-map-footer__attribution-button", "aria-expanded": open, "aria-controls": open ? popoverID : undefined, onClick: () => setOpen((value) => !value), children: attributionLabel })] })) : null] }));
50
+ }
51
+ //# sourceMappingURL=MapFooter.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"MapFooter.js","sourceRoot":"","sources":["../../lib/map/MapFooter.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH,OAAO,EAAkB,SAAS,EAAE,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,C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AI,CAAA;IAE7D,OAAO,CACN,kBAAQ,SAAS,EAAE,EAAE,CAAC,eAAe,EAAE,SAAS,CAAC,EAAE,GAAG,EAAE,IAAI,aAC3D,eAAK,SAAS,EAAC,yBAAyB,aACtC,QAAQ,EACR,MAAM,CAAC,CAAC,CAAC,eAAM,SAAS,EAAC,uBAAuB,YAAE,MAAM,GAAQ,CAAC,CAAC,CAAC,IAAI,IACnE,EAEL,WAAW,EAAE,MAAM,CAAC,CAAC,CAAC,CACtB,eAAK,SAAS,EAAC,wBAAwB,aACrC,IAAI,CAAC,CAAC,CAAC,CACP,cAAK,SAAS,EAAC,wBAAwB,EAAC,EAAE,EAAE,SAAS,EAAE,IAAI,EAAC,OAAO,gBAAY,kBAAkB,YAC/F,WAAW,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,KAAK,EAAE,EAAE,CAAC,CAElC,eAAkB,SAAS,EAAC,uBAAuB,YACjD,KAAK,IADI,KAAK,CAET,CACP,CAAC,GACG,CACN,CAAC,CAAC,CAAC,IAAI,EAER,iBACC,IAAI,EAAC,QAAQ,EACb,SAAS,EAAC,mCAAmC,mBAC9B,IAAI,mBACJ,IAAI,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,SAAS,EAC3C,OAAO,EAAE,GAAG,EAAE,CAAC,OAAO,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC,KAAK,CAAC,YAExC,gBAAgB,GACT,IACJ,CACN,CAAC,CAAC,CAAC,IAAI,IACA,CACT,CAAA;AACF,CAAC"}
@@ -0,0 +1,34 @@
1
+ /**
2
+ * @copyright Sister Software
3
+ * @license AGPL-3.0
4
+ * @author Teffen Ellis, et al.
5
+ *
6
+ * `<MapProgressBar>` — the loading bar pinned across the top of the viewport.
7
+ *
8
+ * Loading a 38 MB model is a page-level event, not a control-level one, so it reports at the page's edge rather than
9
+ * inside the search field: a spinner in the field resizes the one control a visitor is trying to type into, and a
10
+ * staged list in the result sheet claims the space an answer will need.
11
+ *
12
+ * It reports a FRACTION when the loader names its steps and runs indeterminate when it does not, because a bar that
13
+ * invents a percentage is worse than one that admits it is only saying "still working".
14
+ *
15
+ * NODE-SAFE: pure React, no maplibre.
16
+ */
17
+ import type { ReactNode } from "react";
18
+ export interface MapProgressBarProps {
19
+ /**
20
+ * Whether the bar is showing at all. It stays mounted through its fade rather than unmounting on the transition.
21
+ */
22
+ active: boolean;
23
+ /**
24
+ * Completed steps over total steps, in [0, 1]. Omit for work whose length is unknown.
25
+ */
26
+ fraction?: number | null;
27
+ /**
28
+ * The bar's accessible name — what is loading, in a few words.
29
+ */
30
+ label: string;
31
+ className?: string;
32
+ }
33
+ export declare function MapProgressBar({ active, fraction, label, className }: MapProgressBarProps): ReactNode;
34
+ //# sourceMappingURL=MapProgressBar.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"MapProgressBar.d.ts","sourceRoot":"","sources":["../../lib/map/MapProgressBar.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAItC,MAAM,WAAW,mBAAmB;IACnC;;OAEG;IACH,MAAM,EAAE,OAAO,CAAA;IACf;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IACxB;;OAEG;IACH,KAAK,EAAE,MAAM,CAAA;IACb,SAAS,CAAC,EAAE,MAAM,CAAA;CAClB;AAED,wBAAgB,cAAc,CAAC,EAAE,MAAM,EAAE,QAAQ,EAAE,KAAK,EAAE,SAAS,EAAE,EAAE,mBAAmB,GAAG,SAAS,CAoBrG"}
@@ -0,0 +1,8 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { cx } from "#common/cx";
3
+ export function MapProgressBar({ active, fraction, label, className }) {
4
+ const determinate = typeof fraction === "number" && Number.isFinite(fraction);
5
+ const clamped = determinate ? Math.min(1, Math.max(0, fraction)) : 0;
6
+ return (_jsx("div", { className: cx("mw-map-progress", !active && "mw-map-progress--idle", className), role: "progressbar", "aria-label": label, "aria-hidden": !active, "aria-valuemin": determinate ? 0 : undefined, "aria-valuemax": determinate ? 100 : undefined, "aria-valuenow": determinate ? Math.round(clamped * 100) : undefined, children: _jsx("div", { className: cx("mw-map-progress__fill", !determinate && "mw-map-progress__fill--indeterminate"), style: determinate ? { transform: `scaleX(${clamped})` } : undefined }) }));
7
+ }
8
+ //# sourceMappingURL=MapProgressBar.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"MapProgressBar.js","sourceRoot":"","sources":["../../lib/map/MapProgressBar.tsx"],"names":[],"mappings":";AAmBA,OAAO,EAAE,EAAE,EAAE,MAAM,YAAY,CAAA;AAkB/B,MAAM,UAAU,cAAc,CAAC,EAAE,MAAM,EAAE,QAAQ,EAAE,KAAK,EAAE,SAAS,EAAuB;IACzF,MAAM,WAAW,GAAG,OAAO,QAAQ,KAAK,QAAQ,IAAI,MAAM,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAA;IAC7E,MAAM,OAAO,GAAG,WAAW,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;IAEpE,OAAO,CACN,cACC,SAAS,EAAE,EAAE,CAAC,iBAAiB,EAAE,CAAC,MAAM,IAAI,uBAAuB,EAAE,SAAS,CAAC,EAC/E,IAAI,EAAC,aAAa,gBACN,KAAK,iBACJ,CAAC,MAAM,mBACL,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,mBAC3B,WAAW,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,SAAS,mBAC7B,WAAW,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,OAAO,GAAG,GAAG,CAAC,CAAC,CAAC,CAAC,SAAS,YAElE,cACC,SAAS,EAAE,EAAE,CAAC,uBAAuB,EAAE,CAAC,WAAW,IAAI,sCAAsC,CAAC,EAC9F,KAAK,EAAE,WAAW,CAAC,CAAC,CAAC,EAAE,SAAS,EAAE,UAAU,OAAO,GAAG,EAAE,CAAC,CAAC,CAAC,SAAS,GACnE,GACG,CACN,CAAA;AACF,CAAC"}
@@ -0,0 +1,49 @@
1
+ /**
2
+ * @copyright Sister Software
3
+ * @license AGPL-3.0
4
+ * @author Teffen Ellis, et al.
5
+ *
6
+ * `<MapSearchBar>` — the floating search pill that sits over a map. Presentational only: it supplies the glass
7
+ * material, the pill shape and the two icon slots, and the host supplies the input and whatever backend answers it.
8
+ * Earth searches an address through the geocoder runtime and the planetary apps search a nomenclature artifact, so
9
+ * nothing about the query belongs here.
10
+ *
11
+ * The slots are elements rather than icon names because a leading mark and a trailing control differ per app — a
12
+ * magnifier on one, a body glyph on another.
13
+ *
14
+ * BUSY IS A LINE, NOT A SLOT. A spinner placed in the trailing slot changed the pill's height on every submit,
15
+ * because a slot is laid out and an indicator is not part of the query. `busy` draws a hairline across the pill's
16
+ * lower edge instead, which costs no layout. A host that wants `type="search"` also gets the browser's own clear
17
+ * button in that corner, and two crosses side by side is one control too many.
18
+ *
19
+ * NODE-SAFE: pure React, no maplibre.
20
+ */
21
+ import type { ReactNode } from "react";
22
+ export interface MapSearchBarProps {
23
+ /**
24
+ * The input (or combobox) the host owns. Rendered between the two slots.
25
+ */
26
+ children: ReactNode;
27
+ /**
28
+ * Rendered before the input — a magnifier, a body mark, a back arrow.
29
+ */
30
+ leading?: ReactNode;
31
+ /**
32
+ * Rendered after the input — a microphone, a menu. Not a spinner: pass {@link busy} instead.
33
+ */
34
+ trailing?: ReactNode;
35
+ /**
36
+ * A query is running. Draws a progress hairline along the pill's lower edge, which takes no layout.
37
+ */
38
+ busy?: boolean;
39
+ /**
40
+ * Extra class on the pill.
41
+ */
42
+ className?: string;
43
+ /**
44
+ * Accessible name for the surrounding region, when the bar is the app's primary search.
45
+ */
46
+ label?: string;
47
+ }
48
+ export declare function MapSearchBar({ children, leading, trailing, busy, className, label }: MapSearchBarProps): ReactNode;
49
+ //# sourceMappingURL=MapSearchBar.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"MapSearchBar.d.ts","sourceRoot":"","sources":["../../lib/map/MapSearchBar.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAItC,MAAM,WAAW,iBAAiB;IACjC;;OAEG;IACH,QAAQ,EAAE,SAAS,CAAA;IACnB;;OAEG;IACH,OAAO,CAAC,EAAE,SAAS,CAAA;IACnB;;OAEG;IACH,QAAQ,CAAC,EAAE,SAAS,CAAA;IACpB;;OAEG;IACH,IAAI,CAAC,EAAE,OAAO,CAAA;IACd;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAA;CACd;AAED,wBAAgB,YAAY,CAAC,EAAE,QAAQ,EAAE,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,SAAS,EAAE,KAAK,EAAE,EAAE,iBAAiB,GAAG,SAAS,CAelH"}
@@ -0,0 +1,6 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { cx } from "#common/cx";
3
+ export function MapSearchBar({ children, leading, trailing, busy, className, label }) {
4
+ return (_jsxs("div", { className: cx("mw-map-searchbar", busy && "mw-map-searchbar--busy", className), role: label ? "search" : undefined, "aria-label": label, "aria-busy": busy, children: [leading ? _jsx("span", { className: "mw-map-searchbar__slot mw-map-searchbar__slot--leading", children: leading }) : null, _jsx("span", { className: "mw-map-searchbar__field", children: children }), trailing ? _jsx("span", { className: "mw-map-searchbar__slot mw-map-searchbar__slot--trailing", children: trailing }) : null] }));
5
+ }
6
+ //# sourceMappingURL=MapSearchBar.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"MapSearchBar.js","sourceRoot":"","sources":["../../lib/map/MapSearchBar.tsx"],"names":[],"mappings":";AAuBA,OAAO,EAAE,EAAE,EAAE,MAAM,YAAY,CAAA;AA6B/B,MAAM,UAAU,YAAY,CAAC,EAAE,QAAQ,EAAE,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,SAAS,EAAE,KAAK,EAAqB;IACtG,OAAO,CACN,eACC,SAAS,EAAE,EAAE,CAAC,kBAAkB,EAAE,IAAI,IAAI,wBAAwB,EAAE,SAAS,CAAC,EAC9E,IAAI,EAAE,KAAK,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,SAAS,gBACtB,KAAK,eACN,IAAI,aAEd,OAAO,CAAC,CAAC,CAAC,eAAM,SAAS,EAAC,wDAAwD,YAAE,OAAO,GAAQ,CAAC,CAAC,CAAC,IAAI,EAE3G,eAAM,SAAS,EAAC,yBAAyB,YAAE,QAAQ,GAAQ,EAE1D,QAAQ,CAAC,CAAC,CAAC,eAAM,SAAS,EAAC,yDAAyD,YAAE,QAAQ,GAAQ,CAAC,CAAC,CAAC,IAAI,IACzG,CACN,CAAA;AACF,CAAC"}
@@ -0,0 +1,32 @@
1
+ /**
2
+ * @copyright Sister Software
3
+ * @license AGPL-3.0
4
+ * @author Teffen Ellis, et al.
5
+ *
6
+ * `<MapSheet>` — a side panel over the map: a title, a close button, and content.
7
+ *
8
+ * The close button is not optional. On a wide screen the control that opened the sheet stays visible beside it and
9
+ * could close it again, but on a phone the sheet is the whole panel and covers that control — so a sheet without its
10
+ * own close is a sheet a phone cannot dismiss. One component carries it so the four sheets in these apps cannot
11
+ * disagree about that.
12
+ *
13
+ * Escape closes it too, because a panel over the whole screen is a modal in every way that matters to someone
14
+ * holding a keyboard.
15
+ *
16
+ * NODE-SAFE: pure React, no maplibre.
17
+ */
18
+ import { type ReactNode } from "react";
19
+ export interface MapSheetProps {
20
+ /**
21
+ * The sheet's heading, and its accessible name.
22
+ */
23
+ title: string;
24
+ /**
25
+ * Dismiss the sheet.
26
+ */
27
+ onClose: () => void;
28
+ children: ReactNode;
29
+ className?: string;
30
+ }
31
+ export declare function MapSheet({ title, onClose, children, className }: MapSheetProps): ReactNode;
32
+ //# sourceMappingURL=MapSheet.d.ts.map