@sentio/ui-core 0.1.2 → 0.1.4

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.mjs CHANGED
@@ -7,9 +7,8 @@ function _BarLoading({
7
7
  hint = "Loading Sentio",
8
8
  loading = true,
9
9
  className,
10
- iconClassName,
11
10
  width = 150,
12
- gray
11
+ logo
13
12
  }) {
14
13
  if (loading) {
15
14
  return /* @__PURE__ */ jsxs(
@@ -20,6 +19,7 @@ function _BarLoading({
20
19
  className
21
20
  ),
22
21
  children: [
22
+ logo,
23
23
  hint && /* @__PURE__ */ jsx("div", { className: "loading-text text-icontent text-gray my-2 text-center font-medium", children: hint }),
24
24
  /* @__PURE__ */ jsx("div", { className: "flex justify-center pt-1", children: /* @__PURE__ */ jsx(
25
25
  BarLoader,
@@ -42,42 +42,45 @@ function _BarLoading({
42
42
  var BarLoading = memo(_BarLoading);
43
43
 
44
44
  // src/common/SpinLoading.tsx
45
+ import React from "react";
45
46
  import { ClipLoader } from "react-spinners";
46
47
  import { cx as classNames2 } from "class-variance-authority";
47
48
  import { jsx as jsx2, jsxs as jsxs2 } from "react/jsx-runtime";
48
- var SpinLoading = function Spinner(args) {
49
- const {
50
- loading = false,
51
- children,
52
- className,
53
- size = 48,
54
- showMask,
55
- maskOpacity = 80
56
- } = args;
57
- return /* @__PURE__ */ jsxs2("div", { className: classNames2("relative", className), children: [
58
- showMask && loading && /* @__PURE__ */ jsx2(
59
- "div",
60
- {
61
- className: classNames2(
62
- "absolute bottom-0 left-0 right-0 top-0 z-[1]",
63
- maskOpacity ? `bg-white dark:bg-sentio-gray-100/${maskOpacity}` : "dark:bg-sentio-gray-100 bg-white"
64
- )
65
- }
66
- ),
67
- /* @__PURE__ */ jsx2("div", { className: "absolute left-[50%] top-[50%] z-[1] -translate-y-6", children: /* @__PURE__ */ jsx2(
68
- ClipLoader,
69
- {
70
- loading,
71
- color: "#3B82F6",
72
- size,
73
- cssOverride: {
74
- borderWidth: 3
49
+ var SpinLoading = React.forwardRef(
50
+ function Spinner(args, ref) {
51
+ const {
52
+ loading = false,
53
+ children,
54
+ className,
55
+ size = 48,
56
+ showMask,
57
+ maskOpacity = 80
58
+ } = args;
59
+ return /* @__PURE__ */ jsxs2("div", { ref, className: classNames2("relative", className), children: [
60
+ showMask && loading && /* @__PURE__ */ jsx2(
61
+ "div",
62
+ {
63
+ className: classNames2(
64
+ "absolute bottom-0 left-0 right-0 top-0 z-[1]",
65
+ maskOpacity ? `bg-white dark:bg-sentio-gray-100/${maskOpacity}` : "dark:bg-sentio-gray-100 bg-white"
66
+ )
75
67
  }
76
- }
77
- ) }),
78
- children
79
- ] });
80
- };
68
+ ),
69
+ /* @__PURE__ */ jsx2("div", { className: "absolute left-[50%] top-[50%] z-[1] -translate-y-6", children: /* @__PURE__ */ jsx2(
70
+ ClipLoader,
71
+ {
72
+ loading,
73
+ color: "#3B82F6",
74
+ size,
75
+ cssOverride: {
76
+ borderWidth: 3
77
+ }
78
+ }
79
+ ) }),
80
+ children
81
+ ] });
82
+ }
83
+ );
81
84
 
82
85
  // src/common/CopyButton.tsx
83
86
  import {
@@ -272,7 +275,7 @@ var CopyButton = ({
272
275
  import { cloneElement, forwardRef, useMemo } from "react";
273
276
 
274
277
  // src/common/DivTooltip.tsx
275
- import React, { useRef as useRef2, useState as useState2, useEffect as useEffect2 } from "react";
278
+ import React2, { useRef as useRef2, useState as useState2, useEffect as useEffect2 } from "react";
276
279
  import {
277
280
  useFloating,
278
281
  useHover,
@@ -372,7 +375,7 @@ var PopoverTooltip = ({
372
375
  icon,
373
376
  children
374
377
  ] });
375
- const Portal = usePortal ? FloatingPortal : React.Fragment;
378
+ const Portal = usePortal ? FloatingPortal : React2.Fragment;
376
379
  return /* @__PURE__ */ jsxs4("div", { className: classNames4("relative flex items-center", className), children: [
377
380
  /* @__PURE__ */ jsxs4(
378
381
  "div",
@@ -405,7 +408,7 @@ var PopoverTooltip = ({
405
408
  !hideArrow && placement === "bottom" && /* @__PURE__ */ jsx4(
406
409
  "div",
407
410
  {
408
- className: "arrow dark:before:bg-sentio-gray-200 -translate-y-[5px] before:absolute before:h-2 before:w-2 before:rotate-45 before:border-l before:border-t before:border-black/5 before:bg-white dark:before:border-gray-100",
411
+ className: "arrow dark:bg-sentio-gray-100 before:border-border-color -translate-y-[7px] bg-white before:visible before:border before:border-b-0 before:border-r-0",
409
412
  ref: arrowRef,
410
413
  style: {
411
414
  left: arrowX ?? 0,
@@ -544,18 +547,22 @@ function Proccessing({ className, light }) {
544
547
  /* @__PURE__ */ jsx5(
545
548
  "circle",
546
549
  {
547
- className: light ? "opacity-5" : "opacity-10",
548
550
  cx: "12",
549
551
  cy: "12",
550
552
  r: "10",
551
553
  stroke: "currentColor",
552
- strokeWidth: "4"
554
+ strokeWidth: "4",
555
+ style: {
556
+ opacity: light ? 0.05 : 0.1
557
+ }
553
558
  }
554
559
  ),
555
560
  /* @__PURE__ */ jsx5(
556
561
  "path",
557
562
  {
558
- className: light ? "opacity-50" : "opacity-75",
563
+ style: {
564
+ opacity: light ? 0.5 : 0.75
565
+ },
559
566
  fill: "currentColor",
560
567
  d: "M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"
561
568
  }
@@ -2045,7 +2052,7 @@ if (DOMPurify?.addHook) {
2045
2052
  });
2046
2053
  }
2047
2054
  var renderTextWithColoredNumbers = (text) => {
2048
- const numberRegex = /\b(\d+(?:\.\d+)?)\b/g;
2055
+ const numberRegex = /\b(\d+(?:\.\d+)?(?:[eE][+-]?\d+)?)\b/g;
2049
2056
  return text.replace(numberRegex, (match, number, offset2) => {
2050
2057
  const before = text.charAt(offset2 - 1);
2051
2058
  const after = text.charAt(offset2 + match.length);
@@ -2474,7 +2481,7 @@ function PopupMenuButton({
2474
2481
  }, [menuOpen]);
2475
2482
  let menuItems = null;
2476
2483
  if (menuOpen && items.length > 0) {
2477
- menuItems = /* @__PURE__ */ jsx20(MenuContext.Provider, { value: { selectedKey }, children: /* @__PURE__ */ jsx20("div", { ref: refs.setFloating, style: floatingStyles, children: /* @__PURE__ */ jsx20(
2484
+ menuItems = /* @__PURE__ */ jsx20(MenuContext.Provider, { value: { selectedKey }, children: /* @__PURE__ */ jsx20("div", { ref: refs.setFloating, style: floatingStyles, className: small ? "z-10" : "z-[100]", children: /* @__PURE__ */ jsx20(
2478
2485
  Transition2,
2479
2486
  {
2480
2487
  as: Fragment5,