@carto/ps-react-ui 4.9.0 → 4.11.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 (186) 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-BiuuHCDN.js +1156 -0
  4. package/dist/change-column-BiuuHCDN.js.map +1 -0
  5. package/dist/chat.js +1507 -0
  6. package/dist/chat.js.map +1 -0
  7. package/dist/components.js +125 -122
  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-BH0LPwSy.js → data-zoom-layout--YiY6ko_.js} +5 -4
  12. package/dist/{data-zoom-layout-BH0LPwSy.js.map → data-zoom-layout--YiY6ko_.js.map} +1 -1
  13. package/dist/{download-config-DNLkypdN.js → download-config-oJIFZ2WC.js} +10 -9
  14. package/dist/{download-config-DNLkypdN.js.map → download-config-oJIFZ2WC.js.map} +1 -1
  15. package/dist/{lasso-tool-BYbxrJ-7.js → lasso-tool-CDFj4zKY.js} +2 -1
  16. package/dist/lasso-tool-CDFj4zKY.js.map +1 -0
  17. package/dist/{spread-CTuIXZSM.js → spread-CPis22AE.js} +5 -4
  18. package/dist/{spread-CTuIXZSM.js.map → spread-CPis22AE.js.map} +1 -1
  19. package/dist/types/chat/bubbles/chat-error-message.d.ts +2 -0
  20. package/dist/types/chat/bubbles/chat-suggestion-button.d.ts +2 -0
  21. package/dist/types/chat/bubbles/chat-user-message.d.ts +2 -0
  22. package/dist/types/chat/bubbles/index.d.ts +4 -0
  23. package/dist/types/chat/const.d.ts +4 -0
  24. package/dist/types/chat/containers/chat-content.d.ts +2 -0
  25. package/dist/types/chat/containers/chat-footer.d.ts +2 -0
  26. package/dist/types/chat/containers/chat-header.d.ts +2 -0
  27. package/dist/types/chat/containers/chat-starter.d.ts +2 -0
  28. package/dist/types/chat/containers/index.d.ts +4 -0
  29. package/dist/types/chat/containers/styles.d.ts +93 -0
  30. package/dist/types/chat/feedback/chat-loader.d.ts +2 -0
  31. package/dist/types/chat/feedback/chat-rating-action.d.ts +2 -0
  32. package/dist/types/chat/feedback/chat-thinking.d.ts +2 -0
  33. package/dist/types/chat/feedback/chat-tool-code-area.d.ts +2 -0
  34. package/dist/types/chat/feedback/chat-tool-full-view-dialog.d.ts +2 -0
  35. package/dist/types/chat/feedback/chat-tool-group.d.ts +2 -0
  36. package/dist/types/chat/feedback/chat-tool-trace.d.ts +3 -0
  37. package/dist/types/chat/feedback/get-tool-label.d.ts +2 -0
  38. package/dist/types/chat/feedback/index.d.ts +8 -0
  39. package/dist/types/chat/feedback/styles.d.ts +211 -0
  40. package/dist/types/chat/index.d.ts +20 -0
  41. package/dist/types/chat/types.d.ts +184 -0
  42. package/dist/types/chat/use-typewriter.d.ts +30 -0
  43. package/dist/types/components/copy-button/copy-button.d.ts +2 -0
  44. package/dist/types/components/copy-button/types.d.ts +6 -0
  45. package/dist/types/components/index.d.ts +2 -0
  46. package/dist/types/components/lasso-tool/styles.d.ts +1 -0
  47. package/dist/types/components/measurement-tools/styles.d.ts +1 -0
  48. package/dist/types/widgets-v2/actions/index.d.ts +1 -0
  49. package/dist/types/widgets-v2/actions/show-all/index.d.ts +2 -0
  50. package/dist/types/widgets-v2/actions/show-all/labels.d.ts +5 -0
  51. package/dist/types/widgets-v2/actions/show-all/show-all.d.ts +33 -0
  52. package/dist/types/widgets-v2/actions/show-all/style.d.ts +8 -0
  53. package/dist/types/widgets-v2/category/category-ui.d.ts +9 -2
  54. package/dist/types/widgets-v2/category/category.d.ts +9 -2
  55. package/dist/types/widgets-v2/category/components/category-row-other.d.ts +19 -6
  56. package/dist/types/widgets-v2/category/style.d.ts +21 -2
  57. package/dist/types/widgets-v2/category/types.d.ts +2 -0
  58. package/dist/types/widgets-v2/index.d.ts +3 -2
  59. package/dist/types/widgets-v2/selection-summary/labels.d.ts +7 -2
  60. package/dist/types/widgets-v2/selection-summary/selection-summary.d.ts +13 -6
  61. package/dist/types/widgets-v2/selection-summary/style.d.ts +15 -0
  62. package/dist/types/widgets-v2/wrapper/style.d.ts +1 -2
  63. package/dist/types/widgets-v2/wrapper/widget-wrapper.d.ts +6 -1
  64. package/dist/widgets/actions.js +116 -115
  65. package/dist/widgets/actions.js.map +1 -1
  66. package/dist/widgets/bar.js +1 -1
  67. package/dist/widgets/category.js +10 -9
  68. package/dist/widgets/category.js.map +1 -1
  69. package/dist/widgets/formula.js +12 -11
  70. package/dist/widgets/formula.js.map +1 -1
  71. package/dist/widgets/histogram.js +8 -7
  72. package/dist/widgets/histogram.js.map +1 -1
  73. package/dist/widgets/markdown.js +10 -9
  74. package/dist/widgets/markdown.js.map +1 -1
  75. package/dist/widgets/pie.js +1 -1
  76. package/dist/widgets/scatterplot.js +1 -1
  77. package/dist/widgets/spread.js +10 -9
  78. package/dist/widgets/spread.js.map +1 -1
  79. package/dist/widgets/table.js +18 -17
  80. package/dist/widgets/table.js.map +1 -1
  81. package/dist/widgets/timeseries.js +1 -1
  82. package/dist/widgets/utils.js +1 -1
  83. package/dist/widgets/wrapper.js +4 -3
  84. package/dist/widgets/wrapper.js.map +1 -1
  85. package/dist/widgets-v2/actions.js +41 -37
  86. package/dist/widgets-v2/bar.js +9 -8
  87. package/dist/widgets-v2/bar.js.map +1 -1
  88. package/dist/widgets-v2/category.js +23 -22
  89. package/dist/widgets-v2/category.js.map +1 -1
  90. package/dist/widgets-v2/formula.js +24 -23
  91. package/dist/widgets-v2/formula.js.map +1 -1
  92. package/dist/widgets-v2/histogram.js +11 -10
  93. package/dist/widgets-v2/histogram.js.map +1 -1
  94. package/dist/widgets-v2/markdown.js +10 -9
  95. package/dist/widgets-v2/markdown.js.map +1 -1
  96. package/dist/widgets-v2/pie.js +8 -7
  97. package/dist/widgets-v2/pie.js.map +1 -1
  98. package/dist/widgets-v2/scatterplot.js +10 -9
  99. package/dist/widgets-v2/scatterplot.js.map +1 -1
  100. package/dist/widgets-v2/spread.js +10 -9
  101. package/dist/widgets-v2/spread.js.map +1 -1
  102. package/dist/widgets-v2/table.js +17 -16
  103. package/dist/widgets-v2/table.js.map +1 -1
  104. package/dist/widgets-v2/timeseries.js +9 -8
  105. package/dist/widgets-v2/timeseries.js.map +1 -1
  106. package/dist/widgets-v2/utils.js +1 -1
  107. package/dist/widgets-v2.js +343 -338
  108. package/dist/widgets-v2.js.map +1 -1
  109. package/package.json +9 -3
  110. package/src/chat/bubbles/chat-agent-message.test.tsx +30 -0
  111. package/src/chat/bubbles/chat-agent-message.tsx +11 -0
  112. package/src/chat/bubbles/chat-error-message.test.tsx +40 -0
  113. package/src/chat/bubbles/chat-error-message.tsx +47 -0
  114. package/src/chat/bubbles/chat-suggestion-button.test.tsx +24 -0
  115. package/src/chat/bubbles/chat-suggestion-button.tsx +27 -0
  116. package/src/chat/bubbles/chat-user-message.test.tsx +27 -0
  117. package/src/chat/bubbles/chat-user-message.tsx +27 -0
  118. package/src/chat/bubbles/index.ts +4 -0
  119. package/src/chat/bubbles/styles.ts +148 -0
  120. package/src/chat/const.ts +4 -0
  121. package/src/chat/containers/chat-content.test.tsx +269 -0
  122. package/src/chat/containers/chat-content.tsx +142 -0
  123. package/src/chat/containers/chat-footer.test.tsx +34 -0
  124. package/src/chat/containers/chat-footer.tsx +78 -0
  125. package/src/chat/containers/chat-header.test.tsx +28 -0
  126. package/src/chat/containers/chat-header.tsx +29 -0
  127. package/src/chat/containers/chat-starter.test.tsx +32 -0
  128. package/src/chat/containers/chat-starter.tsx +75 -0
  129. package/src/chat/containers/index.ts +4 -0
  130. package/src/chat/containers/styles.ts +96 -0
  131. package/src/chat/feedback/chat-actions-container.test.tsx +64 -0
  132. package/src/chat/feedback/chat-actions-container.tsx +7 -0
  133. package/src/chat/feedback/chat-loader.test.tsx +10 -0
  134. package/src/chat/feedback/chat-loader.tsx +31 -0
  135. package/src/chat/feedback/chat-rating-action.tsx +43 -0
  136. package/src/chat/feedback/chat-thinking.test.tsx +15 -0
  137. package/src/chat/feedback/chat-thinking.tsx +23 -0
  138. package/src/chat/feedback/chat-tool-code-area.test.tsx +23 -0
  139. package/src/chat/feedback/chat-tool-code-area.tsx +71 -0
  140. package/src/chat/feedback/chat-tool-full-view-dialog.test.tsx +39 -0
  141. package/src/chat/feedback/chat-tool-full-view-dialog.tsx +121 -0
  142. package/src/chat/feedback/chat-tool-group.test.tsx +84 -0
  143. package/src/chat/feedback/chat-tool-group.tsx +156 -0
  144. package/src/chat/feedback/chat-tool-trace.test.tsx +81 -0
  145. package/src/chat/feedback/chat-tool-trace.tsx +192 -0
  146. package/src/chat/feedback/get-tool-label.test.tsx +91 -0
  147. package/src/chat/feedback/get-tool-label.ts +13 -0
  148. package/src/chat/feedback/index.ts +8 -0
  149. package/src/chat/feedback/styles.ts +229 -0
  150. package/src/chat/index.ts +59 -0
  151. package/src/chat/types.ts +215 -0
  152. package/src/chat/use-typewriter.test.tsx +38 -0
  153. package/src/chat/use-typewriter.ts +82 -0
  154. package/src/components/copy-button/copy-button.test.tsx +41 -0
  155. package/src/components/copy-button/copy-button.tsx +31 -0
  156. package/src/components/copy-button/types.ts +10 -0
  157. package/src/components/index.ts +3 -0
  158. package/src/components/lasso-tool/styles.ts +1 -0
  159. package/src/components/measurement-tools/styles.ts +1 -0
  160. package/src/widgets-v2/actions/index.ts +8 -0
  161. package/src/widgets-v2/actions/show-all/index.ts +7 -0
  162. package/src/widgets-v2/actions/show-all/labels.ts +8 -0
  163. package/src/widgets-v2/actions/show-all/show-all.test.tsx +50 -0
  164. package/src/widgets-v2/actions/show-all/show-all.tsx +72 -0
  165. package/src/widgets-v2/actions/show-all/style.ts +8 -0
  166. package/src/widgets-v2/category/category-ui.test.tsx +26 -10
  167. package/src/widgets-v2/category/category-ui.tsx +13 -3
  168. package/src/widgets-v2/category/category.test.tsx +4 -4
  169. package/src/widgets-v2/category/category.tsx +10 -1
  170. package/src/widgets-v2/category/components/category-row-other.test.tsx +36 -7
  171. package/src/widgets-v2/category/components/category-row-other.tsx +64 -13
  172. package/src/widgets-v2/category/style.ts +35 -4
  173. package/src/widgets-v2/category/types.ts +2 -0
  174. package/src/widgets-v2/index.ts +3 -0
  175. package/src/widgets-v2/selection-summary/labels.ts +8 -4
  176. package/src/widgets-v2/selection-summary/selection-summary.test.tsx +15 -9
  177. package/src/widgets-v2/selection-summary/selection-summary.tsx +42 -22
  178. package/src/widgets-v2/selection-summary/style.ts +15 -0
  179. package/src/widgets-v2/wrapper/style.ts +1 -2
  180. package/src/widgets-v2/wrapper/widget-wrapper.test.tsx +30 -0
  181. package/src/widgets-v2/wrapper/widget-wrapper.tsx +11 -1
  182. package/dist/category-DwaeYjpX.js +0 -656
  183. package/dist/category-DwaeYjpX.js.map +0 -1
  184. package/dist/change-column-Cidl_M-4.js +0 -1110
  185. package/dist/change-column-Cidl_M-4.js.map +0 -1
  186. package/dist/lasso-tool-BYbxrJ-7.js.map +0 -1
@@ -13,6 +13,9 @@ export declare const styles: {
13
13
  gap: number;
14
14
  py: number;
15
15
  };
16
+ listScroll: {
17
+ pr: number;
18
+ };
16
19
  rowSingle: {
17
20
  display: string;
18
21
  flexDirection: string;
@@ -150,17 +153,33 @@ export declare const styles: {
150
153
  };
151
154
  otherRow: {
152
155
  display: string;
153
- justifyContent: string;
154
156
  alignItems: string;
157
+ gap: number;
155
158
  py: number;
156
159
  px: number;
157
160
  };
161
+ otherLabelButton: {
162
+ cursor: string;
163
+ userSelect: string;
164
+ borderRadius: number;
165
+ px: number;
166
+ ml: number;
167
+ transition: string;
168
+ '&:hover': {
169
+ bgcolor: string;
170
+ };
171
+ '&:focus-visible': {
172
+ outline: string;
173
+ outlineColor: string;
174
+ outlineOffset: number;
175
+ };
176
+ };
158
177
  otherLabel: {
159
- fontStyle: string;
160
178
  color: string;
161
179
  fontWeight: string;
162
180
  };
163
181
  otherCount: {
164
182
  color: string;
183
+ fontVariantNumeric: string;
165
184
  };
166
185
  };
@@ -42,6 +42,8 @@ export type CategorySeriesConfig = WidgetSeries;
42
42
  export interface CategoryLabels {
43
43
  other?: string;
44
44
  otherCount?: string;
45
+ /** Tooltip shown over the clickable "Others" row. Defaults to `'Show all'`. */
46
+ showAll?: string;
45
47
  }
46
48
  /**
47
49
  * Visual density of the bar primitive. `'small'` (default) keeps the
@@ -9,7 +9,7 @@ import { Toolbox } from './toolbox/toolbox';
9
9
  import { DEFAULT_TOOLBOX_LABELS } from './toolbox/labels';
10
10
  import { Echart, EchartUI, DEFAULT_INIT_OPTS } from './echart';
11
11
  import { DEFAULT_NOTE_LABELS } from './note/labels';
12
- import { Searcher, SearcherToggle, StackToggle, ZoomToggle, BrushToggle, RelativeData, Download, LockSelection, ChangeColumn } from './actions';
12
+ import { Searcher, SearcherToggle, StackToggle, ShowAllToggle, ZoomToggle, BrushToggle, RelativeData, Download, LockSelection, ChangeColumn } from './actions';
13
13
  import { Formula, FormulaUI } from './formula';
14
14
  import { Markdown, MarkdownUI } from './markdown';
15
15
  import { Spread, SpreadUI } from './spread';
@@ -59,6 +59,7 @@ export declare const Widget: {
59
59
  readonly Searcher: typeof Searcher;
60
60
  readonly SearcherToggle: typeof SearcherToggle;
61
61
  readonly StackToggle: typeof StackToggle;
62
+ readonly ShowAllToggle: typeof ShowAllToggle;
62
63
  readonly ZoomToggle: typeof ZoomToggle;
63
64
  readonly BrushToggle: typeof BrushToggle;
64
65
  readonly RelativeData: typeof RelativeData;
@@ -95,7 +96,7 @@ export type { ToolboxLabels } from './toolbox/labels';
95
96
  export type { EchartProps, EchartUIProps, EchartsEventHandler } from './echart';
96
97
  export type { NoteProps, NoteMarkdownProps } from './note/widget-note';
97
98
  export type { NoteLabels } from './note/labels';
98
- export type { SearcherProps, SearcherToggleProps, StackToggleProps, ZoomToggleProps, BrushToggleProps, RelativeDataProps, DownloadProps, DownloadItem, FullScreenTriggerProps, FullScreenSlotProps, LockSelectionProps, LockSelectionKey, ChangeColumnProps, ChangeColumnItem, } from './actions';
99
+ export type { SearcherProps, SearcherToggleProps, StackToggleProps, ShowAllToggleProps, ZoomToggleProps, BrushToggleProps, RelativeDataProps, DownloadProps, DownloadItem, FullScreenTriggerProps, FullScreenSlotProps, LockSelectionProps, LockSelectionKey, ChangeColumnProps, ChangeColumnItem, } from './actions';
99
100
  export type { FormulaUIProps, FormulaDataItem, FormulaWidgetData, } from './formula';
100
101
  export type { MarkdownUIProps, MarkdownWidgetData } from './markdown';
101
102
  export type { PieDatum, PieWidgetData } from './pie';
@@ -1,6 +1,11 @@
1
+ import { ReactNode } from 'react';
1
2
  export interface SelectionSummaryLabels {
2
- allSelected: string;
3
- selections: (count: number) => string;
3
+ /**
4
+ * Optional custom renderer for the count. Defaults to the built-in two-tone
5
+ * `selected / total` rendering. Receives the already-resolved displayed
6
+ * number (which equals `total` when nothing is selected).
7
+ */
8
+ summary?: (selected: number, total: number) => ReactNode;
4
9
  clear: string;
5
10
  }
6
11
  export declare const DEFAULT_SELECTION_SUMMARY_LABELS: SelectionSummaryLabels;
@@ -4,19 +4,26 @@ import { SelectionSummaryLabels } from './labels';
4
4
  export interface SelectionSummaryProps {
5
5
  /** Number of currently selected items. */
6
6
  count: number;
7
- /** Optional total — when 0 the component renders nothing (no data to summarize). */
7
+ /** Optional total — when `undefined` or `0` the component renders nothing (no data). */
8
8
  total?: number;
9
- /** Clear callback. Shown only when count > 0. */
9
+ /** Clear callback. The Clear control is shown only when `count > 0` and `onClear` is provided. */
10
10
  onClear?: () => void;
11
11
  labels?: Partial<SelectionSummaryLabels>;
12
12
  icon?: ComponentType<SvgIconProps>;
13
13
  iconProps?: SvgIconProps;
14
14
  }
15
15
  /**
16
+ * Renders a `selected / total` count.
17
+ *
16
18
  * Render rules:
17
- * - `total === 0` → render nothing.
18
- * - `count === 0` → render `labels.allSelected` (matches v1 default),
19
- * prefixed with the optional `icon` glyph when provided.
20
- * - `count > 0` render `labels.selections(count)` + Clear (when `onClear`).
19
+ * - `!total` (undefined or 0) → render nothing (no data to summarize).
20
+ * - `count === 0` → display `total / total` (everything is implicitly in
21
+ * scope); no Clear button.
22
+ * - `count > 0` display `count / total` + Clear (when `onClear` is given).
23
+ *
24
+ * The count is two-tone by default (selected number bold/`text.primary`,
25
+ * ` / total` in `text.secondary`). Pass `labels.summary` to render a custom
26
+ * node instead — it receives the already-resolved displayed number (which
27
+ * equals `total` when nothing is selected).
21
28
  */
22
29
  export declare function SelectionSummary({ count, total, onClear, labels, icon: Icon, iconProps, }: SelectionSummaryProps): import("react/jsx-runtime").JSX.Element | null;
@@ -8,6 +8,21 @@ export declare const styles: {
8
8
  label: {
9
9
  color: "text.secondary";
10
10
  };
11
+ count: {
12
+ display: "inline-flex";
13
+ alignItems: "baseline";
14
+ gap: number;
15
+ };
16
+ selected: {
17
+ color: "text.primary";
18
+ fontWeight: number;
19
+ };
20
+ separator: {
21
+ color: "text.secondary";
22
+ };
23
+ total: {
24
+ color: "text.secondary";
25
+ };
11
26
  clear: {
12
27
  color: "primary.main";
13
28
  cursor: "pointer";
@@ -5,10 +5,9 @@ export declare const styles: {
5
5
  width: string;
6
6
  minWidth: number;
7
7
  bgcolor: "background.paper";
8
- border: "1px solid";
9
- borderColor: "divider";
10
8
  borderRadius: number;
11
9
  overflow: "hidden";
10
+ boxShadow: "none";
12
11
  '&::before': {
13
12
  display: "none";
14
13
  };
@@ -23,6 +23,11 @@ export interface WrapperProps {
23
23
  */
24
24
  defaultCollapsed?: boolean;
25
25
  disabled?: boolean;
26
+ /**
27
+ * Visual variant. `'elevation'` (default) renders a borderless shell;
28
+ * `'outlined'` adds a 1px divider border around the card.
29
+ */
30
+ variant?: 'outlined' | 'elevation';
26
31
  labels?: Partial<WrapperLabels>;
27
32
  /**
28
33
  * Icon shown at the right edge of the summary row. Accordion rotates it
@@ -48,4 +53,4 @@ export interface WrapperProps {
48
53
  * render inside the summary row; everything else (`<Content>`, `<Footer>`,
49
54
  * loose nodes) renders inside the details panel.
50
55
  */
51
- export declare function Wrapper({ title, collapsed, onCollapseChange, defaultCollapsed, disabled, labels, expandIcon: ExpandIcon, iconProps, sx, children, }: WrapperProps): import("react/jsx-runtime").JSX.Element;
56
+ export declare function Wrapper({ title, collapsed, onCollapseChange, defaultCollapsed, disabled, variant, labels, expandIcon: ExpandIcon, iconProps, sx, children, }: WrapperProps): import("react/jsx-runtime").JSX.Element;