@payglocal_ui/flux-ui 0.1.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/package.json +72 -0
- package/src/accordion.tsx +68 -0
- package/src/alert.tsx +107 -0
- package/src/avatar-group.tsx +96 -0
- package/src/avatar-tag.tsx +136 -0
- package/src/avatar.tsx +39 -0
- package/src/badge.tsx +98 -0
- package/src/blanket.tsx +61 -0
- package/src/breadcrumb.tsx +119 -0
- package/src/button-group.tsx +218 -0
- package/src/button.tsx +83 -0
- package/src/calendar.tsx +227 -0
- package/src/callout.tsx +68 -0
- package/src/card.tsx +103 -0
- package/src/chart-templates.tsx +587 -0
- package/src/chart.tsx +379 -0
- package/src/checkbox-select.tsx +239 -0
- package/src/checkbox.tsx +54 -0
- package/src/code.tsx +154 -0
- package/src/command.tsx +77 -0
- package/src/country-select.tsx +242 -0
- package/src/currency-amount-input.tsx +72 -0
- package/src/data-table.tsx +378 -0
- package/src/date-picker.tsx +317 -0
- package/src/dialog.tsx +81 -0
- package/src/drawer.tsx +91 -0
- package/src/dropdown-menu.tsx +174 -0
- package/src/empty-state.tsx +32 -0
- package/src/field.tsx +243 -0
- package/src/flag.tsx +265 -0
- package/src/form.tsx +168 -0
- package/src/grid-flex.tsx +241 -0
- package/src/heading.tsx +202 -0
- package/src/icon-button.tsx +93 -0
- package/src/index.ts +332 -0
- package/src/inline-dialog.tsx +153 -0
- package/src/inline-edit.tsx +212 -0
- package/src/input-group.tsx +151 -0
- package/src/input.tsx +28 -0
- package/src/label.tsx +21 -0
- package/src/layout.tsx +119 -0
- package/src/link.tsx +80 -0
- package/src/lozenge.tsx +61 -0
- package/src/menu.tsx +146 -0
- package/src/otp-input.tsx +117 -0
- package/src/page-header.tsx +28 -0
- package/src/pagination.tsx +185 -0
- package/src/password-input.tsx +34 -0
- package/src/popover.tsx +31 -0
- package/src/progress-indicator.tsx +94 -0
- package/src/progress.tsx +95 -0
- package/src/radio-group.tsx +46 -0
- package/src/responsive.tsx +276 -0
- package/src/scroll-area.tsx +39 -0
- package/src/section-message.tsx +119 -0
- package/src/select.tsx +144 -0
- package/src/separator.tsx +26 -0
- package/src/side-nav.tsx +264 -0
- package/src/skeleton.tsx +74 -0
- package/src/slider.tsx +25 -0
- package/src/sonner.tsx +32 -0
- package/src/spinner.tsx +54 -0
- package/src/spotlight.tsx +141 -0
- package/src/status-badge.tsx +86 -0
- package/src/switch.tsx +70 -0
- package/src/tabs.tsx +57 -0
- package/src/tag.tsx +52 -0
- package/src/textarea.tsx +25 -0
- package/src/time-picker.tsx +443 -0
- package/src/tooltip.tsx +29 -0
- package/src/utils.ts +6 -0
- package/src/visually-hidden.tsx +25 -0
package/src/callout.tsx
ADDED
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { Info, CheckCircle2, AlertTriangle, XCircle, Sparkles } from "lucide-react";
|
|
3
|
+
import { cn } from "./utils";
|
|
4
|
+
|
|
5
|
+
export type CalloutVariant = "info" | "success" | "warning" | "error" | "neutral" | "discovery";
|
|
6
|
+
|
|
7
|
+
export interface CalloutProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
8
|
+
variant?: CalloutVariant;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
const variantStyles: Record<CalloutVariant, string> = {
|
|
12
|
+
info: "bg-blue-50 border-blue-200 text-blue-900 dark:bg-blue-950/30 dark:border-blue-800 dark:text-blue-200",
|
|
13
|
+
success: "bg-green-50 border-green-200 text-green-900 dark:bg-green-950/30 dark:border-green-800 dark:text-green-200",
|
|
14
|
+
warning: "bg-amber-50 border-amber-200 text-amber-900 dark:bg-amber-950/30 dark:border-amber-800 dark:text-amber-200",
|
|
15
|
+
error: "bg-red-50 border-red-200 text-red-900 dark:bg-red-950/30 dark:border-red-800 dark:text-red-200",
|
|
16
|
+
neutral: "bg-muted border-border text-foreground",
|
|
17
|
+
discovery: "bg-purple-50 border-purple-200 text-purple-900 dark:bg-purple-950/30 dark:border-purple-800 dark:text-purple-200",
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
const variantIcons: Record<CalloutVariant, React.ElementType> = {
|
|
21
|
+
info: Info,
|
|
22
|
+
success: CheckCircle2,
|
|
23
|
+
warning: AlertTriangle,
|
|
24
|
+
error: XCircle,
|
|
25
|
+
neutral: Info,
|
|
26
|
+
discovery: Sparkles,
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
const Callout = React.forwardRef<HTMLDivElement, CalloutProps>(
|
|
30
|
+
({ className, variant = "info", children, ...props }, ref) => (
|
|
31
|
+
<div ref={ref} className={cn("flex gap-3 rounded-xl border p-4", variantStyles[variant], className)} {...props}>
|
|
32
|
+
{children}
|
|
33
|
+
</div>
|
|
34
|
+
)
|
|
35
|
+
);
|
|
36
|
+
Callout.displayName = "Callout";
|
|
37
|
+
|
|
38
|
+
interface CalloutIconProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
39
|
+
variant?: CalloutVariant;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
const CalloutIcon = React.forwardRef<HTMLDivElement, CalloutIconProps>(
|
|
43
|
+
({ className, variant = "info", ...props }, ref) => {
|
|
44
|
+
const Icon = variantIcons[variant];
|
|
45
|
+
return (
|
|
46
|
+
<div ref={ref} className={cn("mt-0.5 shrink-0", className)} {...props}>
|
|
47
|
+
<Icon className="size-4" aria-hidden />
|
|
48
|
+
</div>
|
|
49
|
+
);
|
|
50
|
+
}
|
|
51
|
+
);
|
|
52
|
+
CalloutIcon.displayName = "CalloutIcon";
|
|
53
|
+
|
|
54
|
+
const CalloutTitle = React.forwardRef<HTMLParagraphElement, React.HTMLAttributes<HTMLParagraphElement>>(
|
|
55
|
+
({ className, ...props }, ref) => (
|
|
56
|
+
<p ref={ref} className={cn("text-sm font-semibold", className)} {...props} />
|
|
57
|
+
)
|
|
58
|
+
);
|
|
59
|
+
CalloutTitle.displayName = "CalloutTitle";
|
|
60
|
+
|
|
61
|
+
const CalloutText = React.forwardRef<HTMLParagraphElement, React.HTMLAttributes<HTMLParagraphElement>>(
|
|
62
|
+
({ className, ...props }, ref) => (
|
|
63
|
+
<p ref={ref} className={cn("mt-1 text-sm opacity-90 leading-relaxed", className)} {...props} />
|
|
64
|
+
)
|
|
65
|
+
);
|
|
66
|
+
CalloutText.displayName = "CalloutText";
|
|
67
|
+
|
|
68
|
+
export { Callout, CalloutIcon, CalloutTitle, CalloutText };
|
package/src/card.tsx
ADDED
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { cva, type VariantProps } from "class-variance-authority";
|
|
3
|
+
|
|
4
|
+
import { cn } from "./utils";
|
|
5
|
+
|
|
6
|
+
const cardVariants = cva("flex flex-col rounded-xl border border-border bg-card text-card-foreground shadow-sm", {
|
|
7
|
+
variants: {
|
|
8
|
+
size: {
|
|
9
|
+
default: "gap-10 px-10 py-10",
|
|
10
|
+
sm: "gap-6 px-7 py-7",
|
|
11
|
+
},
|
|
12
|
+
},
|
|
13
|
+
defaultVariants: {
|
|
14
|
+
size: "default",
|
|
15
|
+
},
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
function Card({
|
|
19
|
+
className,
|
|
20
|
+
size,
|
|
21
|
+
...props
|
|
22
|
+
}: React.ComponentProps<"div"> & VariantProps<typeof cardVariants>) {
|
|
23
|
+
return (
|
|
24
|
+
<div
|
|
25
|
+
data-slot="card"
|
|
26
|
+
className={cn(cardVariants({ size }), className)}
|
|
27
|
+
{...props}
|
|
28
|
+
/>
|
|
29
|
+
);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
function CardHeader({ className, ...props }: React.ComponentProps<"div">) {
|
|
33
|
+
return (
|
|
34
|
+
<div
|
|
35
|
+
data-slot="card-header"
|
|
36
|
+
className={cn(
|
|
37
|
+
"@container/card-header grid auto-rows-min grid-rows-[auto_auto] items-start gap-4 px-0 has-data-[slot=card-action]:grid-cols-[1fr_auto] [.border-b]:pb-6",
|
|
38
|
+
className
|
|
39
|
+
)}
|
|
40
|
+
{...props}
|
|
41
|
+
/>
|
|
42
|
+
);
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
function CardTitle({ className, ...props }: React.ComponentProps<"div">) {
|
|
46
|
+
return (
|
|
47
|
+
<div
|
|
48
|
+
data-slot="card-title"
|
|
49
|
+
className={cn("text-lg font-semibold leading-snug tracking-tight", className)}
|
|
50
|
+
{...props}
|
|
51
|
+
/>
|
|
52
|
+
);
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
function CardDescription({ className, ...props }: React.ComponentProps<"div">) {
|
|
56
|
+
return (
|
|
57
|
+
<div
|
|
58
|
+
data-slot="card-description"
|
|
59
|
+
className={cn("text-sm leading-relaxed text-muted-foreground", className)}
|
|
60
|
+
{...props}
|
|
61
|
+
/>
|
|
62
|
+
);
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
function CardAction({ className, ...props }: React.ComponentProps<"div">) {
|
|
66
|
+
return (
|
|
67
|
+
<div
|
|
68
|
+
data-slot="card-action"
|
|
69
|
+
className={cn(
|
|
70
|
+
"col-start-2 row-span-2 row-start-1 self-start justify-self-end",
|
|
71
|
+
className
|
|
72
|
+
)}
|
|
73
|
+
{...props}
|
|
74
|
+
/>
|
|
75
|
+
);
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
function CardContent({ className, ...props }: React.ComponentProps<"div">) {
|
|
79
|
+
return <div data-slot="card-content" className={cn("px-0", className)} {...props} />;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
function CardFooter({ className, ...props }: React.ComponentProps<"div">) {
|
|
83
|
+
return (
|
|
84
|
+
<div
|
|
85
|
+
data-slot="card-footer"
|
|
86
|
+
className={cn(
|
|
87
|
+
"flex flex-wrap items-center gap-3 border-t border-border px-0 pt-8 pb-0 sm:gap-4",
|
|
88
|
+
className
|
|
89
|
+
)}
|
|
90
|
+
{...props}
|
|
91
|
+
/>
|
|
92
|
+
);
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
export {
|
|
96
|
+
Card,
|
|
97
|
+
CardHeader,
|
|
98
|
+
CardFooter,
|
|
99
|
+
CardTitle,
|
|
100
|
+
CardAction,
|
|
101
|
+
CardDescription,
|
|
102
|
+
CardContent,
|
|
103
|
+
};
|