@adsgency_npm/adsgency-ads-ui 0.1.0-alpha.32 → 0.1.0-alpha.33

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/index.cjs CHANGED
@@ -6174,6 +6174,8 @@ function AdsLineChart({
6174
6174
  yAxis,
6175
6175
  yAxisProps
6176
6176
  }) {
6177
+ const [activeDataKey, setActiveDataKey] = React48.useState(null);
6178
+ const hoverHighlightDataKey = series.find((item) => item.activeColor)?.dataKey ?? null;
6177
6179
  const chartData = data.map((datum) => {
6178
6180
  const safeDatum = { ...datum, [xKey]: datum[xKey] };
6179
6181
  series.forEach((item) => {
@@ -6211,6 +6213,14 @@ function AdsLineChart({
6211
6213
  data: chartData,
6212
6214
  margin: chartProps?.margin ?? { bottom: 0, left: 0, right: 0, top: 0 },
6213
6215
  ...chartProps,
6216
+ onMouseLeave: (...args) => {
6217
+ setActiveDataKey(null);
6218
+ chartProps?.onMouseLeave?.(...args);
6219
+ },
6220
+ onMouseMove: (...args) => {
6221
+ setActiveDataKey(hoverHighlightDataKey);
6222
+ chartProps?.onMouseMove?.(...args);
6223
+ },
6214
6224
  children: [
6215
6225
  showGrid && /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
6216
6226
  import_recharts3.CartesianGrid,
@@ -6289,7 +6299,9 @@ function AdsLineChart({
6289
6299
  dataKey: item.dataKey,
6290
6300
  fill: item.areaProps?.fill ?? color,
6291
6301
  fillOpacity: item.areaProps?.fillOpacity ?? opacity,
6292
- isAnimationActive: item.areaProps?.isAnimationActive ?? false,
6302
+ animationDuration: item.areaProps?.animationDuration ?? 360,
6303
+ animationEasing: item.areaProps?.animationEasing ?? "ease-out",
6304
+ isAnimationActive: item.areaProps?.isAnimationActive ?? true,
6293
6305
  stroke: item.areaProps?.stroke ?? "none",
6294
6306
  type: item.areaProps?.type ?? curve
6295
6307
  }
@@ -6299,10 +6311,14 @@ function AdsLineChart({
6299
6311
  {
6300
6312
  ...item.lineProps,
6301
6313
  activeDot: item.lineProps?.activeDot ?? { r: 5 },
6314
+ animationDuration: item.lineProps?.animationDuration ?? 360,
6315
+ animationEasing: item.lineProps?.animationEasing ?? "ease-out",
6302
6316
  dataKey: item.dataKey,
6303
6317
  dot: item.lineProps?.dot ?? false,
6304
- isAnimationActive: item.lineProps?.isAnimationActive ?? false,
6305
- stroke: item.lineProps?.stroke ?? color,
6318
+ isAnimationActive: item.lineProps?.isAnimationActive ?? true,
6319
+ onMouseEnter: () => setActiveDataKey(item.dataKey),
6320
+ onMouseLeave: () => setActiveDataKey(null),
6321
+ stroke: activeDataKey === item.dataKey ? item.activeColor ?? "#2196f3" : item.lineProps?.stroke ?? color,
6306
6322
  strokeWidth: item.lineProps?.strokeWidth ?? item.strokeWidth ?? 2,
6307
6323
  type: item.lineProps?.type ?? curve
6308
6324
  }
package/dist/index.d.cts CHANGED
@@ -771,6 +771,7 @@ interface ChartContainerProps extends React$1.ComponentPropsWithoutRef<"div"> {
771
771
  type AxisBound$1 = "auto" | "dataMax" | "dataMin" | number;
772
772
  type AdsLineChartCurve = "linear" | "monotone" | "step";
773
773
  interface AdsLineChartSeries {
774
+ activeColor?: string;
774
775
  areaOpacity?: number;
775
776
  areaProps?: Omit<React$1.ComponentProps<typeof Area>, "dataKey">;
776
777
  color?: string;
package/dist/index.d.ts CHANGED
@@ -771,6 +771,7 @@ interface ChartContainerProps extends React$1.ComponentPropsWithoutRef<"div"> {
771
771
  type AxisBound$1 = "auto" | "dataMax" | "dataMin" | number;
772
772
  type AdsLineChartCurve = "linear" | "monotone" | "step";
773
773
  interface AdsLineChartSeries {
774
+ activeColor?: string;
774
775
  areaOpacity?: number;
775
776
  areaProps?: Omit<React$1.ComponentProps<typeof Area>, "dataKey">;
776
777
  color?: string;
package/dist/index.js CHANGED
@@ -6011,6 +6011,8 @@ function AdsLineChart({
6011
6011
  yAxis,
6012
6012
  yAxisProps
6013
6013
  }) {
6014
+ const [activeDataKey, setActiveDataKey] = React48.useState(null);
6015
+ const hoverHighlightDataKey = series.find((item) => item.activeColor)?.dataKey ?? null;
6014
6016
  const chartData = data.map((datum) => {
6015
6017
  const safeDatum = { ...datum, [xKey]: datum[xKey] };
6016
6018
  series.forEach((item) => {
@@ -6048,6 +6050,14 @@ function AdsLineChart({
6048
6050
  data: chartData,
6049
6051
  margin: chartProps?.margin ?? { bottom: 0, left: 0, right: 0, top: 0 },
6050
6052
  ...chartProps,
6053
+ onMouseLeave: (...args) => {
6054
+ setActiveDataKey(null);
6055
+ chartProps?.onMouseLeave?.(...args);
6056
+ },
6057
+ onMouseMove: (...args) => {
6058
+ setActiveDataKey(hoverHighlightDataKey);
6059
+ chartProps?.onMouseMove?.(...args);
6060
+ },
6051
6061
  children: [
6052
6062
  showGrid && /* @__PURE__ */ jsx55(
6053
6063
  CartesianGrid,
@@ -6126,7 +6136,9 @@ function AdsLineChart({
6126
6136
  dataKey: item.dataKey,
6127
6137
  fill: item.areaProps?.fill ?? color,
6128
6138
  fillOpacity: item.areaProps?.fillOpacity ?? opacity,
6129
- isAnimationActive: item.areaProps?.isAnimationActive ?? false,
6139
+ animationDuration: item.areaProps?.animationDuration ?? 360,
6140
+ animationEasing: item.areaProps?.animationEasing ?? "ease-out",
6141
+ isAnimationActive: item.areaProps?.isAnimationActive ?? true,
6130
6142
  stroke: item.areaProps?.stroke ?? "none",
6131
6143
  type: item.areaProps?.type ?? curve
6132
6144
  }
@@ -6136,10 +6148,14 @@ function AdsLineChart({
6136
6148
  {
6137
6149
  ...item.lineProps,
6138
6150
  activeDot: item.lineProps?.activeDot ?? { r: 5 },
6151
+ animationDuration: item.lineProps?.animationDuration ?? 360,
6152
+ animationEasing: item.lineProps?.animationEasing ?? "ease-out",
6139
6153
  dataKey: item.dataKey,
6140
6154
  dot: item.lineProps?.dot ?? false,
6141
- isAnimationActive: item.lineProps?.isAnimationActive ?? false,
6142
- stroke: item.lineProps?.stroke ?? color,
6155
+ isAnimationActive: item.lineProps?.isAnimationActive ?? true,
6156
+ onMouseEnter: () => setActiveDataKey(item.dataKey),
6157
+ onMouseLeave: () => setActiveDataKey(null),
6158
+ stroke: activeDataKey === item.dataKey ? item.activeColor ?? "#2196f3" : item.lineProps?.stroke ?? color,
6143
6159
  strokeWidth: item.lineProps?.strokeWidth ?? item.strokeWidth ?? 2,
6144
6160
  type: item.lineProps?.type ?? curve
6145
6161
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adsgency_npm/adsgency-ads-ui",
3
- "version": "0.1.0-alpha.32",
3
+ "version": "0.1.0-alpha.33",
4
4
  "description": "AdsGency Ads Design System React component library.",
5
5
  "private": false,
6
6
  "type": "module",
@@ -35,26 +35,6 @@
35
35
  "publishConfig": {
36
36
  "access": "public"
37
37
  },
38
- "scripts": {
39
- "build": "tsup && node scripts/copy-assets.mjs",
40
- "dev": "tsup --watch",
41
- "demo": "vite --config examples/playground/vite.config.ts --host 127.0.0.1 --port 4173",
42
- "demo:full": "pnpm build && pnpm demo",
43
- "demo:build": "pnpm build && vite build --config examples/playground/vite.config.ts",
44
- "demo:typecheck": "tsc --noEmit -p examples/playground/tsconfig.json",
45
- "verify:hygiene": "node scripts/verify-hygiene.mjs",
46
- "verify:tokens": "node scripts/verify-tokens.mjs",
47
- "verify:package": "node scripts/verify-package.mjs",
48
- "lint": "eslint src tests --max-warnings=0 && pnpm verify:hygiene && pnpm verify:tokens",
49
- "typecheck": "tsc --noEmit",
50
- "test": "vitest run",
51
- "test:watch": "vitest",
52
- "pack:dry": "pnpm build && npm pack --dry-run",
53
- "verify": "pnpm lint && pnpm typecheck && pnpm test && pnpm demo:typecheck && pnpm build && pnpm verify:package",
54
- "prepublishOnly": "pnpm verify",
55
- "prepack": "node scripts/remove-sourcemaps.mjs",
56
- "postpack": "pnpm build"
57
- },
58
38
  "peerDependencies": {
59
39
  "react": ">=18.2.0",
60
40
  "react-dom": ">=18.2.0",
@@ -118,5 +98,22 @@
118
98
  "typescript-eslint": "^8.35.1",
119
99
  "vite": "^7.3.5",
120
100
  "vitest": "^3.2.4"
101
+ },
102
+ "scripts": {
103
+ "build": "tsup && node scripts/copy-assets.mjs",
104
+ "dev": "tsup --watch",
105
+ "demo": "vite --config examples/playground/vite.config.ts --host 127.0.0.1 --port 4173",
106
+ "demo:full": "pnpm build && pnpm demo",
107
+ "demo:build": "pnpm build && vite build --config examples/playground/vite.config.ts",
108
+ "demo:typecheck": "tsc --noEmit -p examples/playground/tsconfig.json",
109
+ "verify:hygiene": "node scripts/verify-hygiene.mjs",
110
+ "verify:tokens": "node scripts/verify-tokens.mjs",
111
+ "verify:package": "node scripts/verify-package.mjs",
112
+ "lint": "eslint src tests --max-warnings=0 && pnpm verify:hygiene && pnpm verify:tokens",
113
+ "typecheck": "tsc --noEmit",
114
+ "test": "NODE_OPTIONS=--max-old-space-size=1536 vitest run",
115
+ "test:watch": "NODE_OPTIONS=--max-old-space-size=1536 vitest",
116
+ "pack:dry": "pnpm build && npm pack --dry-run",
117
+ "verify": "pnpm lint && pnpm typecheck && pnpm test && pnpm demo:typecheck && pnpm build && pnpm verify:package"
121
118
  }
122
- }
119
+ }
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/tokens/designTokens.ts"],"sourcesContent":["export const designTokens = {\n background: \"#151619\",\n foreground: \"#fdfdfd\",\n card: \"#1b1c21\",\n cardForeground: \"#fdfdfd\",\n popover: \"#2a2b2f\",\n popoverForeground: \"#fdfdfd\",\n primary: \"#844fff\",\n primaryForeground: \"#fdfdfd\",\n secondary: \"#3f4043\",\n secondaryForeground: \"#fdfdfd\",\n muted: \"#3f4043\",\n mutedForeground: \"#7e7f81\",\n accent: \"#3f4043\",\n accentForeground: \"#fdfdfd\",\n destructive: \"#dc2626\",\n destructiveForeground: \"#ff9b9b\",\n border: \"#545558\",\n input: \"#151619\",\n ring: \"#a984ff\",\n brandSecondary: \"#af41ff\",\n brandSecondaryForeground: \"#151619\",\n brandGradientFrom: \"#6859ff\",\n brandGradientTo: \"#af41ff\",\n success: \"#008e61\",\n successForeground: \"#fdfdfd\",\n warning: \"#cd6c00\",\n warningForeground: \"#fdfdfd\",\n info: \"#844fff\",\n infoForeground: \"#fdfdfd\",\n borderMuted: \"#3f4043\",\n active: \"#422880\",\n activeForeground: \"#fdfdfd\",\n labelForeground: \"#a8a9aa\",\n icon: \"#939496\",\n iconMuted: \"#545558\",\n spacing: {\n xs: \"0.25rem\",\n sm: \"0.5rem\",\n md: \"0.75rem\",\n lg: \"1rem\",\n xl: \"1.5rem\",\n \"2xl\": \"2rem\",\n },\n radius: {\n sm: \"0.25rem\",\n md: \"0.375rem\",\n lg: \"0.5rem\",\n xl: \"0.75rem\",\n full: \"9999px\",\n },\n size: {\n controlHeight: \"2.5rem\",\n modalWidth: \"42rem\",\n sidebarWidth: \"17.5rem\",\n },\n zIndex: {\n toolbar: 30,\n overlay: 40,\n modal: 50,\n toast: 60,\n },\n} as const;\n\nexport type DesignTokens = typeof designTokens;\n"],"mappings":";;;AAAO,IAAM,eAAe;AAAA,EAC1B,YAAY;AAAA,EACZ,YAAY;AAAA,EACZ,MAAM;AAAA,EACN,gBAAgB;AAAA,EAChB,SAAS;AAAA,EACT,mBAAmB;AAAA,EACnB,SAAS;AAAA,EACT,mBAAmB;AAAA,EACnB,WAAW;AAAA,EACX,qBAAqB;AAAA,EACrB,OAAO;AAAA,EACP,iBAAiB;AAAA,EACjB,QAAQ;AAAA,EACR,kBAAkB;AAAA,EAClB,aAAa;AAAA,EACb,uBAAuB;AAAA,EACvB,QAAQ;AAAA,EACR,OAAO;AAAA,EACP,MAAM;AAAA,EACN,gBAAgB;AAAA,EAChB,0BAA0B;AAAA,EAC1B,mBAAmB;AAAA,EACnB,iBAAiB;AAAA,EACjB,SAAS;AAAA,EACT,mBAAmB;AAAA,EACnB,SAAS;AAAA,EACT,mBAAmB;AAAA,EACnB,MAAM;AAAA,EACN,gBAAgB;AAAA,EAChB,aAAa;AAAA,EACb,QAAQ;AAAA,EACR,kBAAkB;AAAA,EAClB,iBAAiB;AAAA,EACjB,MAAM;AAAA,EACN,WAAW;AAAA,EACX,SAAS;AAAA,IACP,IAAI;AAAA,IACJ,IAAI;AAAA,IACJ,IAAI;AAAA,IACJ,IAAI;AAAA,IACJ,IAAI;AAAA,IACJ,OAAO;AAAA,EACT;AAAA,EACA,QAAQ;AAAA,IACN,IAAI;AAAA,IACJ,IAAI;AAAA,IACJ,IAAI;AAAA,IACJ,IAAI;AAAA,IACJ,MAAM;AAAA,EACR;AAAA,EACA,MAAM;AAAA,IACJ,eAAe;AAAA,IACf,YAAY;AAAA,IACZ,cAAc;AAAA,EAChB;AAAA,EACA,QAAQ;AAAA,IACN,SAAS;AAAA,IACT,SAAS;AAAA,IACT,OAAO;AAAA,IACP,OAAO;AAAA,EACT;AACF;","names":[]}