@ah-automation.nl/component-lib 0.0.101 → 0.0.102

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,5 +1,5 @@
1
1
  import * as React from "react";
2
2
  import type { BarChartProps } from "@/types";
3
- declare function BarChart({ className, color, data, initialDimension, isAnimationActive, radius, showTooltip, showValueLabels, useDeviceAnimationGuard, valueFormatter, ...props }: BarChartProps): React.ReactElement;
3
+ declare function BarChart({ className, color, data, initialDimension, isAnimationActive, radius, seriesLabel, showTooltip, showValueLabels, useDeviceAnimationGuard, valueFormatter, ...props }: BarChartProps): React.ReactElement;
4
4
  export { BarChart };
5
5
  //# sourceMappingURL=bar-chart.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"bar-chart.d.ts","sourceRoot":"","sources":["../../src/components/bar-chart.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAU/B,OAAO,KAAK,EAAE,aAAa,EAAe,MAAM,SAAS,CAAC;AAK1D,iBAAS,QAAQ,CAAC,EAChB,SAAS,EACT,KAAqB,EACrB,IAAI,EACJ,gBAAgB,EAChB,iBAAwB,EACxB,MAAuB,EACvB,WAAkB,EAClB,eAAsB,EACtB,uBAA8B,EAC9B,cAAc,EACd,GAAG,KAAK,EACT,EAAE,aAAa,GAAG,KAAK,CAAC,YAAY,CAqFpC;AAED,OAAO,EAAE,QAAQ,EAAE,CAAC"}
1
+ {"version":3,"file":"bar-chart.d.ts","sourceRoot":"","sources":["../../src/components/bar-chart.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAU/B,OAAO,KAAK,EAAE,aAAa,EAAe,MAAM,SAAS,CAAC;AAK1D,iBAAS,QAAQ,CAAC,EAChB,SAAS,EACT,KAAqB,EACrB,IAAI,EACJ,gBAAgB,EAChB,iBAAwB,EACxB,MAAuB,EACvB,WAAqB,EACrB,WAAkB,EAClB,eAAsB,EACtB,uBAA8B,EAC9B,cAAc,EACd,GAAG,KAAK,EACT,EAAE,aAAa,GAAG,KAAK,CAAC,YAAY,CAuFpC;AAED,OAAO,EAAE,QAAQ,EAAE,CAAC"}
package/dist/index.js CHANGED
@@ -29921,45 +29921,52 @@ function qme({
29921
29921
  initialDimension: n,
29922
29922
  isAnimationActive: i = !0,
29923
29923
  radius: a = Sre,
29924
- showTooltip: o = !0,
29925
- showValueLabels: l = !0,
29926
- useDeviceAnimationGuard: u = !0,
29927
- valueFormatter: c,
29928
- ...d
29924
+ seriesLabel: o = "Total",
29925
+ showTooltip: l = !0,
29926
+ showValueLabels: u = !0,
29927
+ useDeviceAnimationGuard: c = !0,
29928
+ valueFormatter: d,
29929
+ ...f
29929
29930
  }) {
29930
- const f = EM(
29931
+ const h = EM(
29931
29932
  i,
29932
- u
29933
- ), h = Object.fromEntries(
29934
- r.map((g) => [
29935
- g.key,
29933
+ c
29934
+ ), m = Object.fromEntries(
29935
+ r.map((y) => [
29936
+ y.key,
29936
29937
  {
29937
- color: g.color ?? t,
29938
- label: g.label
29938
+ color: y.color ?? t,
29939
+ label: y.label
29939
29940
  }
29940
29941
  ])
29941
- ), m = r.map((g) => ({
29942
- fill: g.color ?? t,
29943
- label: g.label,
29944
- name: g.key,
29945
- value: g.value
29946
- })), p = (g) => c !== void 0 ? c(g) : g.toLocaleString(), v = (g) => {
29947
- const y = h[g].label;
29948
- return typeof y == "string" || typeof y == "number" ? String(y) : g;
29942
+ ), p = r.map((y) => ({
29943
+ fill: y.color ?? t,
29944
+ label: y.label,
29945
+ name: y.key,
29946
+ value: y.value
29947
+ })), v = (y) => d !== void 0 ? d(y) : y.toLocaleString(), g = (y) => {
29948
+ const E = m[y].label;
29949
+ return typeof E == "string" || typeof E == "number" ? String(E) : y;
29949
29950
  };
29950
29951
  return /* @__PURE__ */ $(
29951
29952
  yM,
29952
29953
  {
29953
- config: h,
29954
+ config: m,
29954
29955
  initialDimension: n,
29955
- className: k("aspect-video w-full", e),
29956
- ...d,
29956
+ className: k(
29957
+ "aspect-video w-full",
29958
+ // accessibilityLayer makes the chart focusable; drop the focus ring
29959
+ // it draws on any focused descendant when a bar is clicked.
29960
+ "[&_*:focus]:outline-none [&_*:focus-visible]:outline-none [&_.recharts-wrapper]:ring-0",
29961
+ e
29962
+ ),
29963
+ ...f,
29957
29964
  children: /* @__PURE__ */ K(
29958
29965
  rre,
29959
29966
  {
29960
29967
  accessibilityLayer: !0,
29961
- data: m,
29962
- margin: { top: l ? 24 : 8 },
29968
+ data: p,
29969
+ margin: { top: u ? 24 : 8 },
29963
29970
  children: [
29964
29971
  /* @__PURE__ */ $(
29965
29972
  XC,
@@ -29968,29 +29975,24 @@ function qme({
29968
29975
  tickLine: !1,
29969
29976
  axisLine: !1,
29970
29977
  tickMargin: 8,
29971
- tickFormatter: v
29978
+ tickFormatter: g
29972
29979
  }
29973
29980
  ),
29974
- o ? /* @__PURE__ */ $(
29981
+ l ? /* @__PURE__ */ $(
29975
29982
  bM,
29976
29983
  {
29977
- cursor: !1,
29978
- content: /* @__PURE__ */ $(
29979
- wM,
29980
- {
29981
- hideLabel: !0,
29982
- formatter: (g) => p(Number(g))
29983
- }
29984
- )
29984
+ cursor: { fill: "var(--muted)", opacity: 0.4 },
29985
+ content: /* @__PURE__ */ $(wM, {})
29985
29986
  }
29986
29987
  ) : null,
29987
29988
  /* @__PURE__ */ $(
29988
29989
  YC,
29989
29990
  {
29990
29991
  dataKey: "value",
29992
+ name: o,
29991
29993
  radius: a,
29992
- isAnimationActive: f,
29993
- children: l ? /* @__PURE__ */ $(
29994
+ isAnimationActive: h,
29995
+ children: u ? /* @__PURE__ */ $(
29994
29996
  Do,
29995
29997
  {
29996
29998
  dataKey: "value",
@@ -29999,7 +30001,7 @@ function qme({
29999
30001
  className: "fill-muted-foreground",
30000
30002
  fontSize: 12,
30001
30003
  fontWeight: 600,
30002
- formatter: (g) => p(Number(g))
30004
+ formatter: (y) => v(Number(y))
30003
30005
  }
30004
30006
  ) : null
30005
30007
  }