@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/README.md +34 -34
- package/bin/cli.js +87 -87
- package/dist/assets/index.css +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +3 -0
- package/dist/index.js +50 -37
- package/dist/index.umd.js +2 -2
- package/package.json +102 -102
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
|
|
32604
|
+
const s = a, l = t === "doughnut" || t === "pie";
|
|
32602
32605
|
return {
|
|
32603
32606
|
labels: e.labels,
|
|
32604
32607
|
datasets: e.datasets.map(
|
|
32605
|
-
(
|
|
32606
|
-
var
|
|
32607
|
-
return
|
|
32608
|
-
label:
|
|
32609
|
-
data:
|
|
32610
|
-
backgroundColor:
|
|
32611
|
-
(
|
|
32612
|
-
|
|
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:
|
|
32616
|
-
(
|
|
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:
|
|
32621
|
-
data:
|
|
32624
|
+
label: u.label,
|
|
32625
|
+
data: u.data,
|
|
32622
32626
|
backgroundColor: lf(
|
|
32623
|
-
|
|
32627
|
+
u.color || s[d % s.length],
|
|
32628
|
+
o
|
|
32624
32629
|
),
|
|
32625
|
-
borderColor:
|
|
32626
|
-
borderWidth: t === "line" ?
|
|
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
|
-
|
|
32700
|
-
|
|
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 [
|
|
32703
|
-
return `rgba(${
|
|
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 [
|
|
32706
|
-
return `rgba(${
|
|
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
|
-
|
|
32738
|
-
|
|
32739
|
-
|
|
32740
|
-
|
|
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
|
|
32753
|
+
const m = J5e({
|
|
32744
32754
|
input: t,
|
|
32745
32755
|
type: e,
|
|
32746
32756
|
lineVariant: o,
|
|
32747
|
-
lineTension: i
|
|
32748
|
-
|
|
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
|
-
),
|
|
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
|
-
|
|
32772
|
+
p,
|
|
32760
32773
|
{
|
|
32761
|
-
data:
|
|
32762
|
-
options:
|
|
32763
|
-
style: { width:
|
|
32764
|
-
className: `awi-chart ${
|
|
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) => {
|