@carto/ps-react-ui 4.9.1 → 4.11.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (207) hide show
  1. package/dist/category-Dnd2_j0x.js +719 -0
  2. package/dist/category-Dnd2_j0x.js.map +1 -0
  3. package/dist/change-column-DjjwoPt1.js +1143 -0
  4. package/dist/change-column-DjjwoPt1.js.map +1 -0
  5. package/dist/chat.js +1507 -0
  6. package/dist/chat.js.map +1 -0
  7. package/dist/components.js +122 -120
  8. package/dist/components.js.map +1 -1
  9. package/dist/copy-button-DGL1tyli.js +26 -0
  10. package/dist/copy-button-DGL1tyli.js.map +1 -0
  11. package/dist/{data-zoom-layout-0QSptXG_.js → data-zoom-layout-CkVnm6ej.js} +3 -3
  12. package/dist/{data-zoom-layout-0QSptXG_.js.map → data-zoom-layout-CkVnm6ej.js.map} +1 -1
  13. package/dist/{download-config-CzmjOT2T.js → download-config-oJIFZ2WC.js} +9 -8
  14. package/dist/{download-config-CzmjOT2T.js.map → download-config-oJIFZ2WC.js.map} +1 -1
  15. package/dist/{png-item-CS4z1iSH.js → png-item-BE9uEqlD.js} +2 -2
  16. package/dist/png-item-BE9uEqlD.js.map +1 -0
  17. package/dist/{spread-Y9R1f5dm.js → spread-DYNpzgh_.js} +10 -11
  18. package/dist/{spread-Y9R1f5dm.js.map → spread-DYNpzgh_.js.map} +1 -1
  19. package/dist/{table-CQCAnDLb.js → table-C9IMbTr0.js} +50 -53
  20. package/dist/table-C9IMbTr0.js.map +1 -0
  21. package/dist/types/chat/bubbles/chat-error-message.d.ts +2 -0
  22. package/dist/types/chat/bubbles/chat-suggestion-button.d.ts +2 -0
  23. package/dist/types/chat/bubbles/chat-user-message.d.ts +2 -0
  24. package/dist/types/chat/bubbles/index.d.ts +4 -0
  25. package/dist/types/chat/const.d.ts +4 -0
  26. package/dist/types/chat/containers/chat-content.d.ts +2 -0
  27. package/dist/types/chat/containers/chat-footer.d.ts +2 -0
  28. package/dist/types/chat/containers/chat-header.d.ts +2 -0
  29. package/dist/types/chat/containers/chat-starter.d.ts +2 -0
  30. package/dist/types/chat/containers/index.d.ts +4 -0
  31. package/dist/types/chat/containers/styles.d.ts +93 -0
  32. package/dist/types/chat/feedback/chat-loader.d.ts +2 -0
  33. package/dist/types/chat/feedback/chat-rating-action.d.ts +2 -0
  34. package/dist/types/chat/feedback/chat-thinking.d.ts +2 -0
  35. package/dist/types/chat/feedback/chat-tool-code-area.d.ts +2 -0
  36. package/dist/types/chat/feedback/chat-tool-full-view-dialog.d.ts +2 -0
  37. package/dist/types/chat/feedback/chat-tool-group.d.ts +2 -0
  38. package/dist/types/chat/feedback/chat-tool-trace.d.ts +3 -0
  39. package/dist/types/chat/feedback/get-tool-label.d.ts +2 -0
  40. package/dist/types/chat/feedback/index.d.ts +8 -0
  41. package/dist/types/chat/feedback/styles.d.ts +211 -0
  42. package/dist/types/chat/index.d.ts +20 -0
  43. package/dist/types/chat/types.d.ts +184 -0
  44. package/dist/types/chat/use-typewriter.d.ts +30 -0
  45. package/dist/types/components/copy-button/copy-button.d.ts +2 -0
  46. package/dist/types/components/copy-button/types.d.ts +6 -0
  47. package/dist/types/components/index.d.ts +2 -0
  48. package/dist/types/widgets/actions/brush-toggle/style.d.ts +1 -1
  49. package/dist/types/widgets/actions/shared/styles.d.ts +1 -1
  50. package/dist/types/widgets/actions/zoom-toggle/style.d.ts +1 -1
  51. package/dist/types/widgets/echart/types.d.ts +1 -1
  52. package/dist/types/widgets/toolbar-actions/styles.d.ts +1 -1
  53. package/dist/types/widgets-v2/actions/brush-toggle/style.d.ts +1 -1
  54. package/dist/types/widgets-v2/actions/change-column/style.d.ts +1 -1
  55. package/dist/types/widgets-v2/actions/fullscreen/style.d.ts +1 -1
  56. package/dist/types/widgets-v2/actions/index.d.ts +1 -0
  57. package/dist/types/widgets-v2/actions/lock-selection/style.d.ts +1 -1
  58. package/dist/types/widgets-v2/actions/relative-data/style.d.ts +1 -1
  59. package/dist/types/widgets-v2/actions/searcher/style.d.ts +1 -1
  60. package/dist/types/widgets-v2/actions/show-all/index.d.ts +2 -0
  61. package/dist/types/widgets-v2/actions/show-all/labels.d.ts +5 -0
  62. package/dist/types/widgets-v2/actions/show-all/show-all.d.ts +33 -0
  63. package/dist/types/widgets-v2/actions/show-all/style.d.ts +8 -0
  64. package/dist/types/widgets-v2/actions/stack-toggle/style.d.ts +1 -1
  65. package/dist/types/widgets-v2/actions/zoom-toggle/style.d.ts +1 -1
  66. package/dist/types/widgets-v2/category/category-ui.d.ts +9 -2
  67. package/dist/types/widgets-v2/category/category.d.ts +9 -2
  68. package/dist/types/widgets-v2/category/components/category-row-other.d.ts +19 -6
  69. package/dist/types/widgets-v2/category/style.d.ts +21 -2
  70. package/dist/types/widgets-v2/category/types.d.ts +2 -0
  71. package/dist/types/widgets-v2/index.d.ts +3 -2
  72. package/dist/types/widgets-v2/selection-summary/labels.d.ts +7 -2
  73. package/dist/types/widgets-v2/selection-summary/selection-summary.d.ts +13 -6
  74. package/dist/types/widgets-v2/selection-summary/style.d.ts +15 -0
  75. package/dist/widgets/actions.js +115 -114
  76. package/dist/widgets/actions.js.map +1 -1
  77. package/dist/widgets/bar.js +1 -1
  78. package/dist/widgets/category.js +9 -8
  79. package/dist/widgets/category.js.map +1 -1
  80. package/dist/widgets/formula.js +11 -10
  81. package/dist/widgets/formula.js.map +1 -1
  82. package/dist/widgets/histogram.js +7 -6
  83. package/dist/widgets/histogram.js.map +1 -1
  84. package/dist/widgets/markdown.js +9 -8
  85. package/dist/widgets/markdown.js.map +1 -1
  86. package/dist/widgets/pie.js +1 -1
  87. package/dist/widgets/scatterplot.js +1 -1
  88. package/dist/widgets/spread.js +9 -8
  89. package/dist/widgets/spread.js.map +1 -1
  90. package/dist/widgets/table.js +17 -16
  91. package/dist/widgets/table.js.map +1 -1
  92. package/dist/widgets/timeseries.js +1 -1
  93. package/dist/widgets/utils.js +1 -1
  94. package/dist/widgets/wrapper.js +3 -2
  95. package/dist/widgets/wrapper.js.map +1 -1
  96. package/dist/widgets-v2/actions.js +41 -37
  97. package/dist/widgets-v2/bar.js +9 -10
  98. package/dist/widgets-v2/bar.js.map +1 -1
  99. package/dist/widgets-v2/category.js +25 -26
  100. package/dist/widgets-v2/category.js.map +1 -1
  101. package/dist/widgets-v2/formula.js +3 -3
  102. package/dist/widgets-v2/histogram.js +11 -13
  103. package/dist/widgets-v2/histogram.js.map +1 -1
  104. package/dist/widgets-v2/markdown.js +26 -27
  105. package/dist/widgets-v2/markdown.js.map +1 -1
  106. package/dist/widgets-v2/pie.js +8 -10
  107. package/dist/widgets-v2/pie.js.map +1 -1
  108. package/dist/widgets-v2/scatterplot.js +10 -12
  109. package/dist/widgets-v2/scatterplot.js.map +1 -1
  110. package/dist/widgets-v2/spread.js +15 -16
  111. package/dist/widgets-v2/spread.js.map +1 -1
  112. package/dist/widgets-v2/table.js +39 -40
  113. package/dist/widgets-v2/table.js.map +1 -1
  114. package/dist/widgets-v2/timeseries.js +9 -11
  115. package/dist/widgets-v2/timeseries.js.map +1 -1
  116. package/dist/widgets-v2/utils.js +1 -1
  117. package/dist/widgets-v2.js +284 -282
  118. package/dist/widgets-v2.js.map +1 -1
  119. package/package.json +5 -1
  120. package/src/chat/bubbles/chat-agent-message.test.tsx +30 -0
  121. package/src/chat/bubbles/chat-agent-message.tsx +11 -0
  122. package/src/chat/bubbles/chat-error-message.test.tsx +40 -0
  123. package/src/chat/bubbles/chat-error-message.tsx +47 -0
  124. package/src/chat/bubbles/chat-suggestion-button.test.tsx +24 -0
  125. package/src/chat/bubbles/chat-suggestion-button.tsx +27 -0
  126. package/src/chat/bubbles/chat-user-message.test.tsx +27 -0
  127. package/src/chat/bubbles/chat-user-message.tsx +27 -0
  128. package/src/chat/bubbles/index.ts +4 -0
  129. package/src/chat/bubbles/styles.ts +148 -0
  130. package/src/chat/const.ts +4 -0
  131. package/src/chat/containers/chat-content.test.tsx +269 -0
  132. package/src/chat/containers/chat-content.tsx +142 -0
  133. package/src/chat/containers/chat-footer.test.tsx +34 -0
  134. package/src/chat/containers/chat-footer.tsx +78 -0
  135. package/src/chat/containers/chat-header.test.tsx +28 -0
  136. package/src/chat/containers/chat-header.tsx +29 -0
  137. package/src/chat/containers/chat-starter.test.tsx +32 -0
  138. package/src/chat/containers/chat-starter.tsx +75 -0
  139. package/src/chat/containers/index.ts +4 -0
  140. package/src/chat/containers/styles.ts +96 -0
  141. package/src/chat/feedback/chat-actions-container.test.tsx +64 -0
  142. package/src/chat/feedback/chat-actions-container.tsx +7 -0
  143. package/src/chat/feedback/chat-loader.test.tsx +10 -0
  144. package/src/chat/feedback/chat-loader.tsx +31 -0
  145. package/src/chat/feedback/chat-rating-action.tsx +43 -0
  146. package/src/chat/feedback/chat-thinking.test.tsx +15 -0
  147. package/src/chat/feedback/chat-thinking.tsx +23 -0
  148. package/src/chat/feedback/chat-tool-code-area.test.tsx +23 -0
  149. package/src/chat/feedback/chat-tool-code-area.tsx +71 -0
  150. package/src/chat/feedback/chat-tool-full-view-dialog.test.tsx +39 -0
  151. package/src/chat/feedback/chat-tool-full-view-dialog.tsx +121 -0
  152. package/src/chat/feedback/chat-tool-group.test.tsx +84 -0
  153. package/src/chat/feedback/chat-tool-group.tsx +156 -0
  154. package/src/chat/feedback/chat-tool-trace.test.tsx +81 -0
  155. package/src/chat/feedback/chat-tool-trace.tsx +192 -0
  156. package/src/chat/feedback/get-tool-label.test.tsx +91 -0
  157. package/src/chat/feedback/get-tool-label.ts +13 -0
  158. package/src/chat/feedback/index.ts +8 -0
  159. package/src/chat/feedback/styles.ts +229 -0
  160. package/src/chat/index.ts +59 -0
  161. package/src/chat/types.ts +215 -0
  162. package/src/chat/use-typewriter.test.tsx +38 -0
  163. package/src/chat/use-typewriter.ts +82 -0
  164. package/src/components/copy-button/copy-button.test.tsx +41 -0
  165. package/src/components/copy-button/copy-button.tsx +31 -0
  166. package/src/components/copy-button/types.ts +10 -0
  167. package/src/components/index.ts +3 -0
  168. package/src/widgets/echart/types.ts +1 -1
  169. package/src/widgets-v2/actions/brush-toggle/brush-toggle.tsx +1 -1
  170. package/src/widgets-v2/actions/change-column/sortable-column-item.tsx +1 -1
  171. package/src/widgets-v2/actions/download/download.tsx +1 -1
  172. package/src/widgets-v2/actions/download/icons.tsx +1 -1
  173. package/src/widgets-v2/actions/fullscreen/fullscreen.tsx +3 -3
  174. package/src/widgets-v2/actions/index.ts +8 -0
  175. package/src/widgets-v2/actions/lock-selection/lock-selection.tsx +2 -2
  176. package/src/widgets-v2/actions/relative-data/relative-data.tsx +1 -1
  177. package/src/widgets-v2/actions/searcher/searcher-toggle.tsx +1 -1
  178. package/src/widgets-v2/actions/searcher/searcher.tsx +2 -2
  179. package/src/widgets-v2/actions/show-all/index.ts +7 -0
  180. package/src/widgets-v2/actions/show-all/labels.ts +8 -0
  181. package/src/widgets-v2/actions/show-all/show-all.test.tsx +50 -0
  182. package/src/widgets-v2/actions/show-all/show-all.tsx +72 -0
  183. package/src/widgets-v2/actions/show-all/style.ts +8 -0
  184. package/src/widgets-v2/actions/stack-toggle/stack-toggle.tsx +1 -1
  185. package/src/widgets-v2/actions/zoom-toggle/zoom-toggle.tsx +1 -1
  186. package/src/widgets-v2/category/category-ui.test.tsx +26 -10
  187. package/src/widgets-v2/category/category-ui.tsx +13 -3
  188. package/src/widgets-v2/category/category.test.tsx +4 -4
  189. package/src/widgets-v2/category/category.tsx +10 -1
  190. package/src/widgets-v2/category/components/category-row-other.test.tsx +36 -7
  191. package/src/widgets-v2/category/components/category-row-other.tsx +64 -13
  192. package/src/widgets-v2/category/style.ts +35 -4
  193. package/src/widgets-v2/category/types.ts +2 -0
  194. package/src/widgets-v2/index.ts +3 -0
  195. package/src/widgets-v2/selection-summary/labels.ts +8 -4
  196. package/src/widgets-v2/selection-summary/selection-summary.test.tsx +15 -9
  197. package/src/widgets-v2/selection-summary/selection-summary.tsx +42 -22
  198. package/src/widgets-v2/selection-summary/style.ts +15 -0
  199. package/src/widgets-v2/table/table-ui.tsx +4 -4
  200. package/src/widgets-v2/toolbox/toolbox.tsx +1 -1
  201. package/src/widgets-v2/wrapper/widget-wrapper.tsx +1 -1
  202. package/dist/category-DwaeYjpX.js +0 -656
  203. package/dist/category-DwaeYjpX.js.map +0 -1
  204. package/dist/change-column-B4IT0rh6.js +0 -1110
  205. package/dist/change-column-B4IT0rh6.js.map +0 -1
  206. package/dist/png-item-CS4z1iSH.js.map +0 -1
  207. package/dist/table-CQCAnDLb.js.map +0 -1
@@ -0,0 +1,2 @@
1
+ import { ChatHeaderProps } from '../types';
2
+ export declare function ChatHeader({ leftSlot, title, rightSlot, onClose, sx, }: ChatHeaderProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,2 @@
1
+ import { ChatStarterProps } from '../types';
2
+ export declare function ChatStarter({ icon, title, description, items, size, onSelect, sx, }: ChatStarterProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,4 @@
1
+ export { ChatContent } from './chat-content';
2
+ export { ChatHeader } from './chat-header';
3
+ export { ChatFooter } from './chat-footer';
4
+ export { ChatStarter } from './chat-starter';
@@ -0,0 +1,93 @@
1
+ import { Theme } from '@mui/material';
2
+ export declare const styles: {
3
+ header: {
4
+ display: "flex";
5
+ alignItems: "center";
6
+ justifyContent: "space-between";
7
+ padding: ({ spacing }: Theme) => string;
8
+ };
9
+ headerTitle: {
10
+ flexGrow: number;
11
+ px: ({ spacing }: Theme) => string;
12
+ };
13
+ headerActions: {
14
+ display: "flex";
15
+ alignItems: "center";
16
+ marginLeft: ({ spacing }: Theme) => string;
17
+ gap: ({ spacing }: Theme) => string;
18
+ };
19
+ footerWrapper: {
20
+ padding: ({ spacing }: Theme) => string;
21
+ position: "relative";
22
+ };
23
+ footerCorner: {
24
+ position: "absolute";
25
+ bottom: string;
26
+ right: string;
27
+ margin: string;
28
+ };
29
+ footer: {
30
+ maxWidth: number;
31
+ margin: string;
32
+ '&.MuiFilledInput-root.MuiInputBase-multiline.MuiInputBase-sizeSmall textarea': {
33
+ resize: "none";
34
+ maxHeight: string;
35
+ overflowY: "auto !important";
36
+ paddingRight: ({ spacing }: Theme) => string;
37
+ };
38
+ };
39
+ footerCaption: {
40
+ textAlign: "center";
41
+ };
42
+ content: {
43
+ overflowY: "auto";
44
+ flex: number;
45
+ position: "relative";
46
+ mx: string;
47
+ maxWidth: number;
48
+ width: string;
49
+ maxHeight: string;
50
+ pt: number;
51
+ pb: number;
52
+ px: number;
53
+ display: "flex";
54
+ flexDirection: "column";
55
+ borderTopWidth: string;
56
+ borderTopStyle: "solid";
57
+ borderBottomWidth: string;
58
+ borderBottomStyle: "solid";
59
+ };
60
+ sentinel: {
61
+ height: string;
62
+ flexShrink: number;
63
+ };
64
+ jumpToLatestWrapper: {
65
+ position: "sticky";
66
+ bottom: ({ spacing }: Theme) => string;
67
+ height: number;
68
+ display: "flex";
69
+ justifyContent: "center";
70
+ zIndex: number;
71
+ };
72
+ jumpToLatest: {
73
+ transition: "opacity 0.2s";
74
+ };
75
+ starter: {
76
+ display: "flex";
77
+ flexDirection: "column";
78
+ alignItems: "center";
79
+ justifyContent: "center";
80
+ padding: ({ spacing }: Theme) => string;
81
+ textAlign: "center";
82
+ maxWidth: number;
83
+ margin: string;
84
+ };
85
+ starterItems: {
86
+ display: "grid";
87
+ width: string;
88
+ marginTop: ({ spacing }: Theme) => string;
89
+ };
90
+ starterItemsTwoCol: {
91
+ gridTemplateColumns: string;
92
+ };
93
+ };
@@ -0,0 +1,2 @@
1
+ import { ChatLoaderProps } from '../types';
2
+ export declare function ChatLoader({ size, labels, sx }: ChatLoaderProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,2 @@
1
+ import { ChatRatingActionProps } from '../types';
2
+ export declare function ChatRatingAction({ rating, onRatingChange, labels, }: ChatRatingActionProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,2 @@
1
+ import { ChatThinkingProps } from '../types';
2
+ export declare function ChatThinking({ children, duration, sx, }: ChatThinkingProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,2 @@
1
+ import { ChatToolCodeAreaProps } from '../types';
2
+ export declare function ChatToolCodeArea({ content, title, isError, labels, sx, }: ChatToolCodeAreaProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,2 @@
1
+ import { ChatToolFullViewDialogProps } from '../types';
2
+ export declare function ChatToolFullViewDialog({ open, onClose, title, content, }: ChatToolFullViewDialogProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,2 @@
1
+ import { ChatToolGroupProps } from '../types';
2
+ export declare function ChatToolGroup({ tools, expanded: _expanded, onExpandedChange: _setExpanded, expandedTools: _expandedTools, onToolExpandedChange: _setExpandedTools, labels, sx, }: ChatToolGroupProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,3 @@
1
+ import { ChatToolTraceProps } from '../types';
2
+ export declare function ChatToolTraceDetails({ tool, labels, }: Pick<ChatToolTraceProps, 'tool' | 'labels'>): import("react/jsx-runtime").JSX.Element;
3
+ export declare function ChatToolTrace({ tool, expanded, onExpandedChange, labels, sx, }: ChatToolTraceProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,2 @@
1
+ import { ChatToolItem } from '../types';
2
+ export declare function getToolLabel(tool: ChatToolItem): string;
@@ -0,0 +1,8 @@
1
+ export { ChatThinking } from './chat-thinking';
2
+ export { ChatLoader } from './chat-loader';
3
+ export { ChatActionsContainer } from './chat-actions-container';
4
+ export { ChatRatingAction } from './chat-rating-action';
5
+ export { ChatToolTrace } from './chat-tool-trace';
6
+ export { ChatToolCodeArea } from './chat-tool-code-area';
7
+ export { ChatToolFullViewDialog } from './chat-tool-full-view-dialog';
8
+ export { ChatToolGroup } from './chat-tool-group';
@@ -0,0 +1,211 @@
1
+ import { Theme } from '@mui/material';
2
+ export declare const styles: {
3
+ thinking: {
4
+ display: "flex";
5
+ alignItems: "center";
6
+ minHeight: ({ spacing }: Theme) => string;
7
+ background: ({ palette }: Theme) => string;
8
+ backgroundSize: string;
9
+ backgroundClip: "text";
10
+ WebkitBackgroundClip: "text";
11
+ WebkitTextFillColor: "transparent";
12
+ animation: `${{
13
+ name: string;
14
+ styles: string;
15
+ anim: 1;
16
+ toString: () => string;
17
+ } & string} 2s ease-in-out infinite`;
18
+ animationDuration: "2s";
19
+ };
20
+ loader: {
21
+ display: "flex";
22
+ alignItems: "center";
23
+ justifyContent: "center";
24
+ position: "relative";
25
+ p: number;
26
+ };
27
+ loaderOuterCircle: {
28
+ position: "absolute";
29
+ inset: number;
30
+ margin: string;
31
+ borderRadius: string;
32
+ backgroundColor: ({ palette }: Theme) => string;
33
+ animation: `${{
34
+ name: string;
35
+ styles: string;
36
+ anim: 1;
37
+ toString: () => string;
38
+ } & string} 1s ease-in-out infinite`;
39
+ };
40
+ loaderInnerCircle: {
41
+ position: "absolute";
42
+ inset: number;
43
+ margin: string;
44
+ borderRadius: string;
45
+ backgroundColor: ({ palette }: Theme) => string;
46
+ animation: `${{
47
+ name: string;
48
+ styles: string;
49
+ anim: 1;
50
+ toString: () => string;
51
+ } & string} 1s ease-in-out infinite`;
52
+ };
53
+ traceHeader: {
54
+ display: "flex";
55
+ alignItems: "center";
56
+ padding: number;
57
+ paddingLeft: ({ spacing }: Theme) => string;
58
+ borderRadius: ({ spacing }: Theme) => string;
59
+ width: string;
60
+ color: ({ palette }: Theme) => string;
61
+ '&:hover': {
62
+ backgroundColor: ({ palette }: Theme) => string;
63
+ };
64
+ };
65
+ traceChevron: {
66
+ color: ({ palette }: Theme) => string;
67
+ transition: "transform 0.2s";
68
+ };
69
+ traceDetailsWrapper: {
70
+ marginTop: ({ spacing }: Theme) => string;
71
+ padding: ({ spacing }: Theme) => string;
72
+ border: "1px solid";
73
+ borderColor: "divider";
74
+ borderRadius: ({ spacing }: Theme) => string;
75
+ };
76
+ traceField: {
77
+ display: "flex";
78
+ alignItems: "flex-start";
79
+ gap: ({ spacing }: Theme) => string;
80
+ };
81
+ traceFieldLabel: {
82
+ flexShrink: number;
83
+ };
84
+ traceReference: {
85
+ display: "flex";
86
+ borderRadius: ({ spacing }: Theme) => string;
87
+ padding: ({ spacing }: Theme) => string;
88
+ gap: ({ spacing }: Theme) => string;
89
+ backgroundColor: ({ palette }: Theme) => string;
90
+ color: ({ palette }: Theme) => string;
91
+ };
92
+ traceStatusSuccess: {
93
+ color: ({ palette }: Theme) => string;
94
+ };
95
+ traceStatusError: {
96
+ color: ({ palette }: Theme) => string;
97
+ };
98
+ codeArea: {
99
+ position: "relative";
100
+ width: string;
101
+ };
102
+ codeAreaPre: {
103
+ margin: number;
104
+ padding: ({ spacing }: Theme) => string;
105
+ borderRadius: ({ spacing }: Theme) => string;
106
+ backgroundColor: ({ palette }: Theme) => string;
107
+ fontSize: string;
108
+ fontFamily: "monospace";
109
+ whiteSpace: "pre-wrap";
110
+ wordBreak: "break-word";
111
+ overflowY: "auto";
112
+ };
113
+ codeAreaPreError: {
114
+ borderLeft: ({ palette }: Theme) => string;
115
+ backgroundColor: ({ palette }: Theme) => string;
116
+ };
117
+ codeAreaFullViewButton: {
118
+ position: "absolute";
119
+ top: ({ spacing }: Theme) => string;
120
+ right: ({ spacing }: Theme) => string;
121
+ };
122
+ fullViewDialog: {
123
+ margin: ({ spacing }: Theme) => string;
124
+ };
125
+ fullViewPaper: {
126
+ borderRadius: number;
127
+ };
128
+ fullViewTitle: {
129
+ display: "flex";
130
+ alignItems: "center";
131
+ justifyContent: "space-between";
132
+ padding: ({ spacing }: Theme) => string;
133
+ borderBottom: string;
134
+ borderBottomColor: "divider";
135
+ };
136
+ fullViewDialogContent: {
137
+ padding: number;
138
+ '&:first-of-type': {
139
+ paddingTop: number;
140
+ };
141
+ };
142
+ fullViewPre: {
143
+ margin: number;
144
+ padding: ({ spacing }: Theme) => string;
145
+ background: ({ palette, spacing }: Theme) => string;
146
+ fontFamily: "monospace";
147
+ fontSize: string;
148
+ whiteSpace: "pre-wrap";
149
+ wordBreak: "break-word";
150
+ lineHeight: number;
151
+ counterReset: "line";
152
+ };
153
+ fullViewLine: {
154
+ display: "block";
155
+ '&::before': {
156
+ counterIncrement: "line";
157
+ content: "counter(line)";
158
+ display: "inline-block";
159
+ width: string;
160
+ marginRight: string;
161
+ textAlign: "right";
162
+ color: ({ palette }: Theme) => string;
163
+ userSelect: "none";
164
+ };
165
+ };
166
+ groupHeader: {
167
+ textAlign: "left";
168
+ display: "flex";
169
+ alignItems: "center";
170
+ borderRadius: number;
171
+ gap: ({ spacing }: Theme) => string;
172
+ };
173
+ errorBadge: {
174
+ color: ({ palette }: Theme) => string;
175
+ fontWeight: number;
176
+ display: "flex";
177
+ alignItems: "center";
178
+ gap: ({ spacing }: Theme) => string;
179
+ };
180
+ syntaxToken_key: {
181
+ color: "#881280";
182
+ };
183
+ syntaxToken_string: {
184
+ color: "#c41a16";
185
+ };
186
+ syntaxToken_number: {
187
+ color: "#1c00cf";
188
+ };
189
+ syntaxToken_boolean: {
190
+ color: "#1c00cf";
191
+ };
192
+ syntaxToken_null: {
193
+ color: "#808080";
194
+ };
195
+ syntaxToken_punctuation: {
196
+ color: ({ palette }: Theme) => string;
197
+ };
198
+ groupListItem: {
199
+ borderBottom: string;
200
+ borderColor: "divider";
201
+ '&:first-of-type .MuiButton-root': {
202
+ borderRadius: ({ spacing }: Theme) => string;
203
+ };
204
+ '&:last-of-type:not([aria-expanded=true]) .MuiButton-root': {
205
+ borderRadius: ({ spacing }: Theme) => string;
206
+ };
207
+ '&:last-of-type': {
208
+ borderBottomWidth: number;
209
+ };
210
+ };
211
+ };
@@ -0,0 +1,20 @@
1
+ export type { ChatSxProps, ChatErrorAction, ChatUserMessageProps, ChatAgentMessageProps, ChatErrorMessageProps, ChatSuggestionButtonProps, ChatThinkingProps, ChatLoaderProps, ChatContentProps, ChatContentRef, ChatHeaderProps, ChatFooterProps, ChatStarterItem, ChatStarterProps, ChatRatingActionProps, ChatToolItem, ChatToolTraceProps, ChatToolCodeAreaProps, ChatToolFullViewDialogProps, ChatToolGroupProps, } from './types';
2
+ export { CHAT_MAX_WIDTH, CHAT_SCROLL_DELAY, CHAT_DIVIDER_DELAY, CHAT_TOOL_CODE_AREA_MAX_HEIGHT, } from './const';
3
+ export { useTypewriter } from './use-typewriter';
4
+ export { ChatUserMessage } from './bubbles/chat-user-message';
5
+ export { ChatAgentMessage } from './bubbles/chat-agent-message';
6
+ export { ChatErrorMessage } from './bubbles/chat-error-message';
7
+ export { ChatSuggestionButton } from './bubbles/chat-suggestion-button';
8
+ export { ChatMessageOverflow } from './bubbles/styles';
9
+ export { ChatThinking } from './feedback/chat-thinking';
10
+ export { ChatLoader } from './feedback/chat-loader';
11
+ export { ChatContent } from './containers/chat-content';
12
+ export { ChatHeader } from './containers/chat-header';
13
+ export { ChatFooter } from './containers/chat-footer';
14
+ export { ChatStarter } from './containers/chat-starter';
15
+ export { ChatActionsContainer } from './feedback/chat-actions-container';
16
+ export { ChatRatingAction } from './feedback/chat-rating-action';
17
+ export { ChatToolTrace } from './feedback/chat-tool-trace';
18
+ export { ChatToolCodeArea } from './feedback/chat-tool-code-area';
19
+ export { ChatToolFullViewDialog } from './feedback/chat-tool-full-view-dialog';
20
+ export { ChatToolGroup } from './feedback/chat-tool-group';
@@ -0,0 +1,184 @@
1
+ import { ReactNode } from 'react';
2
+ import { ButtonBaseProps, SxProps, Theme } from '@mui/material';
3
+ export interface ChatSxProps {
4
+ sx?: SxProps<Theme>;
5
+ }
6
+ export interface ChatErrorAction {
7
+ label: string;
8
+ onClick: () => void;
9
+ }
10
+ export interface ChatUserMessageProps extends ChatSxProps {
11
+ children: ReactNode;
12
+ /** enabled to render text with a lighter color for indicating things like an error sending the message */
13
+ muted?: boolean;
14
+ /** content to render on top of the message for user attachments */
15
+ topContext?: ReactNode;
16
+ }
17
+ export interface ChatAgentMessageProps extends ChatSxProps {
18
+ children: ReactNode;
19
+ }
20
+ export interface ChatErrorMessageProps extends ChatSxProps {
21
+ errors: string[];
22
+ icon?: ReactNode;
23
+ actions?: ChatErrorAction[];
24
+ }
25
+ export interface ChatSuggestionButtonProps extends ChatSxProps, Omit<ButtonBaseProps, 'children'> {
26
+ label: ReactNode;
27
+ color?: string;
28
+ }
29
+ export interface ChatThinkingProps extends ChatSxProps {
30
+ duration?: number;
31
+ children?: ReactNode;
32
+ }
33
+ export interface ChatLoaderProps extends ChatSxProps {
34
+ size?: number;
35
+ labels?: {
36
+ loading?: string;
37
+ };
38
+ }
39
+ export interface ChatContentProps extends ChatSxProps {
40
+ children: ReactNode;
41
+ /**
42
+ * Smooth-scrolls to the bottom whenever new content is added — but only if
43
+ * the user was already at (or near) the bottom. Readers who scrolled up to
44
+ * revisit older messages are left alone. Defaults to `true`; pass `false`
45
+ * to opt out and manage scroll yourself via the ref.
46
+ */
47
+ autoScroll?: boolean;
48
+ labels?: {
49
+ jumpToLatest?: string;
50
+ };
51
+ }
52
+ /**
53
+ * Imperative handle exposed by `ChatContent` via `ref`. Use it to drive scroll
54
+ * from the parent — for example, calling `scrollToBottom()` when a new agent
55
+ * message arrives.
56
+ */
57
+ export interface ChatContentRef {
58
+ /** Smooth-scrolls the content area to the bottom. */
59
+ scrollToBottom: () => void;
60
+ /** Smooth-scrolls the content area to the top. */
61
+ scrollToTop: () => void;
62
+ /** `true` when the content area is scrolled to (or near) its bottom edge. */
63
+ isAtBottom: boolean;
64
+ /** `true` when the content area is scrolled to (or near) its top edge. */
65
+ isAtTop: boolean;
66
+ }
67
+ export interface ChatHeaderProps extends ChatSxProps {
68
+ leftSlot?: ReactNode;
69
+ title: ReactNode;
70
+ rightSlot?: ReactNode;
71
+ onClose?: () => void;
72
+ }
73
+ export interface ChatFooterProps extends ChatSxProps {
74
+ /** Current value of the chat message area. */
75
+ value: string;
76
+ /** Called with the new textarea value on every keystroke. */
77
+ onChange: (value: string) => void;
78
+ /** Called when the send button is clicked or Enter is pressed (without Shift). */
79
+ onSend: () => void;
80
+ /** Called when the stop button is clicked. Only shown while `isGenerating` is true. */
81
+ onStop?: () => void;
82
+ /** When true, swaps the send button for a stop button and disables the textarea. */
83
+ isGenerating?: boolean;
84
+ /** Disables the textarea and both send/stop buttons. */
85
+ disabled?: boolean;
86
+ /** Placeholder text for the textarea. Defaults to `'Type a message...'`. */
87
+ placeholder?: string;
88
+ /** Accessible labels for the send and stop buttons (used as `aria-label`). */
89
+ labels?: {
90
+ /** Defaults to `'Send'`. */
91
+ send?: string;
92
+ /** Defaults to `'Stop'`. */
93
+ stop?: string;
94
+ };
95
+ /** Helper text rendered under the input. Defaults to an AI disclaimer; pass `null` to hide. */
96
+ caption?: ReactNode;
97
+ }
98
+ export interface ChatStarterItem {
99
+ label: string;
100
+ color?: string;
101
+ }
102
+ export interface ChatStarterProps extends ChatSxProps {
103
+ icon?: ReactNode;
104
+ title?: ReactNode;
105
+ description?: ReactNode;
106
+ items: string[] | ChatStarterItem[];
107
+ size?: 'small' | 'medium';
108
+ onSelect?: (prompt: string) => void;
109
+ }
110
+ export interface ChatRatingActionProps {
111
+ onRatingChange?: (rating: 'up' | 'down' | null) => void;
112
+ rating?: 'up' | 'down' | null;
113
+ labels?: {
114
+ thumbUp?: string;
115
+ thumbDown?: string;
116
+ };
117
+ }
118
+ export interface ChatToolItem {
119
+ id: string;
120
+ name: string;
121
+ status: 'running' | 'complete' | 'error';
122
+ /** Display label shown while status is 'running'. Falls back to a capitalized `name`. */
123
+ runningLabel?: string;
124
+ /** Display label shown for non-running statuses. Falls back to a capitalized `name`. */
125
+ label?: string;
126
+ /** Friendly reference name for the tool (e.g. "add_marker"). Displayed with icon. */
127
+ reference?: string;
128
+ /** Execution duration in seconds (e.g. 1.8) */
129
+ duration?: number;
130
+ /** Input arguments as a JSON string or plain text */
131
+ inputArguments?: string;
132
+ /** Output as a JSON string or plain text */
133
+ output?: string;
134
+ }
135
+ export interface ChatToolTraceProps extends ChatSxProps {
136
+ tool: ChatToolItem;
137
+ /** Whether the trace accordion is expanded */
138
+ expanded?: boolean;
139
+ /** Callback when accordion expansion state changes */
140
+ onExpandedChange?: (expanded: boolean) => void;
141
+ labels?: {
142
+ toolExecuted?: string;
143
+ reference?: string;
144
+ duration?: string;
145
+ status?: string;
146
+ inputArguments?: string;
147
+ output?: string;
148
+ fullView?: string;
149
+ success?: string;
150
+ error?: string;
151
+ running?: string;
152
+ };
153
+ }
154
+ export interface ChatToolCodeAreaProps extends ChatSxProps {
155
+ /** Code content to display */
156
+ content: string;
157
+ /** Label for the full view dialog title */
158
+ title?: string;
159
+ /** Render with error styling (red left border, tinted background) */
160
+ isError?: boolean;
161
+ labels?: {
162
+ fullView?: string;
163
+ };
164
+ }
165
+ export interface ChatToolFullViewDialogProps {
166
+ open: boolean;
167
+ onClose: () => void;
168
+ title: string;
169
+ content: string;
170
+ }
171
+ export interface ChatToolGroupProps extends ChatSxProps {
172
+ tools: ChatToolItem[];
173
+ /** Whether the group accordion is expanded */
174
+ expanded?: boolean;
175
+ /** Callback when group expansion state changes */
176
+ onExpandedChange?: (expanded: boolean) => void;
177
+ /** Map of tool IDs to their individual expanded state. Used to preserve expansion state during grouping. */
178
+ expandedTools?: Record<string, boolean>;
179
+ /** Callback when an individual tool's expansion state changes */
180
+ onToolExpandedChange?: (value: Record<string, boolean>, toolId?: string) => void;
181
+ labels?: ChatToolTraceProps['labels'] & {
182
+ toolsUsed?: string;
183
+ };
184
+ }
@@ -0,0 +1,30 @@
1
+ interface UseTypewriterOptions {
2
+ /** Characters revealed per second (default: `500`). */
3
+ speed?: number;
4
+ /** When true on mount, skip the animation and reveal the full text immediately. */
5
+ skipAnimation?: boolean;
6
+ }
7
+ interface UseTypewriterResult {
8
+ /** The portion of `fullText` revealed so far. */
9
+ displayedText: string;
10
+ /** `true` while characters are still being revealed. */
11
+ isTyping: boolean;
12
+ }
13
+ /**
14
+ * Reveals a string character-by-character at a steady rate via
15
+ * `requestAnimationFrame`. Useful for smoothing out bursty WebSocket-streamed
16
+ * agent message text — pair it with `ChatAgentMessage`.
17
+ *
18
+ * @example
19
+ * ```tsx
20
+ * const { displayedText, isTyping } = useTypewriter(message)
21
+ * return (
22
+ * <ChatAgentMessage>
23
+ * <Markdown>{displayedText}</Markdown>
24
+ * {isTyping ? <Cursor /> : null}
25
+ * </ChatAgentMessage>
26
+ * )
27
+ * ```
28
+ */
29
+ export declare function useTypewriter(fullText: string, options?: UseTypewriterOptions): UseTypewriterResult;
30
+ export {};
@@ -0,0 +1,2 @@
1
+ import { CopyButtonProps } from './types';
2
+ export declare function CopyButton({ copyText, onSuccess, onError, 'aria-label': ariaLabel, ...props }: CopyButtonProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,6 @@
1
+ import { IconButtonProps } from '@mui/material/IconButton';
2
+ export interface CopyButtonProps extends Omit<IconButtonProps, 'onError' | 'onClick'> {
3
+ copyText: string;
4
+ onSuccess?: () => void;
5
+ onError?: (err: Error) => void;
6
+ }
@@ -18,3 +18,5 @@ export { BasemapsUI } from './basemaps/basemaps';
18
18
  export type { BasemapsUIProps } from './basemaps/types';
19
19
  export { Tooltip, setTooltipEnterDelay } from './tooltip/tooltip';
20
20
  export { SmartTooltip } from './smart-tooltip/smart-tooltip';
21
+ export type { CopyButtonProps } from './copy-button/types';
22
+ export { CopyButton } from './copy-button/copy-button';
@@ -8,7 +8,7 @@ export declare const styles: {
8
8
  };
9
9
  trigger: {
10
10
  '&[data-active="true"]': {
11
- background: (theme: Theme) => any;
11
+ background: (theme: Theme) => string;
12
12
  };
13
13
  };
14
14
  };
@@ -5,7 +5,7 @@ import { Theme } from '@mui/material';
5
5
  export declare const actionButtonStyles: {
6
6
  trigger: {
7
7
  '&[data-active="true"]': {
8
- background: (theme: Theme) => any;
8
+ background: (theme: Theme) => string;
9
9
  };
10
10
  };
11
11
  };
@@ -7,7 +7,7 @@ export declare const styles: {
7
7
  };
8
8
  trigger: {
9
9
  '&[data-active="true"]': {
10
- background: (theme: Theme) => any;
10
+ background: (theme: Theme) => string;
11
11
  };
12
12
  };
13
13
  };
@@ -1,7 +1,7 @@
1
1
  import { EChartsOption } from 'echarts';
2
2
  import { BaseWidgetState } from '../stores/types';
3
3
  import { Ref, RefObject } from 'react';
4
- import { theme as CartoTheme } from '../../theme';
4
+ import { theme as CartoTheme } from '@carto/meridian-ds/theme';
5
5
  import type * as echarts from 'echarts';
6
6
  export type EchartOptionsProps = EChartsOption;
7
7
  export interface EchartUIProps {
@@ -31,7 +31,7 @@ export declare const styles: {
31
31
  };
32
32
  triggerButton: {
33
33
  '&[data-active="true"]': {
34
- backgroundColor: ({ palette }: Theme) => any;
34
+ backgroundColor: ({ palette }: Theme) => string;
35
35
  };
36
36
  };
37
37
  };