@carto/ps-react-ui 4.2.7 → 4.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (267) hide show
  1. package/dist/cjs-D4KH3azB.js +85 -0
  2. package/dist/cjs-D4KH3azB.js.map +1 -0
  3. package/dist/components.js +770 -1415
  4. package/dist/components.js.map +1 -1
  5. package/dist/error-B2IJ9d2h.js +38 -0
  6. package/dist/error-B2IJ9d2h.js.map +1 -0
  7. package/dist/exports-Cr43OCul.js +51 -0
  8. package/dist/exports-Cr43OCul.js.map +1 -0
  9. package/dist/lasso-tool-BwRzEW7k.js +534 -0
  10. package/dist/lasso-tool-BwRzEW7k.js.map +1 -0
  11. package/dist/no-data-C54XJt13.js +61 -0
  12. package/dist/no-data-C54XJt13.js.map +1 -0
  13. package/dist/note-t51drNe0.js +124 -0
  14. package/dist/note-t51drNe0.js.map +1 -0
  15. package/dist/options-D9wflre6.js +49 -0
  16. package/dist/options-D9wflre6.js.map +1 -0
  17. package/dist/row-DrHwXNvF.js +35 -0
  18. package/dist/row-DrHwXNvF.js.map +1 -0
  19. package/dist/series-D3Pc-kYX.js +91 -0
  20. package/dist/series-D3Pc-kYX.js.map +1 -0
  21. package/dist/smart-tooltip-BEtBaIdz.js +39 -0
  22. package/dist/smart-tooltip-BEtBaIdz.js.map +1 -0
  23. package/dist/styles-CCZnY17y.js +117 -0
  24. package/dist/styles-CCZnY17y.js.map +1 -0
  25. package/dist/tooltip-BDnrRKrp.js +25 -0
  26. package/dist/tooltip-BDnrRKrp.js.map +1 -0
  27. package/dist/types/components/measurement-tools/styles.d.ts +13 -4
  28. package/dist/types/hooks/index.d.ts +2 -0
  29. package/dist/types/hooks/use-debounce.d.ts +19 -0
  30. package/dist/types/hooks/use-widget-ref.d.ts +17 -0
  31. package/dist/types/widgets/_shared/chart-config/config-factory.d.ts +38 -0
  32. package/dist/types/widgets/_shared/chart-config/csv-modifiers.d.ts +19 -0
  33. package/dist/types/widgets/_shared/chart-config/index.d.ts +7 -0
  34. package/dist/types/widgets/_shared/chart-config/option-builders.d.ts +85 -0
  35. package/dist/types/widgets/_shared/skeleton/index.d.ts +4 -0
  36. package/dist/types/widgets/_shared/skeleton/styles.d.ts +19 -0
  37. package/dist/types/widgets/actions/change-column/change-column-icon.d.ts +1 -0
  38. package/dist/types/widgets/actions/change-column/change-column.d.ts +16 -0
  39. package/dist/types/widgets/actions/change-column/sortable-column-item.d.ts +9 -0
  40. package/dist/types/widgets/actions/change-column/types.d.ts +19 -0
  41. package/dist/types/widgets/actions/download/download.d.ts +2 -0
  42. package/dist/types/widgets/actions/download/exports.d.ts +6 -0
  43. package/dist/types/widgets/actions/download/types.d.ts +21 -0
  44. package/dist/types/widgets/actions/fullscreen/fullscreen.d.ts +2 -0
  45. package/dist/types/widgets/actions/fullscreen/styles.d.ts +16 -0
  46. package/dist/types/widgets/actions/fullscreen/types.d.ts +20 -0
  47. package/dist/types/widgets/actions/index.d.ts +18 -0
  48. package/dist/types/widgets/actions/lock-selection/lock-selection.d.ts +19 -0
  49. package/dist/types/widgets/actions/lock-selection/types.d.ts +36 -0
  50. package/dist/types/widgets/actions/relative-data/relative-data.d.ts +18 -0
  51. package/dist/types/widgets/actions/relative-data/style.d.ts +8 -0
  52. package/dist/types/widgets/actions/relative-data/types.d.ts +27 -0
  53. package/dist/types/widgets/actions/relative-data/utils.d.ts +9 -0
  54. package/dist/types/widgets/actions/relative-data/utils.test.d.ts +1 -0
  55. package/dist/types/widgets/actions/searcher/searcher-toggle.d.ts +18 -0
  56. package/dist/types/widgets/actions/searcher/searcher.d.ts +21 -0
  57. package/dist/types/widgets/actions/searcher/types.d.ts +64 -0
  58. package/dist/types/widgets/actions/shared/styles.d.ts +11 -0
  59. package/dist/types/widgets/actions/stack-toggle/grouped-bar-chart-icon.d.ts +1 -0
  60. package/dist/types/widgets/actions/stack-toggle/stack-toggle.d.ts +16 -0
  61. package/dist/types/widgets/actions/stack-toggle/types.d.ts +25 -0
  62. package/dist/types/widgets/actions/zoom-toggle/index.d.ts +2 -0
  63. package/dist/types/widgets/actions/zoom-toggle/style.d.ts +13 -0
  64. package/dist/types/widgets/actions/zoom-toggle/types.d.ts +41 -0
  65. package/dist/types/widgets/actions/zoom-toggle/zoom-toggle.d.ts +18 -0
  66. package/dist/types/widgets/bar/config.d.ts +5 -0
  67. package/dist/types/widgets/bar/index.d.ts +3 -0
  68. package/dist/types/widgets/bar/skeleton.d.ts +1 -0
  69. package/dist/types/widgets/bar/style.d.ts +37 -0
  70. package/dist/types/widgets/bar/types.d.ts +9 -0
  71. package/dist/types/widgets/category/category-ui.d.ts +2 -0
  72. package/dist/types/widgets/category/components/category-bar.d.ts +7 -0
  73. package/dist/types/widgets/category/components/category-legend.d.ts +6 -0
  74. package/dist/types/widgets/category/components/category-row-multi.d.ts +11 -0
  75. package/dist/types/widgets/category/components/category-row-other.d.ts +6 -0
  76. package/dist/types/widgets/category/components/category-row-single.d.ts +11 -0
  77. package/dist/types/widgets/category/components/index.d.ts +10 -0
  78. package/dist/types/widgets/category/config.d.ts +16 -0
  79. package/dist/types/widgets/category/index.d.ts +6 -0
  80. package/dist/types/widgets/category/skeleton.d.ts +1 -0
  81. package/dist/types/widgets/category/style.d.ts +120 -0
  82. package/dist/types/widgets/category/types.d.ts +34 -0
  83. package/dist/types/widgets/echart/const.d.ts +1 -0
  84. package/dist/types/widgets/echart/echart-ui.d.ts +2 -0
  85. package/dist/types/widgets/echart/echart.d.ts +2 -0
  86. package/dist/types/widgets/echart/index.d.ts +5 -0
  87. package/dist/types/widgets/echart/options.d.ts +2 -0
  88. package/dist/types/widgets/echart/types.d.ts +34 -0
  89. package/dist/types/widgets/echart/utils.d.ts +80 -0
  90. package/dist/types/widgets/error/error.d.ts +2 -0
  91. package/dist/types/widgets/error/index.d.ts +2 -0
  92. package/dist/types/widgets/error/types.d.ts +12 -0
  93. package/dist/types/widgets/formula/components/item.d.ts +2 -0
  94. package/dist/types/widgets/formula/components/prefix.d.ts +2 -0
  95. package/dist/types/widgets/formula/components/row.d.ts +2 -0
  96. package/dist/types/widgets/formula/components/series.d.ts +2 -0
  97. package/dist/types/widgets/formula/components/suffix.d.ts +2 -0
  98. package/dist/types/widgets/formula/components/value.d.ts +2 -0
  99. package/dist/types/widgets/formula/config.d.ts +4 -0
  100. package/dist/types/widgets/formula/formula-ui.d.ts +2 -0
  101. package/dist/types/widgets/formula/index.d.ts +11 -0
  102. package/dist/types/widgets/formula/serializer.d.ts +16 -0
  103. package/dist/types/widgets/formula/skeleton.d.ts +1 -0
  104. package/dist/types/widgets/formula/style.d.ts +21 -0
  105. package/dist/types/widgets/formula/types.d.ts +42 -0
  106. package/dist/types/widgets/histogram/config.d.ts +5 -0
  107. package/dist/types/widgets/histogram/index.d.ts +3 -0
  108. package/dist/types/widgets/histogram/skeleton.d.ts +1 -0
  109. package/dist/types/widgets/histogram/style.d.ts +15 -0
  110. package/dist/types/widgets/histogram/types.d.ts +9 -0
  111. package/dist/types/widgets/index.d.ts +9 -1
  112. package/dist/types/widgets/loader/index.d.ts +3 -0
  113. package/dist/types/widgets/loader/loader.d.ts +2 -0
  114. package/dist/types/widgets/loader/types.d.ts +9 -0
  115. package/dist/types/widgets/loader/utils.d.ts +1 -0
  116. package/dist/types/widgets/markdown/config.d.ts +4 -0
  117. package/dist/types/widgets/markdown/index.d.ts +5 -0
  118. package/dist/types/widgets/markdown/markdown-ui.d.ts +2 -0
  119. package/dist/types/widgets/markdown/markdown.d.ts +2 -0
  120. package/dist/types/widgets/markdown/skeleton.d.ts +1 -0
  121. package/dist/types/widgets/markdown/style.d.ts +2 -0
  122. package/dist/types/widgets/markdown/types.d.ts +18 -0
  123. package/dist/types/widgets/no-data/index.d.ts +2 -0
  124. package/dist/types/widgets/no-data/no-data.d.ts +35 -0
  125. package/dist/types/widgets/no-data/style.d.ts +6 -0
  126. package/dist/types/widgets/no-data/types.d.ts +67 -0
  127. package/dist/types/widgets/note/index.d.ts +2 -0
  128. package/dist/types/widgets/note/note.d.ts +2 -0
  129. package/dist/types/widgets/note/style.d.ts +28 -0
  130. package/dist/types/widgets/note/types.d.ts +8 -0
  131. package/dist/types/widgets/pie/config.d.ts +5 -0
  132. package/dist/types/widgets/pie/index.d.ts +3 -0
  133. package/dist/types/widgets/pie/skeleton.d.ts +1 -0
  134. package/dist/types/widgets/pie/style.d.ts +15 -0
  135. package/dist/types/widgets/pie/types.d.ts +9 -0
  136. package/dist/types/widgets/range/components/range-item.d.ts +2 -0
  137. package/dist/types/widgets/range/config.d.ts +6 -0
  138. package/dist/types/widgets/range/index.d.ts +6 -0
  139. package/dist/types/widgets/range/range-ui.d.ts +2 -0
  140. package/dist/types/widgets/range/serializer.d.ts +16 -0
  141. package/dist/types/widgets/range/serializer.test.d.ts +1 -0
  142. package/dist/types/widgets/range/skeleton.d.ts +1 -0
  143. package/dist/types/widgets/range/style.d.ts +2 -0
  144. package/dist/types/widgets/range/types.d.ts +33 -0
  145. package/dist/types/widgets/scatterplot/config.d.ts +5 -0
  146. package/dist/types/widgets/scatterplot/index.d.ts +3 -0
  147. package/dist/types/widgets/scatterplot/skeleton.d.ts +1 -0
  148. package/dist/types/widgets/scatterplot/style.d.ts +24 -0
  149. package/dist/types/widgets/scatterplot/types.d.ts +9 -0
  150. package/dist/types/widgets/selection-summary/index.d.ts +2 -0
  151. package/dist/types/widgets/selection-summary/selection-summary.d.ts +2 -0
  152. package/dist/types/widgets/selection-summary/style.d.ts +9 -0
  153. package/dist/types/widgets/selection-summary/types.d.ts +13 -0
  154. package/dist/types/widgets/skeleton-loader/index.d.ts +2 -0
  155. package/dist/types/widgets/skeleton-loader/skeleton-loader.d.ts +2 -0
  156. package/dist/types/widgets/skeleton-loader/types.d.ts +7 -0
  157. package/dist/types/widgets/spread/components/max-value.d.ts +2 -0
  158. package/dist/types/widgets/spread/components/min-value.d.ts +2 -0
  159. package/dist/types/widgets/spread/components/separator.d.ts +2 -0
  160. package/dist/types/widgets/spread/config.d.ts +10 -0
  161. package/dist/types/widgets/spread/index.d.ts +9 -0
  162. package/dist/types/widgets/spread/skeleton.d.ts +1 -0
  163. package/dist/types/widgets/spread/spread-ui.d.ts +2 -0
  164. package/dist/types/widgets/spread/style.d.ts +21 -0
  165. package/dist/types/widgets/spread/types.d.ts +40 -0
  166. package/dist/types/widgets/stores/index.d.ts +2 -0
  167. package/dist/types/widgets/stores/types.d.ts +165 -0
  168. package/dist/types/widgets/stores/widget-store.d.ts +39 -0
  169. package/dist/types/widgets/stores/widget-store.test.d.ts +1 -0
  170. package/dist/types/widgets/subheader/index.d.ts +2 -0
  171. package/dist/types/widgets/subheader/style.d.ts +19 -0
  172. package/dist/types/widgets/subheader/subheader.d.ts +2 -0
  173. package/dist/types/widgets/subheader/types.d.ts +10 -0
  174. package/dist/types/widgets/table/components/cell-header.d.ts +5 -0
  175. package/dist/types/widgets/table/components/cell.d.ts +16 -0
  176. package/dist/types/widgets/table/components/index.d.ts +4 -0
  177. package/dist/types/widgets/table/components/pagination-actions.d.ts +5 -0
  178. package/dist/types/widgets/table/components/pagination.d.ts +5 -0
  179. package/dist/types/widgets/table/components/row.d.ts +5 -0
  180. package/dist/types/widgets/table/config.d.ts +17 -0
  181. package/dist/types/widgets/table/helpers.d.ts +38 -0
  182. package/dist/types/widgets/table/helpers.test.d.ts +1 -0
  183. package/dist/types/widgets/table/hooks/index.d.ts +6 -0
  184. package/dist/types/widgets/table/hooks/use-pagination.d.ts +33 -0
  185. package/dist/types/widgets/table/hooks/use-pagination.test.d.ts +1 -0
  186. package/dist/types/widgets/table/hooks/use-selection.d.ts +30 -0
  187. package/dist/types/widgets/table/hooks/use-selection.test.d.ts +1 -0
  188. package/dist/types/widgets/table/hooks/use-sort.d.ts +22 -0
  189. package/dist/types/widgets/table/hooks/use-sort.test.d.ts +1 -0
  190. package/dist/types/widgets/table/index.d.ts +13 -0
  191. package/dist/types/widgets/table/serializer.d.ts +16 -0
  192. package/dist/types/widgets/table/skeleton.d.ts +10 -0
  193. package/dist/types/widgets/table/style.d.ts +33 -0
  194. package/dist/types/widgets/table/table-ui.d.ts +32 -0
  195. package/dist/types/widgets/table/types.d.ts +196 -0
  196. package/dist/types/widgets/timeseries/config.d.ts +5 -0
  197. package/dist/types/widgets/timeseries/index.d.ts +3 -0
  198. package/dist/types/widgets/timeseries/skeleton.d.ts +1 -0
  199. package/dist/types/widgets/timeseries/style.d.ts +38 -0
  200. package/dist/types/widgets/timeseries/types.d.ts +9 -0
  201. package/dist/types/widgets/toolbar-actions/index.d.ts +2 -0
  202. package/dist/types/widgets/toolbar-actions/styles.d.ts +37 -0
  203. package/dist/types/widgets/toolbar-actions/toolbar-actions.d.ts +8 -0
  204. package/dist/types/widgets/toolbar-actions/types.d.ts +45 -0
  205. package/dist/types/widgets/wrapper/components/actions.d.ts +2 -0
  206. package/dist/types/widgets/wrapper/components/options.d.ts +2 -0
  207. package/dist/types/widgets/wrapper/components/title.d.ts +6 -0
  208. package/dist/types/widgets/wrapper/index.d.ts +6 -0
  209. package/dist/types/widgets/wrapper/styles.d.ts +89 -0
  210. package/dist/types/widgets/wrapper/types.d.ts +37 -0
  211. package/dist/types/widgets/wrapper/wrapper-ui.d.ts +2 -0
  212. package/dist/types/widgets/wrapper/wrapper.d.ts +2 -0
  213. package/dist/use-widget-ref-B0aNCANx.js +19 -0
  214. package/dist/use-widget-ref-B0aNCANx.js.map +1 -0
  215. package/dist/utils-D3-eQyDR.js +144 -0
  216. package/dist/utils-D3-eQyDR.js.map +1 -0
  217. package/dist/widget-store-CB6Trp_0.js +131 -0
  218. package/dist/widget-store-CB6Trp_0.js.map +1 -0
  219. package/dist/widgets/actions.js +872 -0
  220. package/dist/widgets/actions.js.map +1 -0
  221. package/dist/widgets/bar.js +188 -0
  222. package/dist/widgets/bar.js.map +1 -0
  223. package/dist/widgets/category.js +427 -0
  224. package/dist/widgets/category.js.map +1 -0
  225. package/dist/widgets/echart.js +115 -0
  226. package/dist/widgets/echart.js.map +1 -0
  227. package/dist/widgets/error.js +5 -0
  228. package/dist/widgets/error.js.map +1 -0
  229. package/dist/widgets/formula.js +119 -0
  230. package/dist/widgets/formula.js.map +1 -0
  231. package/dist/widgets/histogram.js +186 -0
  232. package/dist/widgets/histogram.js.map +1 -0
  233. package/dist/widgets/loader.js +57 -0
  234. package/dist/widgets/loader.js.map +1 -0
  235. package/dist/widgets/markdown.js +127 -0
  236. package/dist/widgets/markdown.js.map +1 -0
  237. package/dist/widgets/no-data.js +5 -0
  238. package/dist/widgets/no-data.js.map +1 -0
  239. package/dist/widgets/note.js +5 -0
  240. package/dist/widgets/note.js.map +1 -0
  241. package/dist/widgets/pie.js +230 -0
  242. package/dist/widgets/pie.js.map +1 -0
  243. package/dist/widgets/range.js +217 -0
  244. package/dist/widgets/range.js.map +1 -0
  245. package/dist/widgets/scatterplot.js +233 -0
  246. package/dist/widgets/scatterplot.js.map +1 -0
  247. package/dist/widgets/selection-summary.js +40 -0
  248. package/dist/widgets/selection-summary.js.map +1 -0
  249. package/dist/widgets/skeleton-loader.js +24 -0
  250. package/dist/widgets/skeleton-loader.js.map +1 -0
  251. package/dist/widgets/spread.js +161 -0
  252. package/dist/widgets/spread.js.map +1 -0
  253. package/dist/widgets/stores.js +5 -0
  254. package/dist/widgets/stores.js.map +1 -0
  255. package/dist/widgets/subheader.js +52 -0
  256. package/dist/widgets/subheader.js.map +1 -0
  257. package/dist/widgets/table.js +672 -0
  258. package/dist/widgets/table.js.map +1 -0
  259. package/dist/widgets/timeseries.js +187 -0
  260. package/dist/widgets/timeseries.js.map +1 -0
  261. package/dist/widgets/toolbar-actions.js +6725 -0
  262. package/dist/widgets/toolbar-actions.js.map +1 -0
  263. package/dist/widgets/wrapper.js +295 -0
  264. package/dist/widgets/wrapper.js.map +1 -0
  265. package/dist/widgets.js +12 -1
  266. package/dist/widgets.js.map +1 -1
  267. package/package.json +114 -4
@@ -0,0 +1,16 @@
1
+ import { RangeDataItem } from './types';
2
+ /**
3
+ * Sanitizes RangeDataItem by converting ReactNode note values to undefined.
4
+ * This ensures only string values are stored in the widget state.
5
+ *
6
+ * @param item - The RangeDataItem to sanitize
7
+ * @returns A new RangeDataItem with ReactNode note values converted to undefined
8
+ */
9
+ export declare function sanitizeRangeDataItem(item: RangeDataItem): RangeDataItem;
10
+ /**
11
+ * Sanitizes an array of RangeDataItems by converting ReactNode note values to undefined.
12
+ *
13
+ * @param items - Array of RangeDataItems to sanitize
14
+ * @returns A new array with sanitized RangeDataItems
15
+ */
16
+ export declare function sanitizeRangeDataItems(items: RangeDataItem[] | undefined): RangeDataItem[] | undefined;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export declare function RangeSkeleton(): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,2 @@
1
+ import { SxProps, Theme } from '@mui/material';
2
+ export declare const styles: Record<string, SxProps<Theme>>;
@@ -0,0 +1,33 @@
1
+ import { ReactNode } from 'react';
2
+ import { BaseWidgetState, WidgetsStoreProps } from '../stores/types';
3
+ import { WrapperState } from '../wrapper/types';
4
+ import { DownloadItem } from '../actions/download/types';
5
+ export interface RangeUIProps {
6
+ id: WidgetsStoreProps['id'];
7
+ }
8
+ export interface RangeDataItem {
9
+ min: number;
10
+ max: number;
11
+ value?: number[];
12
+ step?: number;
13
+ marks?: boolean | {
14
+ value: number;
15
+ label?: string;
16
+ }[];
17
+ disabled?: boolean;
18
+ color?: string;
19
+ note?: string | ReactNode;
20
+ }
21
+ export interface RangeItemProps {
22
+ id: WidgetsStoreProps['id'];
23
+ index: number;
24
+ }
25
+ export type RangeWidgetData = RangeDataItem[];
26
+ export type RangeWidgetState = BaseWidgetState<WrapperState<RangeWidgetConfig>> & {
27
+ data: RangeWidgetData;
28
+ };
29
+ export interface RangeWidgetConfig {
30
+ formatter?: (value: number) => string;
31
+ onChange?: (value: number[], index: number) => void;
32
+ }
33
+ export type RangeDownloadConfig = DownloadItem<RangeWidgetData>[];
@@ -0,0 +1,5 @@
1
+ import { ScatterplotConfig, ScatterplotWidgetConfig, ScatterplotWidgetData } from './types';
2
+ import { DownloadItem } from '../actions';
3
+ import { ConfigProps } from '../loader/types';
4
+ export declare function scatterplotDownloadConfig({ refUI, }: ConfigProps): DownloadItem<ScatterplotWidgetData>[];
5
+ export declare function scatterplotConfig(props: ScatterplotConfig): ScatterplotWidgetConfig;
@@ -0,0 +1,3 @@
1
+ export type { ScatterplotWidgetData, ScatterplotWidgetState, ScatterplotWidgetConfig, ScatterplotConfig, } from './types';
2
+ export { scatterplotConfig, scatterplotDownloadConfig } from './config';
3
+ export { ScatterplotSkeleton } from './skeleton';
@@ -0,0 +1 @@
1
+ export declare function ScatterplotSkeleton(): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,24 @@
1
+ import { Theme } from '@mui/material';
2
+ export declare const styles: {
3
+ skeleton: {
4
+ graph: {
5
+ container: {
6
+ position: "relative";
7
+ display: "flex";
8
+ alignItems: "center";
9
+ justifyContent: "space-between";
10
+ flexDirection: "column";
11
+ gap: ({ spacing }: Theme) => string;
12
+ height: ({ spacing }: Theme) => string;
13
+ };
14
+ };
15
+ legend: {
16
+ display: "flex";
17
+ alignItems: "center";
18
+ gap: ({ spacing }: Theme) => string;
19
+ height: ({ spacing }: Theme) => string;
20
+ position: "absolute";
21
+ bottom: number;
22
+ };
23
+ };
24
+ };
@@ -0,0 +1,9 @@
1
+ import { EchartWidgetState } from '../echart';
2
+ import { EchartWidgetOptionProps, EchartWidgetProps } from '../echart/types';
3
+ import { ConfigProps } from '../loader';
4
+ export type ScatterplotWidgetData = [number, number][][];
5
+ export type ScatterplotWidgetState = EchartWidgetState;
6
+ export type ScatterplotWidgetConfig = EchartWidgetProps & {
7
+ type: 'scatterplot';
8
+ };
9
+ export type ScatterplotConfig = ConfigProps & EchartWidgetOptionProps<ScatterplotWidgetData>;
@@ -0,0 +1,2 @@
1
+ export { WidgetSelectionSummary } from './selection-summary';
2
+ export type { WidgetSelectionSummaryProps, SelectionSummaryLabels, } from './types';
@@ -0,0 +1,2 @@
1
+ import { WidgetSelectionSummaryProps } from './types';
2
+ export declare function WidgetSelectionSummary({ selections, onClear, labels, }: WidgetSelectionSummaryProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,9 @@
1
+ import { Theme } from '@mui/material';
2
+ export declare const styles: {
3
+ root: {
4
+ display: "flex";
5
+ alignItems: "center";
6
+ flex: string;
7
+ gap: ({ spacing }: Theme) => string;
8
+ };
9
+ };
@@ -0,0 +1,13 @@
1
+ export interface WidgetSelectionSummaryProps {
2
+ selections: number;
3
+ onClear?: () => void;
4
+ labels?: Partial<SelectionSummaryLabels>;
5
+ }
6
+ export interface SelectionSummaryLabels {
7
+ /** Label for "All selected" state */
8
+ allSelected: string;
9
+ /** Label for number of selections */
10
+ selections: (count: number) => string;
11
+ /** Label for clear button */
12
+ clear: string;
13
+ }
@@ -0,0 +1,2 @@
1
+ export { SkeletonLoader } from './skeleton-loader';
2
+ export type { SkeletonLoaderProps } from './types';
@@ -0,0 +1,2 @@
1
+ import { SkeletonLoaderProps } from './types';
2
+ export declare function SkeletonLoader({ id, children, Skeleton, }: SkeletonLoaderProps): 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;
@@ -0,0 +1,7 @@
1
+ import { ElementType, ReactNode } from 'react';
2
+ import { WidgetState } from '../stores/types';
3
+ export interface SkeletonLoaderProps {
4
+ id: WidgetState['id'];
5
+ Skeleton: ElementType | null;
6
+ children: ReactNode;
7
+ }
@@ -0,0 +1,2 @@
1
+ import { ValueProps } from '../types';
2
+ export declare function MaxValue({ id, index, ...props }: ValueProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,2 @@
1
+ import { ValueProps } from '../types';
2
+ export declare function MinValue({ id, index, ...props }: ValueProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,2 @@
1
+ import { ItemProps } from '../../formula/types';
2
+ export declare function Separator(props: Omit<ItemProps, 'children'>): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,10 @@
1
+ import { DownloadItem } from '../actions';
2
+ import { ConfigProps } from '../loader/types';
3
+ import { SpreadWidgetConfig, SpreadWidgetData } from './types';
4
+ import { SeriesConfig } from '../formula/types';
5
+ export interface SpreadConfigProps {
6
+ formatter?: (value: number) => string;
7
+ series?: SeriesConfig[];
8
+ }
9
+ export declare function spreadDownloadConfig({ refUI, }: ConfigProps): DownloadItem<SpreadWidgetData>[];
10
+ export declare function spreadConfig(): SpreadWidgetConfig;
@@ -0,0 +1,9 @@
1
+ export { SpreadUI } from './spread-ui';
2
+ export { SpreadSkeleton } from './skeleton';
3
+ export { spreadConfig, spreadDownloadConfig } from './config';
4
+ export { MinValue } from './components/min-value';
5
+ export { MaxValue } from './components/max-value';
6
+ export { Separator } from './components/separator';
7
+ export { Item, Row, Prefix, Suffix, Series } from '../formula';
8
+ export type { RowProps, ValueProps, SpreadWidgetState, SpreadWidgetConfig, SpreadWidgetData, SpreadDownloadConfig, ItemProps, SpreadDataItem, SpreadUIProps, } from './types';
9
+ export type { SeriesConfig } from '../formula/types';
@@ -0,0 +1 @@
1
+ export declare function SpreadSkeleton(): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,2 @@
1
+ import { SpreadUIProps } from './types';
2
+ export declare function SpreadUI(props: SpreadUIProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,21 @@
1
+ import { Theme } from '@mui/material';
2
+ export declare const styles: {
3
+ root: {
4
+ display: "flex";
5
+ flexDirection: "column";
6
+ gap: (theme: Theme) => string;
7
+ };
8
+ item: {
9
+ '&[data-disabled="true"]': {
10
+ color: (theme: Theme) => string;
11
+ };
12
+ };
13
+ row: {
14
+ display: "flex";
15
+ alignItems: "center";
16
+ gap: (theme: Theme) => string;
17
+ '& + &': {
18
+ marginTop: (theme: Theme) => string;
19
+ };
20
+ };
21
+ };
@@ -0,0 +1,40 @@
1
+ import { TypographyProps } from '@mui/material';
2
+ import { ReactNode } from 'react';
3
+ import { BaseWidgetState, WidgetsStoreProps } from '../stores/types';
4
+ import { WrapperState } from '../wrapper/types';
5
+ import { DownloadItem } from '../actions/download/types';
6
+ import { SeriesConfig } from '../formula/types';
7
+ export interface SpreadUIProps {
8
+ id: WidgetsStoreProps['id'];
9
+ }
10
+ export interface SpreadDataItem {
11
+ min: number;
12
+ max: number;
13
+ prefix?: string | ReactNode;
14
+ suffix?: string | ReactNode;
15
+ color?: string;
16
+ }
17
+ export interface RowProps {
18
+ id: WidgetsStoreProps['id'];
19
+ children: ReactNode | ((props: {
20
+ index: number;
21
+ }) => ReactNode);
22
+ }
23
+ export interface ValueProps extends Omit<ItemProps, 'children'> {
24
+ id: WidgetsStoreProps['id'];
25
+ index?: number;
26
+ }
27
+ export interface ItemProps {
28
+ children: ReactNode;
29
+ disabled?: boolean;
30
+ TypographyProps?: TypographyProps;
31
+ }
32
+ export type SpreadWidgetData = SpreadDataItem[];
33
+ export type SpreadWidgetState = BaseWidgetState<WrapperState<SpreadWidgetConfig> & {
34
+ data: SpreadWidgetData;
35
+ }>;
36
+ export interface SpreadWidgetConfig {
37
+ formatter?: (value: number) => string;
38
+ series?: SeriesConfig[];
39
+ }
40
+ export type SpreadDownloadConfig = DownloadItem<SpreadWidgetData>[];
@@ -0,0 +1,2 @@
1
+ export { useWidgetStore } from './widget-store';
2
+ export type { BaseWidgetState, WidgetsStoreProps, WidgetState, WidgetStore, WidgetStoreActions, WidgetStoreState, } from './types';
@@ -0,0 +1,165 @@
1
+ import { RefObject } from 'react';
2
+ export interface WidgetsStoreProps {
3
+ /** Unique identifier for the widget */
4
+ id: string;
5
+ /** Type of widget */
6
+ type: string;
7
+ /** Widget data - flexible to accommodate different widget types */
8
+ data: unknown;
9
+ /** Loading state */
10
+ isLoading: boolean;
11
+ /** Fetching state (e.g., for async data) */
12
+ isFetching: boolean;
13
+ /** Error message if any */
14
+ error?: {
15
+ title?: string;
16
+ message?: string;
17
+ };
18
+ /** Whether widget is visible */
19
+ visible?: boolean;
20
+ /** Reference to the widget ui instance */
21
+ refUI?: RefObject<HTMLElement | null>;
22
+ /** Registered tools for the widget's transformation pipeline */
23
+ registeredTools?: ToolRegistration[];
24
+ /** Formatter function for widget values */
25
+ formatter?: (value: number) => string;
26
+ /** Locale for number formatting (e.g., 'en-US', 'es-ES', 'fr-FR') */
27
+ locale?: string;
28
+ }
29
+ /**
30
+ * Tool transformation function type
31
+ * Can be synchronous or asynchronous to support remote operations
32
+ */
33
+ export type ToolTransformFunction = (data: unknown, config?: Record<string, unknown>) => Promise<unknown> | unknown;
34
+ /**
35
+ * Tool registration for widget pipeline
36
+ *
37
+ * @example Basic tool registration
38
+ * ```typescript
39
+ * registerTool(widgetId, {
40
+ * id: 'searcher',
41
+ * order: 10,
42
+ * enabled: true,
43
+ * fn: (data) => filterData(data),
44
+ * })
45
+ * ```
46
+ *
47
+ * @example Tool with dependencies
48
+ * ```typescript
49
+ * registerTool(widgetId, {
50
+ * id: 'lock-selection',
51
+ * order: 20,
52
+ * enabled: true,
53
+ * fn: (data) => lockData(data),
54
+ * disables: ['searcher', 'relative-data'], // Disable these when active
55
+ * })
56
+ * ```
57
+ *
58
+ * Dependency Management:
59
+ * - Multiple tools can disable the same target (reference counting)
60
+ * - Target is only re-enabled when ALL disabling tools are inactive
61
+ * - Original enabled state is preserved and restored
62
+ * - Circular dependencies are detected and throw errors
63
+ */
64
+ export interface ToolRegistration {
65
+ /** Unique tool identifier (e.g., 'searcher', 'relative-data') */
66
+ id: string;
67
+ /** Execution priority - lower numbers execute first */
68
+ order: number;
69
+ /** Transformation function */
70
+ fn: ToolTransformFunction;
71
+ /** Whether tool is currently enabled */
72
+ enabled: boolean;
73
+ /** Tool-specific configuration */
74
+ config?: Record<string, unknown>;
75
+ /**
76
+ * Array of tool IDs to disable when this tool is active.
77
+ * During pipeline execution, if this tool is enabled, any tools listed
78
+ * in this array will be excluded from the pipeline.
79
+ *
80
+ * @example
81
+ * ```typescript
82
+ * disables: ['searcher', 'relative-data']
83
+ * ```
84
+ */
85
+ disables?: string[];
86
+ }
87
+ /**
88
+ * Base widget state interface
89
+ */
90
+ export type BaseWidgetState<T> = WidgetsStoreProps & T;
91
+ /**
92
+ * Union type for all widget states
93
+ */
94
+ export type WidgetState = BaseWidgetState<unknown>;
95
+ /**
96
+ * Widget store state with tool registration
97
+ */
98
+ export interface WidgetStoreState {
99
+ /** Map of widget id to widget state */
100
+ widgets: Record<string, WidgetState>;
101
+ }
102
+ /**
103
+ * Widget store actions
104
+ */
105
+ export interface WidgetStoreActions {
106
+ /**
107
+ * Add or update a widget in the store
108
+ * @param id - Widget ID
109
+ * @param widget - Widget state properties to merge (accepts any object structure)
110
+ * @template T - Type of the widget state for type-safe access
111
+ */
112
+ setWidget: <T = any>(id: WidgetState['id'], widget: Partial<T>) => void;
113
+ /**
114
+ * Remove a widget from the store
115
+ * @param id - Widget ID to remove
116
+ */
117
+ removeWidget: (id: WidgetState['id']) => void;
118
+ /**
119
+ * Clear all widgets
120
+ */
121
+ clearWidgets: () => void;
122
+ /**
123
+ * Get widget by ID
124
+ * @param id - Widget ID
125
+ * @returns Widget state or undefined if not found
126
+ */
127
+ getWidget: <T extends WidgetState = WidgetState>(id: WidgetState['id']) => T | undefined;
128
+ /**
129
+ * Register a tool with the widget's transformation pipeline
130
+ * @param widgetId - Widget ID
131
+ * @param tool - Tool registration object
132
+ */
133
+ registerTool: (widgetId: string, tool: ToolRegistration) => void;
134
+ /**
135
+ * Unregister a tool from the widget's transformation pipeline
136
+ * @param widgetId - Widget ID
137
+ * @param toolId - Tool ID to remove
138
+ */
139
+ unregisterTool: (widgetId: string, toolId: string) => void;
140
+ /**
141
+ * Update tool configuration
142
+ * @param widgetId - Widget ID
143
+ * @param toolId - Tool ID
144
+ * @param config - New configuration to merge
145
+ */
146
+ updateToolConfig: (widgetId: string, toolId: string, config: Record<string, unknown>) => void;
147
+ /**
148
+ * Set tool enabled state
149
+ * @param widgetId - Widget ID
150
+ * @param toolId - Tool ID
151
+ * @param enabled - Whether tool should be enabled
152
+ */
153
+ setToolEnabled: (widgetId: string, toolId: string, enabled: boolean) => void;
154
+ /**
155
+ * Execute the tool transformation pipeline
156
+ * Supports both synchronous and asynchronous tools
157
+ * @param widgetId - Widget ID
158
+ * @param sourceData - Original data to transform
159
+ */
160
+ executeToolPipeline: (widgetId: string, sourceData: unknown) => Promise<void>;
161
+ }
162
+ /**
163
+ * Complete widget store interface
164
+ */
165
+ export type WidgetStore = WidgetStoreState & WidgetStoreActions;
@@ -0,0 +1,39 @@
1
+ import { WidgetStore } from './types';
2
+ /**
3
+ * Zustand store for managing widget state across the application.
4
+ *
5
+ * This store provides centralized state management for all widget UI components
6
+ *
7
+ * @example
8
+ * ```tsx
9
+ * // Import the store
10
+ * import { useWidgetStore } from '@carto/ps-react-ui/widgets'
11
+ *
12
+ * // Use in a component
13
+ * function MyWidget() {
14
+ * const setWidget = useWidgetStore((state) => state.setWidget)
15
+ * const widget = useWidgetStore((state) => state.widgets['my-widget'])
16
+ *
17
+ * useEffect(() => {
18
+ * setWidget({
19
+ * id: 'my-widget',
20
+ * type: 'formula',
21
+ * title: 'Total Sales',
22
+ * isLoading: false,
23
+ * visible: true,
24
+ * data: { value: 1000, prefix: '$' }
25
+ * })
26
+ * }, [setWidget])
27
+ *
28
+ * return <div>{widget?.data?.value}</div>
29
+ * }
30
+ * ```
31
+ *
32
+ * @example
33
+ * ```tsx
34
+ * // Get widgets by type
35
+ * const getWidgetsByType = useWidgetStore((state) => state.getWidgetsByType)
36
+ * const formulaWidgets = getWidgetsByType('formula')
37
+ * ```
38
+ */
39
+ export declare const useWidgetStore: import('node_modules/zustand/esm/react.mjs').UseBoundStore<import('node_modules/zustand/esm/vanilla.mjs').StoreApi<WidgetStore>>;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,2 @@
1
+ export { WidgetSubHeader } from './subheader';
2
+ export type { WidgetSubHeaderProps } from './types';
@@ -0,0 +1,19 @@
1
+ import { Theme } from '@mui/material';
2
+ export declare const styles: {
3
+ root: {
4
+ display: "flex";
5
+ alignItems: "center";
6
+ gap: ({ spacing }: Theme) => string;
7
+ minHeight: ({ spacing }: Theme) => string;
8
+ };
9
+ slotLeft: {
10
+ flexShrink: number;
11
+ };
12
+ slotRight: {
13
+ flexGrow: number;
14
+ display: "flex";
15
+ justifyContent: "flex-end";
16
+ alignItems: "center";
17
+ gap: ({ spacing }: Theme) => string;
18
+ };
19
+ };
@@ -0,0 +1,2 @@
1
+ import { WidgetSubHeaderProps } from './types';
2
+ export declare function WidgetSubHeader({ slotLeft, slotRight, sx, }: WidgetSubHeaderProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,10 @@
1
+ import { SxProps, Theme } from '@mui/material';
2
+ import { ReactNode } from 'react';
3
+ export interface WidgetSubHeaderProps {
4
+ /** Content for the left slot */
5
+ slotLeft?: ReactNode;
6
+ /** Content for the right slot*/
7
+ slotRight?: ReactNode;
8
+ /** Custom styles */
9
+ sx?: SxProps<Theme>;
10
+ }
@@ -0,0 +1,5 @@
1
+ import { CellHeaderProps } from '../types';
2
+ /**
3
+ * Table cell header component with optional sorting and select-all checkbox
4
+ */
5
+ export declare function CellHeader({ column, sortState, onSort, isSelectAll, isAllSelected, isIndeterminate, onSelectAll, }: CellHeaderProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,16 @@
1
+ import { TableColumn } from '../types';
2
+ /**
3
+ * Props for Cell component
4
+ */
5
+ export interface CellProps {
6
+ /** Column definition */
7
+ column: TableColumn;
8
+ /** Cell value */
9
+ value: unknown;
10
+ }
11
+ /**
12
+ * Table cell component with automatic markdown support for string values
13
+ * Markdown is rendered when the raw value is a string and no formatter is defined.
14
+ * If a formatter is used, its output is rendered directly without markdown parsing.
15
+ */
16
+ export declare function Cell({ column, value }: CellProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,4 @@
1
+ export { CellHeader } from './cell-header';
2
+ export { Row } from './row';
3
+ export { Pagination } from './pagination';
4
+ export { PaginationActions } from './pagination-actions';
@@ -0,0 +1,5 @@
1
+ import { PaginationActionsProps } from '../types';
2
+ /**
3
+ * Custom pagination actions with first/prev/next/last buttons
4
+ */
5
+ export declare function PaginationActions({ count, page, rowsPerPage, onPageChange, }: PaginationActionsProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,5 @@
1
+ import { PaginationProps } from '../types';
2
+ /**
3
+ * Table pagination component
4
+ */
5
+ export declare function Pagination({ page, rowsPerPage, total, rowsPerPageOptions, onPageChange, onRowsPerPageChange, }: PaginationProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,5 @@
1
+ import { RowProps } from '../types';
2
+ /**
3
+ * Table row component with selection and hover support
4
+ */
5
+ export declare function Row({ row, columns, isSelected, selectable, onClick, onSelect, onMouseEnter, onMouseLeave, }: RowProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,17 @@
1
+ import { ConfigProps } from '../loader/types';
2
+ import { TableDownloadConfig, TableWidgetConfig, TableColumn, Mode, SortDirection } from './types';
3
+ export declare const DEFAULT_MODE: Mode;
4
+ export declare const DEFAULT_PAGE = 0;
5
+ export declare const DEFAULT_ROWS_PER_PAGE = 10;
6
+ export declare const DEFAULT_ROWS_PER_PAGE_OPTIONS: number[];
7
+ export declare const DEFAULT_COLUMN_ID: null;
8
+ export declare const DEFAULT_DIRECTION: SortDirection;
9
+ /**
10
+ * Default table download configuration
11
+ * Supports PNG export (screenshot) and CSV export (data)
12
+ */
13
+ export declare function tableDownloadConfig({ refUI, }: ConfigProps): TableDownloadConfig;
14
+ /**
15
+ * Default table widget configuration
16
+ */
17
+ export declare function tableConfig(columns?: TableColumn[]): TableWidgetConfig;
@@ -0,0 +1,38 @@
1
+ import { ReactNode } from 'react';
2
+ /**
3
+ * Get formatted cell value for display
4
+ * Handles primitives, arrays, objects, and custom formatters
5
+ *
6
+ * @param cellValue - Raw cell value
7
+ * @param formatter - Optional formatter function
8
+ * @returns Formatted value for display
9
+ */
10
+ export declare function getCellValue<T>(cellValue: T): ReactNode;
11
+ /**
12
+ * Compare two values for sorting
13
+ * Handles strings, numbers, and other types
14
+ *
15
+ * @param a - First value
16
+ * @param b - Second value
17
+ * @param direction - Sort direction
18
+ * @returns Comparison result (-1, 0, 1)
19
+ */
20
+ export declare function compareValues(a: unknown, b: unknown, direction: 'asc' | 'desc'): number;
21
+ /**
22
+ * Sort data array by column
23
+ *
24
+ * @param data - Data array to sort
25
+ * @param columnId - Column ID to sort by
26
+ * @param direction - Sort direction
27
+ * @returns Sorted data array (new array, does not mutate original)
28
+ */
29
+ export declare function sortData<T extends Record<string, unknown>>(data: T[], columnId: string, direction: 'asc' | 'desc'): T[];
30
+ /**
31
+ * Paginate data array
32
+ *
33
+ * @param data - Data array to paginate
34
+ * @param page - Current page (0-indexed)
35
+ * @param rowsPerPage - Number of rows per page
36
+ * @returns Paginated data slice
37
+ */
38
+ export declare function paginateData<T>(data: T[], page: number, rowsPerPage: number): T[];
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,6 @@
1
+ export { usePagination } from './use-pagination';
2
+ export { useSort } from './use-sort';
3
+ export { useSelection } from './use-selection';
4
+ export type { UsePaginationResult } from './use-pagination';
5
+ export type { UseSortResult } from './use-sort';
6
+ export type { UseSelectionOptions, UseSelectionResult } from './use-selection';