@ambuj.bhaskar/react-component-library 0.24.3-alpha → 0.24.5-alpha

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.js CHANGED
@@ -32596,34 +32596,39 @@ function J5e({
32596
32596
  input: e,
32597
32597
  type: t,
32598
32598
  lineVariant: n,
32599
- lineTension: r
32599
+ lineTension: r,
32600
+ opacity: o,
32601
+ lineStroke: i,
32602
+ colors: a
32600
32603
  }) {
32601
- const o = ["#4e79a7", "#f28e2b", "#e15759", "#76b7b2"], i = t === "doughnut" || t === "pie";
32604
+ const s = a, l = t === "doughnut" || t === "pie";
32602
32605
  return {
32603
32606
  labels: e.labels,
32604
32607
  datasets: e.datasets.map(
32605
- (a, s) => {
32606
- var l;
32607
- return i ? {
32608
- label: a.label,
32609
- data: a.data,
32610
- backgroundColor: a.colors && a.colors.length === a.data.length ? (l = a.colors) == null ? void 0 : l.map((u) => lf(u)) : a.data.map(
32611
- (u, d) => lf(
32612
- o[d % o.length]
32608
+ (u, d) => {
32609
+ var h;
32610
+ return l ? {
32611
+ label: u.label,
32612
+ data: u.data,
32613
+ backgroundColor: u.colors && u.colors.length === u.data.length ? (h = u.colors) == null ? void 0 : h.map((C) => lf(C, o)) : u.data.map(
32614
+ (C, m) => lf(
32615
+ s[m % s.length],
32616
+ o
32613
32617
  )
32614
32618
  ),
32615
- borderColor: a.colors && a.colors.length === a.data.length ? a.colors : a.data.map(
32616
- (u, d) => o[d % o.length]
32619
+ borderColor: u.colors && u.colors.length === u.data.length ? u.colors : u.data.map(
32620
+ (C, m) => s[m % s.length]
32617
32621
  ),
32618
32622
  borderWidth: 2
32619
32623
  } : {
32620
- label: a.label,
32621
- data: a.data,
32624
+ label: u.label,
32625
+ data: u.data,
32622
32626
  backgroundColor: lf(
32623
- a.color || o[s % o.length]
32627
+ u.color || s[d % s.length],
32628
+ o
32624
32629
  ),
32625
- borderColor: a.color || o[s % o.length],
32626
- borderWidth: t === "line" ? 2 : 1,
32630
+ borderColor: u.color || s[d % s.length],
32631
+ borderWidth: t === "line" ? i : 1,
32627
32632
  fill: n == "fill",
32628
32633
  tension: r ?? 0.4
32629
32634
  };
@@ -32694,16 +32699,18 @@ function e4e({
32694
32699
  }
32695
32700
  }) : r;
32696
32701
  }
32697
- function lf(e) {
32702
+ function lf(e, t = 0.1) {
32698
32703
  if (/^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/.test(e)) {
32699
- const n = e.substring(1), r = parseInt(n.substring(0, 2), 16), o = parseInt(n.substring(2, 4), 16), i = parseInt(n.substring(4, 6), 16);
32700
- return `rgba(${r}, ${o}, ${i}, 0.1)`;
32704
+ let r = e.substring(1);
32705
+ r.length === 3 && (r = r.split("").map((s) => s + s).join(""));
32706
+ const o = parseInt(r.substring(0, 2), 16), i = parseInt(r.substring(2, 4), 16), a = parseInt(r.substring(4, 6), 16);
32707
+ return `rgba(${o}, ${i}, ${a}, ${t})`;
32701
32708
  } else if (e.startsWith("rgba")) {
32702
- const [n, r, o, i] = e.substring(5, e.length - 1).split(",");
32703
- return `rgba(${n}, ${r}, ${o}, 0.1)`;
32709
+ const [r, o, i] = e.substring(5, e.length - 1).split(",").map((a) => a.trim()).slice(0, 3);
32710
+ return `rgba(${r}, ${o}, ${i}, ${t})`;
32704
32711
  } else if (e.startsWith("rgb")) {
32705
- const [n, r, o] = e.substring(4, e.length - 1).split(",");
32706
- return `rgba(${n}, ${r}, ${o}, 0.1)`;
32712
+ const [r, o, i] = e.substring(4, e.length - 1).split(",").map((a) => a.trim());
32713
+ return `rgba(${r}, ${o}, ${i}, ${t})`;
32707
32714
  } else
32708
32715
  throw new Error(`Unsupported color format: ${e}`);
32709
32716
  }
@@ -32734,34 +32741,40 @@ const SRe = ({
32734
32741
  barVariant: r,
32735
32742
  lineVariant: o,
32736
32743
  lineTension: i,
32737
- width: a,
32738
- height: s,
32739
- backgroundColor: l,
32740
- className: u = ""
32744
+ opacity: a = 0.1,
32745
+ lineStroke: s,
32746
+ width: l,
32747
+ height: u,
32748
+ backgroundColor: d,
32749
+ className: h = "",
32750
+ colors: C = ["#4e79a7", "#f28e2b", "#e15759", "#76b7b2"]
32741
32751
  }) => {
32742
32752
  e === "line" ? r4e() : e === "bar" ? t4e() : (e === "doughnut" || e === "pie") && n4e();
32743
- const d = J5e({
32753
+ const m = J5e({
32744
32754
  input: t,
32745
32755
  type: e,
32746
32756
  lineVariant: o,
32747
- lineTension: i
32748
- }), h = fl.merge(
32757
+ lineTension: i,
32758
+ opacity: a,
32759
+ lineStroke: s,
32760
+ colors: C
32761
+ }), A = fl.merge(
32749
32762
  { maintainAspectRatio: !1 },
32750
32763
  e4e({ type: e, barVariant: r }),
32751
32764
  n
32752
- ), m = {
32765
+ ), p = {
32753
32766
  line: G5e,
32754
32767
  bar: Y5e,
32755
32768
  doughnut: q5e,
32756
32769
  pie: X5e
32757
32770
  }[e];
32758
32771
  return /* @__PURE__ */ K.jsx(
32759
- m,
32772
+ p,
32760
32773
  {
32761
- data: d,
32762
- options: h,
32763
- style: { width: a, height: s, backgroundColor: l },
32764
- className: `awi-chart ${u}`
32774
+ data: m,
32775
+ options: A,
32776
+ style: { width: l, height: u, backgroundColor: d },
32777
+ className: `awi-chart ${h}`
32765
32778
  }
32766
32779
  );
32767
32780
  }, D6 = (e, t) => {