braid-ui 1.0.98 → 1.0.99
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 +44 -327
- package/components.json +20 -0
- package/eslint.config.js +29 -0
- package/index.html +24 -0
- package/package.json +55 -115
- package/postcss.config.js +6 -0
- package/public/favicon.ico +0 -0
- package/public/placeholder.svg +1 -0
- package/public/robots.txt +14 -0
- package/src/App.css +42 -0
- package/src/App.tsx +94 -0
- package/src/components/MainLayout.tsx +15 -0
- package/src/components/alerts/AlertDocuments.tsx +320 -0
- package/src/components/alerts/AlertNotes.tsx +185 -0
- package/src/components/alerts/AlertTimeline.tsx +79 -0
- package/src/components/alerts/ContextSection.tsx +155 -0
- package/src/components/app-sidebar.tsx +341 -0
- package/src/components/form-sections/ACHBankCard.tsx +78 -0
- package/src/components/form-sections/ACHBasicInfoCard.tsx +100 -0
- package/src/components/form-sections/ACHTransferSection.tsx +64 -0
- package/src/components/form-sections/AddressForm.tsx +94 -0
- package/src/components/form-sections/BankAddressCard.tsx +95 -0
- package/src/components/form-sections/BankingDetailsCard.tsx +46 -0
- package/src/components/form-sections/BasicInfoCard.tsx +103 -0
- package/src/components/form-sections/BasicInfoSection.tsx +34 -0
- package/src/components/form-sections/BeneficiaryAddress.tsx +19 -0
- package/src/components/form-sections/BeneficiaryCard.tsx +41 -0
- package/src/components/form-sections/BeneficiaryDomesticWire.tsx +23 -0
- package/src/components/form-sections/BusinessProfileCard.tsx +131 -0
- package/src/components/form-sections/BusinessStatusCard.tsx +53 -0
- package/src/components/form-sections/ContactInfoCard.tsx +63 -0
- package/src/components/form-sections/CounterpartyBasicInfo.tsx +101 -0
- package/src/components/form-sections/CounterpartyProfileCard.tsx +104 -0
- package/src/components/form-sections/CounterpartyRecordsCard.tsx +41 -0
- package/src/components/form-sections/IntermediaryCard.tsx +77 -0
- package/src/components/form-sections/IntermediaryFI.tsx +41 -0
- package/src/components/form-sections/IntermediaryFIAddress.tsx +14 -0
- package/src/components/form-sections/OriginatorCard.tsx +49 -0
- package/src/components/form-sections/OriginatorFI.tsx +42 -0
- package/src/components/form-sections/OriginatorFIAddress.tsx +14 -0
- package/src/components/form-sections/PaymentInformationSection.tsx +163 -0
- package/src/components/form-sections/ReceiverCard.tsx +94 -0
- package/src/components/form-sections/WireTransferSection.tsx +75 -0
- package/src/components/layouts/list-page.tsx +103 -0
- package/src/components/transaction/ACHDetailsSection.tsx +95 -0
- package/src/components/transaction/WireDetailsSection.tsx +112 -0
- package/src/components/ui/account-card.tsx +94 -0
- package/src/components/ui/badge.tsx +75 -0
- package/src/components/ui/breadcrumb.tsx +78 -0
- package/src/components/ui/business-type-badge.tsx +42 -0
- package/src/components/ui/button.tsx +56 -0
- package/src/components/ui/calendar.tsx +49 -0
- package/src/components/ui/card.tsx +223 -0
- package/src/components/ui/container.tsx +45 -0
- package/src/components/ui/counterparty-type-badge.tsx +53 -0
- package/src/components/ui/data-grid.tsx +99 -0
- package/src/components/ui/data-table.tsx +152 -0
- package/src/components/ui/detail-page-layout.tsx +83 -0
- package/src/components/ui/dialog.tsx +120 -0
- package/src/components/ui/dropdown-menu.tsx +82 -0
- package/src/components/ui/editable-form-card.tsx +106 -0
- package/src/components/ui/editable-info-field.tsx +67 -0
- package/src/components/ui/enhanced-input.tsx +78 -0
- package/src/components/ui/enhanced-select.tsx +101 -0
- package/src/components/ui/enhanced-textarea.tsx +64 -0
- package/src/components/ui/entity-card.tsx +140 -0
- package/src/components/ui/form-card.tsx +40 -0
- package/src/components/ui/form-field.tsx +50 -0
- package/src/components/ui/form-input.tsx +29 -0
- package/src/components/ui/form-provider.tsx +18 -0
- package/src/components/ui/form-section.tsx +66 -0
- package/src/components/ui/form-select.tsx +35 -0
- package/src/components/ui/info-field.tsx +36 -0
- package/src/components/ui/json-viewer.tsx +146 -0
- package/src/components/ui/label.tsx +24 -0
- package/src/components/ui/metric-card.tsx +80 -0
- package/src/components/ui/page-layout.tsx +183 -0
- package/src/components/ui/popover.tsx +29 -0
- package/src/components/ui/responsive-grid.tsx +46 -0
- package/src/components/ui/separator.tsx +31 -0
- package/src/components/ui/sheet.tsx +140 -0
- package/src/components/ui/sidebar.tsx +775 -0
- package/src/components/ui/sonner.tsx +29 -0
- package/src/components/ui/stack.tsx +77 -0
- package/src/components/ui/status-badge.tsx +68 -0
- package/src/components/ui/tabs.tsx +52 -0
- package/src/components/ui/toast.tsx +127 -0
- package/src/components/ui/toaster.tsx +33 -0
- package/src/components/ui/tooltip.tsx +28 -0
- package/src/components/ui/use-toast.ts +3 -0
- package/src/components/ui-kit/dashboard-demo.tsx +156 -0
- package/src/components/ui-kit/pattern-library.tsx +248 -0
- package/src/components/ui-kit/showcase.tsx +211 -0
- package/src/hooks/use-mobile.tsx +19 -0
- package/src/hooks/use-toast.ts +191 -0
- package/src/hooks/useEditState.ts +70 -0
- package/src/hooks/useFormWithEditState.ts +115 -0
- package/src/{styles.css → index.css} +10 -4
- package/src/lib/constants.ts +25 -0
- package/src/lib/mock-data/alert-data.ts +275 -0
- package/src/lib/mock-data/banking-data.ts +72 -0
- package/src/lib/mock-data/business-data.ts +71 -0
- package/src/lib/mock-data/counterparty-data.ts +70 -0
- package/src/lib/mock-data/index.ts +5 -0
- package/src/lib/mock-data/transaction-data.ts +283 -0
- package/src/lib/mock-data/wire-data.ts +103 -0
- package/src/lib/mock-data.tsx +180 -0
- package/src/lib/schemas/banking-schemas.ts +30 -0
- package/src/lib/schemas/business-schemas.ts +36 -0
- package/src/lib/schemas/counterparty-schemas.ts +43 -0
- package/src/lib/schemas/index.ts +5 -0
- package/src/lib/schemas/wire-schemas.ts +44 -0
- package/src/lib/utils.ts +6 -0
- package/src/main.tsx +10 -0
- package/src/pages/Cases.tsx +16 -0
- package/src/pages/Dashboard.tsx +16 -0
- package/src/pages/NotFound.tsx +27 -0
- package/src/pages/TransactionHistory.tsx +532 -0
- package/src/pages/UIKit.tsx +51 -0
- package/src/pages/alerts/AlertDetail.tsx +193 -0
- package/src/pages/alerts/Alerts.tsx +373 -0
- package/src/pages/business/Business.tsx +48 -0
- package/src/pages/business/Create.tsx +173 -0
- package/src/pages/counterparty/Create.tsx +48 -0
- package/src/pages/counterparty/DomesticWire.tsx +78 -0
- package/src/pages/counterparty/Manage.tsx +79 -0
- package/src/pages/transactions/NewTransaction.tsx +527 -0
- package/src/pages/transactions/TransactionDetail.tsx +192 -0
- package/src/vite-env.d.ts +1 -0
- package/tailwind.config.ts +124 -0
- package/tsconfig.app.json +30 -0
- package/tsconfig.json +19 -0
- package/tsconfig.node.json +22 -0
- package/vite.config.ts +22 -0
- package/dist/css/braid-ui-variables.css +0 -88
- package/dist/css/braid-ui.css +0 -4484
- package/dist/css/braid-ui.min.css +0 -1
- package/dist/index.cjs +0 -4
- package/dist/index.cjs.map +0 -1
- package/dist/index.d.cts +0 -2429
- package/dist/index.d.ts +0 -2429
- package/dist/index.js +0 -4
- package/dist/index.js.map +0 -1
- package/src/styles-only.css +0 -121
- /package/{dist/braid-logo-343BOQZ2.png → src/assets/braid-logo.png} +0 -0
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { useTheme } from "next-themes"
|
|
2
|
+
import { Toaster as Sonner, toast } from "sonner"
|
|
3
|
+
|
|
4
|
+
type ToasterProps = React.ComponentProps<typeof Sonner>
|
|
5
|
+
|
|
6
|
+
const Toaster = ({ ...props }: ToasterProps) => {
|
|
7
|
+
const { theme = "system" } = useTheme()
|
|
8
|
+
|
|
9
|
+
return (
|
|
10
|
+
<Sonner
|
|
11
|
+
theme={theme as ToasterProps["theme"]}
|
|
12
|
+
className="toaster group"
|
|
13
|
+
toastOptions={{
|
|
14
|
+
classNames: {
|
|
15
|
+
toast:
|
|
16
|
+
"group toast group-[.toaster]:bg-background group-[.toaster]:text-foreground group-[.toaster]:border-border group-[.toaster]:shadow-lg",
|
|
17
|
+
description: "group-[.toast]:text-muted-foreground",
|
|
18
|
+
actionButton:
|
|
19
|
+
"group-[.toast]:bg-primary group-[.toast]:text-primary-foreground",
|
|
20
|
+
cancelButton:
|
|
21
|
+
"group-[.toast]:bg-muted group-[.toast]:text-muted-foreground",
|
|
22
|
+
},
|
|
23
|
+
}}
|
|
24
|
+
{...props}
|
|
25
|
+
/>
|
|
26
|
+
)
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export { Toaster, toast }
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import * as React from "react"
|
|
2
|
+
import { cn } from "@/lib/utils"
|
|
3
|
+
|
|
4
|
+
interface StackProps {
|
|
5
|
+
children: React.ReactNode
|
|
6
|
+
direction?: "vertical" | "horizontal"
|
|
7
|
+
spacing?: "none" | "xs" | "sm" | "md" | "lg" | "xl"
|
|
8
|
+
align?: "start" | "center" | "end" | "stretch"
|
|
9
|
+
justify?: "start" | "center" | "end" | "between" | "around"
|
|
10
|
+
className?: string
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
const spacingClasses = {
|
|
14
|
+
vertical: {
|
|
15
|
+
none: "",
|
|
16
|
+
xs: "space-y-1",
|
|
17
|
+
sm: "space-y-2",
|
|
18
|
+
md: "space-y-4",
|
|
19
|
+
lg: "space-y-6",
|
|
20
|
+
xl: "space-y-8"
|
|
21
|
+
},
|
|
22
|
+
horizontal: {
|
|
23
|
+
none: "",
|
|
24
|
+
xs: "space-x-1",
|
|
25
|
+
sm: "space-x-2",
|
|
26
|
+
md: "space-x-4",
|
|
27
|
+
lg: "space-x-6",
|
|
28
|
+
xl: "space-x-8"
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
const alignClasses = {
|
|
33
|
+
vertical: {
|
|
34
|
+
start: "",
|
|
35
|
+
center: "items-center",
|
|
36
|
+
end: "items-end",
|
|
37
|
+
stretch: "items-stretch"
|
|
38
|
+
},
|
|
39
|
+
horizontal: {
|
|
40
|
+
start: "",
|
|
41
|
+
center: "items-center",
|
|
42
|
+
end: "items-end",
|
|
43
|
+
stretch: "items-stretch"
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
const justifyClasses = {
|
|
48
|
+
start: "",
|
|
49
|
+
center: "justify-center",
|
|
50
|
+
end: "justify-end",
|
|
51
|
+
between: "justify-between",
|
|
52
|
+
around: "justify-around"
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
export const Stack = React.forwardRef<HTMLDivElement, StackProps>(
|
|
56
|
+
({ children, direction = "vertical", spacing = "md", align = "start", justify = "start", className }, ref) => {
|
|
57
|
+
const isHorizontal = direction === "horizontal"
|
|
58
|
+
|
|
59
|
+
return (
|
|
60
|
+
<div
|
|
61
|
+
ref={ref}
|
|
62
|
+
className={cn(
|
|
63
|
+
"flex",
|
|
64
|
+
isHorizontal ? "flex-row" : "flex-col",
|
|
65
|
+
spacingClasses[direction][spacing],
|
|
66
|
+
alignClasses[direction][align],
|
|
67
|
+
justifyClasses[justify],
|
|
68
|
+
className
|
|
69
|
+
)}
|
|
70
|
+
>
|
|
71
|
+
{children}
|
|
72
|
+
</div>
|
|
73
|
+
)
|
|
74
|
+
}
|
|
75
|
+
)
|
|
76
|
+
|
|
77
|
+
Stack.displayName = "Stack"
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { Badge } from "@/components/ui/badge"
|
|
2
|
+
import { CheckCircle, XCircle, Clock, AlertTriangle } from "lucide-react"
|
|
3
|
+
|
|
4
|
+
interface StatusBadgeProps {
|
|
5
|
+
status: "ACTIVE" | "INACTIVE" | "PENDING" | "SUSPENDED" | "POSTED" | "FAILED" | "CANCELLED"
|
|
6
|
+
className?: string
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
const statusConfig = {
|
|
10
|
+
ACTIVE: {
|
|
11
|
+
variant: "active" as const,
|
|
12
|
+
label: "Active",
|
|
13
|
+
icon: CheckCircle
|
|
14
|
+
},
|
|
15
|
+
INACTIVE: {
|
|
16
|
+
variant: "inactive" as const,
|
|
17
|
+
label: "Inactive",
|
|
18
|
+
icon: XCircle
|
|
19
|
+
},
|
|
20
|
+
PENDING: {
|
|
21
|
+
variant: "pending" as const,
|
|
22
|
+
label: "Pending",
|
|
23
|
+
icon: Clock
|
|
24
|
+
},
|
|
25
|
+
SUSPENDED: {
|
|
26
|
+
variant: "suspended" as const,
|
|
27
|
+
label: "Suspended",
|
|
28
|
+
icon: AlertTriangle
|
|
29
|
+
},
|
|
30
|
+
POSTED: {
|
|
31
|
+
variant: "active" as const,
|
|
32
|
+
label: "Posted",
|
|
33
|
+
icon: CheckCircle
|
|
34
|
+
},
|
|
35
|
+
FAILED: {
|
|
36
|
+
variant: "inactive" as const,
|
|
37
|
+
label: "Failed",
|
|
38
|
+
icon: XCircle
|
|
39
|
+
},
|
|
40
|
+
CANCELLED: {
|
|
41
|
+
variant: "secondary" as const,
|
|
42
|
+
label: "Cancelled",
|
|
43
|
+
icon: XCircle
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
export const StatusBadge = ({ status, className }: StatusBadgeProps) => {
|
|
48
|
+
const config = statusConfig[status]
|
|
49
|
+
|
|
50
|
+
// Fallback if config is not found
|
|
51
|
+
if (!config) {
|
|
52
|
+
return (
|
|
53
|
+
<Badge variant="secondary" className={className}>
|
|
54
|
+
<AlertTriangle className="w-3 h-3 mr-1" />
|
|
55
|
+
{status || "Unknown"}
|
|
56
|
+
</Badge>
|
|
57
|
+
)
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
const Icon = config.icon
|
|
61
|
+
|
|
62
|
+
return (
|
|
63
|
+
<Badge variant={config.variant} className={className}>
|
|
64
|
+
<Icon className="w-3 h-3 mr-1" />
|
|
65
|
+
{config.label}
|
|
66
|
+
</Badge>
|
|
67
|
+
)
|
|
68
|
+
}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import * as React from "react"
|
|
2
|
+
import * as TabsPrimitive from "@radix-ui/react-tabs"
|
|
3
|
+
import { cn } from "@/lib/utils"
|
|
4
|
+
|
|
5
|
+
const Tabs = TabsPrimitive.Root
|
|
6
|
+
|
|
7
|
+
const TabsList = React.forwardRef<
|
|
8
|
+
React.ElementRef<typeof TabsPrimitive.List>,
|
|
9
|
+
React.ComponentPropsWithoutRef<typeof TabsPrimitive.List>
|
|
10
|
+
>(({ className, ...props }, ref) => (
|
|
11
|
+
<TabsPrimitive.List
|
|
12
|
+
ref={ref}
|
|
13
|
+
className={cn(
|
|
14
|
+
"inline-flex h-10 items-center justify-center rounded-md bg-muted p-1 text-muted-foreground",
|
|
15
|
+
className
|
|
16
|
+
)}
|
|
17
|
+
{...props}
|
|
18
|
+
/>
|
|
19
|
+
))
|
|
20
|
+
TabsList.displayName = TabsPrimitive.List.displayName
|
|
21
|
+
|
|
22
|
+
const TabsTrigger = React.forwardRef<
|
|
23
|
+
React.ElementRef<typeof TabsPrimitive.Trigger>,
|
|
24
|
+
React.ComponentPropsWithoutRef<typeof TabsPrimitive.Trigger>
|
|
25
|
+
>(({ className, ...props }, ref) => (
|
|
26
|
+
<TabsPrimitive.Trigger
|
|
27
|
+
ref={ref}
|
|
28
|
+
className={cn(
|
|
29
|
+
"inline-flex items-center justify-center whitespace-nowrap rounded-sm px-3 py-1.5 text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow-sm",
|
|
30
|
+
className
|
|
31
|
+
)}
|
|
32
|
+
{...props}
|
|
33
|
+
/>
|
|
34
|
+
))
|
|
35
|
+
TabsTrigger.displayName = TabsPrimitive.Trigger.displayName
|
|
36
|
+
|
|
37
|
+
const TabsContent = React.forwardRef<
|
|
38
|
+
React.ElementRef<typeof TabsPrimitive.Content>,
|
|
39
|
+
React.ComponentPropsWithoutRef<typeof TabsPrimitive.Content>
|
|
40
|
+
>(({ className, ...props }, ref) => (
|
|
41
|
+
<TabsPrimitive.Content
|
|
42
|
+
ref={ref}
|
|
43
|
+
className={cn(
|
|
44
|
+
"mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",
|
|
45
|
+
className
|
|
46
|
+
)}
|
|
47
|
+
{...props}
|
|
48
|
+
/>
|
|
49
|
+
))
|
|
50
|
+
TabsContent.displayName = TabsPrimitive.Content.displayName
|
|
51
|
+
|
|
52
|
+
export { Tabs, TabsList, TabsTrigger, TabsContent }
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
import * as React from "react"
|
|
2
|
+
import * as ToastPrimitives from "@radix-ui/react-toast"
|
|
3
|
+
import { cva, type VariantProps } from "class-variance-authority"
|
|
4
|
+
import { X } from "lucide-react"
|
|
5
|
+
|
|
6
|
+
import { cn } from "@/lib/utils"
|
|
7
|
+
|
|
8
|
+
const ToastProvider = ToastPrimitives.Provider
|
|
9
|
+
|
|
10
|
+
const ToastViewport = React.forwardRef<
|
|
11
|
+
React.ElementRef<typeof ToastPrimitives.Viewport>,
|
|
12
|
+
React.ComponentPropsWithoutRef<typeof ToastPrimitives.Viewport>
|
|
13
|
+
>(({ className, ...props }, ref) => (
|
|
14
|
+
<ToastPrimitives.Viewport
|
|
15
|
+
ref={ref}
|
|
16
|
+
className={cn(
|
|
17
|
+
"fixed top-0 z-[100] flex max-h-screen w-full flex-col-reverse p-4 sm:bottom-0 sm:right-0 sm:top-auto sm:flex-col md:max-w-[420px]",
|
|
18
|
+
className
|
|
19
|
+
)}
|
|
20
|
+
{...props}
|
|
21
|
+
/>
|
|
22
|
+
))
|
|
23
|
+
ToastViewport.displayName = ToastPrimitives.Viewport.displayName
|
|
24
|
+
|
|
25
|
+
const toastVariants = cva(
|
|
26
|
+
"group pointer-events-auto relative flex w-full items-center justify-between space-x-4 overflow-hidden rounded-md border p-6 pr-8 shadow-lg transition-all data-[swipe=cancel]:translate-x-0 data-[swipe=end]:translate-x-[var(--radix-toast-swipe-end-x)] data-[swipe=move]:translate-x-[var(--radix-toast-swipe-move-x)] data-[swipe=move]:transition-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[swipe=end]:animate-out data-[state=closed]:fade-out-80 data-[state=closed]:slide-out-to-right-full data-[state=open]:slide-in-from-top-full data-[state=open]:sm:slide-in-from-bottom-full",
|
|
27
|
+
{
|
|
28
|
+
variants: {
|
|
29
|
+
variant: {
|
|
30
|
+
default: "border bg-background text-foreground",
|
|
31
|
+
destructive:
|
|
32
|
+
"destructive group border-destructive bg-destructive text-destructive-foreground",
|
|
33
|
+
},
|
|
34
|
+
},
|
|
35
|
+
defaultVariants: {
|
|
36
|
+
variant: "default",
|
|
37
|
+
},
|
|
38
|
+
}
|
|
39
|
+
)
|
|
40
|
+
|
|
41
|
+
const Toast = React.forwardRef<
|
|
42
|
+
React.ElementRef<typeof ToastPrimitives.Root>,
|
|
43
|
+
React.ComponentPropsWithoutRef<typeof ToastPrimitives.Root> &
|
|
44
|
+
VariantProps<typeof toastVariants>
|
|
45
|
+
>(({ className, variant, ...props }, ref) => {
|
|
46
|
+
return (
|
|
47
|
+
<ToastPrimitives.Root
|
|
48
|
+
ref={ref}
|
|
49
|
+
className={cn(toastVariants({ variant }), className)}
|
|
50
|
+
{...props}
|
|
51
|
+
/>
|
|
52
|
+
)
|
|
53
|
+
})
|
|
54
|
+
Toast.displayName = ToastPrimitives.Root.displayName
|
|
55
|
+
|
|
56
|
+
const ToastAction = React.forwardRef<
|
|
57
|
+
React.ElementRef<typeof ToastPrimitives.Action>,
|
|
58
|
+
React.ComponentPropsWithoutRef<typeof ToastPrimitives.Action>
|
|
59
|
+
>(({ className, ...props }, ref) => (
|
|
60
|
+
<ToastPrimitives.Action
|
|
61
|
+
ref={ref}
|
|
62
|
+
className={cn(
|
|
63
|
+
"inline-flex h-8 shrink-0 items-center justify-center rounded-md border bg-transparent px-3 text-sm font-medium ring-offset-background transition-colors hover:bg-secondary focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 group-[.destructive]:border-muted/40 group-[.destructive]:hover:border-destructive/30 group-[.destructive]:hover:bg-destructive group-[.destructive]:hover:text-destructive-foreground group-[.destructive]:focus:ring-destructive",
|
|
64
|
+
className
|
|
65
|
+
)}
|
|
66
|
+
{...props}
|
|
67
|
+
/>
|
|
68
|
+
))
|
|
69
|
+
ToastAction.displayName = ToastPrimitives.Action.displayName
|
|
70
|
+
|
|
71
|
+
const ToastClose = React.forwardRef<
|
|
72
|
+
React.ElementRef<typeof ToastPrimitives.Close>,
|
|
73
|
+
React.ComponentPropsWithoutRef<typeof ToastPrimitives.Close>
|
|
74
|
+
>(({ className, ...props }, ref) => (
|
|
75
|
+
<ToastPrimitives.Close
|
|
76
|
+
ref={ref}
|
|
77
|
+
className={cn(
|
|
78
|
+
"absolute right-2 top-2 rounded-md p-1 text-foreground/50 opacity-0 transition-opacity hover:text-foreground focus:opacity-100 focus:outline-none focus:ring-2 group-hover:opacity-100 group-[.destructive]:text-red-300 group-[.destructive]:hover:text-red-50 group-[.destructive]:focus:ring-red-400 group-[.destructive]:focus:ring-offset-red-600",
|
|
79
|
+
className
|
|
80
|
+
)}
|
|
81
|
+
toast-close=""
|
|
82
|
+
{...props}
|
|
83
|
+
>
|
|
84
|
+
<X className="h-4 w-4" />
|
|
85
|
+
</ToastPrimitives.Close>
|
|
86
|
+
))
|
|
87
|
+
ToastClose.displayName = ToastPrimitives.Close.displayName
|
|
88
|
+
|
|
89
|
+
const ToastTitle = React.forwardRef<
|
|
90
|
+
React.ElementRef<typeof ToastPrimitives.Title>,
|
|
91
|
+
React.ComponentPropsWithoutRef<typeof ToastPrimitives.Title>
|
|
92
|
+
>(({ className, ...props }, ref) => (
|
|
93
|
+
<ToastPrimitives.Title
|
|
94
|
+
ref={ref}
|
|
95
|
+
className={cn("text-sm font-semibold", className)}
|
|
96
|
+
{...props}
|
|
97
|
+
/>
|
|
98
|
+
))
|
|
99
|
+
ToastTitle.displayName = ToastPrimitives.Title.displayName
|
|
100
|
+
|
|
101
|
+
const ToastDescription = React.forwardRef<
|
|
102
|
+
React.ElementRef<typeof ToastPrimitives.Description>,
|
|
103
|
+
React.ComponentPropsWithoutRef<typeof ToastPrimitives.Description>
|
|
104
|
+
>(({ className, ...props }, ref) => (
|
|
105
|
+
<ToastPrimitives.Description
|
|
106
|
+
ref={ref}
|
|
107
|
+
className={cn("text-sm opacity-90", className)}
|
|
108
|
+
{...props}
|
|
109
|
+
/>
|
|
110
|
+
))
|
|
111
|
+
ToastDescription.displayName = ToastPrimitives.Description.displayName
|
|
112
|
+
|
|
113
|
+
type ToastProps = React.ComponentPropsWithoutRef<typeof Toast>
|
|
114
|
+
|
|
115
|
+
type ToastActionElement = React.ReactElement<typeof ToastAction>
|
|
116
|
+
|
|
117
|
+
export {
|
|
118
|
+
type ToastProps,
|
|
119
|
+
type ToastActionElement,
|
|
120
|
+
ToastProvider,
|
|
121
|
+
ToastViewport,
|
|
122
|
+
Toast,
|
|
123
|
+
ToastTitle,
|
|
124
|
+
ToastDescription,
|
|
125
|
+
ToastClose,
|
|
126
|
+
ToastAction,
|
|
127
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { useToast } from "@/hooks/use-toast"
|
|
2
|
+
import {
|
|
3
|
+
Toast,
|
|
4
|
+
ToastClose,
|
|
5
|
+
ToastDescription,
|
|
6
|
+
ToastProvider,
|
|
7
|
+
ToastTitle,
|
|
8
|
+
ToastViewport,
|
|
9
|
+
} from "@/components/ui/toast"
|
|
10
|
+
|
|
11
|
+
export function Toaster() {
|
|
12
|
+
const { toasts } = useToast()
|
|
13
|
+
|
|
14
|
+
return (
|
|
15
|
+
<ToastProvider>
|
|
16
|
+
{toasts.map(function ({ id, title, description, action, ...props }) {
|
|
17
|
+
return (
|
|
18
|
+
<Toast key={id} {...props}>
|
|
19
|
+
<div className="grid gap-1">
|
|
20
|
+
{title && <ToastTitle>{title}</ToastTitle>}
|
|
21
|
+
{description && (
|
|
22
|
+
<ToastDescription>{description}</ToastDescription>
|
|
23
|
+
)}
|
|
24
|
+
</div>
|
|
25
|
+
{action}
|
|
26
|
+
<ToastClose />
|
|
27
|
+
</Toast>
|
|
28
|
+
)
|
|
29
|
+
})}
|
|
30
|
+
<ToastViewport />
|
|
31
|
+
</ToastProvider>
|
|
32
|
+
)
|
|
33
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import * as React from "react"
|
|
2
|
+
import * as TooltipPrimitive from "@radix-ui/react-tooltip"
|
|
3
|
+
|
|
4
|
+
import { cn } from "@/lib/utils"
|
|
5
|
+
|
|
6
|
+
const TooltipProvider = TooltipPrimitive.Provider
|
|
7
|
+
|
|
8
|
+
const Tooltip = TooltipPrimitive.Root
|
|
9
|
+
|
|
10
|
+
const TooltipTrigger = TooltipPrimitive.Trigger
|
|
11
|
+
|
|
12
|
+
const TooltipContent = React.forwardRef<
|
|
13
|
+
React.ElementRef<typeof TooltipPrimitive.Content>,
|
|
14
|
+
React.ComponentPropsWithoutRef<typeof TooltipPrimitive.Content>
|
|
15
|
+
>(({ className, sideOffset = 4, ...props }, ref) => (
|
|
16
|
+
<TooltipPrimitive.Content
|
|
17
|
+
ref={ref}
|
|
18
|
+
sideOffset={sideOffset}
|
|
19
|
+
className={cn(
|
|
20
|
+
"z-50 overflow-hidden rounded-md border bg-popover px-3 py-1.5 text-sm text-popover-foreground shadow-md animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",
|
|
21
|
+
className
|
|
22
|
+
)}
|
|
23
|
+
{...props}
|
|
24
|
+
/>
|
|
25
|
+
))
|
|
26
|
+
TooltipContent.displayName = TooltipPrimitive.Content.displayName
|
|
27
|
+
|
|
28
|
+
export { Tooltip, TooltipTrigger, TooltipContent, TooltipProvider }
|
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
import * as React from "react"
|
|
2
|
+
import { ListPage } from "@/components/layouts/list-page"
|
|
3
|
+
import { MetricCard } from "@/components/ui/metric-card"
|
|
4
|
+
import { DataTable, type DataTableColumn } from "@/components/ui/data-table"
|
|
5
|
+
import { EntityCard } from "@/components/ui/entity-card"
|
|
6
|
+
import { AccountCard } from "@/components/ui/account-card"
|
|
7
|
+
import { ResponsiveGrid } from "@/components/ui/responsive-grid"
|
|
8
|
+
import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card"
|
|
9
|
+
import { Badge } from "@/components/ui/badge"
|
|
10
|
+
import { mockMetrics, mockTableData, mockCounterparties, mockAccounts } from "@/lib/mock-data"
|
|
11
|
+
import { Plus, Download, TrendingUp } from "lucide-react"
|
|
12
|
+
|
|
13
|
+
const recentTransactions = [
|
|
14
|
+
{
|
|
15
|
+
id: "1",
|
|
16
|
+
recipient: "Acme Corporation",
|
|
17
|
+
amount: "$25,000",
|
|
18
|
+
type: "Wire Transfer",
|
|
19
|
+
status: "completed",
|
|
20
|
+
date: "2024-01-20"
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
id: "2",
|
|
24
|
+
recipient: "Global Tech LLC",
|
|
25
|
+
amount: "$12,500",
|
|
26
|
+
type: "ACH Transfer",
|
|
27
|
+
status: "pending",
|
|
28
|
+
date: "2024-01-20"
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
id: "3",
|
|
32
|
+
recipient: "John Smith",
|
|
33
|
+
amount: "$3,200",
|
|
34
|
+
type: "Wire Transfer",
|
|
35
|
+
status: "completed",
|
|
36
|
+
date: "2024-01-19"
|
|
37
|
+
}
|
|
38
|
+
]
|
|
39
|
+
|
|
40
|
+
const transactionColumns: DataTableColumn[] = [
|
|
41
|
+
{ key: "recipient", title: "Recipient", sortable: true },
|
|
42
|
+
{ key: "amount", title: "Amount", sortable: true, align: "right" },
|
|
43
|
+
{ key: "type", title: "Type", sortable: true },
|
|
44
|
+
{
|
|
45
|
+
key: "status",
|
|
46
|
+
title: "Status",
|
|
47
|
+
sortable: true,
|
|
48
|
+
render: (value) => <Badge variant={value === "completed" ? "success" : "warning"}>{value}</Badge>
|
|
49
|
+
},
|
|
50
|
+
{ key: "date", title: "Date", sortable: true }
|
|
51
|
+
]
|
|
52
|
+
|
|
53
|
+
export function DashboardDemo() {
|
|
54
|
+
const [sortBy, setSortBy] = React.useState<string>()
|
|
55
|
+
const [sortDirection, setSortDirection] = React.useState<"asc" | "desc">("asc")
|
|
56
|
+
|
|
57
|
+
const handleSort = (key: string) => {
|
|
58
|
+
if (sortBy === key) {
|
|
59
|
+
setSortDirection(sortDirection === "asc" ? "desc" : "asc")
|
|
60
|
+
} else {
|
|
61
|
+
setSortBy(key)
|
|
62
|
+
setSortDirection("asc")
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
const breadcrumbs = [
|
|
67
|
+
{ label: "UI Kit", href: "/ui-kit" },
|
|
68
|
+
{ label: "Dashboard Demo" }
|
|
69
|
+
]
|
|
70
|
+
|
|
71
|
+
const actions = [
|
|
72
|
+
{
|
|
73
|
+
label: "Export Report",
|
|
74
|
+
onClick: () => console.log("Export"),
|
|
75
|
+
variant: "outline" as const,
|
|
76
|
+
icon: <Download className="w-4 h-4" />
|
|
77
|
+
},
|
|
78
|
+
{
|
|
79
|
+
label: "New Transfer",
|
|
80
|
+
onClick: () => console.log("New Transfer"),
|
|
81
|
+
icon: <Plus className="w-4 h-4" />
|
|
82
|
+
}
|
|
83
|
+
]
|
|
84
|
+
|
|
85
|
+
return (
|
|
86
|
+
<ListPage
|
|
87
|
+
title="Financial Dashboard"
|
|
88
|
+
description="Comprehensive overview of accounts, transfers, and business metrics"
|
|
89
|
+
breadcrumbs={breadcrumbs}
|
|
90
|
+
actions={actions}
|
|
91
|
+
maxWidth="xl"
|
|
92
|
+
>
|
|
93
|
+
{/* Metrics Overview */}
|
|
94
|
+
<ResponsiveGrid type="cards" gap="md">
|
|
95
|
+
{mockMetrics.map((metric, index) => (
|
|
96
|
+
<MetricCard key={index} {...metric} />
|
|
97
|
+
))}
|
|
98
|
+
</ResponsiveGrid>
|
|
99
|
+
|
|
100
|
+
{/* Account Cards */}
|
|
101
|
+
<Card>
|
|
102
|
+
<CardHeader>
|
|
103
|
+
<div className="flex items-center justify-between">
|
|
104
|
+
<CardTitle>Account Overview</CardTitle>
|
|
105
|
+
<Badge variant="secondary" className="flex items-center gap-1">
|
|
106
|
+
<TrendingUp className="w-3 h-3" />
|
|
107
|
+
3 Active Accounts
|
|
108
|
+
</Badge>
|
|
109
|
+
</div>
|
|
110
|
+
</CardHeader>
|
|
111
|
+
<CardContent>
|
|
112
|
+
<ResponsiveGrid type="cards" gap="md">
|
|
113
|
+
{mockAccounts.map((account) => (
|
|
114
|
+
<AccountCard key={account.id} account={account} />
|
|
115
|
+
))}
|
|
116
|
+
</ResponsiveGrid>
|
|
117
|
+
</CardContent>
|
|
118
|
+
</Card>
|
|
119
|
+
|
|
120
|
+
{/* Recent Transactions */}
|
|
121
|
+
<Card>
|
|
122
|
+
<CardHeader>
|
|
123
|
+
<CardTitle>Recent Transactions</CardTitle>
|
|
124
|
+
</CardHeader>
|
|
125
|
+
<CardContent>
|
|
126
|
+
<DataTable
|
|
127
|
+
columns={transactionColumns}
|
|
128
|
+
data={recentTransactions}
|
|
129
|
+
sortBy={sortBy}
|
|
130
|
+
sortDirection={sortDirection}
|
|
131
|
+
onSort={handleSort}
|
|
132
|
+
/>
|
|
133
|
+
</CardContent>
|
|
134
|
+
</Card>
|
|
135
|
+
|
|
136
|
+
{/* Recent Counterparties */}
|
|
137
|
+
<Card>
|
|
138
|
+
<CardHeader>
|
|
139
|
+
<CardTitle>Recent Counterparties</CardTitle>
|
|
140
|
+
</CardHeader>
|
|
141
|
+
<CardContent>
|
|
142
|
+
<ResponsiveGrid type="cards" gap="md">
|
|
143
|
+
{mockCounterparties.slice(0, 4).map((entity) => (
|
|
144
|
+
<EntityCard
|
|
145
|
+
key={entity.id}
|
|
146
|
+
entity={entity}
|
|
147
|
+
onView={(id) => console.log("View", id)}
|
|
148
|
+
onEdit={(id) => console.log("Edit", id)}
|
|
149
|
+
/>
|
|
150
|
+
))}
|
|
151
|
+
</ResponsiveGrid>
|
|
152
|
+
</CardContent>
|
|
153
|
+
</Card>
|
|
154
|
+
</ListPage>
|
|
155
|
+
)
|
|
156
|
+
}
|