@carto/ps-react-ui 4.20.2 → 4.21.1

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 (406) hide show
  1. package/dist/{actions-Dy9JVr7F.js → actions-C7ZAO0FG.js} +4 -4
  2. package/dist/{actions-Dy9JVr7F.js.map → actions-C7ZAO0FG.js.map} +1 -1
  3. package/dist/{actions-DKX98LlI.js → actions-DZGaL_uT.js} +2 -2
  4. package/dist/{actions-DKX98LlI.js.map → actions-DZGaL_uT.js.map} +1 -1
  5. package/dist/{category-DHZscHaS.js → category-DZt6yiST.js} +3 -3
  6. package/dist/{category-DHZscHaS.js.map → category-DZt6yiST.js.map} +1 -1
  7. package/dist/{chart-config-BGt7wkK7.js → chart-config-BWxjodlt.js} +2 -2
  8. package/dist/chart-config-BWxjodlt.js.map +1 -0
  9. package/dist/chat.js.map +1 -1
  10. package/dist/{components-DDt4mOQn.js → components-DKjBezcJ.js} +73 -73
  11. package/dist/components-DKjBezcJ.js.map +1 -0
  12. package/dist/components.js +1 -1
  13. package/dist/{download-BT6qBamM.js → download-C7he8mSh.js} +2 -2
  14. package/dist/{download-BT6qBamM.js.map → download-C7he8mSh.js.map} +1 -1
  15. package/dist/{formula-Bk9CBzm2.js → formula-BNuRXsmh.js} +2 -2
  16. package/dist/{formula-Bk9CBzm2.js.map → formula-BNuRXsmh.js.map} +1 -1
  17. package/dist/{formula-Dsru_p-g.js → formula-Cqj84ZGX.js} +2 -2
  18. package/dist/{formula-Dsru_p-g.js.map → formula-Cqj84ZGX.js.map} +1 -1
  19. package/dist/legend.js +2 -0
  20. package/dist/legend.js.map +1 -1
  21. package/dist/{markdown-DnSJMPjQ.js → markdown-CV_KP-at.js} +2 -2
  22. package/dist/{markdown-DnSJMPjQ.js.map → markdown-CV_KP-at.js.map} +1 -1
  23. package/dist/{spread-Dy8pshpN.js → spread-C8T12Nfh.js} +3 -3
  24. package/dist/{spread-Dy8pshpN.js.map → spread-C8T12Nfh.js.map} +1 -1
  25. package/dist/{table-BfTG6rrs.js → table-CNQijNNB.js} +2 -2
  26. package/dist/{table-BfTG6rrs.js.map → table-CNQijNNB.js.map} +1 -1
  27. package/dist/types/chat/bubbles/chat-agent-message-markdown.d.ts +1 -1
  28. package/dist/types/chat/bubbles/chat-agent-message.d.ts +1 -1
  29. package/dist/types/chat/bubbles/chat-error-message.d.ts +1 -1
  30. package/dist/types/chat/bubbles/chat-suggestion-button.d.ts +1 -1
  31. package/dist/types/chat/bubbles/chat-user-message.d.ts +1 -1
  32. package/dist/types/chat/bubbles/index.d.ts +5 -5
  33. package/dist/types/chat/bubbles/styles.d.ts +88 -0
  34. package/dist/types/chat/containers/chat-content.d.ts +1 -1
  35. package/dist/types/chat/containers/chat-footer.d.ts +1 -1
  36. package/dist/types/chat/containers/chat-header.d.ts +1 -1
  37. package/dist/types/chat/containers/chat-starter.d.ts +1 -1
  38. package/dist/types/chat/containers/index.d.ts +4 -4
  39. package/dist/types/chat/feedback/chat-actions-container.d.ts +3 -0
  40. package/dist/types/chat/feedback/chat-loader.d.ts +1 -1
  41. package/dist/types/chat/feedback/chat-rating-action.d.ts +1 -1
  42. package/dist/types/chat/feedback/chat-thinking.d.ts +1 -1
  43. package/dist/types/chat/feedback/chat-tool-code-area.d.ts +1 -1
  44. package/dist/types/chat/feedback/chat-tool-full-view-dialog.d.ts +1 -1
  45. package/dist/types/chat/feedback/chat-tool-group.d.ts +1 -1
  46. package/dist/types/chat/feedback/chat-tool-trace.d.ts +1 -1
  47. package/dist/types/chat/feedback/get-tool-label.d.ts +1 -1
  48. package/dist/types/chat/feedback/index.d.ts +8 -8
  49. package/dist/types/chat/feedback/styles.d.ts +212 -0
  50. package/dist/types/chat/index.d.ts +21 -21
  51. package/dist/types/components/basemaps/basemaps.d.ts +1 -1
  52. package/dist/types/components/basemaps/const.d.ts +1 -1
  53. package/dist/types/components/basemaps/group.d.ts +1 -1
  54. package/dist/types/components/basemaps/header.d.ts +1 -1
  55. package/dist/types/components/copy-button/copy-button.d.ts +1 -1
  56. package/dist/types/components/geolocation-controls/geolocation-controls.d.ts +1 -1
  57. package/dist/types/components/index.d.ts +26 -26
  58. package/dist/types/components/lasso-tool/chip.d.ts +1 -1
  59. package/dist/types/components/lasso-tool/const.d.ts +2 -2
  60. package/dist/types/components/lasso-tool/geometry-toolbar.d.ts +1 -1
  61. package/dist/types/components/lasso-tool/lasso-tool-inline.d.ts +1 -1
  62. package/dist/types/components/lasso-tool/lasso-tool.d.ts +1 -1
  63. package/dist/types/components/lasso-tool/layer-filters.d.ts +1 -1
  64. package/dist/types/components/lasso-tool/message.d.ts +1 -1
  65. package/dist/types/components/lasso-tool/types.d.ts +1 -1
  66. package/dist/types/components/list-data/list-data.d.ts +1 -1
  67. package/dist/types/components/measurement-tools/const.d.ts +2 -2
  68. package/dist/types/components/measurement-tools/measurement-tools.d.ts +1 -1
  69. package/dist/types/components/measurement-tools/types.d.ts +1 -1
  70. package/dist/types/components/responsive-drawer/responsive-drawer.d.ts +10 -3
  71. package/dist/types/components/types.d.ts +1 -1
  72. package/dist/types/components/zoom-controls/zoom-controls.d.ts +1 -1
  73. package/dist/types/hooks/index.d.ts +1 -1
  74. package/dist/types/legend/components/icons.d.ts +1 -1
  75. package/dist/types/legend/components/index.d.ts +26 -26
  76. package/dist/types/legend/components/legend-category/legend-category-ui.d.ts +1 -1
  77. package/dist/types/legend/components/legend-icon/legend-icon-ui.d.ts +1 -1
  78. package/dist/types/legend/components/legend-item/legend-item-ui.d.ts +2 -2
  79. package/dist/types/legend/components/legend-proportion/legend-proportion-ui.d.ts +2 -2
  80. package/dist/types/legend/components/legend-ramp/legend-ramp-ui.d.ts +2 -2
  81. package/dist/types/legend/components/legend-sortable/sortable-entity.d.ts +1 -1
  82. package/dist/types/legend/components/legend-swatch/legend-swatch.d.ts +1 -1
  83. package/dist/types/legend/components/legend-visibility-toggle/legend-visibility-toggle.d.ts +2 -2
  84. package/dist/types/legend/components/run-async-menu-action.d.ts +1 -1
  85. package/dist/types/legend/index.d.ts +41 -41
  86. package/dist/types/legend/provider/index.d.ts +6 -6
  87. package/dist/types/legend/provider/legend-config-context.d.ts +1 -1
  88. package/dist/types/legend/provider/legend-provider.d.ts +2 -2
  89. package/dist/types/legend/stores/index.d.ts +5 -5
  90. package/dist/types/legend/stores/legend-store-registry.d.ts +1 -1
  91. package/dist/types/legend/stores/selectors.d.ts +1 -1
  92. package/dist/types/widgets/actions/brush-toggle/brush-toggle.d.ts +1 -1
  93. package/dist/types/widgets/actions/brush-toggle/hit-test.d.ts +1 -1
  94. package/dist/types/widgets/actions/brush-toggle/types.d.ts +1 -1
  95. package/dist/types/widgets/actions/change-column/change-column.d.ts +1 -1
  96. package/dist/types/widgets/actions/change-column/sortable-column-item.d.ts +1 -1
  97. package/dist/types/widgets/actions/download/download.d.ts +1 -1
  98. package/dist/types/widgets/actions/download/exports.d.ts +1 -1
  99. package/dist/types/widgets/actions/download/types.d.ts +1 -1
  100. package/dist/types/widgets/actions/fullscreen/fullscreen.d.ts +1 -1
  101. package/dist/types/widgets/actions/fullscreen/types.d.ts +1 -1
  102. package/dist/types/widgets/actions/index.d.ts +20 -20
  103. package/dist/types/widgets/actions/lock-selection/lock-selection.d.ts +1 -1
  104. package/dist/types/widgets/actions/lock-selection/types.d.ts +1 -1
  105. package/dist/types/widgets/actions/relative-data/relative-data.d.ts +1 -1
  106. package/dist/types/widgets/actions/relative-data/types.d.ts +1 -1
  107. package/dist/types/widgets/actions/relative-data/utils.d.ts +1 -1
  108. package/dist/types/widgets/actions/searcher/searcher-toggle.d.ts +1 -1
  109. package/dist/types/widgets/actions/searcher/searcher.d.ts +1 -1
  110. package/dist/types/widgets/actions/searcher/types.d.ts +2 -2
  111. package/dist/types/widgets/actions/stack-toggle/stack-toggle.d.ts +1 -1
  112. package/dist/types/widgets/actions/stack-toggle/types.d.ts +1 -1
  113. package/dist/types/widgets/actions/zoom-toggle/types.d.ts +1 -1
  114. package/dist/types/widgets/actions/zoom-toggle/zoom-toggle.d.ts +1 -1
  115. package/dist/types/widgets/bar/config.d.ts +2 -2
  116. package/dist/types/widgets/bar/index.d.ts +3 -3
  117. package/dist/types/widgets/bar/types.d.ts +3 -3
  118. package/dist/types/widgets/category/category-ui.d.ts +1 -1
  119. package/dist/types/widgets/category/components/category-legend.d.ts +1 -1
  120. package/dist/types/widgets/category/components/category-row-multi.d.ts +1 -1
  121. package/dist/types/widgets/category/components/category-row-single.d.ts +1 -1
  122. package/dist/types/widgets/category/config.d.ts +3 -3
  123. package/dist/types/widgets/category/index.d.ts +14 -14
  124. package/dist/types/widgets/category/types.d.ts +3 -3
  125. package/dist/types/widgets/echart/echart-ui.d.ts +1 -1
  126. package/dist/types/widgets/echart/echart.d.ts +1 -1
  127. package/dist/types/widgets/echart/index.d.ts +5 -5
  128. package/dist/types/widgets/echart/options.d.ts +1 -1
  129. package/dist/types/widgets/echart/types.d.ts +1 -1
  130. package/dist/types/widgets/echart/utils.d.ts +1 -1
  131. package/dist/types/widgets/error/error.d.ts +1 -1
  132. package/dist/types/widgets/error/index.d.ts +2 -2
  133. package/dist/types/widgets/error/types.d.ts +1 -1
  134. package/dist/types/widgets/formula/components/item.d.ts +1 -1
  135. package/dist/types/widgets/formula/components/prefix.d.ts +1 -1
  136. package/dist/types/widgets/formula/components/row.d.ts +1 -1
  137. package/dist/types/widgets/formula/components/series.d.ts +1 -1
  138. package/dist/types/widgets/formula/components/suffix.d.ts +1 -1
  139. package/dist/types/widgets/formula/components/value.d.ts +1 -1
  140. package/dist/types/widgets/formula/config.d.ts +2 -2
  141. package/dist/types/widgets/formula/formula-ui.d.ts +1 -1
  142. package/dist/types/widgets/formula/index.d.ts +11 -11
  143. package/dist/types/widgets/formula/serializer.d.ts +1 -1
  144. package/dist/types/widgets/formula/types.d.ts +3 -3
  145. package/dist/types/widgets/histogram/config.d.ts +3 -3
  146. package/dist/types/widgets/histogram/index.d.ts +4 -4
  147. package/dist/types/widgets/histogram/types.d.ts +3 -3
  148. package/dist/types/widgets/loader/index.d.ts +3 -3
  149. package/dist/types/widgets/loader/loader.d.ts +1 -1
  150. package/dist/types/widgets/loader/types.d.ts +1 -1
  151. package/dist/types/widgets/markdown/config.d.ts +2 -2
  152. package/dist/types/widgets/markdown/index.d.ts +5 -5
  153. package/dist/types/widgets/markdown/markdown-ui.d.ts +1 -1
  154. package/dist/types/widgets/markdown/markdown.d.ts +1 -1
  155. package/dist/types/widgets/markdown/types.d.ts +3 -3
  156. package/dist/types/widgets/no-data/index.d.ts +2 -2
  157. package/dist/types/widgets/no-data/no-data.d.ts +1 -1
  158. package/dist/types/widgets/no-data/types.d.ts +1 -1
  159. package/dist/types/widgets/note/index.d.ts +2 -2
  160. package/dist/types/widgets/note/note.d.ts +1 -1
  161. package/dist/types/widgets/note/types.d.ts +1 -1
  162. package/dist/types/widgets/pie/config.d.ts +2 -2
  163. package/dist/types/widgets/pie/index.d.ts +3 -3
  164. package/dist/types/widgets/pie/types.d.ts +3 -3
  165. package/dist/types/widgets/range/components/range-item.d.ts +1 -1
  166. package/dist/types/widgets/range/config.d.ts +1 -1
  167. package/dist/types/widgets/range/index.d.ts +6 -6
  168. package/dist/types/widgets/range/range-ui.d.ts +1 -1
  169. package/dist/types/widgets/range/serializer.d.ts +1 -1
  170. package/dist/types/widgets/range/types.d.ts +3 -3
  171. package/dist/types/widgets/scatterplot/config.d.ts +2 -2
  172. package/dist/types/widgets/scatterplot/index.d.ts +3 -3
  173. package/dist/types/widgets/scatterplot/types.d.ts +3 -3
  174. package/dist/types/widgets/selection-summary/index.d.ts +2 -2
  175. package/dist/types/widgets/selection-summary/selection-summary.d.ts +1 -1
  176. package/dist/types/widgets/skeleton-loader/index.d.ts +2 -2
  177. package/dist/types/widgets/skeleton-loader/skeleton-loader.d.ts +1 -1
  178. package/dist/types/widgets/skeleton-loader/types.d.ts +1 -1
  179. package/dist/types/widgets/spread/components/max-value.d.ts +1 -1
  180. package/dist/types/widgets/spread/components/min-value.d.ts +1 -1
  181. package/dist/types/widgets/spread/components/separator.d.ts +1 -1
  182. package/dist/types/widgets/spread/config.d.ts +3 -3
  183. package/dist/types/widgets/spread/index.d.ts +9 -9
  184. package/dist/types/widgets/spread/spread-ui.d.ts +1 -1
  185. package/dist/types/widgets/spread/types.d.ts +4 -4
  186. package/dist/types/widgets/stores/index.d.ts +3 -3
  187. package/dist/types/widgets/stores/use-widget-selector.d.ts +1 -1
  188. package/dist/types/widgets/stores/widget-store.d.ts +2 -2
  189. package/dist/types/widgets/subheader/index.d.ts +2 -2
  190. package/dist/types/widgets/subheader/subheader.d.ts +1 -1
  191. package/dist/types/widgets/table/components/cell-header.d.ts +1 -1
  192. package/dist/types/widgets/table/components/cell.d.ts +1 -1
  193. package/dist/types/widgets/table/components/pagination-actions.d.ts +1 -1
  194. package/dist/types/widgets/table/components/pagination.d.ts +1 -1
  195. package/dist/types/widgets/table/components/row.d.ts +1 -1
  196. package/dist/types/widgets/table/config.d.ts +2 -2
  197. package/dist/types/widgets/table/hooks/use-pagination.d.ts +1 -1
  198. package/dist/types/widgets/table/hooks/use-selection.d.ts +1 -1
  199. package/dist/types/widgets/table/hooks/use-sort.d.ts +1 -1
  200. package/dist/types/widgets/table/index.d.ts +17 -17
  201. package/dist/types/widgets/table/serializer.d.ts +1 -1
  202. package/dist/types/widgets/table/table-ui.d.ts +8 -8
  203. package/dist/types/widgets/table/types.d.ts +3 -3
  204. package/dist/types/widgets/timeseries/config.d.ts +2 -2
  205. package/dist/types/widgets/timeseries/index.d.ts +3 -3
  206. package/dist/types/widgets/timeseries/types.d.ts +3 -3
  207. package/dist/types/widgets/toolbar-actions/index.d.ts +2 -2
  208. package/dist/types/widgets/toolbar-actions/toolbar-actions.d.ts +1 -1
  209. package/dist/types/widgets/utils/chart-config/config-factory.d.ts +1 -1
  210. package/dist/types/widgets/utils/chart-config/download-config.d.ts +2 -2
  211. package/dist/types/widgets/utils/chart-config/index.d.ts +6 -6
  212. package/dist/types/widgets/utils/chart-config/option-builders.d.ts +142 -0
  213. package/dist/types/widgets/utils/index.d.ts +7 -7
  214. package/dist/types/widgets/utils/skeleton/index.d.ts +1 -1
  215. package/dist/types/widgets/wrapper/components/actions.d.ts +1 -1
  216. package/dist/types/widgets/wrapper/components/options.d.ts +1 -1
  217. package/dist/types/widgets/wrapper/components/title.d.ts +1 -1
  218. package/dist/types/widgets/wrapper/index.d.ts +6 -6
  219. package/dist/types/widgets/wrapper/types.d.ts +1 -1
  220. package/dist/types/widgets/wrapper/wrapper-ui.d.ts +1 -1
  221. package/dist/types/widgets/wrapper/wrapper.d.ts +1 -1
  222. package/dist/types/widgets-v2/actions/brush-toggle/brush-toggle.d.ts +1 -1
  223. package/dist/types/widgets-v2/actions/brush-toggle/index.d.ts +3 -3
  224. package/dist/types/widgets-v2/actions/change-column/change-column.d.ts +1 -1
  225. package/dist/types/widgets-v2/actions/change-column/index.d.ts +3 -3
  226. package/dist/types/widgets-v2/actions/change-column/types.d.ts +1 -1
  227. package/dist/types/widgets-v2/actions/download/csv-item.d.ts +1 -1
  228. package/dist/types/widgets-v2/actions/download/download.d.ts +2 -2
  229. package/dist/types/widgets-v2/actions/download/index.d.ts +8 -8
  230. package/dist/types/widgets-v2/actions/download/png-item.d.ts +1 -1
  231. package/dist/types/widgets-v2/actions/fullscreen/fullscreen.d.ts +1 -1
  232. package/dist/types/widgets-v2/actions/fullscreen/index.d.ts +3 -3
  233. package/dist/types/widgets-v2/actions/fullscreen/types.d.ts +1 -1
  234. package/dist/types/widgets-v2/actions/index.d.ts +10 -10
  235. package/dist/types/widgets-v2/actions/lock-selection/index.d.ts +3 -3
  236. package/dist/types/widgets-v2/actions/lock-selection/lock-selection.d.ts +1 -1
  237. package/dist/types/widgets-v2/actions/relative-data/index.d.ts +3 -3
  238. package/dist/types/widgets-v2/actions/relative-data/relative-data.d.ts +1 -1
  239. package/dist/types/widgets-v2/actions/searcher/index.d.ts +4 -4
  240. package/dist/types/widgets-v2/actions/searcher/searcher-toggle.d.ts +1 -1
  241. package/dist/types/widgets-v2/actions/searcher/searcher.d.ts +1 -1
  242. package/dist/types/widgets-v2/actions/show-all/index.d.ts +2 -2
  243. package/dist/types/widgets-v2/actions/show-all/show-all.d.ts +1 -1
  244. package/dist/types/widgets-v2/actions/stack-toggle/index.d.ts +3 -3
  245. package/dist/types/widgets-v2/actions/stack-toggle/stack-toggle.d.ts +1 -1
  246. package/dist/types/widgets-v2/actions/zoom-toggle/index.d.ts +3 -3
  247. package/dist/types/widgets-v2/actions/zoom-toggle/zoom-toggle.d.ts +2 -2
  248. package/dist/types/widgets-v2/bar/download.d.ts +2 -2
  249. package/dist/types/widgets-v2/bar/index.d.ts +4 -4
  250. package/dist/types/widgets-v2/bar/options.d.ts +2 -2
  251. package/dist/types/widgets-v2/bar/types.d.ts +1 -1
  252. package/dist/types/widgets-v2/category/category-ui.d.ts +1 -1
  253. package/dist/types/widgets-v2/category/category.d.ts +1 -1
  254. package/dist/types/widgets-v2/category/components/category-bar-stacked.d.ts +1 -1
  255. package/dist/types/widgets-v2/category/components/category-bar.d.ts +1 -1
  256. package/dist/types/widgets-v2/category/components/category-legend.d.ts +1 -1
  257. package/dist/types/widgets-v2/category/components/category-row-multi.d.ts +1 -1
  258. package/dist/types/widgets-v2/category/components/category-row-single.d.ts +1 -1
  259. package/dist/types/widgets-v2/category/components/category-row-stacked.d.ts +1 -1
  260. package/dist/types/widgets-v2/category/download.d.ts +2 -2
  261. package/dist/types/widgets-v2/category/index.d.ts +10 -10
  262. package/dist/types/widgets-v2/category/skeleton.d.ts +1 -1
  263. package/dist/types/widgets-v2/category/style.d.ts +1 -1
  264. package/dist/types/widgets-v2/category/types.d.ts +1 -1
  265. package/dist/types/widgets-v2/echart/echart.d.ts +1 -1
  266. package/dist/types/widgets-v2/echart/index.d.ts +4 -4
  267. package/dist/types/widgets-v2/echart/use-chart-selection.d.ts +1 -1
  268. package/dist/types/widgets-v2/formula/delta.d.ts +1 -1
  269. package/dist/types/widgets-v2/formula/download.d.ts +2 -2
  270. package/dist/types/widgets-v2/formula/formula-ui.d.ts +1 -1
  271. package/dist/types/widgets-v2/formula/index.d.ts +11 -11
  272. package/dist/types/widgets-v2/formula/types.d.ts +1 -1
  273. package/dist/types/widgets-v2/histogram/download.d.ts +2 -2
  274. package/dist/types/widgets-v2/histogram/index.d.ts +5 -5
  275. package/dist/types/widgets-v2/histogram/options.d.ts +3 -3
  276. package/dist/types/widgets-v2/histogram/types.d.ts +1 -1
  277. package/dist/types/widgets-v2/index.d.ts +45 -45
  278. package/dist/types/widgets-v2/markdown/download.d.ts +2 -2
  279. package/dist/types/widgets-v2/markdown/index.d.ts +6 -6
  280. package/dist/types/widgets-v2/note/widget-note.d.ts +1 -1
  281. package/dist/types/widgets-v2/pie/download.d.ts +2 -2
  282. package/dist/types/widgets-v2/pie/index.d.ts +4 -4
  283. package/dist/types/widgets-v2/pie/options.d.ts +2 -2
  284. package/dist/types/widgets-v2/pie/types.d.ts +1 -1
  285. package/dist/types/widgets-v2/range/index.d.ts +4 -4
  286. package/dist/types/widgets-v2/range/range-ui.d.ts +1 -1
  287. package/dist/types/widgets-v2/range/range.d.ts +1 -1
  288. package/dist/types/widgets-v2/scatterplot/download.d.ts +2 -2
  289. package/dist/types/widgets-v2/scatterplot/index.d.ts +5 -5
  290. package/dist/types/widgets-v2/scatterplot/options.d.ts +2 -2
  291. package/dist/types/widgets-v2/scatterplot/types.d.ts +1 -1
  292. package/dist/types/widgets-v2/selection-summary/selection-summary.d.ts +1 -1
  293. package/dist/types/widgets-v2/spread/download.d.ts +2 -2
  294. package/dist/types/widgets-v2/spread/index.d.ts +7 -7
  295. package/dist/types/widgets-v2/spread/spread-ui.d.ts +1 -1
  296. package/dist/types/widgets-v2/spread/types.d.ts +1 -1
  297. package/dist/types/widgets-v2/state/widget-state.d.ts +1 -1
  298. package/dist/types/widgets-v2/stores/index.d.ts +8 -8
  299. package/dist/types/widgets-v2/stores/pipeline-middleware.d.ts +1 -1
  300. package/dist/types/widgets-v2/stores/transforms.d.ts +1 -1
  301. package/dist/types/widgets-v2/stores/use-transform.d.ts +1 -1
  302. package/dist/types/widgets-v2/stores/widget-store-registry.d.ts +1 -1
  303. package/dist/types/widgets-v2/table/download.d.ts +2 -2
  304. package/dist/types/widgets-v2/table/helpers.d.ts +1 -1
  305. package/dist/types/widgets-v2/table/index.d.ts +8 -8
  306. package/dist/types/widgets-v2/table/table-ui.d.ts +2 -2
  307. package/dist/types/widgets-v2/table/table.d.ts +2 -2
  308. package/dist/types/widgets-v2/table/types.d.ts +1 -1
  309. package/dist/types/widgets-v2/timeseries/download.d.ts +2 -2
  310. package/dist/types/widgets-v2/timeseries/index.d.ts +5 -5
  311. package/dist/types/widgets-v2/timeseries/options.d.ts +4 -4
  312. package/dist/types/widgets-v2/timeseries/types.d.ts +1 -1
  313. package/dist/types/widgets-v2/toolbox/toolbox.d.ts +1 -1
  314. package/dist/types/widgets-v2/utils/index.d.ts +3 -3
  315. package/dist/types/widgets-v2/wrapper/index.d.ts +4 -4
  316. package/dist/types/widgets-v2/wrapper/widget-wrapper.d.ts +1 -1
  317. package/dist/{utils-DtvTjjMq.js → utils-ClB6nn4w.js} +2 -2
  318. package/dist/{utils-DtvTjjMq.js.map → utils-ClB6nn4w.js.map} +1 -1
  319. package/dist/widgets/actions.js +1 -1
  320. package/dist/widgets/bar.js +1 -1
  321. package/dist/widgets/category.js +1 -1
  322. package/dist/widgets/formula.js +1 -1
  323. package/dist/widgets/histogram.js +2 -2
  324. package/dist/widgets/markdown.js +1 -1
  325. package/dist/widgets/pie.js +1 -1
  326. package/dist/widgets/scatterplot.js +1 -1
  327. package/dist/widgets/spread.js +2 -2
  328. package/dist/widgets/table.js +1 -1
  329. package/dist/widgets/timeseries.js +1 -1
  330. package/dist/widgets/utils.js +1 -1
  331. package/dist/widgets/wrapper.js +1 -1
  332. package/dist/widgets-v2/actions.js +3 -3
  333. package/dist/widgets-v2/bar.js +4 -4
  334. package/dist/widgets-v2/category.js +1 -1
  335. package/dist/widgets-v2/formula.js +1 -1
  336. package/dist/widgets-v2/histogram.js +4 -4
  337. package/dist/widgets-v2/markdown.js +1 -1
  338. package/dist/widgets-v2/pie.js +3 -3
  339. package/dist/widgets-v2/scatterplot.js +4 -4
  340. package/dist/widgets-v2/spread.js +1 -1
  341. package/dist/widgets-v2/table.js +1 -1
  342. package/dist/widgets-v2/timeseries.js +4 -4
  343. package/dist/widgets-v2/utils.js +1 -1
  344. package/dist/widgets-v2.js +9 -9
  345. package/dist/{zoom-toggle-CA0ifG23.js → zoom-toggle-KA63b6-J.js} +2 -2
  346. package/dist/{zoom-toggle-CA0ifG23.js.map → zoom-toggle-KA63b6-J.js.map} +1 -1
  347. package/package.json +5 -4
  348. package/src/chat/bubbles/styles.ts +27 -8
  349. package/src/chat/feedback/chat-actions-container.tsx +5 -2
  350. package/src/chat/feedback/styles.ts +8 -5
  351. package/src/components/basemaps/basemaps.tsx +4 -4
  352. package/src/components/responsive-drawer/responsive-drawer.test.tsx +37 -23
  353. package/src/components/responsive-drawer/responsive-drawer.tsx +15 -8
  354. package/src/legend/components/legend-row/legend-row.test.tsx +19 -0
  355. package/src/legend/components/legend-row/legend-row.tsx +15 -2
  356. package/src/widgets/utils/chart-config/option-builders.ts +5 -1
  357. package/dist/chart-config-BGt7wkK7.js.map +0 -1
  358. package/dist/components-DDt4mOQn.js.map +0 -1
  359. package/dist/types/legend/stores/legend-store.test.d.ts +0 -1
  360. package/dist/types/widgets/actions/brush-toggle/hit-test.test.d.ts +0 -1
  361. package/dist/types/widgets/actions/relative-data/utils.test.d.ts +0 -1
  362. package/dist/types/widgets/echart/utils.test.d.ts +0 -1
  363. package/dist/types/widgets/formula/config.test.d.ts +0 -1
  364. package/dist/types/widgets/loader/utils.test.d.ts +0 -1
  365. package/dist/types/widgets/range/serializer.test.d.ts +0 -1
  366. package/dist/types/widgets/stores/widget-store-branches.test.d.ts +0 -1
  367. package/dist/types/widgets/stores/widget-store-performance.test.d.ts +0 -1
  368. package/dist/types/widgets/stores/widget-store.test.d.ts +0 -1
  369. package/dist/types/widgets/table/config.test.d.ts +0 -1
  370. package/dist/types/widgets/table/helpers.test.d.ts +0 -1
  371. package/dist/types/widgets/table/hooks/use-pagination.test.d.ts +0 -1
  372. package/dist/types/widgets/table/hooks/use-selection.test.d.ts +0 -1
  373. package/dist/types/widgets/table/hooks/use-sort.test.d.ts +0 -1
  374. package/dist/types/widgets/utils/chart-config/option-builders.test.d.ts +0 -1
  375. package/dist/types/widgets-v2/actions/brush-toggle/transforms.test.d.ts +0 -1
  376. package/dist/types/widgets-v2/actions/relative-data/transforms.test.d.ts +0 -1
  377. package/dist/types/widgets-v2/actions/stack-toggle/transforms.test.d.ts +0 -1
  378. package/dist/types/widgets-v2/actions/zoom-toggle/transforms.test.d.ts +0 -1
  379. package/dist/types/widgets-v2/bar/options.test.d.ts +0 -1
  380. package/dist/types/widgets-v2/category/download.test.d.ts +0 -1
  381. package/dist/types/widgets-v2/echart/edge-label-clamp.test.d.ts +0 -1
  382. package/dist/types/widgets-v2/echart/shared-resize-observer.test.d.ts +0 -1
  383. package/dist/types/widgets-v2/histogram/download.test.d.ts +0 -1
  384. package/dist/types/widgets-v2/histogram/options.test.d.ts +0 -1
  385. package/dist/types/widgets-v2/histogram/transforms.test.d.ts +0 -1
  386. package/dist/types/widgets-v2/markdown/download.test.d.ts +0 -1
  387. package/dist/types/widgets-v2/pie/download.test.d.ts +0 -1
  388. package/dist/types/widgets-v2/pie/options.test.d.ts +0 -1
  389. package/dist/types/widgets-v2/scatterplot/download.test.d.ts +0 -1
  390. package/dist/types/widgets-v2/scatterplot/options.test.d.ts +0 -1
  391. package/dist/types/widgets-v2/scatterplot/transforms.test.d.ts +0 -1
  392. package/dist/types/widgets-v2/spread/band.test.d.ts +0 -1
  393. package/dist/types/widgets-v2/spread/download.test.d.ts +0 -1
  394. package/dist/types/widgets-v2/state/labels.test.d.ts +0 -1
  395. package/dist/types/widgets-v2/stores/pipeline-middleware.test.d.ts +0 -1
  396. package/dist/types/widgets-v2/stores/transforms.test.d.ts +0 -1
  397. package/dist/types/widgets-v2/stores/widget-store-registry.test.d.ts +0 -1
  398. package/dist/types/widgets-v2/table/download.test.d.ts +0 -1
  399. package/dist/types/widgets-v2/table/helpers.test.d.ts +0 -1
  400. package/dist/types/widgets-v2/table/transforms.test.d.ts +0 -1
  401. package/dist/types/widgets-v2/test-utils.d.ts +0 -52
  402. package/dist/types/widgets-v2/timeseries/download.test.d.ts +0 -1
  403. package/dist/types/widgets-v2/timeseries/options.test.d.ts +0 -1
  404. package/dist/types/widgets-v2/timeseries/transforms.test.d.ts +0 -1
  405. package/dist/types/widgets-v2/utils/merge-options.test.d.ts +0 -1
  406. package/dist/types/widgets-v2/utils/resolve-theme-color.test.d.ts +0 -1
@@ -1,2 +1,2 @@
1
- import { a as e, c as t, d as n, f as r, i, l as a, m as o, n as s, o as c, p as l, r as u, s as d, t as f, u as p } from "../table-BfTG6rrs.js";
1
+ import { a as e, c as t, d as n, f as r, i, l as a, m as o, n as s, o as c, p as l, r as u, s as d, t as f, u as p } from "../table-CNQijNNB.js";
2
2
  export { o as DEFAULT_TABLE_LABELS, r as DEFAULT_TABLE_PAGE_SIZE, l as DEFAULT_TABLE_PAGE_SIZE_OPTIONS, i as Table, u as TableSkeleton, n as TableUI, e as compareValues, s as createTableDownloadConfig, c as deriveVisibleRows, f as filterTableByLockedRows, d as paginateRows, t as resolveColumns, a as sortRows, p as tableDataToCsv };
@@ -1,7 +1,7 @@
1
- import { r as e } from "../zoom-toggle-CA0ifG23.js";
2
- import { n as t, t as n } from "../download-BT6qBamM.js";
3
- import { n as r, r as i, t as a } from "../utils-DtvTjjMq.js";
4
- import { a as o, d as s, f as c, i as l, s as u, u as d } from "../chart-config-BGt7wkK7.js";
1
+ import { r as e } from "../zoom-toggle-KA63b6-J.js";
2
+ import { n as t, t as n } from "../download-C7he8mSh.js";
3
+ import { n as r, r as i, t as a } from "../utils-ClB6nn4w.js";
4
+ import { a as o, d as s, f as c, i as l, s as u, u as d } from "../chart-config-BWxjodlt.js";
5
5
  import { c as f } from "react/compiler-runtime";
6
6
  import { Box as p, Skeleton as m } from "@mui/material";
7
7
  import { jsx as h, jsxs as g } from "react/jsx-runtime";
@@ -1,2 +1,2 @@
1
- import { n as e, r as t, t as n } from "../utils-DtvTjjMq.js";
1
+ import { n as e, r as t, t as n } from "../utils-ClB6nn4w.js";
2
2
  export { t as mergeOptions, e as positionDataZoomForLegend, n as resolveThemeColor };
@@ -1,18 +1,18 @@
1
1
  import { t as e } from "./tooltip-DJUGNZxY.js";
2
- import "./components-DDt4mOQn.js";
2
+ import "./components-DKjBezcJ.js";
3
3
  import { t } from "./smart-tooltip-CwGHCqab.js";
4
4
  import { C as n, S as r, T as i, _ as a, h as o, l as s, m as c, p as l, w as u, x as d, y as f } from "./stores-BVFMfgyo.js";
5
5
  import { i as p, n as m, o as h, r as g } from "./echart-DSz2Tu0z.js";
6
6
  import { t as _ } from "./markdown-content-BzKoX3eu.js";
7
- import { C as v, S as y, c as b, f as x, g as S, o as C, r as w, t as T, y as E } from "./actions-Dy9JVr7F.js";
8
- import { t as D } from "./zoom-toggle-CA0ifG23.js";
9
- import { s as O } from "./download-BT6qBamM.js";
10
- import { i as k, r as A } from "./formula-Dsru_p-g.js";
11
- import { i as j, r as M } from "./markdown-DnSJMPjQ.js";
12
- import { a as N, i as P } from "./spread-Dy8pshpN.js";
7
+ import { C as v, S as y, c as b, f as x, g as S, o as C, r as w, t as T, y as E } from "./actions-C7ZAO0FG.js";
8
+ import { t as D } from "./zoom-toggle-KA63b6-J.js";
9
+ import { s as O } from "./download-C7he8mSh.js";
10
+ import { i as k, r as A } from "./formula-Cqj84ZGX.js";
11
+ import { i as j, r as M } from "./markdown-CV_KP-at.js";
12
+ import { a as N, i as P } from "./spread-C8T12Nfh.js";
13
13
  import { n as F, r as I } from "./range-BPWVrAsY.js";
14
- import { i as L, r as R } from "./category-DHZscHaS.js";
15
- import { d as z, i as B } from "./table-BfTG6rrs.js";
14
+ import { i as L, r as R } from "./category-DZt6yiST.js";
15
+ import { d as z, i as B } from "./table-CNQijNNB.js";
16
16
  import { c as V } from "react/compiler-runtime";
17
17
  import { Children as H, Component as U, isValidElement as W, useEffect as G, useLayoutEffect as K, useRef as q, useState as J } from "react";
18
18
  import { Accordion as ee, AccordionDetails as te, AccordionSummary as ne, Alert as re, AlertTitle as ie, Box as Y, Button as ae, Divider as oe, Grow as se, IconButton as ce, LinearProgress as le, Link as ue, Paper as de, Popper as fe, Typography as X } from "@mui/material";
@@ -1,5 +1,5 @@
1
1
  import { t as e } from "./tooltip-DJUGNZxY.js";
2
- import "./components-DDt4mOQn.js";
2
+ import "./components-DKjBezcJ.js";
3
3
  import { T as t, f as n, n as r } from "./stores-BVFMfgyo.js";
4
4
  import { c as i } from "react/compiler-runtime";
5
5
  import "react";
@@ -161,4 +161,4 @@ function y(l) {
161
161
  //#endregion
162
162
  export { f as a, p as i, g as n, h as r, y as t };
163
163
 
164
- //# sourceMappingURL=zoom-toggle-CA0ifG23.js.map
164
+ //# sourceMappingURL=zoom-toggle-KA63b6-J.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"zoom-toggle-CA0ifG23.js","names":["Theme","SLIDER_HANDLE_ICON","SLIDER_HEIGHT","SLIDER_BOTTOM","ZoomAxis","CreateAddZoomOptions","axes","createAddZoom","theme","options","option","includeX","includes","includeY","sliderStyles","getZoomSliderStyles","baseSliderProps","throttle","showDetail","brushSelect","moveHandleSize","handleSize","cfg","Record","dataZoom","push","type","xAxisIndex","yAxisIndex","height","bottom","handleIcon","width","right","addZoom","secondary","palette","main","fillerColor","borderColor","borderWidth","backgroundColor","borderRadius","dataBackground","lineStyle","opacity","areaStyle","color","selectedDataBackground","handleStyle","common","white","shadowBlur","shadowColor","shadowOffsetX","shadowOffsetY","textStyle","black","text","primary","fontSize","parseInt","typography","overlineDelicate","fontFamily","caption","ZOOM_LAYOUT","sliderHeight","sliderGap","sliderBottomWithLegend","const","ZoomToggleLabels","on","off","DEFAULT_ZOOM_TOGGLE_LABELS","SxProps","Theme","styles","toggle","p","fontSize","toggleActive","background","theme","palette","primary","relatedLight","Record","useCallback","useMemo","ComponentType","IconButton","useTheme","SvgIconProps","ZoomIn","ZoomInIcon","Tooltip","getEchartInstance","useSingleTransform","useWidgetId","createAddZoom","ZoomAxis","DEFAULT_ZOOM_TOGGLE_LABELS","ZoomToggleLabels","styles","ZOOM_DESCRIPTOR","id","type","const","order","ZoomToggleProps","initialEnabled","labels","Partial","icon","iconProps","axes","ZoomToggle","t0","$","_c","t1","t2","undefined","Icon","theme","t3","_labels","t4","includes","includeX","t5","includeY","t6","resolved","push","transform","t7","enabled","toggle","t8","setOption","replaceMerge","handleToggle","tooltip","on","off","t9","t10","toggleActive","t11","t12","t13","t14"],"sources":["../src/widgets-v2/actions/zoom-toggle/transforms.ts","../src/widgets-v2/actions/zoom-toggle/labels.ts","../src/widgets-v2/actions/zoom-toggle/style.ts","../src/widgets-v2/actions/zoom-toggle/zoom-toggle.tsx"],"sourcesContent":["import type { Theme } from '@mui/material'\n\n/**\n * v1's slider handle — 9×36 SVG with a white pill body, secondary-colored\n * stroke, and three grip lines. Inlined as a data URL so the chart can\n * render it without a network fetch.\n */\nconst SLIDER_HANDLE_ICON =\n 'image://data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iOSIgaGVpZ2h0PSIzNiIgdmlld0JveD0iMCAwIDkgMzYiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+CjxyZWN0IHg9IjAuNSIgeT0iLTAuNSIgd2lkdGg9IjgiIGhlaWdodD0iMTgiIHJ4PSI0IiB0cmFuc2Zvcm09Im1hdHJpeCgxIDAgMCAtMSAwIDI3KSIgZmlsbD0id2hpdGUiIHN0cm9rZT0iIzM1OEJFNyIvPgo8cmVjdCB3aWR0aD0iMyIgaGVpZ2h0PSIyIiByeD0iMSIgdHJhbnNmb3JtPSJtYXRyaXgoMSAwIDAgLTEgMyAyMykiIGZpbGw9IiMzNThCRTciLz4KPHJlY3Qgd2lkdGg9IjMiIGhlaWdodD0iMiIgcng9IjEiIHRyYW5zZm9ybT0ibWF0cml4KDEgMCAwIC0xIDMgMTkpIiBmaWxsPSIjMzU4QkU3Ii8+CjxyZWN0IHdpZHRoPSIzIiBoZWlnaHQ9IjIiIHJ4PSIxIiB0cmFuc2Zvcm09Im1hdHJpeCgxIDAgMCAtMSAzIDE1KSIgZmlsbD0iIzM1OEJFNyIvPgo8L3N2Zz4='\n\nconst SLIDER_HEIGHT = 32\nconst SLIDER_BOTTOM = 0\n\n/** Which chart axis (or axes) zoom applies to. */\nexport type ZoomAxis = 'x' | 'y'\n\nexport interface CreateAddZoomOptions {\n /**\n * Axes to enable zoom on. Default `['x']` (matches bar / histogram /\n * timeseries — horizontal pan/zoom on the category axis). Pass\n * `['x', 'y']` for a scatterplot-style 2D zoom (mouse-wheel scales both\n * axes; a horizontal slider sits at the bottom for x-range and a\n * vertical slider sits on the right for y-range).\n */\n axes?: readonly ZoomAxis[]\n}\n\n/**\n * Theme-bound zoom config transform: adds one inside `dataZoom`\n * (mouse-wheel + drag) per axis plus a styled slider per axis with the\n * v1 chrome (blue-tinted filler, secondary-color data preview, white\n * pill handles, CARTO typography). The x-slider is horizontal at the\n * bottom; the y-slider is vertical on the right.\n *\n * Returned function has stable identity for a given theme + axes\n * combination; pair with `useMemo` at the call site.\n *\n * **No `start` / `end`** are emitted: ECharts defaults to `0–100` on the\n * first `setOption` and then keeps the runtime slider state across\n * subsequent merges (no `replaceMerge` for `dataZoom`). Re-running the\n * transform on data/formatter/RelativeData updates therefore preserves the\n * user's dragged range instead of snapping it back.\n */\nexport function createAddZoom(\n theme: Theme,\n options: CreateAddZoomOptions = {},\n): (option: unknown) => unknown {\n const axes = options.axes ?? ['x']\n const includeX = axes.includes('x')\n const includeY = axes.includes('y')\n const sliderStyles = getZoomSliderStyles(theme)\n const baseSliderProps = {\n throttle: 0,\n showDetail: false,\n brushSelect: false,\n moveHandleSize: 8,\n handleSize: '100%',\n ...sliderStyles,\n }\n return (option: unknown): unknown => {\n if (option == null || typeof option !== 'object') return option\n const cfg = option as Record<string, unknown>\n const dataZoom: object[] = []\n if (includeX) {\n dataZoom.push({ type: 'inside', xAxisIndex: [0], throttle: 0 })\n }\n if (includeY) {\n dataZoom.push({ type: 'inside', yAxisIndex: [0], throttle: 0 })\n }\n if (includeX) {\n dataZoom.push({\n type: 'slider',\n xAxisIndex: [0],\n height: SLIDER_HEIGHT,\n bottom: SLIDER_BOTTOM,\n handleIcon: SLIDER_HANDLE_ICON,\n ...baseSliderProps,\n })\n }\n if (includeY) {\n // Vertical slider — `width` is its thickness, `right` pins it to\n // the right edge. We omit `handleIcon` so ECharts renders its\n // default vertical handle (the inline SVG is shaped for a\n // horizontal slider and looks wrong when rotated).\n dataZoom.push({\n type: 'slider',\n yAxisIndex: [0],\n width: SLIDER_HEIGHT,\n right: SLIDER_BOTTOM,\n ...baseSliderProps,\n })\n }\n return { ...cfg, dataZoom }\n }\n}\n\n/**\n * Back-compat untyped transform — produces the bare `dataZoom` config from\n * the original v2 implementation. Use {@link createAddZoom} when a theme is\n * available so the slider matches the v1 styling.\n *\n * `start` / `end` are intentionally omitted so ECharts preserves the user's\n * runtime range across subsequent `setOption` merges (see {@link createAddZoom}).\n */\nexport const addZoom = (option: unknown): unknown => {\n if (option == null || typeof option !== 'object') return option\n const cfg = option as Record<string, unknown>\n return {\n ...cfg,\n dataZoom: [\n { type: 'inside' },\n {\n type: 'slider',\n height: SLIDER_HEIGHT,\n bottom: SLIDER_BOTTOM,\n },\n ],\n }\n}\n\n/** Style block matching v1's `getEChartZoomSliderStyles`. */\nfunction getZoomSliderStyles(theme: Theme) {\n const secondary = theme.palette.secondary?.main ?? '#358BE7'\n return {\n fillerColor: 'rgba(53, 139, 231, 0.25)',\n borderColor: 'rgba(53, 139, 231, 0.3)',\n borderWidth: 0.5,\n backgroundColor: 'transparent',\n borderRadius: 4,\n dataBackground: {\n lineStyle: { opacity: 0 },\n areaStyle: { opacity: 1, color: secondary },\n },\n selectedDataBackground: {\n lineStyle: { opacity: 0 },\n areaStyle: { opacity: 1, color: secondary },\n },\n handleStyle: {\n color: theme.palette.common?.white ?? '#fff',\n borderColor: 'rgba(3, 111, 226, 0.08)',\n borderWidth: 1,\n shadowBlur: 3,\n shadowColor: 'rgba(0, 0, 0, 0.1)',\n shadowOffsetX: 0,\n shadowOffsetY: 1,\n },\n textStyle: {\n color: theme.palette.black?.[60] ?? theme.palette.text?.primary,\n fontSize: parseInt(\n (theme.typography.overlineDelicate?.fontSize as string | undefined) ??\n '11',\n ),\n fontFamily:\n theme.typography.overlineDelicate?.fontFamily ??\n theme.typography.caption?.fontFamily,\n },\n }\n}\n\n/**\n * Visual layout constants used by the data-fusion mergers (bar, histogram,\n * timeseries) when laying out the slider against the legend / grid.\n */\nexport const ZOOM_LAYOUT = {\n /** Slider height in px (matches `createAddZoom` output). */\n sliderHeight: SLIDER_HEIGHT,\n /** Vertical gap between chart grid and the slider. */\n sliderGap: 8,\n /** Slider `bottom` when a legend is shown — sits above the legend row. */\n sliderBottomWithLegend: 28,\n} as const\n","export interface ZoomToggleLabels {\n on: string\n off: string\n}\n\nexport const DEFAULT_ZOOM_TOGGLE_LABELS: ZoomToggleLabels = {\n on: 'Disable zoom',\n off: 'Enable zoom',\n}\n","import type { SxProps, Theme } from '@mui/material'\n\nexport const styles = {\n toggle: {\n p: 0.5,\n '& .MuiSvgIcon-root': { fontSize: 20 },\n },\n toggleActive: {\n background: (theme: Theme) => theme.palette.primary.relatedLight,\n },\n} satisfies Record<string, SxProps<Theme>>\n","import { useCallback, useMemo, type ComponentType } from 'react'\nimport { IconButton, useTheme, type SvgIconProps } from '@mui/material'\nimport { ZoomIn as ZoomInIcon } from '@mui/icons-material'\nimport { Tooltip } from '../../../components'\nimport {\n getEchartInstance,\n useSingleTransform,\n useWidgetId,\n} from '../../stores'\nimport { createAddZoom, type ZoomAxis } from './transforms'\nimport { DEFAULT_ZOOM_TOGGLE_LABELS, type ZoomToggleLabels } from './labels'\nimport { styles } from './style'\n\nconst ZOOM_DESCRIPTOR = {\n id: 'zoom-toggle',\n type: 'config' as const,\n order: 20,\n}\n\nexport interface ZoomToggleProps {\n initialEnabled?: boolean\n labels?: Partial<ZoomToggleLabels>\n icon?: ComponentType<SvgIconProps>\n iconProps?: SvgIconProps\n /**\n * Which axes the zoom controls. Default `['x']` — matches bar /\n * histogram / timeseries (horizontal pan on the category axis). Pass\n * `['x', 'y']` for 2D zoom on a scatterplot-style chart (mouse-wheel\n * scales both axes; horizontal slider at bottom + vertical slider on\n * the right).\n */\n axes?: readonly ZoomAxis[]\n}\n\n/**\n * Toggle a `dataZoom` slider + wheel-zoom on the chart. The transform is\n * theme-bound so the slider gets v1's CARTO chrome (blue-tinted filler,\n * secondary-color preview, white pill handles).\n *\n * `dataZoom` is intentionally NOT in `replaceMergeKeys` — ECharts merges\n * subsequent `setOption` calls so the user's dragged range survives\n * unrelated re-renders (data updates, formatter swaps, RelativeData toggles).\n *\n * On disable the transform is unregistered, but ECharts' merge semantics\n * would otherwise *keep* the live `dataZoom` component visible. To remove\n * the slider immediately we issue a one-shot\n * `setOption({}, { replaceMerge: ['dataZoom'] })` against the live chart\n * instance via {@link getEchartInstance} — this bypasses the pipeline so\n * unrelated transforms aren't disturbed.\n */\nexport function ZoomToggle({\n initialEnabled = false,\n labels,\n icon: Icon = ZoomInIcon,\n iconProps,\n axes,\n}: ZoomToggleProps) {\n const id = useWidgetId()\n const theme = useTheme()\n const _labels = { ...DEFAULT_ZOOM_TOGGLE_LABELS, ...labels }\n // Reduce `axes` to two structural booleans before memoizing so the memo\n // depends on stable primitive values, not an array reference (callers\n // typically pass an inline `axes={['x', 'y']}` literal that changes\n // identity each render). Default — no `axes` prop — is x-axis only,\n // matching `createAddZoom`'s default.\n const includeX = axes ? axes.includes('x') : true\n const includeY = axes ? axes.includes('y') : false\n const transform = useMemo(() => {\n const resolved: ZoomAxis[] = []\n if (includeX) resolved.push('x')\n if (includeY) resolved.push('y')\n return createAddZoom(theme, { axes: resolved })\n }, [theme, includeX, includeY])\n const { enabled, toggle } = useSingleTransform(\n id,\n ZOOM_DESCRIPTOR,\n transform,\n { initialEnabled },\n )\n\n const handleToggle = useCallback(() => {\n if (enabled) {\n // About to disable — clear the dataZoom component on the live\n // instance so the slider disappears immediately.\n getEchartInstance(id)?.setOption({}, { replaceMerge: ['dataZoom'] })\n }\n toggle()\n }, [enabled, toggle, id])\n\n const tooltip = enabled ? _labels.on : _labels.off\n\n return (\n <Tooltip title={tooltip}>\n <IconButton\n size='small'\n aria-label={tooltip}\n aria-pressed={enabled}\n onClick={handleToggle}\n className={enabled ? 'active' : undefined}\n sx={{ ...styles.toggle, ...(enabled && styles.toggleActive) }}\n >\n <Icon fontSize='small' {...iconProps} />\n </IconButton>\n </Tooltip>\n )\n}\n"],"mappings":";;;;;;;;;AAOA,IAAMC,IACJ,8pBAEIC,IAAgB,IAChBC,IAAgB;AAgCtB,SAAgBI,EACdC,GACAC,IAAgC,CAAC,GACH;CAC9B,IAAMH,IAAOG,EAAQH,QAAQ,CAAC,GAAG,GAC3BK,IAAWL,EAAKM,SAAS,GAAG,GAC5BC,IAAWP,EAAKM,SAAS,GAAG,GAE5BI,IAAkB;EACtBC,UAAU;EACVC,YAAY;EACZC,aAAa;EACbC,gBAAgB;EAChBC,YAAY;EACZ,GAPmBN,EAAoBP,CAOpCM;CACL;CACA,QAAQJ,MAA6B;EACnC,IAAsB,OAAOA,KAAW,aAApCA,GAA8C,OAAOA;EACzD,IAAMY,IAAMZ,GACNc,IAAqB,CAAA;EA8B3B,OA7BIb,KACFa,EAASC,KAAK;GAAEC,MAAM;GAAUC,YAAY,CAAC,CAAC;GAAGV,UAAU;EAAE,CAAC,GAE5DJ,KACFW,EAASC,KAAK;GAAEC,MAAM;GAAUE,YAAY,CAAC,CAAC;GAAGX,UAAU;EAAE,CAAC,GAE5DN,KACFa,EAASC,KAAK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AAAmB,KAAAnB,EAAA,QAAAwB,KAAAxB,EAAA,QAAA+B,KAAA/B,EAAA,QAAAgC,KAAAhC,EAAA,QAAA4B,KAAA5B,EAAA,QAAAyB,KAR1CQ,IAAA,kBAAC,GAAD;EACO,MAAA;EACOR,cAAAA;EACEN,gBAAAA;EACLK,SAAAA;EACE,WAAAI;EACP,IAAAG;EAEJC,UAAAA;CARS,CAAA,GASEhC,EAAA,MAAAmB,GAAAnB,EAAA,MAAAwB,GAAAxB,EAAA,MAAA+B,GAAA/B,EAAA,MAAAgC,GAAAhC,EAAA,MAAA4B,GAAA5B,EAAA,MAAAyB,GAAAzB,EAAA,MAAAiC,KAAAA,IAAAjC,EAAA;CAAA,IAAAkC;CACL,OADKlC,EAAA,QAAAiC,KAAAjC,EAAA,QAAAyB,KAVfS,IAAA,kBAAC,GAAD;EAAgBT,OAAAA;EACdQ,UAAAA;CADM,CAAA,GAWEjC,EAAA,MAAAiC,GAAAjC,EAAA,MAAAyB,GAAAzB,EAAA,MAAAkC,KAAAA,IAAAlC,EAAA,KAXVkC;AAWU"}
1
+ {"version":3,"file":"zoom-toggle-KA63b6-J.js","names":["Theme","SLIDER_HANDLE_ICON","SLIDER_HEIGHT","SLIDER_BOTTOM","ZoomAxis","CreateAddZoomOptions","axes","createAddZoom","theme","options","option","includeX","includes","includeY","sliderStyles","getZoomSliderStyles","baseSliderProps","throttle","showDetail","brushSelect","moveHandleSize","handleSize","cfg","Record","dataZoom","push","type","xAxisIndex","yAxisIndex","height","bottom","handleIcon","width","right","addZoom","secondary","palette","main","fillerColor","borderColor","borderWidth","backgroundColor","borderRadius","dataBackground","lineStyle","opacity","areaStyle","color","selectedDataBackground","handleStyle","common","white","shadowBlur","shadowColor","shadowOffsetX","shadowOffsetY","textStyle","black","text","primary","fontSize","parseInt","typography","overlineDelicate","fontFamily","caption","ZOOM_LAYOUT","sliderHeight","sliderGap","sliderBottomWithLegend","const","ZoomToggleLabels","on","off","DEFAULT_ZOOM_TOGGLE_LABELS","SxProps","Theme","styles","toggle","p","fontSize","toggleActive","background","theme","palette","primary","relatedLight","Record","useCallback","useMemo","ComponentType","IconButton","useTheme","SvgIconProps","ZoomIn","ZoomInIcon","Tooltip","getEchartInstance","useSingleTransform","useWidgetId","createAddZoom","ZoomAxis","DEFAULT_ZOOM_TOGGLE_LABELS","ZoomToggleLabels","styles","ZOOM_DESCRIPTOR","id","type","const","order","ZoomToggleProps","initialEnabled","labels","Partial","icon","iconProps","axes","ZoomToggle","t0","$","_c","t1","t2","undefined","Icon","theme","t3","_labels","t4","includes","includeX","t5","includeY","t6","resolved","push","transform","t7","enabled","toggle","t8","setOption","replaceMerge","handleToggle","tooltip","on","off","t9","t10","toggleActive","t11","t12","t13","t14"],"sources":["../src/widgets-v2/actions/zoom-toggle/transforms.ts","../src/widgets-v2/actions/zoom-toggle/labels.ts","../src/widgets-v2/actions/zoom-toggle/style.ts","../src/widgets-v2/actions/zoom-toggle/zoom-toggle.tsx"],"sourcesContent":["import type { Theme } from '@mui/material'\n\n/**\n * v1's slider handle — 9×36 SVG with a white pill body, secondary-colored\n * stroke, and three grip lines. Inlined as a data URL so the chart can\n * render it without a network fetch.\n */\nconst SLIDER_HANDLE_ICON =\n 'image://data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iOSIgaGVpZ2h0PSIzNiIgdmlld0JveD0iMCAwIDkgMzYiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+CjxyZWN0IHg9IjAuNSIgeT0iLTAuNSIgd2lkdGg9IjgiIGhlaWdodD0iMTgiIHJ4PSI0IiB0cmFuc2Zvcm09Im1hdHJpeCgxIDAgMCAtMSAwIDI3KSIgZmlsbD0id2hpdGUiIHN0cm9rZT0iIzM1OEJFNyIvPgo8cmVjdCB3aWR0aD0iMyIgaGVpZ2h0PSIyIiByeD0iMSIgdHJhbnNmb3JtPSJtYXRyaXgoMSAwIDAgLTEgMyAyMykiIGZpbGw9IiMzNThCRTciLz4KPHJlY3Qgd2lkdGg9IjMiIGhlaWdodD0iMiIgcng9IjEiIHRyYW5zZm9ybT0ibWF0cml4KDEgMCAwIC0xIDMgMTkpIiBmaWxsPSIjMzU4QkU3Ii8+CjxyZWN0IHdpZHRoPSIzIiBoZWlnaHQ9IjIiIHJ4PSIxIiB0cmFuc2Zvcm09Im1hdHJpeCgxIDAgMCAtMSAzIDE1KSIgZmlsbD0iIzM1OEJFNyIvPgo8L3N2Zz4='\n\nconst SLIDER_HEIGHT = 32\nconst SLIDER_BOTTOM = 0\n\n/** Which chart axis (or axes) zoom applies to. */\nexport type ZoomAxis = 'x' | 'y'\n\nexport interface CreateAddZoomOptions {\n /**\n * Axes to enable zoom on. Default `['x']` (matches bar / histogram /\n * timeseries — horizontal pan/zoom on the category axis). Pass\n * `['x', 'y']` for a scatterplot-style 2D zoom (mouse-wheel scales both\n * axes; a horizontal slider sits at the bottom for x-range and a\n * vertical slider sits on the right for y-range).\n */\n axes?: readonly ZoomAxis[]\n}\n\n/**\n * Theme-bound zoom config transform: adds one inside `dataZoom`\n * (mouse-wheel + drag) per axis plus a styled slider per axis with the\n * v1 chrome (blue-tinted filler, secondary-color data preview, white\n * pill handles, CARTO typography). The x-slider is horizontal at the\n * bottom; the y-slider is vertical on the right.\n *\n * Returned function has stable identity for a given theme + axes\n * combination; pair with `useMemo` at the call site.\n *\n * **No `start` / `end`** are emitted: ECharts defaults to `0–100` on the\n * first `setOption` and then keeps the runtime slider state across\n * subsequent merges (no `replaceMerge` for `dataZoom`). Re-running the\n * transform on data/formatter/RelativeData updates therefore preserves the\n * user's dragged range instead of snapping it back.\n */\nexport function createAddZoom(\n theme: Theme,\n options: CreateAddZoomOptions = {},\n): (option: unknown) => unknown {\n const axes = options.axes ?? ['x']\n const includeX = axes.includes('x')\n const includeY = axes.includes('y')\n const sliderStyles = getZoomSliderStyles(theme)\n const baseSliderProps = {\n throttle: 0,\n showDetail: false,\n brushSelect: false,\n moveHandleSize: 8,\n handleSize: '100%',\n ...sliderStyles,\n }\n return (option: unknown): unknown => {\n if (option == null || typeof option !== 'object') return option\n const cfg = option as Record<string, unknown>\n const dataZoom: object[] = []\n if (includeX) {\n dataZoom.push({ type: 'inside', xAxisIndex: [0], throttle: 0 })\n }\n if (includeY) {\n dataZoom.push({ type: 'inside', yAxisIndex: [0], throttle: 0 })\n }\n if (includeX) {\n dataZoom.push({\n type: 'slider',\n xAxisIndex: [0],\n height: SLIDER_HEIGHT,\n bottom: SLIDER_BOTTOM,\n handleIcon: SLIDER_HANDLE_ICON,\n ...baseSliderProps,\n })\n }\n if (includeY) {\n // Vertical slider — `width` is its thickness, `right` pins it to\n // the right edge. We omit `handleIcon` so ECharts renders its\n // default vertical handle (the inline SVG is shaped for a\n // horizontal slider and looks wrong when rotated).\n dataZoom.push({\n type: 'slider',\n yAxisIndex: [0],\n width: SLIDER_HEIGHT,\n right: SLIDER_BOTTOM,\n ...baseSliderProps,\n })\n }\n return { ...cfg, dataZoom }\n }\n}\n\n/**\n * Back-compat untyped transform — produces the bare `dataZoom` config from\n * the original v2 implementation. Use {@link createAddZoom} when a theme is\n * available so the slider matches the v1 styling.\n *\n * `start` / `end` are intentionally omitted so ECharts preserves the user's\n * runtime range across subsequent `setOption` merges (see {@link createAddZoom}).\n */\nexport const addZoom = (option: unknown): unknown => {\n if (option == null || typeof option !== 'object') return option\n const cfg = option as Record<string, unknown>\n return {\n ...cfg,\n dataZoom: [\n { type: 'inside' },\n {\n type: 'slider',\n height: SLIDER_HEIGHT,\n bottom: SLIDER_BOTTOM,\n },\n ],\n }\n}\n\n/** Style block matching v1's `getEChartZoomSliderStyles`. */\nfunction getZoomSliderStyles(theme: Theme) {\n const secondary = theme.palette.secondary?.main ?? '#358BE7'\n return {\n fillerColor: 'rgba(53, 139, 231, 0.25)',\n borderColor: 'rgba(53, 139, 231, 0.3)',\n borderWidth: 0.5,\n backgroundColor: 'transparent',\n borderRadius: 4,\n dataBackground: {\n lineStyle: { opacity: 0 },\n areaStyle: { opacity: 1, color: secondary },\n },\n selectedDataBackground: {\n lineStyle: { opacity: 0 },\n areaStyle: { opacity: 1, color: secondary },\n },\n handleStyle: {\n color: theme.palette.common?.white ?? '#fff',\n borderColor: 'rgba(3, 111, 226, 0.08)',\n borderWidth: 1,\n shadowBlur: 3,\n shadowColor: 'rgba(0, 0, 0, 0.1)',\n shadowOffsetX: 0,\n shadowOffsetY: 1,\n },\n textStyle: {\n color: theme.palette.black?.[60] ?? theme.palette.text?.primary,\n fontSize: parseInt(\n (theme.typography.overlineDelicate?.fontSize as string | undefined) ??\n '11',\n ),\n fontFamily:\n theme.typography.overlineDelicate?.fontFamily ??\n theme.typography.caption?.fontFamily,\n },\n }\n}\n\n/**\n * Visual layout constants used by the data-fusion mergers (bar, histogram,\n * timeseries) when laying out the slider against the legend / grid.\n */\nexport const ZOOM_LAYOUT = {\n /** Slider height in px (matches `createAddZoom` output). */\n sliderHeight: SLIDER_HEIGHT,\n /** Vertical gap between chart grid and the slider. */\n sliderGap: 8,\n /** Slider `bottom` when a legend is shown — sits above the legend row. */\n sliderBottomWithLegend: 28,\n} as const\n","export interface ZoomToggleLabels {\n on: string\n off: string\n}\n\nexport const DEFAULT_ZOOM_TOGGLE_LABELS: ZoomToggleLabels = {\n on: 'Disable zoom',\n off: 'Enable zoom',\n}\n","import type { SxProps, Theme } from '@mui/material'\n\nexport const styles = {\n toggle: {\n p: 0.5,\n '& .MuiSvgIcon-root': { fontSize: 20 },\n },\n toggleActive: {\n background: (theme: Theme) => theme.palette.primary.relatedLight,\n },\n} satisfies Record<string, SxProps<Theme>>\n","import { useCallback, useMemo, type ComponentType } from 'react'\nimport { IconButton, useTheme, type SvgIconProps } from '@mui/material'\nimport { ZoomIn as ZoomInIcon } from '@mui/icons-material'\nimport { Tooltip } from '../../../components'\nimport {\n getEchartInstance,\n useSingleTransform,\n useWidgetId,\n} from '../../stores'\nimport { createAddZoom, type ZoomAxis } from './transforms'\nimport { DEFAULT_ZOOM_TOGGLE_LABELS, type ZoomToggleLabels } from './labels'\nimport { styles } from './style'\n\nconst ZOOM_DESCRIPTOR = {\n id: 'zoom-toggle',\n type: 'config' as const,\n order: 20,\n}\n\nexport interface ZoomToggleProps {\n initialEnabled?: boolean\n labels?: Partial<ZoomToggleLabels>\n icon?: ComponentType<SvgIconProps>\n iconProps?: SvgIconProps\n /**\n * Which axes the zoom controls. Default `['x']` — matches bar /\n * histogram / timeseries (horizontal pan on the category axis). Pass\n * `['x', 'y']` for 2D zoom on a scatterplot-style chart (mouse-wheel\n * scales both axes; horizontal slider at bottom + vertical slider on\n * the right).\n */\n axes?: readonly ZoomAxis[]\n}\n\n/**\n * Toggle a `dataZoom` slider + wheel-zoom on the chart. The transform is\n * theme-bound so the slider gets v1's CARTO chrome (blue-tinted filler,\n * secondary-color preview, white pill handles).\n *\n * `dataZoom` is intentionally NOT in `replaceMergeKeys` — ECharts merges\n * subsequent `setOption` calls so the user's dragged range survives\n * unrelated re-renders (data updates, formatter swaps, RelativeData toggles).\n *\n * On disable the transform is unregistered, but ECharts' merge semantics\n * would otherwise *keep* the live `dataZoom` component visible. To remove\n * the slider immediately we issue a one-shot\n * `setOption({}, { replaceMerge: ['dataZoom'] })` against the live chart\n * instance via {@link getEchartInstance} — this bypasses the pipeline so\n * unrelated transforms aren't disturbed.\n */\nexport function ZoomToggle({\n initialEnabled = false,\n labels,\n icon: Icon = ZoomInIcon,\n iconProps,\n axes,\n}: ZoomToggleProps) {\n const id = useWidgetId()\n const theme = useTheme()\n const _labels = { ...DEFAULT_ZOOM_TOGGLE_LABELS, ...labels }\n // Reduce `axes` to two structural booleans before memoizing so the memo\n // depends on stable primitive values, not an array reference (callers\n // typically pass an inline `axes={['x', 'y']}` literal that changes\n // identity each render). Default — no `axes` prop — is x-axis only,\n // matching `createAddZoom`'s default.\n const includeX = axes ? axes.includes('x') : true\n const includeY = axes ? axes.includes('y') : false\n const transform = useMemo(() => {\n const resolved: ZoomAxis[] = []\n if (includeX) resolved.push('x')\n if (includeY) resolved.push('y')\n return createAddZoom(theme, { axes: resolved })\n }, [theme, includeX, includeY])\n const { enabled, toggle } = useSingleTransform(\n id,\n ZOOM_DESCRIPTOR,\n transform,\n { initialEnabled },\n )\n\n const handleToggle = useCallback(() => {\n if (enabled) {\n // About to disable — clear the dataZoom component on the live\n // instance so the slider disappears immediately.\n getEchartInstance(id)?.setOption({}, { replaceMerge: ['dataZoom'] })\n }\n toggle()\n }, [enabled, toggle, id])\n\n const tooltip = enabled ? _labels.on : _labels.off\n\n return (\n <Tooltip title={tooltip}>\n <IconButton\n size='small'\n aria-label={tooltip}\n aria-pressed={enabled}\n onClick={handleToggle}\n className={enabled ? 'active' : undefined}\n sx={{ ...styles.toggle, ...(enabled && styles.toggleActive) }}\n >\n <Icon fontSize='small' {...iconProps} />\n </IconButton>\n </Tooltip>\n )\n}\n"],"mappings":";;;;;;;;;AAOA,IAAMC,IACJ,8pBAEIC,IAAgB,IAChBC,IAAgB;AAgCtB,SAAgBI,EACdC,GACAC,IAAgC,CAAC,GACH;CAC9B,IAAMH,IAAOG,EAAQH,QAAQ,CAAC,GAAG,GAC3BK,IAAWL,EAAKM,SAAS,GAAG,GAC5BC,IAAWP,EAAKM,SAAS,GAAG,GAE5BI,IAAkB;EACtBC,UAAU;EACVC,YAAY;EACZC,aAAa;EACbC,gBAAgB;EAChBC,YAAY;EACZ,GAPmBN,EAAoBP,CAOpCM;CACL;CACA,QAAQJ,MAA6B;EACnC,IAAsB,OAAOA,KAAW,aAApCA,GAA8C,OAAOA;EACzD,IAAMY,IAAMZ,GACNc,IAAqB,CAAA;EA8B3B,OA7BIb,KACFa,EAASC,KAAK;GAAEC,MAAM;GAAUC,YAAY,CAAC,CAAC;GAAGV,UAAU;EAAE,CAAC,GAE5DJ,KACFW,EAASC,KAAK;GAAEC,MAAM;GAAUE,YAAY,CAAC,CAAC;GAAGX,UAAU;EAAE,CAAC,GAE5DN,KACFa,EAASC,KAAK;GACZC,MAAM;GACNC,YAAY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AAwB,KAAAxB,EAAA,QAAA+B,KAAA/B,EAAA,QAAAgC,KAAAhC,EAAA,QAAA4B,KAAA5B,EAAA,QAAAyB,KAR1CQ,IAAA,kBAAC,GAAD;EACO,MAAA;EACOR,cAAAA;EACEN,gBAAAA;EACLK,SAAAA;EACE,WAAAI;EACP,IAAAG;EAEJC,UAAAA;CARS,CAAA,GASEhC,EAAA,MAAAmB,GAAAnB,EAAA,MAAAwB,GAAAxB,EAAA,MAAA+B,GAAA/B,EAAA,MAAAgC,GAAAhC,EAAA,MAAA4B,GAAA5B,EAAA,MAAAyB,GAAAzB,EAAA,MAAAiC,KAAAA,IAAAjC,EAAA;CAAA,IAAAkC;CACL,OADKlC,EAAA,QAAAiC,KAAAjC,EAAA,QAAAyB,KAVfS,IAAA,kBAAC,GAAD;EAAgBT,OAAAA;EACdQ,UAAAA;CADM,CAAA,GAWEjC,EAAA,MAAAiC,GAAAjC,EAAA,MAAAyB,GAAAzB,EAAA,MAAAkC,KAAAA,IAAAlC,EAAA,KAXVkC;AAWU"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@carto/ps-react-ui",
3
- "version": "4.20.2",
3
+ "version": "4.21.1",
4
4
  "description": "CARTO's Professional Service React Material library",
5
5
  "type": "module",
6
6
  "devDependencies": {
@@ -17,7 +17,7 @@
17
17
  "react-dom": "19.2.8",
18
18
  "react-markdown": "10.1.0",
19
19
  "zustand": "5.0.15",
20
- "@carto/ps-utils": "2.1.0",
20
+ "@carto/ps-utils": "2.1.1",
21
21
  "@carto/ps-common-types": "1.0.0"
22
22
  },
23
23
  "peerDependencies": {
@@ -35,7 +35,7 @@
35
35
  "react-dom": "^19.2.0",
36
36
  "react-markdown": "^10.0.0",
37
37
  "zustand": "^5.0.0",
38
- "@carto/ps-utils": "2.1.0"
38
+ "@carto/ps-utils": "2.1.1"
39
39
  },
40
40
  "exports": {
41
41
  "./chat": {
@@ -244,7 +244,8 @@
244
244
  "dependencies": {
245
245
  "rehype-raw": "7.0.0",
246
246
  "rehype-sanitize": "6.0.0",
247
- "remark-gfm": "4.0.1"
247
+ "remark-gfm": "4.0.1",
248
+ "type-fest": "5.8.0"
248
249
  },
249
250
  "scripts": {
250
251
  "dev": "vite build --watch --emptyOutDir=false",
@@ -1,15 +1,34 @@
1
- import { styled, Typography, type SxProps, type Theme } from '@mui/material'
1
+ import {
2
+ styled,
3
+ Typography,
4
+ type SxProps,
5
+ type Theme,
6
+ type TypographyProps,
7
+ } from '@mui/material'
8
+ import type { CSSObject } from '@mui/material/styles'
9
+ import type { FC } from 'react'
2
10
 
3
- export const ChatMessageOverflow = styled(Typography)(() => ({
4
- whiteSpace: 'pre-wrap',
5
- overflowX: 'clip',
6
- overflowWrap: 'break-word',
7
- maxWidth: '100%',
8
- }))
11
+ // The explicit annotation is what keeps this file's .d.ts emittable: the type
12
+ // `styled()` infers can only be named through a pnpm-internal @mui/system path
13
+ // (TS2742), and vite-plugin-dts drops the whole declaration when that happens.
14
+ //
15
+ // ponytail: `component` and `ref` still typecheck, but the prop re-typing that
16
+ // comes with them does not — `component="a" href="#"` is rejected here and
17
+ // accepted on `Typography` itself. Restoring it needs `OverridableComponent`,
18
+ // which a MUI v5 `styled()` result isn't assignable to under React 19 types.
19
+ // Consumers who need the polymorphism use `Typography` directly.
20
+ export const ChatMessageOverflow: FC<TypographyProps> = styled(Typography)(
21
+ () => ({
22
+ whiteSpace: 'pre-wrap',
23
+ overflowX: 'clip',
24
+ overflowWrap: 'break-word',
25
+ maxWidth: '100%',
26
+ }),
27
+ )
9
28
  ChatMessageOverflow.displayName = 'ChatMessageOverflow'
10
29
 
11
30
  export const styles = {
12
- agentMessageContainer: (theme: Theme) => ({
31
+ agentMessageContainer: (theme: Theme): CSSObject => ({
13
32
  ...theme.typography.body2,
14
33
  width: '100%',
15
34
  display: 'flex',
@@ -1,6 +1,9 @@
1
- import { Box, styled } from '@mui/material'
1
+ import { Box, styled, type BoxProps } from '@mui/material'
2
+ import type { FC } from 'react'
2
3
 
3
- export const ChatActionsContainer = styled(Box)(({ theme }) => ({
4
+ // See chat/bubbles/styles.ts: the annotation keeps the declaration emittable,
5
+ // and what it gives up on `component=`.
6
+ export const ChatActionsContainer: FC<BoxProps> = styled(Box)(({ theme }) => ({
4
7
  display: 'flex',
5
8
  alignItems: 'center',
6
9
  gap: theme.spacing(0.5),
@@ -121,12 +121,14 @@ export const styles = {
121
121
  padding: ({ spacing }) => spacing(1),
122
122
  borderRadius: ({ spacing }) => spacing(0.5),
123
123
  backgroundColor: ({ palette }) => palette.background.default,
124
- fontFamily: ({ typography }) =>
124
+ fontFamily: ({ typography }): string =>
125
125
  typography.code3?.fontFamily ??
126
126
  typography.code1?.fontFamily ??
127
127
  'monospace',
128
- fontSize: ({ typography }) => typography.code3?.fontSize ?? '0.75rem',
129
- lineHeight: ({ typography }) => typography.code3?.lineHeight ?? 1.333,
128
+ fontSize: ({ typography }): string | number =>
129
+ typography.code3?.fontSize ?? '0.75rem',
130
+ lineHeight: ({ typography }): string | number =>
131
+ typography.code3?.lineHeight ?? 1.333,
130
132
  whiteSpace: 'pre-wrap',
131
133
  wordBreak: 'break-word',
132
134
  overflowY: 'auto',
@@ -164,11 +166,12 @@ export const styles = {
164
166
  padding: ({ spacing }) => spacing(1),
165
167
  background: ({ palette, spacing }) =>
166
168
  `linear-gradient(to right, ${palette.action.hover} calc(${spacing(1)} + 3em), ${palette.background.default} calc(${spacing(1)} + 3em))`,
167
- fontFamily: ({ typography }) =>
169
+ fontFamily: ({ typography }): string =>
168
170
  typography.code3?.fontFamily ??
169
171
  typography.code1?.fontFamily ??
170
172
  'monospace',
171
- fontSize: ({ typography }) => typography.code3?.fontSize ?? '0.75rem',
173
+ fontSize: ({ typography }): string | number =>
174
+ typography.code3?.fontSize ?? '0.75rem',
172
175
  whiteSpace: 'pre-wrap',
173
176
  wordBreak: 'break-word',
174
177
  lineHeight: 1.6,
@@ -40,7 +40,7 @@ export function BasemapsUI({
40
40
  onChange,
41
41
  TooltipProps,
42
42
  }: BasemapsUIProps): JSX.Element {
43
- const [toggleRef, setToggleRef] = useState<HTMLButtonElement | null>(null)
43
+ const [anchorEl, setAnchorEl] = useState<HTMLButtonElement | null>(null)
44
44
  const [isOpen, setIsOpen] = useState(false)
45
45
  const timeoutRef = useRef<NodeJS.Timeout | null>(null)
46
46
  const [timer, setTimer] = useState<number | null>(null)
@@ -55,7 +55,7 @@ export function BasemapsUI({
55
55
  const groupCount = Object.keys(groups).length
56
56
 
57
57
  const handleClose = () => {
58
- setToggleRef(null)
58
+ setAnchorEl(null)
59
59
  setIsOpen(false)
60
60
  }
61
61
 
@@ -93,7 +93,7 @@ export function BasemapsUI({
93
93
  <IconButton
94
94
  sx={styles.toggle}
95
95
  onClick={(e) => {
96
- setToggleRef(e.currentTarget as HTMLButtonElement)
96
+ setAnchorEl(e.currentTarget as HTMLButtonElement)
97
97
  setIsOpen(true)
98
98
  }}
99
99
  >
@@ -105,7 +105,7 @@ export function BasemapsUI({
105
105
  </Tooltip>
106
106
 
107
107
  <ResponsiveDrawer
108
- ref={toggleRef}
108
+ anchorEl={anchorEl}
109
109
  slotProps={{
110
110
  paper: {
111
111
  sx: {
@@ -10,8 +10,8 @@ const theme = createTheme()
10
10
  describe('ResponsiveDrawer', () => {
11
11
  const mockOnChangeCollapsed = vi.fn()
12
12
 
13
- // A real anchor element: the desktop Popover only opens when `ref != null`
14
- // (the open-by-default guard), and positioning needs a DOM node.
13
+ // A real anchor element: the desktop Popover only opens when the anchor is
14
+ // non-null (the open-by-default guard), and positioning needs a DOM node.
15
15
  let anchor: HTMLElement
16
16
 
17
17
  const defaultProps = {
@@ -32,10 +32,20 @@ describe('ResponsiveDrawer', () => {
32
32
  anchor.remove()
33
33
  })
34
34
 
35
+ test('accepts the anchor through the deprecated `ref` alias', () => {
36
+ render(
37
+ <ThemeProvider theme={theme}>
38
+ <ResponsiveDrawer ref={anchor} {...defaultProps} />
39
+ </ThemeProvider>,
40
+ )
41
+
42
+ expect(screen.getByTestId('drawer-content')).toBeDefined()
43
+ })
44
+
35
45
  test('renders in desktop mode when isMobile is false', () => {
36
46
  const { container } = render(
37
47
  <ThemeProvider theme={theme}>
38
- <ResponsiveDrawer ref={anchor} {...defaultProps} />
48
+ <ResponsiveDrawer anchorEl={anchor} {...defaultProps} />
39
49
  </ThemeProvider>,
40
50
  )
41
51
 
@@ -50,12 +60,12 @@ describe('ResponsiveDrawer', () => {
50
60
  expect(presentationElements.length).toBe(0)
51
61
  })
52
62
 
53
- test('does not open the desktop popover until the anchor ref resolves', () => {
54
- // Open-by-default guard: collapsed=false but ref=null → stays closed so the
55
- // popover never renders with a null anchorEl.
63
+ test('does not open the desktop popover until the anchor resolves', () => {
64
+ // Open-by-default guard: collapsed=false but anchorEl=null → stays closed so
65
+ // the popover never renders with a null anchorEl.
56
66
  render(
57
67
  <ThemeProvider theme={theme}>
58
- <ResponsiveDrawer ref={null} {...defaultProps} />
68
+ <ResponsiveDrawer anchorEl={null} {...defaultProps} />
59
69
  </ThemeProvider>,
60
70
  )
61
71
  expect(screen.queryByTestId('drawer-content')).toBeNull()
@@ -64,7 +74,7 @@ describe('ResponsiveDrawer', () => {
64
74
  test('renders in mobile mode when isMobile is true', () => {
65
75
  render(
66
76
  <ThemeProvider theme={theme}>
67
- <ResponsiveDrawer ref={anchor} {...defaultProps} isMobile={true} />
77
+ <ResponsiveDrawer anchorEl={anchor} {...defaultProps} isMobile={true} />
68
78
  </ThemeProvider>,
69
79
  )
70
80
 
@@ -82,7 +92,11 @@ describe('ResponsiveDrawer', () => {
82
92
  test('hides content when collapsed is true in desktop mode', () => {
83
93
  render(
84
94
  <ThemeProvider theme={theme}>
85
- <ResponsiveDrawer ref={anchor} {...defaultProps} collapsed={true} />
95
+ <ResponsiveDrawer
96
+ anchorEl={anchor}
97
+ {...defaultProps}
98
+ collapsed={true}
99
+ />
86
100
  </ThemeProvider>,
87
101
  )
88
102
 
@@ -94,7 +108,7 @@ describe('ResponsiveDrawer', () => {
94
108
  test('closes drawer when clicking outside in mobile mode', () => {
95
109
  const { container } = render(
96
110
  <ThemeProvider theme={theme}>
97
- <ResponsiveDrawer ref={anchor} {...defaultProps} isMobile={true} />
111
+ <ResponsiveDrawer anchorEl={anchor} {...defaultProps} isMobile={true} />
98
112
  </ThemeProvider>,
99
113
  )
100
114
 
@@ -119,7 +133,7 @@ describe('ResponsiveDrawer', () => {
119
133
  render(
120
134
  <ThemeProvider theme={theme}>
121
135
  <ResponsiveDrawer
122
- ref={anchor}
136
+ anchorEl={anchor}
123
137
  {...defaultProps}
124
138
  position={position}
125
139
  />
@@ -132,7 +146,7 @@ describe('ResponsiveDrawer', () => {
132
146
  test('modal (default): renders an (invisible) backdrop', () => {
133
147
  render(
134
148
  <ThemeProvider theme={theme}>
135
- <ResponsiveDrawer ref={anchor} {...defaultProps} />
149
+ <ResponsiveDrawer anchorEl={anchor} {...defaultProps} />
136
150
  </ThemeProvider>,
137
151
  )
138
152
  // The popover portals to document.body, so query the whole document.
@@ -145,7 +159,7 @@ describe('ResponsiveDrawer', () => {
145
159
  render(
146
160
  <ThemeProvider theme={theme}>
147
161
  <ResponsiveDrawer
148
- ref={anchor}
162
+ anchorEl={anchor}
149
163
  {...defaultProps}
150
164
  slotProps={slotProps}
151
165
  />
@@ -157,7 +171,7 @@ describe('ResponsiveDrawer', () => {
157
171
  test('defaults to portaling into document.body when container is omitted', () => {
158
172
  render(
159
173
  <ThemeProvider theme={theme}>
160
- <ResponsiveDrawer ref={anchor} {...defaultProps} />
174
+ <ResponsiveDrawer anchorEl={anchor} {...defaultProps} />
161
175
  </ThemeProvider>,
162
176
  )
163
177
  const content = screen.getByTestId('drawer-content')
@@ -172,7 +186,7 @@ describe('ResponsiveDrawer', () => {
172
186
  render(
173
187
  <ThemeProvider theme={theme}>
174
188
  <ResponsiveDrawer
175
- ref={anchor}
189
+ anchorEl={anchor}
176
190
  {...defaultProps}
177
191
  container={customContainer}
178
192
  />
@@ -197,7 +211,7 @@ describe('ResponsiveDrawer', () => {
197
211
  render(
198
212
  <ThemeProvider theme={theme}>
199
213
  <ResponsiveDrawer
200
- ref={anchor}
214
+ anchorEl={anchor}
201
215
  {...defaultProps}
202
216
  container={customContainer}
203
217
  />
@@ -225,7 +239,7 @@ describe('ResponsiveDrawer', () => {
225
239
  test('leaves paper maxHeight unset when no container is given', () => {
226
240
  render(
227
241
  <ThemeProvider theme={theme}>
228
- <ResponsiveDrawer ref={anchor} {...defaultProps} />
242
+ <ResponsiveDrawer anchorEl={anchor} {...defaultProps} />
229
243
  </ThemeProvider>,
230
244
  )
231
245
  const paper = document.querySelector<HTMLElement>('.MuiPopover-paper')!
@@ -247,7 +261,7 @@ describe('ResponsiveDrawer', () => {
247
261
  render(
248
262
  <ThemeProvider theme={theme}>
249
263
  <ResponsiveDrawer
250
- ref={anchor}
264
+ anchorEl={anchor}
251
265
  {...defaultProps}
252
266
  container={customContainer}
253
267
  />
@@ -271,7 +285,7 @@ describe('ResponsiveDrawer', () => {
271
285
  render(
272
286
  <ThemeProvider theme={theme}>
273
287
  <ResponsiveDrawer
274
- ref={anchor}
288
+ anchorEl={anchor}
275
289
  {...defaultProps}
276
290
  container={customContainer}
277
291
  slotProps={
@@ -297,7 +311,7 @@ describe('ResponsiveDrawer', () => {
297
311
  render(
298
312
  <ThemeProvider theme={theme}>
299
313
  <ResponsiveDrawer
300
- ref={anchor}
314
+ anchorEl={anchor}
301
315
  {...defaultProps}
302
316
  sx={{ zIndex: 9999 }}
303
317
  />
@@ -311,7 +325,7 @@ describe('ResponsiveDrawer', () => {
311
325
  test('non-modal: renders no backdrop', () => {
312
326
  render(
313
327
  <ThemeProvider theme={theme}>
314
- <ResponsiveDrawer ref={anchor} {...defaultProps} modal={false} />
328
+ <ResponsiveDrawer anchorEl={anchor} {...defaultProps} modal={false} />
315
329
  </ThemeProvider>,
316
330
  )
317
331
  expect(document.querySelector('.MuiBackdrop-root')).toBeNull()
@@ -322,7 +336,7 @@ describe('ResponsiveDrawer', () => {
322
336
  test('non-modal: Escape does not close the panel', () => {
323
337
  render(
324
338
  <ThemeProvider theme={theme}>
325
- <ResponsiveDrawer ref={anchor} {...defaultProps} modal={false} />
339
+ <ResponsiveDrawer anchorEl={anchor} {...defaultProps} modal={false} />
326
340
  </ThemeProvider>,
327
341
  )
328
342
  // Fire on a node inside the Modal root so it reaches the Modal's key handler.
@@ -336,7 +350,7 @@ describe('ResponsiveDrawer', () => {
336
350
  test('modal (default): Escape closes the panel', () => {
337
351
  render(
338
352
  <ThemeProvider theme={theme}>
339
- <ResponsiveDrawer ref={anchor} {...defaultProps} />
353
+ <ResponsiveDrawer anchorEl={anchor} {...defaultProps} />
340
354
  </ThemeProvider>,
341
355
  )
342
356
  fireEvent.keyDown(screen.getByTestId('drawer-content'), {
@@ -14,10 +14,7 @@ import {
14
14
  } from 'react'
15
15
 
16
16
  type ResponsiveDrawerPosition =
17
- | 'top-left'
18
- | 'top-right'
19
- | 'bottom-left'
20
- | 'bottom-right'
17
+ 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right'
21
18
 
22
19
  /** Placement of the panel relative to its anchor (desktop popover only). */
23
20
  export type ResponsiveDrawerPlacement = 'side' | 'overlay'
@@ -59,6 +56,7 @@ export function ResponsiveDrawer<
59
56
  slotProps?: PopoverProps['slotProps']
60
57
  },
61
58
  >({
59
+ anchorEl,
62
60
  ref,
63
61
  children,
64
62
  collapsed,
@@ -72,8 +70,15 @@ export function ResponsiveDrawer<
72
70
  placement = 'side',
73
71
  }: Required<Pick<T, 'collapsed' | 'onChangeCollapsed' | 'position'>> &
74
72
  Pick<PopoverProps, 'slotProps' | 'sx' | 'container'> & {
75
- ref: HTMLElement | null
76
- isMobile: boolean
73
+ /** Element the desktop popover is anchored to. */
74
+ anchorEl?: HTMLElement | null
75
+ /**
76
+ * @deprecated Use `anchorEl`. A JSX prop named `ref` is non-reactive under
77
+ * the React Compiler, so a state-held anchor stays frozen at its initial
78
+ * `null` and the popover never opens. Removed in the next major.
79
+ */
80
+ ref?: HTMLElement | null
81
+ isMobile?: boolean
77
82
  children: ReactNode
78
83
  /**
79
84
  * When `false`, the desktop popover is **non-modal**: no backdrop, clicks
@@ -91,6 +96,8 @@ export function ResponsiveDrawer<
91
96
  placement?: ResponsiveDrawerPlacement
92
97
  }) {
93
98
  // Popover position is frozen on open — re-measure on content resize (callback ref: portal mounts after open).
99
+ const anchor = anchorEl ?? ref ?? null
100
+
94
101
  const popoverActions = useRef<PopoverActions>(null)
95
102
  const observerRef = useRef<ResizeObserver | null>(null)
96
103
  const observeContent = useCallback((el: HTMLDivElement | null) => {
@@ -191,8 +198,8 @@ export function ResponsiveDrawer<
191
198
  action={popoverActions}
192
199
  sx={sx}
193
200
  container={container}
194
- anchorEl={ref}
195
- open={!collapsed && ref != null}
201
+ anchorEl={anchor}
202
+ open={!collapsed && anchor != null}
196
203
  onClose={modal ? () => onChangeCollapsed(true) : undefined}
197
204
  hideBackdrop={!modal}
198
205
  disableScrollLock={!modal}
@@ -177,6 +177,25 @@ describe('<LegendRow> composition', () => {
177
177
  // …and the note renders exactly once, after all variables.
178
178
  expect(screen.getAllByText('One note for the whole layer.')).toHaveLength(1)
179
179
  })
180
+
181
+ // These render with no ThemeProvider, i.e. MUI's default theme, whose
182
+ // defaultVariantMapping has no `caption` entry and falls back to a `span`.
183
+ // An inline box ignores the line-height, so the type must not depend on a
184
+ // theme-level variantMapping to come out as a block.
185
+ it('renders the note and the subtitle as blocks, not inline', () => {
186
+ renderRow('boxes', [
187
+ {
188
+ id: 'a',
189
+ name: 'A',
190
+ subtitle: 'Zoom 0-12',
191
+ helperText: 'A note.',
192
+ variables: [cat],
193
+ },
194
+ ])
195
+
196
+ expect(screen.getByText('A note.').tagName).toBe('P')
197
+ expect(screen.getByText('Zoom 0-12').tagName).toBe('P')
198
+ })
180
199
  })
181
200
 
182
201
  describe('<LegendRow> grouped (inside Legend.Group)', () => {
@@ -112,7 +112,11 @@ export function LegendRow({ layerId, children }: LegendRowProps) {
112
112
  )}
113
113
  </Box>
114
114
  {layer.subtitle && !effectivelyCollapsed && (
115
- <Typography variant='caption' color='text.secondary'>
115
+ <Typography
116
+ variant='caption'
117
+ color='text.secondary'
118
+ component='p'
119
+ >
116
120
  {layer.subtitle}
117
121
  </Typography>
118
122
  )}
@@ -136,7 +140,16 @@ export function LegendRow({ layerId, children }: LegendRowProps) {
136
140
  {layer.helperText && (
137
141
  <Box sx={[styles.footer, inGroup && styles.footerGrouped]}>
138
142
  {typeof layer.helperText === 'string' ? (
139
- <Typography variant='caption' color='text.secondary'>
143
+ // `component` is load-bearing: MUI's defaultVariantMapping has
144
+ // no entry for `caption`, so it falls back to a `span` and the
145
+ // line-height stops governing the box. Meridian maps it to `p`
146
+ // by theme, which makes the box type depend on the consumer's
147
+ // theme rather than on this component.
148
+ <Typography
149
+ variant='caption'
150
+ color='text.secondary'
151
+ component='p'
152
+ >
140
153
  {layer.helperText}
141
154
  </Typography>
142
155
  ) : (
@@ -79,7 +79,11 @@ export function buildGridConfig(hasLegend: boolean, theme: Theme) {
79
79
  * @param theme - MUI theme providing the typography token and palette
80
80
  * @returns `{ fontSize, fontFamily, color }` for an ECharts `axisLabel`
81
81
  */
82
- export function buildAxisLabelStyle(theme: Theme) {
82
+ export function buildAxisLabelStyle(theme: Theme): {
83
+ fontSize: string | number | undefined
84
+ fontFamily: string | undefined
85
+ color: string
86
+ } {
83
87
  return {
84
88
  fontSize: theme.typography.overlineDelicate?.fontSize,
85
89
  fontFamily: theme.typography.overlineDelicate?.fontFamily,