panelui-native 0.22.5 → 0.25.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 (135) hide show
  1. package/README.md +8 -3
  2. package/lib/module/components/area-chart/index.js +826 -0
  3. package/lib/module/components/area-chart/index.js.map +1 -0
  4. package/lib/module/components/avatar/index.js +1 -1
  5. package/lib/module/components/avatar/index.js.map +1 -1
  6. package/lib/module/components/bar-chart/index.js +853 -0
  7. package/lib/module/components/bar-chart/index.js.map +1 -0
  8. package/lib/module/components/bottom-sheet/index.js +207 -23
  9. package/lib/module/components/bottom-sheet/index.js.map +1 -1
  10. package/lib/module/components/breadcrumb/index.js +275 -0
  11. package/lib/module/components/breadcrumb/index.js.map +1 -0
  12. package/lib/module/components/chip/index.js +2 -2
  13. package/lib/module/components/direction/index.js +13 -19
  14. package/lib/module/components/direction/index.js.map +1 -1
  15. package/lib/module/components/frame/index.js +17 -0
  16. package/lib/module/components/frame/index.js.map +1 -1
  17. package/lib/module/components/heatmap-chart/index.js +28 -8
  18. package/lib/module/components/heatmap-chart/index.js.map +1 -1
  19. package/lib/module/components/input-group/index.js +2 -2
  20. package/lib/module/components/input-group/index.js.map +1 -1
  21. package/lib/module/components/line-chart/index.js +4 -146
  22. package/lib/module/components/line-chart/index.js.map +1 -1
  23. package/lib/module/components/loader/index.js +758 -0
  24. package/lib/module/components/loader/index.js.map +1 -0
  25. package/lib/module/components/map/basemap.js +265 -0
  26. package/lib/module/components/map/basemap.js.map +1 -0
  27. package/lib/module/components/map/index.js +850 -0
  28. package/lib/module/components/map/index.js.map +1 -0
  29. package/lib/module/components/map/maplibre.js +87 -0
  30. package/lib/module/components/map/maplibre.js.map +1 -0
  31. package/lib/module/components/message/index.js +8 -7
  32. package/lib/module/components/message/index.js.map +1 -1
  33. package/lib/module/components/otp-input/index.js +2 -2
  34. package/lib/module/components/progress/index.js +8 -2
  35. package/lib/module/components/progress/index.js.map +1 -1
  36. package/lib/module/components/ring-chart/index.js +423 -0
  37. package/lib/module/components/ring-chart/index.js.map +1 -0
  38. package/lib/module/components/section-rail/index.js +2 -2
  39. package/lib/module/components/separator/index.js +76 -22
  40. package/lib/module/components/separator/index.js.map +1 -1
  41. package/lib/module/components/shimmer/index.js +10 -1
  42. package/lib/module/components/shimmer/index.js.map +1 -1
  43. package/lib/module/components/slider/index.js +19 -5
  44. package/lib/module/components/slider/index.js.map +1 -1
  45. package/lib/module/components/steps/index.js +1 -1
  46. package/lib/module/components/switch/index.js +6 -1
  47. package/lib/module/components/switch/index.js.map +1 -1
  48. package/lib/module/components/typography/index.js +5 -0
  49. package/lib/module/components/typography/index.js.map +1 -1
  50. package/lib/module/hooks/use-direction.js +43 -0
  51. package/lib/module/hooks/use-direction.js.map +1 -0
  52. package/lib/module/icons/index.js +117 -2
  53. package/lib/module/icons/index.js.map +1 -1
  54. package/lib/module/index.js +8 -2
  55. package/lib/module/index.js.map +1 -1
  56. package/lib/module/primitives/text.js +30 -10
  57. package/lib/module/primitives/text.js.map +1 -1
  58. package/lib/module/utils/chart.js +279 -0
  59. package/lib/module/utils/chart.js.map +1 -0
  60. package/lib/typescript/src/components/area-chart/index.d.ts +197 -0
  61. package/lib/typescript/src/components/area-chart/index.d.ts.map +1 -0
  62. package/lib/typescript/src/components/bar-chart/index.d.ts +228 -0
  63. package/lib/typescript/src/components/bar-chart/index.d.ts.map +1 -0
  64. package/lib/typescript/src/components/bottom-sheet/index.d.ts +75 -4
  65. package/lib/typescript/src/components/bottom-sheet/index.d.ts.map +1 -1
  66. package/lib/typescript/src/components/breadcrumb/index.d.ts +100 -0
  67. package/lib/typescript/src/components/breadcrumb/index.d.ts.map +1 -0
  68. package/lib/typescript/src/components/direction/index.d.ts +11 -10
  69. package/lib/typescript/src/components/direction/index.d.ts.map +1 -1
  70. package/lib/typescript/src/components/frame/index.d.ts +17 -0
  71. package/lib/typescript/src/components/frame/index.d.ts.map +1 -1
  72. package/lib/typescript/src/components/heatmap-chart/index.d.ts +22 -3
  73. package/lib/typescript/src/components/heatmap-chart/index.d.ts.map +1 -1
  74. package/lib/typescript/src/components/line-chart/index.d.ts +1 -0
  75. package/lib/typescript/src/components/line-chart/index.d.ts.map +1 -1
  76. package/lib/typescript/src/components/loader/index.d.ts +38 -0
  77. package/lib/typescript/src/components/loader/index.d.ts.map +1 -0
  78. package/lib/typescript/src/components/map/basemap.d.ts +76 -0
  79. package/lib/typescript/src/components/map/basemap.d.ts.map +1 -0
  80. package/lib/typescript/src/components/map/index.d.ts +367 -0
  81. package/lib/typescript/src/components/map/index.d.ts.map +1 -0
  82. package/lib/typescript/src/components/map/maplibre.d.ts +193 -0
  83. package/lib/typescript/src/components/map/maplibre.d.ts.map +1 -0
  84. package/lib/typescript/src/components/message/index.d.ts.map +1 -1
  85. package/lib/typescript/src/components/progress/index.d.ts.map +1 -1
  86. package/lib/typescript/src/components/ring-chart/index.d.ts +156 -0
  87. package/lib/typescript/src/components/ring-chart/index.d.ts.map +1 -0
  88. package/lib/typescript/src/components/separator/index.d.ts +36 -1
  89. package/lib/typescript/src/components/separator/index.d.ts.map +1 -1
  90. package/lib/typescript/src/components/shimmer/index.d.ts.map +1 -1
  91. package/lib/typescript/src/components/slider/index.d.ts.map +1 -1
  92. package/lib/typescript/src/components/switch/index.d.ts.map +1 -1
  93. package/lib/typescript/src/components/typography/index.d.ts +6 -0
  94. package/lib/typescript/src/components/typography/index.d.ts.map +1 -1
  95. package/lib/typescript/src/hooks/use-direction.d.ts +20 -0
  96. package/lib/typescript/src/hooks/use-direction.d.ts.map +1 -0
  97. package/lib/typescript/src/icons/index.d.ts +5 -0
  98. package/lib/typescript/src/icons/index.d.ts.map +1 -1
  99. package/lib/typescript/src/index.d.ts +9 -3
  100. package/lib/typescript/src/index.d.ts.map +1 -1
  101. package/lib/typescript/src/primitives/text.d.ts.map +1 -1
  102. package/lib/typescript/src/utils/chart.d.ts +96 -0
  103. package/lib/typescript/src/utils/chart.d.ts.map +1 -0
  104. package/package.json +9 -1
  105. package/src/components/area-chart/index.tsx +994 -0
  106. package/src/components/avatar/index.tsx +1 -1
  107. package/src/components/bar-chart/index.tsx +1048 -0
  108. package/src/components/bottom-sheet/index.tsx +280 -20
  109. package/src/components/breadcrumb/index.tsx +365 -0
  110. package/src/components/chip/index.tsx +2 -2
  111. package/src/components/direction/index.tsx +20 -21
  112. package/src/components/frame/index.tsx +17 -0
  113. package/src/components/heatmap-chart/index.tsx +58 -11
  114. package/src/components/input-group/index.tsx +2 -2
  115. package/src/components/line-chart/index.tsx +13 -181
  116. package/src/components/loader/index.tsx +812 -0
  117. package/src/components/map/basemap.ts +304 -0
  118. package/src/components/map/index.tsx +1118 -0
  119. package/src/components/map/maplibre.ts +201 -0
  120. package/src/components/message/index.tsx +8 -7
  121. package/src/components/otp-input/index.tsx +2 -2
  122. package/src/components/progress/index.tsx +10 -2
  123. package/src/components/ring-chart/index.tsx +543 -0
  124. package/src/components/section-rail/index.tsx +2 -2
  125. package/src/components/separator/index.tsx +77 -19
  126. package/src/components/shimmer/index.tsx +10 -1
  127. package/src/components/slider/index.tsx +20 -5
  128. package/src/components/steps/index.tsx +1 -1
  129. package/src/components/switch/index.tsx +6 -1
  130. package/src/components/typography/index.tsx +5 -0
  131. package/src/hooks/use-direction.ts +45 -0
  132. package/src/icons/index.tsx +66 -0
  133. package/src/index.ts +84 -0
  134. package/src/primitives/text.tsx +25 -7
  135. package/src/utils/chart.ts +355 -0
@@ -0,0 +1,38 @@
1
+ import { type ViewProps } from 'react-native';
2
+ export type LoaderVariant = 'pulse-dots' | 'bounce-dots' | 'pulsating-dots' | 'liquid-dots' | 'bar-cascade' | 'bouncing-bars' | 'symmetric-wave' | 'morph-ring' | 'wave-physics';
3
+ export type LoaderSize = 'sm' | 'md' | 'lg';
4
+ export interface LoaderProps extends Omit<ViewProps, 'children'> {
5
+ /**
6
+ * Which animation to draw. They are interchangeable — pick one for the
7
+ * character it gives the screen and keep it.
8
+ */
9
+ variant?: LoaderVariant;
10
+ /** Overall scale. The geometry of every variant is multiplied by it. */
11
+ size?: LoaderSize;
12
+ /**
13
+ * Ink. Takes a theme token by name — `"--color-primary"` — as readily as a
14
+ * literal, and the token is usually what you want: a literal cannot follow
15
+ * the theme into dark mode.
16
+ *
17
+ * With neither, the loader draws in the readable foreground of the surface
18
+ * it is on, so one inside a filled button is legible without being told.
19
+ */
20
+ color?: string;
21
+ /** Multiplier on the tempo. `1` is the designed speed; `2` is twice as fast. */
22
+ speed?: number;
23
+ /**
24
+ * What a screen reader announces. Defaults to "Loading". Say what is
25
+ * loading when the loader is the only thing on the screen.
26
+ */
27
+ label?: string;
28
+ className?: string;
29
+ }
30
+ /**
31
+ * A loading animation.
32
+ *
33
+ * Nine of them, chosen with `variant`. They all take the same colour, the same
34
+ * `speed`, and the same treatment under reduced motion, so swapping one for
35
+ * another is a one-word change.
36
+ */
37
+ export declare const Loader: import("react").MemoExoticComponent<({ variant, size, color, speed, label, className, ...props }: LoaderProps) => import("react").JSX.Element>;
38
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/loader/index.tsx"],"names":[],"mappings":"AA8BA,OAAO,EAAQ,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;AAsBpD,MAAM,MAAM,aAAa,GACrB,YAAY,GACZ,aAAa,GACb,gBAAgB,GAChB,aAAa,GACb,aAAa,GACb,eAAe,GACf,gBAAgB,GAChB,YAAY,GACZ,cAAc,CAAC;AAEnB,MAAM,MAAM,UAAU,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;AAM5C,MAAM,WAAW,WAAY,SAAQ,IAAI,CAAC,SAAS,EAAE,UAAU,CAAC;IAC9D;;;OAGG;IACH,OAAO,CAAC,EAAE,aAAa,CAAC;IACxB,wEAAwE;IACxE,IAAI,CAAC,EAAE,UAAU,CAAC;IAClB;;;;;;;OAOG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,gFAAgF;IAChF,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AA8eD;;;;;;GAMG;AACH,eAAO,MAAM,MAAM,oGAQhB,WAAW,iCA+MZ,CAAC"}
@@ -0,0 +1,76 @@
1
+ /**
2
+ * The basemap, drawn from theme tokens.
3
+ *
4
+ * A hosted map style ships its colours baked in, which gives you exactly two
5
+ * maps: a light one and a dark one. PanelUI has six themes, and a map that
6
+ * stays grey while the rest of the screen turns green is the one element on
7
+ * the page that visibly does not belong to it.
8
+ *
9
+ * So the style is assembled here instead. Tiles still come from the vector
10
+ * source — that is the part worth paying someone for — but every colour in
11
+ * the style is a token the caller's theme already resolved, which means a new
12
+ * theme gets a matching basemap without anyone drawing one.
13
+ *
14
+ * The layer list is deliberately short. A full street style runs to ninety-odd
15
+ * layers separating tunnel casings from bridge casings at eleven zoom stops;
16
+ * almost none of that survives being recoloured down to five greys, and every
17
+ * layer is another thing to keep in step with the tokens. What is here is the
18
+ * set that still reads as a map at any zoom: ground, water, green space,
19
+ * buildings, roads, boundaries, and the labels that make them findable.
20
+ */
21
+ import type { StyleSpecification } from './maplibre.js';
22
+ /** Resolved theme colours the style is built from. */
23
+ export interface BasemapTokens {
24
+ /** Ground — everything that is not something else. */
25
+ background: string;
26
+ /** Water bodies and rivers. */
27
+ water: string;
28
+ /** Parks, forest, and other green space. */
29
+ land: string;
30
+ /** Building footprints. */
31
+ building: string;
32
+ /** Roads, boundaries and other lines. */
33
+ line: string;
34
+ /** Label text. */
35
+ label: string;
36
+ /** Halo behind label text, so it stays legible over any fill. */
37
+ labelHalo: string;
38
+ }
39
+ /**
40
+ * Vector tiles and the glyphs to label them with.
41
+ *
42
+ * Swappable because the tiles are the one part of the style that is somebody
43
+ * else's to license. The defaults follow the OpenMapTiles schema, so any
44
+ * source using it can be dropped in without touching the layers below.
45
+ */
46
+ export interface BasemapSource {
47
+ /** TileJSON URL for the vector source. */
48
+ url: string;
49
+ /** Glyph endpoint, `{fontstack}` and `{range}` templated. */
50
+ glyphs: string;
51
+ /** Font stack for labels. Needs to exist at the glyph endpoint. */
52
+ fonts: string[];
53
+ /** Shown in the attribution control. Check your provider's terms. */
54
+ attribution?: string;
55
+ }
56
+ /**
57
+ * CARTO's street tiles.
58
+ *
59
+ * Free for non-commercial use; commercial use needs a licence from them. Pass
60
+ * your own `BasemapSource` to use a different provider — the layers below only
61
+ * assume the OpenMapTiles schema, which most vector providers serve.
62
+ */
63
+ export declare const CARTO_SOURCE: BasemapSource;
64
+ /**
65
+ * Builds a complete MapLibre style from resolved theme colours.
66
+ *
67
+ * `blank` drops the tile source and every layer that reads from it, leaving
68
+ * just the ground colour — a canvas for data that supplies its own geography,
69
+ * such as a choropleth or an arc diagram, where street detail underneath is
70
+ * noise rather than context.
71
+ */
72
+ export declare function buildBasemapStyle(tokens: BasemapTokens, options?: {
73
+ blank?: boolean;
74
+ source?: BasemapSource;
75
+ }): StyleSpecification;
76
+ //# sourceMappingURL=basemap.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"basemap.d.ts","sourceRoot":"","sources":["../../../../../src/components/map/basemap.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AACH,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,eAAY,CAAC;AAErD,sDAAsD;AACtD,MAAM,WAAW,aAAa;IAC5B,sDAAsD;IACtD,UAAU,EAAE,MAAM,CAAC;IACnB,+BAA+B;IAC/B,KAAK,EAAE,MAAM,CAAC;IACd,4CAA4C;IAC5C,IAAI,EAAE,MAAM,CAAC;IACb,2BAA2B;IAC3B,QAAQ,EAAE,MAAM,CAAC;IACjB,yCAAyC;IACzC,IAAI,EAAE,MAAM,CAAC;IACb,kBAAkB;IAClB,KAAK,EAAE,MAAM,CAAC;IACd,iEAAiE;IACjE,SAAS,EAAE,MAAM,CAAC;CACnB;AAED;;;;;;GAMG;AACH,MAAM,WAAW,aAAa;IAC5B,0CAA0C;IAC1C,GAAG,EAAE,MAAM,CAAC;IACZ,6DAA6D;IAC7D,MAAM,EAAE,MAAM,CAAC;IACf,mEAAmE;IACnE,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB,qEAAqE;IACrE,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED;;;;;;GAMG;AACH,eAAO,MAAM,YAAY,EAAE,aAK1B,CAAC;AAsBF;;;;;;;GAOG;AACH,wBAAgB,iBAAiB,CAC/B,MAAM,EAAE,aAAa,EACrB,OAAO,GAAE;IAAE,KAAK,CAAC,EAAE,OAAO,CAAC;IAAC,MAAM,CAAC,EAAE,aAAa,CAAA;CAAO,GACxD,kBAAkB,CAwMpB"}
@@ -0,0 +1,367 @@
1
+ /**
2
+ * Map — a themed vector map.
3
+ *
4
+ * Everything visible is built from theme tokens rather than shipped as a
5
+ * finished style, so the map belongs to whatever theme is active instead of
6
+ * being the one rectangle on the screen that stayed grey. See `basemap.ts` for
7
+ * how the style is assembled; the short version is that the tiles are bought
8
+ * and the colours are ours.
9
+ *
10
+ * ```tsx
11
+ * <Map center={[-0.12, 51.5]} zoom={11}>
12
+ * <Map.Marker lngLat={[-0.12, 51.5]}>
13
+ * <Map.Popup>
14
+ * <Text weight="medium">Charing Cross</Text>
15
+ * </Map.Popup>
16
+ * </Map.Marker>
17
+ * <Map.Controls locate />
18
+ * </Map>
19
+ * ```
20
+ *
21
+ * The renderer is native and optional, so `Map` has a state no other component
22
+ * here does: it may be unable to draw at all. It says so in place rather than
23
+ * throwing, because the usual way to reach that state is running in a client
24
+ * that cannot load native modules, and a screen explaining the build you need
25
+ * is more use than a stack trace.
26
+ *
27
+ * `Map.Popup` reads its position from the marker it sits inside, the way a
28
+ * frame's title reads its weight from its slot. Given a `lngLat` of its own it
29
+ * anchors to that coordinate instead, so the same name covers both the popup
30
+ * attached to a pin and the one floating over a place with no pin at all.
31
+ */
32
+ import { type ReactNode } from 'react';
33
+ import { type ViewProps } from 'react-native';
34
+ import { CARTO_SOURCE, type BasemapSource, type BasemapTokens } from './basemap.js';
35
+ import { hasMapLibre, type CameraRef, type LngLat, type LngLatBounds, type MapRef, type StyleSpecification, type ViewState } from './maplibre.js';
36
+ export { hasMapLibre, CARTO_SOURCE };
37
+ export type { BasemapSource, BasemapTokens, LngLat, LngLatBounds, ViewState };
38
+ export type MapControlsPosition = 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right';
39
+ interface MapContextValue {
40
+ mapRef: React.RefObject<MapRef | null>;
41
+ cameraRef: React.RefObject<CameraRef | null>;
42
+ /** The style has loaded and the map is drawing. */
43
+ ready: boolean;
44
+ }
45
+ /**
46
+ * The map's camera and view state, from inside it.
47
+ *
48
+ * For a control, an overlay, or anything that has to move the map in response
49
+ * to something that is not a gesture on it.
50
+ */
51
+ export declare function useMap(): MapContextValue;
52
+ export interface MapHandle {
53
+ /** Move the camera, animating unless `duration` is 0. */
54
+ flyTo(options: {
55
+ center: LngLat;
56
+ zoom?: number;
57
+ duration?: number;
58
+ }): void;
59
+ /** Frame a bounding box, leaving `padding` points around it. */
60
+ fitBounds(bounds: LngLatBounds, padding?: number): void;
61
+ /** Where the map is looking right now. */
62
+ getViewState(): Promise<ViewState | null>;
63
+ }
64
+ export interface MapProps extends Omit<ViewProps, 'children'> {
65
+ children?: ReactNode;
66
+ /** Initial centre, `[longitude, latitude]`. */
67
+ center?: LngLat;
68
+ /** Initial zoom. 0 is the whole world; 18 is a building. */
69
+ zoom?: number;
70
+ /** Initial bearing in degrees, clockwise from north. */
71
+ bearing?: number;
72
+ /** Initial tilt in degrees. 0 looks straight down. */
73
+ pitch?: number;
74
+ /**
75
+ * Frame these bounds instead of centring — `[west, south, east, north]`.
76
+ * Wins over `center` and `zoom` when both are given.
77
+ */
78
+ bounds?: LngLatBounds;
79
+ /**
80
+ * Drop the basemap and keep only the ground colour. For data that carries
81
+ * its own geography — a choropleth, an arc diagram — where streets
82
+ * underneath are noise rather than context.
83
+ */
84
+ blank?: boolean;
85
+ /**
86
+ * Where the vector tiles come from. Defaults to CARTO, which is free for
87
+ * non-commercial use and licensed for everything else.
88
+ */
89
+ source?: BasemapSource;
90
+ /**
91
+ * Use this style wholesale instead of building one from tokens. The escape
92
+ * hatch for a map that has to match something outside the app.
93
+ */
94
+ mapStyle?: string | StyleSpecification;
95
+ /** Let the map rotate and tilt. Off by default — most maps only pan and zoom. */
96
+ rotatable?: boolean;
97
+ /** Turn off panning and zooming, for a map that is an illustration. */
98
+ interactive?: boolean;
99
+ /** Fires continuously while the map moves. */
100
+ onViewStateChange?: (state: ViewState) => void;
101
+ /** Fires when the map is pressed somewhere that is not a feature. */
102
+ onPress?: (lngLat: LngLat) => void;
103
+ /** Fires once the style has loaded and the first frame is drawn. */
104
+ onReady?: () => void;
105
+ }
106
+ export interface MapMarkerProps {
107
+ /** Where the marker sits, `[longitude, latitude]`. */
108
+ lngLat: LngLat;
109
+ /**
110
+ * Which part of the marker sits on the coordinate. A pin drawn above its
111
+ * point wants `bottom`; a dot centred on it wants the default.
112
+ */
113
+ anchor?: 'center' | 'top' | 'bottom' | 'left' | 'right';
114
+ /** Pressing the marker. Adds a button role when given. */
115
+ onPress?: () => void;
116
+ className?: string;
117
+ /** Defaults to a dot. Anything else replaces it. */
118
+ children?: ReactNode;
119
+ }
120
+ /**
121
+ * A point on the map, drawn as React views rather than as a style layer — so
122
+ * it can be anything the rest of the library can draw. For hundreds of points
123
+ * use `Map.Cluster` instead: a view per marker stops being affordable long
124
+ * before the map stops being readable.
125
+ */
126
+ declare function MapMarker({ lngLat, anchor, onPress, className, children, }: MapMarkerProps): import("react").JSX.Element | null;
127
+ declare namespace MapMarker {
128
+ var displayName: string;
129
+ }
130
+ export interface MapLabelProps {
131
+ children?: ReactNode;
132
+ className?: string;
133
+ /** Which side of the marker the label sits on. */
134
+ side?: 'top' | 'bottom';
135
+ }
136
+ /**
137
+ * A caption pinned to a marker. Always visible, unlike a popup — for the
138
+ * handful of places whose names are the point of the map.
139
+ *
140
+ * It is taken out of the marker's layout flow, which matters more than it
141
+ * sounds: a marker sits on its coordinate by the centre of its box, so a label
142
+ * in flow underneath the pin would pull that centre down and lift every pin
143
+ * off the place it marks. Absolute keeps the box the size of the pin.
144
+ *
145
+ * The overhang on each side is what lets a long name stay centred on the pin
146
+ * without widening the marker — a name is usually far wider than the dot it
147
+ * belongs to, and a box sized to the name would be anchored by the name.
148
+ */
149
+ declare function MapLabel({ children, className, side }: MapLabelProps): import("react").JSX.Element;
150
+ declare namespace MapLabel {
151
+ var displayName: string;
152
+ }
153
+ export interface MapPopupProps {
154
+ children?: ReactNode;
155
+ className?: string;
156
+ /** Heading above the content. Strings are wrapped for you. */
157
+ title?: string;
158
+ /**
159
+ * Anchor to this coordinate instead of to an enclosing marker. Required when
160
+ * the popup is not inside one.
161
+ */
162
+ lngLat?: LngLat;
163
+ }
164
+ /**
165
+ * A card anchored to a point.
166
+ *
167
+ * Inside a `Map.Marker` it takes that marker's coordinate and opens when the
168
+ * marker is pressed. Given a `lngLat` it stands alone at that coordinate — the
169
+ * same component either way, because the difference is where it is anchored
170
+ * rather than what it is.
171
+ *
172
+ * Either way it is its own annotation rather than something drawn inside the
173
+ * marker, which is what keeps a card from dragging the pin off its coordinate.
174
+ * Anchored by its bottom edge, so it floats above the point it describes
175
+ * instead of covering it.
176
+ */
177
+ declare function MapPopup({ children, className, title, lngLat }: MapPopupProps): import("react").JSX.Element | null;
178
+ declare namespace MapPopup {
179
+ var displayName: string;
180
+ }
181
+ export interface MapControlsProps {
182
+ /** Which corner the stack sits in. */
183
+ position?: MapControlsPosition;
184
+ /** Zoom in and out. On by default — it is the one control a map always needs. */
185
+ zoom?: boolean;
186
+ /** Recentre on the device's location. Needs a location permission. */
187
+ locate?: boolean;
188
+ /** Reset bearing and pitch to north and flat. */
189
+ compass?: boolean;
190
+ className?: string;
191
+ /** Called with the located coordinate, so a caller can react to it. */
192
+ onLocate?: (lngLat: LngLat) => void;
193
+ }
194
+ /**
195
+ * The map's own chrome, as themed views.
196
+ *
197
+ * The renderer draws its own zoom and compass ornaments, but in its style
198
+ * rather than the app's, and they cannot be recoloured — so they are turned
199
+ * off in `Map` and replaced here by buttons built from the same tokens as
200
+ * every other control in the library.
201
+ */
202
+ declare function MapControls({ position, zoom, locate, compass, className, onLocate, }: MapControlsProps): import("react").JSX.Element;
203
+ declare namespace MapControls {
204
+ var displayName: string;
205
+ }
206
+ export interface MapRouteProps {
207
+ /** The path, in order. */
208
+ coordinates: LngLat[];
209
+ /** Defaults to the primary token. */
210
+ color?: string;
211
+ /** Line thickness in points. */
212
+ width?: number;
213
+ /** Draw it dashed — for a leg that is planned rather than travelled. */
214
+ dashed?: boolean;
215
+ /** 0 is invisible, 1 is solid. */
216
+ opacity?: number;
217
+ id?: string;
218
+ }
219
+ /**
220
+ * A path across the map, drawn as a style layer rather than as views — so its
221
+ * cost does not grow with the number of points in it.
222
+ */
223
+ declare function MapRoute({ coordinates, color, width, dashed, opacity, id, }: MapRouteProps): import("react").JSX.Element | null;
224
+ declare namespace MapRoute {
225
+ var displayName: string;
226
+ }
227
+ export interface MapArcProps {
228
+ /** Where the arc starts. */
229
+ from: LngLat;
230
+ /** Where it ends. */
231
+ to: LngLat;
232
+ /** How far it bows. 0 is a straight line; 0.2 is the default lift. */
233
+ curvature?: number;
234
+ color?: string;
235
+ width?: number;
236
+ opacity?: number;
237
+ id?: string;
238
+ }
239
+ /**
240
+ * A curved connection between two points.
241
+ *
242
+ * The curve is not geography — a great circle between two cities is not bowed
243
+ * on a flat projection. It is there so that two arcs sharing an endpoint stay
244
+ * tellable apart, which a bundle of straight lines through one city does not.
245
+ */
246
+ declare function MapArc({ from, to, curvature, color, width, opacity, id, }: MapArcProps): import("react").JSX.Element | null;
247
+ declare namespace MapArc {
248
+ var displayName: string;
249
+ }
250
+ export interface MapGeoJSONProps {
251
+ /** A Feature, FeatureCollection, or the URL of one. */
252
+ data: unknown;
253
+ /** Fill colour for polygons. A style expression works here too. */
254
+ fill?: string | unknown[];
255
+ /** Outline colour. Defaults to the border token. */
256
+ stroke?: string | unknown[];
257
+ /** Outline thickness. */
258
+ strokeWidth?: number;
259
+ /** 0 is invisible, 1 is solid. */
260
+ fillOpacity?: number;
261
+ /** Fires with the pressed feature. */
262
+ onPress?: (feature: unknown) => void;
263
+ id?: string;
264
+ }
265
+ /**
266
+ * Arbitrary geography as a themed layer — the component behind a choropleth,
267
+ * a coverage area, or any other shape that comes from data rather than from
268
+ * the basemap.
269
+ *
270
+ * `fill` takes a style expression as well as a colour, which is what makes a
271
+ * choropleth one layer instead of one layer per bucket.
272
+ */
273
+ declare function MapGeoJSON({ data, fill, stroke, strokeWidth, fillOpacity, onPress, id, }: MapGeoJSONProps): import("react").JSX.Element | null;
274
+ declare namespace MapGeoJSON {
275
+ var displayName: string;
276
+ }
277
+ export interface MapClusterProps {
278
+ /** Point features to cluster. */
279
+ data: unknown;
280
+ /** Defaults to the primary token. */
281
+ color?: string;
282
+ /** Text colour inside a cluster bubble. */
283
+ textColor?: string;
284
+ /** How close two points have to be, in points, to merge. */
285
+ radius?: number;
286
+ /** Above this zoom every point stands alone. */
287
+ maxZoom?: number;
288
+ /** Fires with the pressed cluster or point. */
289
+ onPress?: (feature: unknown) => void;
290
+ id?: string;
291
+ }
292
+ /**
293
+ * Dense points, merged as they get too close to tell apart.
294
+ *
295
+ * This is the layer to reach for past a few dozen points: `Map.Marker` mounts
296
+ * a React view each, which a thousand points cannot afford, and a thousand
297
+ * overlapping pins would be unreadable even if it could.
298
+ */
299
+ declare function MapCluster({ data, color, textColor, radius, maxZoom, onPress, id, }: MapClusterProps): import("react").JSX.Element | null;
300
+ declare namespace MapCluster {
301
+ var displayName: string;
302
+ }
303
+ export interface MapHeatmapProps {
304
+ /** Point features to spread. */
305
+ data: unknown;
306
+ /** Feature property to weight each point by. Unweighted when omitted. */
307
+ weight?: string;
308
+ /**
309
+ * Spread of a single point, in points, at street zoom. Larger blurs more.
310
+ * The drawn radius shrinks as the map zooms out, so a point keeps covering
311
+ * roughly the same ground rather than the same screen area.
312
+ */
313
+ radius?: number;
314
+ /** Overall strength. Raise it when the data is sparse. */
315
+ intensity?: number;
316
+ /** 0 is invisible, 1 is solid. */
317
+ opacity?: number;
318
+ /** Above this zoom the layer fades out — see the note on the component. */
319
+ maxZoom?: number;
320
+ id?: string;
321
+ }
322
+ /**
323
+ * Point density as a continuous field.
324
+ *
325
+ * The opposite trade to `Map.Cluster`: a cluster keeps every point countable
326
+ * and tells you nothing about the space between them, while a heatmap shows
327
+ * the shape of the distribution and no longer lets you count anything. Reach
328
+ * for it when the question is *where* rather than *how many*.
329
+ *
330
+ * It fades out past `maxZoom` on purpose. Zoomed far enough in, every point is
331
+ * its own island and the blur says less than the points would — so the layer
332
+ * gets out of the way rather than smearing five records across a street.
333
+ *
334
+ * The radius is tied to zoom for the mirror-image reason. Left as a fixed
335
+ * number of screen points it would mean a different distance at every zoom:
336
+ * a blur that reads as a city at street level covers half a continent once
337
+ * the map is pulled out, and a field measured over land ends up sitting in
338
+ * the sea. Scaling it with the projection keeps the claim the same one.
339
+ */
340
+ declare function MapHeatmap({ data, weight, radius, intensity, opacity, maxZoom, id, }: MapHeatmapProps): import("react").JSX.Element | null;
341
+ declare namespace MapHeatmap {
342
+ var displayName: string;
343
+ }
344
+ export interface MapUserLocationProps {
345
+ /** Show which way the device is facing, not just where it is. */
346
+ heading?: boolean;
347
+ /** Draw the ring showing how confident the fix is. */
348
+ accuracy?: boolean;
349
+ }
350
+ /** The device's own position, drawn by the renderer. */
351
+ declare function MapUserLocation({ heading, accuracy, }: MapUserLocationProps): import("react").JSX.Element | null;
352
+ declare namespace MapUserLocation {
353
+ var displayName: string;
354
+ }
355
+ export declare const Map: import("react").ForwardRefExoticComponent<MapProps & import("react").RefAttributes<MapHandle>> & {
356
+ Marker: typeof MapMarker;
357
+ Label: typeof MapLabel;
358
+ Popup: typeof MapPopup;
359
+ Controls: typeof MapControls;
360
+ Route: typeof MapRoute;
361
+ Arc: typeof MapArc;
362
+ GeoJSON: typeof MapGeoJSON;
363
+ Cluster: typeof MapCluster;
364
+ Heatmap: typeof MapHeatmap;
365
+ UserLocation: typeof MapUserLocation;
366
+ };
367
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/map/index.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AACH,OAAO,EAWL,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AACf,OAAO,EAAmB,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;AAM/D,OAAO,EAEL,YAAY,EACZ,KAAK,aAAa,EAClB,KAAK,aAAa,EACnB,MAAM,cAAW,CAAC;AACnB,OAAO,EACL,WAAW,EAEX,KAAK,SAAS,EACd,KAAK,MAAM,EACX,KAAK,YAAY,EACjB,KAAK,MAAM,EACX,KAAK,kBAAkB,EACvB,KAAK,SAAS,EACf,MAAM,eAAY,CAAC;AAEpB,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,CAAC;AACrC,YAAY,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,EAAE,YAAY,EAAE,SAAS,EAAE,CAAC;AAwB9E,MAAM,MAAM,mBAAmB,GAC3B,UAAU,GACV,WAAW,GACX,aAAa,GACb,cAAc,CAAC;AAQnB,UAAU,eAAe;IACvB,MAAM,EAAE,KAAK,CAAC,SAAS,CAAC,MAAM,GAAG,IAAI,CAAC,CAAC;IACvC,SAAS,EAAE,KAAK,CAAC,SAAS,CAAC,SAAS,GAAG,IAAI,CAAC,CAAC;IAC7C,mDAAmD;IACnD,KAAK,EAAE,OAAO,CAAC;CAChB;AAID;;;;;GAKG;AACH,wBAAgB,MAAM,IAAI,eAAe,CAIxC;AAKD,MAAM,WAAW,SAAS;IACxB,yDAAyD;IACzD,KAAK,CAAC,OAAO,EAAE;QAAE,MAAM,EAAE,MAAM,C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