@carto/ps-react-ui 4.4.1 → 4.4.2

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 (210) hide show
  1. package/dist/components.js.map +1 -1
  2. package/dist/error-CEkRPccv.js.map +1 -1
  3. package/dist/exports-Cr43OCul.js.map +1 -1
  4. package/dist/formatter-B1Xh8XDH.js +5 -0
  5. package/dist/formatter-B1Xh8XDH.js.map +1 -0
  6. package/dist/lasso-tool-BYbxrJ-7.js.map +1 -1
  7. package/dist/note-t51drNe0.js.map +1 -1
  8. package/dist/options-D9wflre6.js.map +1 -1
  9. package/dist/row-DTCV0Ocm.js.map +1 -1
  10. package/dist/series-CYNOu2Ju.js.map +1 -1
  11. package/dist/smart-tooltip-D4vwQpFf.js.map +1 -1
  12. package/dist/styles-C_8vOEep.js +167 -0
  13. package/dist/styles-C_8vOEep.js.map +1 -0
  14. package/dist/tooltip-BDnrRKrp.js.map +1 -1
  15. package/dist/types/components/basemaps/basemaps.d.ts +20 -0
  16. package/dist/types/components/geolocation-controls/geolocation-controls.d.ts +11 -0
  17. package/dist/types/components/lasso-tool/lasso-tool-inline.d.ts +17 -0
  18. package/dist/types/components/lasso-tool/lasso-tool.d.ts +21 -0
  19. package/dist/types/components/list-data/list-data.d.ts +16 -0
  20. package/dist/types/components/measurement-tools/measurement-tools.d.ts +20 -0
  21. package/dist/types/components/smart-tooltip/smart-tooltip.d.ts +17 -0
  22. package/dist/types/components/tooltip/tooltip.d.ts +13 -0
  23. package/dist/types/components/zoom-controls/zoom-controls.d.ts +16 -0
  24. package/dist/types/hooks/use-widget-ref.d.ts +4 -4
  25. package/dist/types/widgets/actions/download/download.d.ts +11 -0
  26. package/dist/types/widgets/actions/download/exports.d.ts +15 -0
  27. package/dist/types/widgets/actions/fullscreen/fullscreen.d.ts +13 -0
  28. package/dist/types/widgets/actions/index.d.ts +1 -1
  29. package/dist/types/widgets/actions/relative-data/relative-data.d.ts +1 -0
  30. package/dist/types/widgets/bar/config.d.ts +8 -4
  31. package/dist/types/widgets/category/category-ui.d.ts +3 -0
  32. package/dist/types/widgets/category/components/category-bar.d.ts +3 -0
  33. package/dist/types/widgets/category/components/category-legend.d.ts +3 -0
  34. package/dist/types/widgets/category/components/category-row-multi.d.ts +3 -0
  35. package/dist/types/widgets/category/components/category-row-other.d.ts +3 -0
  36. package/dist/types/widgets/category/components/category-row-single.d.ts +3 -0
  37. package/dist/types/widgets/category/config.d.ts +11 -0
  38. package/dist/types/widgets/echart/echart-ui.d.ts +7 -0
  39. package/dist/types/widgets/echart/echart.d.ts +6 -0
  40. package/dist/types/widgets/echart/options.d.ts +7 -0
  41. package/dist/types/widgets/echart/types.d.ts +1 -0
  42. package/dist/types/widgets/echart/utils.d.ts +41 -0
  43. package/dist/types/widgets/error/error.d.ts +10 -0
  44. package/dist/types/widgets/formula/components/item.d.ts +3 -0
  45. package/dist/types/widgets/formula/components/prefix.d.ts +3 -0
  46. package/dist/types/widgets/formula/components/row.d.ts +3 -0
  47. package/dist/types/widgets/formula/components/series.d.ts +3 -0
  48. package/dist/types/widgets/formula/components/suffix.d.ts +3 -0
  49. package/dist/types/widgets/formula/components/value.d.ts +3 -0
  50. package/dist/types/widgets/formula/config.d.ts +11 -0
  51. package/dist/types/widgets/formula/formula-ui.d.ts +3 -0
  52. package/dist/types/widgets/histogram/config.d.ts +8 -4
  53. package/dist/types/widgets/loader/loader.d.ts +22 -0
  54. package/dist/types/widgets/loader/utils.d.ts +26 -3
  55. package/dist/types/widgets/markdown/config.d.ts +10 -0
  56. package/dist/types/widgets/markdown/markdown-ui.d.ts +7 -0
  57. package/dist/types/widgets/markdown/markdown.d.ts +3 -0
  58. package/dist/types/widgets/note/note.d.ts +10 -0
  59. package/dist/types/widgets/pie/config.d.ts +8 -4
  60. package/dist/types/widgets/range/components/range-item.d.ts +3 -0
  61. package/dist/types/widgets/range/config.d.ts +5 -0
  62. package/dist/types/widgets/range/range-ui.d.ts +3 -0
  63. package/dist/types/widgets/scatterplot/config.d.ts +7 -3
  64. package/dist/types/widgets/selection-summary/selection-summary.d.ts +11 -0
  65. package/dist/types/widgets/skeleton-loader/skeleton-loader.d.ts +10 -0
  66. package/dist/types/widgets/spread/components/max-value.d.ts +3 -0
  67. package/dist/types/widgets/spread/components/min-value.d.ts +3 -0
  68. package/dist/types/widgets/spread/components/separator.d.ts +3 -0
  69. package/dist/types/widgets/spread/config.d.ts +11 -0
  70. package/dist/types/widgets/spread/spread-ui.d.ts +3 -0
  71. package/dist/types/widgets/subheader/subheader.d.ts +11 -0
  72. package/dist/types/widgets/table/config.d.ts +8 -3
  73. package/dist/types/widgets/table/hooks/use-pagination.d.ts +11 -3
  74. package/dist/types/widgets/table/hooks/use-selection.d.ts +11 -2
  75. package/dist/types/widgets/table/hooks/use-sort.d.ts +11 -3
  76. package/dist/types/widgets/timeseries/config.d.ts +8 -4
  77. package/dist/types/widgets/utils/chart-config/download-config.d.ts +3 -0
  78. package/dist/types/widgets/{_shared → utils}/chart-config/index.d.ts +2 -0
  79. package/dist/types/widgets/{_shared → utils}/chart-config/option-builders.d.ts +1 -1
  80. package/dist/types/widgets/utils/formatter.d.ts +1 -0
  81. package/dist/types/widgets/utils/index.d.ts +7 -0
  82. package/dist/types/widgets/wrapper/components/actions.d.ts +3 -0
  83. package/dist/types/widgets/wrapper/components/options.d.ts +3 -0
  84. package/dist/types/widgets/wrapper/components/title.d.ts +3 -0
  85. package/dist/types/widgets/wrapper/wrapper-ui.d.ts +14 -0
  86. package/dist/types/widgets/wrapper/wrapper.d.ts +14 -0
  87. package/dist/use-widget-ref-wtFLDFCD.js.map +1 -1
  88. package/dist/utils-BOhInag6.js.map +1 -1
  89. package/dist/widgets/actions.js +651 -628
  90. package/dist/widgets/actions.js.map +1 -1
  91. package/dist/widgets/bar.js +66 -86
  92. package/dist/widgets/bar.js.map +1 -1
  93. package/dist/widgets/category.js +21 -21
  94. package/dist/widgets/category.js.map +1 -1
  95. package/dist/widgets/echart.js.map +1 -1
  96. package/dist/widgets/formula.js +54 -54
  97. package/dist/widgets/formula.js.map +1 -1
  98. package/dist/widgets/histogram.js +45 -65
  99. package/dist/widgets/histogram.js.map +1 -1
  100. package/dist/widgets/loader.js.map +1 -1
  101. package/dist/widgets/markdown.js.map +1 -1
  102. package/dist/widgets/pie.js +122 -99
  103. package/dist/widgets/pie.js.map +1 -1
  104. package/dist/widgets/range.js +23 -22
  105. package/dist/widgets/range.js.map +1 -1
  106. package/dist/widgets/scatterplot.js +39 -59
  107. package/dist/widgets/scatterplot.js.map +1 -1
  108. package/dist/widgets/selection-summary.js.map +1 -1
  109. package/dist/widgets/skeleton-loader.js.map +1 -1
  110. package/dist/widgets/spread.js +40 -41
  111. package/dist/widgets/spread.js.map +1 -1
  112. package/dist/widgets/subheader.js.map +1 -1
  113. package/dist/widgets/table.js.map +1 -1
  114. package/dist/widgets/timeseries.js +39 -59
  115. package/dist/widgets/timeseries.js.map +1 -1
  116. package/dist/widgets/utils.js +31 -0
  117. package/dist/widgets/utils.js.map +1 -0
  118. package/dist/widgets/wrapper.js.map +1 -1
  119. package/package.json +5 -1
  120. package/src/components/basemaps/basemaps.tsx +20 -0
  121. package/src/components/geolocation-controls/geolocation-controls.tsx +11 -0
  122. package/src/components/lasso-tool/lasso-tool-inline.tsx +17 -0
  123. package/src/components/lasso-tool/lasso-tool.tsx +21 -0
  124. package/src/components/list-data/list-data.tsx +16 -0
  125. package/src/components/measurement-tools/measurement-tools.tsx +20 -0
  126. package/src/components/smart-tooltip/smart-tooltip.tsx +17 -0
  127. package/src/components/tooltip/tooltip.tsx +13 -0
  128. package/src/components/zoom-controls/zoom-controls.tsx +16 -0
  129. package/src/hooks/use-widget-ref.ts +4 -4
  130. package/src/widgets/README.md +10 -10
  131. package/src/widgets/actions/download/download.tsx +11 -0
  132. package/src/widgets/actions/download/exports.tsx +15 -0
  133. package/src/widgets/actions/fullscreen/fullscreen.tsx +13 -0
  134. package/src/widgets/actions/index.ts +1 -0
  135. package/src/widgets/actions/relative-data/relative-data.test.tsx +62 -1
  136. package/src/widgets/actions/relative-data/relative-data.tsx +62 -39
  137. package/src/widgets/bar/config.ts +12 -20
  138. package/src/widgets/bar/style.ts +1 -1
  139. package/src/widgets/category/category-ui.tsx +4 -2
  140. package/src/widgets/category/components/category-bar.tsx +3 -0
  141. package/src/widgets/category/components/category-legend.tsx +3 -0
  142. package/src/widgets/category/components/category-row-multi.tsx +3 -0
  143. package/src/widgets/category/components/category-row-other.tsx +3 -0
  144. package/src/widgets/category/components/category-row-single.tsx +3 -0
  145. package/src/widgets/category/config.ts +11 -0
  146. package/src/widgets/echart/echart-ui.tsx +7 -0
  147. package/src/widgets/echart/echart.tsx +6 -0
  148. package/src/widgets/echart/options.ts +7 -0
  149. package/src/widgets/echart/types.ts +1 -0
  150. package/src/widgets/echart/utils.ts +41 -0
  151. package/src/widgets/error/error.tsx +10 -0
  152. package/src/widgets/formula/components/item.tsx +3 -0
  153. package/src/widgets/formula/components/prefix.tsx +3 -0
  154. package/src/widgets/formula/components/row.tsx +3 -0
  155. package/src/widgets/formula/components/series.tsx +3 -0
  156. package/src/widgets/formula/components/suffix.tsx +3 -0
  157. package/src/widgets/formula/components/value.tsx +4 -2
  158. package/src/widgets/formula/config.ts +11 -0
  159. package/src/widgets/formula/formula-ui.tsx +3 -0
  160. package/src/widgets/histogram/config.ts +11 -20
  161. package/src/widgets/histogram/style.ts +1 -1
  162. package/src/widgets/loader/loader.tsx +22 -0
  163. package/src/widgets/loader/utils.ts +26 -3
  164. package/src/widgets/markdown/config.ts +10 -0
  165. package/src/widgets/markdown/markdown-ui.tsx +7 -0
  166. package/src/widgets/markdown/markdown.tsx +3 -0
  167. package/src/widgets/note/note.tsx +10 -0
  168. package/src/widgets/pie/config.ts +85 -30
  169. package/src/widgets/pie/style.ts +1 -1
  170. package/src/widgets/range/components/range-item.tsx +5 -2
  171. package/src/widgets/range/config.ts +5 -0
  172. package/src/widgets/range/range-ui.tsx +3 -0
  173. package/src/widgets/scatterplot/config.ts +11 -20
  174. package/src/widgets/scatterplot/style.ts +1 -1
  175. package/src/widgets/selection-summary/selection-summary.tsx +11 -0
  176. package/src/widgets/skeleton-loader/skeleton-loader.tsx +10 -0
  177. package/src/widgets/spread/components/max-value.tsx +4 -2
  178. package/src/widgets/spread/components/min-value.tsx +4 -2
  179. package/src/widgets/spread/components/separator.tsx +3 -0
  180. package/src/widgets/spread/config.ts +11 -0
  181. package/src/widgets/spread/spread-ui.tsx +3 -0
  182. package/src/widgets/subheader/subheader.tsx +11 -0
  183. package/src/widgets/table/config.ts +8 -3
  184. package/src/widgets/table/hooks/use-pagination.ts +11 -3
  185. package/src/widgets/table/hooks/use-selection.ts +11 -2
  186. package/src/widgets/table/hooks/use-sort.ts +11 -3
  187. package/src/widgets/timeseries/config.ts +11 -20
  188. package/src/widgets/timeseries/style.ts +1 -1
  189. package/src/widgets/utils/chart-config/download-config.ts +22 -0
  190. package/src/widgets/{_shared → utils}/chart-config/index.ts +4 -0
  191. package/src/widgets/{_shared → utils}/chart-config/option-builders.ts +1 -1
  192. package/src/widgets/utils/formatter.ts +1 -0
  193. package/src/widgets/utils/index.ts +26 -0
  194. package/src/widgets/wrapper/components/actions.tsx +3 -0
  195. package/src/widgets/wrapper/components/options.tsx +3 -0
  196. package/src/widgets/wrapper/components/title.tsx +3 -0
  197. package/src/widgets/wrapper/wrapper-ui.tsx +14 -0
  198. package/src/widgets/wrapper/wrapper.tsx +14 -0
  199. package/dist/styles-CAroD5Rc.js +0 -123
  200. package/dist/styles-CAroD5Rc.js.map +0 -1
  201. /package/dist/types/widgets/{_shared → utils}/chart-config/config-factory.d.ts +0 -0
  202. /package/dist/types/widgets/{_shared → utils}/chart-config/csv-modifiers.d.ts +0 -0
  203. /package/dist/types/widgets/{_shared → utils}/chart-config/option-builders.test.d.ts +0 -0
  204. /package/dist/types/widgets/{_shared → utils}/skeleton/index.d.ts +0 -0
  205. /package/dist/types/widgets/{_shared → utils}/skeleton/styles.d.ts +0 -0
  206. /package/src/widgets/{_shared → utils}/chart-config/config-factory.ts +0 -0
  207. /package/src/widgets/{_shared → utils}/chart-config/csv-modifiers.ts +0 -0
  208. /package/src/widgets/{_shared → utils}/chart-config/option-builders.test.ts +0 -0
  209. /package/src/widgets/{_shared → utils}/skeleton/index.ts +0 -0
  210. /package/src/widgets/{_shared → utils}/skeleton/styles.ts +0 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"styles-C_8vOEep.js","sources":["../src/widgets/utils/chart-config/csv-modifiers.ts","../src/widgets/utils/chart-config/option-builders.ts","../src/widgets/utils/chart-config/download-config.ts","../src/widgets/utils/skeleton/styles.ts"],"sourcesContent":["/**\n * Shared CSV export modifiers for chart widgets\n */\n\n/**\n * Flattens object array data into CSV-ready rows.\n * Used by bar, pie, histogram, and timeseries widgets.\n *\n * @param data - Array of series, where each series is an array of data objects\n * @returns CSV rows with headers and values\n */\nexport function flattenObjectArrayToCSV<T extends Record<string, unknown>>(\n data: T[][],\n): string[][] {\n const rows: string[][] = []\n\n // Add headers from first data point if available\n if (data.length > 0 && (data[0]?.length ?? 0) > 0) {\n const firstDataPoint = data?.[0]?.[0] ?? {}\n const headers = Object.keys(firstDataPoint)\n rows.push(headers)\n }\n\n // Add data rows from all series\n data.forEach((series) => {\n series.forEach((dataPoint) => {\n const values = Object.values(dataPoint).map((v) => String(v))\n rows.push(values)\n })\n })\n\n return rows\n}\n\n/**\n * Creates CSV rows for scatterplot data.\n * Scatterplot uses array format [x, y] instead of objects.\n *\n * @param data - Array of series, where each series is an array of [x, y] tuples\n * @returns CSV rows with ['x', 'y'] headers\n */\nexport function scatterplotDataToCSV(data: number[][][]): string[][] {\n const rows: string[][] = []\n\n // Add headers\n rows.push(['x', 'y'])\n\n // Add data rows from all series\n data.forEach((series) => {\n series.forEach((dataPoint) => {\n rows.push([String(dataPoint[0]), String(dataPoint[1])])\n })\n })\n\n return rows\n}\n","import type { Theme } from '@mui/material'\nimport type { LegendComponentOption } from 'echarts'\nimport type {\n CallbackDataParams,\n TopLevelFormatterParams,\n} from 'echarts/types/dist/shared'\n\n/**\n * Shared EChart configuration builders for chart widgets\n */\n\n/**\n * Rounds a value up to the nearest \"nice\" number.\n * A nice number is a multiple of 10^floor(log10(value)).\n *\n * Examples: 547 → 600, 200 → 200, 1200 → 2000, 18 → 20, 5 → 5, -547 → -500\n */\nexport function niceNum(value: number): number {\n if (value === 0) return 0\n const absValue = Math.abs(value)\n const base = Math.pow(10, Math.floor(Math.log10(absValue)))\n const rounded = Math.ceil(absValue / base) * base\n return value < 0 ? -rounded : rounded\n}\n\n/**\n * Builds standard legend configuration for chart widgets\n *\n * @param hasLegend - Whether to show the legend\n * @returns Legend configuration object\n */\nexport function buildLegendConfig(hasLegend: boolean): LegendComponentOption {\n return {\n show: hasLegend,\n icon: 'circle' as const,\n left: 0,\n bottom: 0,\n orient: 'horizontal',\n type: 'scroll',\n }\n}\n\n/**\n * Builds standard grid configuration with legend-aware spacing\n *\n * @param hasLegend - Whether the chart has a legend\n * @param theme - MUI theme for spacing\n * @param additionalConfig - Additional grid configuration to merge\n * @returns Grid configuration object\n */\nexport function buildGridConfig(hasLegend: boolean, theme: Theme) {\n return {\n ...(!hasLegend && { bottom: parseInt(theme.spacing(3)) }),\n ...(hasLegend && { bottom: parseInt(theme.spacing(7)) }),\n }\n}\n\n/**\n * Creates a tooltip position calculator that handles overflow\n * Used by bar, histogram, and scatterplot widgets\n *\n * @param theme - MUI theme for spacing\n * @returns Tooltip position function\n */\nexport function createTooltipPositioner(theme: Theme) {\n return function (\n point: [number, number],\n _params: unknown,\n _dom: unknown,\n _rect: unknown,\n size: { contentSize: [number, number]; viewSize: [number, number] },\n ) {\n const position = { top: parseInt(theme.spacing(0.5)) } as Record<\n string,\n number\n >\n\n // Position tooltip left or right based on available space\n if (size.contentSize[0] < size.viewSize[0] - point[0]) {\n position.left = point[0]\n } else {\n position.right = size.viewSize[0] - point[0]\n }\n\n return position\n }\n}\n\n/**\n * Creates an axis label formatter for ECharts\n * Used to format numeric axis labels with a widget formatter\n *\n * @param formatter - Optional formatter function from widget config\n * @returns Axis label formatter function or undefined\n */\nexport function createAxisLabelFormatter(\n formatter?: (value: number) => string,\n) {\n if (!formatter) return undefined\n return (value: number) => formatter(value)\n}\n\n/**\n * Applies formatter to xAxis configuration\n * Only applies to single axis objects (not arrays) with type 'value'\n *\n * @param xAxis - Existing xAxis configuration\n * @param formatter - Optional formatter function from widget config\n * @returns Updated xAxis configuration or undefined if no changes needed\n */\nexport function applyXAxisFormatter(\n xAxis: unknown,\n formatter?: (value: number) => string,\n) {\n let axisFormatter = createAxisLabelFormatter(formatter)\n\n const xAxisIsObject = xAxis && !Array.isArray(xAxis)\n const xAxisTyped = xAxis as { type?: string; axisLabel?: unknown }\n\n if (!xAxisIsObject || xAxisTyped.type !== 'value') {\n axisFormatter = undefined\n }\n\n return {\n ...xAxisTyped,\n axisLabel: {\n ...(typeof xAxisTyped.axisLabel === 'object' && xAxisTyped.axisLabel\n ? xAxisTyped.axisLabel\n : {}),\n formatter: axisFormatter,\n },\n }\n}\n\n/**\n * Applies formatter to yAxis configuration\n * Only applies to single axis objects (not arrays) with type 'value'\n *\n * @param yAxis - Existing yAxis configuration\n * @param formatter - Optional formatter function from widget config\n * @returns Updated yAxis configuration or undefined if no changes needed\n */\nexport function applyYAxisFormatter(\n yAxis: unknown,\n formatter?: (value: number) => string,\n) {\n let axisFormatter = createAxisLabelFormatter(formatter)\n\n const yAxisIsObject = yAxis && !Array.isArray(yAxis)\n const yAxisTyped = yAxis as { type?: string; axisLabel?: unknown }\n\n if (!yAxisIsObject || yAxisTyped.type !== 'value') {\n axisFormatter = undefined\n }\n\n return {\n ...yAxisTyped,\n axisLabel: {\n ...(typeof yAxisTyped.axisLabel === 'object' && yAxisTyped.axisLabel\n ? yAxisTyped.axisLabel\n : {}),\n formatter: axisFormatter,\n },\n }\n}\n\n/**\n * Creates a tooltip formatter for ECharts\n * Formats numeric values in tooltip using widget formatter\n * Handles both axis trigger (array) and item trigger (object) modes\n *\n * @param formatter - Optional formatter function from widget config\n * @returns Tooltip formatter function or undefined\n */\nexport function createTooltipFormatter(\n callback: (\n item: CallbackDataParams,\n items: CallbackDataParams[],\n ) => {\n name: string\n seriesName: string\n marker: string\n value: string | number\n },\n) {\n return (params: TopLevelFormatterParams) => {\n // Handle both array (axis trigger) and object (item trigger)\n const items = Array.isArray(params) ? params : [params]\n\n const tooltip = (name: string, callback: string) =>\n `<div style=\"margin: 0px 0 0;line-height:1;\">${name ? `<div style=\"font-size:11px;color:#FFFFFF;font-weight:400;line-height:1; margin-bottom: 10px\">${name}</div>` : ''}<div style=\"margin: 0;line-height:1;\">${callback}</div><div style=\"clear:both\"></div></div>`\n\n const values = items.map((item) => {\n const { name, seriesName, marker, value } = callback(item, items)\n return {\n name,\n seriesName,\n marker,\n value,\n }\n })\n\n const name = values[0]?.name ?? ''\n // Show margin if name exists or there are multiple items\n const showMargin = name || items.length > 1\n const marginStyle = showMargin\n ? 'margin: 10px 0 0;line-height:1;'\n : 'margin: 0;line-height:1;'\n\n const formattedValues = values.map(\n ({ seriesName, marker, value }) =>\n `<div style=\"${marginStyle}\"><div style=\"margin: 0px 0 0;line-height:1;\">${marker}${seriesName ? `<span style=\"font-size:11px;color:#FFFFFF;font-weight:400;margin-left:2px;margin-right:10px\">${seriesName}</span>` : ''}<span style=\"float:right;margin-left:10px;font-size:11px;color:#FFFFFF;font-weight:900\">${value}</span></div></div>`,\n )\n\n return tooltip(name, formattedValues.join(''))\n }\n}\n","import { downloadToCSV, downloadToPNG, type DownloadItem } from '../../actions'\nimport type { ConfigProps } from '../../loader/types'\n\nexport function createChartDownloadConfig<TData>(\n csvModifier: (data: TData) => string[][],\n) {\n return function ({ refUI }: ConfigProps): DownloadItem<TData>[] {\n return [\n {\n ...downloadToPNG,\n modifier: () => downloadToPNG.modifier(refUI),\n },\n {\n ...downloadToCSV,\n modifier: async (data) => {\n const rows = csvModifier(data)\n return downloadToCSV.modifier(rows)\n },\n },\n ]\n }\n}\n","import type { Theme } from '@mui/material'\n\n/**\n * Base skeleton styles shared across all chart widgets\n */\nexport const baseSkeletonStyles = {\n graph: {\n /**\n * Common container style for chart widget skeletons\n */\n container: {\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'space-between',\n flexDirection: 'column',\n gap: ({ spacing }: Theme) => spacing(1),\n height: ({ spacing }: Theme) => spacing(38),\n },\n },\n} as const\n"],"names":["flattenObjectArrayToCSV","data","rows","length","firstDataPoint","headers","Object","keys","push","forEach","series","dataPoint","values","map","v","String","scatterplotDataToCSV","niceNum","value","absValue","Math","abs","base","pow","floor","log10","rounded","ceil","buildLegendConfig","hasLegend","show","icon","left","bottom","orient","type","buildGridConfig","theme","parseInt","spacing","createTooltipPositioner","point","_params","_dom","_rect","size","position","top","contentSize","viewSize","right","createAxisLabelFormatter","formatter","applyXAxisFormatter","xAxis","axisFormatter","xAxisIsObject","Array","isArray","xAxisTyped","undefined","axisLabel","applyYAxisFormatter","yAxis","yAxisIsObject","yAxisTyped","createTooltipFormatter","callback","params","items","tooltip","name","item","seriesName","marker","marginStyle","formattedValues","join","createChartDownloadConfig","csvModifier","refUI","downloadToPNG","modifier","downloadToCSV","baseSkeletonStyles","graph","container","display","alignItems","justifyContent","flexDirection","gap","height"],"mappings":";;;;;;;;;;;;;;AAWO,SAASA,EACdC,GACY;AACZ,QAAMC,IAAmB,CAAA;AAGzB,MAAID,EAAKE,SAAS,MAAMF,EAAK,CAAC,GAAGE,UAAU,KAAK,GAAG;AACjD,UAAMC,IAAiBH,IAAO,CAAC,IAAI,CAAC,KAAK,CAAA,GACnCI,IAAUC,OAAOC,KAAKH,CAAc;AAC1CF,IAAAA,EAAKM,KAAKH,CAAO;AAAA,EACnB;AAGAJ,SAAAA,EAAKQ,QAASC,CAAAA,MAAW;AACvBA,IAAAA,EAAOD,QAASE,CAAAA,MAAc;AAC5B,YAAMC,IAASN,OAAOM,OAAOD,CAAS,EAAEE,IAAKC,CAAAA,MAAMC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AAA,MACTC,YAAY;AAAA,MACZC,gBAAgB;AAAA,MAChBC,eAAe;AAAA,MACfC,KAAKA,CAAC;AAAA,QAAEpD,SAAAA;AAAAA,MAAAA,MAAqBA,EAAQ,CAAC;AAAA,MACtCqD,QAAQA,CAAC;AAAA,QAAErD,SAAAA;AAAAA,MAAAA,MAAqBA,EAAQ,EAAE;AAAA,IAAA;AAAA,EAC5C;AAEJ;"}
@@ -1 +1 @@
1
- {"version":3,"file":"tooltip-BDnrRKrp.js","sources":["../src/components/tooltip/tooltip.tsx"],"sourcesContent":["import { Tooltip as MuiTooltip, type TooltipProps } from '@mui/material'\n\nlet tooltipEnterDelay = 500\n\n/**\n * A wrapper around MUI's Tooltip component with enterNextDelay set to 1000ms by default.\n *\n * This component ensures consistent tooltip behavior across the application.\n *\n * @example\n * <Tooltip title=\"This is a tooltip\">\n * <Button>Hover me</Button>\n * </Tooltip>\n */\nexport function Tooltip({\n children,\n title,\n enterNextDelay = tooltipEnterDelay,\n ...props\n}: TooltipProps) {\n return (\n <MuiTooltip title={title} enterNextDelay={enterNextDelay} {...props}>\n {children}\n </MuiTooltip>\n )\n}\n\nexport function setTooltipEnterDelay(delay: number) {\n tooltipEnterDelay = delay\n}\n"],"names":["tooltipEnterDelay","Tooltip","t0","$","_c","children","props","t1","title","enterNextDelay","undefined","t2","MuiTooltip","setTooltipEnterDelay","delay"],"mappings":";;;AAEA,IAAIA,IAAoB;AAYjB,SAAAC,EAAAC,GAAA;AAAA,QAAAC,IAAAC,EAAA,EAAA;AAAA,MAAAC,GAAAC,GAAAC,GAAAC;AAAA,EAAAL,SAAAD,KAAiB;AAAA,IAAAG,UAAAA;AAAAA,IAAAG,OAAAA;AAAAA,IAAAC,gBAAAF;AAAAA,IAAA,GAAAD;AAAAA,EAAAA,IAAAJ,GAKTC,OAAAD,GAAAC,OAAAE,GAAAF,OAAAG,GAAAH,OAAAI,GAAAJ,OAAAK,MAAAH,IAAAF,EAAA,CAAA,GAAAG,IAAAH,EAAA,CAAA,GAAAI,IAAAJ,EAAA,CAAA,GAAAK,IAAAL,EAAA,CAAA;AAFb,QAAAM,IAAAF,MAAAG,SAAAV,IAAAO;AAAkC,MAAAI;AAAA,SAAAR,EAAA,CAAA,MAAAE,KAAAF,EAAA,CAAA,MAAAM,KAAAN,EAAA,CAAA,MAAAG,KAAAH,SAAAK,KAIhCG,sBAACC,GAAA,EAAkBJ,OAAAA,GAAuBC,gBAAAA,MAAoBH,gBAE9D,GAAaH,OAAAE,GAAAF,OAAAM,GAAAN,OAAAG,GAAAH,OAAAK,GAAAL,OAAAQ,KAAAA,IAAAR,EAAA,CAAA,GAFbQ;AAEa;AAIV,SAASE,EAAqBC,GAAe;AAClDd,EAAAA,IAAoBc;AACtB;"}
1
+ {"version":3,"file":"tooltip-BDnrRKrp.js","sources":["../src/components/tooltip/tooltip.tsx"],"sourcesContent":["import { Tooltip as MuiTooltip, type TooltipProps } from '@mui/material'\n\nlet tooltipEnterDelay = 500\n\n/**\n * A wrapper around MUI's Tooltip component with enterNextDelay set to 1000ms by default.\n *\n * This component ensures consistent tooltip behavior across the application.\n *\n * @example\n * <Tooltip title=\"This is a tooltip\">\n * <Button>Hover me</Button>\n * </Tooltip>\n */\nexport function Tooltip({\n children,\n title,\n enterNextDelay = tooltipEnterDelay,\n ...props\n}: TooltipProps) {\n return (\n <MuiTooltip title={title} enterNextDelay={enterNextDelay} {...props}>\n {children}\n </MuiTooltip>\n )\n}\n\n/**\n * Sets the global default `enterNextDelay` for all Tooltip components in the application.\n *\n * @param delay - Delay in milliseconds before showing tooltips on subsequent hovers.\n *\n * @example\n * ```tsx\n * import { setTooltipEnterDelay } from '@carto/ps-react-ui/components';\n *\n * // Set global delay to 300ms at app initialization\n * setTooltipEnterDelay(300);\n * ```\n */\nexport function setTooltipEnterDelay(delay: number) {\n tooltipEnterDelay = delay\n}\n"],"names":["tooltipEnterDelay","Tooltip","t0","$","_c","children","props","t1","title","enterNextDelay","undefined","t2","MuiTooltip","setTooltipEnterDelay","delay"],"mappings":";;;AAEA,IAAIA,IAAoB;AAYjB,SAAAC,EAAAC,GAAA;AAAA,QAAAC,IAAAC,EAAA,EAAA;AAAA,MAAAC,GAAAC,GAAAC,GAAAC;AAAA,EAAAL,SAAAD,KAAiB;AAAA,IAAAG,UAAAA;AAAAA,IAAAG,OAAAA;AAAAA,IAAAC,gBAAAF;AAAAA,IAAA,GAAAD;AAAAA,EAAAA,IAAAJ,GAKTC,OAAAD,GAAAC,OAAAE,GAAAF,OAAAG,GAAAH,OAAAI,GAAAJ,OAAAK,MAAAH,IAAAF,EAAA,CAAA,GAAAG,IAAAH,EAAA,CAAA,GAAAI,IAAAJ,EAAA,CAAA,GAAAK,IAAAL,EAAA,CAAA;AAFb,QAAAM,IAAAF,MAAAG,SAAAV,IAAAO;AAAkC,MAAAI;AAAA,SAAAR,EAAA,CAAA,MAAAE,KAAAF,EAAA,CAAA,MAAAM,KAAAN,EAAA,CAAA,MAAAG,KAAAH,SAAAK,KAIhCG,sBAACC,GAAA,EAAkBJ,OAAAA,GAAuBC,gBAAAA,MAAoBH,gBAE9D,GAAaH,OAAAE,GAAAF,OAAAM,GAAAN,OAAAG,GAAAH,OAAAK,GAAAL,OAAAQ,KAAAA,IAAAR,EAAA,CAAA,GAFbQ;AAEa;AAiBV,SAASE,EAAqBC,GAAe;AAClDd,EAAAA,IAAoBc;AACtB;"}
@@ -1,3 +1,23 @@
1
1
  import { BasemapsUIProps } from './types';
2
2
  import { JSX } from 'react';
3
+ /**
4
+ * Provides an interactive basemap selector with responsive drawer, grouping support, and customizable positioning.
5
+ *
6
+ * @remarks
7
+ * This is an uncontrolled component focused on UI presentation. Typically used with the `BasemapsControls` HOC from `@carto/ps-react-maps` for automatic state management.
8
+ *
9
+ * @example
10
+ * ```tsx
11
+ * <BasemapsControls mapId={mapId}>
12
+ * {({ basemap, setBasemap }) => (
13
+ * <BasemapsUI
14
+ * options={basemapOptions}
15
+ * selected={basemap}
16
+ * onChange={setBasemap}
17
+ * position="bottom-right"
18
+ * />
19
+ * )}
20
+ * </BasemapsControls>
21
+ * ```
22
+ */
3
23
  export declare function BasemapsUI({ options, labels: _labels, position, selected, onChange, TooltipProps, }: BasemapsUIProps): JSX.Element;
@@ -1,3 +1,14 @@
1
1
  import { GeolocationControlProps } from './types';
2
2
  import { JSX } from 'react';
3
+ /**
4
+ * Provides a seamless interface for accessing device location through the browser's Geolocation API, with permission handling, continuous tracking, and error management.
5
+ *
6
+ * @example
7
+ * ```tsx
8
+ * <GeolocationControls
9
+ * onChange={(coords) => console.log(coords.latitude, coords.longitude)}
10
+ * onError={(error) => console.error(error.message)}
11
+ * />
12
+ * ```
13
+ */
3
14
  export declare function GeolocationControls({ disabled, labels, PaperProps, TooltipProps, watch, onChange, onError, }: GeolocationControlProps): JSX.Element;
@@ -1,3 +1,20 @@
1
1
  import { JSX } from 'react';
2
2
  import { LassoToolsInlineComponentProps } from './types';
3
+ /**
4
+ * Provides an inline layout variant of the lasso tools interface with toggle button groups for mode selection and inline chip management for spatial filters.
5
+ *
6
+ * @example
7
+ * ```tsx
8
+ * <LassoToolsInlineUI
9
+ * enabled={enabled}
10
+ * values={spatialFilters}
11
+ * modes={modes}
12
+ * modesMapping={modesMapping}
13
+ * modeSelected={modeSelected}
14
+ * onChangeMode={setModeSelected}
15
+ * onChipToggle={handleChipToggle}
16
+ * onDelete={handleDelete}
17
+ * />
18
+ * ```
19
+ */
3
20
  export declare function LassoToolsInlineUI({ enabled, values, chipProps, labels, modes, modesMapping, modeSelected, BoxProps: { sx, ...BoxProps }, onChipToggle, onDelete, onChangeMode, onAllChipToggle, onAllDelete, }: LassoToolsInlineComponentProps): JSX.Element;
@@ -1,6 +1,27 @@
1
1
  import { JSX } from 'react';
2
2
  import { PickDeep } from 'type-fest';
3
3
  import { LassoToolsComponentProps, OptionsChildrenProps } from './types';
4
+ /**
5
+ * Provides a comprehensive floating interface for spatial selection and drawing operations on maps, supporting polygon, rectangle, circle, freehand lasso, and edit modes.
6
+ *
7
+ * @remarks
8
+ * Supports customizable slots for action, options, chips, and secondary actions via compound component pattern (e.g., `LassoToolsUI.Action`, `LassoToolsUI.Chips`).
9
+ *
10
+ * @example
11
+ * ```tsx
12
+ * <LassoToolsUI
13
+ * enabled={enabled}
14
+ * values={spatialFilters}
15
+ * modes={modes}
16
+ * modesMapping={modesMapping}
17
+ * modeSelected={modeSelected}
18
+ * onActionToggle={setEnabled}
19
+ * onChangeMode={setModeSelected}
20
+ * onChipToggle={handleChipToggle}
21
+ * onDelete={handleDelete}
22
+ * />
23
+ * ```
24
+ */
4
25
  export declare function LassoToolsUI({ enabled, values, actionProps, chipProps, labels, modes, modesMapping, modeSelected, PaperProps: { sx, ...PaperProps }, onActionToggle, onChipToggle, onDelete, onChangeMode, onAllChipToggle, onAllDelete, ChipsSlot, ActionSlot, SecondaryActionsSlot, OptionsSlot, }: LassoToolsComponentProps): JSX.Element;
5
26
  export declare namespace LassoToolsUI {
6
27
  var Action: ({ modes, modesMapping, modeSelected, actionProps, enabled, labels, onActionToggle, }: Partial<Omit<LassoToolsComponentProps, "ChipsSlot" | "ActionsSlot" | "OptionsSlot" | "SecondaryActionsSlot">> & {
@@ -1,3 +1,19 @@
1
1
  import { JSX } from 'react';
2
2
  import { ListDataProps } from './types';
3
+ /**
4
+ * Displays structured data in an accessible list format with expandable views, interactive selection, tooltips, and loading states.
5
+ *
6
+ * @example
7
+ * ```tsx
8
+ * <ListDataUI
9
+ * data={[
10
+ * { id: '1', label: 'Population', value: '8.4M' },
11
+ * { id: '2', label: 'Median Age', value: '32 years' },
12
+ * ]}
13
+ * maxItems={3}
14
+ * onItemClick={(item) => setSelectedId(item.id)}
15
+ * selectedItemId={selectedId}
16
+ * />
17
+ * ```
18
+ */
3
19
  export declare function ListDataUI({ data, isLoading, maxItems, labels, showDivider, selectedItemId, tooltipProps, onExpand, onItemClick, }: ListDataProps): JSX.Element;
@@ -1,3 +1,23 @@
1
1
  import { JSX } from 'react';
2
2
  import { MeasurementToolsComponentProps } from './types';
3
+ /**
4
+ * Provides a measurement interface for calculating distances, areas, and buffers on maps with support for metric and imperial unit systems and real-time unit conversion.
5
+ *
6
+ * @example
7
+ * ```tsx
8
+ * <MeasurementToolsUI
9
+ * enabled={enabled}
10
+ * value={measurementValue}
11
+ * modes={DEFAULT_MEASUREMENT_TOOLS_MODES}
12
+ * units={DEFAULT_MEASUREMENT_TOOLS_UNITS}
13
+ * modesMapping={DEFAULT_MEASUREMENT_TOOLS_MODES_MAPPING}
14
+ * unitsMapping={DEFAULT_MEASUREMENT_TOOLS_UNITS_MAPPING}
15
+ * modeSelected={mode}
16
+ * unitSelected={unit}
17
+ * onActionToggle={setEnabled}
18
+ * onChangeMode={setMode}
19
+ * onChangeUnit={setUnit}
20
+ * />
21
+ * ```
22
+ */
3
23
  export declare function MeasurementToolsUI({ enabled, actionProps, labels, modes, modesMapping, unitsMapping, modeSelected, PaperProps: { sx, ...PaperProps }, units, unitSelected, onActionToggle, onChangeMode, onChangeUnit, }: MeasurementToolsComponentProps): JSX.Element;
@@ -1,5 +1,22 @@
1
1
  import { TooltipProps } from '@mui/material';
2
2
  import { JSX, Ref } from 'react';
3
+ /**
4
+ * An intelligent tooltip wrapper that automatically detects text overflow and displays a tooltip only when content is truncated.
5
+ *
6
+ * @remarks
7
+ * Uses a render prop pattern. The child function receives a `ref` that must be attached to the element being monitored for overflow. Use the `dependencies` array to trigger re-evaluation when content or container size changes.
8
+ *
9
+ * @example
10
+ * ```tsx
11
+ * <SmartTooltip title="This is a long text that might get truncated">
12
+ * {({ ref }) => (
13
+ * <Typography ref={ref} noWrap sx={{ overflow: 'hidden', textOverflow: 'ellipsis' }}>
14
+ * This is a long text that might get truncated
15
+ * </Typography>
16
+ * )}
17
+ * </SmartTooltip>
18
+ * ```
19
+ */
3
20
  export declare function SmartTooltip<T extends HTMLElement>({ title, dependencies, timeout, TooltipProps, children, }: {
4
21
  title: string | undefined;
5
22
  dependencies?: unknown[];
@@ -10,4 +10,17 @@ import { TooltipProps } from '@mui/material';
10
10
  * </Tooltip>
11
11
  */
12
12
  export declare function Tooltip({ children, title, enterNextDelay, ...props }: TooltipProps): import("react/jsx-runtime").JSX.Element;
13
+ /**
14
+ * Sets the global default `enterNextDelay` for all Tooltip components in the application.
15
+ *
16
+ * @param delay - Delay in milliseconds before showing tooltips on subsequent hovers.
17
+ *
18
+ * @example
19
+ * ```tsx
20
+ * import { setTooltipEnterDelay } from '@carto/ps-react-ui/components';
21
+ *
22
+ * // Set global delay to 300ms at app initialization
23
+ * setTooltipEnterDelay(300);
24
+ * ```
25
+ */
13
26
  export declare function setTooltipEnterDelay(delay: number): void;
@@ -1,3 +1,19 @@
1
1
  import { ZoomControlProps } from './types';
2
2
  import { JSX } from 'react';
3
+ /**
4
+ * Provides intuitive zoom controls for maps and zoomable interfaces with flexible layouts, loading states, and optional reset functionality.
5
+ *
6
+ * @remarks
7
+ * This is an uncontrolled component. Typically used with the `ZoomControls` HOC from `@carto/ps-react-maps` for automatic state management.
8
+ *
9
+ * @example
10
+ * ```tsx
11
+ * <ZoomControlsUI
12
+ * zoom={zoom}
13
+ * onChange={setZoom}
14
+ * minZoom={2}
15
+ * maxZoom={20}
16
+ * />
17
+ * ```
18
+ */
3
19
  export declare function ZoomControlsUI({ zoom, disabled, direction, reverse, isLoading, maxZoom, minZoom, PaperProps, ResetViewProps, showZoom, onChange, onReset, }: ZoomControlProps): JSX.Element;
@@ -1,9 +1,9 @@
1
1
  /**
2
- * Custom hook for registering a DOM element ref with the widget store.
3
- * This allows other parts of the application to access the widget's DOM element.
2
+ * Registers a DOM element ref and an ECharts instance ref with the widget store.
3
+ * This allows other parts of the application (e.g., screenshot export) to access the widget's DOM element.
4
4
  *
5
- * @param widgetId - The widget ID to register the ref under
6
- * @returns A ref object to attach to the DOM element
5
+ * @param widgetId - The widget ID to register the refs under.
6
+ * @returns An object with `ref` (DOM element) and `instance` (ECharts instance) refs.
7
7
  *
8
8
  * @example
9
9
  * ```tsx
@@ -1,2 +1,13 @@
1
1
  import { DownloadProps } from './types';
2
+ /**
3
+ * Dropdown menu action for exporting widget data in various formats (CSV, PNG, etc.).
4
+ *
5
+ * Reads widget data from the store and triggers downloads using the modifier
6
+ * function defined in each `DownloadItem`.
7
+ *
8
+ * @example
9
+ * ```tsx
10
+ * <Download id={widgetId} items={barDownloadConfig({ refUI })} />
11
+ * ```
12
+ */
2
13
  export declare function Download({ id, items, labels, Icon, IconButtonProps, }: DownloadProps): import("react/jsx-runtime").JSX.Element;
@@ -1,6 +1,21 @@
1
1
  import { Ref } from 'react';
2
2
  import { DownloadItem } from './types';
3
+ /**
4
+ * Pre-configured download item for exporting widget data as a CSV file.
5
+ *
6
+ * Converts a 2D array of data into CSV format with proper escaping and
7
+ * triggers a browser download. Revokes the object URL after download.
8
+ */
3
9
  export declare const downloadToCSV: DownloadItem<unknown[][]>;
10
+ /**
11
+ * Pre-configured download item for exporting a widget as a PNG image.
12
+ *
13
+ * Uses html2canvas to capture the widget DOM element referenced by a React ref.
14
+ * Strips toolbar and action elements before capturing.
15
+ *
16
+ * @remarks
17
+ * The modifier expects a React ref to the widget's root HTML element, not raw data.
18
+ */
4
19
  export declare const downloadToPNG: Omit<DownloadItem, 'modifier'> & {
5
20
  modifier: (ref: Ref<HTMLElement | null> | undefined) => Promise<string | undefined>;
6
21
  };
@@ -1,2 +1,15 @@
1
1
  import { FullScreenProps } from './types';
2
+ /**
3
+ * Displays widget content in a fullscreen modal dialog.
4
+ *
5
+ * Manages fullscreen state via the widget store and renders a MUI Dialog
6
+ * with the widget title and a close button.
7
+ *
8
+ * @example
9
+ * ```tsx
10
+ * <FullScreen id="my-widget" labels={{ ariaLabel: 'Expand chart' }}>
11
+ * <ChartContent id="my-widget" />
12
+ * </FullScreen>
13
+ * ```
14
+ */
2
15
  export declare function FullScreen({ id, labels, children, Icon, IconButtonProps, DialogContentProps: { sx, ...DialogContentProps }, DialogProps, }: FullScreenProps): import("react/jsx-runtime").JSX.Element;
@@ -3,7 +3,7 @@ export type { FullScreenState, FullScreenConfig } from './fullscreen/types';
3
3
  export { Download } from './download/download';
4
4
  export type { DownloadItem, DownloadProps } from './download/types';
5
5
  export { downloadToCSV, downloadToPNG } from './download/exports';
6
- export { RelativeData, RELATIVE_DATA_TOOL_ID, } from './relative-data/relative-data';
6
+ export { RelativeData, RELATIVE_DATA_TOOL_ID, RELATIVE_DATA_CONFIG_TOOL_ID, } from './relative-data/relative-data';
7
7
  export type { RelativeDataProps } from './relative-data/types';
8
8
  export { ZoomToggle, ZOOM_TOGGLE_TOOL_ID } from './zoom-toggle/zoom-toggle';
9
9
  export type { ZoomToggleProps, ZoomState, ZoomConfig, } from './zoom-toggle/types';
@@ -1,5 +1,6 @@
1
1
  import { RelativeDataProps } from './types';
2
2
  export declare const RELATIVE_DATA_TOOL_ID = "relative-data";
3
+ export declare const RELATIVE_DATA_CONFIG_TOOL_ID = "relative-data-config";
3
4
  /**
4
5
  * Widget action to toggle between relative (percentage) and absolute data display.
5
6
  *
@@ -1,5 +1,9 @@
1
- import { BarConfig, BarWidgetConfig, BarWidgetData } from './types';
2
- import { DownloadItem } from '../actions';
3
- import { ConfigProps } from '../loader/types';
4
- export declare function barDownloadConfig({ refUI, }: ConfigProps): DownloadItem<BarWidgetData>[];
1
+ import { BarConfig, BarWidgetConfig } from './types';
2
+ export declare const barDownloadConfig: ({ refUI }: import('../loader').ConfigProps) => import('../actions').DownloadItem<import('../echart').EchartWidgetData>[];
3
+ /**
4
+ * Generates ECharts configuration for bar chart widgets (vertical and horizontal), including axis, tooltip, legend, and series options styled with the CARTO theme.
5
+ *
6
+ * @param props - Bar chart configuration including data and theme.
7
+ * @returns Widget config with ECharts option object.
8
+ */
5
9
  export declare function barConfig(props: BarConfig): BarWidgetConfig;
@@ -1,2 +1,5 @@
1
1
  import { CategoryUIProps } from './types';
2
+ /**
3
+ * Renders a category widget displaying horizontal bars for categorical data with support for single and multi-series layouts, selection, and overflow grouping.
4
+ */
2
5
  export declare function CategoryUI({ id }: CategoryUIProps): import("react/jsx-runtime").JSX.Element | null;
@@ -4,4 +4,7 @@ export interface CategoryBarProps {
4
4
  color: string;
5
5
  selected?: boolean;
6
6
  }
7
+ /**
8
+ * Renders a single horizontal bar fill proportional to its value relative to the maximum.
9
+ */
7
10
  export declare function CategoryBar({ value, maxValue, color, selected, }: CategoryBarProps): import("react/jsx-runtime").JSX.Element;
@@ -3,4 +3,7 @@ export interface CategoryLegendProps {
3
3
  series: CategorySeriesConfig[];
4
4
  colors: string[];
5
5
  }
6
+ /**
7
+ * Renders a color-coded legend for multi-series category widgets.
8
+ */
6
9
  export declare function CategoryLegend({ series, colors }: CategoryLegendProps): import("react/jsx-runtime").JSX.Element | null;
@@ -8,4 +8,7 @@ export interface CategoryRowMultiProps {
8
8
  onClick?: CategoryWidgetConfig['onRowClick'];
9
9
  selected?: boolean;
10
10
  }
11
+ /**
12
+ * Renders a multi-series category row with a label and multiple color-coded bars stacked vertically.
13
+ */
11
14
  export declare function CategoryRowMulti({ name, values, maxValue, colors, formatter, onClick, selected, }: CategoryRowMultiProps): import("react/jsx-runtime").JSX.Element;
@@ -3,4 +3,7 @@ export interface CategoryRowOtherProps {
3
3
  otherLabel?: string;
4
4
  otherCountLabel?: string;
5
5
  }
6
+ /**
7
+ * Renders an "Other" summary row indicating how many additional categories are hidden beyond `maxItems`.
8
+ */
6
9
  export declare function CategoryRowOther({ hiddenCount, otherLabel, otherCountLabel, }: CategoryRowOtherProps): import("react/jsx-runtime").JSX.Element;
@@ -8,4 +8,7 @@ export interface CategoryRowSingleProps {
8
8
  onClick?: CategoryWidgetConfig['onRowClick'];
9
9
  selected?: boolean;
10
10
  }
11
+ /**
12
+ * Renders a single-series category row with a label, formatted value, and proportional bar.
13
+ */
11
14
  export declare function CategoryRowSingle({ name, value, maxValue, color, formatter, onClick, selected, }: CategoryRowSingleProps): import("react/jsx-runtime").JSX.Element;
@@ -4,6 +4,17 @@ import { CategoryWidgetConfig, CategoryWidgetData, CategorySeriesConfig } from '
4
4
  interface CategoryDownloadConfigProps extends ConfigProps {
5
5
  series?: CategorySeriesConfig[];
6
6
  }
7
+ /**
8
+ * Creates download configuration for category widgets, supporting PNG (screenshot) and CSV (data) exports. CSV output groups values by category across multiple series.
9
+ *
10
+ * @param props - Configuration with `refUI` reference and optional `series` for CSV column headers.
11
+ * @returns Array of download items for use with the Download action.
12
+ */
7
13
  export declare function categoryDownloadConfig({ refUI, series, }: CategoryDownloadConfigProps): DownloadItem<CategoryWidgetData>[];
14
+ /**
15
+ * Returns the default configuration for category list widgets, including empty series and a default `maxItems` of 10.
16
+ *
17
+ * @returns Default category widget config.
18
+ */
8
19
  export declare function categoryConfig(): CategoryWidgetConfig;
9
20
  export {};
@@ -1,2 +1,9 @@
1
1
  import { EchartUIProps } from './types';
2
+ /**
3
+ * Presentational component that initializes and manages an Apache ECharts instance.
4
+ *
5
+ * @remarks
6
+ * Handles chart lifecycle (init, dispose), option updates, resize observation, and event listener management.
7
+ * Uses SVG renderer with a default height of 304px.
8
+ */
2
9
  export declare function EchartUI(props: EchartUIProps): import("react/jsx-runtime").JSX.Element;
@@ -1,2 +1,8 @@
1
1
  import { EchartProps } from './types';
2
+ /**
3
+ * Stateful EChart widget component that reads data and options from the widget store and renders an ECharts chart.
4
+ *
5
+ * @remarks
6
+ * Transforms widget data into ECharts dataset format and delegates rendering to {@link EchartUI}.
7
+ */
2
8
  export declare function Echart(props: EchartProps): import("react/jsx-runtime").JSX.Element | null;
@@ -1,2 +1,9 @@
1
1
  import { EchartOptionsProps, EchartWidgetOptionProps } from './types';
2
+ /**
3
+ * Returns the shared base ECharts options used across all EChart-based widgets (bar, pie, histogram, etc.).
4
+ *
5
+ * @remarks
6
+ * Configures grid spacing, tooltip styling, legend, axis pointer, and the default color palette
7
+ * derived from the MUI theme.
8
+ */
2
9
  export declare function getCommonOptions({ theme, }: EchartWidgetOptionProps<unknown>): EchartOptionsProps;
@@ -32,4 +32,5 @@ export interface EchartWidgetProps {
32
32
  type: string;
33
33
  option: EchartUIProps['option'];
34
34
  onEvents?: EchartUIProps['onEvents'];
35
+ formatter?: (value: number) => string;
35
36
  }
@@ -1,6 +1,35 @@
1
1
  import { EchartOptionsProps } from './types';
2
2
  import { Theme } from '@mui/material';
3
+ /**
4
+ * Deep-merges two ECharts option objects with smart handling for `color`, `axisLabel`, and `series` keys.
5
+ *
6
+ * @param optionA - Base ECharts options.
7
+ * @param optionB - Override ECharts options to merge on top.
8
+ * @param customMergeFn - Optional function returning a custom merge strategy per key.
9
+ * @returns The merged ECharts options object.
10
+ *
11
+ * @remarks
12
+ * - `color` arrays are replaced entirely (not concatenated).
13
+ * - `axisLabel` formatters are composed so the base formatter can suppress values by returning `''`.
14
+ * - `series` arrays are merged element-by-element rather than concatenated.
15
+ *
16
+ * @example
17
+ * ```tsx
18
+ * const option = mergeEchartWidgetConfig(props.option, {
19
+ * series: [{ barWidth: '60%', itemStyle: { borderRadius: [4, 4, 0, 0] } }],
20
+ * tooltip: { trigger: 'axis' },
21
+ * })
22
+ * ```
23
+ */
3
24
  export declare function mergeEchartWidgetConfig<T extends EchartOptionsProps>(optionA: T | undefined, optionB: T | undefined, customMergeFn?: (key: string) => ((a: unknown, b: unknown) => unknown) | undefined): T;
25
+ /**
26
+ * Generates ECharts `dataZoom` configuration for interactive zoom and pan on chart axes.
27
+ *
28
+ * @param range - Initial visible range as `{ start, end }` percentages (0-100). Defaults to full range.
29
+ * @param options - Zoom behavior options including axis sliders, inside zoom, and formatter.
30
+ * @param theme - Optional MUI theme for styled slider handles and backgrounds.
31
+ * @returns An object containing the `dataZoom` array configuration.
32
+ */
4
33
  export declare function getEChartZoomConfig({ start, end }?: {
5
34
  start: number;
6
35
  end: number;
@@ -68,6 +97,12 @@ export declare function getEChartZoomConfig({ start, end }?: {
68
97
  orientation?: undefined;
69
98
  })[];
70
99
  };
100
+ /**
101
+ * Generates ECharts `brush` configuration for interactive data selection on charts.
102
+ *
103
+ * @param options - Brush options including type, mode, and target axis index.
104
+ * @returns An object containing the `brush` configuration.
105
+ */
71
106
  export declare function getEChartBrushConfig({ brushType, brushMode, xAxisIndex }?: {
72
107
  brushType?: string;
73
108
  brushMode?: string;
@@ -82,6 +117,12 @@ export declare function getEChartBrushConfig({ brushType, brushMode, xAxisIndex
82
117
  xAxisIndex: number;
83
118
  };
84
119
  };
120
+ /**
121
+ * Returns an ECharts `stack` configuration to group series into a stacked layout.
122
+ *
123
+ * @param stackGroup - The stack group identifier. Defaults to the library's default group.
124
+ * @returns An object with the `stack` property set to the group name.
125
+ */
85
126
  export declare function getEChartStackConfig(stackGroup?: string): {
86
127
  stack: string;
87
128
  };
@@ -1,2 +1,12 @@
1
1
  import { WidgetErrorProps } from './types';
2
+ /**
3
+ * Displays an error alert when a widget encounters an error during data loading. Reads error state from the widget store and hides errors during loading/fetching to prevent flashing.
4
+ *
5
+ * @example
6
+ * ```tsx
7
+ * <WidgetError id="my-widget">
8
+ * <WidgetContent />
9
+ * </WidgetError>
10
+ * ```
11
+ */
2
12
  export declare function WidgetError({ id, children, title: titleProp, description, }: WidgetErrorProps): string | number | bigint | boolean | Iterable<import('react').ReactNode> | Promise<string | number | bigint | boolean | import('react').ReactPortal | import('react').ReactElement<unknown, string | import('react').JSXElementConstructor<any>> | Iterable<import('react').ReactNode> | null | undefined> | import("react/jsx-runtime").JSX.Element | null | undefined;
@@ -1,2 +1,5 @@
1
1
  import { ItemProps } from '../types';
2
+ /**
3
+ * Base typography wrapper used by formula sub-components (Value, Prefix, Suffix) to render styled text.
4
+ */
2
5
  export declare function Item(props: ItemProps): import("react/jsx-runtime").JSX.Element;
@@ -1,2 +1,5 @@
1
1
  import { ValueProps } from '../types';
2
+ /**
3
+ * Renders the prefix content (e.g., currency symbol) before a formula value, if defined in the data item.
4
+ */
2
5
  export declare function Prefix({ id, index, ...props }: ValueProps): import("react/jsx-runtime").JSX.Element | null;
@@ -1,2 +1,5 @@
1
1
  import { RowProps } from '../types';
2
+ /**
3
+ * Iterates over the widget's data items and renders a row for each one using render props.
4
+ */
2
5
  export declare function Row(props: RowProps): import("react/jsx-runtime").JSX.Element[] | undefined;
@@ -1,2 +1,5 @@
1
1
  import { ValueProps } from '../types';
2
+ /**
3
+ * Renders a colored avatar badge showing the first letter of the series name for multi-value formula widgets.
4
+ */
2
5
  export declare function Series({ id, index }: Pick<ValueProps, 'id' | 'index'>): import("react/jsx-runtime").JSX.Element | null;
@@ -1,2 +1,5 @@
1
1
  import { ValueProps } from '../types';
2
+ /**
3
+ * Renders the suffix content (e.g., unit label) after a formula value, if defined in the data item.
4
+ */
2
5
  export declare function Suffix({ id, index, ...props }: ValueProps): import("react/jsx-runtime").JSX.Element | null;
@@ -1,2 +1,5 @@
1
1
  import { ValueProps } from '../types';
2
+ /**
3
+ * Displays the formatted numeric value for a formula widget data item, applying the widget's formatter and color.
4
+ */
2
5
  export declare function Value({ id, index, ...props }: ValueProps): import("react/jsx-runtime").JSX.Element;
@@ -1,4 +1,15 @@
1
1
  import { ConfigProps } from '../loader/types';
2
2
  import { FormulaDownloadConfig, FormulaWidgetConfig } from './types';
3
+ /**
4
+ * Creates download configuration for formula widgets, supporting PNG (screenshot) and CSV (data) exports.
5
+ *
6
+ * @param props - Configuration with `refUI` reference for PNG export.
7
+ * @returns Array of download items for use with the Download action.
8
+ */
3
9
  export declare function formulaDownloadConfig({ refUI, }: ConfigProps): FormulaDownloadConfig;
10
+ /**
11
+ * Returns the default configuration for formula (single or multiple numeric value) widgets.
12
+ *
13
+ * @returns Default formula widget config with empty series.
14
+ */
4
15
  export declare function formulaConfig(): FormulaWidgetConfig;
@@ -1,2 +1,5 @@
1
1
  import { FormulaUIProps } from './types';
2
+ /**
3
+ * Renders a formula widget displaying one or more KPI values with optional prefixes, suffixes, and series indicators.
4
+ */
2
5
  export declare function FormulaUI(props: FormulaUIProps): import("react/jsx-runtime").JSX.Element;
@@ -1,5 +1,9 @@
1
- import { HistogramConfig, HistogramWidgetConfig, HistogramWidgetData } from './types';
2
- import { DownloadItem } from '../actions';
3
- import { ConfigProps } from '../loader/types';
4
- export declare function histogramDownloadConfig({ refUI, }: ConfigProps): DownloadItem<HistogramWidgetData>[];
1
+ import { HistogramConfig, HistogramWidgetConfig } from './types';
2
+ export declare const histogramDownloadConfig: ({ refUI }: import('../loader').ConfigProps) => import('../actions').DownloadItem<import('../echart').EchartWidgetData>[];
3
+ /**
4
+ * Generates ECharts configuration for distribution histogram widgets with adjacent bars (minimal gap) and axis formatting styled with the CARTO theme.
5
+ *
6
+ * @param props - Histogram configuration including bin data and theme.
7
+ * @returns Widget config with ECharts option object.
8
+ */
5
9
  export declare function histogramConfig(props: HistogramConfig): HistogramWidgetConfig;