@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/README.md CHANGED
@@ -1,5 +1,7 @@
1
1
  # Underverse UI
2
2
 
3
+ Docs: https://underverse-sepia.vercel.app/vi/docs/underverse
4
+
3
5
  **Author:** Tran Van Bach
4
6
 
5
7
  A comprehensive UI component library for React/Next.js applications, extracted from the main project. Built with Tailwind CSS, `clsx`, and `tailwind-merge`. Some components support `next-intl` (optional).
package/dist/index.cjs CHANGED
@@ -2625,7 +2625,7 @@ var Alert = ({ title, description, variant = "default", className, icon, dismiss
2625
2625
  var Alert_default = Alert;
2626
2626
 
2627
2627
  // ../../components/ui/GlobalLoading.tsx
2628
- var import_react8 = require("react");
2628
+ var import_react8 = __toESM(require("react"), 1);
2629
2629
  var import_lucide_react10 = require("lucide-react");
2630
2630
 
2631
2631
  // ../../lib/utils/loading.ts
@@ -2744,21 +2744,24 @@ var ButtonLoading = ({
2744
2744
  disabled,
2745
2745
  loadingText
2746
2746
  }) => {
2747
+ const child = import_react8.default.isValidElement(children) ? import_react8.default.cloneElement(children, {
2748
+ disabled: (children.props?.disabled ?? false) || disabled || isLoading,
2749
+ "aria-busy": isLoading || void 0
2750
+ }) : children;
2747
2751
  return /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(
2748
- "button",
2752
+ "div",
2749
2753
  {
2750
2754
  className: cn(
2751
- "relative",
2755
+ "relative inline-block",
2752
2756
  isLoading && "cursor-not-allowed",
2753
2757
  className
2754
2758
  ),
2755
- disabled: disabled || isLoading,
2756
2759
  children: [
2757
- isLoading && /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { className: "absolute inset-0 flex items-center justify-center", children: [
2760
+ isLoading && /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { className: "absolute inset-0 flex items-center justify-center pointer-events-none", children: [
2758
2761
  /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_lucide_react10.Activity, { className: "w-4 h-4 animate-spin text-primary-foreground" }),
2759
2762
  loadingText && /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("span", { className: "ml-2 text-sm", children: loadingText })
2760
2763
  ] }),
2761
- /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("div", { className: cn(isLoading && "invisible"), children })
2764
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("div", { className: cn(isLoading && "opacity-50 pointer-events-none"), children: child })
2762
2765
  ]
2763
2766
  }
2764
2767
  );