@moontra/moonui 2.4.7 → 2.4.9
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/dist/index.d.mts +3 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.global.js +29 -37
- package/dist/index.global.js.map +1 -1
- package/dist/index.js +18 -11
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +18 -11
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/src/components/ui/tabs.tsx +22 -12
- package/src/styles/tailwind.css +20 -1
package/package.json
CHANGED
|
@@ -37,7 +37,7 @@ const tabsListVariants = cva(
|
|
|
37
37
|
variants: {
|
|
38
38
|
variant: {
|
|
39
39
|
default: "bg-muted rounded-md p-1 text-muted-foreground dark:bg-gray-800/80 dark:text-gray-400",
|
|
40
|
-
pills: "bg-transparent gap-2 p-0 dark:text-gray-400",
|
|
40
|
+
pills: "bg-transparent gap-2 p-0 dark:text-gray-400",
|
|
41
41
|
underline: "bg-transparent border-b border-border dark:border-gray-700 gap-4 dark:text-gray-400",
|
|
42
42
|
cards: "bg-transparent gap-2 p-0 dark:text-gray-400",
|
|
43
43
|
minimal: "bg-transparent gap-1 p-0 dark:text-gray-400",
|
|
@@ -48,33 +48,43 @@ const tabsListVariants = cva(
|
|
|
48
48
|
},
|
|
49
49
|
fullWidth: {
|
|
50
50
|
true: "w-full"
|
|
51
|
+
},
|
|
52
|
+
scrollable: {
|
|
53
|
+
true: "overflow-x-auto overflow-y-hidden flex-nowrap hide-scrollbar snap-x snap-mandatory px-4",
|
|
54
|
+
false: "flex-wrap"
|
|
51
55
|
}
|
|
52
56
|
},
|
|
53
57
|
defaultVariants: {
|
|
54
58
|
variant: "default",
|
|
55
59
|
orientation: "horizontal",
|
|
56
|
-
fullWidth: false
|
|
60
|
+
fullWidth: false,
|
|
61
|
+
scrollable: false
|
|
57
62
|
}
|
|
58
63
|
}
|
|
59
64
|
);
|
|
60
65
|
|
|
61
|
-
interface TabsListProps
|
|
66
|
+
interface TabsListProps
|
|
62
67
|
extends React.ComponentPropsWithoutRef<typeof TabsPrimitive.List>,
|
|
63
68
|
VariantProps<typeof tabsListVariants> {
|
|
64
69
|
/** Dikey düzende göster */
|
|
65
70
|
orientation?: "horizontal" | "vertical";
|
|
71
|
+
/** Mobil için yatay scroll */
|
|
72
|
+
scrollable?: boolean;
|
|
66
73
|
}
|
|
67
74
|
|
|
68
75
|
const TabsList = React.forwardRef<
|
|
69
76
|
React.ElementRef<typeof TabsPrimitive.List>,
|
|
70
77
|
TabsListProps
|
|
71
|
-
>(({ className, variant, orientation, fullWidth, ...props }, ref) =>
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
+
>(({ className, variant, orientation, fullWidth, scrollable, ...props }, ref) => {
|
|
79
|
+
// scrollable prop'unu DOM'a geçirmemek için destructure ediyoruz
|
|
80
|
+
return (
|
|
81
|
+
<TabsPrimitive.List
|
|
82
|
+
ref={ref}
|
|
83
|
+
className={cn("moonui-theme", tabsListVariants({ variant, orientation, fullWidth, scrollable, className }))}
|
|
84
|
+
{...props}
|
|
85
|
+
/>
|
|
86
|
+
);
|
|
87
|
+
});
|
|
78
88
|
|
|
79
89
|
TabsList.displayName = TabsPrimitive.List.displayName;
|
|
80
90
|
|
|
@@ -82,13 +92,13 @@ TabsList.displayName = TabsPrimitive.List.displayName;
|
|
|
82
92
|
* TabsTrigger
|
|
83
93
|
* -----------------------------------------------------------------------------------------------*/
|
|
84
94
|
const tabsTriggerVariants = cva(
|
|
85
|
-
"inline-flex items-center justify-center whitespace-nowrap font-medium ring-offset-background transition-all duration-200 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",
|
|
95
|
+
"inline-flex items-center justify-center whitespace-nowrap flex-shrink-0 font-medium ring-offset-background transition-all duration-200 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",
|
|
86
96
|
{
|
|
87
97
|
variants: {
|
|
88
98
|
variant: {
|
|
89
99
|
default: "rounded-md data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow-sm dark:data-[state=active]:bg-gray-900 dark:data-[state=active]:text-gray-100 dark:data-[state=active]:shadow-gray-950/10",
|
|
90
100
|
underline: "rounded-none border-b-2 border-transparent pb-2 data-[state=active]:border-primary data-[state=active]:bg-transparent data-[state=active]:text-foreground dark:data-[state=active]:border-primary/80 dark:data-[state=active]:text-gray-100",
|
|
91
|
-
pills: "rounded-full bg-
|
|
101
|
+
pills: "rounded-full bg-gray-100 hover:bg-gray-200/80 border border-gray-300 data-[state=active]:bg-primary data-[state=active]:text-primary-foreground data-[state=active]:border-primary dark:bg-gray-800 dark:hover:bg-gray-700 dark:border-gray-700 dark:data-[state=active]:bg-primary/90 dark:data-[state=active]:text-white dark:data-[state=active]:border-primary",
|
|
92
102
|
cards: "rounded-md bg-muted/50 hover:bg-muted data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow-md dark:bg-gray-800/50 dark:hover:bg-gray-700/50 dark:data-[state=active]:bg-gray-900 dark:data-[state=active]:text-gray-100 dark:data-[state=active]:shadow-gray-950/20",
|
|
93
103
|
minimal: "rounded-sm bg-transparent hover:bg-muted/30 data-[state=active]:bg-transparent data-[state=active]:text-foreground data-[state=active]:underline data-[state=active]:underline-offset-4 dark:hover:bg-gray-800/30 dark:data-[state=active]:text-gray-200",
|
|
94
104
|
},
|
package/src/styles/tailwind.css
CHANGED
|
@@ -1,7 +1,26 @@
|
|
|
1
|
-
/*
|
|
1
|
+
/*
|
|
2
2
|
* MoonUI Tailwind CSS
|
|
3
3
|
* NOT: Bu dosya artık tailwind direktiflerini içermiyor
|
|
4
4
|
* Ana proje zaten Tailwind kullandığı için çakışmayı önlemek amacıyla kaldırıldı
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
7
|
/* Component-specific utility classes buraya eklenebilir */
|
|
8
|
+
|
|
9
|
+
/* Hide scrollbar utility - For scrollable tabs */
|
|
10
|
+
.hide-scrollbar::-webkit-scrollbar {
|
|
11
|
+
display: none;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
.hide-scrollbar {
|
|
15
|
+
-ms-overflow-style: none; /* IE and Edge */
|
|
16
|
+
scrollbar-width: none; /* Firefox */
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
/* Snap scroll utilities - For smooth tab scrolling */
|
|
20
|
+
.snap-x {
|
|
21
|
+
scroll-snap-type: x mandatory;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
.snap-mandatory {
|
|
25
|
+
scroll-snap-align: start;
|
|
26
|
+
}
|