pxengine 0.1.12 → 0.1.14
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.cjs +227 -291
- package/dist/index.d.cts +15 -11
- package/dist/index.d.ts +15 -11
- package/dist/index.js +225 -287
- package/dist/registry.json +20 -22
- package/package.json +2 -4
- package/config/tailwind-preset.js +0 -106
- package/src/atoms/AccordionAtom.tsx +0 -44
- package/src/atoms/AlertAtom.tsx +0 -48
- package/src/atoms/AlertDialogAtom.tsx +0 -66
- package/src/atoms/AspectRatioAtom.tsx +0 -27
- package/src/atoms/AvatarAtom.tsx +0 -21
- package/src/atoms/BadgeAtom.tsx +0 -35
- package/src/atoms/BreadcrumbAtom.tsx +0 -36
- package/src/atoms/ButtonAtom.tsx +0 -65
- package/src/atoms/CalendarAtom.tsx +0 -24
- package/src/atoms/CardAtom.tsx +0 -66
- package/src/atoms/CarouselAtom.tsx +0 -40
- package/src/atoms/ChartAtom.tsx +0 -192
- package/src/atoms/CheckboxAtom.tsx +0 -33
- package/src/atoms/CollapsibleAtom.tsx +0 -44
- package/src/atoms/CommandAtom.tsx +0 -46
- package/src/atoms/ContextMenuAtom.tsx +0 -49
- package/src/atoms/DialogAtom.tsx +0 -68
- package/src/atoms/DrawerAtom.tsx +0 -49
- package/src/atoms/DropdownMenuAtom.tsx +0 -49
- package/src/atoms/FormInputAtom.tsx +0 -101
- package/src/atoms/FormSelectAtom.tsx +0 -110
- package/src/atoms/FormTextareaAtom.tsx +0 -93
- package/src/atoms/InputAtom.tsx +0 -216
- package/src/atoms/InputOTPAtom.tsx +0 -49
- package/src/atoms/KbdAtom.tsx +0 -25
- package/src/atoms/LabelAtom.tsx +0 -23
- package/src/atoms/LayoutAtom.tsx +0 -45
- package/src/atoms/PaginationAtom.tsx +0 -49
- package/src/atoms/PopoverAtom.tsx +0 -40
- package/src/atoms/ProgressAtom.tsx +0 -15
- package/src/atoms/RadioGroupAtom.tsx +0 -31
- package/src/atoms/RatingAtom.tsx +0 -37
- package/src/atoms/ResizableAtom.tsx +0 -51
- package/src/atoms/ScrollAreaAtom.tsx +0 -31
- package/src/atoms/SeparatorAtom.tsx +0 -16
- package/src/atoms/SheetAtom.tsx +0 -72
- package/src/atoms/SkeletonAtom.tsx +0 -22
- package/src/atoms/SliderAtom.tsx +0 -32
- package/src/atoms/SpinnerAtom.tsx +0 -26
- package/src/atoms/SwitchAtom.tsx +0 -32
- package/src/atoms/TableAtom.tsx +0 -60
- package/src/atoms/TabsAtom.tsx +0 -40
- package/src/atoms/TextAtom.tsx +0 -36
- package/src/atoms/TextareaAtom.tsx +0 -42
- package/src/atoms/TimelineAtom.tsx +0 -77
- package/src/atoms/ToggleAtom.tsx +0 -36
- package/src/atoms/TooltipAtom.tsx +0 -39
- package/src/atoms/VideoAtom.tsx +0 -34
- package/src/atoms/index.ts +0 -49
- package/src/components/index.ts +0 -178
- package/src/components/ui/accordion.tsx +0 -56
- package/src/components/ui/alert-dialog.tsx +0 -139
- package/src/components/ui/alert.tsx +0 -59
- package/src/components/ui/aspect-ratio.tsx +0 -5
- package/src/components/ui/avatar.tsx +0 -50
- package/src/components/ui/badge.tsx +0 -36
- package/src/components/ui/breadcrumb.tsx +0 -115
- package/src/components/ui/button-group.tsx +0 -83
- package/src/components/ui/button.tsx +0 -56
- package/src/components/ui/calendar.tsx +0 -213
- package/src/components/ui/card.tsx +0 -79
- package/src/components/ui/carousel.tsx +0 -260
- package/src/components/ui/chart.tsx +0 -367
- package/src/components/ui/checkbox.tsx +0 -28
- package/src/components/ui/collapsible.tsx +0 -11
- package/src/components/ui/command.tsx +0 -153
- package/src/components/ui/context-menu.tsx +0 -198
- package/src/components/ui/dialog.tsx +0 -122
- package/src/components/ui/drawer.tsx +0 -116
- package/src/components/ui/dropdown-menu.tsx +0 -200
- package/src/components/ui/empty.tsx +0 -104
- package/src/components/ui/field.tsx +0 -244
- package/src/components/ui/form.tsx +0 -176
- package/src/components/ui/hover-card.tsx +0 -27
- package/src/components/ui/index.ts +0 -54
- package/src/components/ui/input-group.tsx +0 -168
- package/src/components/ui/input-otp.tsx +0 -69
- package/src/components/ui/input.tsx +0 -22
- package/src/components/ui/item.tsx +0 -193
- package/src/components/ui/kbd.tsx +0 -28
- package/src/components/ui/label.tsx +0 -26
- package/src/components/ui/menubar.tsx +0 -254
- package/src/components/ui/navigation-menu.tsx +0 -128
- package/src/components/ui/pagination.tsx +0 -117
- package/src/components/ui/popover.tsx +0 -29
- package/src/components/ui/progress.tsx +0 -28
- package/src/components/ui/radio-group.tsx +0 -42
- package/src/components/ui/resizable.tsx +0 -44
- package/src/components/ui/scroll-area.tsx +0 -46
- package/src/components/ui/select.tsx +0 -160
- package/src/components/ui/separator.tsx +0 -29
- package/src/components/ui/sheet.tsx +0 -140
- package/src/components/ui/sidebar.tsx +0 -771
- package/src/components/ui/skeleton.tsx +0 -15
- package/src/components/ui/slider.tsx +0 -26
- package/src/components/ui/sonner.tsx +0 -45
- package/src/components/ui/spinner.tsx +0 -16
- package/src/components/ui/switch.tsx +0 -27
- package/src/components/ui/table.tsx +0 -117
- package/src/components/ui/tabs.tsx +0 -53
- package/src/components/ui/textarea.tsx +0 -22
- package/src/components/ui/toggle-group.tsx +0 -61
- package/src/components/ui/toggle.tsx +0 -43
- package/src/components/ui/tooltip.tsx +0 -30
- package/src/hooks/use-mobile.tsx +0 -19
- package/src/index.ts +0 -24
- package/src/lib/countries.ts +0 -203
- package/src/lib/index.ts +0 -2
- package/src/lib/utils.ts +0 -15
- package/src/lib/validators/index.ts +0 -1
- package/src/lib/validators/theme.ts +0 -148
- package/src/molecules/creator-discovery/AudienceDemographicsCard/AudienceDemographicsCard.tsx +0 -44
- package/src/molecules/creator-discovery/AudienceDemographicsCard/index.ts +0 -1
- package/src/molecules/creator-discovery/AudienceMetricCard/AudienceMetricCard.tsx +0 -50
- package/src/molecules/creator-discovery/AudienceMetricCard/index.ts +0 -1
- package/src/molecules/creator-discovery/BrandAffinityGroup/BrandAffinityGroup.tsx +0 -36
- package/src/molecules/creator-discovery/BrandAffinityGroup/index.ts +0 -1
- package/src/molecules/creator-discovery/CampaignSeedCard/CampaignSeedCard.tsx +0 -123
- package/src/molecules/creator-discovery/CampaignSeedCard/CampaignSeedCard.types.ts +0 -13
- package/src/molecules/creator-discovery/CampaignSeedCard/index.ts +0 -2
- package/src/molecules/creator-discovery/ContentPreviewGallery/ContentPreviewGallery.tsx +0 -41
- package/src/molecules/creator-discovery/ContentPreviewGallery/index.ts +0 -1
- package/src/molecules/creator-discovery/CreatorActionHeader/CreatorActionHeader.tsx +0 -77
- package/src/molecules/creator-discovery/CreatorActionHeader/index.ts +0 -1
- package/src/molecules/creator-discovery/CreatorGridCard/CreatorGridCard.tsx +0 -104
- package/src/molecules/creator-discovery/CreatorGridCard/index.ts +0 -1
- package/src/molecules/creator-discovery/CreatorProfileSummary/CreatorProfileSummary.tsx +0 -65
- package/src/molecules/creator-discovery/CreatorProfileSummary/index.ts +0 -1
- package/src/molecules/creator-discovery/GrowthChartCard/GrowthChartCard.tsx +0 -58
- package/src/molecules/creator-discovery/GrowthChartCard/index.ts +0 -1
- package/src/molecules/creator-discovery/MCQCard/MCQCard.tsx +0 -165
- package/src/molecules/creator-discovery/MCQCard/MCQCard.types.ts +0 -71
- package/src/molecules/creator-discovery/MCQCard/index.ts +0 -2
- package/src/molecules/creator-discovery/PlatformIconGroup/PlatformIconGroup.tsx +0 -72
- package/src/molecules/creator-discovery/PlatformIconGroup/index.ts +0 -1
- package/src/molecules/creator-discovery/SearchSpecCard/CustomFieldRenderers.tsx +0 -334
- package/src/molecules/creator-discovery/SearchSpecCard/SearchSpecCard.tsx +0 -111
- package/src/molecules/creator-discovery/SearchSpecCard/SearchSpecCard.types.ts +0 -18
- package/src/molecules/creator-discovery/SearchSpecCard/index.ts +0 -3
- package/src/molecules/creator-discovery/TopPostsGrid/TopPostsGrid.tsx +0 -49
- package/src/molecules/creator-discovery/TopPostsGrid/index.ts +0 -1
- package/src/molecules/creator-discovery/index.ts +0 -13
- package/src/molecules/generic/ActionButton/ActionButton.tsx +0 -137
- package/src/molecules/generic/ActionButton/ActionButton.types.ts +0 -68
- package/src/molecules/generic/ActionButton/index.ts +0 -2
- package/src/molecules/generic/DataGrid/DataGrid.tsx +0 -102
- package/src/molecules/generic/DataGrid/index.ts +0 -1
- package/src/molecules/generic/EditableField/EditableField.tsx +0 -229
- package/src/molecules/generic/EditableField/EditableField.types.ts +0 -73
- package/src/molecules/generic/EditableField/index.ts +0 -2
- package/src/molecules/generic/EmptyState/EmptyState.tsx +0 -61
- package/src/molecules/generic/EmptyState/index.ts +0 -1
- package/src/molecules/generic/FileUpload/FileUpload.tsx +0 -62
- package/src/molecules/generic/FileUpload/index.ts +0 -1
- package/src/molecules/generic/FilterBar/FilterBar.tsx +0 -54
- package/src/molecules/generic/FilterBar/index.ts +0 -1
- package/src/molecules/generic/FormCard/FormCard.tsx +0 -136
- package/src/molecules/generic/FormCard/FormCard.types.ts +0 -93
- package/src/molecules/generic/FormCard/index.ts +0 -2
- package/src/molecules/generic/LoadingOverlay/LoadingOverlay.tsx +0 -39
- package/src/molecules/generic/LoadingOverlay/index.ts +0 -1
- package/src/molecules/generic/NotificationList/NotificationList.tsx +0 -80
- package/src/molecules/generic/NotificationList/index.ts +0 -1
- package/src/molecules/generic/StatsGrid/StatsGrid.tsx +0 -80
- package/src/molecules/generic/StatsGrid/index.ts +0 -1
- package/src/molecules/generic/StepWizard/StepWizard.tsx +0 -67
- package/src/molecules/generic/StepWizard/index.ts +0 -1
- package/src/molecules/generic/TagCloud/TagCloud.tsx +0 -32
- package/src/molecules/generic/TagCloud/index.ts +0 -1
- package/src/molecules/generic/index.ts +0 -12
- package/src/molecules/index.ts +0 -2
- package/src/render/PXEngineRenderer.tsx +0 -458
- package/src/render/index.ts +0 -1
- package/src/styles/globals.css +0 -146
- package/src/types/atoms.ts +0 -450
- package/src/types/common.ts +0 -116
- package/src/types/index.ts +0 -3
- package/src/types/molecules.ts +0 -279
- package/src/types/schema.ts +0 -12
|
@@ -1,193 +0,0 @@
|
|
|
1
|
-
import * as React from "react"
|
|
2
|
-
import { Slot } from "@radix-ui/react-slot"
|
|
3
|
-
import { cva, type VariantProps } from "class-variance-authority"
|
|
4
|
-
|
|
5
|
-
import { cn } from "@/lib/utils"
|
|
6
|
-
import { Separator } from "@/components/ui/separator"
|
|
7
|
-
|
|
8
|
-
function ItemGroup({ className, ...props }: React.ComponentProps<"div">) {
|
|
9
|
-
return (
|
|
10
|
-
<div
|
|
11
|
-
role="list"
|
|
12
|
-
data-slot="item-group"
|
|
13
|
-
className={cn("group/item-group flex flex-col", className)}
|
|
14
|
-
{...props}
|
|
15
|
-
/>
|
|
16
|
-
)
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
function ItemSeparator({
|
|
20
|
-
className,
|
|
21
|
-
...props
|
|
22
|
-
}: React.ComponentProps<typeof Separator>) {
|
|
23
|
-
return (
|
|
24
|
-
<Separator
|
|
25
|
-
data-slot="item-separator"
|
|
26
|
-
orientation="horizontal"
|
|
27
|
-
className={cn("my-0", className)}
|
|
28
|
-
{...props}
|
|
29
|
-
/>
|
|
30
|
-
)
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
const itemVariants = cva(
|
|
34
|
-
"group/item [a]:hover:bg-accent/50 focus-visible:border-ring focus-visible:ring-ring/50 [a]:transition-colors flex flex-wrap items-center rounded-md border border-transparent text-sm outline-none transition-colors duration-100 focus-visible:ring-[3px]",
|
|
35
|
-
{
|
|
36
|
-
variants: {
|
|
37
|
-
variant: {
|
|
38
|
-
default: "bg-transparent",
|
|
39
|
-
outline: "border-border",
|
|
40
|
-
muted: "bg-muted/50",
|
|
41
|
-
},
|
|
42
|
-
size: {
|
|
43
|
-
default: "gap-4 p-4 ",
|
|
44
|
-
sm: "gap-2.5 px-4 py-3",
|
|
45
|
-
},
|
|
46
|
-
},
|
|
47
|
-
defaultVariants: {
|
|
48
|
-
variant: "default",
|
|
49
|
-
size: "default",
|
|
50
|
-
},
|
|
51
|
-
}
|
|
52
|
-
)
|
|
53
|
-
|
|
54
|
-
function Item({
|
|
55
|
-
className,
|
|
56
|
-
variant = "default",
|
|
57
|
-
size = "default",
|
|
58
|
-
asChild = false,
|
|
59
|
-
...props
|
|
60
|
-
}: React.ComponentProps<"div"> &
|
|
61
|
-
VariantProps<typeof itemVariants> & { asChild?: boolean }) {
|
|
62
|
-
const Comp = asChild ? Slot : "div"
|
|
63
|
-
return (
|
|
64
|
-
<Comp
|
|
65
|
-
data-slot="item"
|
|
66
|
-
data-variant={variant}
|
|
67
|
-
data-size={size}
|
|
68
|
-
className={cn(itemVariants({ variant, size, className }))}
|
|
69
|
-
{...props}
|
|
70
|
-
/>
|
|
71
|
-
)
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
const itemMediaVariants = cva(
|
|
75
|
-
"flex shrink-0 items-center justify-center gap-2 group-has-[[data-slot=item-description]]/item:translate-y-0.5 group-has-[[data-slot=item-description]]/item:self-start [&_svg]:pointer-events-none",
|
|
76
|
-
{
|
|
77
|
-
variants: {
|
|
78
|
-
variant: {
|
|
79
|
-
default: "bg-transparent",
|
|
80
|
-
icon: "bg-muted size-8 rounded-sm border [&_svg:not([class*='size-'])]:size-4",
|
|
81
|
-
image:
|
|
82
|
-
"size-10 overflow-hidden rounded-sm [&_img]:size-full [&_img]:object-cover",
|
|
83
|
-
},
|
|
84
|
-
},
|
|
85
|
-
defaultVariants: {
|
|
86
|
-
variant: "default",
|
|
87
|
-
},
|
|
88
|
-
}
|
|
89
|
-
)
|
|
90
|
-
|
|
91
|
-
function ItemMedia({
|
|
92
|
-
className,
|
|
93
|
-
variant = "default",
|
|
94
|
-
...props
|
|
95
|
-
}: React.ComponentProps<"div"> & VariantProps<typeof itemMediaVariants>) {
|
|
96
|
-
return (
|
|
97
|
-
<div
|
|
98
|
-
data-slot="item-media"
|
|
99
|
-
data-variant={variant}
|
|
100
|
-
className={cn(itemMediaVariants({ variant, className }))}
|
|
101
|
-
{...props}
|
|
102
|
-
/>
|
|
103
|
-
)
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
function ItemContent({ className, ...props }: React.ComponentProps<"div">) {
|
|
107
|
-
return (
|
|
108
|
-
<div
|
|
109
|
-
data-slot="item-content"
|
|
110
|
-
className={cn(
|
|
111
|
-
"flex flex-1 flex-col gap-1 [&+[data-slot=item-content]]:flex-none",
|
|
112
|
-
className
|
|
113
|
-
)}
|
|
114
|
-
{...props}
|
|
115
|
-
/>
|
|
116
|
-
)
|
|
117
|
-
}
|
|
118
|
-
|
|
119
|
-
function ItemTitle({ className, ...props }: React.ComponentProps<"div">) {
|
|
120
|
-
return (
|
|
121
|
-
<div
|
|
122
|
-
data-slot="item-title"
|
|
123
|
-
className={cn(
|
|
124
|
-
"flex w-fit items-center gap-2 text-sm font-medium leading-snug",
|
|
125
|
-
className
|
|
126
|
-
)}
|
|
127
|
-
{...props}
|
|
128
|
-
/>
|
|
129
|
-
)
|
|
130
|
-
}
|
|
131
|
-
|
|
132
|
-
function ItemDescription({ className, ...props }: React.ComponentProps<"p">) {
|
|
133
|
-
return (
|
|
134
|
-
<p
|
|
135
|
-
data-slot="item-description"
|
|
136
|
-
className={cn(
|
|
137
|
-
"text-muted-foreground line-clamp-2 text-balance text-sm font-normal leading-normal",
|
|
138
|
-
"[&>a:hover]:text-primary [&>a]:underline [&>a]:underline-offset-4",
|
|
139
|
-
className
|
|
140
|
-
)}
|
|
141
|
-
{...props}
|
|
142
|
-
/>
|
|
143
|
-
)
|
|
144
|
-
}
|
|
145
|
-
|
|
146
|
-
function ItemActions({ className, ...props }: React.ComponentProps<"div">) {
|
|
147
|
-
return (
|
|
148
|
-
<div
|
|
149
|
-
data-slot="item-actions"
|
|
150
|
-
className={cn("flex items-center gap-2", className)}
|
|
151
|
-
{...props}
|
|
152
|
-
/>
|
|
153
|
-
)
|
|
154
|
-
}
|
|
155
|
-
|
|
156
|
-
function ItemHeader({ className, ...props }: React.ComponentProps<"div">) {
|
|
157
|
-
return (
|
|
158
|
-
<div
|
|
159
|
-
data-slot="item-header"
|
|
160
|
-
className={cn(
|
|
161
|
-
"flex basis-full items-center justify-between gap-2",
|
|
162
|
-
className
|
|
163
|
-
)}
|
|
164
|
-
{...props}
|
|
165
|
-
/>
|
|
166
|
-
)
|
|
167
|
-
}
|
|
168
|
-
|
|
169
|
-
function ItemFooter({ className, ...props }: React.ComponentProps<"div">) {
|
|
170
|
-
return (
|
|
171
|
-
<div
|
|
172
|
-
data-slot="item-footer"
|
|
173
|
-
className={cn(
|
|
174
|
-
"flex basis-full items-center justify-between gap-2",
|
|
175
|
-
className
|
|
176
|
-
)}
|
|
177
|
-
{...props}
|
|
178
|
-
/>
|
|
179
|
-
)
|
|
180
|
-
}
|
|
181
|
-
|
|
182
|
-
export {
|
|
183
|
-
Item,
|
|
184
|
-
ItemMedia,
|
|
185
|
-
ItemContent,
|
|
186
|
-
ItemActions,
|
|
187
|
-
ItemGroup,
|
|
188
|
-
ItemSeparator,
|
|
189
|
-
ItemTitle,
|
|
190
|
-
ItemDescription,
|
|
191
|
-
ItemHeader,
|
|
192
|
-
ItemFooter,
|
|
193
|
-
}
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import { cn } from "@/lib/utils"
|
|
2
|
-
|
|
3
|
-
function Kbd({ className, ...props }: React.ComponentProps<"kbd">) {
|
|
4
|
-
return (
|
|
5
|
-
<kbd
|
|
6
|
-
data-slot="kbd"
|
|
7
|
-
className={cn(
|
|
8
|
-
"bg-muted text-muted-foreground pointer-events-none inline-flex h-5 w-fit min-w-5 select-none items-center justify-center gap-1 rounded-sm px-1 font-sans text-xs font-medium",
|
|
9
|
-
"[&_svg:not([class*='size-'])]:size-3",
|
|
10
|
-
"[[data-slot=tooltip-content]_&]:bg-background/20 [[data-slot=tooltip-content]_&]:text-background dark:[[data-slot=tooltip-content]_&]:bg-background/10",
|
|
11
|
-
className
|
|
12
|
-
)}
|
|
13
|
-
{...props}
|
|
14
|
-
/>
|
|
15
|
-
)
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
function KbdGroup({ className, ...props }: React.ComponentProps<"div">) {
|
|
19
|
-
return (
|
|
20
|
-
<kbd
|
|
21
|
-
data-slot="kbd-group"
|
|
22
|
-
className={cn("inline-flex items-center gap-1", className)}
|
|
23
|
-
{...props}
|
|
24
|
-
/>
|
|
25
|
-
)
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
export { Kbd, KbdGroup }
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
"use client"
|
|
2
|
-
|
|
3
|
-
import * as React from "react"
|
|
4
|
-
import * as LabelPrimitive from "@radix-ui/react-label"
|
|
5
|
-
import { cva, type VariantProps } from "class-variance-authority"
|
|
6
|
-
|
|
7
|
-
import { cn } from "@/lib/utils"
|
|
8
|
-
|
|
9
|
-
const labelVariants = cva(
|
|
10
|
-
"text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"
|
|
11
|
-
)
|
|
12
|
-
|
|
13
|
-
const Label = React.forwardRef<
|
|
14
|
-
React.ElementRef<typeof LabelPrimitive.Root>,
|
|
15
|
-
React.ComponentPropsWithoutRef<typeof LabelPrimitive.Root> &
|
|
16
|
-
VariantProps<typeof labelVariants>
|
|
17
|
-
>(({ className, ...props }, ref) => (
|
|
18
|
-
<LabelPrimitive.Root
|
|
19
|
-
ref={ref}
|
|
20
|
-
className={cn(labelVariants(), className)}
|
|
21
|
-
{...props}
|
|
22
|
-
/>
|
|
23
|
-
))
|
|
24
|
-
Label.displayName = LabelPrimitive.Root.displayName
|
|
25
|
-
|
|
26
|
-
export { Label }
|
|
@@ -1,254 +0,0 @@
|
|
|
1
|
-
import * as React from "react"
|
|
2
|
-
import * as MenubarPrimitive from "@radix-ui/react-menubar"
|
|
3
|
-
import { Check, ChevronRight, Circle } from "lucide-react"
|
|
4
|
-
|
|
5
|
-
import { cn } from "@/lib/utils"
|
|
6
|
-
|
|
7
|
-
function MenubarMenu({
|
|
8
|
-
...props
|
|
9
|
-
}: React.ComponentProps<typeof MenubarPrimitive.Menu>) {
|
|
10
|
-
return <MenubarPrimitive.Menu {...props} />
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
function MenubarGroup({
|
|
14
|
-
...props
|
|
15
|
-
}: React.ComponentProps<typeof MenubarPrimitive.Group>) {
|
|
16
|
-
return <MenubarPrimitive.Group {...props} />
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
function MenubarPortal({
|
|
20
|
-
...props
|
|
21
|
-
}: React.ComponentProps<typeof MenubarPrimitive.Portal>) {
|
|
22
|
-
return <MenubarPrimitive.Portal {...props} />
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
function MenubarRadioGroup({
|
|
26
|
-
...props
|
|
27
|
-
}: React.ComponentProps<typeof MenubarPrimitive.RadioGroup>) {
|
|
28
|
-
return <MenubarPrimitive.RadioGroup {...props} />
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
function MenubarSub({
|
|
32
|
-
...props
|
|
33
|
-
}: React.ComponentProps<typeof MenubarPrimitive.Sub>) {
|
|
34
|
-
return <MenubarPrimitive.Sub data-slot="menubar-sub" {...props} />
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
const Menubar = React.forwardRef<
|
|
38
|
-
React.ElementRef<typeof MenubarPrimitive.Root>,
|
|
39
|
-
React.ComponentPropsWithoutRef<typeof MenubarPrimitive.Root>
|
|
40
|
-
>(({ className, ...props }, ref) => (
|
|
41
|
-
<MenubarPrimitive.Root
|
|
42
|
-
ref={ref}
|
|
43
|
-
className={cn(
|
|
44
|
-
"flex h-10 items-center space-x-1 rounded-md border bg-background p-1",
|
|
45
|
-
className
|
|
46
|
-
)}
|
|
47
|
-
{...props}
|
|
48
|
-
/>
|
|
49
|
-
))
|
|
50
|
-
Menubar.displayName = MenubarPrimitive.Root.displayName
|
|
51
|
-
|
|
52
|
-
const MenubarTrigger = React.forwardRef<
|
|
53
|
-
React.ElementRef<typeof MenubarPrimitive.Trigger>,
|
|
54
|
-
React.ComponentPropsWithoutRef<typeof MenubarPrimitive.Trigger>
|
|
55
|
-
>(({ className, ...props }, ref) => (
|
|
56
|
-
<MenubarPrimitive.Trigger
|
|
57
|
-
ref={ref}
|
|
58
|
-
className={cn(
|
|
59
|
-
"flex cursor-default select-none items-center rounded-sm px-3 py-1.5 text-sm font-medium outline-none focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground",
|
|
60
|
-
className
|
|
61
|
-
)}
|
|
62
|
-
{...props}
|
|
63
|
-
/>
|
|
64
|
-
))
|
|
65
|
-
MenubarTrigger.displayName = MenubarPrimitive.Trigger.displayName
|
|
66
|
-
|
|
67
|
-
const MenubarSubTrigger = React.forwardRef<
|
|
68
|
-
React.ElementRef<typeof MenubarPrimitive.SubTrigger>,
|
|
69
|
-
React.ComponentPropsWithoutRef<typeof MenubarPrimitive.SubTrigger> & {
|
|
70
|
-
inset?: boolean
|
|
71
|
-
}
|
|
72
|
-
>(({ className, inset, children, ...props }, ref) => (
|
|
73
|
-
<MenubarPrimitive.SubTrigger
|
|
74
|
-
ref={ref}
|
|
75
|
-
className={cn(
|
|
76
|
-
"flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground",
|
|
77
|
-
inset && "pl-8",
|
|
78
|
-
className
|
|
79
|
-
)}
|
|
80
|
-
{...props}
|
|
81
|
-
>
|
|
82
|
-
{children}
|
|
83
|
-
<ChevronRight className="ml-auto h-4 w-4" />
|
|
84
|
-
</MenubarPrimitive.SubTrigger>
|
|
85
|
-
))
|
|
86
|
-
MenubarSubTrigger.displayName = MenubarPrimitive.SubTrigger.displayName
|
|
87
|
-
|
|
88
|
-
const MenubarSubContent = React.forwardRef<
|
|
89
|
-
React.ElementRef<typeof MenubarPrimitive.SubContent>,
|
|
90
|
-
React.ComponentPropsWithoutRef<typeof MenubarPrimitive.SubContent>
|
|
91
|
-
>(({ className, ...props }, ref) => (
|
|
92
|
-
<MenubarPrimitive.SubContent
|
|
93
|
-
ref={ref}
|
|
94
|
-
className={cn(
|
|
95
|
-
"z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-[--radix-menubar-content-transform-origin]",
|
|
96
|
-
className
|
|
97
|
-
)}
|
|
98
|
-
{...props}
|
|
99
|
-
/>
|
|
100
|
-
))
|
|
101
|
-
MenubarSubContent.displayName = MenubarPrimitive.SubContent.displayName
|
|
102
|
-
|
|
103
|
-
const MenubarContent = React.forwardRef<
|
|
104
|
-
React.ElementRef<typeof MenubarPrimitive.Content>,
|
|
105
|
-
React.ComponentPropsWithoutRef<typeof MenubarPrimitive.Content>
|
|
106
|
-
>(
|
|
107
|
-
(
|
|
108
|
-
{ className, align = "start", alignOffset = -4, sideOffset = 8, ...props },
|
|
109
|
-
ref
|
|
110
|
-
) => (
|
|
111
|
-
<MenubarPrimitive.Portal>
|
|
112
|
-
<MenubarPrimitive.Content
|
|
113
|
-
ref={ref}
|
|
114
|
-
align={align}
|
|
115
|
-
alignOffset={alignOffset}
|
|
116
|
-
sideOffset={sideOffset}
|
|
117
|
-
className={cn(
|
|
118
|
-
"z-50 min-w-[12rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-[--radix-menubar-content-transform-origin]",
|
|
119
|
-
className
|
|
120
|
-
)}
|
|
121
|
-
{...props}
|
|
122
|
-
/>
|
|
123
|
-
</MenubarPrimitive.Portal>
|
|
124
|
-
)
|
|
125
|
-
)
|
|
126
|
-
MenubarContent.displayName = MenubarPrimitive.Content.displayName
|
|
127
|
-
|
|
128
|
-
const MenubarItem = React.forwardRef<
|
|
129
|
-
React.ElementRef<typeof MenubarPrimitive.Item>,
|
|
130
|
-
React.ComponentPropsWithoutRef<typeof MenubarPrimitive.Item> & {
|
|
131
|
-
inset?: boolean
|
|
132
|
-
}
|
|
133
|
-
>(({ className, inset, ...props }, ref) => (
|
|
134
|
-
<MenubarPrimitive.Item
|
|
135
|
-
ref={ref}
|
|
136
|
-
className={cn(
|
|
137
|
-
"relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
|
|
138
|
-
inset && "pl-8",
|
|
139
|
-
className
|
|
140
|
-
)}
|
|
141
|
-
{...props}
|
|
142
|
-
/>
|
|
143
|
-
))
|
|
144
|
-
MenubarItem.displayName = MenubarPrimitive.Item.displayName
|
|
145
|
-
|
|
146
|
-
const MenubarCheckboxItem = React.forwardRef<
|
|
147
|
-
React.ElementRef<typeof MenubarPrimitive.CheckboxItem>,
|
|
148
|
-
React.ComponentPropsWithoutRef<typeof MenubarPrimitive.CheckboxItem>
|
|
149
|
-
>(({ className, children, checked, ...props }, ref) => (
|
|
150
|
-
<MenubarPrimitive.CheckboxItem
|
|
151
|
-
ref={ref}
|
|
152
|
-
className={cn(
|
|
153
|
-
"relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
|
|
154
|
-
className
|
|
155
|
-
)}
|
|
156
|
-
checked={checked}
|
|
157
|
-
{...props}
|
|
158
|
-
>
|
|
159
|
-
<span className="absolute left-2 flex h-3.5 w-3.5 items-center justify-center">
|
|
160
|
-
<MenubarPrimitive.ItemIndicator>
|
|
161
|
-
<Check className="h-4 w-4" />
|
|
162
|
-
</MenubarPrimitive.ItemIndicator>
|
|
163
|
-
</span>
|
|
164
|
-
{children}
|
|
165
|
-
</MenubarPrimitive.CheckboxItem>
|
|
166
|
-
))
|
|
167
|
-
MenubarCheckboxItem.displayName = MenubarPrimitive.CheckboxItem.displayName
|
|
168
|
-
|
|
169
|
-
const MenubarRadioItem = React.forwardRef<
|
|
170
|
-
React.ElementRef<typeof MenubarPrimitive.RadioItem>,
|
|
171
|
-
React.ComponentPropsWithoutRef<typeof MenubarPrimitive.RadioItem>
|
|
172
|
-
>(({ className, children, ...props }, ref) => (
|
|
173
|
-
<MenubarPrimitive.RadioItem
|
|
174
|
-
ref={ref}
|
|
175
|
-
className={cn(
|
|
176
|
-
"relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
|
|
177
|
-
className
|
|
178
|
-
)}
|
|
179
|
-
{...props}
|
|
180
|
-
>
|
|
181
|
-
<span className="absolute left-2 flex h-3.5 w-3.5 items-center justify-center">
|
|
182
|
-
<MenubarPrimitive.ItemIndicator>
|
|
183
|
-
<Circle className="h-2 w-2 fill-current" />
|
|
184
|
-
</MenubarPrimitive.ItemIndicator>
|
|
185
|
-
</span>
|
|
186
|
-
{children}
|
|
187
|
-
</MenubarPrimitive.RadioItem>
|
|
188
|
-
))
|
|
189
|
-
MenubarRadioItem.displayName = MenubarPrimitive.RadioItem.displayName
|
|
190
|
-
|
|
191
|
-
const MenubarLabel = React.forwardRef<
|
|
192
|
-
React.ElementRef<typeof MenubarPrimitive.Label>,
|
|
193
|
-
React.ComponentPropsWithoutRef<typeof MenubarPrimitive.Label> & {
|
|
194
|
-
inset?: boolean
|
|
195
|
-
}
|
|
196
|
-
>(({ className, inset, ...props }, ref) => (
|
|
197
|
-
<MenubarPrimitive.Label
|
|
198
|
-
ref={ref}
|
|
199
|
-
className={cn(
|
|
200
|
-
"px-2 py-1.5 text-sm font-semibold",
|
|
201
|
-
inset && "pl-8",
|
|
202
|
-
className
|
|
203
|
-
)}
|
|
204
|
-
{...props}
|
|
205
|
-
/>
|
|
206
|
-
))
|
|
207
|
-
MenubarLabel.displayName = MenubarPrimitive.Label.displayName
|
|
208
|
-
|
|
209
|
-
const MenubarSeparator = React.forwardRef<
|
|
210
|
-
React.ElementRef<typeof MenubarPrimitive.Separator>,
|
|
211
|
-
React.ComponentPropsWithoutRef<typeof MenubarPrimitive.Separator>
|
|
212
|
-
>(({ className, ...props }, ref) => (
|
|
213
|
-
<MenubarPrimitive.Separator
|
|
214
|
-
ref={ref}
|
|
215
|
-
className={cn("-mx-1 my-1 h-px bg-muted", className)}
|
|
216
|
-
{...props}
|
|
217
|
-
/>
|
|
218
|
-
))
|
|
219
|
-
MenubarSeparator.displayName = MenubarPrimitive.Separator.displayName
|
|
220
|
-
|
|
221
|
-
const MenubarShortcut = ({
|
|
222
|
-
className,
|
|
223
|
-
...props
|
|
224
|
-
}: React.HTMLAttributes<HTMLSpanElement>) => {
|
|
225
|
-
return (
|
|
226
|
-
<span
|
|
227
|
-
className={cn(
|
|
228
|
-
"ml-auto text-xs tracking-widest text-muted-foreground",
|
|
229
|
-
className
|
|
230
|
-
)}
|
|
231
|
-
{...props}
|
|
232
|
-
/>
|
|
233
|
-
)
|
|
234
|
-
}
|
|
235
|
-
MenubarShortcut.displayname = "MenubarShortcut"
|
|
236
|
-
|
|
237
|
-
export {
|
|
238
|
-
Menubar,
|
|
239
|
-
MenubarMenu,
|
|
240
|
-
MenubarTrigger,
|
|
241
|
-
MenubarContent,
|
|
242
|
-
MenubarItem,
|
|
243
|
-
MenubarSeparator,
|
|
244
|
-
MenubarLabel,
|
|
245
|
-
MenubarCheckboxItem,
|
|
246
|
-
MenubarRadioGroup,
|
|
247
|
-
MenubarRadioItem,
|
|
248
|
-
MenubarPortal,
|
|
249
|
-
MenubarSubContent,
|
|
250
|
-
MenubarSubTrigger,
|
|
251
|
-
MenubarGroup,
|
|
252
|
-
MenubarSub,
|
|
253
|
-
MenubarShortcut,
|
|
254
|
-
}
|
|
@@ -1,128 +0,0 @@
|
|
|
1
|
-
import * as React from "react"
|
|
2
|
-
import * as NavigationMenuPrimitive from "@radix-ui/react-navigation-menu"
|
|
3
|
-
import { cva } from "class-variance-authority"
|
|
4
|
-
import { ChevronDown } from "lucide-react"
|
|
5
|
-
|
|
6
|
-
import { cn } from "@/lib/utils"
|
|
7
|
-
|
|
8
|
-
const NavigationMenu = React.forwardRef<
|
|
9
|
-
React.ElementRef<typeof NavigationMenuPrimitive.Root>,
|
|
10
|
-
React.ComponentPropsWithoutRef<typeof NavigationMenuPrimitive.Root>
|
|
11
|
-
>(({ className, children, ...props }, ref) => (
|
|
12
|
-
<NavigationMenuPrimitive.Root
|
|
13
|
-
ref={ref}
|
|
14
|
-
className={cn(
|
|
15
|
-
"relative z-10 flex max-w-max flex-1 items-center justify-center",
|
|
16
|
-
className
|
|
17
|
-
)}
|
|
18
|
-
{...props}
|
|
19
|
-
>
|
|
20
|
-
{children}
|
|
21
|
-
<NavigationMenuViewport />
|
|
22
|
-
</NavigationMenuPrimitive.Root>
|
|
23
|
-
))
|
|
24
|
-
NavigationMenu.displayName = NavigationMenuPrimitive.Root.displayName
|
|
25
|
-
|
|
26
|
-
const NavigationMenuList = React.forwardRef<
|
|
27
|
-
React.ElementRef<typeof NavigationMenuPrimitive.List>,
|
|
28
|
-
React.ComponentPropsWithoutRef<typeof NavigationMenuPrimitive.List>
|
|
29
|
-
>(({ className, ...props }, ref) => (
|
|
30
|
-
<NavigationMenuPrimitive.List
|
|
31
|
-
ref={ref}
|
|
32
|
-
className={cn(
|
|
33
|
-
"group flex flex-1 list-none items-center justify-center space-x-1",
|
|
34
|
-
className
|
|
35
|
-
)}
|
|
36
|
-
{...props}
|
|
37
|
-
/>
|
|
38
|
-
))
|
|
39
|
-
NavigationMenuList.displayName = NavigationMenuPrimitive.List.displayName
|
|
40
|
-
|
|
41
|
-
const NavigationMenuItem = NavigationMenuPrimitive.Item
|
|
42
|
-
|
|
43
|
-
const navigationMenuTriggerStyle = cva(
|
|
44
|
-
"group inline-flex h-10 w-max items-center justify-center rounded-md bg-background px-4 py-2 text-sm font-medium transition-colors hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground focus:outline-none disabled:pointer-events-none disabled:opacity-50 data-[state=open]:text-accent-foreground data-[state=open]:bg-accent/50 data-[state=open]:hover:bg-accent data-[state=open]:focus:bg-accent"
|
|
45
|
-
)
|
|
46
|
-
|
|
47
|
-
const NavigationMenuTrigger = React.forwardRef<
|
|
48
|
-
React.ElementRef<typeof NavigationMenuPrimitive.Trigger>,
|
|
49
|
-
React.ComponentPropsWithoutRef<typeof NavigationMenuPrimitive.Trigger>
|
|
50
|
-
>(({ className, children, ...props }, ref) => (
|
|
51
|
-
<NavigationMenuPrimitive.Trigger
|
|
52
|
-
ref={ref}
|
|
53
|
-
className={cn(navigationMenuTriggerStyle(), "group", className)}
|
|
54
|
-
{...props}
|
|
55
|
-
>
|
|
56
|
-
{children}{" "}
|
|
57
|
-
<ChevronDown
|
|
58
|
-
className="relative top-[1px] ml-1 h-3 w-3 transition duration-200 group-data-[state=open]:rotate-180"
|
|
59
|
-
aria-hidden="true"
|
|
60
|
-
/>
|
|
61
|
-
</NavigationMenuPrimitive.Trigger>
|
|
62
|
-
))
|
|
63
|
-
NavigationMenuTrigger.displayName = NavigationMenuPrimitive.Trigger.displayName
|
|
64
|
-
|
|
65
|
-
const NavigationMenuContent = React.forwardRef<
|
|
66
|
-
React.ElementRef<typeof NavigationMenuPrimitive.Content>,
|
|
67
|
-
React.ComponentPropsWithoutRef<typeof NavigationMenuPrimitive.Content>
|
|
68
|
-
>(({ className, ...props }, ref) => (
|
|
69
|
-
<NavigationMenuPrimitive.Content
|
|
70
|
-
ref={ref}
|
|
71
|
-
className={cn(
|
|
72
|
-
"left-0 top-0 w-full data-[motion^=from-]:animate-in data-[motion^=to-]:animate-out data-[motion^=from-]:fade-in data-[motion^=to-]:fade-out data-[motion=from-end]:slide-in-from-right-52 data-[motion=from-start]:slide-in-from-left-52 data-[motion=to-end]:slide-out-to-right-52 data-[motion=to-start]:slide-out-to-left-52 md:absolute md:w-auto ",
|
|
73
|
-
className
|
|
74
|
-
)}
|
|
75
|
-
{...props}
|
|
76
|
-
/>
|
|
77
|
-
))
|
|
78
|
-
NavigationMenuContent.displayName = NavigationMenuPrimitive.Content.displayName
|
|
79
|
-
|
|
80
|
-
const NavigationMenuLink = NavigationMenuPrimitive.Link
|
|
81
|
-
|
|
82
|
-
const NavigationMenuViewport = React.forwardRef<
|
|
83
|
-
React.ElementRef<typeof NavigationMenuPrimitive.Viewport>,
|
|
84
|
-
React.ComponentPropsWithoutRef<typeof NavigationMenuPrimitive.Viewport>
|
|
85
|
-
>(({ className, ...props }, ref) => (
|
|
86
|
-
<div className={cn("absolute left-0 top-full flex justify-center")}>
|
|
87
|
-
<NavigationMenuPrimitive.Viewport
|
|
88
|
-
className={cn(
|
|
89
|
-
"origin-top-center relative mt-1.5 h-[var(--radix-navigation-menu-viewport-height)] w-full overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-90 md:w-[var(--radix-navigation-menu-viewport-width)]",
|
|
90
|
-
className
|
|
91
|
-
)}
|
|
92
|
-
ref={ref}
|
|
93
|
-
{...props}
|
|
94
|
-
/>
|
|
95
|
-
</div>
|
|
96
|
-
))
|
|
97
|
-
NavigationMenuViewport.displayName =
|
|
98
|
-
NavigationMenuPrimitive.Viewport.displayName
|
|
99
|
-
|
|
100
|
-
const NavigationMenuIndicator = React.forwardRef<
|
|
101
|
-
React.ElementRef<typeof NavigationMenuPrimitive.Indicator>,
|
|
102
|
-
React.ComponentPropsWithoutRef<typeof NavigationMenuPrimitive.Indicator>
|
|
103
|
-
>(({ className, ...props }, ref) => (
|
|
104
|
-
<NavigationMenuPrimitive.Indicator
|
|
105
|
-
ref={ref}
|
|
106
|
-
className={cn(
|
|
107
|
-
"top-full z-[1] flex h-1.5 items-end justify-center overflow-hidden data-[state=visible]:animate-in data-[state=hidden]:animate-out data-[state=hidden]:fade-out data-[state=visible]:fade-in",
|
|
108
|
-
className
|
|
109
|
-
)}
|
|
110
|
-
{...props}
|
|
111
|
-
>
|
|
112
|
-
<div className="relative top-[60%] h-2 w-2 rotate-45 rounded-tl-sm bg-border shadow-md" />
|
|
113
|
-
</NavigationMenuPrimitive.Indicator>
|
|
114
|
-
))
|
|
115
|
-
NavigationMenuIndicator.displayName =
|
|
116
|
-
NavigationMenuPrimitive.Indicator.displayName
|
|
117
|
-
|
|
118
|
-
export {
|
|
119
|
-
navigationMenuTriggerStyle,
|
|
120
|
-
NavigationMenu,
|
|
121
|
-
NavigationMenuList,
|
|
122
|
-
NavigationMenuItem,
|
|
123
|
-
NavigationMenuContent,
|
|
124
|
-
NavigationMenuTrigger,
|
|
125
|
-
NavigationMenuLink,
|
|
126
|
-
NavigationMenuIndicator,
|
|
127
|
-
NavigationMenuViewport,
|
|
128
|
-
}
|