@mailwoman/react 9.4.0 → 10.1.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.
- package/README.md +17 -16
- package/fonts.css +97 -22
- package/lib/common/About.tsx +87 -71
- package/lib/common/ClientOnly.tsx +2 -14
- package/lib/common/CopyButton.tsx +3 -1
- package/lib/common/LoadingIndicator.tsx +4 -2
- package/lib/common/PresetChips.tsx +9 -8
- package/lib/common/confidence-tiers.ts +7 -6
- package/lib/common/cx.ts +3 -1
- package/lib/common/text-tokens.ts +7 -4
- package/lib/common/useBuildInfo.ts +54 -0
- package/lib/common/useClipboard.ts +2 -11
- package/lib/common.ts +22 -0
- package/lib/index.ts +27 -112
- package/lib/map/AppIdentity.tsx +85 -0
- package/lib/map/BackendControl.tsx +16 -13
- package/lib/map/CompareToggle.tsx +11 -33
- package/lib/map/DebugInfo.tsx +88 -0
- package/lib/map/Geocoder.tsx +92 -58
- package/lib/map/GeocoderControls.tsx +582 -127
- package/lib/map/GraticuleLayer.tsx +54 -0
- package/lib/map/MapCanvas.tsx +23 -12
- package/lib/map/MapChipRow.tsx +73 -0
- package/lib/map/MapCompass.tsx +68 -0
- package/lib/map/MapControlStack.tsx +97 -0
- package/lib/map/MapFooter.tsx +101 -0
- package/lib/map/MapProgressBar.tsx +55 -0
- package/lib/map/MapSearchBar.tsx +82 -0
- package/lib/map/MapSheet.tsx +71 -0
- package/lib/map/OverlayLayers.tsx +1 -1
- package/lib/map/PlaceAutocomplete.tsx +10 -21
- package/lib/map/PlaceMarker.tsx +4 -2
- package/lib/map/ResolvedPlaceLayers.tsx +5 -14
- package/lib/map/ResultCamera.tsx +8 -31
- package/lib/map/ResultOverlay.tsx +2 -12
- package/lib/map/ResultPanel.tsx +1 -20
- package/lib/map/VersionPicker.tsx +10 -19
- package/lib/map/fake-runtime.ts +10 -12
- package/lib/map/geometry.ts +14 -47
- package/lib/map/graticule.ts +80 -0
- package/lib/map/map-debug.ts +1 -1
- package/lib/map/place-render.ts +28 -60
- package/lib/map/types.ts +65 -97
- package/lib/map/useCompareState.ts +5 -4
- package/lib/map/useGeocode.ts +7 -5
- package/lib/map/useMapBearing.ts +56 -0
- package/lib/map/useMapLabelPick.ts +114 -0
- package/lib/map/useMapPlaceRender.ts +2 -6
- package/lib/map/usePlaceAutocomplete.ts +44 -50
- package/lib/map.ts +95 -0
- package/lib/pipeline/CandidatePicker.tsx +13 -5
- package/lib/pipeline/ConfidenceCell.tsx +1 -1
- package/lib/pipeline/FailureDiagnostic.tsx +8 -2
- package/lib/pipeline/QueryForm.tsx +5 -2
- package/lib/pipeline/ResolvedPlace.tsx +1 -1
- package/lib/pipeline/SpanHighlight.tsx +7 -5
- package/lib/pipeline/TimingPanel.tsx +1 -1
- package/lib/pipeline/TreeView.tsx +1 -1
- package/lib/pipeline/copy.ts +22 -25
- package/lib/pipeline/presets.ts +15 -13
- package/lib/pipeline/types.ts +21 -14
- package/lib/pipeline/useParsePipeline.ts +38 -24
- package/lib/pipeline.ts +36 -0
- package/lib/poi/AbstainPanel.tsx +1 -1
- package/lib/poi/LiveResultsBlock.tsx +2 -1
- package/lib/poi/POIExplorer.tsx +24 -15
- package/lib/poi/QueryInput.tsx +1 -1
- package/lib/poi/SubjectPanel.tsx +4 -3
- package/lib/poi/runtime.ts +5 -16
- package/lib/poi/types.ts +39 -27
- package/lib/poi/usePOISearch.ts +39 -44
- package/lib/poi.ts +39 -0
- package/lib/runtime/useReleaseRuntime.ts +125 -74
- package/lib/runtime.ts +16 -0
- package/lib/search/SearchModal.tsx +317 -0
- package/lib/search/search.css +144 -0
- package/lib/search/types.ts +67 -0
- package/lib/search.ts +11 -0
- package/out/common/About.d.ts +13 -4
- package/out/common/About.d.ts.map +1 -1
- package/out/common/About.js +5 -2
- package/out/common/About.js.map +1 -1
- package/out/common/ClientOnly.d.ts +2 -11
- package/out/common/ClientOnly.d.ts.map +1 -1
- package/out/common/ClientOnly.js +1 -13
- package/out/common/ClientOnly.js.map +1 -1
- package/out/common/CopyButton.d.ts +3 -1
- package/out/common/CopyButton.d.ts.map +1 -1
- package/out/common/CopyButton.js.map +1 -1
- package/out/common/LoadingIndicator.d.ts +4 -2
- package/out/common/LoadingIndicator.d.ts.map +1 -1
- package/out/common/LoadingIndicator.js.map +1 -1
- package/out/common/PresetChips.d.ts +9 -8
- package/out/common/PresetChips.d.ts.map +1 -1
- package/out/common/PresetChips.js.map +1 -1
- package/out/common/confidence-tiers.d.ts +7 -6
- package/out/common/confidence-tiers.d.ts.map +1 -1
- package/out/common/confidence-tiers.js +7 -6
- package/out/common/confidence-tiers.js.map +1 -1
- package/out/common/cx.d.ts +3 -1
- package/out/common/cx.d.ts.map +1 -1
- package/out/common/cx.js +3 -1
- package/out/common/cx.js.map +1 -1
- package/out/common/text-tokens.d.ts +4 -3
- package/out/common/text-tokens.d.ts.map +1 -1
- package/out/common/text-tokens.js +6 -3
- package/out/common/text-tokens.js.map +1 -1
- package/out/common/useBuildInfo.d.ts +27 -0
- package/out/common/useBuildInfo.d.ts.map +1 -0
- package/out/common/useBuildInfo.js +32 -0
- package/out/common/useBuildInfo.js.map +1 -0
- package/out/common/useClipboard.d.ts +1 -3
- package/out/common/useClipboard.d.ts.map +1 -1
- package/out/common/useClipboard.js +2 -11
- package/out/common/useClipboard.js.map +1 -1
- package/out/common.d.ts +22 -0
- package/out/common.d.ts.map +1 -0
- package/out/common.js +15 -0
- package/out/common.js.map +1 -0
- package/out/index.d.ts +26 -71
- package/out/index.d.ts.map +1 -1
- package/out/index.js +21 -47
- package/out/index.js.map +1 -1
- package/out/map/AppIdentity.d.ts +42 -0
- package/out/map/AppIdentity.d.ts.map +1 -0
- package/out/map/AppIdentity.js +16 -0
- package/out/map/AppIdentity.js.map +1 -0
- package/out/map/BackendControl.d.ts +9 -10
- package/out/map/BackendControl.d.ts.map +1 -1
- package/out/map/BackendControl.js +2 -2
- package/out/map/BackendControl.js.map +1 -1
- package/out/map/CompareToggle.d.ts +8 -31
- package/out/map/CompareToggle.d.ts.map +1 -1
- package/out/map/CompareToggle.js +5 -2
- package/out/map/CompareToggle.js.map +1 -1
- package/out/map/DebugInfo.d.ts +34 -0
- package/out/map/DebugInfo.d.ts.map +1 -0
- package/out/map/DebugInfo.js +39 -0
- package/out/map/DebugInfo.js.map +1 -0
- package/out/map/Geocoder.d.ts +47 -26
- package/out/map/Geocoder.d.ts.map +1 -1
- package/out/map/Geocoder.js +34 -50
- package/out/map/Geocoder.js.map +1 -1
- package/out/map/GeocoderControls.d.ts +23 -33
- package/out/map/GeocoderControls.d.ts.map +1 -1
- package/out/map/GeocoderControls.js +277 -16
- package/out/map/GeocoderControls.js.map +1 -1
- package/out/map/GraticuleLayer.d.ts +28 -0
- package/out/map/GraticuleLayer.d.ts.map +1 -0
- package/out/map/GraticuleLayer.js +25 -0
- package/out/map/GraticuleLayer.js.map +1 -0
- package/out/map/MapCanvas.d.ts +23 -12
- package/out/map/MapCanvas.d.ts.map +1 -1
- package/out/map/MapCanvas.js +5 -2
- package/out/map/MapCanvas.js.map +1 -1
- package/out/map/MapChipRow.d.ts +43 -0
- package/out/map/MapChipRow.d.ts.map +1 -0
- package/out/map/MapChipRow.js +12 -0
- package/out/map/MapChipRow.js.map +1 -0
- package/out/map/MapCompass.d.ts +33 -0
- package/out/map/MapCompass.d.ts.map +1 -0
- package/out/map/MapCompass.js +15 -0
- package/out/map/MapCompass.js.map +1 -0
- package/out/map/MapControlStack.d.ts +56 -0
- package/out/map/MapControlStack.d.ts.map +1 -0
- package/out/map/MapControlStack.js +18 -0
- package/out/map/MapControlStack.js.map +1 -0
- package/out/map/MapFooter.d.ts +27 -0
- package/out/map/MapFooter.d.ts.map +1 -0
- package/out/map/MapFooter.js +37 -0
- package/out/map/MapFooter.js.map +1 -0
- package/out/map/MapProgressBar.d.ts +31 -0
- package/out/map/MapProgressBar.d.ts.map +1 -0
- package/out/map/MapProgressBar.js +8 -0
- package/out/map/MapProgressBar.js.map +1 -0
- package/out/map/MapSearchBar.d.ts +48 -0
- package/out/map/MapSearchBar.d.ts.map +1 -0
- package/out/map/MapSearchBar.js +12 -0
- package/out/map/MapSearchBar.js.map +1 -0
- package/out/map/MapSheet.d.ts +35 -0
- package/out/map/MapSheet.d.ts.map +1 -0
- package/out/map/MapSheet.js +29 -0
- package/out/map/MapSheet.js.map +1 -0
- package/out/map/OverlayLayers.d.ts +1 -1
- package/out/map/OverlayLayers.js +2 -2
- package/out/map/PlaceAutocomplete.d.ts +10 -21
- package/out/map/PlaceAutocomplete.d.ts.map +1 -1
- package/out/map/PlaceAutocomplete.js +2 -1
- package/out/map/PlaceAutocomplete.js.map +1 -1
- package/out/map/PlaceMarker.d.ts +4 -2
- package/out/map/PlaceMarker.d.ts.map +1 -1
- package/out/map/PlaceMarker.js +3 -1
- package/out/map/PlaceMarker.js.map +1 -1
- package/out/map/ResolvedPlaceLayers.d.ts +5 -14
- package/out/map/ResolvedPlaceLayers.d.ts.map +1 -1
- package/out/map/ResolvedPlaceLayers.js +2 -2
- package/out/map/ResolvedPlaceLayers.js.map +1 -1
- package/out/map/ResultCamera.d.ts +8 -31
- package/out/map/ResultCamera.d.ts.map +1 -1
- package/out/map/ResultCamera.js +3 -28
- package/out/map/ResultCamera.js.map +1 -1
- package/out/map/ResultOverlay.d.ts +2 -12
- package/out/map/ResultOverlay.d.ts.map +1 -1
- package/out/map/ResultOverlay.js +1 -2
- package/out/map/ResultOverlay.js.map +1 -1
- package/out/map/ResultPanel.d.ts +1 -20
- package/out/map/ResultPanel.d.ts.map +1 -1
- package/out/map/ResultPanel.js +1 -1
- package/out/map/ResultPanel.js.map +1 -1
- package/out/map/VersionPicker.d.ts +7 -19
- package/out/map/VersionPicker.d.ts.map +1 -1
- package/out/map/VersionPicker.js +5 -2
- package/out/map/VersionPicker.js.map +1 -1
- package/out/map/fake-runtime.d.ts +9 -11
- package/out/map/fake-runtime.d.ts.map +1 -1
- package/out/map/fake-runtime.js +9 -12
- package/out/map/fake-runtime.js.map +1 -1
- package/out/map/geometry.d.ts +13 -34
- package/out/map/geometry.d.ts.map +1 -1
- package/out/map/geometry.js +9 -34
- package/out/map/geometry.js.map +1 -1
- package/out/map/graticule.d.ts +17 -0
- package/out/map/graticule.d.ts.map +1 -0
- package/out/map/graticule.js +67 -0
- package/out/map/graticule.js.map +1 -0
- package/out/map/map-debug.d.ts +1 -1
- package/out/map/map-debug.d.ts.map +1 -1
- package/out/map/map-debug.js +1 -1
- package/out/map/map-debug.js.map +1 -1
- package/out/map/place-render.d.ts +23 -43
- package/out/map/place-render.d.ts.map +1 -1
- package/out/map/place-render.js +4 -39
- package/out/map/place-render.js.map +1 -1
- package/out/map/types.d.ts +67 -95
- package/out/map/types.d.ts.map +1 -1
- package/out/map/types.js +1 -10
- package/out/map/types.js.map +1 -1
- package/out/map/useCompareState.d.ts +5 -4
- package/out/map/useCompareState.d.ts.map +1 -1
- package/out/map/useCompareState.js +3 -3
- package/out/map/useCompareState.js.map +1 -1
- package/out/map/useGeocode.d.ts +5 -3
- package/out/map/useGeocode.d.ts.map +1 -1
- package/out/map/useGeocode.js +4 -4
- package/out/map/useGeocode.js.map +1 -1
- package/out/map/useMapBearing.d.ts +28 -0
- package/out/map/useMapBearing.d.ts.map +1 -0
- package/out/map/useMapBearing.js +30 -0
- package/out/map/useMapBearing.js.map +1 -0
- package/out/map/useMapLabelPick.d.ts +13 -0
- package/out/map/useMapLabelPick.d.ts.map +1 -0
- package/out/map/useMapLabelPick.js +95 -0
- package/out/map/useMapLabelPick.js.map +1 -0
- package/out/map/useMapPlaceRender.d.ts +2 -6
- package/out/map/useMapPlaceRender.d.ts.map +1 -1
- package/out/map/useMapPlaceRender.js +2 -6
- package/out/map/useMapPlaceRender.js.map +1 -1
- package/out/map/usePlaceAutocomplete.d.ts +30 -28
- package/out/map/usePlaceAutocomplete.d.ts.map +1 -1
- package/out/map/usePlaceAutocomplete.js +6 -33
- package/out/map/usePlaceAutocomplete.js.map +1 -1
- package/out/map.d.ts +69 -0
- package/out/map.d.ts.map +1 -0
- package/out/map.js +46 -0
- package/out/map.js.map +1 -0
- package/out/pipeline/CandidatePicker.d.ts +12 -2
- package/out/pipeline/CandidatePicker.d.ts.map +1 -1
- package/out/pipeline/CandidatePicker.js +2 -2
- package/out/pipeline/CandidatePicker.js.map +1 -1
- package/out/pipeline/ConfidenceCell.d.ts +1 -1
- package/out/pipeline/ConfidenceCell.js +1 -1
- package/out/pipeline/FailureDiagnostic.d.ts +8 -2
- package/out/pipeline/FailureDiagnostic.d.ts.map +1 -1
- package/out/pipeline/FailureDiagnostic.js +3 -0
- package/out/pipeline/FailureDiagnostic.js.map +1 -1
- package/out/pipeline/PipelineExplorer.js +1 -1
- package/out/pipeline/QueryForm.d.ts +5 -2
- package/out/pipeline/QueryForm.d.ts.map +1 -1
- package/out/pipeline/QueryForm.js +1 -1
- package/out/pipeline/QueryForm.js.map +1 -1
- package/out/pipeline/ResolvedPlace.js +1 -1
- package/out/pipeline/SpanHighlight.d.ts +4 -3
- package/out/pipeline/SpanHighlight.d.ts.map +1 -1
- package/out/pipeline/SpanHighlight.js +3 -2
- package/out/pipeline/SpanHighlight.js.map +1 -1
- package/out/pipeline/TimingPanel.d.ts +1 -1
- package/out/pipeline/TimingPanel.js +1 -1
- package/out/pipeline/TreeView.d.ts +1 -1
- package/out/pipeline/copy.d.ts +1 -1
- package/out/pipeline/copy.d.ts.map +1 -1
- package/out/pipeline/copy.js +4 -3
- package/out/pipeline/copy.js.map +1 -1
- package/out/pipeline/presets.d.ts +5 -4
- package/out/pipeline/presets.d.ts.map +1 -1
- package/out/pipeline/presets.js +15 -13
- package/out/pipeline/presets.js.map +1 -1
- package/out/pipeline/types.d.ts +21 -14
- package/out/pipeline/types.d.ts.map +1 -1
- package/out/pipeline/types.js +2 -4
- package/out/pipeline/types.js.map +1 -1
- package/out/pipeline/useParsePipeline.d.ts +15 -7
- package/out/pipeline/useParsePipeline.d.ts.map +1 -1
- package/out/pipeline/useParsePipeline.js +10 -7
- package/out/pipeline/useParsePipeline.js.map +1 -1
- package/out/pipeline.d.ts +33 -0
- package/out/pipeline.d.ts.map +1 -0
- package/out/pipeline.js +21 -0
- package/out/pipeline.js.map +1 -0
- package/out/poi/AbstainPanel.d.ts +1 -1
- package/out/poi/LiveResultsBlock.d.ts +2 -1
- package/out/poi/LiveResultsBlock.d.ts.map +1 -1
- package/out/poi/LiveResultsBlock.js +1 -1
- package/out/poi/LiveResultsBlock.js.map +1 -1
- package/out/poi/POIExplorer.d.ts +22 -12
- package/out/poi/POIExplorer.d.ts.map +1 -1
- package/out/poi/POIExplorer.js +10 -9
- package/out/poi/POIExplorer.js.map +1 -1
- package/out/poi/QueryInput.d.ts +1 -1
- package/out/poi/SubjectPanel.d.ts +2 -2
- package/out/poi/SubjectPanel.d.ts.map +1 -1
- package/out/poi/SubjectPanel.js +3 -2
- package/out/poi/SubjectPanel.js.map +1 -1
- package/out/poi/runtime.d.ts +5 -14
- package/out/poi/runtime.d.ts.map +1 -1
- package/out/poi/runtime.js +5 -16
- package/out/poi/runtime.js.map +1 -1
- package/out/poi/types.d.ts +39 -27
- package/out/poi/types.d.ts.map +1 -1
- package/out/poi/types.js +2 -4
- package/out/poi/types.js.map +1 -1
- package/out/poi/usePOISearch.d.ts +28 -17
- package/out/poi/usePOISearch.d.ts.map +1 -1
- package/out/poi/usePOISearch.js +6 -32
- package/out/poi/usePOISearch.js.map +1 -1
- package/out/poi.d.ts +23 -0
- package/out/poi.d.ts.map +1 -0
- package/out/poi.js +15 -0
- package/out/poi.js.map +1 -0
- package/out/runtime/useReleaseRuntime.d.ts +64 -65
- package/out/runtime/useReleaseRuntime.d.ts.map +1 -1
- package/out/runtime/useReleaseRuntime.js +31 -26
- package/out/runtime/useReleaseRuntime.js.map +1 -1
- package/out/runtime.d.ts +9 -0
- package/out/runtime.d.ts.map +1 -0
- package/out/runtime.js +8 -0
- package/out/runtime.js.map +1 -0
- package/out/search/SearchModal.d.ts +33 -0
- package/out/search/SearchModal.d.ts.map +1 -0
- package/out/search/SearchModal.js +187 -0
- package/out/search/SearchModal.js.map +1 -0
- package/out/search/types.d.ts +64 -0
- package/out/search/types.d.ts.map +1 -0
- package/out/search/types.js +13 -0
- package/out/search/types.js.map +1 -0
- package/out/search.d.ts +11 -0
- package/out/search.d.ts.map +1 -0
- package/out/search.js +9 -0
- package/out/search.js.map +1 -0
- package/package.json +132 -133
- package/styles.css +1340 -202
- package/tokens/index.css +26 -7
- package/tokens/tokens.json +121 -6
- package/tokens/tokens.resolver.json +1 -1
- package/lib/map/index.ts +0 -76
- package/out/map/index.d.ts +0 -52
- package/out/map/index.d.ts.map +0 -1
- package/out/map/index.js +0 -36
- package/out/map/index.js.map +0 -1
- package/styleframe.config.ts +0 -321
- package/vitest.node.config.ts +0 -20
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @copyright Sister Software
|
|
3
|
+
* @license AGPL-3.0
|
|
4
|
+
* @author Teffen Ellis, et al.
|
|
5
|
+
*
|
|
6
|
+
* Draws a grid of meridians and parallels under the basemap so that the globe is readable while
|
|
7
|
+
* tiles load. Loaded tiles cover the grid.
|
|
8
|
+
*/
|
|
9
|
+
import { type ReactNode } from "react";
|
|
10
|
+
/**
|
|
11
|
+
* Props for {@link GraticuleLayer}.
|
|
12
|
+
*/
|
|
13
|
+
export interface GraticuleLayerProps {
|
|
14
|
+
/**
|
|
15
|
+
* The basemap layer to draw the grid beneath.
|
|
16
|
+
* Without it, the grid is drawn on top.
|
|
17
|
+
*/
|
|
18
|
+
beforeID?: string;
|
|
19
|
+
/**
|
|
20
|
+
* Hides the grid. @default false
|
|
21
|
+
*/
|
|
22
|
+
hidden?: boolean;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Renders the graticule source and line layer.
|
|
26
|
+
*/
|
|
27
|
+
export declare function GraticuleLayer({ beforeID, hidden }: GraticuleLayerProps): ReactNode;
|
|
28
|
+
//# sourceMappingURL=GraticuleLayer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"GraticuleLayer.d.ts","sourceRoot":"","sources":["../../lib/map/GraticuleLayer.tsx"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,KAAK,SAAS,EAAW,MAAM,OAAO,CAAA;AAK/C;;GAEG;AACH,MAAM,WAAW,mBAAmB;IACnC;;;OAGG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB;;OAEG;IACH,MAAM,CAAC,EAAE,OAAO,CAAA;CAChB;AAED;;GAEG;AACH,wBAAgB,cAAc,CAAC,EAAE,QAAQ,EAAE,MAAc,EAAE,EAAE,mBAAmB,GAAG,SAAS,CAqB3F"}
|
|
@@ -0,0 +1,25 @@
|
|
|
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
|
+
* Draws a grid of meridians and parallels under the basemap so that the globe is readable while
|
|
8
|
+
* tiles load. Loaded tiles cover the grid.
|
|
9
|
+
*/
|
|
10
|
+
import { useMemo } from "react";
|
|
11
|
+
import { Layer, Source } from "react-map-gl/maplibre";
|
|
12
|
+
import { buildGraticule } from "./graticule.js";
|
|
13
|
+
/**
|
|
14
|
+
* Renders the graticule source and line layer.
|
|
15
|
+
*/
|
|
16
|
+
export function GraticuleLayer({ beforeID, hidden = false }) {
|
|
17
|
+
const data = useMemo(() => buildGraticule(), []);
|
|
18
|
+
return (_jsxs(_Fragment, { children: [_jsx(Source, { id: "mw-graticule", type: "geojson", data: data }), _jsx(Layer, { id: "mw-graticule-line", type: "line", source: "mw-graticule", ...(beforeID ? { beforeId: beforeID } : {}), layout: { visibility: hidden ? "none" : "visible", "line-cap": "round" }, paint: {
|
|
19
|
+
"line-color": "#8aa0c8",
|
|
20
|
+
// The grid fades out by zoom 8, where map detail makes it unnecessary.
|
|
21
|
+
"line-opacity": ["interpolate", ["linear"], ["zoom"], 0, 0.3, 3, 0.2, 6, 0.09, 8, 0],
|
|
22
|
+
"line-width": ["interpolate", ["linear"], ["zoom"], 0, 0.5, 4, 0.75],
|
|
23
|
+
} })] }));
|
|
24
|
+
}
|
|
25
|
+
//# sourceMappingURL=GraticuleLayer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"GraticuleLayer.js","sourceRoot":"","sources":["../../lib/map/GraticuleLayer.tsx"],"names":[],"mappings":";AAAA;;;;;;;GAOG;AAEH,OAAO,EAAkB,OAAO,EAAE,MAAM,OAAO,CAAA;AAC/C,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAA;AAErD,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAA;AAiB/C;;GAEG;AACH,MAAM,UAAU,cAAc,CAAC,EAAE,QAAQ,EAAE,MAAM,GAAG,KAAK,EAAuB;IAC/E,MAAM,IAAI,GAAG,OAAO,CAAC,GAAG,EAAE,CAAC,cAAc,EAAE,EAAE,EAAE,CAAC,CAAA;IAEhD,OAAO,CACN,8BACC,KAAC,MAAM,IAAC,EAAE,EAAC,cAAc,EAAC,IAAI,EAAC,SAAS,EAAC,IAAI,EAAE,IAAI,GAAI,EACvD,KAAC,KAAK,IACL,EAAE,EAAC,mBAAmB,EACtB,IAAI,EAAC,MAAM,EACX,MAAM,EAAC,cAAc,KACjB,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,QAAQ,EAAE,QAAQ,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,EAC5C,MAAM,EAAE,EAAE,UAAU,EAAE,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS,EAAE,UAAU,EAAE,OAAO,EAAE,EACxE,KAAK,EAAE;oBACN,YAAY,EAAE,SAAS;oBACvB,uEAAuE;oBACvE,cAAc,EAAE,CAAC,aAAa,EAAE,CAAC,QAAQ,CAAC,EAAE,CAAC,MAAM,CAAC,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,CAAC,CAAC;oBACpF,YAAY,EAAE,CAAC,aAAa,EAAE,CAAC,QAAQ,CAAC,EAAE,CAAC,MAAM,CAAC,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,IAAI,CAAC;iBACpE,GACA,IACA,CACH,CAAA;AACF,CAAC"}
|
package/out/map/MapCanvas.d.ts
CHANGED
|
@@ -5,18 +5,18 @@
|
|
|
5
5
|
*
|
|
6
6
|
* `<MapCanvas>` — the declarative map shell for the geocoder demo, over `react-map-gl/maplibre` (v8).
|
|
7
7
|
* Phase 1 is the shell only: a `<Map>` that takes a host-composed `mapStyle`, an initial (or
|
|
8
|
-
* controlled) view state
|
|
8
|
+
* controlled) view state and a `children` slot for overlays/markers from later phases.
|
|
9
9
|
* No overlay/marker/camera logic lives here yet.
|
|
10
10
|
*
|
|
11
|
-
*
|
|
12
|
-
* + DOM at import) at module scope, so it is reachable
|
|
11
|
+
* node-import safety: this module imports `react-map-gl/maplibre` (which pulls `maplibre-gl` — WebGL
|
|
12
|
+
* + DOM at import) at module scope, so it is reachable only through the `@mailwoman/react/map`
|
|
13
13
|
* subpath, never from the package root (`index.ts`). The bare `import("@mailwoman/react")` a node
|
|
14
14
|
* consumer (or the CI smoke IMPORT_CHECK) runs must never transitively load this file. Keep it out of
|
|
15
15
|
* the root barrel.
|
|
16
16
|
*
|
|
17
17
|
* CSS: the package imports no CSS from its modules (the node-safe invariant), so a host that renders
|
|
18
18
|
* `<MapCanvas>` must import `maplibre-gl/dist/maplibre-gl.css` itself (plus `@mailwoman/react/styles.css`
|
|
19
|
-
* for the `.mw-demo-map` container). `<MapCanvas>` is intrinsically a client component
|
|
19
|
+
* for the `.mw-demo-map` container). `<MapCanvas>` is intrinsically a client component. A host that
|
|
20
20
|
* server-renders should wrap it in a client boundary (the package's `ClientOnly`), exactly as the
|
|
21
21
|
* composed `Geocoder` will in a later phase.
|
|
22
22
|
*/
|
|
@@ -27,8 +27,10 @@ import type { MapProps, MapRef, ViewStateChangeEvent } from "react-map-gl/maplib
|
|
|
27
27
|
*/
|
|
28
28
|
export type MapCanvasStyle = NonNullable<MapProps["mapStyle"]>;
|
|
29
29
|
/**
|
|
30
|
-
* Override for the `<Map>` props `<MapCanvas>` does not surface explicitly
|
|
31
|
-
* `maplibreLogo`).
|
|
30
|
+
* Override for the `<Map>` props `<MapCanvas>` does not surface explicitly
|
|
31
|
+
* (e.g. `minZoom`, `attributionControl`, `maplibreLogo`).
|
|
32
|
+
*
|
|
33
|
+
* The controlled fields MapCanvas owns are omitted so they can't be set twice.
|
|
32
34
|
*/
|
|
33
35
|
export type MapCanvasExtraProps = Partial<Omit<MapProps, "mapStyle" | "initialViewState" | "viewState" | "onMove" | "children" | "style" | "ref">>;
|
|
34
36
|
export interface MapCanvasProps {
|
|
@@ -37,11 +39,15 @@ export interface MapCanvasProps {
|
|
|
37
39
|
*/
|
|
38
40
|
mapStyle: MapCanvasStyle;
|
|
39
41
|
/**
|
|
40
|
-
* Uncontrolled initial camera.
|
|
42
|
+
* Uncontrolled initial camera.
|
|
43
|
+
*
|
|
44
|
+
* Use this or `viewState`, not both.
|
|
41
45
|
*/
|
|
42
46
|
initialViewState?: MapProps["initialViewState"];
|
|
43
47
|
/**
|
|
44
|
-
* Controlled camera.
|
|
48
|
+
* Controlled camera.
|
|
49
|
+
*
|
|
50
|
+
* Pair with `onMove` to persist it.
|
|
45
51
|
*/
|
|
46
52
|
viewState?: MapProps["viewState"];
|
|
47
53
|
/**
|
|
@@ -57,7 +63,9 @@ export interface MapCanvasProps {
|
|
|
57
63
|
*/
|
|
58
64
|
mapRef?: Ref<MapRef>;
|
|
59
65
|
/**
|
|
60
|
-
* Overlays, markers
|
|
66
|
+
* Overlays, markers and controls — rendered as `<Map>` children.
|
|
67
|
+
*
|
|
68
|
+
* Empty in phase 1.
|
|
61
69
|
*/
|
|
62
70
|
children?: ReactNode;
|
|
63
71
|
/**
|
|
@@ -69,13 +77,16 @@ export interface MapCanvasProps {
|
|
|
69
77
|
*/
|
|
70
78
|
style?: CSSProperties;
|
|
71
79
|
/**
|
|
72
|
-
*
|
|
80
|
+
* Other `<Map>` props that MapCanvas does not surface explicitly.
|
|
73
81
|
*/
|
|
74
82
|
mapProps?: MapCanvasExtraProps;
|
|
75
83
|
}
|
|
76
84
|
/**
|
|
77
|
-
* The controlled-viewport map shell.
|
|
78
|
-
*
|
|
85
|
+
* The controlled-viewport map shell.
|
|
86
|
+
*
|
|
87
|
+
* Renders a sized wrapper around a `react-map-gl/maplibre` `<Map>`; everything
|
|
88
|
+
* host-specific (the composed `mapStyle`, the initial center) is injected.
|
|
89
|
+
* Overlays arrive as `children`.
|
|
79
90
|
*/
|
|
80
91
|
export declare function MapCanvas({ mapStyle, initialViewState, viewState, onMove, projection, mapRef, children, className, style, mapProps, }: MapCanvasProps): ReactNode;
|
|
81
92
|
//# sourceMappingURL=MapCanvas.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MapCanvas.d.ts","sourceRoot":"","sources":["../../lib/map/MapCanvas.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,SAAS,EAAE,GAAG,EAAE,MAAM,OAAO,CAAA;AAE1D,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,EAAE,oBAAoB,EAAE,MAAM,uBAAuB,CAAA;AAEnF;;GAEG;AACH,MAAM,MAAM,cAAc,GAAG,WAAW,CAAC,QAAQ,CAAC,UAAU,CAAC,CAAC,CAAA;AAE9D
|
|
1
|
+
{"version":3,"file":"MapCanvas.d.ts","sourceRoot":"","sources":["../../lib/map/MapCanvas.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,OAAO,K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AAE,cAAc,GAAG,SAAS,CAmB5B"}
|
package/out/map/MapCanvas.js
CHANGED
|
@@ -2,8 +2,11 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
2
2
|
import { Map } from "react-map-gl/maplibre";
|
|
3
3
|
const FILL = { width: "100%", height: "100%" };
|
|
4
4
|
/**
|
|
5
|
-
* The controlled-viewport map shell.
|
|
6
|
-
*
|
|
5
|
+
* The controlled-viewport map shell.
|
|
6
|
+
*
|
|
7
|
+
* Renders a sized wrapper around a `react-map-gl/maplibre` `<Map>`; everything
|
|
8
|
+
* host-specific (the composed `mapStyle`, the initial center) is injected.
|
|
9
|
+
* Overlays arrive as `children`.
|
|
7
10
|
*/
|
|
8
11
|
export function MapCanvas({ mapStyle, initialViewState, viewState, onMove, projection = "globe", mapRef, children, className, style, mapProps, }) {
|
|
9
12
|
const wrapperClassName = className ? `mw-demo-map ${className}` : "mw-demo-map";
|
package/out/map/MapCanvas.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MapCanvas.js","sourceRoot":"","sources":["../../lib/map/MapCanvas.tsx"],"names":[],"mappings":";AAwBA,OAAO,EAAE,GAAG,EAAE,MAAM,uBAAuB,CAAA;
|
|
1
|
+
{"version":3,"file":"MapCanvas.js","sourceRoot":"","sources":["../../lib/map/MapCanvas.tsx"],"names":[],"mappings":";AAwBA,OAAO,EAAE,GAAG,EAAE,MAAM,uBAAuB,CAAA;AAmE3C,MAAM,IAAI,GAAkB,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,CAAA;AAE7D;;;;;;GAMG;AACH,MAAM,UAAU,SAAS,CAAC,EACzB,QAAQ,EACR,gBAAgB,EAChB,SAAS,EACT,MAAM,EACN,UAAU,GAAG,OAAO,EACpB,MAAM,EACN,QAAQ,EACR,SAAS,EACT,KAAK,EACL,QAAQ,GACQ;IAChB,MAAM,gBAAgB,GAAG,SAAS,CAAC,CAAC,CAAC,eAAe,SAAS,EAAE,CAAC,CAAC,CAAC,aAAa,CAAA;IAE/E,OAAO,CACN,cAAK,SAAS,EAAE,gBAAgB,EAAE,KAAK,EAAE,KAAK,YAC7C,KAAC,GAAG,OACC,QAAQ,EACZ,GAAG,EAAE,MAAM,EACX,QAAQ,EAAE,QAAQ,EAClB,gBAAgB,EAAE,gBAAgB,EAClC,SAAS,EAAE,SAAS,EACpB,MAAM,EAAE,MAAM,EACd,UAAU,EAAE,UAAU,EACtB,KAAK,EAAE,IAAI,YAEV,QAAQ,GACJ,GACD,CACN,CAAA;AACF,CAAC"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @copyright Sister Software
|
|
3
|
+
* @license AGPL-3.0
|
|
4
|
+
* @author Teffen Ellis, et al.
|
|
5
|
+
*
|
|
6
|
+
* Render example-query chips in a single horizontally scrollable row.
|
|
7
|
+
*/
|
|
8
|
+
import type { ReactNode } from "react";
|
|
9
|
+
export interface MapChip {
|
|
10
|
+
/**
|
|
11
|
+
* What the chip reads.
|
|
12
|
+
*/
|
|
13
|
+
label: string;
|
|
14
|
+
/**
|
|
15
|
+
* The query the chip stands for, handed back on press.
|
|
16
|
+
*
|
|
17
|
+
* Defaults to the label.
|
|
18
|
+
*/
|
|
19
|
+
value?: string;
|
|
20
|
+
/**
|
|
21
|
+
* Rendered before the label — a category mark.
|
|
22
|
+
*/
|
|
23
|
+
icon?: ReactNode;
|
|
24
|
+
}
|
|
25
|
+
export interface MapChipRowProps {
|
|
26
|
+
chips: MapChip[];
|
|
27
|
+
/**
|
|
28
|
+
* Fired with the chip's `value` (or its label) when one is pressed.
|
|
29
|
+
*/
|
|
30
|
+
onPick: (value: string) => void;
|
|
31
|
+
/**
|
|
32
|
+
* The chip matching this value reads as pressed.
|
|
33
|
+
*/
|
|
34
|
+
activeValue?: string;
|
|
35
|
+
disabled?: boolean;
|
|
36
|
+
className?: string;
|
|
37
|
+
/**
|
|
38
|
+
* Accessible name for the row, e.g. "Example addresses".
|
|
39
|
+
*/
|
|
40
|
+
label?: string;
|
|
41
|
+
}
|
|
42
|
+
export declare function MapChipRow({ chips, onPick, activeValue, disabled, className, label }: MapChipRowProps): ReactNode;
|
|
43
|
+
//# sourceMappingURL=MapChipRow.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MapChipRow.d.ts","sourceRoot":"","sources":["../../lib/map/MapChipRow.tsx"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAItC,MAAM,WAAW,OAAO;IACvB;;OAEG;IACH,KAAK,EAAE,MAAM,CAAA;IACb;;;;OAIG;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":";AAUA,OAAO,EAAE,EAAE,EAAE,MAAM,YAAY,CAAA;AAqC/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,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @copyright Sister Software
|
|
3
|
+
* @license AGPL-3.0
|
|
4
|
+
* @author Teffen Ellis, et al.
|
|
5
|
+
*
|
|
6
|
+
* Shows a compass that rotates with the map bearing and hides when the map faces north. A press
|
|
7
|
+
* it asks the host to reset the bearing.
|
|
8
|
+
*/
|
|
9
|
+
import type { ReactNode } from "react";
|
|
10
|
+
/**
|
|
11
|
+
* Props for {@link MapCompass}.
|
|
12
|
+
*/
|
|
13
|
+
export interface MapCompassProps {
|
|
14
|
+
/**
|
|
15
|
+
* The map's bearing in degrees as MapLibre reports it, where 0 is north.
|
|
16
|
+
*/
|
|
17
|
+
bearing: number;
|
|
18
|
+
/**
|
|
19
|
+
* Called when the compass is pressed.
|
|
20
|
+
* The host should reset its map to north.
|
|
21
|
+
*/
|
|
22
|
+
onResetNorth: () => void;
|
|
23
|
+
/**
|
|
24
|
+
* The control's accessible name. @default "Reset bearing to north"
|
|
25
|
+
*/
|
|
26
|
+
label?: string;
|
|
27
|
+
className?: string;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Renders the compass button.
|
|
31
|
+
*/
|
|
32
|
+
export declare function MapCompass({ bearing, onResetNorth, label, className }: MapCompassProps): ReactNode;
|
|
33
|
+
//# sourceMappingURL=MapCompass.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MapCompass.d.ts","sourceRoot":"","sources":["../../lib/map/MapCompass.tsx"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAUtC;;GAEG;AACH,MAAM,WAAW,eAAe;IAC/B;;OAEG;IACH,OAAO,EAAE,MAAM,CAAA;IACf;;;OAGG;IACH,YAAY,EAAE,MAAM,IAAI,CAAA;IACxB;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,SAAS,CAAC,EAAE,MAAM,CAAA;CAClB;AAED;;GAEG;AACH,wBAAgB,UAAU,CAAC,EAAE,OAAO,EAAE,YAAY,EAAE,KAAK,EAAE,SAAS,EAAE,EAAE,eAAe,GAAG,SAAS,CAyBlG"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { cx } from "#common/cx";
|
|
3
|
+
/**
|
|
4
|
+
* The compass counts as facing north below this bearing.
|
|
5
|
+
* It fades out below the same threshold.
|
|
6
|
+
*/
|
|
7
|
+
const HIDE_BELOW_DEGREES = 0.5;
|
|
8
|
+
/**
|
|
9
|
+
* Renders the compass button.
|
|
10
|
+
*/
|
|
11
|
+
export function MapCompass({ bearing, onResetNorth, label, className }) {
|
|
12
|
+
const facingNorth = Math.abs(bearing) < HIDE_BELOW_DEGREES;
|
|
13
|
+
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" })] }) }) }));
|
|
14
|
+
}
|
|
15
|
+
//# sourceMappingURL=MapCompass.js.map
|
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+
/**
|
|
2
|
+
* @copyright Sister Software
|
|
3
|
+
* @license AGPL-3.0
|
|
4
|
+
* @author Teffen Ellis, et al.
|
|
5
|
+
*
|
|
6
|
+
* Provide accessible map-control buttons arranged in grouped capsules.
|
|
7
|
+
*/
|
|
8
|
+
import type { ReactNode } from "react";
|
|
9
|
+
export interface MapControlButtonProps {
|
|
10
|
+
/**
|
|
11
|
+
* The mark inside the control — an SVG icon or a single glyph.
|
|
12
|
+
*/
|
|
13
|
+
children: ReactNode;
|
|
14
|
+
/**
|
|
15
|
+
* The control's accessible name.
|
|
16
|
+
*
|
|
17
|
+
* Required: the visible content is a mark rather than a word.
|
|
18
|
+
*/
|
|
19
|
+
label: string;
|
|
20
|
+
onPress: () => void;
|
|
21
|
+
/**
|
|
22
|
+
* Reads as active, for a control that toggles a layer or a mode.
|
|
23
|
+
*/
|
|
24
|
+
active?: boolean;
|
|
25
|
+
disabled?: boolean;
|
|
26
|
+
className?: string;
|
|
27
|
+
}
|
|
28
|
+
export declare function MapControlButton({ children, label, onPress, active, disabled, className, }: MapControlButtonProps): ReactNode;
|
|
29
|
+
export interface MapControlGroupProps {
|
|
30
|
+
children: ReactNode;
|
|
31
|
+
className?: string;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* One capsule.
|
|
35
|
+
*
|
|
36
|
+
* Put related controls in the same group.
|
|
37
|
+
* Give an unrelated one its own.
|
|
38
|
+
*/
|
|
39
|
+
export declare function MapControlGroup({ children, className }: MapControlGroupProps): ReactNode;
|
|
40
|
+
export interface MapControlStackProps {
|
|
41
|
+
/**
|
|
42
|
+
* Groups, top to bottom.
|
|
43
|
+
*/
|
|
44
|
+
children: ReactNode;
|
|
45
|
+
/**
|
|
46
|
+
* Which edge the column sits against. @default "right"
|
|
47
|
+
*/
|
|
48
|
+
side?: "left" | "right";
|
|
49
|
+
className?: string;
|
|
50
|
+
/**
|
|
51
|
+
* Accessible name for the column, e.g. "Map controls".
|
|
52
|
+
*/
|
|
53
|
+
label?: string;
|
|
54
|
+
}
|
|
55
|
+
export declare function MapControlStack({ children, side, className, label }: MapControlStackProps): ReactNode;
|
|
56
|
+
//# sourceMappingURL=MapControlStack.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MapControlStack.d.ts","sourceRoot":"","sources":["../../lib/map/MapControlStack.tsx"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAItC,MAAM,WAAW,qBAAqB;IACrC;;OAEG;IACH,QAAQ,EAAE,SAAS,CAAA;IACnB;;;;OAIG;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;;;;;GAKG;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,18 @@
|
|
|
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.
|
|
8
|
+
*
|
|
9
|
+
* Put related controls in the same group.
|
|
10
|
+
* Give an unrelated one its own.
|
|
11
|
+
*/
|
|
12
|
+
export function MapControlGroup({ children, className }) {
|
|
13
|
+
return _jsx("div", { className: cx("mw-map-control-group", className), children: children });
|
|
14
|
+
}
|
|
15
|
+
export function MapControlStack({ children, side = "right", className, label }) {
|
|
16
|
+
return (_jsx("div", { className: cx("mw-map-control-stack", `mw-map-control-stack--${side}`, className), role: "group", "aria-label": label, children: children }));
|
|
17
|
+
}
|
|
18
|
+
//# sourceMappingURL=MapControlStack.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MapControlStack.js","sourceRoot":"","sources":["../../lib/map/MapControlStack.tsx"],"names":[],"mappings":";AAUA,OAAO,EAAE,EAAE,EAAE,MAAM,YAAY,CAAA;AAsB/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;;;;;GAKG;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,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @copyright Sister Software
|
|
3
|
+
* @license AGPL-3.0
|
|
4
|
+
* @author Teffen Ellis, et al.
|
|
5
|
+
*/
|
|
6
|
+
import { type ReactNode } from "react";
|
|
7
|
+
export interface MapFooterProps {
|
|
8
|
+
/**
|
|
9
|
+
* The left side: a wordmark, a body name, a line saying what the page does.
|
|
10
|
+
*/
|
|
11
|
+
identity?: ReactNode;
|
|
12
|
+
/**
|
|
13
|
+
* What is loading right now, beside the identity.
|
|
14
|
+
*/
|
|
15
|
+
status?: ReactNode;
|
|
16
|
+
/**
|
|
17
|
+
* The credits, one entry per source, shown in the popover the attribution button opens.
|
|
18
|
+
*/
|
|
19
|
+
attribution?: ReactNode[];
|
|
20
|
+
/**
|
|
21
|
+
* What the attribution button reads. @default "Sources"
|
|
22
|
+
*/
|
|
23
|
+
attributionLabel?: string;
|
|
24
|
+
className?: string;
|
|
25
|
+
}
|
|
26
|
+
export declare function MapFooter({ identity, status, attribution, attributionLabel, className, }: MapFooterProps): ReactNode;
|
|
27
|
+
//# sourceMappingURL=MapFooter.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MapFooter.d.ts","sourceRoot":"","sources":["../../lib/map/MapFooter.tsx"],"names":[],"mappings":"AAAA;;;;GAIG;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,CAgE5B"}
|
|
@@ -0,0 +1,37 @@
|
|
|
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
|
+
import { useEffect, useId, useRef, useState } from "react";
|
|
8
|
+
import { cx } from "#common/cx";
|
|
9
|
+
export function MapFooter({ identity, status, attribution, attributionLabel = "Sources", className, }) {
|
|
10
|
+
const [open, setOpen] = useState(false);
|
|
11
|
+
const popoverID = useId();
|
|
12
|
+
const root = useRef(null);
|
|
13
|
+
useEffect(() => {
|
|
14
|
+
if (!open)
|
|
15
|
+
return;
|
|
16
|
+
const onPointerDown = (event) => {
|
|
17
|
+
if (!root.current?.contains(event.target)) {
|
|
18
|
+
setOpen(false);
|
|
19
|
+
}
|
|
20
|
+
};
|
|
21
|
+
const onKeyDown = (event) => {
|
|
22
|
+
if (event.key === "Escape") {
|
|
23
|
+
setOpen(false);
|
|
24
|
+
}
|
|
25
|
+
};
|
|
26
|
+
document.addEventListener("pointerdown", onPointerDown);
|
|
27
|
+
document.addEventListener("keydown", onKeyDown);
|
|
28
|
+
return () => {
|
|
29
|
+
document.removeEventListener("pointerdown", onPointerDown);
|
|
30
|
+
document.removeEventListener("keydown", onKeyDown);
|
|
31
|
+
};
|
|
32
|
+
}, [open]);
|
|
33
|
+
if (!identity && !status && !attribution?.length)
|
|
34
|
+
return null;
|
|
35
|
+
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] }));
|
|
36
|
+
}
|
|
37
|
+
//# sourceMappingURL=MapFooter.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MapFooter.js","sourceRoot":"","sources":["../../lib/map/MapFooter.tsx"],"names":[],"mappings":";AAAA;;;;GAIG;AAEH,OAAO,EAAkB,SAAS,EAAE,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AAE1E,OAAO,EAAE,EAAE,EAAE,MAAM,YAAY,CAAA;AAsB/B,MAAM,UAAU,SAAS,CAAC,EACzB,QAAQ,EACR,MAAM,EACN,WAAW,EACX,gBAAgB,GAAG,SAAS,EAC5B,SAAS,GACO;IAChB,MAAM,CAAC,IAAI,EAAE,OAAO,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAA;IACvC,MAAM,SAAS,GAAG,KAAK,EAAE,CAAA;IACzB,MAAM,IAAI,GAAG,MAAM,CAAc,IAAI,CAAC,CAAA;IAEt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AAC,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,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @copyright Sister Software
|
|
3
|
+
* @license AGPL-3.0
|
|
4
|
+
* @author Teffen Ellis, et al.
|
|
5
|
+
*
|
|
6
|
+
* Show loading progress at the top of the viewport.
|
|
7
|
+
* Use a determinate bar when progress is known, otherwise an indeterminate bar.
|
|
8
|
+
*/
|
|
9
|
+
import type { ReactNode } from "react";
|
|
10
|
+
export interface MapProgressBarProps {
|
|
11
|
+
/**
|
|
12
|
+
* Whether the bar is showing at all.
|
|
13
|
+
*
|
|
14
|
+
* It stays mounted through its fade rather than unmounting on the transition.
|
|
15
|
+
*/
|
|
16
|
+
active: boolean;
|
|
17
|
+
/**
|
|
18
|
+
* Completed steps over total steps, in [0, 1].
|
|
19
|
+
*
|
|
20
|
+
* Omit for work whose length is unknown.
|
|
21
|
+
*/
|
|
22
|
+
fraction?: number | null;
|
|
23
|
+
/**
|
|
24
|
+
* The bar's accessible name.
|
|
25
|
+
* What is loading, in a few words.
|
|
26
|
+
*/
|
|
27
|
+
label: string;
|
|
28
|
+
className?: string;
|
|
29
|
+
}
|
|
30
|
+
export declare function MapProgressBar({ active, fraction, label, className }: MapProgressBarProps): ReactNode;
|
|
31
|
+
//# sourceMappingURL=MapProgressBar.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MapProgressBar.d.ts","sourceRoot":"","sources":["../../lib/map/MapProgressBar.tsx"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAItC,MAAM,WAAW,mBAAmB;IACnC;;;;OAIG;IACH,MAAM,EAAE,OAAO,CAAA;IACf;;;;OAIG;IACH,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IACxB;;;OAGG;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
|
+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software
|
|
3
|
+
* @license AGPL-3.0
|
|
4
|
+
* @author Teffen Ellis, et al.
|
|
5
|
+
*
|
|
6
|
+
* Presentational search pill for map UIs. The host supplies the input and icons.
|
|
7
|
+
* Busy state uses a bottom-edge indicator to avoid changing the pill layout.
|
|
8
|
+
*/
|
|
9
|
+
import type { ReactNode } from "react";
|
|
10
|
+
/**
|
|
11
|
+
* Draw a consistently sized magnifier for the leading slot.
|
|
12
|
+
*/
|
|
13
|
+
export declare function SearchGlyph(): ReactNode;
|
|
14
|
+
export interface MapSearchBarProps {
|
|
15
|
+
/**
|
|
16
|
+
* The input (or combobox) the host owns.
|
|
17
|
+
*
|
|
18
|
+
* Rendered between the two slots.
|
|
19
|
+
*/
|
|
20
|
+
children: ReactNode;
|
|
21
|
+
/**
|
|
22
|
+
* Rendered before the input — a magnifier, a body mark, a back arrow.
|
|
23
|
+
*/
|
|
24
|
+
leading?: ReactNode;
|
|
25
|
+
/**
|
|
26
|
+
* Rendered after the input — a microphone, a menu.
|
|
27
|
+
*
|
|
28
|
+
* Not a spinner: pass {@link busy} instead.
|
|
29
|
+
*/
|
|
30
|
+
trailing?: ReactNode;
|
|
31
|
+
/**
|
|
32
|
+
* A query is running.
|
|
33
|
+
*
|
|
34
|
+
* Draws a progress hairline along the pill's lower edge.
|
|
35
|
+
* The hairline takes no layout space.
|
|
36
|
+
*/
|
|
37
|
+
busy?: boolean;
|
|
38
|
+
/**
|
|
39
|
+
* Extra class on the pill.
|
|
40
|
+
*/
|
|
41
|
+
className?: string;
|
|
42
|
+
/**
|
|
43
|
+
* Accessible name for the surrounding region, when the bar is the app's primary search.
|
|
44
|
+
*/
|
|
45
|
+
label?: string;
|
|
46
|
+
}
|
|
47
|
+
export declare function MapSearchBar({ children, leading, trailing, busy, className, label }: MapSearchBarProps): ReactNode;
|
|
48
|
+
//# sourceMappingURL=MapSearchBar.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MapSearchBar.d.ts","sourceRoot":"","sources":["../../lib/map/MapSearchBar.tsx"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAItC;;GAEG;AACH,wBAAgB,WAAW,IAAI,SAAS,CAcvC;AAED,MAAM,WAAW,iBAAiB;IACjC;;;;OAIG;IACH,QAAQ,EAAE,SAAS,CAAA;IACnB;;OAEG;IACH,OAAO,CAAC,EAAE,SAAS,CAAA;IACnB;;;;OAIG;IACH,QAAQ,CAAC,EAAE,SAAS,CAAA;IACpB;;;;;OAKG;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,12 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { cx } from "#common/cx";
|
|
3
|
+
/**
|
|
4
|
+
* Draw a consistently sized magnifier for the leading slot.
|
|
5
|
+
*/
|
|
6
|
+
export function SearchGlyph() {
|
|
7
|
+
return (_jsxs("svg", { viewBox: "0 0 20 20", width: "18", height: "18", "aria-hidden": "true", focusable: "false", className: "mw-map-searchbar__glyph", children: [_jsx("circle", { cx: "8.75", cy: "8.75", r: "5.5", fill: "none", stroke: "currentColor", strokeWidth: "1.8" }), _jsx("line", { x1: "12.9", y1: "12.9", x2: "17", y2: "17", stroke: "currentColor", strokeWidth: "1.8", strokeLinecap: "round" })] }));
|
|
8
|
+
}
|
|
9
|
+
export function MapSearchBar({ children, leading, trailing, busy, className, label }) {
|
|
10
|
+
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] }));
|
|
11
|
+
}
|
|
12
|
+
//# sourceMappingURL=MapSearchBar.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MapSearchBar.js","sourceRoot":"","sources":["../../lib/map/MapSearchBar.tsx"],"names":[],"mappings":";AAWA,OAAO,EAAE,EAAE,EAAE,MAAM,YAAY,CAAA;AAE/B;;GAEG;AACH,MAAM,UAAU,WAAW;IAC1B,OAAO,CACN,eACC,OAAO,EAAC,WAAW,EACnB,KAAK,EAAC,IAAI,EACV,MAAM,EAAC,IAAI,iBACC,MAAM,EAClB,SAAS,EAAC,OAAO,EACjB,SAAS,EAAC,yBAAyB,aAEnC,iBAAQ,EAAE,EAAC,MAAM,EAAC,EAAE,EAAC,MAAM,EAAC,CAAC,EAAC,KAAK,EAAC,IAAI,EAAC,MAAM,EAAC,MAAM,EAAC,cAAc,EAAC,WAAW,EAAC,KAAK,GAAG,EAC1F,eAAM,EAAE,EAAC,MAAM,EAAC,EAAE,EAAC,MAAM,EAAC,EAAE,EAAC,IAAI,EAAC,EAAE,EAAC,IAAI,EAAC,MAAM,EAAC,cAAc,EAAC,WAAW,EAAC,KAAK,EAAC,aAAa,EAAC,OAAO,GAAG,IACrG,CACN,CAAA;AACF,CAAC;AAoCD,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,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @copyright Sister Software
|
|
3
|
+
* @license AGPL-3.0
|
|
4
|
+
* @author Teffen Ellis, et al.
|
|
5
|
+
*
|
|
6
|
+
* Side panel over the map with a heading, close button and Escape dismissal.
|
|
7
|
+
*/
|
|
8
|
+
import { type ReactNode } from "react";
|
|
9
|
+
export interface SheetCloseProps {
|
|
10
|
+
/**
|
|
11
|
+
* What is being closed, for the accessible name: "Close the result", "Close About".
|
|
12
|
+
*/
|
|
13
|
+
label: string;
|
|
14
|
+
onClose: () => void;
|
|
15
|
+
className?: string;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Accessible button for dismissing a sheet.
|
|
19
|
+
*/
|
|
20
|
+
export declare function SheetClose({ label, onClose, className }: SheetCloseProps): ReactNode;
|
|
21
|
+
export interface MapSheetProps {
|
|
22
|
+
/**
|
|
23
|
+
* The sheet's heading.
|
|
24
|
+
* It also supplies the accessible name.
|
|
25
|
+
*/
|
|
26
|
+
title: string;
|
|
27
|
+
/**
|
|
28
|
+
* Dismiss the sheet.
|
|
29
|
+
*/
|
|
30
|
+
onClose: () => void;
|
|
31
|
+
children: ReactNode;
|
|
32
|
+
className?: string;
|
|
33
|
+
}
|
|
34
|
+
export declare function MapSheet({ title, onClose, children, className }: MapSheetProps): ReactNode;
|
|
35
|
+
//# sourceMappingURL=MapSheet.d.ts.map
|