@apexcura/ui-components 0.0.14-Beta136 → 0.0.14-Beta137

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.d.mts CHANGED
@@ -132,6 +132,6 @@ declare const LineChart: (props: ElementType) => React$1.JSX.Element;
132
132
 
133
133
  declare const DoubleBarChart: (props: ElementType) => React$1.JSX.Element;
134
134
 
135
- declare const BarChart: React$1.FC;
135
+ declare const BarChart: (props: ElementType) => React$1.JSX.Element;
136
136
 
137
137
  export { AddMoreTable, BarChart, ButtonElement, CheckboxElement, CircleDonut, CkEditor, DatePickerElement, DateRangePickerElement, DoubleBarChart, DropDownGroup, FileUpload, HorizontalBarChart, Image, LineChart, MultipleSelectElement, Navbar, NumberElement, OtpElement, PasswordElement, RadioElement, SelectElement, SemiCircleDonut, Sidebar, SingleCheckbox, SingleSelectElement, SwitchElement, TableElement, TabsElement, TextElement, TextareaElement, Upload };
package/dist/index.d.ts CHANGED
@@ -132,6 +132,6 @@ declare const LineChart: (props: ElementType) => React$1.JSX.Element;
132
132
 
133
133
  declare const DoubleBarChart: (props: ElementType) => React$1.JSX.Element;
134
134
 
135
- declare const BarChart: React$1.FC;
135
+ declare const BarChart: (props: ElementType) => React$1.JSX.Element;
136
136
 
137
137
  export { AddMoreTable, BarChart, ButtonElement, CheckboxElement, CircleDonut, CkEditor, DatePickerElement, DateRangePickerElement, DoubleBarChart, DropDownGroup, FileUpload, HorizontalBarChart, Image, LineChart, MultipleSelectElement, Navbar, NumberElement, OtpElement, PasswordElement, RadioElement, SelectElement, SemiCircleDonut, Sidebar, SingleCheckbox, SingleSelectElement, SwitchElement, TableElement, TabsElement, TextElement, TextareaElement, Upload };
package/dist/index.js CHANGED
@@ -1323,8 +1323,8 @@ var LineChart = (props) => {
1323
1323
  const chartInstance = (0, import_react34.useRef)(null);
1324
1324
  const data = [
1325
1325
  { label: "ROI", data: [10, 13, 20, 15, 10] },
1326
- { label: "Engagement Rate", data: [12, 15, 26, 28, 12] },
1327
- { label: "Conversion Rate", data: [30, 50, 70, 90, 30] }
1326
+ { label: "Engagement Rate", data: [20, 23, 30, 28, 20] },
1327
+ { label: "Conversion Rate", data: [50, 100, 150, 180, 50] }
1328
1328
  ];
1329
1329
  const labels = ["Instagram", "Whatsapp", "Messages", "Telegram", "Linkedin"];
1330
1330
  (0, import_react34.useEffect)(() => {
@@ -1468,59 +1468,62 @@ var DoubleBarChart = (props) => {
1468
1468
 
1469
1469
  // src/Components/BarChart.tsx
1470
1470
  var import_react36 = __toESM(require("react"));
1471
- var import_auto3 = __toESM(require("chart.js/auto"));
1472
- var BarChart = () => {
1473
- const chartRef = (0, import_react36.useRef)(null);
1474
- const chartInstance = (0, import_react36.useRef)(null);
1475
- (0, import_react36.useEffect)(() => {
1476
- if (chartRef.current) {
1477
- if (chartInstance.current) {
1478
- chartInstance.current.destroy();
1471
+ var import_react_chartjs_24 = require("react-chartjs-2");
1472
+ var import_chart4 = require("chart.js");
1473
+ import_chart4.Chart.register(import_chart4.BarElement, import_chart4.CategoryScale, import_chart4.LinearScale, import_chart4.Tooltip);
1474
+ var BarChart = (props) => {
1475
+ const data = {
1476
+ labels: [
1477
+ "17 June",
1478
+ "18 June",
1479
+ "19 June",
1480
+ "20 June",
1481
+ "21 June",
1482
+ "22 June",
1483
+ "23 June"
1484
+ ],
1485
+ datasets: [
1486
+ {
1487
+ data: [30, 10, 27, 40, 12, 24],
1488
+ backgroundColor: "#6298D5",
1489
+ barThickness: 15
1479
1490
  }
1480
- chartInstance.current = new import_auto3.default(chartRef.current, {
1481
- type: "bar",
1482
- data: {
1483
- labels: [
1484
- "17 June",
1485
- "18 June",
1486
- "19 June",
1487
- "20 June",
1488
- "21 June",
1489
- "22 June",
1490
- "23 June"
1491
- ],
1492
- datasets: [
1493
- {
1494
- data: [70, 65, 75, 55, 85, 20, 55],
1495
- // Example data for female
1496
- backgroundColor: "rgba(255, 99, 132, 0.5)",
1497
- borderColor: "rgba(255, 99, 132, 1)",
1498
- borderWidth: 1
1499
- }
1500
- ]
1501
- },
1502
- options: {
1503
- scales: {
1504
- y: {
1505
- beginAtZero: true,
1506
- suggestedMax: 100,
1507
- ticks: {
1508
- callback: function(value) {
1509
- return value + "%";
1510
- }
1511
- }
1512
- }
1491
+ ]
1492
+ };
1493
+ const options = {
1494
+ responsive: true,
1495
+ scales: {
1496
+ x: {
1497
+ beginAtZero: true,
1498
+ ticks: {
1499
+ callback: function(value) {
1500
+ return `${value}%`;
1513
1501
  }
1514
1502
  }
1515
- });
1516
- }
1517
- return () => {
1518
- if (chartInstance.current) {
1519
- chartInstance.current.destroy();
1503
+ },
1504
+ y: {
1505
+ grid: {
1506
+ display: false
1507
+ }
1520
1508
  }
1521
- };
1522
- }, []);
1523
- return /* @__PURE__ */ import_react36.default.createElement("canvas", { ref: chartRef });
1509
+ },
1510
+ plugins: {
1511
+ tooltip: {
1512
+ enabled: true,
1513
+ callbacks: {
1514
+ label: function(context) {
1515
+ const label = context.label || "";
1516
+ const value = context.raw || 0;
1517
+ return `${label}: ${value}`;
1518
+ }
1519
+ }
1520
+ },
1521
+ legend: {
1522
+ display: false
1523
+ }
1524
+ }
1525
+ };
1526
+ return /* @__PURE__ */ import_react36.default.createElement("div", { className: props.className }, /* @__PURE__ */ import_react36.default.createElement("h1", { className: props.labelClassName }, props.label), /* @__PURE__ */ import_react36.default.createElement(import_react_chartjs_24.Bar, { data, options }));
1524
1527
  };
1525
1528
  // Annotate the CommonJS export names for ESM import in node:
1526
1529
  0 && (module.exports = {
package/dist/index.mjs CHANGED
@@ -1275,8 +1275,8 @@ var LineChart = (props) => {
1275
1275
  const chartInstance = useRef2(null);
1276
1276
  const data = [
1277
1277
  { label: "ROI", data: [10, 13, 20, 15, 10] },
1278
- { label: "Engagement Rate", data: [12, 15, 26, 28, 12] },
1279
- { label: "Conversion Rate", data: [30, 50, 70, 90, 30] }
1278
+ { label: "Engagement Rate", data: [20, 23, 30, 28, 20] },
1279
+ { label: "Conversion Rate", data: [50, 100, 150, 180, 50] }
1280
1280
  ];
1281
1281
  const labels = ["Instagram", "Whatsapp", "Messages", "Telegram", "Linkedin"];
1282
1282
  useEffect4(() => {
@@ -1419,60 +1419,69 @@ var DoubleBarChart = (props) => {
1419
1419
  };
1420
1420
 
1421
1421
  // src/Components/BarChart.tsx
1422
- import React36, { useEffect as useEffect6, useRef as useRef4 } from "react";
1423
- import Chart3 from "chart.js/auto";
1424
- var BarChart = () => {
1425
- const chartRef = useRef4(null);
1426
- const chartInstance = useRef4(null);
1427
- useEffect6(() => {
1428
- if (chartRef.current) {
1429
- if (chartInstance.current) {
1430
- chartInstance.current.destroy();
1422
+ import React36 from "react";
1423
+ import { Bar as Bar2 } from "react-chartjs-2";
1424
+ import {
1425
+ Chart as ChartJS4,
1426
+ BarElement as BarElement2,
1427
+ CategoryScale as CategoryScale2,
1428
+ LinearScale as LinearScale2,
1429
+ Tooltip as Tooltip4
1430
+ } from "chart.js";
1431
+ ChartJS4.register(BarElement2, CategoryScale2, LinearScale2, Tooltip4);
1432
+ var BarChart = (props) => {
1433
+ const data = {
1434
+ labels: [
1435
+ "17 June",
1436
+ "18 June",
1437
+ "19 June",
1438
+ "20 June",
1439
+ "21 June",
1440
+ "22 June",
1441
+ "23 June"
1442
+ ],
1443
+ datasets: [
1444
+ {
1445
+ data: [30, 10, 27, 40, 12, 24],
1446
+ backgroundColor: "#6298D5",
1447
+ barThickness: 15
1431
1448
  }
1432
- chartInstance.current = new Chart3(chartRef.current, {
1433
- type: "bar",
1434
- data: {
1435
- labels: [
1436
- "17 June",
1437
- "18 June",
1438
- "19 June",
1439
- "20 June",
1440
- "21 June",
1441
- "22 June",
1442
- "23 June"
1443
- ],
1444
- datasets: [
1445
- {
1446
- data: [70, 65, 75, 55, 85, 20, 55],
1447
- // Example data for female
1448
- backgroundColor: "rgba(255, 99, 132, 0.5)",
1449
- borderColor: "rgba(255, 99, 132, 1)",
1450
- borderWidth: 1
1451
- }
1452
- ]
1453
- },
1454
- options: {
1455
- scales: {
1456
- y: {
1457
- beginAtZero: true,
1458
- suggestedMax: 100,
1459
- ticks: {
1460
- callback: function(value) {
1461
- return value + "%";
1462
- }
1463
- }
1464
- }
1449
+ ]
1450
+ };
1451
+ const options = {
1452
+ responsive: true,
1453
+ scales: {
1454
+ x: {
1455
+ beginAtZero: true,
1456
+ ticks: {
1457
+ callback: function(value) {
1458
+ return `${value}%`;
1465
1459
  }
1466
1460
  }
1467
- });
1468
- }
1469
- return () => {
1470
- if (chartInstance.current) {
1471
- chartInstance.current.destroy();
1461
+ },
1462
+ y: {
1463
+ grid: {
1464
+ display: false
1465
+ }
1472
1466
  }
1473
- };
1474
- }, []);
1475
- return /* @__PURE__ */ React36.createElement("canvas", { ref: chartRef });
1467
+ },
1468
+ plugins: {
1469
+ tooltip: {
1470
+ enabled: true,
1471
+ callbacks: {
1472
+ label: function(context) {
1473
+ const label = context.label || "";
1474
+ const value = context.raw || 0;
1475
+ return `${label}: ${value}`;
1476
+ }
1477
+ }
1478
+ },
1479
+ legend: {
1480
+ display: false
1481
+ }
1482
+ }
1483
+ };
1484
+ return /* @__PURE__ */ React36.createElement("div", { className: props.className }, /* @__PURE__ */ React36.createElement("h1", { className: props.labelClassName }, props.label), /* @__PURE__ */ React36.createElement(Bar2, { data, options }));
1476
1485
  };
1477
1486
  export {
1478
1487
  AddMoreTable,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@apexcura/ui-components",
3
- "version": "0.0.14-Beta136",
3
+ "version": "0.0.14-Beta137",
4
4
  "description": "Apex cura React components library",
5
5
  "keywords": [
6
6
  "apex cura",