@react-magma/charts 16.0.1-next.0 → 16.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/dist/charts.js +5 -4
- package/dist/charts.js.map +1 -1
- package/dist/charts.modern.module.js +6 -5
- package/dist/charts.modern.module.js.map +1 -1
- package/dist/charts.umd.js +608 -342
- package/dist/charts.umd.js.map +1 -1
- package/package.json +5 -5
- package/src/components/CarbonChart/CarbonChart.test.js +7 -3
- package/src/components/CarbonChart/CarbonChart.tsx +8 -8
- package/src/components/ChartTable/ChartMoreOptionsButton.tsx +10 -7
- package/src/components/ChartTable/ChartTable.test.js +6 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@react-magma/charts",
|
|
3
|
-
"version": "16.0.1
|
|
3
|
+
"version": "16.0.1",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -50,8 +50,8 @@
|
|
|
50
50
|
"identity-obj-proxy": "3.0.0",
|
|
51
51
|
"react": "18.3.1",
|
|
52
52
|
"react-dom": "18.3.1",
|
|
53
|
-
"react-magma-dom": "^7.
|
|
54
|
-
"react-magma-icons": "^3.3.
|
|
53
|
+
"react-magma-dom": "^7.1.0",
|
|
54
|
+
"react-magma-icons": "^3.3.1",
|
|
55
55
|
"rollup": "^4.52.4",
|
|
56
56
|
"rollup-plugin-postcss": "^4.0.2"
|
|
57
57
|
},
|
|
@@ -60,8 +60,8 @@
|
|
|
60
60
|
"@emotion/styled": "^11.14.0",
|
|
61
61
|
"react": "^18.3.1",
|
|
62
62
|
"react-dom": "^18.3.1",
|
|
63
|
-
"react-magma-dom": "^7.0
|
|
64
|
-
"react-magma-icons": "^3.3.
|
|
63
|
+
"react-magma-dom": "^7.1.0-next.2",
|
|
64
|
+
"react-magma-icons": "^3.3.1"
|
|
65
65
|
},
|
|
66
66
|
"engines": {
|
|
67
67
|
"node": ">=22.14.0",
|
|
@@ -24,7 +24,7 @@ global.ResizeObserver = jest.fn().mockImplementation(() => ({
|
|
|
24
24
|
// Multiple observers may be created per component; we collect all of them and
|
|
25
25
|
// call each one so that no observer is silently skipped.
|
|
26
26
|
let mutationObserverCallbacks = [];
|
|
27
|
-
const mutationObserverCallback = mutations =>
|
|
27
|
+
const mutationObserverCallback = (mutations = []) =>
|
|
28
28
|
mutationObserverCallbacks.forEach(cb => cb(mutations));
|
|
29
29
|
global.MutationObserver = jest.fn().mockImplementation(callback => {
|
|
30
30
|
mutationObserverCallbacks.push(callback);
|
|
@@ -1063,7 +1063,9 @@ describe('CarbonChart', () => {
|
|
|
1063
1063
|
|
|
1064
1064
|
expect(wrapper).not.toHaveClass('has-magma-toolbar');
|
|
1065
1065
|
|
|
1066
|
-
|
|
1066
|
+
act(() => {
|
|
1067
|
+
jest.runOnlyPendingTimers();
|
|
1068
|
+
});
|
|
1067
1069
|
expect(wrapper).toHaveClass('has-magma-toolbar');
|
|
1068
1070
|
} finally {
|
|
1069
1071
|
jest.useRealTimers();
|
|
@@ -1090,7 +1092,9 @@ describe('CarbonChart', () => {
|
|
|
1090
1092
|
expect(exportToJPG).toHaveBeenCalledTimes(1);
|
|
1091
1093
|
expect(wrapper).not.toHaveClass('has-magma-toolbar');
|
|
1092
1094
|
|
|
1093
|
-
|
|
1095
|
+
act(() => {
|
|
1096
|
+
jest.runOnlyPendingTimers();
|
|
1097
|
+
});
|
|
1094
1098
|
expect(wrapper).toHaveClass('has-magma-toolbar');
|
|
1095
1099
|
} finally {
|
|
1096
1100
|
jest.useRealTimers();
|
|
@@ -35,10 +35,10 @@ import {
|
|
|
35
35
|
VisuallyHidden,
|
|
36
36
|
} from 'react-magma-dom';
|
|
37
37
|
import {
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
38
|
+
FullscreenExitOutlinedIcon,
|
|
39
|
+
FullscreenOutlinedIcon,
|
|
40
|
+
MoreVertOutlinedIcon,
|
|
41
|
+
TableOutlinedIcon,
|
|
42
42
|
} from 'react-magma-icons';
|
|
43
43
|
|
|
44
44
|
import { useCarbonModalFocusManagement } from '../../hooks/useCarbonModalFocusManagement';
|
|
@@ -1064,7 +1064,7 @@ function CarbonChartToolbar({
|
|
|
1064
1064
|
{showTable && (
|
|
1065
1065
|
<ChartTableButton
|
|
1066
1066
|
ariaLabel={resolvedTitle}
|
|
1067
|
-
icon={<
|
|
1067
|
+
icon={<TableOutlinedIcon size={20} />}
|
|
1068
1068
|
isInverse={isInverse}
|
|
1069
1069
|
isTableOpen={isTableOpen}
|
|
1070
1070
|
onClick={onOpenTable}
|
|
@@ -1073,15 +1073,15 @@ function CarbonChartToolbar({
|
|
|
1073
1073
|
{showFullscreen && (
|
|
1074
1074
|
<ChartFullscreenButton
|
|
1075
1075
|
ariaLabel={`${isFullscreen ? 'Exit' : 'View'} ${resolvedTitle} full screen`}
|
|
1076
|
-
icon={<
|
|
1077
|
-
exitIcon={<
|
|
1076
|
+
icon={<FullscreenOutlinedIcon size={20} />}
|
|
1077
|
+
exitIcon={<FullscreenExitOutlinedIcon size={20} />}
|
|
1078
1078
|
isInverse={isInverse}
|
|
1079
1079
|
isFullscreen={isFullscreen}
|
|
1080
1080
|
onClick={onToggleFullscreen}
|
|
1081
1081
|
/>
|
|
1082
1082
|
)}
|
|
1083
1083
|
<ChartMoreOptionsButton
|
|
1084
|
-
icon={<
|
|
1084
|
+
icon={<MoreVertOutlinedIcon size={20} />}
|
|
1085
1085
|
isInverse={isInverse}
|
|
1086
1086
|
>
|
|
1087
1087
|
{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';
|
|
@@ -38,13 +39,15 @@ export function ChartMoreOptionsButton({
|
|
|
38
39
|
|
|
39
40
|
return (
|
|
40
41
|
<Dropdown isInverse={isInverse}>
|
|
41
|
-
<
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
42
|
+
<Tooltip content={resolvedAriaLabel} isInverse={isInverse}>
|
|
43
|
+
<DropdownButton
|
|
44
|
+
aria-label={resolvedAriaLabel}
|
|
45
|
+
color={ButtonColor.subtle}
|
|
46
|
+
icon={icon}
|
|
47
|
+
variant={ButtonVariant.link}
|
|
48
|
+
testId="chart-more-options-button"
|
|
49
|
+
/>
|
|
50
|
+
</Tooltip>
|
|
48
51
|
<DropdownContent>{children}</DropdownContent>
|
|
49
52
|
</Dropdown>
|
|
50
53
|
);
|
|
@@ -372,7 +372,7 @@ describe('ChartFullscreenButton', () => {
|
|
|
372
372
|
// ChartMoreOptionsButton
|
|
373
373
|
// ---------------------------------------------------------------------------
|
|
374
374
|
describe('ChartMoreOptionsButton', () => {
|
|
375
|
-
it('renders with default "More options" label', () => {
|
|
375
|
+
it('renders with default "More options" label and tooltip', async () => {
|
|
376
376
|
render(
|
|
377
377
|
<ChartMoreOptionsButton icon={<MoreVertIcon />}>
|
|
378
378
|
<DropdownMenuItem>Download</DropdownMenuItem>
|
|
@@ -382,6 +382,11 @@ describe('ChartMoreOptionsButton', () => {
|
|
|
382
382
|
expect(
|
|
383
383
|
screen.getByRole('button', { name: 'More options' })
|
|
384
384
|
).toHaveAttribute('color', 'subtle');
|
|
385
|
+
|
|
386
|
+
fireEvent.mouseEnter(screen.getByRole('button', { name: 'More options' }));
|
|
387
|
+
await waitFor(() => {
|
|
388
|
+
expect(screen.getByText('More options')).toBeInTheDocument();
|
|
389
|
+
});
|
|
385
390
|
});
|
|
386
391
|
|
|
387
392
|
it('renders with custom aria-label', () => {
|