@majapisoftwares/ui 6.1.0 → 6.1.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/AGENTS.md +27 -27
- package/README.md +79 -79
- package/THIRD_PARTY_NOTICES.md +39 -39
- package/components.json +25 -25
- package/docs/MIGRATION-0.2.md +20 -20
- package/docs/MIGRATION-6.0.md +33 -33
- package/docs/NEXT-STARTER-VALIDATION.md +14 -14
- package/docs/STANDARDS.md +41 -41
- package/docs/VALIDATION.md +11 -11
- package/docs/VERSIONING.md +28 -28
- package/docs/validation/preference-titles.md +22 -0
- package/package.json +88 -84
- package/scripts/check-standards.mjs +41 -41
- package/src/components/ui/accordion.tsx +82 -82
- package/src/components/ui/alert-dialog.tsx +187 -187
- package/src/components/ui/alert.tsx +77 -77
- package/src/components/ui/avatar.tsx +108 -108
- package/src/components/ui/badge.tsx +55 -55
- package/src/components/ui/breadcrumb.tsx +125 -125
- package/src/components/ui/button-group.tsx +89 -89
- package/src/components/ui/button.tsx +59 -59
- package/src/components/ui/card.tsx +101 -101
- package/src/components/ui/checkbox.tsx +27 -27
- package/src/components/ui/collapsible.tsx +21 -21
- package/src/components/ui/context-menu.tsx +271 -271
- package/src/components/ui/dialog.tsx +161 -161
- package/src/components/ui/dropdown-menu.tsx +271 -271
- package/src/components/ui/empty.tsx +105 -105
- package/src/components/ui/field.tsx +238 -238
- package/src/components/ui/hover-card.tsx +50 -50
- package/src/components/ui/input-group.tsx +155 -155
- package/src/components/ui/input.tsx +21 -21
- package/src/components/ui/kbd.tsx +28 -28
- package/src/components/ui/label.tsx +19 -19
- package/src/components/ui/orb.css +1002 -1002
- package/src/components/ui/orb.tsx +752 -752
- package/src/components/ui/popover.tsx +89 -89
- package/src/components/ui/progress.tsx +82 -82
- package/src/components/ui/radio-group.tsx +37 -37
- package/src/components/ui/scroll-area.tsx +54 -54
- package/src/components/ui/select.tsx +204 -204
- package/src/components/ui/separator.tsx +24 -24
- package/src/components/ui/sheet.tsx +139 -139
- package/src/components/ui/sidebar.tsx +1039 -1035
- package/src/components/ui/skeleton.tsx +15 -15
- package/src/components/ui/slider.tsx +53 -53
- package/src/components/ui/sonner.tsx +44 -44
- package/src/components/ui/spinner.tsx +32 -32
- package/src/components/ui/switch.tsx +31 -31
- package/src/components/ui/table.tsx +121 -121
- package/src/components/ui/tabs.tsx +81 -81
- package/src/components/ui/textarea.tsx +19 -19
- package/src/components/ui/toggle-group.tsx +89 -89
- package/src/components/ui/toggle.tsx +44 -44
- package/src/components/ui/tooltip.tsx +65 -65
- package/src/hooks/use-mobile.ts +20 -20
- package/src/lib/i18n.tsx +109 -109
- package/src/lib/utils.ts +1 -1
- package/src/patterns/app-shell.tsx +177 -179
- package/src/patterns/data-table.tsx +2486 -2486
- package/src/patterns/details-sheet.tsx +54 -54
- package/src/patterns/filter-tabs.tsx +53 -53
- package/src/patterns/majapi-logo.tsx +32 -32
- package/src/patterns/page-header.tsx +62 -62
- package/src/patterns/preferences.tsx +15 -7
- package/src/patterns/status-badge.tsx +24 -24
- package/src/patterns/user-menu.tsx +218 -218
- package/src/patterns/workspace-switcher.tsx +176 -173
- package/src/styles.css +165 -165
- package/src/templates/admin-dashboard.tsx +44 -44
- package/src/templates/auth-layout.tsx +30 -30
- package/src/templates/login-form.tsx +129 -129
- package/src/templates/signup-form.tsx +177 -177
|
@@ -1,161 +1,161 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
|
|
3
|
-
import * as React from "react";
|
|
4
|
-
import { Dialog as DialogPrimitive } from "@base-ui/react/dialog";
|
|
5
|
-
import { cn } from "cn";
|
|
6
|
-
import { useUiMessages } from "../../lib/i18n";
|
|
7
|
-
|
|
8
|
-
import { Button } from "./button";
|
|
9
|
-
import { XIcon } from "lucide-react";
|
|
10
|
-
|
|
11
|
-
function Dialog({ ...props }: DialogPrimitive.Root.Props) {
|
|
12
|
-
return <DialogPrimitive.Root data-slot="dialog" {...props} />;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
function DialogTrigger({ ...props }: DialogPrimitive.Trigger.Props) {
|
|
16
|
-
return <DialogPrimitive.Trigger data-slot="dialog-trigger" {...props} />;
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
function DialogPortal({ ...props }: DialogPrimitive.Portal.Props) {
|
|
20
|
-
return <DialogPrimitive.Portal data-slot="dialog-portal" {...props} />;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
function DialogClose({ ...props }: DialogPrimitive.Close.Props) {
|
|
24
|
-
return <DialogPrimitive.Close data-slot="dialog-close" {...props} />;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
function DialogOverlay({
|
|
28
|
-
className,
|
|
29
|
-
...props
|
|
30
|
-
}: DialogPrimitive.Backdrop.Props) {
|
|
31
|
-
return (
|
|
32
|
-
<DialogPrimitive.Backdrop
|
|
33
|
-
data-slot="dialog-overlay"
|
|
34
|
-
className={cn(
|
|
35
|
-
"fixed inset-0 isolate z-50 bg-black/30 duration-100 supports-backdrop-filter:backdrop-blur-sm data-open:animate-in data-open:fade-in-0 data-closed:animate-out data-closed:fade-out-0",
|
|
36
|
-
className,
|
|
37
|
-
)}
|
|
38
|
-
{...props}
|
|
39
|
-
/>
|
|
40
|
-
);
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
function DialogContent({
|
|
44
|
-
className,
|
|
45
|
-
children,
|
|
46
|
-
showCloseButton = true,
|
|
47
|
-
...props
|
|
48
|
-
}: DialogPrimitive.Popup.Props & {
|
|
49
|
-
showCloseButton?: boolean;
|
|
50
|
-
}) {
|
|
51
|
-
const messages = useUiMessages();
|
|
52
|
-
return (
|
|
53
|
-
<DialogPortal>
|
|
54
|
-
<DialogOverlay />
|
|
55
|
-
<DialogPrimitive.Popup
|
|
56
|
-
data-slot="dialog-content"
|
|
57
|
-
className={cn(
|
|
58
|
-
"fixed top-1/2 left-1/2 z-50 grid w-full max-w-[calc(100%-2rem)] -translate-x-1/2 -translate-y-1/2 gap-6 rounded-4xl bg-popover p-6 text-sm text-popover-foreground shadow-xl ring-1 ring-foreground/5 duration-100 outline-none sm:max-w-md dark:ring-foreground/10 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95",
|
|
59
|
-
className,
|
|
60
|
-
)}
|
|
61
|
-
{...props}
|
|
62
|
-
>
|
|
63
|
-
{children}
|
|
64
|
-
{showCloseButton && (
|
|
65
|
-
<DialogPrimitive.Close
|
|
66
|
-
data-slot="dialog-close"
|
|
67
|
-
render={
|
|
68
|
-
<Button
|
|
69
|
-
variant="ghost"
|
|
70
|
-
className="absolute top-4 right-4 bg-secondary"
|
|
71
|
-
size="icon-sm"
|
|
72
|
-
/>
|
|
73
|
-
}
|
|
74
|
-
>
|
|
75
|
-
<XIcon />
|
|
76
|
-
<span className="sr-only">{messages.close}</span>
|
|
77
|
-
</DialogPrimitive.Close>
|
|
78
|
-
)}
|
|
79
|
-
</DialogPrimitive.Popup>
|
|
80
|
-
</DialogPortal>
|
|
81
|
-
);
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
function DialogHeader({ className, ...props }: React.ComponentProps<"div">) {
|
|
85
|
-
return (
|
|
86
|
-
<div
|
|
87
|
-
data-slot="dialog-header"
|
|
88
|
-
className={cn("flex flex-col gap-1.5", className)}
|
|
89
|
-
{...props}
|
|
90
|
-
/>
|
|
91
|
-
);
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
function DialogFooter({
|
|
95
|
-
className,
|
|
96
|
-
showCloseButton = false,
|
|
97
|
-
children,
|
|
98
|
-
...props
|
|
99
|
-
}: React.ComponentProps<"div"> & {
|
|
100
|
-
showCloseButton?: boolean;
|
|
101
|
-
}) {
|
|
102
|
-
return (
|
|
103
|
-
<div
|
|
104
|
-
data-slot="dialog-footer"
|
|
105
|
-
className={cn(
|
|
106
|
-
"flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",
|
|
107
|
-
className,
|
|
108
|
-
)}
|
|
109
|
-
{...props}
|
|
110
|
-
>
|
|
111
|
-
{children}
|
|
112
|
-
{showCloseButton && (
|
|
113
|
-
<DialogPrimitive.Close render={<Button variant="outline" />}>
|
|
114
|
-
Close
|
|
115
|
-
</DialogPrimitive.Close>
|
|
116
|
-
)}
|
|
117
|
-
</div>
|
|
118
|
-
);
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
function DialogTitle({ className, ...props }: DialogPrimitive.Title.Props) {
|
|
122
|
-
return (
|
|
123
|
-
<DialogPrimitive.Title
|
|
124
|
-
data-slot="dialog-title"
|
|
125
|
-
className={cn(
|
|
126
|
-
"font-heading text-base leading-none font-medium",
|
|
127
|
-
className,
|
|
128
|
-
)}
|
|
129
|
-
{...props}
|
|
130
|
-
/>
|
|
131
|
-
);
|
|
132
|
-
}
|
|
133
|
-
|
|
134
|
-
function DialogDescription({
|
|
135
|
-
className,
|
|
136
|
-
...props
|
|
137
|
-
}: DialogPrimitive.Description.Props) {
|
|
138
|
-
return (
|
|
139
|
-
<DialogPrimitive.Description
|
|
140
|
-
data-slot="dialog-description"
|
|
141
|
-
className={cn(
|
|
142
|
-
"text-sm text-muted-foreground *:[a]:underline *:[a]:underline-offset-3 *:[a]:hover:text-foreground",
|
|
143
|
-
className,
|
|
144
|
-
)}
|
|
145
|
-
{...props}
|
|
146
|
-
/>
|
|
147
|
-
);
|
|
148
|
-
}
|
|
149
|
-
|
|
150
|
-
export {
|
|
151
|
-
Dialog,
|
|
152
|
-
DialogClose,
|
|
153
|
-
DialogContent,
|
|
154
|
-
DialogDescription,
|
|
155
|
-
DialogFooter,
|
|
156
|
-
DialogHeader,
|
|
157
|
-
DialogOverlay,
|
|
158
|
-
DialogPortal,
|
|
159
|
-
DialogTitle,
|
|
160
|
-
DialogTrigger,
|
|
161
|
-
};
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import * as React from "react";
|
|
4
|
+
import { Dialog as DialogPrimitive } from "@base-ui/react/dialog";
|
|
5
|
+
import { cn } from "cn";
|
|
6
|
+
import { useUiMessages } from "../../lib/i18n";
|
|
7
|
+
|
|
8
|
+
import { Button } from "./button";
|
|
9
|
+
import { XIcon } from "lucide-react";
|
|
10
|
+
|
|
11
|
+
function Dialog({ ...props }: DialogPrimitive.Root.Props) {
|
|
12
|
+
return <DialogPrimitive.Root data-slot="dialog" {...props} />;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
function DialogTrigger({ ...props }: DialogPrimitive.Trigger.Props) {
|
|
16
|
+
return <DialogPrimitive.Trigger data-slot="dialog-trigger" {...props} />;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
function DialogPortal({ ...props }: DialogPrimitive.Portal.Props) {
|
|
20
|
+
return <DialogPrimitive.Portal data-slot="dialog-portal" {...props} />;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
function DialogClose({ ...props }: DialogPrimitive.Close.Props) {
|
|
24
|
+
return <DialogPrimitive.Close data-slot="dialog-close" {...props} />;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
function DialogOverlay({
|
|
28
|
+
className,
|
|
29
|
+
...props
|
|
30
|
+
}: DialogPrimitive.Backdrop.Props) {
|
|
31
|
+
return (
|
|
32
|
+
<DialogPrimitive.Backdrop
|
|
33
|
+
data-slot="dialog-overlay"
|
|
34
|
+
className={cn(
|
|
35
|
+
"fixed inset-0 isolate z-50 bg-black/30 duration-100 supports-backdrop-filter:backdrop-blur-sm data-open:animate-in data-open:fade-in-0 data-closed:animate-out data-closed:fade-out-0",
|
|
36
|
+
className,
|
|
37
|
+
)}
|
|
38
|
+
{...props}
|
|
39
|
+
/>
|
|
40
|
+
);
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
function DialogContent({
|
|
44
|
+
className,
|
|
45
|
+
children,
|
|
46
|
+
showCloseButton = true,
|
|
47
|
+
...props
|
|
48
|
+
}: DialogPrimitive.Popup.Props & {
|
|
49
|
+
showCloseButton?: boolean;
|
|
50
|
+
}) {
|
|
51
|
+
const messages = useUiMessages();
|
|
52
|
+
return (
|
|
53
|
+
<DialogPortal>
|
|
54
|
+
<DialogOverlay />
|
|
55
|
+
<DialogPrimitive.Popup
|
|
56
|
+
data-slot="dialog-content"
|
|
57
|
+
className={cn(
|
|
58
|
+
"fixed top-1/2 left-1/2 z-50 grid w-full max-w-[calc(100%-2rem)] -translate-x-1/2 -translate-y-1/2 gap-6 rounded-4xl bg-popover p-6 text-sm text-popover-foreground shadow-xl ring-1 ring-foreground/5 duration-100 outline-none sm:max-w-md dark:ring-foreground/10 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95",
|
|
59
|
+
className,
|
|
60
|
+
)}
|
|
61
|
+
{...props}
|
|
62
|
+
>
|
|
63
|
+
{children}
|
|
64
|
+
{showCloseButton && (
|
|
65
|
+
<DialogPrimitive.Close
|
|
66
|
+
data-slot="dialog-close"
|
|
67
|
+
render={
|
|
68
|
+
<Button
|
|
69
|
+
variant="ghost"
|
|
70
|
+
className="absolute top-4 right-4 bg-secondary"
|
|
71
|
+
size="icon-sm"
|
|
72
|
+
/>
|
|
73
|
+
}
|
|
74
|
+
>
|
|
75
|
+
<XIcon />
|
|
76
|
+
<span className="sr-only">{messages.close}</span>
|
|
77
|
+
</DialogPrimitive.Close>
|
|
78
|
+
)}
|
|
79
|
+
</DialogPrimitive.Popup>
|
|
80
|
+
</DialogPortal>
|
|
81
|
+
);
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
function DialogHeader({ className, ...props }: React.ComponentProps<"div">) {
|
|
85
|
+
return (
|
|
86
|
+
<div
|
|
87
|
+
data-slot="dialog-header"
|
|
88
|
+
className={cn("flex flex-col gap-1.5", className)}
|
|
89
|
+
{...props}
|
|
90
|
+
/>
|
|
91
|
+
);
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
function DialogFooter({
|
|
95
|
+
className,
|
|
96
|
+
showCloseButton = false,
|
|
97
|
+
children,
|
|
98
|
+
...props
|
|
99
|
+
}: React.ComponentProps<"div"> & {
|
|
100
|
+
showCloseButton?: boolean;
|
|
101
|
+
}) {
|
|
102
|
+
return (
|
|
103
|
+
<div
|
|
104
|
+
data-slot="dialog-footer"
|
|
105
|
+
className={cn(
|
|
106
|
+
"flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",
|
|
107
|
+
className,
|
|
108
|
+
)}
|
|
109
|
+
{...props}
|
|
110
|
+
>
|
|
111
|
+
{children}
|
|
112
|
+
{showCloseButton && (
|
|
113
|
+
<DialogPrimitive.Close render={<Button variant="outline" />}>
|
|
114
|
+
Close
|
|
115
|
+
</DialogPrimitive.Close>
|
|
116
|
+
)}
|
|
117
|
+
</div>
|
|
118
|
+
);
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
function DialogTitle({ className, ...props }: DialogPrimitive.Title.Props) {
|
|
122
|
+
return (
|
|
123
|
+
<DialogPrimitive.Title
|
|
124
|
+
data-slot="dialog-title"
|
|
125
|
+
className={cn(
|
|
126
|
+
"font-heading text-base leading-none font-medium",
|
|
127
|
+
className,
|
|
128
|
+
)}
|
|
129
|
+
{...props}
|
|
130
|
+
/>
|
|
131
|
+
);
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
function DialogDescription({
|
|
135
|
+
className,
|
|
136
|
+
...props
|
|
137
|
+
}: DialogPrimitive.Description.Props) {
|
|
138
|
+
return (
|
|
139
|
+
<DialogPrimitive.Description
|
|
140
|
+
data-slot="dialog-description"
|
|
141
|
+
className={cn(
|
|
142
|
+
"text-sm text-muted-foreground *:[a]:underline *:[a]:underline-offset-3 *:[a]:hover:text-foreground",
|
|
143
|
+
className,
|
|
144
|
+
)}
|
|
145
|
+
{...props}
|
|
146
|
+
/>
|
|
147
|
+
);
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
export {
|
|
151
|
+
Dialog,
|
|
152
|
+
DialogClose,
|
|
153
|
+
DialogContent,
|
|
154
|
+
DialogDescription,
|
|
155
|
+
DialogFooter,
|
|
156
|
+
DialogHeader,
|
|
157
|
+
DialogOverlay,
|
|
158
|
+
DialogPortal,
|
|
159
|
+
DialogTitle,
|
|
160
|
+
DialogTrigger,
|
|
161
|
+
};
|