@ktnpm_devops/react-component 0.12.1 → 0.13.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 (451) hide show
  1. package/README.md +39 -0
  2. package/dist/constants.d.ts +26 -0
  3. package/dist/constants.d.ts.map +1 -1
  4. package/dist/geo/GeoMapCard/GeoMapCard.d.ts +7 -0
  5. package/dist/geo/GeoMapCard/GeoMapCard.d.ts.map +1 -0
  6. package/dist/geo/GeoMapCard/GeoMapCard.types.d.ts +91 -0
  7. package/dist/geo/GeoMapCard/GeoMapCard.types.d.ts.map +1 -0
  8. package/dist/geo/GeoMapCard/MapLegend.d.ts +12 -0
  9. package/dist/geo/GeoMapCard/MapLegend.d.ts.map +1 -0
  10. package/dist/geo/GeoMapCard/MapViewport.d.ts +17 -0
  11. package/dist/geo/GeoMapCard/MapViewport.d.ts.map +1 -0
  12. package/dist/geo/GeoMapCard/PointListing.d.ts +14 -0
  13. package/dist/geo/GeoMapCard/PointListing.d.ts.map +1 -0
  14. package/dist/geo/GeoMapCard/buildMarkerStyle.d.ts +47 -0
  15. package/dist/geo/GeoMapCard/buildMarkerStyle.d.ts.map +1 -0
  16. package/dist/geo/GeoMapCard/buildMarkerStyle.test.d.ts +2 -0
  17. package/dist/geo/GeoMapCard/buildMarkerStyle.test.d.ts.map +1 -0
  18. package/dist/geo/GeoMapCard/index.d.ts +3 -0
  19. package/dist/geo/GeoMapCard/index.d.ts.map +1 -0
  20. package/dist/geo/GeoMapCard/normalizePoints.d.ts +26 -0
  21. package/dist/geo/GeoMapCard/normalizePoints.d.ts.map +1 -0
  22. package/dist/geo/GeoMapCard/normalizePoints.test.d.ts +2 -0
  23. package/dist/geo/GeoMapCard/normalizePoints.test.d.ts.map +1 -0
  24. package/dist/geo/GeoMapCard/warnMissingLeafletStylesheet.d.ts +13 -0
  25. package/dist/geo/GeoMapCard/warnMissingLeafletStylesheet.d.ts.map +1 -0
  26. package/dist/geo/GeoMapCard/warnMissingLeafletStylesheet.test.d.ts +2 -0
  27. package/dist/geo/GeoMapCard/warnMissingLeafletStylesheet.test.d.ts.map +1 -0
  28. package/dist/geo/index.d.ts +3 -0
  29. package/dist/geo/index.d.ts.map +1 -0
  30. package/dist/hooks/useThemeMode.d.ts +8 -0
  31. package/dist/hooks/useThemeMode.d.ts.map +1 -0
  32. package/dist/index.cjs +52 -48
  33. package/dist/index.cjs.map +1 -1
  34. package/dist/index.d.ts +5 -0
  35. package/dist/index.d.ts.map +1 -1
  36. package/dist/index.js +52 -48
  37. package/dist/index.js.map +1 -1
  38. package/dist/index10.cjs +45 -14
  39. package/dist/index10.cjs.map +1 -1
  40. package/dist/index10.js +46 -15
  41. package/dist/index10.js.map +1 -1
  42. package/dist/index100.cjs +24 -6
  43. package/dist/index100.cjs.map +1 -1
  44. package/dist/index100.js +23 -5
  45. package/dist/index100.js.map +1 -1
  46. package/dist/index101.cjs +20 -16
  47. package/dist/index101.cjs.map +1 -1
  48. package/dist/index101.js +19 -15
  49. package/dist/index101.js.map +1 -1
  50. package/dist/index102.cjs +14 -22
  51. package/dist/index102.cjs.map +1 -1
  52. package/dist/index102.js +13 -21
  53. package/dist/index102.js.map +1 -1
  54. package/dist/index103.cjs +57 -36
  55. package/dist/index103.cjs.map +1 -1
  56. package/dist/index103.js +57 -36
  57. package/dist/index103.js.map +1 -1
  58. package/dist/index104.cjs +19 -16
  59. package/dist/index104.cjs.map +1 -1
  60. package/dist/index104.js +20 -17
  61. package/dist/index104.js.map +1 -1
  62. package/dist/index105.cjs +49 -19
  63. package/dist/index105.cjs.map +1 -1
  64. package/dist/index105.js +49 -19
  65. package/dist/index105.js.map +1 -1
  66. package/dist/index106.cjs +33 -0
  67. package/dist/index106.cjs.map +1 -0
  68. package/dist/index106.js +33 -0
  69. package/dist/index106.js.map +1 -0
  70. package/dist/index107.cjs +18 -0
  71. package/dist/index107.cjs.map +1 -0
  72. package/dist/index107.js +18 -0
  73. package/dist/index107.js.map +1 -0
  74. package/dist/index108.cjs +12 -0
  75. package/dist/index108.cjs.map +1 -0
  76. package/dist/index108.js +12 -0
  77. package/dist/index108.js.map +1 -0
  78. package/dist/index109.cjs +21 -0
  79. package/dist/index109.cjs.map +1 -0
  80. package/dist/index109.js +21 -0
  81. package/dist/index109.js.map +1 -0
  82. package/dist/index11.cjs +14 -15
  83. package/dist/index11.cjs.map +1 -1
  84. package/dist/index11.js +15 -16
  85. package/dist/index11.js.map +1 -1
  86. package/dist/index110.cjs +24 -0
  87. package/dist/index110.cjs.map +1 -0
  88. package/dist/index110.js +24 -0
  89. package/dist/index110.js.map +1 -0
  90. package/dist/index111.cjs +9 -0
  91. package/dist/index111.cjs.map +1 -0
  92. package/dist/index111.js +9 -0
  93. package/dist/index111.js.map +1 -0
  94. package/dist/index112.cjs +9 -0
  95. package/dist/index112.cjs.map +1 -0
  96. package/dist/index112.js +9 -0
  97. package/dist/index112.js.map +1 -0
  98. package/dist/index113.cjs +27 -0
  99. package/dist/index113.cjs.map +1 -0
  100. package/dist/index113.js +27 -0
  101. package/dist/index113.js.map +1 -0
  102. package/dist/index12.cjs +15 -4
  103. package/dist/index12.cjs.map +1 -1
  104. package/dist/index12.js +15 -4
  105. package/dist/index12.js.map +1 -1
  106. package/dist/index13.cjs +4 -16
  107. package/dist/index13.cjs.map +1 -1
  108. package/dist/index13.js +4 -16
  109. package/dist/index13.js.map +1 -1
  110. package/dist/index14.cjs +16 -10
  111. package/dist/index14.cjs.map +1 -1
  112. package/dist/index14.js +16 -10
  113. package/dist/index14.js.map +1 -1
  114. package/dist/index15.cjs +10 -100
  115. package/dist/index15.cjs.map +1 -1
  116. package/dist/index15.js +11 -101
  117. package/dist/index15.js.map +1 -1
  118. package/dist/index16.cjs +100 -20
  119. package/dist/index16.cjs.map +1 -1
  120. package/dist/index16.js +101 -21
  121. package/dist/index16.js.map +1 -1
  122. package/dist/index17.cjs +20 -54
  123. package/dist/index17.cjs.map +1 -1
  124. package/dist/index17.js +20 -54
  125. package/dist/index17.js.map +1 -1
  126. package/dist/index18.cjs +52 -16
  127. package/dist/index18.cjs.map +1 -1
  128. package/dist/index18.js +54 -18
  129. package/dist/index18.js.map +1 -1
  130. package/dist/index19.cjs +16 -24
  131. package/dist/index19.cjs.map +1 -1
  132. package/dist/index19.js +17 -25
  133. package/dist/index19.js.map +1 -1
  134. package/dist/index20.cjs +22 -39
  135. package/dist/index20.cjs.map +1 -1
  136. package/dist/index20.js +23 -40
  137. package/dist/index20.js.map +1 -1
  138. package/dist/index21.cjs +38 -85
  139. package/dist/index21.cjs.map +1 -1
  140. package/dist/index21.js +40 -87
  141. package/dist/index21.js.map +1 -1
  142. package/dist/index22.cjs +85 -153
  143. package/dist/index22.cjs.map +1 -1
  144. package/dist/index22.js +87 -155
  145. package/dist/index22.js.map +1 -1
  146. package/dist/index23.cjs +150 -128
  147. package/dist/index23.cjs.map +1 -1
  148. package/dist/index23.js +150 -128
  149. package/dist/index23.js.map +1 -1
  150. package/dist/index24.cjs +121 -106
  151. package/dist/index24.cjs.map +1 -1
  152. package/dist/index24.js +122 -107
  153. package/dist/index24.js.map +1 -1
  154. package/dist/index25.cjs +121 -17
  155. package/dist/index25.cjs.map +1 -1
  156. package/dist/index25.js +121 -17
  157. package/dist/index25.js.map +1 -1
  158. package/dist/index26.cjs +16 -163
  159. package/dist/index26.cjs.map +1 -1
  160. package/dist/index26.js +16 -163
  161. package/dist/index26.js.map +1 -1
  162. package/dist/index27.cjs +163 -21
  163. package/dist/index27.cjs.map +1 -1
  164. package/dist/index27.js +164 -22
  165. package/dist/index27.js.map +1 -1
  166. package/dist/index28.cjs +20 -129
  167. package/dist/index28.cjs.map +1 -1
  168. package/dist/index28.js +20 -129
  169. package/dist/index28.js.map +1 -1
  170. package/dist/index29.cjs +129 -75
  171. package/dist/index29.cjs.map +1 -1
  172. package/dist/index29.js +131 -77
  173. package/dist/index29.js.map +1 -1
  174. package/dist/index30.cjs +152 -7
  175. package/dist/index30.cjs.map +1 -1
  176. package/dist/index30.js +154 -9
  177. package/dist/index30.js.map +1 -1
  178. package/dist/index31.cjs +74 -128
  179. package/dist/index31.cjs.map +1 -1
  180. package/dist/index31.js +76 -130
  181. package/dist/index31.js.map +1 -1
  182. package/dist/index32.cjs +6 -54
  183. package/dist/index32.cjs.map +1 -1
  184. package/dist/index32.js +8 -56
  185. package/dist/index32.js.map +1 -1
  186. package/dist/index33.cjs +128 -35
  187. package/dist/index33.cjs.map +1 -1
  188. package/dist/index33.js +128 -35
  189. package/dist/index33.js.map +1 -1
  190. package/dist/index34.cjs +51 -221
  191. package/dist/index34.cjs.map +1 -1
  192. package/dist/index34.js +52 -222
  193. package/dist/index34.js.map +1 -1
  194. package/dist/index35.cjs +38 -34
  195. package/dist/index35.cjs.map +1 -1
  196. package/dist/index35.js +39 -35
  197. package/dist/index35.js.map +1 -1
  198. package/dist/index36.cjs +222 -106
  199. package/dist/index36.cjs.map +1 -1
  200. package/dist/index36.js +224 -108
  201. package/dist/index36.js.map +1 -1
  202. package/dist/index37.cjs +30 -64
  203. package/dist/index37.cjs.map +1 -1
  204. package/dist/index37.js +31 -65
  205. package/dist/index37.js.map +1 -1
  206. package/dist/index38.cjs +106 -74
  207. package/dist/index38.cjs.map +1 -1
  208. package/dist/index38.js +108 -76
  209. package/dist/index38.js.map +1 -1
  210. package/dist/index39.cjs +63 -54
  211. package/dist/index39.cjs.map +1 -1
  212. package/dist/index39.js +64 -55
  213. package/dist/index39.js.map +1 -1
  214. package/dist/index40.cjs +69 -144
  215. package/dist/index40.cjs.map +1 -1
  216. package/dist/index40.js +70 -145
  217. package/dist/index40.js.map +1 -1
  218. package/dist/index41.cjs +57 -96
  219. package/dist/index41.cjs.map +1 -1
  220. package/dist/index41.js +59 -98
  221. package/dist/index41.js.map +1 -1
  222. package/dist/index42.cjs +147 -66
  223. package/dist/index42.cjs.map +1 -1
  224. package/dist/index42.js +149 -68
  225. package/dist/index42.js.map +1 -1
  226. package/dist/index43.cjs +97 -7
  227. package/dist/index43.cjs.map +1 -1
  228. package/dist/index43.js +99 -9
  229. package/dist/index43.js.map +1 -1
  230. package/dist/index44.cjs +72 -17
  231. package/dist/index44.cjs.map +1 -1
  232. package/dist/index44.js +73 -18
  233. package/dist/index44.js.map +1 -1
  234. package/dist/index45.cjs +7 -76
  235. package/dist/index45.cjs.map +1 -1
  236. package/dist/index45.js +9 -78
  237. package/dist/index45.js.map +1 -1
  238. package/dist/index46.cjs +17 -143
  239. package/dist/index46.cjs.map +1 -1
  240. package/dist/index46.js +17 -143
  241. package/dist/index46.js.map +1 -1
  242. package/dist/index47.cjs +72 -59
  243. package/dist/index47.cjs.map +1 -1
  244. package/dist/index47.js +74 -61
  245. package/dist/index47.js.map +1 -1
  246. package/dist/index48.cjs +136 -98
  247. package/dist/index48.cjs.map +1 -1
  248. package/dist/index48.js +137 -99
  249. package/dist/index48.js.map +1 -1
  250. package/dist/index49.cjs +49 -32
  251. package/dist/index49.cjs.map +1 -1
  252. package/dist/index49.js +49 -32
  253. package/dist/index49.js.map +1 -1
  254. package/dist/index50.cjs +105 -6
  255. package/dist/index50.cjs.map +1 -1
  256. package/dist/index50.js +106 -7
  257. package/dist/index50.js.map +1 -1
  258. package/dist/index51.cjs +44 -144
  259. package/dist/index51.cjs.map +1 -1
  260. package/dist/index51.js +45 -145
  261. package/dist/index51.js.map +1 -1
  262. package/dist/index52.cjs +6 -8
  263. package/dist/index52.cjs.map +1 -1
  264. package/dist/index52.js +6 -8
  265. package/dist/index52.js.map +1 -1
  266. package/dist/index53.cjs +145 -15
  267. package/dist/index53.cjs.map +1 -1
  268. package/dist/index53.js +147 -17
  269. package/dist/index53.js.map +1 -1
  270. package/dist/index54.cjs +7 -65
  271. package/dist/index54.cjs.map +1 -1
  272. package/dist/index54.js +8 -66
  273. package/dist/index54.js.map +1 -1
  274. package/dist/index55.cjs +19 -16
  275. package/dist/index55.cjs.map +1 -1
  276. package/dist/index55.js +18 -15
  277. package/dist/index55.js.map +1 -1
  278. package/dist/index56.cjs +67 -24
  279. package/dist/index56.cjs.map +1 -1
  280. package/dist/index56.js +66 -23
  281. package/dist/index56.js.map +1 -1
  282. package/dist/index57.cjs +15 -69
  283. package/dist/index57.cjs.map +1 -1
  284. package/dist/index57.js +15 -69
  285. package/dist/index57.js.map +1 -1
  286. package/dist/index58.cjs +3 -15
  287. package/dist/index58.cjs.map +1 -1
  288. package/dist/index58.js +3 -15
  289. package/dist/index58.js.map +1 -1
  290. package/dist/index59.cjs +24 -89
  291. package/dist/index59.cjs.map +1 -1
  292. package/dist/index59.js +23 -88
  293. package/dist/index59.js.map +1 -1
  294. package/dist/index60.cjs +64 -16
  295. package/dist/index60.cjs.map +1 -1
  296. package/dist/index60.js +64 -16
  297. package/dist/index60.js.map +1 -1
  298. package/dist/index62.cjs +18 -9
  299. package/dist/index62.cjs.map +1 -1
  300. package/dist/index62.js +18 -9
  301. package/dist/index62.js.map +1 -1
  302. package/dist/index63.cjs +13 -16
  303. package/dist/index63.cjs.map +1 -1
  304. package/dist/index63.js +13 -16
  305. package/dist/index63.js.map +1 -1
  306. package/dist/index64.cjs +13 -13
  307. package/dist/index64.js +13 -13
  308. package/dist/index65.cjs +17 -2
  309. package/dist/index65.cjs.map +1 -1
  310. package/dist/index65.js +18 -3
  311. package/dist/index65.js.map +1 -1
  312. package/dist/index66.cjs +2 -20
  313. package/dist/index66.cjs.map +1 -1
  314. package/dist/index66.js +3 -21
  315. package/dist/index66.js.map +1 -1
  316. package/dist/index67.cjs +116 -28
  317. package/dist/index67.cjs.map +1 -1
  318. package/dist/index67.js +114 -26
  319. package/dist/index67.js.map +1 -1
  320. package/dist/index68.cjs +17 -17
  321. package/dist/index68.js +18 -18
  322. package/dist/index69.cjs +20 -5
  323. package/dist/index69.cjs.map +1 -1
  324. package/dist/index69.js +20 -5
  325. package/dist/index69.js.map +1 -1
  326. package/dist/index7.cjs +32 -64
  327. package/dist/index7.cjs.map +1 -1
  328. package/dist/index7.js +32 -64
  329. package/dist/index7.js.map +1 -1
  330. package/dist/index70.cjs +10 -16
  331. package/dist/index70.cjs.map +1 -1
  332. package/dist/index70.js +10 -16
  333. package/dist/index70.js.map +1 -1
  334. package/dist/index71.cjs +16 -28
  335. package/dist/index71.cjs.map +1 -1
  336. package/dist/index71.js +16 -28
  337. package/dist/index71.js.map +1 -1
  338. package/dist/index72.cjs +79 -19
  339. package/dist/index72.cjs.map +1 -1
  340. package/dist/index72.js +80 -20
  341. package/dist/index72.js.map +1 -1
  342. package/dist/index73.cjs +47 -2
  343. package/dist/index73.cjs.map +1 -1
  344. package/dist/index73.js +48 -3
  345. package/dist/index73.js.map +1 -1
  346. package/dist/index74.cjs +53 -2
  347. package/dist/index74.cjs.map +1 -1
  348. package/dist/index74.js +54 -3
  349. package/dist/index74.js.map +1 -1
  350. package/dist/index76.cjs +28 -13
  351. package/dist/index76.cjs.map +1 -1
  352. package/dist/index76.js +29 -14
  353. package/dist/index76.js.map +1 -1
  354. package/dist/index77.cjs +3 -30
  355. package/dist/index77.cjs.map +1 -1
  356. package/dist/index77.js +3 -30
  357. package/dist/index77.js.map +1 -1
  358. package/dist/index78.cjs +31 -7
  359. package/dist/index78.cjs.map +1 -1
  360. package/dist/index78.js +32 -8
  361. package/dist/index78.js.map +1 -1
  362. package/dist/index79.cjs +10 -34
  363. package/dist/index79.cjs.map +1 -1
  364. package/dist/index79.js +11 -35
  365. package/dist/index79.js.map +1 -1
  366. package/dist/index8.cjs +58 -75
  367. package/dist/index8.cjs.map +1 -1
  368. package/dist/index8.js +58 -75
  369. package/dist/index8.js.map +1 -1
  370. package/dist/index80.cjs +16 -10
  371. package/dist/index80.cjs.map +1 -1
  372. package/dist/index80.js +17 -11
  373. package/dist/index80.js.map +1 -1
  374. package/dist/index81.cjs +16 -4
  375. package/dist/index81.cjs.map +1 -1
  376. package/dist/index81.js +17 -5
  377. package/dist/index81.js.map +1 -1
  378. package/dist/index82.cjs +10 -134
  379. package/dist/index82.cjs.map +1 -1
  380. package/dist/index82.js +9 -133
  381. package/dist/index82.js.map +1 -1
  382. package/dist/index83.cjs +24 -36
  383. package/dist/index83.cjs.map +1 -1
  384. package/dist/index83.js +25 -37
  385. package/dist/index83.js.map +1 -1
  386. package/dist/index84.cjs +36 -81
  387. package/dist/index84.cjs.map +1 -1
  388. package/dist/index84.js +36 -81
  389. package/dist/index84.js.map +1 -1
  390. package/dist/index85.cjs +38 -2
  391. package/dist/index85.cjs.map +1 -1
  392. package/dist/index85.js +39 -3
  393. package/dist/index85.js.map +1 -1
  394. package/dist/index86.cjs +49 -43
  395. package/dist/index86.cjs.map +1 -1
  396. package/dist/index86.js +50 -44
  397. package/dist/index86.js.map +1 -1
  398. package/dist/index87.cjs +39 -57
  399. package/dist/index87.cjs.map +1 -1
  400. package/dist/index87.js +38 -56
  401. package/dist/index87.js.map +1 -1
  402. package/dist/index88.cjs +92 -42
  403. package/dist/index88.cjs.map +1 -1
  404. package/dist/index88.js +91 -41
  405. package/dist/index88.js.map +1 -1
  406. package/dist/index89.cjs +34 -16
  407. package/dist/index89.cjs.map +1 -1
  408. package/dist/index89.js +34 -16
  409. package/dist/index89.js.map +1 -1
  410. package/dist/index9.cjs +81 -45
  411. package/dist/index9.cjs.map +1 -1
  412. package/dist/index9.js +81 -45
  413. package/dist/index9.js.map +1 -1
  414. package/dist/index90.cjs +1 -1
  415. package/dist/index90.js +1 -1
  416. package/dist/index92.cjs +34 -34
  417. package/dist/index92.js +34 -34
  418. package/dist/index93.cjs +134 -34
  419. package/dist/index93.cjs.map +1 -1
  420. package/dist/index93.js +133 -33
  421. package/dist/index93.js.map +1 -1
  422. package/dist/index94.cjs +45 -39
  423. package/dist/index94.cjs.map +1 -1
  424. package/dist/index94.js +44 -38
  425. package/dist/index94.js.map +1 -1
  426. package/dist/index95.cjs +33 -92
  427. package/dist/index95.cjs.map +1 -1
  428. package/dist/index95.js +32 -91
  429. package/dist/index95.js.map +1 -1
  430. package/dist/index96.cjs +16 -34
  431. package/dist/index96.cjs.map +1 -1
  432. package/dist/index96.js +16 -34
  433. package/dist/index96.js.map +1 -1
  434. package/dist/index97.cjs +13 -49
  435. package/dist/index97.cjs.map +1 -1
  436. package/dist/index97.js +14 -50
  437. package/dist/index97.js.map +1 -1
  438. package/dist/index98.cjs +35 -30
  439. package/dist/index98.cjs.map +1 -1
  440. package/dist/index98.js +34 -29
  441. package/dist/index98.js.map +1 -1
  442. package/dist/index99.cjs +43 -57
  443. package/dist/index99.cjs.map +1 -1
  444. package/dist/index99.js +42 -56
  445. package/dist/index99.js.map +1 -1
  446. package/dist/style.css +207 -0
  447. package/dist/types/geo.types.d.ts +45 -0
  448. package/dist/types/geo.types.d.ts.map +1 -0
  449. package/dist/types/index.d.ts +1 -0
  450. package/dist/types/index.d.ts.map +1 -1
  451. package/package.json +13 -2
package/dist/index30.cjs CHANGED
@@ -2,11 +2,156 @@
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
3
  const jsxRuntime = require("react/jsx-runtime");
4
4
  const react = require("react");
5
- const clsx = require("./index55.cjs");
6
- const Input_module = require("./index65.cjs");
7
- const Input = react.forwardRef(
8
- ({ className, type = "text", ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx("input", { ref, type, className: clsx.clsx(Input_module.default.root, className), ...props })
9
- );
10
- Input.displayName = "Input";
11
- exports.Input = Input;
5
+ const reactLeaflet = require("react-leaflet");
6
+ const clsx = require("./index57.cjs");
7
+ const useThemeMode = require("./index7.cjs");
8
+ const constants = require("./index67.cjs");
9
+ const normalizePoints = require("./index98.cjs");
10
+ const buildMarkerStyle = require("./index99.cjs");
11
+ const MapViewport = require("./index100.cjs");
12
+ const MapLegend = require("./index101.cjs");
13
+ const PointListing = require("./index102.cjs");
14
+ const GeoMapCard_module = require("./index103.cjs");
15
+ const EmptyState = require("./index28.cjs");
16
+ const buildNotice = (info, maxPoints) => {
17
+ const reasons = [];
18
+ if (info.skipped > 0) reasons.push(`${info.skipped} without usable coordinates`);
19
+ if (info.dropped > 0) reasons.push(`${info.dropped} over the ${maxPoints} marker cap`);
20
+ if (reasons.length === 0) return null;
21
+ return `Showing ${info.drawn} of ${info.total} points (${reasons.join(", ")}).`;
22
+ };
23
+ const describePoint = (point, categoryLabel) => [point.label, point.category != null ? `${categoryLabel}: ${point.category}` : null, point.detail].filter((part) => part != null && part !== "").join(" — ");
24
+ const GeoMapCard = ({
25
+ title,
26
+ points,
27
+ selectedIds,
28
+ onSelectPoint,
29
+ categoryLabel = "Category",
30
+ legendTitle = "Legend",
31
+ hideLegend = false,
32
+ maxPoints = constants.GEO_MAP.MAX_POINTS,
33
+ onRender,
34
+ fitBounds = true,
35
+ center,
36
+ zoom,
37
+ scrollWheelZoom = false,
38
+ basemap = "auto",
39
+ tileLayer,
40
+ compact = false,
41
+ toolbar,
42
+ actions,
43
+ isLoading = false,
44
+ error = null,
45
+ onRetry,
46
+ emptyTitle = "No mappable points",
47
+ emptyDescription = "None of the points received carry usable coordinates.",
48
+ retryLabel = "Retry",
49
+ loadingLabel = "Loading map...",
50
+ pointListLabel = "Map points",
51
+ className
52
+ }) => {
53
+ const theme = useThemeMode.useThemeMode();
54
+ const containerRef = react.useRef(null);
55
+ const { drawn, bounds, info } = react.useMemo(
56
+ () => normalizePoints.normalizePoints(points, maxPoints),
57
+ [points, maxPoints]
58
+ );
59
+ const categoryColors = react.useMemo(() => buildMarkerStyle.buildCategoryColors(points), [points]);
60
+ const legendItems = react.useMemo(() => buildMarkerStyle.buildLegendItems(categoryColors), [categoryColors]);
61
+ const markers = react.useMemo(() => {
62
+ const weightScale = buildMarkerStyle.buildWeightScale(points);
63
+ const selection = new Set(selectedIds ?? []);
64
+ return drawn.map(({ point, sourceIndex }) => {
65
+ const selected = selection.has(point.id);
66
+ return {
67
+ point,
68
+ sourceIndex,
69
+ selected,
70
+ style: buildMarkerStyle.buildMarkerStyle(point, { categoryColors, weightScale, selected, theme }),
71
+ description: describePoint(point, categoryLabel)
72
+ };
73
+ });
74
+ }, [drawn, points, selectedIds, categoryColors, theme, categoryLabel]);
75
+ const tiles = tileLayer ?? {
76
+ url: constants.BASEMAP_TILES[basemap === "auto" ? theme : basemap],
77
+ attribution: constants.BASEMAP_TILES.attribution
78
+ };
79
+ const shouldFitBounds = fitBounds && center == null && zoom == null;
80
+ const showLegend = !hideLegend && legendItems.length > 0;
81
+ const notice = buildNotice(info, maxPoints);
82
+ const hasMap = !isLoading && error == null && info.drawn > 0;
83
+ react.useEffect(() => {
84
+ onRender == null ? void 0 : onRender(info);
85
+ }, [onRender, info]);
86
+ react.useEffect(() => {
87
+ }, [hasMap]);
88
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: clsx.clsx(GeoMapCard_module.default.root, compact && GeoMapCard_module.default.compact, className), children: [
89
+ /* @__PURE__ */ jsxRuntime.jsxs("header", { className: GeoMapCard_module.default.header, children: [
90
+ /* @__PURE__ */ jsxRuntime.jsx("h3", { className: GeoMapCard_module.default.title, children: title }),
91
+ actions && /* @__PURE__ */ jsxRuntime.jsx("div", { className: GeoMapCard_module.default.headerActions, children: actions })
92
+ ] }),
93
+ toolbar && /* @__PURE__ */ jsxRuntime.jsx("div", { className: GeoMapCard_module.default.toolbar, children: toolbar }),
94
+ hasMap && notice && /* @__PURE__ */ jsxRuntime.jsx("div", { className: GeoMapCard_module.default.warning, role: "status", children: notice }),
95
+ isLoading && /* @__PURE__ */ jsxRuntime.jsx("div", { className: GeoMapCard_module.default.loading, children: loadingLabel }),
96
+ !isLoading && error != null && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: GeoMapCard_module.default.error, children: [
97
+ /* @__PURE__ */ jsxRuntime.jsx("span", { children: error }),
98
+ onRetry && /* @__PURE__ */ jsxRuntime.jsx("button", { type: "button", className: GeoMapCard_module.default.retryButton, onClick: onRetry, children: retryLabel })
99
+ ] }),
100
+ !isLoading && error == null && info.drawn === 0 && /* @__PURE__ */ jsxRuntime.jsx(
101
+ EmptyState.EmptyState,
102
+ {
103
+ className: GeoMapCard_module.default.empty,
104
+ variant: "plain",
105
+ title: emptyTitle,
106
+ description: emptyDescription
107
+ }
108
+ ),
109
+ hasMap && /* @__PURE__ */ jsxRuntime.jsxs(
110
+ "div",
111
+ {
112
+ ref: containerRef,
113
+ className: GeoMapCard_module.default.mapContainer,
114
+ role: "figure",
115
+ "aria-label": `${title}: map of ${info.drawn} points`,
116
+ children: [
117
+ /* @__PURE__ */ jsxRuntime.jsxs(
118
+ reactLeaflet.MapContainer,
119
+ {
120
+ className: GeoMapCard_module.default.map,
121
+ center: center ?? [...constants.GEO_MAP.DEFAULT_CENTER],
122
+ zoom: zoom ?? constants.GEO_MAP.DEFAULT_ZOOM,
123
+ scrollWheelZoom,
124
+ children: [
125
+ /* @__PURE__ */ jsxRuntime.jsx(reactLeaflet.TileLayer, { url: tiles.url, attribution: tiles.attribution }, tiles.url),
126
+ /* @__PURE__ */ jsxRuntime.jsx(MapViewport.MapViewport, { bounds, fitBounds: shouldFitBounds }),
127
+ markers.map(({ point, sourceIndex, style, description }) => /* @__PURE__ */ jsxRuntime.jsx(
128
+ reactLeaflet.CircleMarker,
129
+ {
130
+ center: [point.latitude, point.longitude],
131
+ radius: style.radius,
132
+ pathOptions: style,
133
+ eventHandlers: onSelectPoint ? { click: () => onSelectPoint({ point, index: sourceIndex }) } : {},
134
+ children: /* @__PURE__ */ jsxRuntime.jsx(reactLeaflet.Tooltip, { children: description })
135
+ },
136
+ point.id
137
+ )),
138
+ showLegend && /* @__PURE__ */ jsxRuntime.jsx(MapLegend.MapLegend, { items: legendItems, title: legendTitle })
139
+ ]
140
+ }
141
+ ),
142
+ /* @__PURE__ */ jsxRuntime.jsx(
143
+ PointListing.PointListing,
144
+ {
145
+ markers,
146
+ label: pointListLabel,
147
+ onSelectPoint
148
+ }
149
+ )
150
+ ]
151
+ }
152
+ )
153
+ ] });
154
+ };
155
+ GeoMapCard.displayName = "GeoMapCard";
156
+ exports.GeoMapCard = GeoMapCard;
12
157
  //# sourceMappingURL=index30.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"index30.cjs","sources":["../src/primitives/Input/Input.tsx"],"sourcesContent":["import { forwardRef } from 'react';\nimport clsx from 'clsx';\nimport styles from './Input.module.css';\n\nexport interface InputProps extends React.InputHTMLAttributes<HTMLInputElement> {}\n\nexport const Input = forwardRef<HTMLInputElement, InputProps>(\n ({ className, type = 'text', ...props }, ref) => (\n <input ref={ref} type={type} className={clsx(styles.root, className)} {...props} />\n ),\n);\n\nInput.displayName = 'Input';\n"],"names":["forwardRef","jsx","clsx","styles"],"mappings":";;;;;;AAMO,MAAM,QAAQA,MAAAA;AAAAA,EACnB,CAAC,EAAE,WAAW,OAAO,QAAQ,GAAG,SAAS,QACvCC,2BAAAA,IAAC,WAAM,KAAU,MAAY,WAAWC,UAAKC,aAAAA,QAAO,MAAM,SAAS,GAAI,GAAG,MAAA,CAAO;AAErF;AAEA,MAAM,cAAc;;"}
1
+ {"version":3,"file":"index30.cjs","sources":["../src/geo/GeoMapCard/GeoMapCard.tsx"],"sourcesContent":["import { useEffect, useMemo, useRef } from 'react';\nimport { CircleMarker, MapContainer, TileLayer, Tooltip } from 'react-leaflet';\nimport clsx from 'clsx';\nimport { EmptyState } from '../../primitives/EmptyState';\nimport { useThemeMode } from '../../hooks/useThemeMode';\nimport { BASEMAP_TILES, GEO_MAP } from '../../constants';\nimport type { GeoPoint, GeoRenderInfo } from '../../types/geo.types';\nimport type { GeoMapCardProps, MarkerDescriptor } from './GeoMapCard.types';\nimport { normalizePoints } from './normalizePoints';\nimport { buildCategoryColors, buildLegendItems, buildMarkerStyle, buildWeightScale } from './buildMarkerStyle';\nimport { MapViewport } from './MapViewport';\nimport { MapLegend } from './MapLegend';\nimport { PointListing } from './PointListing';\nimport { warnMissingLeafletStylesheet } from './warnMissingLeafletStylesheet';\nimport styles from './GeoMapCard.module.css';\n\n/** States what was left out, so a truncated map never passes for a complete one. */\nconst buildNotice = (info: GeoRenderInfo, maxPoints: number): string | null => {\n const reasons: string[] = [];\n\n if (info.skipped > 0) reasons.push(`${info.skipped} without usable coordinates`);\n if (info.dropped > 0) reasons.push(`${info.dropped} over the ${maxPoints} marker cap`);\n\n if (reasons.length === 0) return null;\n\n return `Showing ${info.drawn} of ${info.total} points (${reasons.join(', ')}).`;\n};\n\n/** One line carrying everything the tooltip shows, for the screen reader too. */\nconst describePoint = (point: GeoPoint, categoryLabel: string): string =>\n [point.label, point.category != null ? `${categoryLabel}: ${point.category}` : null, point.detail]\n .filter((part): part is string => part != null && part !== '')\n .join(' — ');\n\nexport const GeoMapCard = ({\n title,\n points,\n selectedIds,\n onSelectPoint,\n categoryLabel = 'Category',\n legendTitle = 'Legend',\n hideLegend = false,\n maxPoints = GEO_MAP.MAX_POINTS,\n onRender,\n fitBounds = true,\n center,\n zoom,\n scrollWheelZoom = false,\n basemap = 'auto',\n tileLayer,\n compact = false,\n toolbar,\n actions,\n isLoading = false,\n error = null,\n onRetry,\n emptyTitle = 'No mappable points',\n emptyDescription = 'None of the points received carry usable coordinates.',\n retryLabel = 'Retry',\n loadingLabel = 'Loading map...',\n pointListLabel = 'Map points',\n className,\n}: GeoMapCardProps) => {\n const theme = useThemeMode();\n const containerRef = useRef<HTMLDivElement>(null);\n\n const { drawn, bounds, info } = useMemo(\n () => normalizePoints(points, maxPoints),\n [points, maxPoints],\n );\n\n const categoryColors = useMemo(() => buildCategoryColors(points), [points]);\n const legendItems = useMemo(() => buildLegendItems(categoryColors), [categoryColors]);\n\n const markers = useMemo<MarkerDescriptor[]>(() => {\n const weightScale = buildWeightScale(points);\n const selection = new Set(selectedIds ?? []);\n\n return drawn.map(({ point, sourceIndex }) => {\n const selected = selection.has(point.id);\n\n return {\n point,\n sourceIndex,\n selected,\n style: buildMarkerStyle(point, { categoryColors, weightScale, selected, theme }),\n description: describePoint(point, categoryLabel),\n };\n });\n }, [drawn, points, selectedIds, categoryColors, theme, categoryLabel]);\n\n const tiles = tileLayer ?? {\n url: BASEMAP_TILES[basemap === 'auto' ? theme : basemap],\n attribution: BASEMAP_TILES.attribution,\n };\n\n // Manual framing and automatic framing would fight over the viewport.\n const shouldFitBounds = fitBounds && center == null && zoom == null;\n const showLegend = !hideLegend && legendItems.length > 0;\n const notice = buildNotice(info, maxPoints);\n const hasMap = !isLoading && error == null && info.drawn > 0;\n\n useEffect(() => {\n onRender?.(info);\n }, [onRender, info]);\n\n useEffect(() => {\n if (import.meta.env.DEV && hasMap) warnMissingLeafletStylesheet(containerRef.current);\n }, [hasMap]);\n\n return (\n <div className={clsx(styles.root, compact && styles.compact, className)}>\n <header className={styles.header}>\n <h3 className={styles.title}>{title}</h3>\n {actions && <div className={styles.headerActions}>{actions}</div>}\n </header>\n\n {toolbar && <div className={styles.toolbar}>{toolbar}</div>}\n\n {hasMap && notice && (\n <div className={styles.warning} role=\"status\">\n {notice}\n </div>\n )}\n\n {isLoading && <div className={styles.loading}>{loadingLabel}</div>}\n\n {!isLoading && error != null && (\n <div className={styles.error}>\n <span>{error}</span>\n {onRetry && (\n <button type=\"button\" className={styles.retryButton} onClick={onRetry}>\n {retryLabel}\n </button>\n )}\n </div>\n )}\n\n {!isLoading && error == null && info.drawn === 0 && (\n <EmptyState\n className={styles.empty}\n variant=\"plain\"\n title={emptyTitle}\n description={emptyDescription}\n />\n )}\n\n {hasMap && (\n <div\n ref={containerRef}\n className={styles.mapContainer}\n role=\"figure\"\n aria-label={`${title}: map of ${info.drawn} points`}\n >\n <MapContainer\n className={styles.map}\n center={center ?? [...GEO_MAP.DEFAULT_CENTER]}\n zoom={zoom ?? GEO_MAP.DEFAULT_ZOOM}\n scrollWheelZoom={scrollWheelZoom}\n >\n <TileLayer key={tiles.url} url={tiles.url} attribution={tiles.attribution} />\n <MapViewport bounds={bounds} fitBounds={shouldFitBounds} />\n\n {markers.map(({ point, sourceIndex, style, description }) => (\n <CircleMarker\n key={point.id}\n center={[point.latitude, point.longitude]}\n radius={style.radius}\n pathOptions={style}\n eventHandlers={\n onSelectPoint ? { click: () => onSelectPoint({ point, index: sourceIndex }) } : {}\n }\n >\n <Tooltip>{description}</Tooltip>\n </CircleMarker>\n ))}\n\n {showLegend && <MapLegend items={legendItems} title={legendTitle} />}\n </MapContainer>\n\n <PointListing\n markers={markers}\n label={pointListLabel}\n onSelectPoint={onSelectPoint}\n />\n </div>\n )}\n </div>\n );\n};\n\nGeoMapCard.displayName = 'GeoMapCard';\n"],"names":["GEO_MAP","useThemeMode","useRef","useMemo","normalizePoints","buildCategoryColors","buildLegendItems","buildWeightScale","buildMarkerStyle","BASEMAP_TILES","useEffect","jsxs","clsx","styles","jsx","EmptyState","MapContainer","TileLayer","MapViewport","CircleMarker","Tooltip","MapLegend","PointListing"],"mappings":";;;;;;;;;;;;;;;AAiBA,MAAM,cAAc,CAAC,MAAqB,cAAqC;AAC7E,QAAM,UAAoB,CAAA;AAE1B,MAAI,KAAK,UAAU,EAAG,SAAQ,KAAK,GAAG,KAAK,OAAO,6BAA6B;AAC/E,MAAI,KAAK,UAAU,EAAG,SAAQ,KAAK,GAAG,KAAK,OAAO,aAAa,SAAS,aAAa;AAErF,MAAI,QAAQ,WAAW,EAAG,QAAO;AAEjC,SAAO,WAAW,KAAK,KAAK,OAAO,KAAK,KAAK,YAAY,QAAQ,KAAK,IAAI,CAAC;AAC7E;AAGA,MAAM,gBAAgB,CAAC,OAAiB,kBACtC,CAAC,MAAM,OAAO,MAAM,YAAY,OAAO,GAAG,aAAa,KAAK,MAAM,QAAQ,KAAK,MAAM,MAAM,MAAM,EAC9F,OAAO,CAAC,SAAyB,QAAQ,QAAQ,SAAS,EAAE,EAC5D,KAAK,KAAK;AAER,MAAM,aAAa,CAAC;AAAA,EACzB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,gBAAgB;AAAA,EAChB,cAAc;AAAA,EACd,aAAa;AAAA,EACb,YAAYA,UAAAA,QAAQ;AAAA,EACpB;AAAA,EACA,YAAY;AAAA,EACZ;AAAA,EACA;AAAA,EACA,kBAAkB;AAAA,EAClB,UAAU;AAAA,EACV;AAAA,EACA,UAAU;AAAA,EACV;AAAA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A;AAAA,cACC;AAAA,cACA,OAAO;AAAA,cACP;AAAA,YAAA;AAAA,UAAA;AAAA,QACF;AAAA,MAAA;AAAA,IAAA;AAAA,EACF,GAEJ;AAEJ;AAEA,WAAW,cAAc;;"}
package/dist/index30.js CHANGED
@@ -1,12 +1,157 @@
1
- import { jsx } from "react/jsx-runtime";
2
- import { forwardRef } from "react";
3
- import { clsx } from "./index55.js";
4
- import styles from "./index65.js";
5
- const Input = forwardRef(
6
- ({ className, type = "text", ...props }, ref) => /* @__PURE__ */ jsx("input", { ref, type, className: clsx(styles.root, className), ...props })
7
- );
8
- Input.displayName = "Input";
1
+ import { jsxs, jsx } from "react/jsx-runtime";
2
+ import { useRef, useMemo, useEffect } from "react";
3
+ import { MapContainer, TileLayer, CircleMarker, Tooltip } from "react-leaflet";
4
+ import { clsx } from "./index57.js";
5
+ import { useThemeMode } from "./index7.js";
6
+ import { GEO_MAP, BASEMAP_TILES } from "./index67.js";
7
+ import { normalizePoints } from "./index98.js";
8
+ import { buildCategoryColors, buildLegendItems, buildWeightScale, buildMarkerStyle } from "./index99.js";
9
+ import { MapViewport } from "./index100.js";
10
+ import { MapLegend } from "./index101.js";
11
+ import { PointListing } from "./index102.js";
12
+ import styles from "./index103.js";
13
+ import { EmptyState } from "./index28.js";
14
+ const buildNotice = (info, maxPoints) => {
15
+ const reasons = [];
16
+ if (info.skipped > 0) reasons.push(`${info.skipped} without usable coordinates`);
17
+ if (info.dropped > 0) reasons.push(`${info.dropped} over the ${maxPoints} marker cap`);
18
+ if (reasons.length === 0) return null;
19
+ return `Showing ${info.drawn} of ${info.total} points (${reasons.join(", ")}).`;
20
+ };
21
+ const describePoint = (point, categoryLabel) => [point.label, point.category != null ? `${categoryLabel}: ${point.category}` : null, point.detail].filter((part) => part != null && part !== "").join(" — ");
22
+ const GeoMapCard = ({
23
+ title,
24
+ points,
25
+ selectedIds,
26
+ onSelectPoint,
27
+ categoryLabel = "Category",
28
+ legendTitle = "Legend",
29
+ hideLegend = false,
30
+ maxPoints = GEO_MAP.MAX_POINTS,
31
+ onRender,
32
+ fitBounds = true,
33
+ center,
34
+ zoom,
35
+ scrollWheelZoom = false,
36
+ basemap = "auto",
37
+ tileLayer,
38
+ compact = false,
39
+ toolbar,
40
+ actions,
41
+ isLoading = false,
42
+ error = null,
43
+ onRetry,
44
+ emptyTitle = "No mappable points",
45
+ emptyDescription = "None of the points received carry usable coordinates.",
46
+ retryLabel = "Retry",
47
+ loadingLabel = "Loading map...",
48
+ pointListLabel = "Map points",
49
+ className
50
+ }) => {
51
+ const theme = useThemeMode();
52
+ const containerRef = useRef(null);
53
+ const { drawn, bounds, info } = useMemo(
54
+ () => normalizePoints(points, maxPoints),
55
+ [points, maxPoints]
56
+ );
57
+ const categoryColors = useMemo(() => buildCategoryColors(points), [points]);
58
+ const legendItems = useMemo(() => buildLegendItems(categoryColors), [categoryColors]);
59
+ const markers = useMemo(() => {
60
+ const weightScale = buildWeightScale(points);
61
+ const selection = new Set(selectedIds ?? []);
62
+ return drawn.map(({ point, sourceIndex }) => {
63
+ const selected = selection.has(point.id);
64
+ return {
65
+ point,
66
+ sourceIndex,
67
+ selected,
68
+ style: buildMarkerStyle(point, { categoryColors, weightScale, selected, theme }),
69
+ description: describePoint(point, categoryLabel)
70
+ };
71
+ });
72
+ }, [drawn, points, selectedIds, categoryColors, theme, categoryLabel]);
73
+ const tiles = tileLayer ?? {
74
+ url: BASEMAP_TILES[basemap === "auto" ? theme : basemap],
75
+ attribution: BASEMAP_TILES.attribution
76
+ };
77
+ const shouldFitBounds = fitBounds && center == null && zoom == null;
78
+ const showLegend = !hideLegend && legendItems.length > 0;
79
+ const notice = buildNotice(info, maxPoints);
80
+ const hasMap = !isLoading && error == null && info.drawn > 0;
81
+ useEffect(() => {
82
+ onRender == null ? void 0 : onRender(info);
83
+ }, [onRender, info]);
84
+ useEffect(() => {
85
+ }, [hasMap]);
86
+ return /* @__PURE__ */ jsxs("div", { className: clsx(styles.root, compact && styles.compact, className), children: [
87
+ /* @__PURE__ */ jsxs("header", { className: styles.header, children: [
88
+ /* @__PURE__ */ jsx("h3", { className: styles.title, children: title }),
89
+ actions && /* @__PURE__ */ jsx("div", { className: styles.headerActions, children: actions })
90
+ ] }),
91
+ toolbar && /* @__PURE__ */ jsx("div", { className: styles.toolbar, children: toolbar }),
92
+ hasMap && notice && /* @__PURE__ */ jsx("div", { className: styles.warning, role: "status", children: notice }),
93
+ isLoading && /* @__PURE__ */ jsx("div", { className: styles.loading, children: loadingLabel }),
94
+ !isLoading && error != null && /* @__PURE__ */ jsxs("div", { className: styles.error, children: [
95
+ /* @__PURE__ */ jsx("span", { children: error }),
96
+ onRetry && /* @__PURE__ */ jsx("button", { type: "button", className: styles.retryButton, onClick: onRetry, children: retryLabel })
97
+ ] }),
98
+ !isLoading && error == null && info.drawn === 0 && /* @__PURE__ */ jsx(
99
+ EmptyState,
100
+ {
101
+ className: styles.empty,
102
+ variant: "plain",
103
+ title: emptyTitle,
104
+ description: emptyDescription
105
+ }
106
+ ),
107
+ hasMap && /* @__PURE__ */ jsxs(
108
+ "div",
109
+ {
110
+ ref: containerRef,
111
+ className: styles.mapContainer,
112
+ role: "figure",
113
+ "aria-label": `${title}: map of ${info.drawn} points`,
114
+ children: [
115
+ /* @__PURE__ */ jsxs(
116
+ MapContainer,
117
+ {
118
+ className: styles.map,
119
+ center: center ?? [...GEO_MAP.DEFAULT_CENTER],
120
+ zoom: zoom ?? GEO_MAP.DEFAULT_ZOOM,
121
+ scrollWheelZoom,
122
+ children: [
123
+ /* @__PURE__ */ jsx(TileLayer, { url: tiles.url, attribution: tiles.attribution }, tiles.url),
124
+ /* @__PURE__ */ jsx(MapViewport, { bounds, fitBounds: shouldFitBounds }),
125
+ markers.map(({ point, sourceIndex, style, description }) => /* @__PURE__ */ jsx(
126
+ CircleMarker,
127
+ {
128
+ center: [point.latitude, point.longitude],
129
+ radius: style.radius,
130
+ pathOptions: style,
131
+ eventHandlers: onSelectPoint ? { click: () => onSelectPoint({ point, index: sourceIndex }) } : {},
132
+ children: /* @__PURE__ */ jsx(Tooltip, { children: description })
133
+ },
134
+ point.id
135
+ )),
136
+ showLegend && /* @__PURE__ */ jsx(MapLegend, { items: legendItems, title: legendTitle })
137
+ ]
138
+ }
139
+ ),
140
+ /* @__PURE__ */ jsx(
141
+ PointListing,
142
+ {
143
+ markers,
144
+ label: pointListLabel,
145
+ onSelectPoint
146
+ }
147
+ )
148
+ ]
149
+ }
150
+ )
151
+ ] });
152
+ };
153
+ GeoMapCard.displayName = "GeoMapCard";
9
154
  export {
10
- Input
155
+ GeoMapCard
11
156
  };
12
157
  //# sourceMappingURL=index30.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index30.js","sources":["../src/primitives/Input/Input.tsx"],"sourcesContent":["import { forwardRef } from 'react';\nimport clsx from 'clsx';\nimport styles from './Input.module.css';\n\nexport interface InputProps extends React.InputHTMLAttributes<HTMLInputElement> {}\n\nexport const Input = forwardRef<HTMLInputElement, InputProps>(\n ({ className, type = 'text', ...props }, ref) => (\n <input ref={ref} type={type} className={clsx(styles.root, className)} {...props} />\n ),\n);\n\nInput.displayName = 'Input';\n"],"names":[],"mappings":";;;;AAMO,MAAM,QAAQ;AAAA,EACnB,CAAC,EAAE,WAAW,OAAO,QAAQ,GAAG,SAAS,QACvC,oBAAC,WAAM,KAAU,MAAY,WAAW,KAAK,OAAO,MAAM,SAAS,GAAI,GAAG,MAAA,CAAO;AAErF;AAEA,MAAM,cAAc;"}
1
+ {"version":3,"file":"index30.js","sources":["../src/geo/GeoMapCard/GeoMapCard.tsx"],"sourcesContent":["import { useEffect, useMemo, useRef } from 'react';\nimport { CircleMarker, MapContainer, TileLayer, Tooltip } from 'react-leaflet';\nimport clsx from 'clsx';\nimport { EmptyState } from '../../primitives/EmptyState';\nimport { useThemeMode } from '../../hooks/useThemeMode';\nimport { BASEMAP_TILES, GEO_MAP } from '../../constants';\nimport type { GeoPoint, GeoRenderInfo } from '../../types/geo.types';\nimport type { GeoMapCardProps, MarkerDescriptor } from './GeoMapCard.types';\nimport { normalizePoints } from './normalizePoints';\nimport { buildCategoryColors, buildLegendItems, buildMarkerStyle, buildWeightScale } from './buildMarkerStyle';\nimport { MapViewport } from './MapViewport';\nimport { MapLegend } from './MapLegend';\nimport { PointListing } from './PointListing';\nimport { warnMissingLeafletStylesheet } from './warnMissingLeafletStylesheet';\nimport styles from './GeoMapCard.module.css';\n\n/** States what was left out, so a truncated map never passes for a complete one. */\nconst buildNotice = (info: GeoRenderInfo, maxPoints: number): string | null => {\n const reasons: string[] = [];\n\n if (info.skipped > 0) reasons.push(`${info.skipped} without usable coordinates`);\n if (info.dropped > 0) reasons.push(`${info.dropped} over the ${maxPoints} marker cap`);\n\n if (reasons.length === 0) return null;\n\n return `Showing ${info.drawn} of ${info.total} points (${reasons.join(', ')}).`;\n};\n\n/** One line carrying everything the tooltip shows, for the screen reader too. */\nconst describePoint = (point: GeoPoint, categoryLabel: string): string =>\n [point.label, point.category != null ? `${categoryLabel}: ${point.category}` : null, point.detail]\n .filter((part): part is string => part != null && part !== '')\n .join(' — ');\n\nexport const GeoMapCard = ({\n title,\n points,\n selectedIds,\n onSelectPoint,\n categoryLabel = 'Category',\n legendTitle = 'Legend',\n hideLegend = false,\n maxPoints = GEO_MAP.MAX_POINTS,\n onRender,\n fitBounds = true,\n center,\n zoom,\n scrollWheelZoom = false,\n basemap = 'auto',\n tileLayer,\n compact = false,\n toolbar,\n actions,\n isLoading = false,\n error = null,\n onRetry,\n emptyTitle = 'No mappable points',\n emptyDescription = 'None of the points received carry usable coordinates.',\n retryLabel = 'Retry',\n loadingLabel = 'Loading map...',\n pointListLabel = 'Map points',\n className,\n}: GeoMapCardProps) => {\n const theme = useThemeMode();\n const containerRef = useRef<HTMLDivElement>(null);\n\n const { drawn, bounds, info } = useMemo(\n () => normalizePoints(points, maxPoints),\n [points, maxPoints],\n );\n\n const categoryColors = useMemo(() => buildCategoryColors(points), [points]);\n const legendItems = useMemo(() => buildLegendItems(categoryColors), [categoryColors]);\n\n const markers = useMemo<MarkerDescriptor[]>(() => {\n const weightScale = buildWeightScale(points);\n const selection = new Set(selectedIds ?? []);\n\n return drawn.map(({ point, sourceIndex }) => {\n const selected = selection.has(point.id);\n\n return {\n point,\n sourceIndex,\n selected,\n style: buildMarkerStyle(point, { categoryColors, weightScale, selected, theme }),\n description: describePoint(point, categoryLabel),\n };\n });\n }, [drawn, points, selectedIds, categoryColors, theme, categoryLabel]);\n\n const tiles = tileLayer ?? {\n url: BASEMAP_TILES[basemap === 'auto' ? theme : basemap],\n attribution: BASEMAP_TILES.attribution,\n };\n\n // Manual framing and automatic framing would fight over the viewport.\n const shouldFitBounds = fitBounds && center == null && zoom == null;\n const showLegend = !hideLegend && legendItems.length > 0;\n const notice = buildNotice(info, maxPoints);\n const hasMap = !isLoading && error == null && info.drawn > 0;\n\n useEffect(() => {\n onRender?.(info);\n }, [onRender, info]);\n\n useEffect(() => {\n if (import.meta.env.DEV && hasMap) warnMissingLeafletStylesheet(containerRef.current);\n }, [hasMap]);\n\n return (\n <div className={clsx(styles.root, compact && styles.compact, className)}>\n <header className={styles.header}>\n <h3 className={styles.title}>{title}</h3>\n {actions && <div className={styles.headerActions}>{actions}</div>}\n </header>\n\n {toolbar && <div className={styles.toolbar}>{toolbar}</div>}\n\n {hasMap && notice && (\n <div className={styles.warning} role=\"status\">\n {notice}\n </div>\n )}\n\n {isLoading && <div className={styles.loading}>{loadingLabel}</div>}\n\n {!isLoading && error != null && (\n <div className={styles.error}>\n <span>{error}</span>\n {onRetry && (\n <button type=\"button\" className={styles.retryButton} onClick={onRetry}>\n {retryLabel}\n </button>\n )}\n </div>\n )}\n\n {!isLoading && error == null && info.drawn === 0 && (\n <EmptyState\n className={styles.empty}\n variant=\"plain\"\n title={emptyTitle}\n description={emptyDescription}\n />\n )}\n\n {hasMap && (\n <div\n ref={containerRef}\n className={styles.mapContainer}\n role=\"figure\"\n aria-label={`${title}: map of ${info.drawn} points`}\n >\n <MapContainer\n className={styles.map}\n center={center ?? [...GEO_MAP.DEFAULT_CENTER]}\n zoom={zoom ?? GEO_MAP.DEFAULT_ZOOM}\n scrollWheelZoom={scrollWheelZoom}\n >\n <TileLayer key={tiles.url} url={tiles.url} attribution={tiles.attribution} />\n <MapViewport bounds={bounds} fitBounds={shouldFitBounds} />\n\n {markers.map(({ point, sourceIndex, style, description }) => (\n <CircleMarker\n key={point.id}\n center={[point.latitude, point.longitude]}\n radius={style.radius}\n pathOptions={style}\n eventHandlers={\n onSelectPoint ? { click: () => onSelectPoint({ point, index: sourceIndex }) } : {}\n }\n >\n <Tooltip>{description}</Tooltip>\n </CircleMarker>\n ))}\n\n {showLegend && <MapLegend items={legendItems} title={legendTitle} />}\n </MapContainer>\n\n <PointListing\n markers={markers}\n label={pointListLabel}\n onSelectPoint={onSelectPoint}\n />\n </div>\n )}\n </div>\n );\n};\n\nGeoMapCard.displayName = 'GeoMapCard';\n"],"names":[],"mappings":";;;;;;;;;;;;;AAiBA,MAAM,cAAc,CAAC,MAAqB,cAAqC;AAC7E,QAAM,UAAoB,CAAA;AAE1B,MAAI,KAAK,UAAU,EAAG,SAAQ,KAAK,GAAG,KAAK,OAAO,6BAA6B;AAC/E,MAAI,KAAK,UAAU,EAAG,SAAQ,KAAK,GAAG,KAAK,OAAO,aAAa,SAAS,aAAa;AAErF,MAAI,QAAQ,WAAW,EAAG,QAAO;AAEjC,SAAO,WAAW,KAAK,KAAK,OAAO,KAAK,KAAK,YAAY,QAAQ,KAAK,IAAI,CAAC;AAC7E;AAGA,MAAM,gBAAgB,CAAC,OAAiB,kBACtC,CAAC,MAAM,OAAO,MAAM,YAAY,OAAO,GAAG,aAAa,KAAK,MAAM,QAAQ,KAAK,MAAM,MAAM,MAAM,EAC9F,OAAO,CAAC,SAAyB,QAAQ,QAAQ,SAAS,EAAE,EAC5D,KAAK,KAAK;AAER,MAAM,aAAa,CAAC;AAAA,EACzB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,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sxRuntime = require("react/jsx-runtime");
4
4
  const react = require("react");
5
- const clsx = require("./index55.cjs");
6
- const constants = require("./index59.cjs");
7
- const LiveExplorerTable_module = require("./index97.cjs");
8
- const SKELETON_ROWS = 5;
9
- const FULL_PERCENT = 100;
10
- const LiveExplorerTable = ({
11
- rows,
12
- columns,
13
- sortState = null,
14
- onSortChange,
15
- isLoading = false,
16
- hasMore = false,
17
- isFetchingNext = false,
18
- onLoadMore,
19
- onColumnResize,
20
- onRowClick,
21
- selectedRowKey = null,
22
- scrollToSelectedRow = false,
23
- maxHeight,
24
- className
25
- }) => {
26
- const selectedRef = react.useRef(null);
27
- react.useEffect(() => {
28
- if (scrollToSelectedRow && selectedRef.current) {
29
- selectedRef.current.scrollIntoView({ block: "nearest", behavior: "smooth" });
30
- }
31
- }, [scrollToSelectedRow, selectedRowKey]);
32
- const handleSort = react.useCallback(
33
- (columnKey) => {
34
- if (!onSortChange) return;
35
- const newDirection = (sortState == null ? void 0 : sortState.column) === columnKey && sortState.direction === "asc" ? "desc" : "asc";
36
- onSortChange({ column: columnKey, direction: newDirection });
37
- },
38
- [onSortChange, sortState]
39
- );
40
- const handleResizeStart = react.useCallback(
41
- (columnKey, startX, startWidth) => {
42
- if (!onColumnResize) return;
43
- const col = columns.find((c) => c.key === columnKey);
44
- const minW = (col == null ? void 0 : col.minWidth) ?? constants.MIN_COLUMN_WIDTH;
45
- const onMouseMove = (e) => {
46
- const newWidth = Math.max(minW, startWidth + e.clientX - startX);
47
- onColumnResize(columnKey, newWidth);
48
- };
49
- const onMouseUp = () => {
50
- document.removeEventListener("mousemove", onMouseMove);
51
- document.removeEventListener("mouseup", onMouseUp);
52
- document.body.style.cursor = "";
53
- document.body.style.userSelect = "";
54
- };
55
- document.addEventListener("mousemove", onMouseMove);
56
- document.addEventListener("mouseup", onMouseUp);
57
- document.body.style.cursor = "col-resize";
58
- document.body.style.userSelect = "none";
59
- },
60
- [onColumnResize, columns]
61
- );
62
- const getSortAria = (key) => {
63
- if ((sortState == null ? void 0 : sortState.column) !== key) return "none";
64
- return sortState.direction === "asc" ? "ascending" : "descending";
65
- };
66
- const renderCell = (col, row) => {
67
- const value = row[col.key];
68
- if (col.render) return col.render(value, row);
69
- return String(value ?? "");
70
- };
71
- const containerStyle = maxHeight ? { maxHeight: typeof maxHeight === "number" ? `${maxHeight}px` : maxHeight } : void 0;
72
- return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: clsx.clsx(LiveExplorerTable_module.default.root, className), children: [
73
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: LiveExplorerTable_module.default.tableContainer, style: containerStyle, children: /* @__PURE__ */ jsxRuntime.jsxs("table", { className: LiveExplorerTable_module.default.table, children: [
74
- /* @__PURE__ */ jsxRuntime.jsx("thead", { children: /* @__PURE__ */ jsxRuntime.jsx("tr", { children: columns.map((col) => /* @__PURE__ */ jsxRuntime.jsxs(
75
- "th",
76
- {
77
- scope: "col",
78
- className: clsx.clsx(LiveExplorerTable_module.default.th, { [LiveExplorerTable_module.default.sortable]: col.sortable }),
79
- style: col.width ? { width: `${col.width}px` } : void 0,
80
- "aria-sort": col.sortable ? getSortAria(col.key) : void 0,
81
- onClick: col.sortable ? () => handleSort(col.key) : void 0,
82
- children: [
83
- /* @__PURE__ */ jsxRuntime.jsxs("span", { className: LiveExplorerTable_module.default.thContent, children: [
84
- col.label,
85
- col.sortable && (sortState == null ? void 0 : sortState.column) === col.key && /* @__PURE__ */ jsxRuntime.jsx("span", { className: LiveExplorerTable_module.default.sortIndicator, "aria-hidden": "true", children: sortState.direction === "asc" ? "▲" : "▼" })
86
- ] }),
87
- onColumnResize && /* @__PURE__ */ jsxRuntime.jsx(
88
- "span",
5
+ const clsx = require("./index57.cjs");
6
+ const HeatmapMatrix_module = require("./index106.cjs");
7
+ function activateOnKey(event, action) {
8
+ if (event.key === "Enter" || event.key === " ") {
9
+ event.preventDefault();
10
+ action();
11
+ }
12
+ }
13
+ const HeatmapMatrix = react.forwardRef(
14
+ ({
15
+ columns,
16
+ rows,
17
+ cornerLabel,
18
+ getCell,
19
+ onRowHeaderClick,
20
+ onCellClick,
21
+ maxHeight,
22
+ className,
23
+ style,
24
+ ...props
25
+ }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
26
+ "div",
27
+ {
28
+ ref,
29
+ className: clsx.clsx(HeatmapMatrix_module.default.wrap, className),
30
+ style: { maxHeight, ...style },
31
+ ...props,
32
+ children: /* @__PURE__ */ jsxRuntime.jsxs("table", { className: HeatmapMatrix_module.default.root, children: [
33
+ /* @__PURE__ */ jsxRuntime.jsx("thead", { children: /* @__PURE__ */ jsxRuntime.jsxs("tr", { children: [
34
+ /* @__PURE__ */ jsxRuntime.jsx("th", { scope: "col", className: HeatmapMatrix_module.default.corner, "aria-hidden": cornerLabel == null, children: cornerLabel }),
35
+ columns.map((col) => /* @__PURE__ */ jsxRuntime.jsx("th", { scope: "col", className: HeatmapMatrix_module.default.colh, title: col.title, children: col.label }, col.key))
36
+ ] }) }),
37
+ /* @__PURE__ */ jsxRuntime.jsx("tbody", { children: rows.map((row) => {
38
+ const rowInteractive = Boolean(onRowHeaderClick);
39
+ return /* @__PURE__ */ jsxRuntime.jsxs("tr", { children: [
40
+ /* @__PURE__ */ jsxRuntime.jsx(
41
+ "th",
89
42
  {
90
- className: LiveExplorerTable_module.default.resizeHandle,
91
- role: "separator",
92
- "aria-orientation": "vertical",
93
- onMouseDown: (e) => {
94
- e.preventDefault();
95
- e.stopPropagation();
96
- const th = e.target.closest("th");
97
- handleResizeStart(col.key, e.clientX, (th == null ? void 0 : th.offsetWidth) ?? FULL_PERCENT);
98
- }
43
+ scope: "row",
44
+ className: clsx.clsx(HeatmapMatrix_module.default.rowh, rowInteractive && HeatmapMatrix_module.default.clickable),
45
+ role: rowInteractive ? "button" : void 0,
46
+ tabIndex: rowInteractive ? 0 : void 0,
47
+ onClick: rowInteractive ? () => onRowHeaderClick == null ? void 0 : onRowHeaderClick(row.key) : void 0,
48
+ onKeyDown: rowInteractive ? (event) => activateOnKey(event, () => onRowHeaderClick == null ? void 0 : onRowHeaderClick(row.key)) : void 0,
49
+ children: row.label
99
50
  }
100
- )
101
- ]
102
- },
103
- col.key
104
- )) }) }),
105
- /* @__PURE__ */ jsxRuntime.jsx("tbody", { children: isLoading && rows.length === 0 ? Array.from({ length: SKELETON_ROWS }, (_, i) => /* @__PURE__ */ jsxRuntime.jsx("tr", { className: LiveExplorerTable_module.default.skeletonRow, children: columns.map((col) => /* @__PURE__ */ jsxRuntime.jsx("td", { children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: LiveExplorerTable_module.default.skeleton }) }, col.key)) }, `skeleton-${i}`)) : rows.map((row) => /* @__PURE__ */ jsxRuntime.jsx(
106
- "tr",
107
- {
108
- ref: row.id === selectedRowKey ? selectedRef : void 0,
109
- className: clsx.clsx(LiveExplorerTable_module.default.row, {
110
- [LiveExplorerTable_module.default.rowSelected]: row.id === selectedRowKey,
111
- [LiveExplorerTable_module.default.rowClickable]: !!onRowClick
112
- }),
113
- "aria-selected": row.id === selectedRowKey || void 0,
114
- onClick: onRowClick ? () => onRowClick(row) : void 0,
115
- children: columns.map((col) => /* @__PURE__ */ jsxRuntime.jsx("td", { className: LiveExplorerTable_module.default.td, children: renderCell(col, row) }, col.key))
116
- },
117
- row.id
118
- )) })
119
- ] }) }),
120
- rows.length === 0 && !isLoading && /* @__PURE__ */ jsxRuntime.jsx("div", { className: LiveExplorerTable_module.default.empty, children: "No data available" }),
121
- hasMore && onLoadMore && /* @__PURE__ */ jsxRuntime.jsx("div", { className: LiveExplorerTable_module.default.loadMore, children: /* @__PURE__ */ jsxRuntime.jsx(
122
- "button",
123
- {
124
- type: "button",
125
- className: LiveExplorerTable_module.default.loadMoreButton,
126
- onClick: onLoadMore,
127
- disabled: isFetchingNext,
128
- children: isFetchingNext ? "Loading..." : "Load more"
129
- }
130
- ) })
131
- ] });
132
- };
133
- LiveExplorerTable.displayName = "LiveExplorerTable";
134
- exports.LiveExplorerTable = LiveExplorerTable;
51
+ ),
52
+ columns.map((col) => {
53
+ const cell = getCell(row.key, col.key);
54
+ const cellInteractive = Boolean(onCellClick);
55
+ return /* @__PURE__ */ jsxRuntime.jsx(
56
+ "td",
57
+ {
58
+ title: cell.title,
59
+ className: clsx.clsx(
60
+ HeatmapMatrix_module.default.cell,
61
+ cell.state && HeatmapMatrix_module.default[cell.state],
62
+ cellInteractive && HeatmapMatrix_module.default.clickable
63
+ ),
64
+ role: cellInteractive ? "button" : void 0,
65
+ tabIndex: cellInteractive ? 0 : void 0,
66
+ onClick: cellInteractive ? () => onCellClick == null ? void 0 : onCellClick(row.key, col.key) : void 0,
67
+ onKeyDown: cellInteractive ? (event) => activateOnKey(event, () => onCellClick == null ? void 0 : onCellClick(row.key, col.key)) : void 0,
68
+ children: cell.value
69
+ },
70
+ col.key
71
+ );
72
+ })
73
+ ] }, row.key);
74
+ }) })
75
+ ] })
76
+ }
77
+ )
78
+ );
79
+ HeatmapMatrix.displayName = "HeatmapMatrix";
80
+ exports.HeatmapMatrix = HeatmapMatrix;
135
81
  //# sourceMappingURL=index31.cjs.map