@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,108 +1,108 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
|
|
3
|
-
import * as React from "react";
|
|
4
|
-
import { Avatar as AvatarPrimitive } from "@base-ui/react/avatar";
|
|
5
|
-
import { cn } from "cn";
|
|
6
|
-
|
|
7
|
-
function Avatar({
|
|
8
|
-
className,
|
|
9
|
-
size = "default",
|
|
10
|
-
...props
|
|
11
|
-
}: AvatarPrimitive.Root.Props & {
|
|
12
|
-
size?: "default" | "sm" | "lg";
|
|
13
|
-
}) {
|
|
14
|
-
return (
|
|
15
|
-
<AvatarPrimitive.Root
|
|
16
|
-
data-slot="avatar"
|
|
17
|
-
data-size={size}
|
|
18
|
-
className={cn(
|
|
19
|
-
"group/avatar relative flex size-8 shrink-0 rounded-full select-none after:absolute after:inset-0 after:rounded-full after:border after:border-border after:mix-blend-darken data-[size=lg]:size-10 data-[size=sm]:size-6 dark:after:mix-blend-lighten",
|
|
20
|
-
className,
|
|
21
|
-
)}
|
|
22
|
-
{...props}
|
|
23
|
-
/>
|
|
24
|
-
);
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
function AvatarImage({ className, ...props }: AvatarPrimitive.Image.Props) {
|
|
28
|
-
return (
|
|
29
|
-
<AvatarPrimitive.Image
|
|
30
|
-
data-slot="avatar-image"
|
|
31
|
-
className={cn(
|
|
32
|
-
"aspect-square size-full rounded-full object-cover",
|
|
33
|
-
className,
|
|
34
|
-
)}
|
|
35
|
-
{...props}
|
|
36
|
-
/>
|
|
37
|
-
);
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
function AvatarFallback({
|
|
41
|
-
className,
|
|
42
|
-
...props
|
|
43
|
-
}: AvatarPrimitive.Fallback.Props) {
|
|
44
|
-
return (
|
|
45
|
-
<AvatarPrimitive.Fallback
|
|
46
|
-
data-slot="avatar-fallback"
|
|
47
|
-
className={cn(
|
|
48
|
-
"flex size-full items-center justify-center rounded-full bg-muted text-sm text-muted-foreground group-data-[size=sm]/avatar:text-xs",
|
|
49
|
-
className,
|
|
50
|
-
)}
|
|
51
|
-
{...props}
|
|
52
|
-
/>
|
|
53
|
-
);
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
function AvatarBadge({ className, ...props }: React.ComponentProps<"span">) {
|
|
57
|
-
return (
|
|
58
|
-
<span
|
|
59
|
-
data-slot="avatar-badge"
|
|
60
|
-
className={cn(
|
|
61
|
-
"absolute right-0 bottom-0 z-10 inline-flex items-center justify-center rounded-full bg-primary text-primary-foreground bg-blend-color ring-2 ring-background select-none",
|
|
62
|
-
"group-data-[size=sm]/avatar:size-2 group-data-[size=sm]/avatar:[&>svg]:hidden",
|
|
63
|
-
"group-data-[size=default]/avatar:size-2.5 group-data-[size=default]/avatar:[&>svg]:size-2",
|
|
64
|
-
"group-data-[size=lg]/avatar:size-3 group-data-[size=lg]/avatar:[&>svg]:size-2",
|
|
65
|
-
className,
|
|
66
|
-
)}
|
|
67
|
-
{...props}
|
|
68
|
-
/>
|
|
69
|
-
);
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
function AvatarGroup({ className, ...props }: React.ComponentProps<"div">) {
|
|
73
|
-
return (
|
|
74
|
-
<div
|
|
75
|
-
data-slot="avatar-group"
|
|
76
|
-
className={cn(
|
|
77
|
-
"group/avatar-group flex -space-x-2 *:data-[slot=avatar]:ring-2 *:data-[slot=avatar]:ring-background",
|
|
78
|
-
className,
|
|
79
|
-
)}
|
|
80
|
-
{...props}
|
|
81
|
-
/>
|
|
82
|
-
);
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
function AvatarGroupCount({
|
|
86
|
-
className,
|
|
87
|
-
...props
|
|
88
|
-
}: React.ComponentProps<"div">) {
|
|
89
|
-
return (
|
|
90
|
-
<div
|
|
91
|
-
data-slot="avatar-group-count"
|
|
92
|
-
className={cn(
|
|
93
|
-
"relative flex size-8 shrink-0 items-center justify-center rounded-full bg-muted text-sm text-muted-foreground ring-2 ring-background group-has-data-[size=lg]/avatar-group:size-10 group-has-data-[size=sm]/avatar-group:size-6 [&>svg]:size-4 group-has-data-[size=lg]/avatar-group:[&>svg]:size-5 group-has-data-[size=sm]/avatar-group:[&>svg]:size-3",
|
|
94
|
-
className,
|
|
95
|
-
)}
|
|
96
|
-
{...props}
|
|
97
|
-
/>
|
|
98
|
-
);
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
export {
|
|
102
|
-
Avatar,
|
|
103
|
-
AvatarImage,
|
|
104
|
-
AvatarFallback,
|
|
105
|
-
AvatarGroup,
|
|
106
|
-
AvatarGroupCount,
|
|
107
|
-
AvatarBadge,
|
|
108
|
-
};
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import * as React from "react";
|
|
4
|
+
import { Avatar as AvatarPrimitive } from "@base-ui/react/avatar";
|
|
5
|
+
import { cn } from "cn";
|
|
6
|
+
|
|
7
|
+
function Avatar({
|
|
8
|
+
className,
|
|
9
|
+
size = "default",
|
|
10
|
+
...props
|
|
11
|
+
}: AvatarPrimitive.Root.Props & {
|
|
12
|
+
size?: "default" | "sm" | "lg";
|
|
13
|
+
}) {
|
|
14
|
+
return (
|
|
15
|
+
<AvatarPrimitive.Root
|
|
16
|
+
data-slot="avatar"
|
|
17
|
+
data-size={size}
|
|
18
|
+
className={cn(
|
|
19
|
+
"group/avatar relative flex size-8 shrink-0 rounded-full select-none after:absolute after:inset-0 after:rounded-full after:border after:border-border after:mix-blend-darken data-[size=lg]:size-10 data-[size=sm]:size-6 dark:after:mix-blend-lighten",
|
|
20
|
+
className,
|
|
21
|
+
)}
|
|
22
|
+
{...props}
|
|
23
|
+
/>
|
|
24
|
+
);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
function AvatarImage({ className, ...props }: AvatarPrimitive.Image.Props) {
|
|
28
|
+
return (
|
|
29
|
+
<AvatarPrimitive.Image
|
|
30
|
+
data-slot="avatar-image"
|
|
31
|
+
className={cn(
|
|
32
|
+
"aspect-square size-full rounded-full object-cover",
|
|
33
|
+
className,
|
|
34
|
+
)}
|
|
35
|
+
{...props}
|
|
36
|
+
/>
|
|
37
|
+
);
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
function AvatarFallback({
|
|
41
|
+
className,
|
|
42
|
+
...props
|
|
43
|
+
}: AvatarPrimitive.Fallback.Props) {
|
|
44
|
+
return (
|
|
45
|
+
<AvatarPrimitive.Fallback
|
|
46
|
+
data-slot="avatar-fallback"
|
|
47
|
+
className={cn(
|
|
48
|
+
"flex size-full items-center justify-center rounded-full bg-muted text-sm text-muted-foreground group-data-[size=sm]/avatar:text-xs",
|
|
49
|
+
className,
|
|
50
|
+
)}
|
|
51
|
+
{...props}
|
|
52
|
+
/>
|
|
53
|
+
);
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
function AvatarBadge({ className, ...props }: React.ComponentProps<"span">) {
|
|
57
|
+
return (
|
|
58
|
+
<span
|
|
59
|
+
data-slot="avatar-badge"
|
|
60
|
+
className={cn(
|
|
61
|
+
"absolute right-0 bottom-0 z-10 inline-flex items-center justify-center rounded-full bg-primary text-primary-foreground bg-blend-color ring-2 ring-background select-none",
|
|
62
|
+
"group-data-[size=sm]/avatar:size-2 group-data-[size=sm]/avatar:[&>svg]:hidden",
|
|
63
|
+
"group-data-[size=default]/avatar:size-2.5 group-data-[size=default]/avatar:[&>svg]:size-2",
|
|
64
|
+
"group-data-[size=lg]/avatar:size-3 group-data-[size=lg]/avatar:[&>svg]:size-2",
|
|
65
|
+
className,
|
|
66
|
+
)}
|
|
67
|
+
{...props}
|
|
68
|
+
/>
|
|
69
|
+
);
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
function AvatarGroup({ className, ...props }: React.ComponentProps<"div">) {
|
|
73
|
+
return (
|
|
74
|
+
<div
|
|
75
|
+
data-slot="avatar-group"
|
|
76
|
+
className={cn(
|
|
77
|
+
"group/avatar-group flex -space-x-2 *:data-[slot=avatar]:ring-2 *:data-[slot=avatar]:ring-background",
|
|
78
|
+
className,
|
|
79
|
+
)}
|
|
80
|
+
{...props}
|
|
81
|
+
/>
|
|
82
|
+
);
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
function AvatarGroupCount({
|
|
86
|
+
className,
|
|
87
|
+
...props
|
|
88
|
+
}: React.ComponentProps<"div">) {
|
|
89
|
+
return (
|
|
90
|
+
<div
|
|
91
|
+
data-slot="avatar-group-count"
|
|
92
|
+
className={cn(
|
|
93
|
+
"relative flex size-8 shrink-0 items-center justify-center rounded-full bg-muted text-sm text-muted-foreground ring-2 ring-background group-has-data-[size=lg]/avatar-group:size-10 group-has-data-[size=sm]/avatar-group:size-6 [&>svg]:size-4 group-has-data-[size=lg]/avatar-group:[&>svg]:size-5 group-has-data-[size=sm]/avatar-group:[&>svg]:size-3",
|
|
94
|
+
className,
|
|
95
|
+
)}
|
|
96
|
+
{...props}
|
|
97
|
+
/>
|
|
98
|
+
);
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
export {
|
|
102
|
+
Avatar,
|
|
103
|
+
AvatarImage,
|
|
104
|
+
AvatarFallback,
|
|
105
|
+
AvatarGroup,
|
|
106
|
+
AvatarGroupCount,
|
|
107
|
+
AvatarBadge,
|
|
108
|
+
};
|
|
@@ -1,55 +1,55 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
|
|
3
|
-
import { mergeProps } from "@base-ui/react/merge-props";
|
|
4
|
-
import { useRender } from "@base-ui/react/use-render";
|
|
5
|
-
import { cva, type VariantProps } from "class-variance-authority";
|
|
6
|
-
import { cn } from "cn";
|
|
7
|
-
|
|
8
|
-
const badgeVariants = cva(
|
|
9
|
-
"group/badge inline-flex h-5 w-fit shrink-0 items-center justify-center gap-1 overflow-hidden rounded-3xl border border-transparent px-2 py-0.5 text-xs font-medium whitespace-nowrap transition-all focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&>svg]:pointer-events-none [&>svg]:size-3!",
|
|
10
|
-
{
|
|
11
|
-
variants: {
|
|
12
|
-
variant: {
|
|
13
|
-
success: "bg-success text-success-foreground",
|
|
14
|
-
warning: "bg-warning text-warning-foreground",
|
|
15
|
-
default: "bg-primary text-primary-foreground [a]:hover:bg-primary/80",
|
|
16
|
-
secondary:
|
|
17
|
-
"bg-secondary text-secondary-foreground [a]:hover:bg-secondary/80",
|
|
18
|
-
destructive:
|
|
19
|
-
"bg-destructive/10 text-destructive focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:focus-visible:ring-destructive/40 [a]:hover:bg-destructive/20",
|
|
20
|
-
outline:
|
|
21
|
-
"border-border text-foreground [a]:hover:bg-muted [a]:hover:text-muted-foreground",
|
|
22
|
-
ghost:
|
|
23
|
-
"hover:bg-muted hover:text-muted-foreground dark:hover:bg-muted/50",
|
|
24
|
-
link: "text-primary underline-offset-4 hover:underline",
|
|
25
|
-
},
|
|
26
|
-
},
|
|
27
|
-
defaultVariants: {
|
|
28
|
-
variant: "default",
|
|
29
|
-
},
|
|
30
|
-
},
|
|
31
|
-
);
|
|
32
|
-
|
|
33
|
-
function Badge({
|
|
34
|
-
className,
|
|
35
|
-
variant = "default",
|
|
36
|
-
render,
|
|
37
|
-
...props
|
|
38
|
-
}: useRender.ComponentProps<"span"> & VariantProps<typeof badgeVariants>) {
|
|
39
|
-
return useRender({
|
|
40
|
-
defaultTagName: "span",
|
|
41
|
-
props: mergeProps<"span">(
|
|
42
|
-
{
|
|
43
|
-
className: cn(badgeVariants({ variant }), className),
|
|
44
|
-
},
|
|
45
|
-
props,
|
|
46
|
-
),
|
|
47
|
-
render,
|
|
48
|
-
state: {
|
|
49
|
-
slot: "badge",
|
|
50
|
-
variant,
|
|
51
|
-
},
|
|
52
|
-
});
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
export { Badge, badgeVariants };
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import { mergeProps } from "@base-ui/react/merge-props";
|
|
4
|
+
import { useRender } from "@base-ui/react/use-render";
|
|
5
|
+
import { cva, type VariantProps } from "class-variance-authority";
|
|
6
|
+
import { cn } from "cn";
|
|
7
|
+
|
|
8
|
+
const badgeVariants = cva(
|
|
9
|
+
"group/badge inline-flex h-5 w-fit shrink-0 items-center justify-center gap-1 overflow-hidden rounded-3xl border border-transparent px-2 py-0.5 text-xs font-medium whitespace-nowrap transition-all focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&>svg]:pointer-events-none [&>svg]:size-3!",
|
|
10
|
+
{
|
|
11
|
+
variants: {
|
|
12
|
+
variant: {
|
|
13
|
+
success: "bg-success text-success-foreground",
|
|
14
|
+
warning: "bg-warning text-warning-foreground",
|
|
15
|
+
default: "bg-primary text-primary-foreground [a]:hover:bg-primary/80",
|
|
16
|
+
secondary:
|
|
17
|
+
"bg-secondary text-secondary-foreground [a]:hover:bg-secondary/80",
|
|
18
|
+
destructive:
|
|
19
|
+
"bg-destructive/10 text-destructive focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:focus-visible:ring-destructive/40 [a]:hover:bg-destructive/20",
|
|
20
|
+
outline:
|
|
21
|
+
"border-border text-foreground [a]:hover:bg-muted [a]:hover:text-muted-foreground",
|
|
22
|
+
ghost:
|
|
23
|
+
"hover:bg-muted hover:text-muted-foreground dark:hover:bg-muted/50",
|
|
24
|
+
link: "text-primary underline-offset-4 hover:underline",
|
|
25
|
+
},
|
|
26
|
+
},
|
|
27
|
+
defaultVariants: {
|
|
28
|
+
variant: "default",
|
|
29
|
+
},
|
|
30
|
+
},
|
|
31
|
+
);
|
|
32
|
+
|
|
33
|
+
function Badge({
|
|
34
|
+
className,
|
|
35
|
+
variant = "default",
|
|
36
|
+
render,
|
|
37
|
+
...props
|
|
38
|
+
}: useRender.ComponentProps<"span"> & VariantProps<typeof badgeVariants>) {
|
|
39
|
+
return useRender({
|
|
40
|
+
defaultTagName: "span",
|
|
41
|
+
props: mergeProps<"span">(
|
|
42
|
+
{
|
|
43
|
+
className: cn(badgeVariants({ variant }), className),
|
|
44
|
+
},
|
|
45
|
+
props,
|
|
46
|
+
),
|
|
47
|
+
render,
|
|
48
|
+
state: {
|
|
49
|
+
slot: "badge",
|
|
50
|
+
variant,
|
|
51
|
+
},
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
export { Badge, badgeVariants };
|
|
@@ -1,125 +1,125 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
|
|
3
|
-
import * as React from "react";
|
|
4
|
-
import { mergeProps } from "@base-ui/react/merge-props";
|
|
5
|
-
import { useRender } from "@base-ui/react/use-render";
|
|
6
|
-
import { cn } from "cn";
|
|
7
|
-
import { useUiMessages } from "../../lib/i18n";
|
|
8
|
-
import { ChevronRightIcon, MoreHorizontalIcon } from "lucide-react";
|
|
9
|
-
|
|
10
|
-
function Breadcrumb({ className, ...props }: React.ComponentProps<"nav">) {
|
|
11
|
-
return (
|
|
12
|
-
<nav
|
|
13
|
-
aria-label="breadcrumb"
|
|
14
|
-
data-slot="breadcrumb"
|
|
15
|
-
className={cn(className)}
|
|
16
|
-
{...props}
|
|
17
|
-
/>
|
|
18
|
-
);
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
function BreadcrumbList({ className, ...props }: React.ComponentProps<"ol">) {
|
|
22
|
-
return (
|
|
23
|
-
<ol
|
|
24
|
-
data-slot="breadcrumb-list"
|
|
25
|
-
className={cn(
|
|
26
|
-
"flex flex-wrap items-center gap-1.5 text-sm wrap-break-word text-muted-foreground sm:gap-2.5",
|
|
27
|
-
className,
|
|
28
|
-
)}
|
|
29
|
-
{...props}
|
|
30
|
-
/>
|
|
31
|
-
);
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
function BreadcrumbItem({ className, ...props }: React.ComponentProps<"li">) {
|
|
35
|
-
return (
|
|
36
|
-
<li
|
|
37
|
-
data-slot="breadcrumb-item"
|
|
38
|
-
className={cn("inline-flex items-center gap-1.5", className)}
|
|
39
|
-
{...props}
|
|
40
|
-
/>
|
|
41
|
-
);
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
function BreadcrumbLink({
|
|
45
|
-
className,
|
|
46
|
-
render,
|
|
47
|
-
...props
|
|
48
|
-
}: useRender.ComponentProps<"a">) {
|
|
49
|
-
return useRender({
|
|
50
|
-
defaultTagName: "a",
|
|
51
|
-
props: mergeProps<"a">(
|
|
52
|
-
{
|
|
53
|
-
className: cn("transition-colors hover:text-foreground", className),
|
|
54
|
-
},
|
|
55
|
-
props,
|
|
56
|
-
),
|
|
57
|
-
render,
|
|
58
|
-
state: {
|
|
59
|
-
slot: "breadcrumb-link",
|
|
60
|
-
},
|
|
61
|
-
});
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
function BreadcrumbPage({ className, ...props }: React.ComponentProps<"span">) {
|
|
65
|
-
return (
|
|
66
|
-
<span
|
|
67
|
-
data-slot="breadcrumb-page"
|
|
68
|
-
role="link"
|
|
69
|
-
aria-disabled="true"
|
|
70
|
-
aria-current="page"
|
|
71
|
-
className={cn("font-normal text-foreground", className)}
|
|
72
|
-
{...props}
|
|
73
|
-
/>
|
|
74
|
-
);
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
function BreadcrumbSeparator({
|
|
78
|
-
children,
|
|
79
|
-
className,
|
|
80
|
-
...props
|
|
81
|
-
}: React.ComponentProps<"li">) {
|
|
82
|
-
return (
|
|
83
|
-
<li
|
|
84
|
-
data-slot="breadcrumb-separator"
|
|
85
|
-
role="presentation"
|
|
86
|
-
aria-hidden="true"
|
|
87
|
-
className={cn("[&>svg]:size-3.5", className)}
|
|
88
|
-
{...props}
|
|
89
|
-
>
|
|
90
|
-
{children ?? <ChevronRightIcon />}
|
|
91
|
-
</li>
|
|
92
|
-
);
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
function BreadcrumbEllipsis({
|
|
96
|
-
className,
|
|
97
|
-
...props
|
|
98
|
-
}: React.ComponentProps<"span">) {
|
|
99
|
-
const messages = useUiMessages();
|
|
100
|
-
return (
|
|
101
|
-
<span
|
|
102
|
-
data-slot="breadcrumb-ellipsis"
|
|
103
|
-
role="presentation"
|
|
104
|
-
aria-hidden="true"
|
|
105
|
-
className={cn(
|
|
106
|
-
"flex size-5 items-center justify-center [&>svg]:size-4",
|
|
107
|
-
className,
|
|
108
|
-
)}
|
|
109
|
-
{...props}
|
|
110
|
-
>
|
|
111
|
-
<MoreHorizontalIcon />
|
|
112
|
-
<span className="sr-only">{messages.more}</span>
|
|
113
|
-
</span>
|
|
114
|
-
);
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
export {
|
|
118
|
-
Breadcrumb,
|
|
119
|
-
BreadcrumbList,
|
|
120
|
-
BreadcrumbItem,
|
|
121
|
-
BreadcrumbLink,
|
|
122
|
-
BreadcrumbPage,
|
|
123
|
-
BreadcrumbSeparator,
|
|
124
|
-
BreadcrumbEllipsis,
|
|
125
|
-
};
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import * as React from "react";
|
|
4
|
+
import { mergeProps } from "@base-ui/react/merge-props";
|
|
5
|
+
import { useRender } from "@base-ui/react/use-render";
|
|
6
|
+
import { cn } from "cn";
|
|
7
|
+
import { useUiMessages } from "../../lib/i18n";
|
|
8
|
+
import { ChevronRightIcon, MoreHorizontalIcon } from "lucide-react";
|
|
9
|
+
|
|
10
|
+
function Breadcrumb({ className, ...props }: React.ComponentProps<"nav">) {
|
|
11
|
+
return (
|
|
12
|
+
<nav
|
|
13
|
+
aria-label="breadcrumb"
|
|
14
|
+
data-slot="breadcrumb"
|
|
15
|
+
className={cn(className)}
|
|
16
|
+
{...props}
|
|
17
|
+
/>
|
|
18
|
+
);
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
function BreadcrumbList({ className, ...props }: React.ComponentProps<"ol">) {
|
|
22
|
+
return (
|
|
23
|
+
<ol
|
|
24
|
+
data-slot="breadcrumb-list"
|
|
25
|
+
className={cn(
|
|
26
|
+
"flex flex-wrap items-center gap-1.5 text-sm wrap-break-word text-muted-foreground sm:gap-2.5",
|
|
27
|
+
className,
|
|
28
|
+
)}
|
|
29
|
+
{...props}
|
|
30
|
+
/>
|
|
31
|
+
);
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
function BreadcrumbItem({ className, ...props }: React.ComponentProps<"li">) {
|
|
35
|
+
return (
|
|
36
|
+
<li
|
|
37
|
+
data-slot="breadcrumb-item"
|
|
38
|
+
className={cn("inline-flex items-center gap-1.5", className)}
|
|
39
|
+
{...props}
|
|
40
|
+
/>
|
|
41
|
+
);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
function BreadcrumbLink({
|
|
45
|
+
className,
|
|
46
|
+
render,
|
|
47
|
+
...props
|
|
48
|
+
}: useRender.ComponentProps<"a">) {
|
|
49
|
+
return useRender({
|
|
50
|
+
defaultTagName: "a",
|
|
51
|
+
props: mergeProps<"a">(
|
|
52
|
+
{
|
|
53
|
+
className: cn("transition-colors hover:text-foreground", className),
|
|
54
|
+
},
|
|
55
|
+
props,
|
|
56
|
+
),
|
|
57
|
+
render,
|
|
58
|
+
state: {
|
|
59
|
+
slot: "breadcrumb-link",
|
|
60
|
+
},
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
function BreadcrumbPage({ className, ...props }: React.ComponentProps<"span">) {
|
|
65
|
+
return (
|
|
66
|
+
<span
|
|
67
|
+
data-slot="breadcrumb-page"
|
|
68
|
+
role="link"
|
|
69
|
+
aria-disabled="true"
|
|
70
|
+
aria-current="page"
|
|
71
|
+
className={cn("font-normal text-foreground", className)}
|
|
72
|
+
{...props}
|
|
73
|
+
/>
|
|
74
|
+
);
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
function BreadcrumbSeparator({
|
|
78
|
+
children,
|
|
79
|
+
className,
|
|
80
|
+
...props
|
|
81
|
+
}: React.ComponentProps<"li">) {
|
|
82
|
+
return (
|
|
83
|
+
<li
|
|
84
|
+
data-slot="breadcrumb-separator"
|
|
85
|
+
role="presentation"
|
|
86
|
+
aria-hidden="true"
|
|
87
|
+
className={cn("[&>svg]:size-3.5", className)}
|
|
88
|
+
{...props}
|
|
89
|
+
>
|
|
90
|
+
{children ?? <ChevronRightIcon />}
|
|
91
|
+
</li>
|
|
92
|
+
);
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
function BreadcrumbEllipsis({
|
|
96
|
+
className,
|
|
97
|
+
...props
|
|
98
|
+
}: React.ComponentProps<"span">) {
|
|
99
|
+
const messages = useUiMessages();
|
|
100
|
+
return (
|
|
101
|
+
<span
|
|
102
|
+
data-slot="breadcrumb-ellipsis"
|
|
103
|
+
role="presentation"
|
|
104
|
+
aria-hidden="true"
|
|
105
|
+
className={cn(
|
|
106
|
+
"flex size-5 items-center justify-center [&>svg]:size-4",
|
|
107
|
+
className,
|
|
108
|
+
)}
|
|
109
|
+
{...props}
|
|
110
|
+
>
|
|
111
|
+
<MoreHorizontalIcon />
|
|
112
|
+
<span className="sr-only">{messages.more}</span>
|
|
113
|
+
</span>
|
|
114
|
+
);
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
export {
|
|
118
|
+
Breadcrumb,
|
|
119
|
+
BreadcrumbList,
|
|
120
|
+
BreadcrumbItem,
|
|
121
|
+
BreadcrumbLink,
|
|
122
|
+
BreadcrumbPage,
|
|
123
|
+
BreadcrumbSeparator,
|
|
124
|
+
BreadcrumbEllipsis,
|
|
125
|
+
};
|