tempest-react-sdk 0.15.0 → 0.17.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 (128) hide show
  1. package/README.md +3 -1
  2. package/dist/AC-BQUmmKrw.cjs +2 -0
  3. package/dist/AC-BQUmmKrw.cjs.map +1 -0
  4. package/dist/AC-DOvYXax1.js +12 -0
  5. package/dist/AC-DOvYXax1.js.map +1 -0
  6. package/dist/AL-DH1wKIxj.js +12 -0
  7. package/dist/AL-DH1wKIxj.js.map +1 -0
  8. package/dist/AL-oN2X02DP.cjs +2 -0
  9. package/dist/AL-oN2X02DP.cjs.map +1 -0
  10. package/dist/AM-Cn_JOc_u.cjs +2 -0
  11. package/dist/AM-Cn_JOc_u.cjs.map +1 -0
  12. package/dist/AM-D-l4ioxq.js +12 -0
  13. package/dist/AM-D-l4ioxq.js.map +1 -0
  14. package/dist/AP-B8H3590m.cjs +2 -0
  15. package/dist/AP-B8H3590m.cjs.map +1 -0
  16. package/dist/AP-pl_IXUrz.js +12 -0
  17. package/dist/AP-pl_IXUrz.js.map +1 -0
  18. package/dist/BA-DsPuESbp.cjs +2 -0
  19. package/dist/BA-DsPuESbp.cjs.map +1 -0
  20. package/dist/BA-HvFNaSvC.js +12 -0
  21. package/dist/BA-HvFNaSvC.js.map +1 -0
  22. package/dist/CE-BhzlM8v8.cjs +2 -0
  23. package/dist/CE-BhzlM8v8.cjs.map +1 -0
  24. package/dist/CE-C4VCDB2_.js +12 -0
  25. package/dist/CE-C4VCDB2_.js.map +1 -0
  26. package/dist/DF-CdR_I7qu.cjs +2 -0
  27. package/dist/DF-CdR_I7qu.cjs.map +1 -0
  28. package/dist/DF-DCepvNQG.js +12 -0
  29. package/dist/DF-DCepvNQG.js.map +1 -0
  30. package/dist/ES-BNECOgN8.js +12 -0
  31. package/dist/ES-BNECOgN8.js.map +1 -0
  32. package/dist/ES-CzZdWdcw.cjs +2 -0
  33. package/dist/ES-CzZdWdcw.cjs.map +1 -0
  34. package/dist/GO-CTgkFwbh.js +12 -0
  35. package/dist/GO-CTgkFwbh.js.map +1 -0
  36. package/dist/GO-VqQUIkMG.cjs +2 -0
  37. package/dist/GO-VqQUIkMG.cjs.map +1 -0
  38. package/dist/MA-CwpNlEs4.cjs +2 -0
  39. package/dist/MA-CwpNlEs4.cjs.map +1 -0
  40. package/dist/MA-DC3zmbpX.js +12 -0
  41. package/dist/MA-DC3zmbpX.js.map +1 -0
  42. package/dist/MG-DLTyPn6U.js +12 -0
  43. package/dist/MG-DLTyPn6U.js.map +1 -0
  44. package/dist/MG-P3ePmTdM.cjs +2 -0
  45. package/dist/MG-P3ePmTdM.cjs.map +1 -0
  46. package/dist/MS-Crc916be.js +12 -0
  47. package/dist/MS-Crc916be.js.map +1 -0
  48. package/dist/MS-MikLSXO-.cjs +2 -0
  49. package/dist/MS-MikLSXO-.cjs.map +1 -0
  50. package/dist/MT-BzUTgqTr.cjs +2 -0
  51. package/dist/MT-BzUTgqTr.cjs.map +1 -0
  52. package/dist/MT-DEqs4lmz.js +12 -0
  53. package/dist/MT-DEqs4lmz.js.map +1 -0
  54. package/dist/PA-BmFg98qS.cjs +2 -0
  55. package/dist/PA-BmFg98qS.cjs.map +1 -0
  56. package/dist/PA-DCJkLLiT.js +12 -0
  57. package/dist/PA-DCJkLLiT.js.map +1 -0
  58. package/dist/PB-_6qWqUQe.js +12 -0
  59. package/dist/PB-_6qWqUQe.js.map +1 -0
  60. package/dist/PB-cCwnP4jh.cjs +2 -0
  61. package/dist/PB-cCwnP4jh.cjs.map +1 -0
  62. package/dist/PE-BCeDGzmC.cjs +2 -0
  63. package/dist/PE-BCeDGzmC.cjs.map +1 -0
  64. package/dist/PE-DhAJD50w.js +12 -0
  65. package/dist/PE-DhAJD50w.js.map +1 -0
  66. package/dist/PI-8mJVmMWn.cjs +2 -0
  67. package/dist/PI-8mJVmMWn.cjs.map +1 -0
  68. package/dist/PI-BBpuVgnF.js +12 -0
  69. package/dist/PI-BBpuVgnF.js.map +1 -0
  70. package/dist/PR-Ck8PsNQr.cjs +2 -0
  71. package/dist/PR-Ck8PsNQr.cjs.map +1 -0
  72. package/dist/PR-DIU_pEzX.js +12 -0
  73. package/dist/PR-DIU_pEzX.js.map +1 -0
  74. package/dist/RJ-BM_31L8v.js +12 -0
  75. package/dist/RJ-BM_31L8v.js.map +1 -0
  76. package/dist/RJ-RO2nzm45.cjs +2 -0
  77. package/dist/RJ-RO2nzm45.cjs.map +1 -0
  78. package/dist/RN-CGDsj5y7.cjs +2 -0
  79. package/dist/RN-CGDsj5y7.cjs.map +1 -0
  80. package/dist/RN-Cb6kQMBf.js +12 -0
  81. package/dist/RN-Cb6kQMBf.js.map +1 -0
  82. package/dist/RO-DQlMmLkh.js +12 -0
  83. package/dist/RO-DQlMmLkh.js.map +1 -0
  84. package/dist/RO-bBzN2q3e.cjs +2 -0
  85. package/dist/RO-bBzN2q3e.cjs.map +1 -0
  86. package/dist/RR-27xmMYjp.cjs +2 -0
  87. package/dist/RR-27xmMYjp.cjs.map +1 -0
  88. package/dist/RR-DT5Iz7pA.js +12 -0
  89. package/dist/RR-DT5Iz7pA.js.map +1 -0
  90. package/dist/RS-Ax08xnx2.cjs +2 -0
  91. package/dist/RS-Ax08xnx2.cjs.map +1 -0
  92. package/dist/RS-Be6-eibq.js +12 -0
  93. package/dist/RS-Be6-eibq.js.map +1 -0
  94. package/dist/SC-CR4B6n9K.js +12 -0
  95. package/dist/SC-CR4B6n9K.js.map +1 -0
  96. package/dist/SC-D7CvUmBl.cjs +2 -0
  97. package/dist/SC-D7CvUmBl.cjs.map +1 -0
  98. package/dist/SE-DYnzRCQV.js +12 -0
  99. package/dist/SE-DYnzRCQV.js.map +1 -0
  100. package/dist/SE-fXsuEuvK.cjs +2 -0
  101. package/dist/SE-fXsuEuvK.cjs.map +1 -0
  102. package/dist/SP-Cks7QGPk.cjs +2 -0
  103. package/dist/SP-Cks7QGPk.cjs.map +1 -0
  104. package/dist/SP-D7R54yvO.js +12 -0
  105. package/dist/SP-D7R54yvO.js.map +1 -0
  106. package/dist/TO-CWXJNpx2.js +12 -0
  107. package/dist/TO-CWXJNpx2.js.map +1 -0
  108. package/dist/TO-DyvJcNhT.cjs +2 -0
  109. package/dist/TO-DyvJcNhT.cjs.map +1 -0
  110. package/dist/br-geo-Q_VQpVMX.js +8 -0
  111. package/dist/br-geo-Q_VQpVMX.js.map +1 -0
  112. package/dist/br-geo-rADqOFQL.cjs +2 -0
  113. package/dist/br-geo-rADqOFQL.cjs.map +1 -0
  114. package/dist/br.cjs +2 -0
  115. package/dist/br.cjs.map +1 -0
  116. package/dist/br.d.ts +271 -0
  117. package/dist/br.js +472 -0
  118. package/dist/br.js.map +1 -0
  119. package/dist/projection-C2VXUKZJ.js +124 -0
  120. package/dist/projection-C2VXUKZJ.js.map +1 -0
  121. package/dist/projection-CkMNK7HA.cjs +2 -0
  122. package/dist/projection-CkMNK7HA.cjs.map +1 -0
  123. package/dist/styles.css +1 -1
  124. package/dist/tempest-react-sdk.cjs +3 -3
  125. package/dist/tempest-react-sdk.cjs.map +1 -1
  126. package/dist/tempest-react-sdk.js +2643 -2749
  127. package/dist/tempest-react-sdk.js.map +1 -1
  128. package/package.json +6 -1
package/dist/br.d.ts ADDED
@@ -0,0 +1,271 @@
1
+ import { HTMLAttributes } from 'react';
2
+ import { JSX } from 'react/jsx-runtime';
3
+ import { ReactElement } from 'react';
4
+ import { ReactNode } from 'react';
5
+
6
+ /**
7
+ * Clickable choropleth map of Brazil's 27 federative units. Renders the bundled
8
+ * simplified UF GeoJSON as SVG paths — **no external tiles or paid API**. Click
9
+ * a state to fire `onSelect(uf)`; pass `selected` to highlight and `values` to
10
+ * tint states by a metric.
11
+ *
12
+ * The GeoJSON (~36 KB gzip) is loaded lazily, so importing this component does
13
+ * not pull the geometry until it actually mounts.
14
+ *
15
+ * @example
16
+ * const [uf, setUf] = useState<UF | null>(null);
17
+ * <BrazilMap selected={uf} onSelect={setUf} />
18
+ *
19
+ * @example
20
+ * // Choropleth by a metric per state
21
+ * <BrazilMap values={{ SP: 120, RJ: 90, MG: 60 }} />
22
+ */
23
+ export declare function BrazilMap({ selected, onSelect, values, minColor, maxColor, height, padding, showLabels, label, loadingContent, className, style, ...rest }: BrazilMapProps): JSX.Element;
24
+
25
+ export declare interface BrazilMapProps extends Omit<HTMLAttributes<HTMLDivElement>, "onSelect"> {
26
+ /** Currently selected UF(s) — highlighted. Accepts one or many. */
27
+ selected?: UF | readonly UF[] | null;
28
+ /** Fired when a state is clicked. */
29
+ onSelect?: (uf: UF) => void;
30
+ /**
31
+ * Optional choropleth values per UF. When set, each state is tinted between
32
+ * `minColor` and `maxColor` by its value (linear). States without a value
33
+ * use the base surface color.
34
+ */
35
+ values?: Partial<Record<UF, number>>;
36
+ /** Choropleth low-end color. Default: a light primary tint. */
37
+ minColor?: string;
38
+ /** Choropleth high-end color. Default: the primary token. */
39
+ maxColor?: string;
40
+ /** Viewport height in pixels. Default: `440`. */
41
+ height?: number;
42
+ /** Inner padding in pixels. Default: `12`. */
43
+ padding?: number;
44
+ /** Render the UF acronym at each state centroid. Default: `true`. */
45
+ showLabels?: boolean;
46
+ /** Accessible label for the map region. Default: `"Mapa do Brasil por estado"`. */
47
+ label?: string;
48
+ /** Custom content when the geometry is still loading. */
49
+ loadingContent?: ReactNode;
50
+ }
51
+
52
+ /** A federative unit with its display name and city list. */
53
+ export declare interface BrazilState {
54
+ /** Two-letter acronym, e.g. `"SP"`. */
55
+ uf: UF;
56
+ /** Full name, e.g. `"São Paulo"`. */
57
+ name: string;
58
+ /** Macro-region the state belongs to. */
59
+ region: BrRegion;
60
+ /** City names within the state, alphabetically. */
61
+ cities: string[];
62
+ }
63
+
64
+ /**
65
+ * Cascading Estado → Cidade selector backed by the bundled BR locations data —
66
+ * pick a state and the city list narrows to that UF's municipalities. No
67
+ * network, no external API. Complements {@link BrazilMap} (wire the map's
68
+ * `onSelect` to drive the same UF).
69
+ *
70
+ * @example
71
+ * <BrazilStateCitySelect onChange={({ uf, city }) => console.log(uf, city)} />
72
+ */
73
+ export declare function BrazilStateCitySelect({ defaultUf, defaultCity, onChange, stateLabel, cityLabel, statePlaceholder, cityPlaceholder, disabled, layout, }: BrazilStateCitySelectProps): ReactElement;
74
+
75
+ /** Current selection emitted by {@link BrazilStateCitySelect}. */
76
+ export declare interface BrazilStateCitySelection {
77
+ /** Selected federative unit, or `null` when none. */
78
+ uf: UF | null;
79
+ /** Selected city, or `null` when none. */
80
+ city: string | null;
81
+ }
82
+
83
+ export declare interface BrazilStateCitySelectProps {
84
+ /** Pre-selected UF (uncontrolled initial value). */
85
+ defaultUf?: UF;
86
+ /** Pre-selected city (uncontrolled initial value). */
87
+ defaultCity?: string;
88
+ /** Fired whenever the state or city changes. */
89
+ onChange?: (selection: BrazilStateCitySelection) => void;
90
+ /** Label for the state select. Default: `"Estado"`. */
91
+ stateLabel?: string;
92
+ /** Label for the city select. Default: `"Cidade"`. */
93
+ cityLabel?: string;
94
+ /** Placeholder for the state select. Default: `"Selecione o estado"`. */
95
+ statePlaceholder?: string;
96
+ /** Placeholder for the city select. Default: `"Selecione a cidade"`. */
97
+ cityPlaceholder?: string;
98
+ /** Disable both selects. */
99
+ disabled?: boolean;
100
+ /** Layout of the two selects. Default: `"row"`. */
101
+ layout?: "row" | "column";
102
+ }
103
+
104
+ /**
105
+ * Clickable submap of a single Brazilian state showing **all its
106
+ * municipalities** as SVG paths — no external tiles or paid API. The state's
107
+ * geometry (~40-70 KB gzip) is loaded lazily per UF, so switching states fetches
108
+ * only what is shown.
109
+ *
110
+ * @example
111
+ * const [city, setCity] = useState<string | null>(null);
112
+ * <BrazilStateMap uf="SP" selected={city} onSelect={(m) => setCity(m.name)} />
113
+ *
114
+ * @example
115
+ * // Choropleth of a metric by municipality name
116
+ * <BrazilStateMap uf="RJ" values={{ "Rio de Janeiro": 100, Niterói: 40 }} />
117
+ */
118
+ export declare function BrazilStateMap({ uf, selected, onSelect, values, minColor, maxColor, height, padding, showLabels, label, loadingContent, className, style, ...rest }: BrazilStateMapProps): JSX.Element;
119
+
120
+ export declare interface BrazilStateMapProps extends Omit<HTMLAttributes<HTMLDivElement>, "onSelect"> {
121
+ /** Federative unit to draw (required). */
122
+ uf: UF;
123
+ /** Selected municipality — matched by IBGE `id` or by `name`. Accepts many. */
124
+ selected?: string | readonly string[] | null;
125
+ /** Fired when a municipality is clicked. */
126
+ onSelect?: (municipality: Municipality) => void;
127
+ /**
128
+ * Choropleth values keyed by municipality `id` **or** `name`. When set, each
129
+ * municipality is tinted between `minColor` and `maxColor`.
130
+ */
131
+ values?: Record<string, number>;
132
+ /** Choropleth low-end color. Default: a light primary tint. */
133
+ minColor?: string;
134
+ /** Choropleth high-end color. Default: the primary token. */
135
+ maxColor?: string;
136
+ /** Viewport height in pixels. Default: `440`. */
137
+ height?: number;
138
+ /** Inner padding in pixels. Default: `12`. */
139
+ padding?: number;
140
+ /**
141
+ * Render each municipality name at its centroid. Off by default — a state
142
+ * can have hundreds of municipalities and labels overlap badly.
143
+ */
144
+ showLabels?: boolean;
145
+ /** Accessible label. Default: derived from the state name. */
146
+ label?: string;
147
+ /** Content while the state geometry is loading. */
148
+ loadingContent?: ReactNode;
149
+ }
150
+
151
+ /** The five Brazilian macro-regions (IBGE). */
152
+ export declare type BrRegion = "Norte" | "Nordeste" | "Centro-Oeste" | "Sudeste" | "Sul";
153
+
154
+ /** One federative unit feature. */
155
+ export declare interface BrUfFeature {
156
+ type: "Feature";
157
+ properties: {
158
+ uf: UF;
159
+ name: string;
160
+ region: BrRegion;
161
+ };
162
+ geometry: BrUfGeometry;
163
+ }
164
+
165
+ /** The bundled, simplified GeoJSON of all 27 UF boundaries. */
166
+ export declare interface BrUfFeatureCollection {
167
+ type: "FeatureCollection";
168
+ features: BrUfFeature[];
169
+ }
170
+
171
+ /** GeoJSON geometry for a federative unit — always a (multi)polygon. */
172
+ export declare interface BrUfGeometry {
173
+ type: "Polygon" | "MultiPolygon";
174
+ /** `Polygon` → `Ring[]`; `MultiPolygon` → `Ring[][]`. */
175
+ coordinates: Ring[] | Ring[][];
176
+ }
177
+
178
+ /** A `{ value, label }` option, handy for `<Select>` / `<Combobox>`. */
179
+ export declare interface Choice {
180
+ value: string;
181
+ label: string;
182
+ }
183
+
184
+ /**
185
+ * City names for a federative unit (case-insensitive acronym). Returns an empty
186
+ * array for an unknown UF — "no matches" is a valid result, not an error.
187
+ */
188
+ export declare function citiesByUf(uf: string): string[];
189
+
190
+ /** `{ value, label }` options for every city in a UF (value === label). */
191
+ export declare function cityChoices(uf: string): Choice[];
192
+
193
+ /** Look up a single state by acronym (case-insensitive). Returns `null` if unknown. */
194
+ export declare function getState(uf: string): BrazilState | null;
195
+
196
+ /** True when `city` exists within `uf` (both case-insensitive). */
197
+ export declare function isValidCity(uf: string, city: string): boolean;
198
+
199
+ /** True when `value` is one of the 27 valid acronyms (case-insensitive). */
200
+ export declare function isValidUf(value: string): boolean;
201
+
202
+ /** All 27 federative units, sorted by name. */
203
+ export declare function listStates(): readonly BrazilState[];
204
+
205
+ /**
206
+ * Lazily load the bundled simplified UF GeoJSON (~36 KB gzip). Kept out of the
207
+ * synchronous barrel so a data-only import never pulls the geometry.
208
+ */
209
+ export declare function loadBrUfGeoJson(): Promise<BrUfFeatureCollection>;
210
+
211
+ /**
212
+ * Lazily load the simplified municipality GeoJSON for a federative unit. Each
213
+ * state's geometry is a separate chunk (~40-70 KB gzip), fetched on demand —
214
+ * the full ~2 MB municipal dataset never lands in one bundle.
215
+ *
216
+ * @param uf - Federative unit acronym (e.g. `"SP"`).
217
+ * @returns The municipality collection, or `null` for an unknown UF.
218
+ *
219
+ * @example
220
+ * const sp = await loadStateMunicipalities("SP");
221
+ * sp?.features.length; // 644
222
+ */
223
+ export declare function loadStateMunicipalities(uf: UF): Promise<StateMunicipalities | null>;
224
+
225
+ /** A municipality identified for selection callbacks. */
226
+ export declare interface Municipality {
227
+ /** 7-digit IBGE code. */
228
+ id: string;
229
+ /** Municipality name. */
230
+ name: string;
231
+ }
232
+
233
+ /** One municipality feature within a state. */
234
+ export declare interface MunicipalityFeature {
235
+ type: "Feature";
236
+ properties: {
237
+ /** 7-digit IBGE municipality code. */
238
+ id: string;
239
+ /** Municipality name. */
240
+ name: string;
241
+ };
242
+ geometry: BrUfGeometry;
243
+ }
244
+
245
+ /**
246
+ * Normalize an acronym to canonical uppercase form, or `null` if it is not a
247
+ * valid UF. `"sp"` → `"SP"`, `"xx"` → `null`.
248
+ */
249
+ export declare function normalizeUf(value: string): UF | null;
250
+
251
+ /** A ring of `[longitude, latitude]` pairs. */
252
+ export declare type Ring = [number, number][];
253
+
254
+ /** Municipality boundaries for a single federative unit. */
255
+ export declare interface StateMunicipalities {
256
+ type: "FeatureCollection";
257
+ /** The federative unit these municipalities belong to. */
258
+ uf: UF;
259
+ features: MunicipalityFeature[];
260
+ }
261
+
262
+ /** States belonging to a macro-region. */
263
+ export declare function statesByRegion(region: BrRegion): readonly BrazilState[];
264
+
265
+ /** The 27 Brazilian federative units (26 states + Federal District). */
266
+ 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
+
268
+ /** `{ value: uf, label: name }` options for every state, for a `<Select>`. */
269
+ export declare function ufChoices(): Choice[];
270
+
271
+ export { }