braid-ui 1.0.6 → 1.0.7
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.cjs +29 -17
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +2 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.js +30 -18
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -677,8 +677,9 @@ interface StatementViewProps {
|
|
|
677
677
|
onDownloadCSV: () => void;
|
|
678
678
|
onPrintPDF: () => void;
|
|
679
679
|
isGenerateDisabled: boolean;
|
|
680
|
+
isLoading: boolean;
|
|
680
681
|
}
|
|
681
|
-
declare const StatementView: ({ statementType, selectedProgram, selectedProduct, accountNumber, startDate, endDate, statementGenerated, programs, products, statementHeader, statementTransactions, onStatementTypeChange, onProgramChange, onProductChange, onAccountNumberChange, onStartDateChange, onEndDateChange, onGenerateStatement, onEdit, onDownloadCSV, onPrintPDF, isGenerateDisabled }: StatementViewProps) => react_jsx_runtime.JSX.Element;
|
|
682
|
+
declare const StatementView: ({ statementType, selectedProgram, selectedProduct, accountNumber, startDate, endDate, statementGenerated, programs, products, statementHeader, statementTransactions, onStatementTypeChange, onProgramChange, onProductChange, onAccountNumberChange, onStartDateChange, onEndDateChange, onGenerateStatement, onEdit, onDownloadCSV, onPrintPDF, isGenerateDisabled, isLoading }: StatementViewProps) => react_jsx_runtime.JSX.Element;
|
|
682
683
|
|
|
683
684
|
interface ACHDetails {
|
|
684
685
|
type: string;
|
package/dist/index.d.ts
CHANGED
|
@@ -677,8 +677,9 @@ interface StatementViewProps {
|
|
|
677
677
|
onDownloadCSV: () => void;
|
|
678
678
|
onPrintPDF: () => void;
|
|
679
679
|
isGenerateDisabled: boolean;
|
|
680
|
+
isLoading: boolean;
|
|
680
681
|
}
|
|
681
|
-
declare const StatementView: ({ statementType, selectedProgram, selectedProduct, accountNumber, startDate, endDate, statementGenerated, programs, products, statementHeader, statementTransactions, onStatementTypeChange, onProgramChange, onProductChange, onAccountNumberChange, onStartDateChange, onEndDateChange, onGenerateStatement, onEdit, onDownloadCSV, onPrintPDF, isGenerateDisabled }: StatementViewProps) => react_jsx_runtime.JSX.Element;
|
|
682
|
+
declare const StatementView: ({ statementType, selectedProgram, selectedProduct, accountNumber, startDate, endDate, statementGenerated, programs, products, statementHeader, statementTransactions, onStatementTypeChange, onProgramChange, onProductChange, onAccountNumberChange, onStartDateChange, onEndDateChange, onGenerateStatement, onEdit, onDownloadCSV, onPrintPDF, isGenerateDisabled, isLoading }: StatementViewProps) => react_jsx_runtime.JSX.Element;
|
|
682
683
|
|
|
683
684
|
interface ACHDetails {
|
|
684
685
|
type: string;
|
package/dist/index.js
CHANGED
|
@@ -4,7 +4,7 @@ import { cva } from 'class-variance-authority';
|
|
|
4
4
|
import { clsx } from 'clsx';
|
|
5
5
|
import { twMerge } from 'tailwind-merge';
|
|
6
6
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
7
|
-
import { ChevronDown, ChevronUp, Check, X, PanelLeft, Edit, Home, Globe, CreditCard, Building, MoreVertical, Minus, TrendingDown, TrendingUp, ChevronRight, Eye, Trash2, Plus, MessageSquare, Upload, FileText, Download, Copy, LayoutDashboard, Bell, Briefcase, FileCheck, Receipt, ArrowLeftRight, Users, Building2, Zap, Shield, AlertCircle, RefreshCw, Landmark, Search, Repeat, Box, Settings, BarChart3, Key, Heart, User, AlertTriangle, XCircle, CheckCircle, Clock, CalendarIcon, ArrowDownRight, ArrowUpRight, Filter, ChevronLeft, Calendar as Calendar$1, CheckCircle2, StickyNote, FileUp, Circle, UserPlus, ChevronsUpDown, FileJson } from 'lucide-react';
|
|
7
|
+
import { ChevronDown, ChevronUp, Check, X, PanelLeft, Edit, Home, Globe, CreditCard, Building, MoreVertical, Minus, TrendingDown, TrendingUp, ChevronRight, Eye, Trash2, Plus, MessageSquare, Upload, FileText, Download, Copy, LayoutDashboard, Bell, Briefcase, FileCheck, Receipt, ArrowLeftRight, Users, Building2, Zap, Shield, AlertCircle, RefreshCw, Landmark, Search, Repeat, Box, Settings, BarChart3, Key, Heart, User, AlertTriangle, XCircle, CheckCircle, Clock, CalendarIcon, Loader2, ArrowDownRight, ArrowUpRight, Filter, ChevronLeft, Calendar as Calendar$1, CheckCircle2, StickyNote, FileUp, Circle, UserPlus, ChevronsUpDown, FileJson } from 'lucide-react';
|
|
8
8
|
import { createPortal } from 'react-dom';
|
|
9
9
|
import { Slot } from '@radix-ui/react-slot';
|
|
10
10
|
import * as SelectPrimitive from '@radix-ui/react-select';
|
|
@@ -5583,7 +5583,8 @@ var StatementView = ({
|
|
|
5583
5583
|
onEdit,
|
|
5584
5584
|
onDownloadCSV,
|
|
5585
5585
|
onPrintPDF,
|
|
5586
|
-
isGenerateDisabled
|
|
5586
|
+
isGenerateDisabled,
|
|
5587
|
+
isLoading
|
|
5587
5588
|
}) => {
|
|
5588
5589
|
return /* @__PURE__ */ jsxs("div", { className: "container mx-auto p-6 space-y-6", children: [
|
|
5589
5590
|
/* @__PURE__ */ jsxs("div", { children: [
|
|
@@ -5690,12 +5691,15 @@ var StatementView = ({
|
|
|
5690
5691
|
] })
|
|
5691
5692
|
] })
|
|
5692
5693
|
] }),
|
|
5693
|
-
/* @__PURE__ */ jsx("div", { className: "flex justify-end", children: /* @__PURE__ */
|
|
5694
|
+
/* @__PURE__ */ jsx("div", { className: "flex justify-end", children: /* @__PURE__ */ jsxs(
|
|
5694
5695
|
Button,
|
|
5695
5696
|
{
|
|
5696
5697
|
onClick: onGenerateStatement,
|
|
5697
|
-
disabled: isGenerateDisabled,
|
|
5698
|
-
children:
|
|
5698
|
+
disabled: isGenerateDisabled || isLoading,
|
|
5699
|
+
children: [
|
|
5700
|
+
isLoading && /* @__PURE__ */ jsx(Loader2, { className: "h-4 w-4 animate-spin" }),
|
|
5701
|
+
isLoading ? "Generating..." : "Generate Statement"
|
|
5702
|
+
]
|
|
5699
5703
|
}
|
|
5700
5704
|
) })
|
|
5701
5705
|
] })
|
|
@@ -8583,6 +8587,7 @@ function Statement() {
|
|
|
8583
8587
|
const [startDate, setStartDate] = useState();
|
|
8584
8588
|
const [endDate, setEndDate] = useState();
|
|
8585
8589
|
const [statementGenerated, setStatementGenerated] = useState(false);
|
|
8590
|
+
const [isLoading, setIsLoading] = useState(false);
|
|
8586
8591
|
const [programs] = useState(mockPrograms);
|
|
8587
8592
|
const [products] = useState(mockProducts);
|
|
8588
8593
|
const [statementHeader, setStatementHeader] = useState(null);
|
|
@@ -8593,22 +8598,28 @@ function Statement() {
|
|
|
8593
8598
|
setSelectedProduct("");
|
|
8594
8599
|
setAccountNumber("");
|
|
8595
8600
|
};
|
|
8596
|
-
const handleGenerateStatement = () => {
|
|
8601
|
+
const handleGenerateStatement = async () => {
|
|
8597
8602
|
if (!statementType || !startDate || !endDate) return;
|
|
8598
8603
|
if (statementType === "program" && !selectedProgram) return;
|
|
8599
8604
|
if (statementType === "product" && !selectedProduct) return;
|
|
8600
8605
|
if (statementType === "account" && !accountNumber) return;
|
|
8601
|
-
|
|
8602
|
-
|
|
8603
|
-
|
|
8604
|
-
|
|
8605
|
-
|
|
8606
|
-
|
|
8607
|
-
|
|
8608
|
-
|
|
8609
|
-
|
|
8610
|
-
|
|
8611
|
-
|
|
8606
|
+
setIsLoading(true);
|
|
8607
|
+
try {
|
|
8608
|
+
console.log("Generating statement with:", {
|
|
8609
|
+
statementType,
|
|
8610
|
+
selectedProgram,
|
|
8611
|
+
selectedProduct,
|
|
8612
|
+
accountNumber,
|
|
8613
|
+
startDate,
|
|
8614
|
+
endDate
|
|
8615
|
+
});
|
|
8616
|
+
await new Promise((resolve) => setTimeout(resolve, 1e3));
|
|
8617
|
+
setStatementHeader(mockStatementHeader);
|
|
8618
|
+
setStatementTransactions(mockStatementTransactions);
|
|
8619
|
+
setStatementGenerated(true);
|
|
8620
|
+
} finally {
|
|
8621
|
+
setIsLoading(false);
|
|
8622
|
+
}
|
|
8612
8623
|
};
|
|
8613
8624
|
const isGenerateDisabled = () => {
|
|
8614
8625
|
if (!statementType || !startDate || !endDate) return true;
|
|
@@ -8650,7 +8661,8 @@ function Statement() {
|
|
|
8650
8661
|
onEdit: handleEdit,
|
|
8651
8662
|
onDownloadCSV: handleDownloadCSV,
|
|
8652
8663
|
onPrintPDF: handlePrintPDF,
|
|
8653
|
-
isGenerateDisabled: isGenerateDisabled()
|
|
8664
|
+
isGenerateDisabled: isGenerateDisabled(),
|
|
8665
|
+
isLoading
|
|
8654
8666
|
}
|
|
8655
8667
|
);
|
|
8656
8668
|
}
|