@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,34 @@
1
+ import { EChartsOption } from 'echarts';
2
+ import { BaseWidgetState } from '../stores/types';
3
+ import { Ref } from 'react';
4
+ import { theme as CartoTheme } from '@carto/meridian-ds/theme';
5
+ import type * as echarts from 'echarts';
6
+ export type EchartOptionsProps = EChartsOption;
7
+ export interface EchartUIProps {
8
+ id: string;
9
+ option: EchartOptionsProps;
10
+ className?: string;
11
+ init?: echarts.EChartsInitOpts;
12
+ style?: React.CSSProperties;
13
+ ref?: Ref<echarts.ECharts>;
14
+ onEvents?: Record<string, Parameters<echarts.ECharts['on']>[2]>;
15
+ }
16
+ export interface EchartProps {
17
+ id: EchartUIProps['id'];
18
+ }
19
+ export type EchartWidgetData = Record<string, string | number>[][];
20
+ export type EchartWidgetState = BaseWidgetState<{
21
+ option: EchartUIProps['option'];
22
+ onEvents?: EchartUIProps['onEvents'];
23
+ init?: EchartUIProps['init'];
24
+ }>;
25
+ export interface EchartWidgetOptionProps<D> {
26
+ data?: D;
27
+ theme: typeof CartoTheme;
28
+ formatter?: (value: number) => string;
29
+ }
30
+ export interface EchartWidgetProps {
31
+ type: string;
32
+ option: EchartUIProps['option'];
33
+ onEvents?: EchartUIProps['onEvents'];
34
+ }
@@ -0,0 +1,80 @@
1
+ import { EchartOptionsProps } from './types';
2
+ import { Theme } from '@mui/material';
3
+ export declare function mergeEchartWidgetConfig<T extends EchartOptionsProps>(...options: [T | undefined, T | undefined]): T;
4
+ export declare function getEChartZoomConfig(zoom: boolean, { start, end }?: {
5
+ start: number;
6
+ end: number;
7
+ }, { inside, xSlider, ySlider, showSliders, xAxisLabelFormatter, }?: {
8
+ inside?: boolean;
9
+ xSlider?: boolean;
10
+ ySlider?: boolean;
11
+ showSliders?: boolean;
12
+ xAxisLabelFormatter?: (value: number) => string;
13
+ }, theme?: Theme): {
14
+ dataZoom: ({
15
+ throttle: number;
16
+ type: string;
17
+ xAxisIndex: number[];
18
+ yAxisIndex: number[];
19
+ show: boolean;
20
+ zoomLock: boolean;
21
+ start: number;
22
+ end: number;
23
+ orientation?: undefined;
24
+ } | {
25
+ throttle: number;
26
+ type: string;
27
+ show: boolean;
28
+ zoomLock: boolean;
29
+ start: number;
30
+ end: number;
31
+ orientation: string;
32
+ xAxisIndex?: undefined;
33
+ yAxisIndex?: undefined;
34
+ } | {
35
+ brushSelect: boolean;
36
+ moveHandleSize: number;
37
+ handleSize: string;
38
+ handleIcon: string;
39
+ throttle: number;
40
+ type: string;
41
+ xAxisIndex: number[];
42
+ bottom: number;
43
+ height: number;
44
+ show: boolean;
45
+ zoomLock: boolean;
46
+ start: number;
47
+ end: number;
48
+ labelFormatter: ((value: number) => string) | undefined;
49
+ showDetail: boolean;
50
+ yAxisIndex?: undefined;
51
+ orientation?: undefined;
52
+ } | {
53
+ brushSelect: boolean;
54
+ moveHandleSize: number;
55
+ handleSize: string;
56
+ handleIcon: string;
57
+ throttle: number;
58
+ type: string;
59
+ left: number;
60
+ width: number;
61
+ yAxisIndex: number[];
62
+ show: boolean;
63
+ zoomLock: boolean;
64
+ start: number;
65
+ end: number;
66
+ xAxisIndex?: undefined;
67
+ orientation?: undefined;
68
+ })[];
69
+ };
70
+ export declare function getEChartBrushConfig(brush: boolean): {
71
+ brush: {
72
+ brushType: string;
73
+ brushMode: string;
74
+ };
75
+ } | {
76
+ brush?: undefined;
77
+ };
78
+ export declare function getEChartStackConfig(stack: boolean, stackGroup?: string): {
79
+ stack: string | undefined;
80
+ };
@@ -0,0 +1,2 @@
1
+ import { WidgetErrorProps } from './types';
2
+ export declare function WidgetError({ id, children }: 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;
@@ -0,0 +1,2 @@
1
+ export { WidgetError } from './error';
2
+ export type { WidgetErrorProps } from './types';
@@ -0,0 +1,12 @@
1
+ import { ReactNode } from 'react';
2
+ import { WidgetState } from '../stores/types';
3
+ export interface WidgetErrorProps {
4
+ /**
5
+ * Widget ID to fetch error state from store
6
+ */
7
+ id: WidgetState['id'];
8
+ /**
9
+ * Children to render when no error exists
10
+ */
11
+ children: ReactNode;
12
+ }
@@ -0,0 +1,2 @@
1
+ import { ItemProps } from '../types';
2
+ export declare function Item(props: ItemProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,2 @@
1
+ import { ValueProps } from '../types';
2
+ export declare function Prefix({ id, index, ...props }: ValueProps): import("react/jsx-runtime").JSX.Element | null;
@@ -0,0 +1,2 @@
1
+ import { RowProps } from '../types';
2
+ export declare function Row(props: RowProps): import("react/jsx-runtime").JSX.Element[] | undefined;
@@ -0,0 +1,2 @@
1
+ import { ValueProps } from '../types';
2
+ export declare function Series({ id, index }: Pick<ValueProps, 'id' | 'index'>): import("react/jsx-runtime").JSX.Element | null;
@@ -0,0 +1,2 @@
1
+ import { ValueProps } from '../types';
2
+ export declare function Suffix({ id, index, ...props }: ValueProps): import("react/jsx-runtime").JSX.Element | null;
@@ -0,0 +1,2 @@
1
+ import { ValueProps } from '../types';
2
+ export declare function Value({ id, index, ...props }: ValueProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,4 @@
1
+ import { ConfigProps } from '../loader/types';
2
+ import { FormulaDownloadConfig, FormulaWidgetConfig } from './types';
3
+ export declare function formulaDownloadConfig({ refUI, }: ConfigProps): FormulaDownloadConfig;
4
+ export declare function formulaConfig(): FormulaWidgetConfig;
@@ -0,0 +1,2 @@
1
+ import { FormulaUIProps } from './types';
2
+ export declare function FormulaUI(props: FormulaUIProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,11 @@
1
+ export { Item } from './components/item';
2
+ export { Value } from './components/value';
3
+ export { Prefix } from './components/prefix';
4
+ export { Suffix } from './components/suffix';
5
+ export { Series } from './components/series';
6
+ export { Row } from './components/row';
7
+ export { formulaConfig, formulaDownloadConfig } from './config';
8
+ export { FormulaUI } from './formula-ui';
9
+ export { FormulaSkeleton } from './skeleton';
10
+ export { sanitizeDataItem, sanitizeDataItems } from './serializer';
11
+ export type { DataItem, FormulaDownloadConfig, FormulaUIProps, FormulaWidgetConfig, FormulaWidgetData, FormulaWidgetState, ItemProps, RowProps, SeriesConfig, ValueProps, } from './types';
@@ -0,0 +1,16 @@
1
+ import { DataItem } from './types';
2
+ /**
3
+ * Sanitizes DataItem by converting ReactNode prefix/suffix values to undefined.
4
+ * This ensures only string values are stored in the widget state.
5
+ *
6
+ * @param item - The DataItem to sanitize
7
+ * @returns A new DataItem with ReactNode prefix/suffix values converted to undefined
8
+ */
9
+ export declare function sanitizeDataItem(item: DataItem): DataItem;
10
+ /**
11
+ * Sanitizes an array of DataItems by converting ReactNode prefix/suffix values to undefined.
12
+ *
13
+ * @param items - Array of DataItems to sanitize
14
+ * @returns A new array with sanitized DataItems
15
+ */
16
+ export declare function sanitizeDataItems(items: DataItem[] | undefined): DataItem[] | undefined;
@@ -0,0 +1 @@
1
+ export declare function FormulaSkeleton(): 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,42 @@
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
+ export interface FormulaUIProps {
7
+ id: WidgetsStoreProps['id'];
8
+ }
9
+ export interface DataItem {
10
+ value: number;
11
+ prefix?: string | ReactNode;
12
+ suffix?: string | ReactNode;
13
+ color?: string;
14
+ }
15
+ export interface RowProps {
16
+ id: WidgetsStoreProps['id'];
17
+ children: ReactNode | ((props: {
18
+ index: number;
19
+ }) => ReactNode);
20
+ }
21
+ export interface ValueProps extends Omit<ItemProps, 'children'> {
22
+ id: WidgetsStoreProps['id'];
23
+ index?: number;
24
+ }
25
+ export interface ItemProps {
26
+ children: ReactNode;
27
+ disabled?: boolean;
28
+ TypographyProps?: TypographyProps;
29
+ }
30
+ export type FormulaWidgetData = DataItem[];
31
+ export interface SeriesConfig {
32
+ name: string;
33
+ color?: string;
34
+ }
35
+ export type FormulaWidgetState = BaseWidgetState<WrapperState<FormulaWidgetConfig> & {
36
+ data: FormulaWidgetData;
37
+ }>;
38
+ export interface FormulaWidgetConfig {
39
+ formatter?: (value: number) => string;
40
+ series?: SeriesConfig[];
41
+ }
42
+ export type FormulaDownloadConfig = DownloadItem<FormulaWidgetData>[];
@@ -0,0 +1,5 @@
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>[];
5
+ export declare function histogramConfig(props: HistogramConfig): HistogramWidgetConfig;
@@ -0,0 +1,3 @@
1
+ export type { HistogramConfig, HistogramWidgetConfig, HistogramWidgetData, HistogramWidgetState, } from './types';
2
+ export { histogramConfig, histogramDownloadConfig } from './config';
3
+ export { HistogramSkeleton } from './skeleton';
@@ -0,0 +1 @@
1
+ export declare function HistogramSkeleton(): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,15 @@
1
+ import { Theme } from '@mui/material';
2
+ export declare const styles: {
3
+ skeleton: {
4
+ graph: {
5
+ readonly container: {
6
+ readonly display: "flex";
7
+ readonly alignItems: "center";
8
+ readonly justifyContent: "space-between";
9
+ readonly flexDirection: "column";
10
+ readonly gap: ({ spacing }: Theme) => string;
11
+ readonly height: ({ spacing }: Theme) => string;
12
+ };
13
+ };
14
+ };
15
+ };
@@ -0,0 +1,9 @@
1
+ import { EchartWidgetData, EchartWidgetState } from '../echart';
2
+ import { EchartWidgetOptionProps, EchartWidgetProps } from '../echart/types';
3
+ import { ConfigProps } from '../loader';
4
+ export type HistogramWidgetData = EchartWidgetData;
5
+ export type HistogramWidgetState = EchartWidgetState;
6
+ export type HistogramWidgetConfig = EchartWidgetProps & {
7
+ type: 'histogram';
8
+ };
9
+ export type HistogramConfig = ConfigProps & EchartWidgetOptionProps<HistogramWidgetData>;
@@ -1 +1,9 @@
1
- export {};
1
+ export { useWidgetStore } from './stores/widget-store';
2
+ export type { BaseWidgetState, WidgetsStoreProps, WidgetState, WidgetStore, WidgetStoreActions, WidgetStoreState, } from './stores/types';
3
+ export { useWidgetRef } from '../hooks/use-widget-ref';
4
+ export { WidgetNoData } from './no-data';
5
+ export type { WidgetNoDataProps } from './no-data';
6
+ export { WidgetError } from './error';
7
+ export type { WidgetErrorProps } from './error';
8
+ export { WidgetNote } from './note';
9
+ export type { WidgetNoteProps } from './note';
@@ -0,0 +1,3 @@
1
+ export { WidgetLoader } from './loader';
2
+ export { mergeWidgetConfig } from './utils';
3
+ export type { WidgetLoaderProps, ConfigProps } from './types';
@@ -0,0 +1,2 @@
1
+ import { WidgetLoaderProps } from './types';
2
+ export declare function WidgetLoader<T>(props: WidgetLoaderProps<T>): import('react').ReactNode;
@@ -0,0 +1,9 @@
1
+ import { ReactNode } from 'react';
2
+ import { WidgetsStoreProps, WidgetState } from '../stores/types';
3
+ export interface WidgetLoaderProps<T> extends WidgetsStoreProps {
4
+ children: ReactNode;
5
+ config?: T;
6
+ }
7
+ export interface ConfigProps {
8
+ refUI?: WidgetState['refUI'];
9
+ }
@@ -0,0 +1 @@
1
+ export declare function mergeWidgetConfig<T>(...options: [Partial<T> | undefined, Partial<T> | undefined]): T;
@@ -0,0 +1,4 @@
1
+ import { DownloadItem } from '../actions';
2
+ import { MarkdownWidgetConfig, MarkdownWidgetData } from './types';
3
+ export declare function markdownDownloadConfig(): DownloadItem<MarkdownWidgetData>[];
4
+ export declare function markdownConfig(): MarkdownWidgetConfig;
@@ -0,0 +1,5 @@
1
+ export { Markdown } from './markdown';
2
+ export { MarkdownUI } from './markdown-ui';
3
+ export { MarkdownSkeleton } from './skeleton';
4
+ export { markdownConfig, markdownDownloadConfig } from './config';
5
+ export type { MarkdownComponentProps, MarkdownUIProps, MarkdownWidgetData, MarkdownWidgetState, MarkdownWidgetConfig, MarkdownDownloadConfig, MarkdownDataItem, } from './types';
@@ -0,0 +1,2 @@
1
+ import { MarkdownComponentProps } from './types';
2
+ export declare function MarkdownUI({ children, overrides }: MarkdownComponentProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,2 @@
1
+ import { MarkdownUIProps } from './types';
2
+ export declare function Markdown({ id }: MarkdownUIProps): import("react/jsx-runtime").JSX.Element | null;
@@ -0,0 +1 @@
1
+ export declare function MarkdownSkeleton(): 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,18 @@
1
+ import { BaseWidgetState, WidgetsStoreProps } from '../stores/types';
2
+ import { WrapperState } from '../wrapper/types';
3
+ import { DownloadItem } from '../actions/download/types';
4
+ import { Components } from 'react-markdown';
5
+ export interface MarkdownComponentProps {
6
+ children: string;
7
+ overrides?: Components;
8
+ }
9
+ export interface MarkdownUIProps {
10
+ id: WidgetsStoreProps['id'];
11
+ }
12
+ export interface MarkdownDataItem {
13
+ content: string;
14
+ }
15
+ export type MarkdownWidgetData = MarkdownDataItem;
16
+ export type MarkdownWidgetState = BaseWidgetState<WrapperState<MarkdownWidgetConfig>>;
17
+ export type MarkdownWidgetConfig = Record<string, unknown>;
18
+ export type MarkdownDownloadConfig = DownloadItem<MarkdownWidgetData>[];
@@ -0,0 +1,2 @@
1
+ export { WidgetNoData } from './no-data';
2
+ export type { WidgetNoDataProps } from './types';
@@ -0,0 +1,35 @@
1
+ import { WidgetNoDataProps } from './types';
2
+ /**
3
+ * NoData wrapper component that displays empty state UI when widget has no data
4
+ *
5
+ * Integrates with widget store to check loading/fetching state and data availability.
6
+ * Works in conjunction with SkeletonLoader for complete loading/empty state handling.
7
+ *
8
+ * @example Basic usage
9
+ * ```tsx
10
+ * <NoData id="my-widget">
11
+ * <WidgetContent id="my-widget" />
12
+ * </NoData>
13
+ * ```
14
+ *
15
+ * @example With SkeletonLoader
16
+ * ```tsx
17
+ * <SkeletonLoader id="my-widget" Skeleton={MySkeleton}>
18
+ * <NoData id="my-widget">
19
+ * <WidgetContent id="my-widget" />
20
+ * </NoData>
21
+ * </SkeletonLoader>
22
+ * ```
23
+ *
24
+ * @example With custom messages
25
+ * ```tsx
26
+ * <NoData
27
+ * id="my-widget"
28
+ * title="No results found"
29
+ * description="Try adjusting your filters"
30
+ * >
31
+ * <WidgetContent id="my-widget" />
32
+ * </NoData>
33
+ * ```
34
+ */
35
+ export declare function WidgetNoData({ id, children, title, description, isEmpty, }: WidgetNoDataProps): 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,6 @@
1
+ import { SxProps, Theme } from '@mui/material';
2
+ /**
3
+ * Styles for NoData component matching Figma design specifications
4
+ * Design reference: node 5781-11028
5
+ */
6
+ export declare const styles: Record<string, SxProps<Theme>>;
@@ -0,0 +1,67 @@
1
+ import { ReactNode } from 'react';
2
+ import { WidgetState } from '../stores/types';
3
+ /**
4
+ * Props for the WidgetNoData wrapper component
5
+ *
6
+ * @example Basic usage
7
+ * ```tsx
8
+ * <WidgetNoData id="my-widget">
9
+ * <WidgetContent id="my-widget" />
10
+ * </WidgetNoData>
11
+ * ```
12
+ *
13
+ * @example With custom messages
14
+ * ```tsx
15
+ * <WidgetNoData
16
+ * id="my-widget"
17
+ * title="No results found"
18
+ * description="Try adjusting your filters"
19
+ * >
20
+ * <WidgetContent id="my-widget" />
21
+ * </WidgetNoData>
22
+ * ```
23
+ *
24
+ * @example With custom isEmpty logic
25
+ * ```tsx
26
+ * <WidgetNoData
27
+ * id="my-widget"
28
+ * isEmpty={(data) => {
29
+ * const d = data as CustomData
30
+ * return !d?.items?.length
31
+ * }}
32
+ * >
33
+ * <WidgetContent id="my-widget" />
34
+ * </WidgetNoData>
35
+ * ```
36
+ */
37
+ export interface WidgetNoDataProps {
38
+ /**
39
+ * Widget ID to fetch state from store
40
+ */
41
+ id: WidgetState['id'];
42
+ /**
43
+ * Children to render when data is available
44
+ */
45
+ children: ReactNode;
46
+ /**
47
+ * Optional custom title for empty state
48
+ * @default "No data available"
49
+ */
50
+ title?: string;
51
+ /**
52
+ * Optional custom description for empty state
53
+ * @default "There are no results for the combination of filters applied to your data. Try tweaking your filters, or zoom and pan the map to adjust filters"
54
+ */
55
+ description?: string;
56
+ /**
57
+ * Optional custom function to determine if data is empty
58
+ * If not provided, uses default isEmpty logic that handles:
59
+ * - null/undefined → empty
60
+ * - [] (empty array) → empty
61
+ * - [[]] (nested empty arrays) → empty
62
+ * - {} (empty object) → empty
63
+ * - Primitives → not empty
64
+ * - Arrays/objects with content → not empty
65
+ */
66
+ isEmpty?: (data: unknown) => boolean;
67
+ }
@@ -0,0 +1,2 @@
1
+ export { WidgetNote } from './note';
2
+ export type { WidgetNoteProps } from './types';
@@ -0,0 +1,2 @@
1
+ import { WidgetNoteProps } from './types';
2
+ export declare function WidgetNote({ children, labels, }: WidgetNoteProps): import("react/jsx-runtime").JSX.Element | null;
@@ -0,0 +1,28 @@
1
+ import { Theme } from '@mui/material';
2
+ export declare const styles: {
3
+ root: {
4
+ typography: string;
5
+ color: (theme: Theme) => string;
6
+ marginBlockStart: ({ spacing }: Theme) => string;
7
+ };
8
+ clamped: {
9
+ display: "-webkit-box";
10
+ WebkitLineClamp: number;
11
+ WebkitBoxOrient: "vertical";
12
+ overflow: "hidden";
13
+ };
14
+ expanded: {
15
+ display: "block";
16
+ };
17
+ linkButton: {
18
+ padding: number;
19
+ minWidth: string;
20
+ textTransform: "none";
21
+ typography: string;
22
+ fontWeight: number;
23
+ textDecoration: string;
24
+ '&:hover': {
25
+ backgroundColor: "transparent";
26
+ };
27
+ };
28
+ };
@@ -0,0 +1,8 @@
1
+ import { MarkdownComponentProps } from '../markdown';
2
+ export interface WidgetNoteProps {
3
+ children: MarkdownComponentProps['children'];
4
+ labels?: {
5
+ showMore?: string;
6
+ showLess?: string;
7
+ };
8
+ }
@@ -0,0 +1,5 @@
1
+ import { PieConfig, PieWidgetConfig, PieWidgetData } from './types';
2
+ import { DownloadItem } from '../actions';
3
+ import { ConfigProps } from '../loader/types';
4
+ export declare function pieDownloadConfig({ refUI, }: ConfigProps): DownloadItem<PieWidgetData>[];
5
+ export declare function pieConfig(props: PieConfig): PieWidgetConfig;
@@ -0,0 +1,3 @@
1
+ export type { PieWidgetData, PieWidgetState, PieWidgetConfig, PieConfig, } from './types';
2
+ export { pieConfig, pieDownloadConfig } from './config';
3
+ export { PieSkeleton } from './skeleton';
@@ -0,0 +1 @@
1
+ export declare function PieSkeleton(): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,15 @@
1
+ import { Theme } from '@mui/material';
2
+ export declare const styles: {
3
+ skeleton: {
4
+ graph: {
5
+ readonly container: {
6
+ readonly display: "flex";
7
+ readonly alignItems: "center";
8
+ readonly justifyContent: "space-between";
9
+ readonly flexDirection: "column";
10
+ readonly gap: ({ spacing }: Theme) => string;
11
+ readonly height: ({ spacing }: Theme) => string;
12
+ };
13
+ };
14
+ };
15
+ };
@@ -0,0 +1,9 @@
1
+ import { EchartWidgetData, EchartWidgetState } from '../echart';
2
+ import { EchartWidgetOptionProps, EchartWidgetProps } from '../echart/types';
3
+ import { ConfigProps } from '../loader';
4
+ export type PieWidgetData = EchartWidgetData;
5
+ export type PieWidgetState = EchartWidgetState;
6
+ export type PieWidgetConfig = EchartWidgetProps & {
7
+ type: 'pie';
8
+ };
9
+ export type PieConfig = ConfigProps & EchartWidgetOptionProps<PieWidgetData>;
@@ -0,0 +1,2 @@
1
+ import { RangeItemProps } from '../types';
2
+ export declare function RangeItem({ id, index }: RangeItemProps): import("react/jsx-runtime").JSX.Element | null;
@@ -0,0 +1,6 @@
1
+ import { RangeWidgetConfig } from './types';
2
+ export interface RangeConfigProps {
3
+ formatter?: (value: number) => string;
4
+ onChange?: (value: number[], index: number) => void;
5
+ }
6
+ export declare function rangeConfig(): RangeWidgetConfig;
@@ -0,0 +1,6 @@
1
+ export { RangeUI } from './range-ui';
2
+ export { RangeSkeleton } from './skeleton';
3
+ export { rangeConfig } from './config';
4
+ export { RangeItem } from './components/range-item';
5
+ export type { RangeWidgetState, RangeWidgetConfig, RangeDownloadConfig, RangeUIProps, RangeDataItem, RangeWidgetData, RangeItemProps, } from './types';
6
+ export { sanitizeRangeDataItem, sanitizeRangeDataItems } from './serializer';
@@ -0,0 +1,2 @@
1
+ import { RangeUIProps } from './types';
2
+ export declare function RangeUI(props: RangeUIProps): import("react/jsx-runtime").JSX.Element;