tempest-react-sdk 0.17.0 → 0.19.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 (249) hide show
  1. package/bin/tempest.mjs +445 -35
  2. package/dist/AC-Brw7ZrEs.cjs +2 -0
  3. package/dist/AC-Brw7ZrEs.cjs.map +1 -0
  4. package/dist/AC-DLl3Z4oj.js +12 -0
  5. package/dist/AC-DLl3Z4oj.js.map +1 -0
  6. package/dist/AL-DPGoZjht.cjs +2 -0
  7. package/dist/AL-DPGoZjht.cjs.map +1 -0
  8. package/dist/AL-gswGaWlj.js +12 -0
  9. package/dist/AL-gswGaWlj.js.map +1 -0
  10. package/dist/AM-QN1eL4Tn.js +12 -0
  11. package/dist/AM-QN1eL4Tn.js.map +1 -0
  12. package/dist/AM-VqNWvsI-.cjs +2 -0
  13. package/dist/AM-VqNWvsI-.cjs.map +1 -0
  14. package/dist/AP-CPvBa_FK.cjs +2 -0
  15. package/dist/AP-CPvBa_FK.cjs.map +1 -0
  16. package/dist/AP-CRAbh1js.js +12 -0
  17. package/dist/AP-CRAbh1js.js.map +1 -0
  18. package/dist/BA-CKy_HnnV.js +12 -0
  19. package/dist/BA-CKy_HnnV.js.map +1 -0
  20. package/dist/BA-DoMQ6slK.cjs +2 -0
  21. package/dist/BA-DoMQ6slK.cjs.map +1 -0
  22. package/dist/CE-Ca-XMDFW.js +12 -0
  23. package/dist/CE-Ca-XMDFW.js.map +1 -0
  24. package/dist/CE-as-pGPQa.cjs +2 -0
  25. package/dist/CE-as-pGPQa.cjs.map +1 -0
  26. package/dist/DF-8kzFoovF.js +12 -0
  27. package/dist/DF-8kzFoovF.js.map +1 -0
  28. package/dist/DF-Wr8WNxSX.cjs +2 -0
  29. package/dist/DF-Wr8WNxSX.cjs.map +1 -0
  30. package/dist/ES-B4uWNG6s.js +12 -0
  31. package/dist/ES-B4uWNG6s.js.map +1 -0
  32. package/dist/ES-wKVjD_TM.cjs +2 -0
  33. package/dist/ES-wKVjD_TM.cjs.map +1 -0
  34. package/dist/GO-D4m4rOqy.cjs +2 -0
  35. package/dist/GO-D4m4rOqy.cjs.map +1 -0
  36. package/dist/GO-DuaAgIfo.js +12 -0
  37. package/dist/GO-DuaAgIfo.js.map +1 -0
  38. package/dist/MA-BmaUZZKe.cjs +2 -0
  39. package/dist/MA-BmaUZZKe.cjs.map +1 -0
  40. package/dist/MA-wOyPxG_M.js +12 -0
  41. package/dist/MA-wOyPxG_M.js.map +1 -0
  42. package/dist/MG-BYsqJd-S.js +12 -0
  43. package/dist/MG-BYsqJd-S.js.map +1 -0
  44. package/dist/MG-BchdfJXp.cjs +2 -0
  45. package/dist/MG-BchdfJXp.cjs.map +1 -0
  46. package/dist/MS-DZkgtN_7.js +12 -0
  47. package/dist/MS-DZkgtN_7.js.map +1 -0
  48. package/dist/MS-Dz9lDw37.cjs +2 -0
  49. package/dist/MS-Dz9lDw37.cjs.map +1 -0
  50. package/dist/MT-BkVchoah.cjs +2 -0
  51. package/dist/MT-BkVchoah.cjs.map +1 -0
  52. package/dist/MT-GmMwFWw2.js +12 -0
  53. package/dist/MT-GmMwFWw2.js.map +1 -0
  54. package/dist/PA-C2FpT6Ew.cjs +2 -0
  55. package/dist/PA-C2FpT6Ew.cjs.map +1 -0
  56. package/dist/PA-DgyDzDFi.js +12 -0
  57. package/dist/PA-DgyDzDFi.js.map +1 -0
  58. package/dist/PB-BGkzbQup.cjs +2 -0
  59. package/dist/PB-BGkzbQup.cjs.map +1 -0
  60. package/dist/PB-D-6NE6KM.js +12 -0
  61. package/dist/PB-D-6NE6KM.js.map +1 -0
  62. package/dist/PE-D8V7gWY-.cjs +2 -0
  63. package/dist/PE-D8V7gWY-.cjs.map +1 -0
  64. package/dist/PE-vqm-t7Nh.js +12 -0
  65. package/dist/PE-vqm-t7Nh.js.map +1 -0
  66. package/dist/PI-CILuGJlW.js +12 -0
  67. package/dist/PI-CILuGJlW.js.map +1 -0
  68. package/dist/PI-dJYCbXQM.cjs +2 -0
  69. package/dist/PI-dJYCbXQM.cjs.map +1 -0
  70. package/dist/PR-DN8AV__r.js +12 -0
  71. package/dist/PR-DN8AV__r.js.map +1 -0
  72. package/dist/PR-P17oBdNH.cjs +2 -0
  73. package/dist/PR-P17oBdNH.cjs.map +1 -0
  74. package/dist/RJ-Bccz05Em.js +12 -0
  75. package/dist/RJ-Bccz05Em.js.map +1 -0
  76. package/dist/RJ-Budqx7QP.cjs +2 -0
  77. package/dist/RJ-Budqx7QP.cjs.map +1 -0
  78. package/dist/RN-DLcJBxo3.cjs +2 -0
  79. package/dist/RN-DLcJBxo3.cjs.map +1 -0
  80. package/dist/RN-DTqFP-Nm.js +12 -0
  81. package/dist/RN-DTqFP-Nm.js.map +1 -0
  82. package/dist/RO-BCC54UTU.js +12 -0
  83. package/dist/RO-BCC54UTU.js.map +1 -0
  84. package/dist/RO-B_IDyci4.cjs +2 -0
  85. package/dist/RO-B_IDyci4.cjs.map +1 -0
  86. package/dist/RR-CDGUEyla.cjs +2 -0
  87. package/dist/RR-CDGUEyla.cjs.map +1 -0
  88. package/dist/RR-OCnI_XpU.js +12 -0
  89. package/dist/RR-OCnI_XpU.js.map +1 -0
  90. package/dist/RS-DiBeY_u5.cjs +2 -0
  91. package/dist/RS-DiBeY_u5.cjs.map +1 -0
  92. package/dist/RS-Dy7gBbbH.js +12 -0
  93. package/dist/RS-Dy7gBbbH.js.map +1 -0
  94. package/dist/SC-CEMoj8g2.cjs +2 -0
  95. package/dist/SC-CEMoj8g2.cjs.map +1 -0
  96. package/dist/SC-trCqQDXz.js +12 -0
  97. package/dist/SC-trCqQDXz.js.map +1 -0
  98. package/dist/SE-DAfFbZcK.cjs +2 -0
  99. package/dist/SE-DAfFbZcK.cjs.map +1 -0
  100. package/dist/SE-DBdfSrGk.js +12 -0
  101. package/dist/SE-DBdfSrGk.js.map +1 -0
  102. package/dist/SP-Cse4d68i.cjs +2 -0
  103. package/dist/SP-Cse4d68i.cjs.map +1 -0
  104. package/dist/SP-qPZjJDOT.js +12 -0
  105. package/dist/SP-qPZjJDOT.js.map +1 -0
  106. package/dist/TO-CZtMDVug.js +12 -0
  107. package/dist/TO-CZtMDVug.js.map +1 -0
  108. package/dist/TO-Dwi5zIyF.cjs +2 -0
  109. package/dist/TO-Dwi5zIyF.cjs.map +1 -0
  110. package/dist/br-centroids--O7-1KXz.cjs +2 -0
  111. package/dist/br-centroids--O7-1KXz.cjs.map +1 -0
  112. package/dist/br-centroids-IHN7PIzD.js +10 -0
  113. package/dist/br-centroids-IHN7PIzD.js.map +1 -0
  114. package/dist/br-geo-BYynYOwK.cjs +2 -0
  115. package/dist/br-geo-BYynYOwK.cjs.map +1 -0
  116. package/dist/br-geo-DFRuvjuU.js +8 -0
  117. package/dist/br-geo-DFRuvjuU.js.map +1 -0
  118. package/dist/br.cjs +1 -1
  119. package/dist/br.cjs.map +1 -1
  120. package/dist/br.d.ts +356 -6
  121. package/dist/br.js +825 -348
  122. package/dist/br.js.map +1 -1
  123. package/dist/projection-CILVBdpd.cjs +2 -0
  124. package/dist/projection-CILVBdpd.cjs.map +1 -0
  125. package/dist/projection-Wnqr_svy.js +215 -0
  126. package/dist/projection-Wnqr_svy.js.map +1 -0
  127. package/dist/styles.css +1 -1
  128. package/dist/tempest-react-sdk.cjs +3 -3
  129. package/dist/tempest-react-sdk.cjs.map +1 -1
  130. package/dist/tempest-react-sdk.d.ts +21 -1
  131. package/dist/tempest-react-sdk.js +2790 -2848
  132. package/dist/tempest-react-sdk.js.map +1 -1
  133. package/package.json +2 -1
  134. package/dist/AC-BQUmmKrw.cjs +0 -2
  135. package/dist/AC-BQUmmKrw.cjs.map +0 -1
  136. package/dist/AC-DOvYXax1.js +0 -12
  137. package/dist/AC-DOvYXax1.js.map +0 -1
  138. package/dist/AL-DH1wKIxj.js +0 -12
  139. package/dist/AL-DH1wKIxj.js.map +0 -1
  140. package/dist/AL-oN2X02DP.cjs +0 -2
  141. package/dist/AL-oN2X02DP.cjs.map +0 -1
  142. package/dist/AM-Cn_JOc_u.cjs +0 -2
  143. package/dist/AM-Cn_JOc_u.cjs.map +0 -1
  144. package/dist/AM-D-l4ioxq.js +0 -12
  145. package/dist/AM-D-l4ioxq.js.map +0 -1
  146. package/dist/AP-B8H3590m.cjs +0 -2
  147. package/dist/AP-B8H3590m.cjs.map +0 -1
  148. package/dist/AP-pl_IXUrz.js +0 -12
  149. package/dist/AP-pl_IXUrz.js.map +0 -1
  150. package/dist/BA-DsPuESbp.cjs +0 -2
  151. package/dist/BA-DsPuESbp.cjs.map +0 -1
  152. package/dist/BA-HvFNaSvC.js +0 -12
  153. package/dist/BA-HvFNaSvC.js.map +0 -1
  154. package/dist/CE-BhzlM8v8.cjs +0 -2
  155. package/dist/CE-BhzlM8v8.cjs.map +0 -1
  156. package/dist/CE-C4VCDB2_.js +0 -12
  157. package/dist/CE-C4VCDB2_.js.map +0 -1
  158. package/dist/DF-CdR_I7qu.cjs +0 -2
  159. package/dist/DF-CdR_I7qu.cjs.map +0 -1
  160. package/dist/DF-DCepvNQG.js +0 -12
  161. package/dist/DF-DCepvNQG.js.map +0 -1
  162. package/dist/ES-BNECOgN8.js +0 -12
  163. package/dist/ES-BNECOgN8.js.map +0 -1
  164. package/dist/ES-CzZdWdcw.cjs +0 -2
  165. package/dist/ES-CzZdWdcw.cjs.map +0 -1
  166. package/dist/GO-CTgkFwbh.js +0 -12
  167. package/dist/GO-CTgkFwbh.js.map +0 -1
  168. package/dist/GO-VqQUIkMG.cjs +0 -2
  169. package/dist/GO-VqQUIkMG.cjs.map +0 -1
  170. package/dist/MA-CwpNlEs4.cjs +0 -2
  171. package/dist/MA-CwpNlEs4.cjs.map +0 -1
  172. package/dist/MA-DC3zmbpX.js +0 -12
  173. package/dist/MA-DC3zmbpX.js.map +0 -1
  174. package/dist/MG-DLTyPn6U.js +0 -12
  175. package/dist/MG-DLTyPn6U.js.map +0 -1
  176. package/dist/MG-P3ePmTdM.cjs +0 -2
  177. package/dist/MG-P3ePmTdM.cjs.map +0 -1
  178. package/dist/MS-Crc916be.js +0 -12
  179. package/dist/MS-Crc916be.js.map +0 -1
  180. package/dist/MS-MikLSXO-.cjs +0 -2
  181. package/dist/MS-MikLSXO-.cjs.map +0 -1
  182. package/dist/MT-BzUTgqTr.cjs +0 -2
  183. package/dist/MT-BzUTgqTr.cjs.map +0 -1
  184. package/dist/MT-DEqs4lmz.js +0 -12
  185. package/dist/MT-DEqs4lmz.js.map +0 -1
  186. package/dist/PA-BmFg98qS.cjs +0 -2
  187. package/dist/PA-BmFg98qS.cjs.map +0 -1
  188. package/dist/PA-DCJkLLiT.js +0 -12
  189. package/dist/PA-DCJkLLiT.js.map +0 -1
  190. package/dist/PB-_6qWqUQe.js +0 -12
  191. package/dist/PB-_6qWqUQe.js.map +0 -1
  192. package/dist/PB-cCwnP4jh.cjs +0 -2
  193. package/dist/PB-cCwnP4jh.cjs.map +0 -1
  194. package/dist/PE-BCeDGzmC.cjs +0 -2
  195. package/dist/PE-BCeDGzmC.cjs.map +0 -1
  196. package/dist/PE-DhAJD50w.js +0 -12
  197. package/dist/PE-DhAJD50w.js.map +0 -1
  198. package/dist/PI-8mJVmMWn.cjs +0 -2
  199. package/dist/PI-8mJVmMWn.cjs.map +0 -1
  200. package/dist/PI-BBpuVgnF.js +0 -12
  201. package/dist/PI-BBpuVgnF.js.map +0 -1
  202. package/dist/PR-Ck8PsNQr.cjs +0 -2
  203. package/dist/PR-Ck8PsNQr.cjs.map +0 -1
  204. package/dist/PR-DIU_pEzX.js +0 -12
  205. package/dist/PR-DIU_pEzX.js.map +0 -1
  206. package/dist/RJ-BM_31L8v.js +0 -12
  207. package/dist/RJ-BM_31L8v.js.map +0 -1
  208. package/dist/RJ-RO2nzm45.cjs +0 -2
  209. package/dist/RJ-RO2nzm45.cjs.map +0 -1
  210. package/dist/RN-CGDsj5y7.cjs +0 -2
  211. package/dist/RN-CGDsj5y7.cjs.map +0 -1
  212. package/dist/RN-Cb6kQMBf.js +0 -12
  213. package/dist/RN-Cb6kQMBf.js.map +0 -1
  214. package/dist/RO-DQlMmLkh.js +0 -12
  215. package/dist/RO-DQlMmLkh.js.map +0 -1
  216. package/dist/RO-bBzN2q3e.cjs +0 -2
  217. package/dist/RO-bBzN2q3e.cjs.map +0 -1
  218. package/dist/RR-27xmMYjp.cjs +0 -2
  219. package/dist/RR-27xmMYjp.cjs.map +0 -1
  220. package/dist/RR-DT5Iz7pA.js +0 -12
  221. package/dist/RR-DT5Iz7pA.js.map +0 -1
  222. package/dist/RS-Ax08xnx2.cjs +0 -2
  223. package/dist/RS-Ax08xnx2.cjs.map +0 -1
  224. package/dist/RS-Be6-eibq.js +0 -12
  225. package/dist/RS-Be6-eibq.js.map +0 -1
  226. package/dist/SC-CR4B6n9K.js +0 -12
  227. package/dist/SC-CR4B6n9K.js.map +0 -1
  228. package/dist/SC-D7CvUmBl.cjs +0 -2
  229. package/dist/SC-D7CvUmBl.cjs.map +0 -1
  230. package/dist/SE-DYnzRCQV.js +0 -12
  231. package/dist/SE-DYnzRCQV.js.map +0 -1
  232. package/dist/SE-fXsuEuvK.cjs +0 -2
  233. package/dist/SE-fXsuEuvK.cjs.map +0 -1
  234. package/dist/SP-Cks7QGPk.cjs +0 -2
  235. package/dist/SP-Cks7QGPk.cjs.map +0 -1
  236. package/dist/SP-D7R54yvO.js +0 -12
  237. package/dist/SP-D7R54yvO.js.map +0 -1
  238. package/dist/TO-CWXJNpx2.js +0 -12
  239. package/dist/TO-CWXJNpx2.js.map +0 -1
  240. package/dist/TO-DyvJcNhT.cjs +0 -2
  241. package/dist/TO-DyvJcNhT.cjs.map +0 -1
  242. package/dist/br-geo-Q_VQpVMX.js +0 -8
  243. package/dist/br-geo-Q_VQpVMX.js.map +0 -1
  244. package/dist/br-geo-rADqOFQL.cjs +0 -2
  245. package/dist/br-geo-rADqOFQL.cjs.map +0 -1
  246. package/dist/projection-C2VXUKZJ.js +0 -124
  247. package/dist/projection-C2VXUKZJ.js.map +0 -1
  248. package/dist/projection-CkMNK7HA.cjs +0 -2
  249. package/dist/projection-CkMNK7HA.cjs.map +0 -1
package/dist/br.d.ts CHANGED
@@ -20,7 +20,7 @@ import { ReactNode } from 'react';
20
20
  * // Choropleth by a metric per state
21
21
  * <BrazilMap values={{ SP: 120, RJ: 90, MG: 60 }} />
22
22
  */
23
- export declare function BrazilMap({ selected, onSelect, values, minColor, maxColor, height, padding, showLabels, label, loadingContent, className, style, ...rest }: BrazilMapProps): JSX.Element;
23
+ export declare function BrazilMap({ selected, onSelect, values, minColor, maxColor, colorScale, colorByRegion, height, padding, showLabels, label, loadingContent, showTooltip, renderTooltip, markers, onMarkerClick, zoomable, className, style, ...rest }: BrazilMapProps): JSX.Element;
24
24
 
25
25
  export declare interface BrazilMapProps extends Omit<HTMLAttributes<HTMLDivElement>, "onSelect"> {
26
26
  /** Currently selected UF(s) — highlighted. Accepts one or many. */
@@ -33,10 +33,20 @@ export declare interface BrazilMapProps extends Omit<HTMLAttributes<HTMLDivEleme
33
33
  * use the base surface color.
34
34
  */
35
35
  values?: Partial<Record<UF, number>>;
36
- /** Choropleth low-end color. Default: a light primary tint. */
36
+ /** Choropleth low-end color (2-color linear ramp). Default: a light primary tint. */
37
37
  minColor?: string;
38
- /** Choropleth high-end color. Default: the primary token. */
38
+ /** Choropleth high-end color (2-color linear ramp). Default: the primary token. */
39
39
  maxColor?: string;
40
+ /**
41
+ * Custom value→color scale (e.g. from `sequentialScale`/`quantizeScale`).
42
+ * Takes precedence over `minColor`/`maxColor`. Pair with a `<MapLegend>`.
43
+ */
44
+ colorScale?: ColorScale;
45
+ /**
46
+ * Tint each state by its macro-region (categorical). Overrides
47
+ * `values`/`colorScale`. Pair with `<MapLegend items={regionLegendItems()} />`.
48
+ */
49
+ colorByRegion?: boolean;
40
50
  /** Viewport height in pixels. Default: `440`. */
41
51
  height?: number;
42
52
  /** Inner padding in pixels. Default: `12`. */
@@ -47,6 +57,24 @@ export declare interface BrazilMapProps extends Omit<HTMLAttributes<HTMLDivEleme
47
57
  label?: string;
48
58
  /** Custom content when the geometry is still loading. */
49
59
  loadingContent?: ReactNode;
60
+ /** Show a floating tooltip (name + region + city count + value) on hover. Default: `true`. */
61
+ showTooltip?: boolean;
62
+ /** Override the default tooltip content. */
63
+ renderTooltip?: (data: BrazilMapTooltipData) => ReactNode;
64
+ /** Point markers to overlay on the map (e.g. capitals, stores). */
65
+ markers?: readonly GeoMarker[];
66
+ /** Fired when a marker is clicked. */
67
+ onMarkerClick?: (marker: GeoMarker, index: number) => void;
68
+ /** Enable wheel-zoom + drag-pan (double-click resets). Default: `false`. */
69
+ zoomable?: boolean;
70
+ }
71
+
72
+ /** Data passed to a {@link BrazilMapProps.renderTooltip} callback. */
73
+ export declare interface BrazilMapTooltipData {
74
+ uf: UF;
75
+ name: string;
76
+ /** Choropleth value for this UF, if `values` was provided. */
77
+ value?: number;
50
78
  }
51
79
 
52
80
  /** A federative unit with its display name and city list. */
@@ -115,7 +143,7 @@ export declare interface BrazilStateCitySelectProps {
115
143
  * // Choropleth of a metric by municipality name
116
144
  * <BrazilStateMap uf="RJ" values={{ "Rio de Janeiro": 100, Niterói: 40 }} />
117
145
  */
118
- export declare function BrazilStateMap({ uf, selected, onSelect, values, minColor, maxColor, height, padding, showLabels, label, loadingContent, className, style, ...rest }: BrazilStateMapProps): JSX.Element;
146
+ export declare function BrazilStateMap({ uf, selected, onSelect, values, minColor, maxColor, colorScale, height, padding, showLabels, label, loadingContent, showTooltip, renderTooltip, markers, onMarkerClick, zoomable, className, style, ...rest }: BrazilStateMapProps): JSX.Element;
119
147
 
120
148
  export declare interface BrazilStateMapProps extends Omit<HTMLAttributes<HTMLDivElement>, "onSelect"> {
121
149
  /** Federative unit to draw (required). */
@@ -129,10 +157,15 @@ export declare interface BrazilStateMapProps extends Omit<HTMLAttributes<HTMLDiv
129
157
  * municipality is tinted between `minColor` and `maxColor`.
130
158
  */
131
159
  values?: Record<string, number>;
132
- /** Choropleth low-end color. Default: a light primary tint. */
160
+ /** Choropleth low-end color (2-color linear ramp). Default: a light primary tint. */
133
161
  minColor?: string;
134
- /** Choropleth high-end color. Default: the primary token. */
162
+ /** Choropleth high-end color (2-color linear ramp). Default: the primary token. */
135
163
  maxColor?: string;
164
+ /**
165
+ * Custom value→color scale (from `sequentialScale`/`quantizeScale`). Takes
166
+ * precedence over `minColor`/`maxColor`. Pair with a `<MapLegend>`.
167
+ */
168
+ colorScale?: ColorScale;
136
169
  /** Viewport height in pixels. Default: `440`. */
137
170
  height?: number;
138
171
  /** Inner padding in pixels. Default: `12`. */
@@ -146,6 +179,22 @@ export declare interface BrazilStateMapProps extends Omit<HTMLAttributes<HTMLDiv
146
179
  label?: string;
147
180
  /** Content while the state geometry is loading. */
148
181
  loadingContent?: ReactNode;
182
+ /** Show a floating tooltip (name + IBGE code + value) on hover. Default: `true`. */
183
+ showTooltip?: boolean;
184
+ /** Override the default tooltip content. */
185
+ renderTooltip?: (data: BrazilStateMapTooltipData) => ReactNode;
186
+ /** Point markers to overlay on the state (e.g. addresses, POIs). */
187
+ markers?: readonly GeoMarker[];
188
+ /** Fired when a marker is clicked. */
189
+ onMarkerClick?: (marker: GeoMarker, index: number) => void;
190
+ /** Enable wheel-zoom + drag-pan (double-click resets). Default: `false`. */
191
+ zoomable?: boolean;
192
+ }
193
+
194
+ /** Data passed to a {@link BrazilStateMapProps.renderTooltip} callback. */
195
+ export declare interface BrazilStateMapTooltipData extends Municipality {
196
+ /** Choropleth value for this municipality, if `values` was provided. */
197
+ value?: number;
149
198
  }
150
199
 
151
200
  /** The five Brazilian macro-regions (IBGE). */
@@ -158,6 +207,8 @@ export declare interface BrUfFeature {
158
207
  uf: UF;
159
208
  name: string;
160
209
  region: BrRegion;
210
+ /** Representative point `[longitude, latitude]` (area-weighted centroid). */
211
+ centroid: [number, number];
161
212
  };
162
213
  geometry: BrUfGeometry;
163
214
  }
@@ -190,15 +241,84 @@ export declare function citiesByUf(uf: string): string[];
190
241
  /** `{ value, label }` options for every city in a UF (value === label). */
191
242
  export declare function cityChoices(uf: string): Choice[];
192
243
 
244
+ /** Maps a numeric value to a CSS color string. */
245
+ export declare type ColorScale = (value: number) => string;
246
+
247
+ /**
248
+ * WGS84 geographic coordinate. Mirrors the `Coordinate` schema from
249
+ * `tempest-fastapi-sdk` (`geo/schemas.py`) — `latitude` in `[-90, 90]`,
250
+ * `longitude` in `[-180, 180]`, serialized snake_case on the wire.
251
+ */
252
+ declare interface Coordinate {
253
+ /** WGS84 latitude in degrees, `[-90, 90]`. E.g. `-23.5505`. */
254
+ latitude: number;
255
+ /** WGS84 longitude in degrees, `[-180, 180]`. E.g. `-46.6333`. */
256
+ longitude: number;
257
+ }
258
+
259
+ /** Diverging palette (red ↔ neutral ↔ blue), for signed metrics. */
260
+ export declare const DIVERGING_RDBU: readonly ["#b2182b", "#ef8a62", "#fddbc7", "#d1e5f0", "#67a9cf", "#2166ac"];
261
+
262
+ /** A ready-to-use mapping from coordinates to viewport pixels. */
263
+ declare interface FittedProjection {
264
+ /** Project a coordinate to a pixel inside the viewport. */
265
+ project: (coord: Coordinate) => PixelPoint;
266
+ /** Uniform scale (unit-plane → pixels) actually used, after aspect fit. */
267
+ scale: number;
268
+ /** Viewport width in pixels. */
269
+ width: number;
270
+ /** Viewport height in pixels. */
271
+ height: number;
272
+ }
273
+
274
+ /**
275
+ * Forward-geocode a municipality by name (accent-insensitive), optionally scoped
276
+ * to a UF. Returns every exact-name match — the same name can occur in several
277
+ * states (e.g. "Bonito").
278
+ *
279
+ * @param name - Municipality name.
280
+ * @param uf - Optional UF to restrict the search.
281
+ * @returns Matching municipalities (empty array when none match).
282
+ */
283
+ export declare function geocodeMunicipality(name: string, uf?: UF): Promise<MunicipalityCentroid[]>;
284
+
285
+ /**
286
+ * A pin plotted on a map: a {@link Coordinate} plus optional presentation and
287
+ * an identity used for click callbacks. Shared by `TrajectoryMap` and the
288
+ * Brazil maps' `markers` prop.
289
+ */
290
+ export declare interface GeoMarker extends Coordinate {
291
+ /** Stable identity (returned by click handlers). Falls back to the index. */
292
+ id?: string;
293
+ /** Tooltip / accessible label for the pin. */
294
+ label?: string;
295
+ /** Fill color. Defaults to the primary token. */
296
+ color?: string;
297
+ /** Radius in pixels. Default: 6. */
298
+ radius?: number;
299
+ }
300
+
193
301
  /** Look up a single state by acronym (case-insensitive). Returns `null` if unknown. */
194
302
  export declare function getState(uf: string): BrazilState | null;
195
303
 
304
+ /**
305
+ * Interpolate a palette at `t ∈ [0, 1]`, blending between the two nearest
306
+ * stops. `t <= 0` → first color, `t >= 1` → last.
307
+ */
308
+ export declare function interpolatePalette(palette: readonly string[], t: number): string;
309
+
196
310
  /** True when `city` exists within `uf` (both case-insensitive). */
197
311
  export declare function isValidCity(uf: string, city: string): boolean;
198
312
 
199
313
  /** True when `value` is one of the 27 valid acronyms (case-insensitive). */
200
314
  export declare function isValidUf(value: string): boolean;
201
315
 
316
+ /** A discrete legend entry. */
317
+ export declare interface LegendItem {
318
+ color: string;
319
+ label: ReactNode;
320
+ }
321
+
202
322
  /** All 27 federative units, sorted by name. */
203
323
  export declare function listStates(): readonly BrazilState[];
204
324
 
@@ -222,6 +342,62 @@ export declare function loadBrUfGeoJson(): Promise<BrUfFeatureCollection>;
222
342
  */
223
343
  export declare function loadStateMunicipalities(uf: UF): Promise<StateMunicipalities | null>;
224
344
 
345
+ /**
346
+ * Legend for a choropleth map. Renders a **continuous gradient** (with
347
+ * min/mid/max ticks) from `min`/`max`/`palette`, or **discrete swatches** when
348
+ * `items` is given. Pair it with a `BrazilMap`/`BrazilStateMap` `colorScale`.
349
+ *
350
+ * @example
351
+ * // Continuous, matching a sequentialScale(0, 100)
352
+ * <MapLegend title="Vendas" min={0} max={100} palette={SEQUENTIAL_BLUES} />
353
+ *
354
+ * @example
355
+ * // Discrete buckets
356
+ * <MapLegend
357
+ * title="Faixa"
358
+ * items={[
359
+ * { color: "#c6dbef", label: "< 10" },
360
+ * { color: "#6baed6", label: "10–50" },
361
+ * { color: "#08519c", label: "> 50" },
362
+ * ]}
363
+ * />
364
+ */
365
+ export declare function MapLegend({ title, items, min, max, palette, format, className, ...rest }: MapLegendProps): JSX.Element;
366
+
367
+ export declare interface MapLegendProps extends Omit<HTMLAttributes<HTMLDivElement>, "title"> {
368
+ /** Legend heading. */
369
+ title?: ReactNode;
370
+ /**
371
+ * Discrete entries (swatch + label). When provided the legend renders in
372
+ * "steps" mode; otherwise it renders a continuous gradient from `min`/`max`.
373
+ */
374
+ items?: readonly LegendItem[];
375
+ /** Continuous mode: low end of the domain. */
376
+ min?: number;
377
+ /** Continuous mode: high end of the domain. */
378
+ max?: number;
379
+ /** Continuous mode: palette (light → dark). Default: sequential blues. */
380
+ palette?: readonly string[];
381
+ /** Continuous mode: format the min/mid/max tick labels. */
382
+ format?: (value: number) => string;
383
+ }
384
+
385
+ /**
386
+ * SVG overlay of point markers, projected with the host map's projection so
387
+ * they align with its shapes. Each marker carries a native `<title>` (its
388
+ * `label`) and is clickable when `onMarkerClick` is set.
389
+ */
390
+ export declare function MapMarkers({ projection, markers, onMarkerClick }: MapMarkersProps): JSX.Element;
391
+
392
+ export declare interface MapMarkersProps {
393
+ /** Projection used by the host map (markers must share it to line up). */
394
+ projection: FittedProjection;
395
+ /** Pins to plot. */
396
+ markers: readonly GeoMarker[];
397
+ /** Fired when a marker is clicked. */
398
+ onMarkerClick?: (marker: GeoMarker, index: number) => void;
399
+ }
400
+
225
401
  /** A municipality identified for selection callbacks. */
226
402
  export declare interface Municipality {
227
403
  /** 7-digit IBGE code. */
@@ -230,6 +406,26 @@ export declare interface Municipality {
230
406
  name: string;
231
407
  }
232
408
 
409
+ /** A municipality with its representative coordinate (IBGE centroid). */
410
+ export declare interface MunicipalityCentroid {
411
+ /** 7-digit IBGE code. */
412
+ id: string;
413
+ /** Municipality name. */
414
+ name: string;
415
+ /** Federative unit. */
416
+ uf: UF;
417
+ latitude: number;
418
+ longitude: number;
419
+ }
420
+
421
+ /**
422
+ * Centroid of a municipality by IBGE code.
423
+ *
424
+ * @param id - 7-digit IBGE code.
425
+ * @returns The municipality centroid, or `null` if unknown.
426
+ */
427
+ export declare function municipalityCentroid(id: string): Promise<MunicipalityCentroid | null>;
428
+
233
429
  /** One municipality feature within a state. */
234
430
  export declare interface MunicipalityFeature {
235
431
  type: "Feature";
@@ -238,19 +434,163 @@ export declare interface MunicipalityFeature {
238
434
  id: string;
239
435
  /** Municipality name. */
240
436
  name: string;
437
+ /** Representative point `[longitude, latitude]` (area-weighted centroid). */
438
+ centroid: [number, number];
241
439
  };
242
440
  geometry: BrUfGeometry;
243
441
  }
244
442
 
443
+ /**
444
+ * Debounced municipality autocomplete backed by the offline
445
+ * {@link searchMunicipalities} index — no network. Type a partial name, pick a
446
+ * result, and `onSelect` fires with its `{ id, name, uf, latitude, longitude }`.
447
+ * Wire `onSelect` to a `BrazilStateMap` `selected` to highlight it on the map.
448
+ *
449
+ * @example
450
+ * const [uf, setUf] = useState<UF>("SP");
451
+ * const [city, setCity] = useState<string | null>(null);
452
+ * <MunicipalitySearch uf={uf} onSelect={(m) => setCity(m.name)} />
453
+ * <BrazilStateMap uf={uf} selected={city} />
454
+ */
455
+ export declare function MunicipalitySearch({ uf, onSelect, label, placeholder, limit, debounceMs, disabled, }: MunicipalitySearchProps): ReactElement;
456
+
457
+ export declare interface MunicipalitySearchProps {
458
+ /** Restrict the search to a single UF. */
459
+ uf?: UF;
460
+ /** Fired when a municipality is picked from the results. */
461
+ onSelect: (municipality: MunicipalityCentroid) => void;
462
+ /** Field label. */
463
+ label?: string;
464
+ /** Input placeholder. Default: `"Buscar município…"`. */
465
+ placeholder?: string;
466
+ /** Max results shown. Default: `8`. */
467
+ limit?: number;
468
+ /** Debounce in ms before searching. Default: `250`. */
469
+ debounceMs?: number;
470
+ /** Disable the field. */
471
+ disabled?: boolean;
472
+ }
473
+
474
+ /** {@link MunicipalityCentroid} plus the distance from the query point. */
475
+ export declare interface NearestMunicipality extends MunicipalityCentroid {
476
+ /** Great-circle distance from the query coordinate, in kilometers. */
477
+ distanceKm: number;
478
+ }
479
+
480
+ /**
481
+ * Nearest Brazilian municipality to a coordinate by **centroid distance** —
482
+ * fast and geometry-free (only the small centroid index loads). Approximate:
483
+ * near borders or inside large municipalities a neighbor's centroid can be
484
+ * closer. For an exact containing municipality use {@link reverseGeocode}.
485
+ *
486
+ * @param coord - Query coordinate.
487
+ * @returns The nearest municipality with `distanceKm`, or `null` if the index
488
+ * is somehow empty.
489
+ *
490
+ * @example
491
+ * const near = await nearestMunicipality({ latitude: -23.55, longitude: -46.63 });
492
+ * // { id, name, uf: "SP", …, distanceKm }
493
+ */
494
+ export declare function nearestMunicipality(coord: Coordinate): Promise<NearestMunicipality | null>;
495
+
245
496
  /**
246
497
  * Normalize an acronym to canonical uppercase form, or `null` if it is not a
247
498
  * valid UF. `"sp"` → `"SP"`, `"xx"` → `null`.
248
499
  */
249
500
  export declare function normalizeUf(value: string): UF | null;
250
501
 
502
+ /** A pixel coordinate inside the plotting viewport. */
503
+ declare interface PixelPoint {
504
+ x: number;
505
+ y: number;
506
+ }
507
+
508
+ /**
509
+ * Discrete scale: split `[min, max]` into `palette.length` equal buckets and
510
+ * return the bucket's color (a classic choropleth "quantize" scale).
511
+ */
512
+ export declare function quantizeScale(min: number, max: number, palette?: readonly string[]): ColorScale;
513
+
514
+ /**
515
+ * Categorical, distinguishable colors for the five IBGE macro-regions
516
+ * (Tableau-10 family). Swap for your brand palette if needed.
517
+ */
518
+ export declare const REGION_COLORS: Record<BrRegion, string>;
519
+
520
+ /** Legend entries (swatch + region name) for a region-colored map. */
521
+ export declare function regionLegendItems(): LegendItem[];
522
+
523
+ /**
524
+ * Exact reverse-geocode: the municipality whose (simplified) boundary
525
+ * **contains** the coordinate, via point-in-polygon. Loads one state's geometry
526
+ * chunk — pass `uf` when you know it to skip the centroid lookup that picks the
527
+ * candidate state. Boundaries are simplified (~2 km), so points within ~1-2 km
528
+ * of a border may resolve to the neighbor; offshore points return `null`.
529
+ *
530
+ * @param coord - Query coordinate.
531
+ * @param options - `uf` to force the state searched.
532
+ * @returns The containing municipality, or `null` (falls back to the nearest
533
+ * centroid municipality when the point is inside no polygon of the state).
534
+ *
535
+ * @example
536
+ * const here = await reverseGeocode({ latitude: -23.5505, longitude: -46.6333 });
537
+ * // { id: "3550308", name: "São Paulo", uf: "SP" }
538
+ */
539
+ export declare function reverseGeocode(coord: Coordinate, options?: {
540
+ uf?: UF;
541
+ }): Promise<ReverseGeocodeResult | null>;
542
+
543
+ /** A municipality identified by point-in-polygon (see {@link reverseGeocode}). */
544
+ export declare interface ReverseGeocodeResult {
545
+ id: string;
546
+ name: string;
547
+ uf: UF;
548
+ }
549
+
251
550
  /** A ring of `[longitude, latitude]` pairs. */
252
551
  export declare type Ring = [number, number][];
253
552
 
553
+ /**
554
+ * Substring search over municipality names (accent-insensitive), for
555
+ * autocomplete. Ranked prefix-first, then alphabetically.
556
+ *
557
+ * @param query - Partial name.
558
+ * @param options - `uf` to scope, `limit` (default 20).
559
+ * @returns Ranked matches.
560
+ */
561
+ export declare function searchMunicipalities(query: string, options?: {
562
+ uf?: UF;
563
+ limit?: number;
564
+ }): Promise<MunicipalityCentroid[]>;
565
+
566
+ /**
567
+ * Sequential, colorblind-safe palettes (ColorBrewer / Viridis families, public
568
+ * domain). Ordered light → dark. Swap for your brand ramp if needed — any
569
+ * ordered list of hex colors works with the scale builders below.
570
+ */
571
+ export declare const SEQUENTIAL_BLUES: readonly ["#eff3ff", "#c6dbef", "#9ecae1", "#6baed6", "#3182bd", "#08519c"];
572
+
573
+ export declare const SEQUENTIAL_GREENS: readonly ["#edf8e9", "#c7e9c0", "#a1d99b", "#74c476", "#31a354", "#006d2c"];
574
+
575
+ export declare const SEQUENTIAL_VIRIDIS: readonly ["#440154", "#414487", "#2a788e", "#22a884", "#7ad151", "#fde725"];
576
+
577
+ /**
578
+ * Continuous scale: linearly interpolate `palette` across `[min, max]`.
579
+ *
580
+ * @example
581
+ * const color = sequentialScale(0, 100, SEQUENTIAL_BLUES);
582
+ * <BrazilMap values={data} colorScale={color} />;
583
+ */
584
+ export declare function sequentialScale(min: number, max: number, palette?: readonly string[]): ColorScale;
585
+
586
+ /**
587
+ * Centroid of a federative unit.
588
+ *
589
+ * @param uf - Federative unit acronym.
590
+ * @returns The state centroid, or `null` if unknown.
591
+ */
592
+ export declare function stateCentroid(uf: UF): Promise<Coordinate | null>;
593
+
254
594
  /** Municipality boundaries for a single federative unit. */
255
595
  export declare interface StateMunicipalities {
256
596
  type: "FeatureCollection";
@@ -262,6 +602,16 @@ export declare interface StateMunicipalities {
262
602
  /** States belonging to a macro-region. */
263
603
  export declare function statesByRegion(region: BrRegion): readonly BrazilState[];
264
604
 
605
+ /**
606
+ * Threshold scale: `palette[i]` applies to values in
607
+ * `[thresholds[i-1], thresholds[i])`. `palette` must have
608
+ * `thresholds.length + 1` entries.
609
+ *
610
+ * @example
611
+ * const color = thresholdScale([10, 50, 100], SEQUENTIAL_GREENS.slice(0, 4));
612
+ */
613
+ export declare function thresholdScale(thresholds: readonly number[], palette: readonly string[]): ColorScale;
614
+
265
615
  /** The 27 Brazilian federative units (26 states + Federal District). */
266
616
  export declare type UF = "AC" | "AL" | "AP" | "AM" | "BA" | "CE" | "DF" | "ES" | "GO" | "MA" | "MT" | "MS" | "MG" | "PA" | "PB" | "PR" | "PE" | "PI" | "RJ" | "RN" | "RS" | "RO" | "RR" | "SC" | "SP" | "SE" | "TO";
267
617