@ztwoint/z-ui 0.1.115 → 0.1.116
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/components/chart/chart.d.ts +4 -0
- package/dist/components/chart/chart.js +25 -0
- package/dist/components/chart/index.d.ts +2 -0
- package/dist/components/chart-card/builders/bar-chart-builder.d.ts +3 -0
- package/dist/components/chart-card/builders/bar-chart-builder.js +43 -0
- package/dist/components/chart-card/builders/chart-builder-factory.d.ts +5 -0
- package/dist/components/chart-card/builders/chart-builder-factory.js +23 -0
- package/dist/components/chart-card/builders/line-chart-builder.d.ts +3 -0
- package/dist/components/chart-card/builders/line-chart-builder.js +53 -0
- package/dist/components/chart-card/builders/pie-chart-builder.d.ts +3 -0
- package/dist/components/chart-card/builders/pie-chart-builder.js +71 -0
- package/dist/components/chart-card/chart-card-states.d.ts +10 -0
- package/dist/components/chart-card/chart-card-states.js +93 -0
- package/dist/components/chart-card/chart-card.config.types.d.ts +99 -0
- package/dist/components/chart-card/chart-card.d.ts +2 -0
- package/dist/components/chart-card/chart-card.js +72 -0
- package/dist/components/chart-card/chart-card.types.d.ts +12 -0
- package/dist/components/chart-card/config/colors.d.ts +29 -0
- package/dist/components/chart-card/config/colors.js +49 -0
- package/dist/components/chart-card/config/defaults.d.ts +164 -0
- package/dist/components/chart-card/config/defaults.js +156 -0
- package/dist/components/chart-card/index.d.ts +10 -0
- package/dist/components/chart-card/validators/config-validator.d.ts +7 -0
- package/dist/components/chart-card/validators/config-validator.js +40 -0
- package/dist/components/table/components/cell/avatar-cell.js +5 -2
- package/dist/components/table/table-provider.js +3 -0
- package/dist/components/table-card/table-card.js +11 -8
- package/dist/css/styles/tailwind.css +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.js +153 -130
- package/dist/types/components/chart/chart.d.ts +4 -0
- package/dist/types/components/chart/index.d.ts +2 -0
- package/dist/types/components/chart-card/builders/bar-chart-builder.d.ts +3 -0
- package/dist/types/components/chart-card/builders/chart-builder-factory.d.ts +5 -0
- package/dist/types/components/chart-card/builders/line-chart-builder.d.ts +3 -0
- package/dist/types/components/chart-card/builders/pie-chart-builder.d.ts +3 -0
- package/dist/types/components/chart-card/chart-card-states.d.ts +10 -0
- package/dist/types/components/chart-card/chart-card.config.types.d.ts +99 -0
- package/dist/types/components/chart-card/chart-card.d.ts +2 -0
- package/dist/types/components/chart-card/chart-card.types.d.ts +12 -0
- package/dist/types/components/chart-card/config/colors.d.ts +29 -0
- package/dist/types/components/chart-card/config/defaults.d.ts +164 -0
- package/dist/types/components/chart-card/index.d.ts +10 -0
- package/dist/types/components/chart-card/validators/config-validator.d.ts +7 -0
- package/dist/types/index.d.ts +2 -0
- package/package.json +3 -1
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import type { ChartType } from '../chart-card.config.types';
|
|
2
|
+
export declare const COLOR_PALETTES: {
|
|
3
|
+
readonly default: readonly ["#2563eb", "#7c3aed", "#d97706", "#16a34a", "#dc2626", "#0284c7"];
|
|
4
|
+
readonly brand: readonly ["#2563eb", "#3b82f6", "#1d4ed8", "#60a5fa"];
|
|
5
|
+
readonly success: readonly ["#16a34a", "#22c55e", "#15803d", "#4ade80"];
|
|
6
|
+
readonly warning: readonly ["#d97706", "#f59e0b", "#b45309", "#fbbf24"];
|
|
7
|
+
readonly danger: readonly ["#dc2626", "#ef4444", "#b91c1c", "#f87171"];
|
|
8
|
+
readonly purple: readonly ["#7c3aed", "#8b5cf6", "#6d28d9", "#a78bfa"];
|
|
9
|
+
readonly neutral: readonly ["#5d5d5d", "#6d6d6d", "#4f4f4f", "#888888"];
|
|
10
|
+
};
|
|
11
|
+
export declare const CHART_THEME_PALETTES: Record<ChartType, Record<string, ReadonlyArray<string>>>;
|
|
12
|
+
export declare const UI_COLORS: {
|
|
13
|
+
readonly text: {
|
|
14
|
+
readonly primary: "#000000";
|
|
15
|
+
readonly secondary: "#5d5d5d";
|
|
16
|
+
readonly muted: "#888888";
|
|
17
|
+
};
|
|
18
|
+
readonly border: {
|
|
19
|
+
readonly light: "#e7e7e7";
|
|
20
|
+
readonly default: "#d1d1d1";
|
|
21
|
+
readonly medium: "#b0b0b0";
|
|
22
|
+
};
|
|
23
|
+
readonly background: {
|
|
24
|
+
readonly default: "#ffffff";
|
|
25
|
+
readonly light: "#fafafa";
|
|
26
|
+
readonly medium: "#f6f6f6";
|
|
27
|
+
};
|
|
28
|
+
};
|
|
29
|
+
export declare function getThemePalette(type: ChartType, theme: string): string[];
|
|
@@ -0,0 +1,164 @@
|
|
|
1
|
+
import type { ChartOptions } from '../chart-card.config.types';
|
|
2
|
+
export declare const DEFAULT_CHART_HEIGHT = 400;
|
|
3
|
+
export declare const DEFAULT_CHART_WIDTH = "100%";
|
|
4
|
+
export declare const DEFAULT_FONT_FAMILY = "Inter Variable, sans-serif";
|
|
5
|
+
export declare const COMMON_TEXT_STYLE: {
|
|
6
|
+
fontFamily: string;
|
|
7
|
+
color: "#000000";
|
|
8
|
+
};
|
|
9
|
+
export declare function buildTitleConfig(title: string, options?: ChartOptions['title']): {
|
|
10
|
+
text: string;
|
|
11
|
+
textStyle: {
|
|
12
|
+
fontFamily: string;
|
|
13
|
+
fontSize: number;
|
|
14
|
+
fontWeight: number;
|
|
15
|
+
color: string;
|
|
16
|
+
};
|
|
17
|
+
left: "center" | "left" | "right";
|
|
18
|
+
top: number;
|
|
19
|
+
padding: number[];
|
|
20
|
+
} | undefined;
|
|
21
|
+
export declare function buildTooltipConfig(options?: ChartOptions['tooltip']): {
|
|
22
|
+
trigger: "axis" | "item";
|
|
23
|
+
backgroundColor: "#ffffff";
|
|
24
|
+
borderColor: "#d1d1d1";
|
|
25
|
+
borderWidth: number;
|
|
26
|
+
textStyle: {
|
|
27
|
+
fontFamily: string;
|
|
28
|
+
color: "#000000";
|
|
29
|
+
};
|
|
30
|
+
} | undefined;
|
|
31
|
+
export declare function buildLegendConfig(data: string[], hasTitle?: boolean, options?: ChartOptions['legend']): {
|
|
32
|
+
data: string[];
|
|
33
|
+
top: string | number;
|
|
34
|
+
bottom: string | number | undefined;
|
|
35
|
+
left: string | number;
|
|
36
|
+
right: string | number | undefined;
|
|
37
|
+
orient: "horizontal" | "vertical";
|
|
38
|
+
itemGap: number;
|
|
39
|
+
padding: number[];
|
|
40
|
+
textStyle: {
|
|
41
|
+
fontSize: number;
|
|
42
|
+
fontFamily: string;
|
|
43
|
+
color: "#000000";
|
|
44
|
+
};
|
|
45
|
+
itemWidth: number;
|
|
46
|
+
itemHeight: number;
|
|
47
|
+
} | undefined;
|
|
48
|
+
export declare function buildAxisLabelConfig(rotate?: number): {
|
|
49
|
+
rotate?: number | undefined;
|
|
50
|
+
color: "#5d5d5d";
|
|
51
|
+
fontFamily: string;
|
|
52
|
+
fontSize: number;
|
|
53
|
+
};
|
|
54
|
+
export declare function buildAxisLineConfig(show?: boolean): {
|
|
55
|
+
show: boolean;
|
|
56
|
+
lineStyle: {
|
|
57
|
+
color: "#d1d1d1";
|
|
58
|
+
};
|
|
59
|
+
};
|
|
60
|
+
export declare function buildSplitLineConfig(show?: boolean): {
|
|
61
|
+
show: boolean;
|
|
62
|
+
lineStyle: {
|
|
63
|
+
color: "#e7e7e7";
|
|
64
|
+
};
|
|
65
|
+
};
|
|
66
|
+
export declare function buildGridConfig(hasTitle: boolean, hasLegend?: boolean, legendPosition?: 'top' | 'bottom' | 'left' | 'right', customGrid?: ChartOptions['grid']): {
|
|
67
|
+
left: string | number;
|
|
68
|
+
right: string | number;
|
|
69
|
+
bottom: string | number;
|
|
70
|
+
top: string | number;
|
|
71
|
+
containLabel: boolean;
|
|
72
|
+
};
|
|
73
|
+
export declare function buildXAxisConfig(data: string[], boundaryGap?: boolean, options?: ChartOptions['xAxis']): {
|
|
74
|
+
show: boolean;
|
|
75
|
+
type?: undefined;
|
|
76
|
+
data?: undefined;
|
|
77
|
+
boundaryGap?: undefined;
|
|
78
|
+
name?: undefined;
|
|
79
|
+
nameLocation?: undefined;
|
|
80
|
+
nameGap?: undefined;
|
|
81
|
+
nameTextStyle?: undefined;
|
|
82
|
+
axisLine?: undefined;
|
|
83
|
+
axisLabel?: undefined;
|
|
84
|
+
splitLine?: undefined;
|
|
85
|
+
} | {
|
|
86
|
+
type: "category";
|
|
87
|
+
data: string[];
|
|
88
|
+
boundaryGap: boolean;
|
|
89
|
+
name: string | undefined;
|
|
90
|
+
nameLocation: "end" | "middle" | "start";
|
|
91
|
+
nameGap: number | undefined;
|
|
92
|
+
nameTextStyle: {
|
|
93
|
+
fontSize: number;
|
|
94
|
+
fontWeight: number;
|
|
95
|
+
fontFamily: string;
|
|
96
|
+
color: "#000000";
|
|
97
|
+
} | undefined;
|
|
98
|
+
axisLine: {
|
|
99
|
+
show: boolean;
|
|
100
|
+
lineStyle: {
|
|
101
|
+
color: "#d1d1d1";
|
|
102
|
+
};
|
|
103
|
+
};
|
|
104
|
+
axisLabel: {
|
|
105
|
+
rotate?: number | undefined;
|
|
106
|
+
color: "#5d5d5d";
|
|
107
|
+
fontFamily: string;
|
|
108
|
+
fontSize: number;
|
|
109
|
+
};
|
|
110
|
+
splitLine: {
|
|
111
|
+
show: boolean;
|
|
112
|
+
lineStyle: {
|
|
113
|
+
color: "#e7e7e7";
|
|
114
|
+
};
|
|
115
|
+
};
|
|
116
|
+
show?: undefined;
|
|
117
|
+
};
|
|
118
|
+
export declare function buildYAxisConfig(options?: ChartOptions['yAxis']): {
|
|
119
|
+
show: boolean;
|
|
120
|
+
type?: undefined;
|
|
121
|
+
name?: undefined;
|
|
122
|
+
nameLocation?: undefined;
|
|
123
|
+
nameGap?: undefined;
|
|
124
|
+
nameRotate?: undefined;
|
|
125
|
+
nameTextStyle?: undefined;
|
|
126
|
+
min?: undefined;
|
|
127
|
+
max?: undefined;
|
|
128
|
+
axisLine?: undefined;
|
|
129
|
+
axisLabel?: undefined;
|
|
130
|
+
splitLine?: undefined;
|
|
131
|
+
} | {
|
|
132
|
+
type: "value";
|
|
133
|
+
name: string | undefined;
|
|
134
|
+
nameLocation: "end" | "middle" | "start";
|
|
135
|
+
nameGap: number | undefined;
|
|
136
|
+
nameRotate: number;
|
|
137
|
+
nameTextStyle: {
|
|
138
|
+
fontSize: number;
|
|
139
|
+
fontWeight: number;
|
|
140
|
+
fontFamily: string;
|
|
141
|
+
color: "#000000";
|
|
142
|
+
} | undefined;
|
|
143
|
+
min: number | undefined;
|
|
144
|
+
max: number | undefined;
|
|
145
|
+
axisLine: {
|
|
146
|
+
show: boolean;
|
|
147
|
+
lineStyle: {
|
|
148
|
+
color: "#d1d1d1";
|
|
149
|
+
};
|
|
150
|
+
};
|
|
151
|
+
axisLabel: {
|
|
152
|
+
rotate?: number | undefined;
|
|
153
|
+
color: "#5d5d5d";
|
|
154
|
+
fontFamily: string;
|
|
155
|
+
fontSize: number;
|
|
156
|
+
};
|
|
157
|
+
splitLine: {
|
|
158
|
+
show: boolean;
|
|
159
|
+
lineStyle: {
|
|
160
|
+
color: "#e7e7e7";
|
|
161
|
+
};
|
|
162
|
+
};
|
|
163
|
+
show?: undefined;
|
|
164
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export { ChartCard } from './chart-card';
|
|
2
|
+
export type { ChartCardProps } from './chart-card.types';
|
|
3
|
+
export { LoadingState, EmptyState, ErrorState } from './chart-card-states';
|
|
4
|
+
export type { ChartType, ChartTheme, LineChartTheme, BarChartTheme, ChartConfig, BarChartConfig, LineChartConfig, ChartSeries, ChartData, ChartOptions, SeriesStyleConfig, } from './chart-card.config.types';
|
|
5
|
+
export { UI_COLORS, COLOR_PALETTES, getThemePalette } from './config/colors';
|
|
6
|
+
export { validateChartConfig, validateChartData } from './validators/config-validator';
|
|
7
|
+
export type { ValidationResult } from './validators/config-validator';
|
|
8
|
+
export { buildBarChartOptions } from './builders/bar-chart-builder';
|
|
9
|
+
export { buildLineChartOptions } from './builders/line-chart-builder';
|
|
10
|
+
export { buildChartOptions, isChartTypeSupported, registeredChartTypes, } from './builders/chart-builder-factory';
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { ChartConfig, ChartData } from '../chart-card.config.types';
|
|
2
|
+
export interface ValidationResult {
|
|
3
|
+
valid: boolean;
|
|
4
|
+
error?: string;
|
|
5
|
+
}
|
|
6
|
+
export declare function validateChartConfig(config: ChartConfig): ValidationResult;
|
|
7
|
+
export declare function validateChartData(data: ChartData): ValidationResult;
|
package/dist/types/index.d.ts
CHANGED
|
@@ -28,6 +28,8 @@ export * from './components/assets/icons';
|
|
|
28
28
|
export * from './components/segmented-control';
|
|
29
29
|
export * from './components/popover/popover';
|
|
30
30
|
export * from './components/dynamic-table';
|
|
31
|
+
export * from './components/chart';
|
|
32
|
+
export * from './components/chart-card';
|
|
31
33
|
export * from './components/radio-card/radio-card';
|
|
32
34
|
export * from './lib/theme.hook';
|
|
33
35
|
export * from './lib/utils';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ztwoint/z-ui",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.116",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"module": "./dist/index.js",
|
|
@@ -101,6 +101,8 @@
|
|
|
101
101
|
"classnames": "^2.5.1",
|
|
102
102
|
"clsx": "^2.1.1",
|
|
103
103
|
"cmdk": "^1.1.1",
|
|
104
|
+
"echarts": "^5.6.0",
|
|
105
|
+
"echarts-for-react": "^3.0.2",
|
|
104
106
|
"lucide-react": "^0.525.0",
|
|
105
107
|
"radix-ui": "^1.4.3",
|
|
106
108
|
"react-country-flag": "^3.1.0",
|