@lobehub/charts 1.9.8 → 1.9.10

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.
@@ -1,6 +1,6 @@
1
1
  /// <reference types="react" />
2
2
  import BaseChartProps from "../common/BaseChartProps";
3
- import { CurveType } from "../types";
3
+ import { CurveType } from "../types/charts";
4
4
  export interface AreaChartProps extends BaseChartProps {
5
5
  connectNulls?: boolean;
6
6
  curveType?: CurveType;
@@ -1,5 +1,5 @@
1
1
  import React, { HTMLAttributes, ReactNode } from 'react';
2
- import { ValueFormatter } from "../types";
2
+ import { ValueFormatter } from "../types/charts";
3
3
  export interface Bar {
4
4
  [key: string]: any;
5
5
  color?: string;
@@ -1,6 +1,6 @@
1
1
  /// <reference types="react" />
2
2
  import { FlexboxProps } from 'react-layout-kit';
3
- import { ValueFormatter } from "../types";
3
+ import { ValueFormatter } from "../types/charts";
4
4
  export interface CategoryBarProps extends FlexboxProps {
5
5
  colors?: string[];
6
6
  markerValue?: number;
@@ -7,7 +7,7 @@ var _excluded = ["value", "bgColors", "color", "isIncreasePositive", "showAnimat
7
7
  import { Tooltip } from '@lobehub/ui';
8
8
  import { forwardRef } from 'react';
9
9
  import { Flexbox } from 'react-layout-kit';
10
- import { DeltaTypes } from "../types";
10
+ import { DeltaTypes } from "../types/charts";
11
11
  import { mapInputsToDeltaType } from "../utils";
12
12
  import { useStyles } from "./styles";
13
13
  import { jsx as _jsx } from "react/jsx-runtime";
@@ -1,4 +1,4 @@
1
- import { ValueFormatter } from "../types";
1
+ import { ValueFormatter } from "../types/charts";
2
2
  export interface DonutChartTooltipProps {
3
3
  active: boolean | undefined;
4
4
  customCategories?: {
@@ -2,8 +2,8 @@ import { CSSProperties, ComponentType } from 'react';
2
2
  import type BaseAnimationTimingProps from "../common/BaseAnimationTimingProps";
3
3
  import { CustomTooltipProps } from "../common/CustomTooltipProps";
4
4
  import { type NoDataProps } from "../common/NoData";
5
- import type { EventProps } from "../types";
6
- import { ValueFormatter } from "../types";
5
+ import type { EventProps } from "../types/charts";
6
+ import { ValueFormatter } from "../types/charts";
7
7
  type DonutChartVariant = 'donut' | 'pie';
8
8
  export interface DonutChartProps extends BaseAnimationTimingProps {
9
9
  category?: string;
@@ -1,2 +1,2 @@
1
- import { ValueFormatter } from "../types";
1
+ import { ValueFormatter } from "../types/charts";
2
2
  export declare const parseLabelInput: (labelInput: string | undefined, valueFormatter: ValueFormatter, data: any[], category: string) => string;
@@ -1,5 +1,5 @@
1
1
  import { ReactNode } from 'react';
2
- import type { Activity, Labels, Week } from "../types";
2
+ import type { Activity, Labels, Week } from "../types/charts";
3
3
  interface CalendarProps {
4
4
  blockMargin: number;
5
5
  blockRadius: number;
@@ -1,5 +1,5 @@
1
1
  /// <reference types="react" />
2
- import type { Labels, Week } from "../types";
2
+ import type { Labels, Week } from "../types/charts";
3
3
  interface ChartLabelsProps {
4
4
  blockMargin: number;
5
5
  blockSize: number;
@@ -2,7 +2,7 @@ import type { Day as WeekDay } from 'date-fns';
2
2
  import { ReactNode } from 'react';
3
3
  import { FlexboxProps } from 'react-layout-kit';
4
4
  import { NoDataProps } from "../common/NoData";
5
- import type { Activity, Labels } from "../types";
5
+ import type { Activity, Labels } from "../types/charts";
6
6
  export interface HeatmapsProps extends FlexboxProps {
7
7
  blockMargin?: number;
8
8
  blockRadius?: number;
@@ -86,7 +86,7 @@ var Heatmaps = /*#__PURE__*/forwardRef(function (props, ref) {
86
86
  }
87
87
  case 4:
88
88
  {
89
- return [theme.colorFillSecondary, isDarkMode ? theme.lime4 : theme.green4, isDarkMode ? theme.lime6 : theme.green6, isDarkMode ? theme.lime8 : theme.green8, isDarkMode ? theme.lime10 : theme.green10];
89
+ return [theme.colorFillSecondary, isDarkMode ? theme.lime2 : theme.green2, isDarkMode ? theme.lime4 : theme.green4, isDarkMode ? theme.lime6 : theme.green6, isDarkMode ? theme.lime8 : theme.green8];
90
90
  }
91
91
  default:
92
92
  {
@@ -9,6 +9,6 @@ export var useStyles = createStyles(function (_ref) {
9
9
  container: css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n display: flex;\n flex-direction: column;\n gap: 8px;\n\n width: max-content;\n max-width: 100%;\n\n rect {\n stroke: ", ";\n stroke-width: 1px;\n shape-rendering: geometricprecision;\n }\n "])), token.colorFillTertiary),
10
10
  footer: css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n display: flex;\n flex-wrap: wrap;\n gap: 4px 16px;\n white-space: nowrap;\n "]))),
11
11
  legendColors: css(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n display: flex;\n gap: 3px;\n align-items: center;\n margin-left: auto;\n "]))),
12
- scrollContainer: css(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["\n overflow: auto hidden;\n max-width: 100%;\n "])))
12
+ scrollContainer: css(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["\n overflow: auto hidden;\n max-width: 100%;\n padding-block: 2px;\n "])))
13
13
  };
14
14
  });
@@ -1,6 +1,6 @@
1
1
  /// <reference types="react" />
2
2
  import BaseChartProps from "../common/BaseChartProps";
3
- import { CurveType } from "../types";
3
+ import { CurveType } from "../types/charts";
4
4
  export interface LineChartProps extends BaseChartProps {
5
5
  connectNulls?: boolean;
6
6
  curveType?: CurveType;
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import { ScatterChartValueFormatter } from "../types";
2
+ import { ScatterChartValueFormatter } from "../types/charts";
3
3
  export interface ScatterChartTooltipProps {
4
4
  active: boolean | undefined;
5
5
  axis: any;
@@ -1,7 +1,7 @@
1
1
  import { ComponentType, HTMLAttributes } from 'react';
2
2
  import { CustomTooltipProps } from "../common/CustomTooltipProps";
3
- import type { EventProps } from "../types";
4
- import { IntervalType, ValueFormatter } from "../types";
3
+ import type { EventProps } from "../types/charts";
4
+ import { IntervalType, ValueFormatter } from "../types/charts";
5
5
  import BaseAnimationTimingProps from '../common/BaseAnimationTimingProps';
6
6
  import { type NoDataProps } from '../common/NoData';
7
7
  export type ScatterChartValueFormatter = {
@@ -1,6 +1,6 @@
1
1
  /// <reference types="react" />
2
2
  import BaseSparkChartProps from "../common/BaseSparkChartProps";
3
- import { CurveType } from "../types";
3
+ import { CurveType } from "../types/charts";
4
4
  export interface SparkAreaChartProps extends BaseSparkChartProps {
5
5
  connectNulls?: boolean;
6
6
  curveType?: CurveType;
@@ -1,6 +1,6 @@
1
1
  /// <reference types="react" />
2
2
  import BaseSparkChartProps from "../common/BaseSparkChartProps";
3
- import { CurveType } from "../types";
3
+ import { CurveType } from "../types/charts";
4
4
  export interface SparkLineChartProps extends BaseSparkChartProps {
5
5
  connectNulls?: boolean;
6
6
  curveType?: CurveType;
@@ -1,6 +1,6 @@
1
1
  import { ComponentType, HTMLAttributes } from 'react';
2
2
  import type { NoDataProps } from "./NoData";
3
- import { IntervalType, LabelFormatter, ValueFormatter } from "../types";
3
+ import { IntervalType, LabelFormatter, ValueFormatter } from "../types/charts";
4
4
  import type BaseAnimationTimingProps from './BaseAnimationTimingProps';
5
5
  import { CustomTooltipProps } from './CustomTooltipProps';
6
6
  type FixedProps = {
@@ -1,5 +1,5 @@
1
1
  import { ReactNode } from 'react';
2
- import { ValueFormatter } from "../../types";
2
+ import { ValueFormatter } from "../../types/charts";
3
3
  export interface ChartTooltipProps {
4
4
  active: boolean | undefined;
5
5
  categoryColors: Map<string, string>;
@@ -1,6 +1,6 @@
1
1
  import { NameType, Payload } from 'recharts/types/component/DefaultTooltipContent';
2
2
  import { ScatterChartValueFormatter } from "../ScatterChart";
3
- import { ValueFormatter } from "../types";
3
+ import { ValueFormatter } from "../types/charts";
4
4
  export type CustomTooltipProps = {
5
5
  active: boolean | undefined;
6
6
  customCategories?: {
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import { ValueFormatter } from "../types";
2
+ import { ValueFormatter } from "../types/charts";
3
3
  interface CustomYAxisTickProps {
4
4
  align: 'left' | 'right';
5
5
  formatter: ValueFormatter;
@@ -1,5 +1,8 @@
1
1
  import { useTheme } from 'antd-style';
2
+ import { useMemo } from 'react';
2
3
  export var useThemeColorRange = function useThemeColorRange() {
3
4
  var theme = useTheme();
4
- return [theme.geekblue, theme.gold, theme.lime, theme.volcano, theme.purple, theme.blue, theme.orange, theme.green, theme.red, theme.cyan, theme.yellow, theme.magenta];
5
+ return useMemo(function () {
6
+ return [theme.geekblue, theme.gold, theme.green, theme.cyan, theme.purple, theme.red, theme.volcano, theme.gray, theme.geekblue7, theme.gold7, theme.green7, theme.cyan7, theme.purple7, theme.red7, theme.volcano7, theme.gray7];
7
+ }, [theme]);
5
8
  };
package/es/index.d.ts CHANGED
@@ -13,5 +13,5 @@ export { default as LineChart, type LineChartProps } from './LineChart';
13
13
  export { default as ScatterChart, type ScatterChartProps } from './ScatterChart';
14
14
  export * from './SparkChart';
15
15
  export { default as Tracker, type TrackerProps } from './Tracker';
16
- export type * from './types';
16
+ export type * from './types/charts';
17
17
  export { useThemeColorRange } from "./hooks/useThemeColorRange";
@@ -0,0 +1,9 @@
1
+ import type { LobeCustomStylish, LobeCustomToken } from '@lobehub/ui';
2
+ import 'antd-style';
3
+
4
+ declare module 'antd-style' {
5
+ // eslint-disable-next-line @typescript-eslint/no-empty-interface
6
+ export interface CustomToken extends LobeCustomToken {}
7
+ // eslint-disable-next-line @typescript-eslint/no-empty-interface
8
+ export interface CustomStylish extends LobeCustomStylish {}
9
+ }
@@ -1,5 +1,5 @@
1
1
  import type { Day as WeekDay } from 'date-fns';
2
- import type { Activity, Week } from "../types";
2
+ import type { Activity, Week } from "../types/charts";
3
3
  export declare const DEFAULT_MONTH_LABELS: string[];
4
4
  export declare const DEFAULT_LABELS: {
5
5
  legend: {
@@ -1,4 +1,4 @@
1
- import { ValueFormatter } from "../types";
1
+ import { ValueFormatter } from "../types/charts";
2
2
  export declare const getTextWidth: (text: string) => number;
3
3
  export declare const getMaxLabelLength: ({ data, valueFormatter, index, layout, margin, isScatterChart, }: {
4
4
  data: Array<Record<string, any>>;
@@ -1,4 +1,4 @@
1
- import { ValueFormatter } from "../types";
1
+ import { ValueFormatter } from "../types/charts";
2
2
  export declare const defaultValueFormatter: ValueFormatter;
3
3
  export declare const sumNumericArray: (arr: number[]) => number;
4
4
  export declare const isOnSeverSide: boolean;
package/es/utils/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { DeltaTypes } from "../types";
1
+ import { DeltaTypes } from "../types/charts";
2
2
  export var defaultValueFormatter = String;
3
3
  export var sumNumericArray = function sumNumericArray(arr) {
4
4
  return arr.reduce(function (prefixSum, num) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lobehub/charts",
3
- "version": "1.9.8",
3
+ "version": "1.9.10",
4
4
  "description": "React modern charts components built on recharts",
5
5
  "keywords": [
6
6
  "lobehub",
File without changes
File without changes