@octanejs/visx 0.1.38 → 0.1.40
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 +4 -4
- package/src/kernel/warnings.ts +4 -0
- package/src/text/index.ts +1 -0
- package/src/theme/utils/warn.ts +4 -0
- package/src/tooltip/floating/ChartTooltip.tsrx +1 -1
- package/src/tooltip/floating/ChartTooltip.tsrx.d.ts +1 -1
- package/src/tooltip/floating/useFloatingTooltip.tsrx +3 -3
- package/src/xychart/components/XYChart.tsrx +4 -0
- package/src/xychart/index.ts +1 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@octanejs/visx",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.40",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"engines": {
|
|
@@ -123,10 +123,10 @@
|
|
|
123
123
|
"mitt": "^2.1.0",
|
|
124
124
|
"reduce-css-calc": "^1.3.0",
|
|
125
125
|
"svg-path-properties": "2.0.2",
|
|
126
|
-
"@octanejs/floating-ui": "0.1.
|
|
126
|
+
"@octanejs/floating-ui": "0.1.45"
|
|
127
127
|
},
|
|
128
128
|
"peerDependencies": {
|
|
129
|
-
"octane": "0.1.
|
|
129
|
+
"octane": "0.1.46"
|
|
130
130
|
},
|
|
131
131
|
"devDependencies": {
|
|
132
132
|
"@juggle/resize-observer": "^3.4.0",
|
|
@@ -149,7 +149,7 @@
|
|
|
149
149
|
"react-dom": "^19.2.7",
|
|
150
150
|
"typescript": "^5.9.3",
|
|
151
151
|
"vitest": "^4.1.10",
|
|
152
|
-
"octane": "0.1.
|
|
152
|
+
"octane": "0.1.46"
|
|
153
153
|
},
|
|
154
154
|
"scripts": {
|
|
155
155
|
"compile:check": "node scripts/check-tsrx-compile.mjs",
|
package/src/kernel/warnings.ts
CHANGED
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
// Keep the literal expression below available to bundler define substitution
|
|
2
|
+
// without requiring Node ambient types in browser consumers.
|
|
3
|
+
declare const process: { env: { NODE_ENV?: string } };
|
|
4
|
+
|
|
1
5
|
export type WarnCode = 'EMPTY_DATA' | 'NAN_IN_DATA';
|
|
2
6
|
export type WarnDetails = Readonly<Record<string, unknown>>;
|
|
3
7
|
|
package/src/text/index.ts
CHANGED
package/src/theme/utils/warn.ts
CHANGED
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
// Keep the literal expression below available to bundler define substitution
|
|
2
|
+
// without requiring Node ambient types in browser consumers.
|
|
3
|
+
declare const process: { env: { NODE_ENV?: string } };
|
|
4
|
+
|
|
1
5
|
export default function warn(message: string) {
|
|
2
6
|
if (process.env.NODE_ENV !== 'production') {
|
|
3
7
|
console.warn(message);
|
|
@@ -17,7 +17,7 @@ import type {
|
|
|
17
17
|
UseFloatingTooltipOptions,
|
|
18
18
|
} from './types';
|
|
19
19
|
|
|
20
|
-
export { ChartTooltipItem } from './ChartTooltipContent.tsrx';
|
|
20
|
+
export type { ChartTooltipItem } from './ChartTooltipContent.tsrx';
|
|
21
21
|
|
|
22
22
|
export type ChartTooltipControlledProps<Datum = unknown> = {
|
|
23
23
|
open: boolean;
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import type { OctaneNode } from 'octane';
|
|
3
3
|
import type { ChartTooltipConfig, ChartTooltipContentProps, ChartTooltipItem } from './ChartTooltipContent.tsrx';
|
|
4
4
|
import type { FloatingTooltipOffset, FloatingTooltipPadding, FloatingTooltipPortalProps, FloatingTooltipPositionerProps, FloatingTooltipRootState, TooltipAnchor, TooltipPlacement, UseFloatingTooltipOptions } from './types';
|
|
5
|
-
export { ChartTooltipItem } from './ChartTooltipContent.tsrx';
|
|
5
|
+
export type { ChartTooltipItem } from './ChartTooltipContent.tsrx';
|
|
6
6
|
export type ChartTooltipControlledProps<Datum = unknown> = {
|
|
7
7
|
open: boolean;
|
|
8
8
|
anchor: TooltipAnchor | null;
|
|
@@ -268,7 +268,7 @@ export default function useFloatingTooltip<TData = unknown>(
|
|
|
268
268
|
|
|
269
269
|
const { align, side } = getSideAndAlign(floating.placement);
|
|
270
270
|
const getFloatingPropsWithId = useCallback(
|
|
271
|
-
<TProps extends HTMLProps<HTMLElement
|
|
271
|
+
<TProps extends HTMLProps<HTMLElement>,>(props?: TProps) => getFloatingProps(
|
|
272
272
|
getFloatingPropsWithDefaultId(props, id),
|
|
273
273
|
) as TProps,
|
|
274
274
|
[getFloatingProps, id],
|
|
@@ -295,10 +295,10 @@ export default function useFloatingTooltip<TData = unknown>(
|
|
|
295
295
|
update: floating.update,
|
|
296
296
|
openTooltip,
|
|
297
297
|
closeTooltip,
|
|
298
|
-
getReferenceProps: <TProps extends HTMLProps<Element
|
|
298
|
+
getReferenceProps: <TProps extends HTMLProps<Element>,>(props?: TProps) =>
|
|
299
299
|
getReferenceProps(props) as TProps,
|
|
300
300
|
getFloatingProps: getFloatingPropsWithId,
|
|
301
|
-
getArrowProps: <TProps extends Octane.SVGProps<SVGSVGElement
|
|
301
|
+
getArrowProps: <TProps extends Octane.SVGProps<SVGSVGElement>,>(props?: TProps) => {
|
|
302
302
|
const emptyProps = {};
|
|
303
303
|
return props ?? emptyProps as TProps;
|
|
304
304
|
},
|
|
@@ -21,6 +21,10 @@ import useEventHandlers, {
|
|
|
21
21
|
POINTER_EVENTS_NEAREST,
|
|
22
22
|
} from '../hooks/useEventHandlers.tsrx';
|
|
23
23
|
|
|
24
|
+
// Keep the literal expression below available to bundler define substitution
|
|
25
|
+
// without requiring Node ambient types in browser consumers.
|
|
26
|
+
declare const process: { env: { NODE_ENV?: string } };
|
|
27
|
+
|
|
24
28
|
const DEFAULT_MARGIN = { top: 50, right: 50, bottom: 50, left: 50 };
|
|
25
29
|
|
|
26
30
|
export type XYChartProps<XScaleConfig extends ScaleConfig<AxisScaleOutput, any, any>, YScaleConfig extends ScaleConfig<AxisScaleOutput, any, any>, Datum extends object> = {
|
package/src/xychart/index.ts
CHANGED