@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.mjs CHANGED
@@ -1,11 +1,11 @@
1
1
  "use client";
2
2
  import * as React10 from 'react';
3
3
  import { createContext, useRef, useState, useCallback, useEffect, Children, isValidElement, useMemo, useContext } from 'react';
4
+ import { Loader2, ChevronDown, Check, Inbox, Search, ChevronsLeft, ChevronLeft, ChevronRight, ChevronsRight, X, Circle, PinOff, Pin, ArrowDown, ArrowUp, ChevronsUpDown, FileText, FileSpreadsheet, Download, Rows4, Rows3, LayoutList, SlidersHorizontal, Info, AlertTriangle, XCircle, CheckCircle2, Building2, Star, ArrowRight, User, LogOut, Menu, AlertCircle, TrendingUp, TrendingDown, Sun, Moon, Bell, MoreHorizontal, Settings } from 'lucide-react';
4
5
  import { cva } from 'class-variance-authority';
5
6
  import { clsx } from 'clsx';
6
7
  import { twMerge } from 'tailwind-merge';
7
8
  import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
8
- import { ChevronDown, Check, Inbox, Search, ChevronsLeft, ChevronLeft, ChevronRight, ChevronsRight, X, Circle, PinOff, Pin, ArrowDown, ArrowUp, ChevronsUpDown, FileText, FileSpreadsheet, Download, Rows4, Rows3, LayoutList, SlidersHorizontal, Info, AlertTriangle, XCircle, CheckCircle2, Building2, Star, ArrowRight, User, LogOut, Menu, Loader2, AlertCircle, TrendingUp, TrendingDown, Sun, Moon, Bell, MoreHorizontal, Settings } from 'lucide-react';
9
9
  import { AnimatePresence, motion } from 'framer-motion';
10
10
  import * as SelectPrimitive from '@radix-ui/react-select';
11
11
  import * as TabsPrimitive from '@radix-ui/react-tabs';
@@ -58,13 +58,18 @@ var buttonVariants = cva(
58
58
  }
59
59
  );
60
60
  var Button = React10.forwardRef(
61
- ({ className, variant, size, ...props }, ref) => {
61
+ ({ className, variant, size, isLoading = false, loadingText, children, disabled, ...props }, ref) => {
62
62
  return /* @__PURE__ */ jsx(
63
63
  "button",
64
64
  {
65
65
  className: cn(buttonVariants({ variant, size, className })),
66
66
  ref,
67
- ...props
67
+ disabled: disabled || isLoading,
68
+ ...props,
69
+ children: isLoading ? /* @__PURE__ */ jsxs(Fragment, { children: [
70
+ /* @__PURE__ */ jsx(Loader2, { className: "h-4 w-4 animate-spin shrink-0" }),
71
+ loadingText ?? children
72
+ ] }) : children
68
73
  }
69
74
  );
70
75
  }