@react-magma/charts 15.0.1-v6-next.1 → 15.0.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@react-magma/charts",
3
- "version": "15.0.1-v6-next.1",
3
+ "version": "15.0.1",
4
4
  "license": "MIT",
5
5
  "repository": {
6
6
  "type": "git",
@@ -47,8 +47,8 @@
47
47
  "identity-obj-proxy": "^3.0.0",
48
48
  "react": "^17.0.2",
49
49
  "react-dom": "^17.0.2",
50
- "react-magma-dom": "^6.0.1-v6-next.0",
51
- "react-magma-icons": "^3.3.0",
50
+ "react-magma-dom": "^6.1.0",
51
+ "react-magma-icons": "^3.3.1",
52
52
  "rollup": "^4.52.4",
53
53
  "rollup-plugin-postcss": "^4.0.2"
54
54
  },
@@ -57,8 +57,8 @@
57
57
  "@emotion/styled": "^11.13.0",
58
58
  "react": "^17.0.2",
59
59
  "react-dom": "^17.0.2",
60
- "react-magma-dom": "^6.0.1-v6-next.0",
61
- "react-magma-icons": "^3.3.0"
60
+ "react-magma-dom": "^6.1.0-v6-next.2",
61
+ "react-magma-icons": "^3.3.1"
62
62
  },
63
63
  "engines": {
64
64
  "node": ">=22.14.0",
@@ -25,7 +25,7 @@ global.ResizeObserver = jest.fn().mockImplementation(() => ({
25
25
  // Multiple observers may be created per component; we collect all of them and
26
26
  // call each one so that no observer is silently skipped.
27
27
  let mutationObserverCallbacks = [];
28
- const mutationObserverCallback = mutations =>
28
+ const mutationObserverCallback = (mutations = []) =>
29
29
  mutationObserverCallbacks.forEach(cb => cb(mutations));
30
30
  global.MutationObserver = jest.fn().mockImplementation(callback => {
31
31
  mutationObserverCallbacks.push(callback);
@@ -1161,7 +1161,9 @@ describe('CarbonChart', () => {
1161
1161
 
1162
1162
  expect(wrapper).not.toHaveClass('has-magma-toolbar');
1163
1163
 
1164
- jest.runOnlyPendingTimers();
1164
+ act(() => {
1165
+ jest.runOnlyPendingTimers();
1166
+ });
1165
1167
  expect(wrapper).toHaveClass('has-magma-toolbar');
1166
1168
  } finally {
1167
1169
  jest.useRealTimers();
@@ -1188,7 +1190,9 @@ describe('CarbonChart', () => {
1188
1190
  expect(exportToJPG).toHaveBeenCalledTimes(1);
1189
1191
  expect(wrapper).not.toHaveClass('has-magma-toolbar');
1190
1192
 
1191
- jest.runOnlyPendingTimers();
1193
+ act(() => {
1194
+ jest.runOnlyPendingTimers();
1195
+ });
1192
1196
  expect(wrapper).toHaveClass('has-magma-toolbar');
1193
1197
  } finally {
1194
1198
  jest.useRealTimers();
@@ -36,10 +36,10 @@ import {
36
36
  VisuallyHidden,
37
37
  } from 'react-magma-dom';
38
38
  import {
39
- FullscreenExitIcon,
40
- FullscreenIcon,
41
- MoreVertIcon,
42
- TableIcon,
39
+ FullscreenExitOutlinedIcon,
40
+ FullscreenOutlinedIcon,
41
+ MoreVertOutlinedIcon,
42
+ TableOutlinedIcon,
43
43
  } from 'react-magma-icons';
44
44
 
45
45
  import { useCarbonModalFocusManagement } from '../../hooks/useCarbonModalFocusManagement';
@@ -1060,7 +1060,7 @@ function CarbonChartToolbar({
1060
1060
  {showTable && (
1061
1061
  <ChartTableButton
1062
1062
  ariaLabel={resolvedTitle}
1063
- icon={<TableIcon size={20} />}
1063
+ icon={<TableOutlinedIcon size={20} />}
1064
1064
  isInverse={isInverse}
1065
1065
  isTableOpen={isTableOpen}
1066
1066
  onClick={onOpenTable}
@@ -1069,15 +1069,15 @@ function CarbonChartToolbar({
1069
1069
  {showFullscreen && (
1070
1070
  <ChartFullscreenButton
1071
1071
  ariaLabel={`${isFullscreen ? 'Exit' : 'View'} ${resolvedTitle} full screen`}
1072
- icon={<FullscreenIcon size={20} />}
1073
- exitIcon={<FullscreenExitIcon size={20} />}
1072
+ icon={<FullscreenOutlinedIcon size={20} />}
1073
+ exitIcon={<FullscreenExitOutlinedIcon size={20} />}
1074
1074
  isInverse={isInverse}
1075
1075
  isFullscreen={isFullscreen}
1076
1076
  onClick={onToggleFullscreen}
1077
1077
  />
1078
1078
  )}
1079
1079
  <ChartMoreOptionsButton
1080
- icon={<MoreVertIcon size={20} />}
1080
+ icon={<MoreVertOutlinedIcon size={20} />}
1081
1081
  isInverse={isInverse}
1082
1082
  >
1083
1083
  {moreOptionsContent}
@@ -6,6 +6,7 @@ import {
6
6
  Dropdown,
7
7
  DropdownButton,
8
8
  DropdownContent,
9
+ Tooltip,
9
10
  } from 'react-magma-dom';
10
11
 
11
12
  import { useChartToolbarI18n } from './chartToolbarI18n';
@@ -37,13 +38,15 @@ export function ChartMoreOptionsButton({
37
38
  const resolvedAriaLabel = ariaLabel ?? t.moreOptionsAriaLabel;
38
39
  return (
39
40
  <Dropdown isInverse={isInverse}>
40
- <DropdownButton
41
- aria-label={resolvedAriaLabel}
42
- color={ButtonColor.subtle}
43
- icon={icon}
44
- variant={ButtonVariant.link}
45
- testId="chart-more-options-button"
46
- />
41
+ <Tooltip content={resolvedAriaLabel} isInverse={isInverse}>
42
+ <DropdownButton
43
+ aria-label={resolvedAriaLabel}
44
+ color={ButtonColor.subtle}
45
+ icon={icon}
46
+ variant={ButtonVariant.link}
47
+ testId="chart-more-options-button"
48
+ />
49
+ </Tooltip>
47
50
  <DropdownContent>{children}</DropdownContent>
48
51
  </Dropdown>
49
52
  );
@@ -364,7 +364,7 @@ describe('ChartFullscreenButton', () => {
364
364
  // ChartMoreOptionsButton
365
365
  // ---------------------------------------------------------------------------
366
366
  describe('ChartMoreOptionsButton', () => {
367
- it('renders with default "More options" label', () => {
367
+ it('renders with default "More options" label and tooltip', async () => {
368
368
  render(
369
369
  <ChartMoreOptionsButton icon={<MoreVertIcon />}>
370
370
  <DropdownMenuItem>Download</DropdownMenuItem>
@@ -374,6 +374,11 @@ describe('ChartMoreOptionsButton', () => {
374
374
  expect(
375
375
  screen.getByRole('button', { name: 'More options' })
376
376
  ).toHaveAttribute('color', 'subtle');
377
+
378
+ fireEvent.mouseEnter(screen.getByRole('button', { name: 'More options' }));
379
+ await waitFor(() => {
380
+ expect(screen.getByText('More options')).toBeInTheDocument();
381
+ });
377
382
  });
378
383
 
379
384
  it('renders with custom aria-label', () => {