@oppulence/design-system 1.0.2
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 +115 -0
- package/components.json +21 -0
- package/hooks/use-mobile.tsx +21 -0
- package/lib/utils.ts +6 -0
- package/package.json +104 -0
- package/postcss.config.mjs +8 -0
- package/src/components/atoms/aspect-ratio.tsx +21 -0
- package/src/components/atoms/avatar.tsx +91 -0
- package/src/components/atoms/badge.tsx +47 -0
- package/src/components/atoms/button.tsx +128 -0
- package/src/components/atoms/checkbox.tsx +24 -0
- package/src/components/atoms/container.tsx +42 -0
- package/src/components/atoms/heading.tsx +56 -0
- package/src/components/atoms/index.ts +21 -0
- package/src/components/atoms/input.tsx +18 -0
- package/src/components/atoms/kbd.tsx +23 -0
- package/src/components/atoms/label.tsx +15 -0
- package/src/components/atoms/logo.tsx +52 -0
- package/src/components/atoms/progress.tsx +79 -0
- package/src/components/atoms/separator.tsx +17 -0
- package/src/components/atoms/skeleton.tsx +13 -0
- package/src/components/atoms/slider.tsx +56 -0
- package/src/components/atoms/spinner.tsx +14 -0
- package/src/components/atoms/stack.tsx +126 -0
- package/src/components/atoms/switch.tsx +26 -0
- package/src/components/atoms/text.tsx +69 -0
- package/src/components/atoms/textarea.tsx +19 -0
- package/src/components/atoms/toggle.tsx +40 -0
- package/src/components/molecules/accordion.tsx +72 -0
- package/src/components/molecules/ai-chat.tsx +251 -0
- package/src/components/molecules/alert.tsx +131 -0
- package/src/components/molecules/breadcrumb.tsx +301 -0
- package/src/components/molecules/button-group.tsx +96 -0
- package/src/components/molecules/card.tsx +184 -0
- package/src/components/molecules/collapsible.tsx +21 -0
- package/src/components/molecules/command-search.tsx +148 -0
- package/src/components/molecules/empty.tsx +98 -0
- package/src/components/molecules/field.tsx +217 -0
- package/src/components/molecules/grid.tsx +141 -0
- package/src/components/molecules/hover-card.tsx +45 -0
- package/src/components/molecules/index.ts +29 -0
- package/src/components/molecules/input-group.tsx +151 -0
- package/src/components/molecules/input-otp.tsx +74 -0
- package/src/components/molecules/item.tsx +194 -0
- package/src/components/molecules/page-header.tsx +89 -0
- package/src/components/molecules/pagination.tsx +130 -0
- package/src/components/molecules/popover.tsx +96 -0
- package/src/components/molecules/radio-group.tsx +37 -0
- package/src/components/molecules/resizable.tsx +52 -0
- package/src/components/molecules/scroll-area.tsx +45 -0
- package/src/components/molecules/section.tsx +108 -0
- package/src/components/molecules/select.tsx +201 -0
- package/src/components/molecules/settings.tsx +197 -0
- package/src/components/molecules/table.tsx +111 -0
- package/src/components/molecules/tabs.tsx +74 -0
- package/src/components/molecules/theme-switcher.tsx +187 -0
- package/src/components/molecules/toggle-group.tsx +89 -0
- package/src/components/molecules/tooltip.tsx +66 -0
- package/src/components/organisms/alert-dialog.tsx +152 -0
- package/src/components/organisms/app-shell.tsx +939 -0
- package/src/components/organisms/calendar.tsx +212 -0
- package/src/components/organisms/carousel.tsx +230 -0
- package/src/components/organisms/chart.tsx +333 -0
- package/src/components/organisms/combobox.tsx +274 -0
- package/src/components/organisms/command.tsx +200 -0
- package/src/components/organisms/context-menu.tsx +229 -0
- package/src/components/organisms/dialog.tsx +134 -0
- package/src/components/organisms/drawer.tsx +123 -0
- package/src/components/organisms/dropdown-menu.tsx +256 -0
- package/src/components/organisms/index.ts +17 -0
- package/src/components/organisms/menubar.tsx +203 -0
- package/src/components/organisms/navigation-menu.tsx +143 -0
- package/src/components/organisms/page-layout.tsx +105 -0
- package/src/components/organisms/sheet.tsx +126 -0
- package/src/components/organisms/sidebar.tsx +723 -0
- package/src/components/organisms/sonner.tsx +41 -0
- package/src/components/ui/index.ts +3 -0
- package/src/index.ts +3 -0
- package/src/styles/globals.css +297 -0
- package/tailwind.config.ts +77 -0
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
import { cva, type VariantProps } from "class-variance-authority";
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
|
|
4
|
+
import { cn } from "../../../lib/utils";
|
|
5
|
+
import { Stack } from "../atoms/stack";
|
|
6
|
+
|
|
7
|
+
const pageLayoutVariants = cva("min-h-dvh bg-background text-foreground", {
|
|
8
|
+
variants: {
|
|
9
|
+
variant: {
|
|
10
|
+
default: "flex flex-col",
|
|
11
|
+
center: "flex items-center justify-center",
|
|
12
|
+
},
|
|
13
|
+
padding: {
|
|
14
|
+
none: "",
|
|
15
|
+
sm: "px-4 py-6",
|
|
16
|
+
default: "px-4 py-10 sm:px-6 lg:px-8",
|
|
17
|
+
lg: "px-6 py-12 sm:px-8 lg:px-12",
|
|
18
|
+
},
|
|
19
|
+
},
|
|
20
|
+
defaultVariants: {
|
|
21
|
+
variant: "default",
|
|
22
|
+
padding: "default",
|
|
23
|
+
},
|
|
24
|
+
});
|
|
25
|
+
|
|
26
|
+
const containerVariants = cva("mx-auto w-full", {
|
|
27
|
+
variants: {
|
|
28
|
+
maxWidth: {
|
|
29
|
+
sm: "max-w-screen-sm", // 640px
|
|
30
|
+
md: "max-w-screen-md", // 768px
|
|
31
|
+
lg: "max-w-screen-lg", // 1024px
|
|
32
|
+
xl: "max-w-[1200px]",
|
|
33
|
+
"2xl": "max-w-[1400px]",
|
|
34
|
+
},
|
|
35
|
+
},
|
|
36
|
+
defaultVariants: {
|
|
37
|
+
maxWidth: "xl",
|
|
38
|
+
},
|
|
39
|
+
});
|
|
40
|
+
|
|
41
|
+
interface PageLayoutProps
|
|
42
|
+
extends
|
|
43
|
+
Omit<React.ComponentProps<"div">, "className" | "children">,
|
|
44
|
+
VariantProps<typeof pageLayoutVariants> {
|
|
45
|
+
children?: React.ReactNode;
|
|
46
|
+
/** Whether to wrap content in a centered container. Defaults to true. */
|
|
47
|
+
container?: boolean;
|
|
48
|
+
/** Max width of the container. Only applies when container is true. */
|
|
49
|
+
maxWidth?: "sm" | "md" | "lg" | "xl" | "2xl";
|
|
50
|
+
/** Vertical gap between children. Defaults to 'lg' (gap-6). */
|
|
51
|
+
gap?:
|
|
52
|
+
| "none"
|
|
53
|
+
| "xs"
|
|
54
|
+
| "sm"
|
|
55
|
+
| "md"
|
|
56
|
+
| "lg"
|
|
57
|
+
| "xl"
|
|
58
|
+
| "0"
|
|
59
|
+
| "1"
|
|
60
|
+
| "2"
|
|
61
|
+
| "3"
|
|
62
|
+
| "4"
|
|
63
|
+
| "6"
|
|
64
|
+
| "8";
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
function PageLayout({
|
|
68
|
+
variant,
|
|
69
|
+
padding,
|
|
70
|
+
container = true,
|
|
71
|
+
maxWidth,
|
|
72
|
+
gap = "lg",
|
|
73
|
+
children,
|
|
74
|
+
...props
|
|
75
|
+
}: PageLayoutProps) {
|
|
76
|
+
// For center variant, default to smaller max-width (sm) for auth-style pages
|
|
77
|
+
const resolvedMaxWidth = maxWidth ?? (variant === "center" ? "sm" : "lg");
|
|
78
|
+
|
|
79
|
+
const content = <Stack gap={gap}>{children}</Stack>;
|
|
80
|
+
|
|
81
|
+
return (
|
|
82
|
+
<div
|
|
83
|
+
data-slot="page-layout"
|
|
84
|
+
data-variant={variant}
|
|
85
|
+
className={pageLayoutVariants({ variant, padding })}
|
|
86
|
+
{...props}
|
|
87
|
+
>
|
|
88
|
+
{container ? (
|
|
89
|
+
<div
|
|
90
|
+
data-slot="page-layout-container"
|
|
91
|
+
className={cn(
|
|
92
|
+
containerVariants({ maxWidth: resolvedMaxWidth }),
|
|
93
|
+
variant === "center" && "flex items-center justify-center",
|
|
94
|
+
)}
|
|
95
|
+
>
|
|
96
|
+
{content}
|
|
97
|
+
</div>
|
|
98
|
+
) : (
|
|
99
|
+
content
|
|
100
|
+
)}
|
|
101
|
+
</div>
|
|
102
|
+
);
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
export { PageLayout, pageLayoutVariants };
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
import { Dialog as SheetPrimitive } from "@base-ui/react/dialog";
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
|
|
4
|
+
import { XIcon } from "lucide-react";
|
|
5
|
+
import { Button } from "../atoms/button";
|
|
6
|
+
|
|
7
|
+
function Sheet({ ...props }: SheetPrimitive.Root.Props) {
|
|
8
|
+
return <SheetPrimitive.Root data-slot="sheet" {...props} />;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
function SheetTrigger({ ...props }: SheetPrimitive.Trigger.Props) {
|
|
12
|
+
return <SheetPrimitive.Trigger data-slot="sheet-trigger" {...props} />;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
function SheetClose({ ...props }: SheetPrimitive.Close.Props) {
|
|
16
|
+
return <SheetPrimitive.Close data-slot="sheet-close" {...props} />;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
function SheetPortal({ ...props }: SheetPrimitive.Portal.Props) {
|
|
20
|
+
return <SheetPrimitive.Portal data-slot="sheet-portal" {...props} />;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
function SheetOverlay({
|
|
24
|
+
...props
|
|
25
|
+
}: Omit<SheetPrimitive.Backdrop.Props, "className">) {
|
|
26
|
+
return (
|
|
27
|
+
<SheetPrimitive.Backdrop
|
|
28
|
+
data-slot="sheet-overlay"
|
|
29
|
+
className="data-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0 bg-black/10 duration-100 data-ending-style:opacity-0 data-starting-style:opacity-0 supports-backdrop-filter:backdrop-blur-xs fixed inset-0 z-50"
|
|
30
|
+
{...props}
|
|
31
|
+
/>
|
|
32
|
+
);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
function SheetContent({
|
|
36
|
+
children,
|
|
37
|
+
side = "right",
|
|
38
|
+
showCloseButton = true,
|
|
39
|
+
...props
|
|
40
|
+
}: Omit<SheetPrimitive.Popup.Props, "className"> & {
|
|
41
|
+
side?: "top" | "right" | "bottom" | "left";
|
|
42
|
+
showCloseButton?: boolean;
|
|
43
|
+
}) {
|
|
44
|
+
return (
|
|
45
|
+
<SheetPortal>
|
|
46
|
+
<SheetOverlay />
|
|
47
|
+
<SheetPrimitive.Popup
|
|
48
|
+
data-slot="sheet-content"
|
|
49
|
+
data-side={side}
|
|
50
|
+
className="bg-background data-open:animate-in data-closed:animate-out data-[side=right]:data-closed:slide-out-to-right-10 data-[side=right]:data-open:slide-in-from-right-10 data-[side=left]:data-closed:slide-out-to-left-10 data-[side=left]:data-open:slide-in-from-left-10 data-[side=top]:data-closed:slide-out-to-top-10 data-[side=top]:data-open:slide-in-from-top-10 data-closed:fade-out-0 data-open:fade-in-0 data-[side=bottom]:data-closed:slide-out-to-bottom-10 data-[side=bottom]:data-open:slide-in-from-bottom-10 fixed z-50 flex flex-col gap-4 px-4 bg-clip-padding text-sm shadow-lg transition duration-200 ease-in-out data-[side=bottom]:inset-x-0 data-[side=bottom]:bottom-0 data-[side=bottom]:h-auto data-[side=bottom]:border-t data-[side=left]:inset-y-0 data-[side=left]:left-0 data-[side=left]:h-full data-[side=left]:w-3/4 data-[side=left]:border-r data-[side=right]:inset-y-0 data-[side=right]:right-0 data-[side=right]:h-full data-[side=right]:w-3/4 data-[side=right]:border-l data-[side=top]:inset-x-0 data-[side=top]:top-0 data-[side=top]:h-auto data-[side=top]:border-b data-[side=left]:sm:max-w-sm data-[side=right]:sm:max-w-sm"
|
|
51
|
+
{...props}
|
|
52
|
+
>
|
|
53
|
+
{children}
|
|
54
|
+
{showCloseButton && (
|
|
55
|
+
<SheetPrimitive.Close
|
|
56
|
+
data-slot="sheet-close"
|
|
57
|
+
render={<Button variant="ghost" size="icon-sm" />}
|
|
58
|
+
className="absolute top-4 right-4"
|
|
59
|
+
>
|
|
60
|
+
<XIcon className="size-4" />
|
|
61
|
+
<span className="sr-only">Close</span>
|
|
62
|
+
</SheetPrimitive.Close>
|
|
63
|
+
)}
|
|
64
|
+
</SheetPrimitive.Popup>
|
|
65
|
+
</SheetPortal>
|
|
66
|
+
);
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
function SheetHeader({
|
|
70
|
+
...props
|
|
71
|
+
}: Omit<React.ComponentProps<"div">, "className">) {
|
|
72
|
+
return (
|
|
73
|
+
<div
|
|
74
|
+
data-slot="sheet-header"
|
|
75
|
+
className="gap-0.5 pt-4 flex flex-col"
|
|
76
|
+
{...props}
|
|
77
|
+
/>
|
|
78
|
+
);
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
function SheetFooter({
|
|
82
|
+
...props
|
|
83
|
+
}: Omit<React.ComponentProps<"div">, "className">) {
|
|
84
|
+
return (
|
|
85
|
+
<div
|
|
86
|
+
data-slot="sheet-footer"
|
|
87
|
+
className="gap-2 pb-4 mt-auto flex flex-col"
|
|
88
|
+
{...props}
|
|
89
|
+
/>
|
|
90
|
+
);
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
function SheetTitle({
|
|
94
|
+
...props
|
|
95
|
+
}: Omit<SheetPrimitive.Title.Props, "className">) {
|
|
96
|
+
return (
|
|
97
|
+
<SheetPrimitive.Title
|
|
98
|
+
data-slot="sheet-title"
|
|
99
|
+
className="text-foreground text-base font-medium"
|
|
100
|
+
{...props}
|
|
101
|
+
/>
|
|
102
|
+
);
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
function SheetDescription({
|
|
106
|
+
...props
|
|
107
|
+
}: Omit<SheetPrimitive.Description.Props, "className">) {
|
|
108
|
+
return (
|
|
109
|
+
<SheetPrimitive.Description
|
|
110
|
+
data-slot="sheet-description"
|
|
111
|
+
className="text-muted-foreground text-sm"
|
|
112
|
+
{...props}
|
|
113
|
+
/>
|
|
114
|
+
);
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
export {
|
|
118
|
+
Sheet,
|
|
119
|
+
SheetClose,
|
|
120
|
+
SheetContent,
|
|
121
|
+
SheetDescription,
|
|
122
|
+
SheetFooter,
|
|
123
|
+
SheetHeader,
|
|
124
|
+
SheetTitle,
|
|
125
|
+
SheetTrigger,
|
|
126
|
+
};
|