@facter/ds-core 1.32.0 → 1.33.0

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
@@ -30,6 +30,8 @@ declare const buttonVariants: (props?: ({
30
30
  } & class_variance_authority_types.ClassProp) | undefined) => string;
31
31
  interface ButtonProps extends React$1.ButtonHTMLAttributes<HTMLButtonElement>, VariantProps<typeof buttonVariants> {
32
32
  asChild?: boolean;
33
+ isLoading?: boolean;
34
+ loadingText?: string;
33
35
  }
34
36
  declare const Button: React$1.ForwardRefExoticComponent<ButtonProps & React$1.RefAttributes<HTMLButtonElement>>;
35
37
 
package/dist/index.d.ts CHANGED
@@ -30,6 +30,8 @@ declare const buttonVariants: (props?: ({
30
30
  } & class_variance_authority_types.ClassProp) | undefined) => string;
31
31
  interface ButtonProps extends React$1.ButtonHTMLAttributes<HTMLButtonElement>, VariantProps<typeof buttonVariants> {
32
32
  asChild?: boolean;
33
+ isLoading?: boolean;
34
+ loadingText?: string;
33
35
  }
34
36
  declare const Button: React$1.ForwardRefExoticComponent<ButtonProps & React$1.RefAttributes<HTMLButtonElement>>;
35
37
 
package/dist/index.js CHANGED
@@ -2,11 +2,11 @@
2
2
  'use strict';
3
3
 
4
4
  var React10 = require('react');
5
+ var lucideReact = require('lucide-react');
5
6
  var classVarianceAuthority = require('class-variance-authority');
6
7
  var clsx = require('clsx');
7
8
  var tailwindMerge = require('tailwind-merge');
8
9
  var jsxRuntime = require('react/jsx-runtime');
9
- var lucideReact = require('lucide-react');
10
10
  var framerMotion = require('framer-motion');
11
11
  var SelectPrimitive = require('@radix-ui/react-select');
12
12
  var TabsPrimitive = require('@radix-ui/react-tabs');
@@ -89,13 +89,18 @@ var buttonVariants = classVarianceAuthority.cva(
89
89
  }
90
90
  );
91
91
  var Button = React10__namespace.forwardRef(
92
- ({ className, variant, size, ...props }, ref) => {
92
+ ({ className, variant, size, isLoading = false, loadingText, children, disabled, ...props }, ref) => {
93
93
  return /* @__PURE__ */ jsxRuntime.jsx(
94
94
  "button",
95
95
  {
96
96
  className: cn(buttonVariants({ variant, size, className })),
97
97
  ref,
98
- ...props
98
+ disabled: disabled || isLoading,
99
+ ...props,
100
+ children: isLoading ? /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
101
+ /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Loader2, { className: "h-4 w-4 animate-spin shrink-0" }),
102
+ loadingText ?? children
103
+ ] }) : children
99
104
  }
100
105
  );
101
106
  }