@recharts/devtools 0.0.15 → 0.0.17

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.
@@ -30,21 +30,24 @@ const buttonStyle = {
30
30
  padding: '4px 8px',
31
31
  fontSize: '11px',
32
32
  cursor: 'pointer',
33
- border: '1px solid #ccc',
33
+ border: '1px solid var(--rd-border, #ccc)',
34
34
  borderRadius: '3px',
35
- background: '#fff',
35
+ background: 'var(--rd-surface, #fff)',
36
+ color: 'var(--rd-text, inherit)',
36
37
  };
37
38
  const activeButtonStyle = {
38
39
  ...buttonStyle,
39
- background: '#e0e0e0',
40
- borderColor: '#999',
40
+ background: 'var(--rd-surface-active, #e0e0e0)',
41
+ borderColor: 'var(--rd-border-strong, #999)',
41
42
  };
42
43
  const inputStyle = {
43
44
  width: '50px',
44
45
  fontSize: '11px',
45
46
  padding: '2px 4px',
46
- border: '1px solid #ccc',
47
+ border: '1px solid var(--rd-border, #ccc)',
47
48
  borderRadius: '2px',
49
+ background: 'var(--rd-surface, #fff)',
50
+ color: 'var(--rd-text, inherit)',
48
51
  };
49
52
  const labelStyle = {
50
53
  fontSize: '11px',
@@ -70,7 +73,11 @@ function SnapModeRadioGroup({ snapMode, onSnapModeChange, }) {
70
73
  "Snap to axis ticks")));
71
74
  }
72
75
  function AnnotationEditForm({ annotation, handleStyleChange, onUpdateAnnotation, }) {
73
- return (React.createElement("div", { style: { marginTop: '8px', paddingTop: '8px', borderTop: '1px solid #ddd' } },
76
+ return (React.createElement("div", { style: {
77
+ marginTop: '8px',
78
+ paddingTop: '8px',
79
+ borderTop: '1px solid var(--rd-border-subtle, #ddd)',
80
+ } },
74
81
  React.createElement("div", { style: { display: 'flex', flexWrap: 'wrap', gap: '8px', marginBottom: '8px' } },
75
82
  (annotation.type === 'verticalLine' ||
76
83
  annotation.type === 'circle' ||
@@ -208,7 +215,7 @@ export function AnnotationsController({ annotations, isAdding, selectedAnnotatio
208
215
  React.createElement("div", { style: { marginBottom: '12px' } },
209
216
  React.createElement("div", { style: { marginBottom: '6px', fontWeight: 'bold' } }, "Add Annotation:"),
210
217
  React.createElement("div", { style: { display: 'flex', flexWrap: 'wrap', gap: '4px' } }, ANNOTATION_TYPES.map(({ type, label }) => (React.createElement("button", { key: type, type: "button", onClick: () => (isAdding === type ? onCancelAdding() : onStartAdding(type)), style: isAdding === type ? activeButtonStyle : buttonStyle }, isAdding === type ? `Cancel ${label}` : label)))),
211
- isAdding && (React.createElement("div", { style: { marginTop: '6px', fontSize: '11px', color: '#666' } },
218
+ isAdding && (React.createElement("div", { style: { marginTop: '6px', fontSize: '11px', color: 'var(--rd-text-muted, #666)' } },
212
219
  "Click on the chart to place the annotation",
213
220
  (isAdding === 'rectangle' || isAdding === 'freeformLine' || isAdding === 'circle') &&
214
221
  ' (click twice or drag to define dimensions)'))),
@@ -218,11 +225,14 @@ export function AnnotationsController({ annotations, isAdding, selectedAnnotatio
218
225
  "Annotations (",
219
226
  annotations.length,
220
227
  "):"),
221
- annotations.length === 0 ? (React.createElement("div", { style: { fontSize: '11px', color: '#666' } }, "No annotations yet")) : (React.createElement("div", { style: { display: 'flex', flexDirection: 'column', gap: '8px' } }, annotations.map((annotation) => (React.createElement("div", { key: annotation.id, style: {
228
+ annotations.length === 0 ? (React.createElement("div", { style: { fontSize: '11px', color: 'var(--rd-text-muted, #666)' } }, "No annotations yet")) : (React.createElement("div", { style: { display: 'flex', flexDirection: 'column', gap: '8px' } }, annotations.map((annotation) => (React.createElement("div", { key: annotation.id, style: {
222
229
  padding: '8px',
223
- border: selectedAnnotationId === annotation.id ? '2px solid #007bff' : '1px solid #ddd',
230
+ border: selectedAnnotationId === annotation.id
231
+ ? '2px solid var(--rd-accent, #007bff)'
232
+ : '1px solid var(--rd-border-subtle, #ddd)',
224
233
  borderRadius: '4px',
225
- background: '#fafafa',
234
+ background: 'var(--rd-surface-raised, #fafafa)',
235
+ color: 'var(--rd-text, inherit)',
226
236
  } },
227
237
  React.createElement("div", { style: { display: 'flex', alignItems: 'center', gap: '8px', marginBottom: '4px' } },
228
238
  React.createElement("input", { type: "color", value: annotation.style.color ?? '#ff0000', onChange: (e) => handleStyleChange(annotation, 'color', e.target.value), style: {
@@ -236,6 +246,6 @@ export function AnnotationsController({ annotations, isAdding, selectedAnnotatio
236
246
  annotation.type),
237
247
  React.createElement("button", { type: "button", onClick: () => toggleExpanded(annotation.id), style: buttonStyle }, expandedAnnotationId === annotation.id ? '▼' : '▶'),
238
248
  React.createElement("button", { type: "button", onClick: () => onSelectAnnotation(selectedAnnotationId === annotation.id ? null : annotation.id), style: selectedAnnotationId === annotation.id ? activeButtonStyle : buttonStyle }, selectedAnnotationId === annotation.id ? 'Deselect' : 'Select'),
239
- React.createElement("button", { type: "button", onClick: () => onDeleteAnnotation(annotation.id), style: { ...buttonStyle, color: '#d00' } }, "Delete")),
249
+ React.createElement("button", { type: "button", onClick: () => onDeleteAnnotation(annotation.id), style: { ...buttonStyle, color: 'var(--rd-danger, #d00)' } }, "Delete")),
240
250
  expandedAnnotationId === annotation.id && (React.createElement(AnnotationEditForm, { annotation: annotation, handleStyleChange: handleStyleChange, onUpdateAnnotation: onUpdateAnnotation }))))))))));
241
251
  }
@@ -16,6 +16,8 @@ import { YAxisTicksInspector } from '../inspectors/YAxisTicksInspector.js';
16
16
  import { XAxisTicksInspector } from '../inspectors/XAxisTicksInspector.js';
17
17
  import { useIsTooltipActiveInspector } from '../inspectors/useIsTooltipActiveInspector.js';
18
18
  import { useActiveTooltipCoordinateInspector } from '../inspectors/useActiveTooltipCoordinateInspector.js';
19
+ import { useCartesianChartLayoutInspector } from '../inspectors/useCartesianChartLayoutInspector.js';
20
+ import { usePolarChartLayoutInspector } from '../inspectors/usePolarChartLayoutInspector.js';
19
21
  const INSPECTORS = {
20
22
  'useChartWidth | useChartHeight': ChartDimensionInspector,
21
23
  useMargin: MarginInspector,
@@ -29,6 +31,8 @@ const INSPECTORS = {
29
31
  useYAxisTicks: YAxisTicksInspector,
30
32
  useIsTooltipActive: useIsTooltipActiveInspector,
31
33
  useActiveTooltipCoordinate: useActiveTooltipCoordinateInspector,
34
+ useCartesianChartLayout: useCartesianChartLayoutInspector,
35
+ usePolarChartLayout: usePolarChartLayoutInspector,
32
36
  };
33
37
  const isValidInspectorKey = (key) => {
34
38
  return key != null && key in INSPECTORS;
@@ -0,0 +1,2 @@
1
+ import { InspectorDef } from '../types.js';
2
+ export declare const useCartesianChartLayoutInspector: InspectorDef;
@@ -0,0 +1,11 @@
1
+ import React from 'react';
2
+ import { useCartesianChartLayout } from 'recharts';
3
+ import { useEventDispatch } from '../components/useEventDispatch.js';
4
+ import { PrimitiveInspector } from './generic/PrimitiveInspector.js';
5
+ export const useCartesianChartLayoutInspector = {
6
+ Inspector: () => {
7
+ const cartesianChartLayout = useCartesianChartLayout();
8
+ useEventDispatch(cartesianChartLayout);
9
+ return React.createElement(PrimitiveInspector, { value: cartesianChartLayout });
10
+ },
11
+ };
@@ -0,0 +1,2 @@
1
+ import { InspectorDef } from '../types.js';
2
+ export declare const usePolarChartLayoutInspector: InspectorDef;
@@ -0,0 +1,11 @@
1
+ import React from 'react';
2
+ import { usePolarChartLayout } from 'recharts';
3
+ import { useEventDispatch } from '../components/useEventDispatch.js';
4
+ import { PrimitiveInspector } from './generic/PrimitiveInspector.js';
5
+ export const usePolarChartLayoutInspector = {
6
+ Inspector: () => {
7
+ const polarChartLayout = usePolarChartLayout();
8
+ useEventDispatch(polarChartLayout);
9
+ return React.createElement(PrimitiveInspector, { value: polarChartLayout });
10
+ },
11
+ };
package/package.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "access": "public"
5
5
  },
6
6
  "type": "module",
7
- "version": "0.0.15",
7
+ "version": "0.0.17",
8
8
  "description": "Devtools and helper functions for Recharts",
9
9
  "main": "dist/index.js",
10
10
  "types": "dist/index.d.ts",
@@ -48,6 +48,6 @@
48
48
  "peerDependencies": {
49
49
  "react": "^18.0.0 || ^19.0.0",
50
50
  "react-dom": "^18.0.0 || ^19.0.0",
51
- "recharts": "3.9.0-canary.0"
51
+ "recharts": "3.9.0"
52
52
  }
53
53
  }