@underverse-ui/underverse 0.1.6 → 0.1.8

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
@@ -2522,7 +2522,7 @@ var Alert = ({ title, description, variant = "default", className, icon, dismiss
2522
2522
  var Alert_default = Alert;
2523
2523
 
2524
2524
  // ../../components/ui/GlobalLoading.tsx
2525
- import { useEffect as useEffect7, useState as useState14 } from "react";
2525
+ import React14, { useEffect as useEffect7, useState as useState14 } from "react";
2526
2526
  import { Activity as Activity2 } from "lucide-react";
2527
2527
 
2528
2528
  // ../../lib/utils/loading.ts
@@ -2641,21 +2641,24 @@ var ButtonLoading = ({
2641
2641
  disabled,
2642
2642
  loadingText
2643
2643
  }) => {
2644
+ const child = React14.isValidElement(children) ? React14.cloneElement(children, {
2645
+ disabled: (children.props?.disabled ?? false) || disabled || isLoading,
2646
+ "aria-busy": isLoading || void 0
2647
+ }) : children;
2644
2648
  return /* @__PURE__ */ jsxs17(
2645
- "button",
2649
+ "div",
2646
2650
  {
2647
2651
  className: cn(
2648
- "relative",
2652
+ "relative inline-block",
2649
2653
  isLoading && "cursor-not-allowed",
2650
2654
  className
2651
2655
  ),
2652
- disabled: disabled || isLoading,
2653
2656
  children: [
2654
- isLoading && /* @__PURE__ */ jsxs17("div", { className: "absolute inset-0 flex items-center justify-center", children: [
2657
+ isLoading && /* @__PURE__ */ jsxs17("div", { className: "absolute inset-0 flex items-center justify-center pointer-events-none", children: [
2655
2658
  /* @__PURE__ */ jsx19(Activity2, { className: "w-4 h-4 animate-spin text-primary-foreground" }),
2656
2659
  loadingText && /* @__PURE__ */ jsx19("span", { className: "ml-2 text-sm", children: loadingText })
2657
2660
  ] }),
2658
- /* @__PURE__ */ jsx19("div", { className: cn(isLoading && "invisible"), children })
2661
+ /* @__PURE__ */ jsx19("div", { className: cn(isLoading && "opacity-50 pointer-events-none"), children: child })
2659
2662
  ]
2660
2663
  }
2661
2664
  );