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,115 +0,0 @@
|
|
|
1
|
-
import * as React from "react"
|
|
2
|
-
import { Slot } from "@radix-ui/react-slot"
|
|
3
|
-
import { ChevronRight, MoreHorizontal } from "lucide-react"
|
|
4
|
-
|
|
5
|
-
import { cn } from "@/lib/utils"
|
|
6
|
-
|
|
7
|
-
const Breadcrumb = React.forwardRef<
|
|
8
|
-
HTMLElement,
|
|
9
|
-
React.ComponentPropsWithoutRef<"nav"> & {
|
|
10
|
-
separator?: React.ReactNode
|
|
11
|
-
}
|
|
12
|
-
>(({ ...props }, ref) => <nav ref={ref} aria-label="breadcrumb" {...props} />)
|
|
13
|
-
Breadcrumb.displayName = "Breadcrumb"
|
|
14
|
-
|
|
15
|
-
const BreadcrumbList = React.forwardRef<
|
|
16
|
-
HTMLOListElement,
|
|
17
|
-
React.ComponentPropsWithoutRef<"ol">
|
|
18
|
-
>(({ className, ...props }, ref) => (
|
|
19
|
-
<ol
|
|
20
|
-
ref={ref}
|
|
21
|
-
className={cn(
|
|
22
|
-
"flex flex-wrap items-center gap-1.5 break-words text-sm text-muted-foreground sm:gap-2.5",
|
|
23
|
-
className
|
|
24
|
-
)}
|
|
25
|
-
{...props}
|
|
26
|
-
/>
|
|
27
|
-
))
|
|
28
|
-
BreadcrumbList.displayName = "BreadcrumbList"
|
|
29
|
-
|
|
30
|
-
const BreadcrumbItem = React.forwardRef<
|
|
31
|
-
HTMLLIElement,
|
|
32
|
-
React.ComponentPropsWithoutRef<"li">
|
|
33
|
-
>(({ className, ...props }, ref) => (
|
|
34
|
-
<li
|
|
35
|
-
ref={ref}
|
|
36
|
-
className={cn("inline-flex items-center gap-1.5", className)}
|
|
37
|
-
{...props}
|
|
38
|
-
/>
|
|
39
|
-
))
|
|
40
|
-
BreadcrumbItem.displayName = "BreadcrumbItem"
|
|
41
|
-
|
|
42
|
-
const BreadcrumbLink = React.forwardRef<
|
|
43
|
-
HTMLAnchorElement,
|
|
44
|
-
React.ComponentPropsWithoutRef<"a"> & {
|
|
45
|
-
asChild?: boolean
|
|
46
|
-
}
|
|
47
|
-
>(({ asChild, className, ...props }, ref) => {
|
|
48
|
-
const Comp = asChild ? Slot : "a"
|
|
49
|
-
|
|
50
|
-
return (
|
|
51
|
-
<Comp
|
|
52
|
-
ref={ref}
|
|
53
|
-
className={cn("transition-colors hover:text-foreground", className)}
|
|
54
|
-
{...props}
|
|
55
|
-
/>
|
|
56
|
-
)
|
|
57
|
-
})
|
|
58
|
-
BreadcrumbLink.displayName = "BreadcrumbLink"
|
|
59
|
-
|
|
60
|
-
const BreadcrumbPage = React.forwardRef<
|
|
61
|
-
HTMLSpanElement,
|
|
62
|
-
React.ComponentPropsWithoutRef<"span">
|
|
63
|
-
>(({ className, ...props }, ref) => (
|
|
64
|
-
<span
|
|
65
|
-
ref={ref}
|
|
66
|
-
role="link"
|
|
67
|
-
aria-disabled="true"
|
|
68
|
-
aria-current="page"
|
|
69
|
-
className={cn("font-normal text-foreground", className)}
|
|
70
|
-
{...props}
|
|
71
|
-
/>
|
|
72
|
-
))
|
|
73
|
-
BreadcrumbPage.displayName = "BreadcrumbPage"
|
|
74
|
-
|
|
75
|
-
const BreadcrumbSeparator = ({
|
|
76
|
-
children,
|
|
77
|
-
className,
|
|
78
|
-
...props
|
|
79
|
-
}: React.ComponentProps<"li">) => (
|
|
80
|
-
<li
|
|
81
|
-
role="presentation"
|
|
82
|
-
aria-hidden="true"
|
|
83
|
-
className={cn("[&>svg]:w-3.5 [&>svg]:h-3.5", className)}
|
|
84
|
-
{...props}
|
|
85
|
-
>
|
|
86
|
-
{children ?? <ChevronRight />}
|
|
87
|
-
</li>
|
|
88
|
-
)
|
|
89
|
-
BreadcrumbSeparator.displayName = "BreadcrumbSeparator"
|
|
90
|
-
|
|
91
|
-
const BreadcrumbEllipsis = ({
|
|
92
|
-
className,
|
|
93
|
-
...props
|
|
94
|
-
}: React.ComponentProps<"span">) => (
|
|
95
|
-
<span
|
|
96
|
-
role="presentation"
|
|
97
|
-
aria-hidden="true"
|
|
98
|
-
className={cn("flex h-9 w-9 items-center justify-center", className)}
|
|
99
|
-
{...props}
|
|
100
|
-
>
|
|
101
|
-
<MoreHorizontal className="h-4 w-4" />
|
|
102
|
-
<span className="sr-only">More</span>
|
|
103
|
-
</span>
|
|
104
|
-
)
|
|
105
|
-
BreadcrumbEllipsis.displayName = "BreadcrumbElipssis"
|
|
106
|
-
|
|
107
|
-
export {
|
|
108
|
-
Breadcrumb,
|
|
109
|
-
BreadcrumbList,
|
|
110
|
-
BreadcrumbItem,
|
|
111
|
-
BreadcrumbLink,
|
|
112
|
-
BreadcrumbPage,
|
|
113
|
-
BreadcrumbSeparator,
|
|
114
|
-
BreadcrumbEllipsis,
|
|
115
|
-
}
|
|
@@ -1,83 +0,0 @@
|
|
|
1
|
-
import { Slot } from "@radix-ui/react-slot"
|
|
2
|
-
import { cva, type VariantProps } from "class-variance-authority"
|
|
3
|
-
|
|
4
|
-
import { cn } from "@/lib/utils"
|
|
5
|
-
import { Separator } from "@/components/ui/separator"
|
|
6
|
-
|
|
7
|
-
const buttonGroupVariants = cva(
|
|
8
|
-
"flex w-fit items-stretch has-[>[data-slot=button-group]]:gap-2 [&>*]:focus-visible:relative [&>*]:focus-visible:z-10 has-[select[aria-hidden=true]:last-child]:[&>[data-slot=select-trigger]:last-of-type]:rounded-r-md [&>[data-slot=select-trigger]:not([class*='w-'])]:w-fit [&>input]:flex-1",
|
|
9
|
-
{
|
|
10
|
-
variants: {
|
|
11
|
-
orientation: {
|
|
12
|
-
horizontal:
|
|
13
|
-
"[&>*:not(:first-child)]:rounded-l-none [&>*:not(:first-child)]:border-l-0 [&>*:not(:last-child)]:rounded-r-none",
|
|
14
|
-
vertical:
|
|
15
|
-
"flex-col [&>*:not(:first-child)]:rounded-t-none [&>*:not(:first-child)]:border-t-0 [&>*:not(:last-child)]:rounded-b-none",
|
|
16
|
-
},
|
|
17
|
-
},
|
|
18
|
-
defaultVariants: {
|
|
19
|
-
orientation: "horizontal",
|
|
20
|
-
},
|
|
21
|
-
}
|
|
22
|
-
)
|
|
23
|
-
|
|
24
|
-
function ButtonGroup({
|
|
25
|
-
className,
|
|
26
|
-
orientation,
|
|
27
|
-
...props
|
|
28
|
-
}: React.ComponentProps<"div"> & VariantProps<typeof buttonGroupVariants>) {
|
|
29
|
-
return (
|
|
30
|
-
<div
|
|
31
|
-
role="group"
|
|
32
|
-
data-slot="button-group"
|
|
33
|
-
data-orientation={orientation}
|
|
34
|
-
className={cn(buttonGroupVariants({ orientation }), className)}
|
|
35
|
-
{...props}
|
|
36
|
-
/>
|
|
37
|
-
)
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
function ButtonGroupText({
|
|
41
|
-
className,
|
|
42
|
-
asChild = false,
|
|
43
|
-
...props
|
|
44
|
-
}: React.ComponentProps<"div"> & {
|
|
45
|
-
asChild?: boolean
|
|
46
|
-
}) {
|
|
47
|
-
const Comp = asChild ? Slot : "div"
|
|
48
|
-
|
|
49
|
-
return (
|
|
50
|
-
<Comp
|
|
51
|
-
className={cn(
|
|
52
|
-
"bg-muted shadow-xs flex items-center gap-2 rounded-md border px-4 text-sm font-medium [&_svg:not([class*='size-'])]:size-4 [&_svg]:pointer-events-none",
|
|
53
|
-
className
|
|
54
|
-
)}
|
|
55
|
-
{...props}
|
|
56
|
-
/>
|
|
57
|
-
)
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
function ButtonGroupSeparator({
|
|
61
|
-
className,
|
|
62
|
-
orientation = "vertical",
|
|
63
|
-
...props
|
|
64
|
-
}: React.ComponentProps<typeof Separator>) {
|
|
65
|
-
return (
|
|
66
|
-
<Separator
|
|
67
|
-
data-slot="button-group-separator"
|
|
68
|
-
orientation={orientation}
|
|
69
|
-
className={cn(
|
|
70
|
-
"bg-input relative !m-0 self-stretch data-[orientation=vertical]:h-auto",
|
|
71
|
-
className
|
|
72
|
-
)}
|
|
73
|
-
{...props}
|
|
74
|
-
/>
|
|
75
|
-
)
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
export {
|
|
79
|
-
ButtonGroup,
|
|
80
|
-
ButtonGroupSeparator,
|
|
81
|
-
ButtonGroupText,
|
|
82
|
-
buttonGroupVariants,
|
|
83
|
-
}
|
|
@@ -1,56 +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
|
-
|
|
7
|
-
const buttonVariants = cva(
|
|
8
|
-
"inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",
|
|
9
|
-
{
|
|
10
|
-
variants: {
|
|
11
|
-
variant: {
|
|
12
|
-
default: "bg-primary text-primary-foreground hover:bg-primary/90",
|
|
13
|
-
destructive:
|
|
14
|
-
"bg-destructive text-destructive-foreground hover:bg-destructive/90",
|
|
15
|
-
outline:
|
|
16
|
-
"border border-input bg-background hover:bg-accent hover:text-accent-foreground",
|
|
17
|
-
secondary:
|
|
18
|
-
"bg-secondary text-secondary-foreground hover:bg-secondary/80",
|
|
19
|
-
ghost: "hover:bg-accent hover:text-accent-foreground",
|
|
20
|
-
link: "text-primary underline-offset-4 hover:underline",
|
|
21
|
-
},
|
|
22
|
-
size: {
|
|
23
|
-
default: "h-10 px-4 py-2",
|
|
24
|
-
sm: "h-9 rounded-md px-3",
|
|
25
|
-
lg: "h-11 rounded-md px-8",
|
|
26
|
-
icon: "h-10 w-10",
|
|
27
|
-
},
|
|
28
|
-
},
|
|
29
|
-
defaultVariants: {
|
|
30
|
-
variant: "default",
|
|
31
|
-
size: "default",
|
|
32
|
-
},
|
|
33
|
-
}
|
|
34
|
-
)
|
|
35
|
-
|
|
36
|
-
export interface ButtonProps
|
|
37
|
-
extends React.ButtonHTMLAttributes<HTMLButtonElement>,
|
|
38
|
-
VariantProps<typeof buttonVariants> {
|
|
39
|
-
asChild?: boolean
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
const Button = React.forwardRef<HTMLButtonElement, ButtonProps>(
|
|
43
|
-
({ className, variant, size, asChild = false, ...props }, ref) => {
|
|
44
|
-
const Comp = asChild ? Slot : "button"
|
|
45
|
-
return (
|
|
46
|
-
<Comp
|
|
47
|
-
className={cn(buttonVariants({ variant, size, className }))}
|
|
48
|
-
ref={ref}
|
|
49
|
-
{...props}
|
|
50
|
-
/>
|
|
51
|
-
)
|
|
52
|
-
}
|
|
53
|
-
)
|
|
54
|
-
Button.displayName = "Button"
|
|
55
|
-
|
|
56
|
-
export { Button, buttonVariants }
|
|
@@ -1,213 +0,0 @@
|
|
|
1
|
-
"use client"
|
|
2
|
-
|
|
3
|
-
import * as React from "react"
|
|
4
|
-
import {
|
|
5
|
-
ChevronDownIcon,
|
|
6
|
-
ChevronLeftIcon,
|
|
7
|
-
ChevronRightIcon,
|
|
8
|
-
} from "lucide-react"
|
|
9
|
-
import { DayButton, DayPicker, getDefaultClassNames } from "react-day-picker"
|
|
10
|
-
|
|
11
|
-
import { cn } from "@/lib/utils"
|
|
12
|
-
import { Button, buttonVariants } from "@/components/ui/button"
|
|
13
|
-
|
|
14
|
-
function Calendar({
|
|
15
|
-
className,
|
|
16
|
-
classNames,
|
|
17
|
-
showOutsideDays = true,
|
|
18
|
-
captionLayout = "label",
|
|
19
|
-
buttonVariant = "ghost",
|
|
20
|
-
formatters,
|
|
21
|
-
components,
|
|
22
|
-
...props
|
|
23
|
-
}: React.ComponentProps<typeof DayPicker> & {
|
|
24
|
-
buttonVariant?: React.ComponentProps<typeof Button>["variant"]
|
|
25
|
-
}) {
|
|
26
|
-
const defaultClassNames = getDefaultClassNames()
|
|
27
|
-
|
|
28
|
-
return (
|
|
29
|
-
<DayPicker
|
|
30
|
-
showOutsideDays={showOutsideDays}
|
|
31
|
-
className={cn(
|
|
32
|
-
"bg-background group/calendar p-3 [--cell-size:2rem] [[data-slot=card-content]_&]:bg-transparent [[data-slot=popover-content]_&]:bg-transparent",
|
|
33
|
-
String.raw`rtl:**:[.rdp-button\_next>svg]:rotate-180`,
|
|
34
|
-
String.raw`rtl:**:[.rdp-button\_previous>svg]:rotate-180`,
|
|
35
|
-
className
|
|
36
|
-
)}
|
|
37
|
-
captionLayout={captionLayout}
|
|
38
|
-
formatters={{
|
|
39
|
-
formatMonthDropdown: (date) =>
|
|
40
|
-
date.toLocaleString("default", { month: "short" }),
|
|
41
|
-
...formatters,
|
|
42
|
-
}}
|
|
43
|
-
classNames={{
|
|
44
|
-
root: cn("w-fit", defaultClassNames.root),
|
|
45
|
-
months: cn(
|
|
46
|
-
"relative flex flex-col gap-4 md:flex-row",
|
|
47
|
-
defaultClassNames.months
|
|
48
|
-
),
|
|
49
|
-
month: cn("flex w-full flex-col gap-4", defaultClassNames.month),
|
|
50
|
-
nav: cn(
|
|
51
|
-
"absolute inset-x-0 top-0 flex w-full items-center justify-between gap-1",
|
|
52
|
-
defaultClassNames.nav
|
|
53
|
-
),
|
|
54
|
-
button_previous: cn(
|
|
55
|
-
buttonVariants({ variant: buttonVariant }),
|
|
56
|
-
"h-[--cell-size] w-[--cell-size] select-none p-0 aria-disabled:opacity-50",
|
|
57
|
-
defaultClassNames.button_previous
|
|
58
|
-
),
|
|
59
|
-
button_next: cn(
|
|
60
|
-
buttonVariants({ variant: buttonVariant }),
|
|
61
|
-
"h-[--cell-size] w-[--cell-size] select-none p-0 aria-disabled:opacity-50",
|
|
62
|
-
defaultClassNames.button_next
|
|
63
|
-
),
|
|
64
|
-
month_caption: cn(
|
|
65
|
-
"flex h-[--cell-size] w-full items-center justify-center px-[--cell-size]",
|
|
66
|
-
defaultClassNames.month_caption
|
|
67
|
-
),
|
|
68
|
-
dropdowns: cn(
|
|
69
|
-
"flex h-[--cell-size] w-full items-center justify-center gap-1.5 text-sm font-medium",
|
|
70
|
-
defaultClassNames.dropdowns
|
|
71
|
-
),
|
|
72
|
-
dropdown_root: cn(
|
|
73
|
-
"has-focus:border-ring border-input shadow-xs has-focus:ring-ring/50 has-focus:ring-[3px] relative rounded-md border",
|
|
74
|
-
defaultClassNames.dropdown_root
|
|
75
|
-
),
|
|
76
|
-
dropdown: cn(
|
|
77
|
-
"bg-popover absolute inset-0 opacity-0",
|
|
78
|
-
defaultClassNames.dropdown
|
|
79
|
-
),
|
|
80
|
-
caption_label: cn(
|
|
81
|
-
"select-none font-medium",
|
|
82
|
-
captionLayout === "label"
|
|
83
|
-
? "text-sm"
|
|
84
|
-
: "[&>svg]:text-muted-foreground flex h-8 items-center gap-1 rounded-md pl-2 pr-1 text-sm [&>svg]:size-3.5",
|
|
85
|
-
defaultClassNames.caption_label
|
|
86
|
-
),
|
|
87
|
-
table: "w-full border-collapse",
|
|
88
|
-
weekdays: cn("flex", defaultClassNames.weekdays),
|
|
89
|
-
weekday: cn(
|
|
90
|
-
"text-muted-foreground flex-1 select-none rounded-md text-[0.8rem] font-normal",
|
|
91
|
-
defaultClassNames.weekday
|
|
92
|
-
),
|
|
93
|
-
week: cn("mt-2 flex w-full", defaultClassNames.week),
|
|
94
|
-
week_number_header: cn(
|
|
95
|
-
"w-[--cell-size] select-none",
|
|
96
|
-
defaultClassNames.week_number_header
|
|
97
|
-
),
|
|
98
|
-
week_number: cn(
|
|
99
|
-
"text-muted-foreground select-none text-[0.8rem]",
|
|
100
|
-
defaultClassNames.week_number
|
|
101
|
-
),
|
|
102
|
-
day: cn(
|
|
103
|
-
"group/day relative aspect-square h-full w-full select-none p-0 text-center [&:first-child[data-selected=true]_button]:rounded-l-md [&:last-child[data-selected=true]_button]:rounded-r-md",
|
|
104
|
-
defaultClassNames.day
|
|
105
|
-
),
|
|
106
|
-
range_start: cn(
|
|
107
|
-
"bg-accent rounded-l-md",
|
|
108
|
-
defaultClassNames.range_start
|
|
109
|
-
),
|
|
110
|
-
range_middle: cn("rounded-none", defaultClassNames.range_middle),
|
|
111
|
-
range_end: cn("bg-accent rounded-r-md", defaultClassNames.range_end),
|
|
112
|
-
today: cn(
|
|
113
|
-
"bg-accent text-accent-foreground rounded-md data-[selected=true]:rounded-none",
|
|
114
|
-
defaultClassNames.today
|
|
115
|
-
),
|
|
116
|
-
outside: cn(
|
|
117
|
-
"text-muted-foreground aria-selected:text-muted-foreground",
|
|
118
|
-
defaultClassNames.outside
|
|
119
|
-
),
|
|
120
|
-
disabled: cn(
|
|
121
|
-
"text-muted-foreground opacity-50",
|
|
122
|
-
defaultClassNames.disabled
|
|
123
|
-
),
|
|
124
|
-
hidden: cn("invisible", defaultClassNames.hidden),
|
|
125
|
-
...classNames,
|
|
126
|
-
}}
|
|
127
|
-
components={{
|
|
128
|
-
Root: ({ className, rootRef, ...props }) => {
|
|
129
|
-
return (
|
|
130
|
-
<div
|
|
131
|
-
data-slot="calendar"
|
|
132
|
-
ref={rootRef}
|
|
133
|
-
className={cn(className)}
|
|
134
|
-
{...props}
|
|
135
|
-
/>
|
|
136
|
-
)
|
|
137
|
-
},
|
|
138
|
-
Chevron: ({ className, orientation, ...props }) => {
|
|
139
|
-
if (orientation === "left") {
|
|
140
|
-
return (
|
|
141
|
-
<ChevronLeftIcon className={cn("size-4", className)} {...props} />
|
|
142
|
-
)
|
|
143
|
-
}
|
|
144
|
-
|
|
145
|
-
if (orientation === "right") {
|
|
146
|
-
return (
|
|
147
|
-
<ChevronRightIcon
|
|
148
|
-
className={cn("size-4", className)}
|
|
149
|
-
{...props}
|
|
150
|
-
/>
|
|
151
|
-
)
|
|
152
|
-
}
|
|
153
|
-
|
|
154
|
-
return (
|
|
155
|
-
<ChevronDownIcon className={cn("size-4", className)} {...props} />
|
|
156
|
-
)
|
|
157
|
-
},
|
|
158
|
-
DayButton: CalendarDayButton,
|
|
159
|
-
WeekNumber: ({ children, ...props }) => {
|
|
160
|
-
return (
|
|
161
|
-
<td {...props}>
|
|
162
|
-
<div className="flex size-[--cell-size] items-center justify-center text-center">
|
|
163
|
-
{children}
|
|
164
|
-
</div>
|
|
165
|
-
</td>
|
|
166
|
-
)
|
|
167
|
-
},
|
|
168
|
-
...components,
|
|
169
|
-
}}
|
|
170
|
-
{...props}
|
|
171
|
-
/>
|
|
172
|
-
)
|
|
173
|
-
}
|
|
174
|
-
|
|
175
|
-
function CalendarDayButton({
|
|
176
|
-
className,
|
|
177
|
-
day,
|
|
178
|
-
modifiers,
|
|
179
|
-
...props
|
|
180
|
-
}: React.ComponentProps<typeof DayButton>) {
|
|
181
|
-
const defaultClassNames = getDefaultClassNames()
|
|
182
|
-
|
|
183
|
-
const ref = React.useRef<HTMLButtonElement>(null)
|
|
184
|
-
React.useEffect(() => {
|
|
185
|
-
if (modifiers.focused) ref.current?.focus()
|
|
186
|
-
}, [modifiers.focused])
|
|
187
|
-
|
|
188
|
-
return (
|
|
189
|
-
<Button
|
|
190
|
-
ref={ref}
|
|
191
|
-
variant="ghost"
|
|
192
|
-
size="icon"
|
|
193
|
-
data-day={day.date.toLocaleDateString()}
|
|
194
|
-
data-selected-single={
|
|
195
|
-
modifiers.selected &&
|
|
196
|
-
!modifiers.range_start &&
|
|
197
|
-
!modifiers.range_end &&
|
|
198
|
-
!modifiers.range_middle
|
|
199
|
-
}
|
|
200
|
-
data-range-start={modifiers.range_start}
|
|
201
|
-
data-range-end={modifiers.range_end}
|
|
202
|
-
data-range-middle={modifiers.range_middle}
|
|
203
|
-
className={cn(
|
|
204
|
-
"data-[selected-single=true]:bg-primary data-[selected-single=true]:text-primary-foreground data-[range-middle=true]:bg-accent data-[range-middle=true]:text-accent-foreground data-[range-start=true]:bg-primary data-[range-start=true]:text-primary-foreground data-[range-end=true]:bg-primary data-[range-end=true]:text-primary-foreground group-data-[focused=true]/day:border-ring group-data-[focused=true]/day:ring-ring/50 flex aspect-square h-auto w-full min-w-[--cell-size] flex-col gap-1 font-normal leading-none data-[range-end=true]:rounded-md data-[range-middle=true]:rounded-none data-[range-start=true]:rounded-md group-data-[focused=true]/day:relative group-data-[focused=true]/day:z-10 group-data-[focused=true]/day:ring-[3px] [&>span]:text-xs [&>span]:opacity-70",
|
|
205
|
-
defaultClassNames.day,
|
|
206
|
-
className
|
|
207
|
-
)}
|
|
208
|
-
{...props}
|
|
209
|
-
/>
|
|
210
|
-
)
|
|
211
|
-
}
|
|
212
|
-
|
|
213
|
-
export { Calendar, CalendarDayButton }
|
|
@@ -1,79 +0,0 @@
|
|
|
1
|
-
import * as React from "react"
|
|
2
|
-
|
|
3
|
-
import { cn } from "@/lib/utils"
|
|
4
|
-
|
|
5
|
-
const Card = React.forwardRef<
|
|
6
|
-
HTMLDivElement,
|
|
7
|
-
React.HTMLAttributes<HTMLDivElement>
|
|
8
|
-
>(({ className, ...props }, ref) => (
|
|
9
|
-
<div
|
|
10
|
-
ref={ref}
|
|
11
|
-
className={cn(
|
|
12
|
-
"rounded-lg border bg-card text-card-foreground shadow-sm",
|
|
13
|
-
className
|
|
14
|
-
)}
|
|
15
|
-
{...props}
|
|
16
|
-
/>
|
|
17
|
-
))
|
|
18
|
-
Card.displayName = "Card"
|
|
19
|
-
|
|
20
|
-
const CardHeader = React.forwardRef<
|
|
21
|
-
HTMLDivElement,
|
|
22
|
-
React.HTMLAttributes<HTMLDivElement>
|
|
23
|
-
>(({ className, ...props }, ref) => (
|
|
24
|
-
<div
|
|
25
|
-
ref={ref}
|
|
26
|
-
className={cn("flex flex-col space-y-1.5 p-6", className)}
|
|
27
|
-
{...props}
|
|
28
|
-
/>
|
|
29
|
-
))
|
|
30
|
-
CardHeader.displayName = "CardHeader"
|
|
31
|
-
|
|
32
|
-
const CardTitle = React.forwardRef<
|
|
33
|
-
HTMLDivElement,
|
|
34
|
-
React.HTMLAttributes<HTMLDivElement>
|
|
35
|
-
>(({ className, ...props }, ref) => (
|
|
36
|
-
<div
|
|
37
|
-
ref={ref}
|
|
38
|
-
className={cn(
|
|
39
|
-
"text-2xl font-semibold leading-none tracking-tight",
|
|
40
|
-
className
|
|
41
|
-
)}
|
|
42
|
-
{...props}
|
|
43
|
-
/>
|
|
44
|
-
))
|
|
45
|
-
CardTitle.displayName = "CardTitle"
|
|
46
|
-
|
|
47
|
-
const CardDescription = React.forwardRef<
|
|
48
|
-
HTMLDivElement,
|
|
49
|
-
React.HTMLAttributes<HTMLDivElement>
|
|
50
|
-
>(({ className, ...props }, ref) => (
|
|
51
|
-
<div
|
|
52
|
-
ref={ref}
|
|
53
|
-
className={cn("text-sm text-muted-foreground", className)}
|
|
54
|
-
{...props}
|
|
55
|
-
/>
|
|
56
|
-
))
|
|
57
|
-
CardDescription.displayName = "CardDescription"
|
|
58
|
-
|
|
59
|
-
const CardContent = React.forwardRef<
|
|
60
|
-
HTMLDivElement,
|
|
61
|
-
React.HTMLAttributes<HTMLDivElement>
|
|
62
|
-
>(({ className, ...props }, ref) => (
|
|
63
|
-
<div ref={ref} className={cn("p-6 pt-0", className)} {...props} />
|
|
64
|
-
))
|
|
65
|
-
CardContent.displayName = "CardContent"
|
|
66
|
-
|
|
67
|
-
const CardFooter = React.forwardRef<
|
|
68
|
-
HTMLDivElement,
|
|
69
|
-
React.HTMLAttributes<HTMLDivElement>
|
|
70
|
-
>(({ className, ...props }, ref) => (
|
|
71
|
-
<div
|
|
72
|
-
ref={ref}
|
|
73
|
-
className={cn("flex items-center p-6 pt-0", className)}
|
|
74
|
-
{...props}
|
|
75
|
-
/>
|
|
76
|
-
))
|
|
77
|
-
CardFooter.displayName = "CardFooter"
|
|
78
|
-
|
|
79
|
-
export { Card, CardHeader, CardFooter, CardTitle, CardDescription, CardContent }
|