@apexcura/ui-components 0.0.14-Beta195 → 0.0.14-Beta197

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.css CHANGED
@@ -341,9 +341,6 @@ video {
341
341
  .m-\[10px\] {
342
342
  margin: 10px;
343
343
  }
344
- .mr-3 {
345
- margin-right: 0.75rem;
346
- }
347
344
  .flex {
348
345
  display: flex;
349
346
  }
@@ -353,20 +350,6 @@ video {
353
350
  .grid {
354
351
  display: grid;
355
352
  }
356
- .h-5 {
357
- height: 1.25rem;
358
- }
359
- .w-5 {
360
- width: 1.25rem;
361
- }
362
- @keyframes spin {
363
- to {
364
- transform: rotate(360deg);
365
- }
366
- }
367
- .animate-spin {
368
- animation: spin 1s linear infinite;
369
- }
370
353
  .rounded-\[8px\] {
371
354
  border-radius: 8px;
372
355
  }
@@ -424,6 +407,9 @@ video {
424
407
  .filter {
425
408
  filter: var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow);
426
409
  }
410
+ .bg-sky-700 .icon-active {
411
+ filter: brightness(0) invert(1);
412
+ }
427
413
  .submit:where(.css-dev-only-do-not-override-1r287do).ant-btn-default:not(:disabled):not(.ant-btn-disabled):hover {
428
414
  color: #472D7A;
429
415
  background-color: white;
package/dist/index.js CHANGED
@@ -384,85 +384,17 @@ var MultipleSelectElement = (props) => {
384
384
  // src/Components/Button.tsx
385
385
  var import_react11 = __toESM(require("react"));
386
386
  var ButtonElement = (props) => {
387
- const [svgContent, setSvgContent] = (0, import_react11.useState)(null);
388
- const [originalSvgContent, setOriginalSvgContent] = (0, import_react11.useState)(
389
- null
390
- );
391
- const [hoverColor, setHoverColor] = (0, import_react11.useState)(null);
392
- const [loading, setLoading] = (0, import_react11.useState)(false);
393
- (0, import_react11.useEffect)(() => {
394
- if (props.icon) {
395
- setLoading(true);
396
- fetch(props.icon).then((response) => response.text()).then((data) => {
397
- const tempDiv = document.createElement("div");
398
- tempDiv.innerHTML = data;
399
- const svgElement = tempDiv.querySelector("svg");
400
- if (svgElement) {
401
- const textColorClass = props.className?.match(/text-[\w-]+/g)?.[0];
402
- const hoverColorClass = props.className?.match(/hover:text-[\w-]+/g)?.[0];
403
- if (textColorClass) {
404
- const tempSpan = document.createElement("span");
405
- tempSpan.className = textColorClass;
406
- document.body.appendChild(tempSpan);
407
- const computedColor = getComputedStyle(tempSpan).color;
408
- document.body.removeChild(tempSpan);
409
- const paths = svgElement.querySelectorAll("path");
410
- paths.forEach((path) => path.setAttribute("fill", computedColor));
411
- }
412
- if (hoverColorClass) {
413
- const tempSpan = document.createElement("span");
414
- tempSpan.className = hoverColorClass.replace("hover:", "");
415
- document.body.appendChild(tempSpan);
416
- const computedHoverColor = getComputedStyle(tempSpan).color;
417
- document.body.removeChild(tempSpan);
418
- setHoverColor(computedHoverColor);
419
- }
420
- svgElement.setAttribute(
421
- "class",
422
- `${props.iconsClassName ? props.iconsClassName : ""}`
423
- );
424
- setSvgContent(tempDiv.innerHTML);
425
- setOriginalSvgContent(tempDiv.innerHTML);
426
- }
427
- }).catch((error) => console.error("Error fetching SVG:", error));
428
- }
429
- setLoading(false);
430
- }, []);
431
- const handleMouseEnter = () => {
432
- if (hoverColor && originalSvgContent) {
433
- const tempDiv = document.createElement("div");
434
- tempDiv.innerHTML = originalSvgContent;
435
- const svgElement = tempDiv.querySelector("svg");
436
- const paths = svgElement?.querySelectorAll("path");
437
- paths?.forEach((path) => path.setAttribute("fill", hoverColor));
438
- setSvgContent(tempDiv.innerHTML);
439
- }
440
- };
441
- const handleMouseLeave = () => {
442
- if (originalSvgContent) {
443
- setSvgContent(originalSvgContent);
444
- }
445
- };
446
387
  return /* @__PURE__ */ import_react11.default.createElement(
447
388
  "button",
448
389
  {
449
390
  onClick: props.onClick,
450
391
  className: `${props.className ? props.className : ""}`,
451
- onMouseEnter: handleMouseEnter,
452
- onMouseLeave: handleMouseLeave,
453
392
  disabled: props.loading,
454
393
  style: {
455
394
  cursor: props.loading ? "no-drop" : "pointer"
456
395
  }
457
396
  },
458
- props.isLoading ? /* @__PURE__ */ import_react11.default.createElement(import_react11.default.Fragment, null, /* @__PURE__ */ import_react11.default.createElement("svg", { className: "animate-spin h-5 w-5 mr-3", viewBox: "0 0 24 24" }), props.label) : /* @__PURE__ */ import_react11.default.createElement(import_react11.default.Fragment, null, props.isSVGStylesOverride === false && loading ? props.icon && /* @__PURE__ */ import_react11.default.createElement(
459
- "img",
460
- {
461
- className: props.iconsClassName,
462
- src: props.icon,
463
- alt: props.label
464
- }
465
- ) : svgContent && /* @__PURE__ */ import_react11.default.createElement("span", { className: props.iconsClassName, dangerouslySetInnerHTML: { __html: svgContent } }), props.label)
397
+ /* @__PURE__ */ import_react11.default.createElement(import_react11.default.Fragment, null, /* @__PURE__ */ import_react11.default.createElement("span", { className: props.iconsClassName }, /* @__PURE__ */ import_react11.default.createElement("img", { src: props.icon, className: "icon-active" })), props.label)
466
398
  );
467
399
  };
468
400
 
package/dist/index.mjs CHANGED
@@ -316,97 +316,29 @@ var MultipleSelectElement = (props) => {
316
316
  };
317
317
 
318
318
  // src/Components/Button.tsx
319
- import React11, { useEffect, useState as useState4 } from "react";
319
+ import React11 from "react";
320
320
  var ButtonElement = (props) => {
321
- const [svgContent, setSvgContent] = useState4(null);
322
- const [originalSvgContent, setOriginalSvgContent] = useState4(
323
- null
324
- );
325
- const [hoverColor, setHoverColor] = useState4(null);
326
- const [loading, setLoading] = useState4(false);
327
- useEffect(() => {
328
- if (props.icon) {
329
- setLoading(true);
330
- fetch(props.icon).then((response) => response.text()).then((data) => {
331
- const tempDiv = document.createElement("div");
332
- tempDiv.innerHTML = data;
333
- const svgElement = tempDiv.querySelector("svg");
334
- if (svgElement) {
335
- const textColorClass = props.className?.match(/text-[\w-]+/g)?.[0];
336
- const hoverColorClass = props.className?.match(/hover:text-[\w-]+/g)?.[0];
337
- if (textColorClass) {
338
- const tempSpan = document.createElement("span");
339
- tempSpan.className = textColorClass;
340
- document.body.appendChild(tempSpan);
341
- const computedColor = getComputedStyle(tempSpan).color;
342
- document.body.removeChild(tempSpan);
343
- const paths = svgElement.querySelectorAll("path");
344
- paths.forEach((path) => path.setAttribute("fill", computedColor));
345
- }
346
- if (hoverColorClass) {
347
- const tempSpan = document.createElement("span");
348
- tempSpan.className = hoverColorClass.replace("hover:", "");
349
- document.body.appendChild(tempSpan);
350
- const computedHoverColor = getComputedStyle(tempSpan).color;
351
- document.body.removeChild(tempSpan);
352
- setHoverColor(computedHoverColor);
353
- }
354
- svgElement.setAttribute(
355
- "class",
356
- `${props.iconsClassName ? props.iconsClassName : ""}`
357
- );
358
- setSvgContent(tempDiv.innerHTML);
359
- setOriginalSvgContent(tempDiv.innerHTML);
360
- }
361
- }).catch((error) => console.error("Error fetching SVG:", error));
362
- }
363
- setLoading(false);
364
- }, []);
365
- const handleMouseEnter = () => {
366
- if (hoverColor && originalSvgContent) {
367
- const tempDiv = document.createElement("div");
368
- tempDiv.innerHTML = originalSvgContent;
369
- const svgElement = tempDiv.querySelector("svg");
370
- const paths = svgElement?.querySelectorAll("path");
371
- paths?.forEach((path) => path.setAttribute("fill", hoverColor));
372
- setSvgContent(tempDiv.innerHTML);
373
- }
374
- };
375
- const handleMouseLeave = () => {
376
- if (originalSvgContent) {
377
- setSvgContent(originalSvgContent);
378
- }
379
- };
380
321
  return /* @__PURE__ */ React11.createElement(
381
322
  "button",
382
323
  {
383
324
  onClick: props.onClick,
384
325
  className: `${props.className ? props.className : ""}`,
385
- onMouseEnter: handleMouseEnter,
386
- onMouseLeave: handleMouseLeave,
387
326
  disabled: props.loading,
388
327
  style: {
389
328
  cursor: props.loading ? "no-drop" : "pointer"
390
329
  }
391
330
  },
392
- props.isLoading ? /* @__PURE__ */ React11.createElement(React11.Fragment, null, /* @__PURE__ */ React11.createElement("svg", { className: "animate-spin h-5 w-5 mr-3", viewBox: "0 0 24 24" }), props.label) : /* @__PURE__ */ React11.createElement(React11.Fragment, null, props.isSVGStylesOverride === false && loading ? props.icon && /* @__PURE__ */ React11.createElement(
393
- "img",
394
- {
395
- className: props.iconsClassName,
396
- src: props.icon,
397
- alt: props.label
398
- }
399
- ) : svgContent && /* @__PURE__ */ React11.createElement("span", { className: props.iconsClassName, dangerouslySetInnerHTML: { __html: svgContent } }), props.label)
331
+ /* @__PURE__ */ React11.createElement(React11.Fragment, null, /* @__PURE__ */ React11.createElement("span", { className: props.iconsClassName }, /* @__PURE__ */ React11.createElement("img", { src: props.icon, className: "icon-active" })), props.label)
400
332
  );
401
333
  };
402
334
 
403
335
  // src/Components/AddMoreTable.tsx
404
- import React12, { useEffect as useEffect2, useState as useState5 } from "react";
336
+ import React12, { useEffect, useState as useState4 } from "react";
405
337
  import { Table, Button } from "antd";
406
338
  import { PlusOutlined, DeleteOutlined } from "@ant-design/icons";
407
339
  var AddMoreTable = (props) => {
408
340
  const { thead, tbody } = props;
409
- const [rows, setRows] = useState5(tbody || []);
341
+ const [rows, setRows] = useState4(tbody || []);
410
342
  const onHandleRows = () => {
411
343
  const newId = rows.length > 0 ? rows[rows.length - 1].id + 1 : 1;
412
344
  let newRow = {
@@ -471,7 +403,7 @@ var AddMoreTable = (props) => {
471
403
  });
472
404
  });
473
405
  };
474
- useEffect2(() => {
406
+ useEffect(() => {
475
407
  console.log(rows);
476
408
  }, [rows]);
477
409
  const renderInputElement = (element, value) => {
@@ -615,7 +547,7 @@ var Navbar = (props) => {
615
547
  };
616
548
 
617
549
  // src/Components/TableElement.tsx
618
- import React20, { useState as useState6, useEffect as useEffect3 } from "react";
550
+ import React20, { useState as useState5, useEffect as useEffect2 } from "react";
619
551
  import { Table as Table2 } from "antd";
620
552
 
621
553
  // src/Components/Model.tsx
@@ -717,10 +649,10 @@ var ModelElement = (props) => {
717
649
  import { EyeOutlined } from "@ant-design/icons";
718
650
  var TableElement = (props) => {
719
651
  const { thead, tbody } = props;
720
- const [selectedRecord, setSelectedRecord] = useState6({});
721
- const [model, setModel] = useState6(false);
722
- const [dataSource, setDataSource] = useState6([]);
723
- useEffect3(() => {
652
+ const [selectedRecord, setSelectedRecord] = useState5({});
653
+ const [model, setModel] = useState5(false);
654
+ const [dataSource, setDataSource] = useState5([]);
655
+ useEffect2(() => {
724
656
  if (tbody) {
725
657
  setDataSource(
726
658
  tbody.map((row, index) => ({
@@ -854,14 +786,14 @@ var TableElement = (props) => {
854
786
  };
855
787
 
856
788
  // src/Components/DatePicker.tsx
857
- import React21, { useState as useState7 } from "react";
789
+ import React21, { useState as useState6 } from "react";
858
790
  import { DatePicker } from "antd";
859
791
  import dayjs from "dayjs";
860
792
  import customParseFormat from "dayjs/plugin/customParseFormat.js";
861
793
  import moment2 from "moment";
862
794
  dayjs.extend(customParseFormat);
863
795
  var DatePickerElement = (props) => {
864
- const [dateState, setDateState] = useState7("");
796
+ const [dateState, setDateState] = useState6("");
865
797
  const handleChange = (date, dateString) => {
866
798
  if (date) {
867
799
  const formattedDate = dateString;
@@ -945,10 +877,10 @@ var SingleCheckbox = (props) => {
945
877
  };
946
878
 
947
879
  // src/Components/DropDownGroup.tsx
948
- import React25, { useState as useState8 } from "react";
880
+ import React25, { useState as useState7 } from "react";
949
881
  import { Select as Select4 } from "antd";
950
882
  var DropDownGroup = (props) => {
951
- const [selectedValue, setSelectedValue] = useState8({
883
+ const [selectedValue, setSelectedValue] = useState7({
952
884
  firstValue: {},
953
885
  secondValue: {},
954
886
  temp: ""
@@ -1000,12 +932,12 @@ var DropDownGroup = (props) => {
1000
932
  };
1001
933
 
1002
934
  // src/Components/FilesUpload.tsx
1003
- import React26, { useState as useState9 } from "react";
935
+ import React26, { useState as useState8 } from "react";
1004
936
  import { Upload } from "antd";
1005
937
  import { InboxOutlined } from "@ant-design/icons";
1006
938
  var FileUpload = (props) => {
1007
939
  const { Dragger } = Upload;
1008
- const [files, setFiles] = useState9([]);
940
+ const [files, setFiles] = useState8([]);
1009
941
  const handleChange = ({ fileList }) => {
1010
942
  setFiles(fileList);
1011
943
  if (props.onChange) {
@@ -1059,9 +991,9 @@ var onChange = (checked) => {
1059
991
  var SwitchElement = () => /* @__PURE__ */ React28.createElement(Switch, { defaultChecked: true, onChange });
1060
992
 
1061
993
  // src/Components/Upload.tsx
1062
- import React29, { useState as useState10 } from "react";
994
+ import React29, { useState as useState9 } from "react";
1063
995
  var Upload2 = (props) => {
1064
- const [file, setFile] = useState10();
996
+ const [file, setFile] = useState9();
1065
997
  const handleFileChange = (e) => {
1066
998
  setFile(e.target.files[0]);
1067
999
  if (props.onChange) {
@@ -1087,11 +1019,11 @@ var Upload2 = (props) => {
1087
1019
  };
1088
1020
 
1089
1021
  // src/Components/OtpElement.tsx
1090
- import React30, { useState as useState11, useRef, useEffect as useEffect4 } from "react";
1022
+ import React30, { useState as useState10, useRef, useEffect as useEffect3 } from "react";
1091
1023
  import { Input as Input3 } from "antd";
1092
1024
  var OtpElement = (props) => {
1093
1025
  const length = props.length;
1094
- const [otp, setOtp] = useState11(Array(length).fill(""));
1026
+ const [otp, setOtp] = useState10(Array(length).fill(""));
1095
1027
  const inputRefs = useRef([]);
1096
1028
  const handleChange = (e, index) => {
1097
1029
  const value = e.target.value;
@@ -1124,7 +1056,7 @@ var OtpElement = (props) => {
1124
1056
  });
1125
1057
  }
1126
1058
  };
1127
- useEffect4(() => {
1059
+ useEffect3(() => {
1128
1060
  inputRefs.current[0]?.focus();
1129
1061
  }, []);
1130
1062
  return /* @__PURE__ */ React30.createElement("div", { className: props.containerClassName }, Array.from({ length }).map((_, index) => /* @__PURE__ */ React30.createElement(
@@ -1376,7 +1308,7 @@ var HorizontalBarChart = (props) => {
1376
1308
  };
1377
1309
 
1378
1310
  // src/Components/LineChart.tsx
1379
- import React34, { useEffect as useEffect5, useRef as useRef2 } from "react";
1311
+ import React34, { useEffect as useEffect4, useRef as useRef2 } from "react";
1380
1312
  import Chart from "chart.js/auto";
1381
1313
  var LineChart = (props) => {
1382
1314
  const chartRef = useRef2(null);
@@ -1387,7 +1319,7 @@ var LineChart = (props) => {
1387
1319
  { label: "Conversion Rate", data: [50, 100, 150, 180, 50] }
1388
1320
  ];
1389
1321
  const labels = ["Instagram", "Whatsapp", "Messages", "Telegram", "Linkedin"];
1390
- useEffect5(() => {
1322
+ useEffect4(() => {
1391
1323
  if (chartRef.current) {
1392
1324
  if (chartInstance.current) {
1393
1325
  chartInstance.current.destroy();
@@ -1449,12 +1381,12 @@ var LineChart = (props) => {
1449
1381
  };
1450
1382
 
1451
1383
  // src/Components/DoubleBarChart.tsx
1452
- import React35, { useEffect as useEffect6, useRef as useRef3 } from "react";
1384
+ import React35, { useEffect as useEffect5, useRef as useRef3 } from "react";
1453
1385
  import Chart2 from "chart.js/auto";
1454
1386
  var DoubleBarChart = (props) => {
1455
1387
  const chartRef = useRef3(null);
1456
1388
  const chartInstance = useRef3(null);
1457
- useEffect6(() => {
1389
+ useEffect5(() => {
1458
1390
  if (chartRef.current) {
1459
1391
  if (chartInstance.current) {
1460
1392
  chartInstance.current.destroy();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@apexcura/ui-components",
3
- "version": "0.0.14-Beta195",
3
+ "version": "0.0.14-Beta197",
4
4
  "description": "Apex cura React components library",
5
5
  "keywords": [
6
6
  "apex cura",