@dyrected/admin 2.4.0 → 2.4.1
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/App.d.ts +1 -0
- package/dist/admin.css +2 -0
- package/dist/components/auth/auth-gate.d.ts +13 -0
- package/dist/components/error-boundary.d.ts +16 -0
- package/dist/components/forms/field-renderer.d.ts +22 -0
- package/dist/components/forms/fields/block-builder.d.ts +9 -0
- package/dist/components/forms/fields/date-picker.d.ts +8 -0
- package/dist/components/forms/fields/json-editor.d.ts +8 -0
- package/dist/components/forms/fields/media-picker.d.ts +12 -0
- package/dist/components/forms/fields/multi-select.d.ts +19 -0
- package/dist/components/forms/fields/radio-field.d.ts +8 -0
- package/dist/components/forms/fields/relationship-picker.d.ts +10 -0
- package/dist/components/forms/fields/rich-text-editor.d.ts +9 -0
- package/dist/components/forms/fields/select-field.d.ts +8 -0
- package/dist/components/forms/fields/switch-field.d.ts +6 -0
- package/dist/components/forms/fields/text-area-field.d.ts +8 -0
- package/dist/components/forms/fields/text-field.d.ts +8 -0
- package/dist/components/forms/form-engine.d.ts +14 -0
- package/dist/components/forms/form-field-renderer.d.ts +20 -0
- package/dist/components/forms/utils.d.ts +11 -0
- package/dist/components/layout/admin-shell.d.ts +5 -0
- package/dist/components/layout/branding-provider.d.ts +4 -0
- package/dist/components/live-preview/LivePreviewPane.d.ts +7 -0
- package/dist/components/media/focal-point-picker.d.ts +12 -0
- package/dist/components/media/media-card.d.ts +8 -0
- package/dist/components/media/media-grid.d.ts +8 -0
- package/dist/components/media/media-library-dialog.d.ts +11 -0
- package/dist/components/ui/aspect-ratio.d.ts +3 -0
- package/dist/components/ui/badge.d.ts +9 -0
- package/dist/components/ui/button.d.ts +11 -0
- package/dist/components/ui/calendar.d.ts +8 -0
- package/dist/components/ui/card.d.ts +8 -0
- package/dist/components/ui/checkbox.d.ts +4 -0
- package/dist/components/ui/command.d.ts +80 -0
- package/dist/components/ui/data-table.d.ts +14 -0
- package/dist/components/ui/dialog.d.ts +19 -0
- package/dist/components/ui/dropdown-menu.d.ts +27 -0
- package/dist/components/ui/form.d.ts +23 -0
- package/dist/components/ui/input.d.ts +3 -0
- package/dist/components/ui/label.d.ts +5 -0
- package/dist/components/ui/page-header.d.ts +10 -0
- package/dist/components/ui/pagination.d.ts +11 -0
- package/dist/components/ui/popover.d.ts +6 -0
- package/dist/components/ui/progress.d.ts +4 -0
- package/dist/components/ui/radio-group.d.ts +5 -0
- package/dist/components/ui/render-cell.d.ts +8 -0
- package/dist/components/ui/scroll-area.d.ts +5 -0
- package/dist/components/ui/select.d.ts +13 -0
- package/dist/components/ui/separator.d.ts +4 -0
- package/dist/components/ui/sheet.d.ts +25 -0
- package/dist/components/ui/sidebar.d.ts +65 -0
- package/dist/components/ui/skeleton.d.ts +2 -0
- package/dist/components/ui/sonner.d.ts +4 -0
- package/dist/components/ui/switch.d.ts +4 -0
- package/dist/components/ui/table.d.ts +10 -0
- package/dist/components/ui/tabs.d.ts +7 -0
- package/dist/components/ui/textarea.d.ts +3 -0
- package/dist/components/ui/toggle.d.ts +12 -0
- package/dist/components/ui/tooltip.d.ts +7 -0
- package/dist/hooks/use-mobile.d.ts +1 -0
- package/dist/hooks/use-preferences.d.ts +6 -0
- package/dist/index.d.ts +38 -0
- package/dist/index.mjs +69091 -0
- package/dist/lib/utils.d.ts +3 -0
- package/dist/main.d.ts +0 -0
- package/dist/pages/auth/first-user-page.d.ts +4 -0
- package/dist/pages/auth/login-page.d.ts +4 -0
- package/dist/pages/collections/edit-page.d.ts +1 -0
- package/dist/pages/collections/list-page.d.ts +5 -0
- package/dist/pages/dashboard/dashboard.d.ts +1 -0
- package/dist/pages/globals/editor-page.d.ts +1 -0
- package/dist/pages/media/media-page.d.ts +4 -0
- package/dist/pages/setup/setup-prompt.d.ts +6 -0
- package/dist/providers/dyrected-provider.d.ts +29 -0
- package/dist/providers/query-provider.d.ts +3 -0
- package/package.json +6 -3
- package/CHANGELOG.md +0 -153
- package/components.json +0 -17
- package/eslint.config.js +0 -22
- package/index.html +0 -13
- package/postcss.config.js +0 -6
- package/scripts/prefix-tailwind-precision.py +0 -98
- package/scripts/prefix-tailwind.py +0 -67
- package/src/App.css +0 -184
- package/src/App.tsx +0 -25
- package/src/assets/dyrected.svg +0 -155
- package/src/assets/hero.png +0 -0
- package/src/assets/react.svg +0 -1
- package/src/assets/vite.svg +0 -1
- package/src/components/auth/auth-gate.tsx +0 -64
- package/src/components/error-boundary.tsx +0 -45
- package/src/components/forms/field-renderer.tsx +0 -111
- package/src/components/forms/fields/block-builder.tsx +0 -213
- package/src/components/forms/fields/date-picker.tsx +0 -60
- package/src/components/forms/fields/json-editor.tsx +0 -62
- package/src/components/forms/fields/media-picker.tsx +0 -286
- package/src/components/forms/fields/multi-select.tsx +0 -145
- package/src/components/forms/fields/radio-field.tsx +0 -51
- package/src/components/forms/fields/relationship-picker.tsx +0 -143
- package/src/components/forms/fields/rich-text-editor.tsx +0 -224
- package/src/components/forms/fields/select-field.tsx +0 -35
- package/src/components/forms/fields/switch-field.tsx +0 -16
- package/src/components/forms/fields/text-area-field.tsx +0 -15
- package/src/components/forms/fields/text-field.tsx +0 -24
- package/src/components/forms/form-engine.tsx +0 -87
- package/src/components/forms/form-field-renderer.tsx +0 -269
- package/src/components/forms/utils.ts +0 -97
- package/src/components/layout/admin-shell.tsx +0 -479
- package/src/components/layout/branding-provider.tsx +0 -112
- package/src/components/live-preview/LivePreviewPane.tsx +0 -128
- package/src/components/media/focal-point-picker.tsx +0 -66
- package/src/components/media/media-card.tsx +0 -44
- package/src/components/media/media-grid.tsx +0 -32
- package/src/components/media/media-library-dialog.tsx +0 -465
- package/src/components/ui/aspect-ratio.tsx +0 -7
- package/src/components/ui/badge.tsx +0 -36
- package/src/components/ui/button.tsx +0 -56
- package/src/components/ui/calendar.tsx +0 -214
- package/src/components/ui/card.tsx +0 -79
- package/src/components/ui/checkbox.tsx +0 -28
- package/src/components/ui/command.tsx +0 -151
- package/src/components/ui/data-table.tsx +0 -219
- package/src/components/ui/dialog.tsx +0 -122
- package/src/components/ui/dropdown-menu.tsx +0 -200
- package/src/components/ui/form.tsx +0 -178
- package/src/components/ui/input.tsx +0 -24
- package/src/components/ui/label.tsx +0 -24
- package/src/components/ui/page-header.tsx +0 -30
- package/src/components/ui/pagination.tsx +0 -57
- package/src/components/ui/popover.tsx +0 -29
- package/src/components/ui/progress.tsx +0 -26
- package/src/components/ui/radio-group.tsx +0 -42
- package/src/components/ui/render-cell.tsx +0 -110
- 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/sonner.tsx +0 -27
- 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.tsx +0 -43
- package/src/components/ui/tooltip.tsx +0 -28
- package/src/hooks/use-mobile.tsx +0 -19
- package/src/hooks/use-preferences.ts +0 -56
- package/src/index.css +0 -111
- package/src/index.tsx +0 -198
- package/src/lib/utils.ts +0 -36
- package/src/main.tsx +0 -10
- package/src/pages/auth/first-user-page.tsx +0 -115
- package/src/pages/auth/login-page.tsx +0 -91
- package/src/pages/collections/edit-page.tsx +0 -280
- package/src/pages/collections/list-page.tsx +0 -343
- package/src/pages/dashboard/dashboard.tsx +0 -150
- package/src/pages/globals/editor-page.tsx +0 -122
- package/src/pages/media/media-page.tsx +0 -564
- package/src/pages/setup/setup-prompt.tsx +0 -181
- package/src/providers/dyrected-provider.tsx +0 -122
- package/src/providers/query-provider.tsx +0 -19
- package/src/types/jexl.d.ts +0 -11
- package/tailwind.config.ts +0 -103
- package/tsconfig.app.json +0 -28
- package/tsconfig.json +0 -12
- package/tsconfig.node.json +0 -25
- package/vite.config.ts +0 -39
- /package/{public → dist}/favicon.svg +0 -0
- /package/{public → dist}/icons.svg +0 -0
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
import * as React from "react"
|
|
2
|
-
import * as RadioGroupPrimitive from "@radix-ui/react-radio-group"
|
|
3
|
-
import { Circle } from "lucide-react"
|
|
4
|
-
|
|
5
|
-
import { cn } from "../../lib/utils"
|
|
6
|
-
|
|
7
|
-
const RadioGroup = React.forwardRef<
|
|
8
|
-
React.ElementRef<typeof RadioGroupPrimitive.Root>,
|
|
9
|
-
React.ComponentPropsWithoutRef<typeof RadioGroupPrimitive.Root>
|
|
10
|
-
>(({ className, ...props }, ref) => {
|
|
11
|
-
return (
|
|
12
|
-
<RadioGroupPrimitive.Root
|
|
13
|
-
className={cn("dy-grid dy-gap-2", className)}
|
|
14
|
-
{...props}
|
|
15
|
-
ref={ref}
|
|
16
|
-
/>
|
|
17
|
-
)
|
|
18
|
-
})
|
|
19
|
-
RadioGroup.displayName = RadioGroupPrimitive.Root.displayName
|
|
20
|
-
|
|
21
|
-
const RadioGroupItem = React.forwardRef<
|
|
22
|
-
React.ElementRef<typeof RadioGroupPrimitive.Item>,
|
|
23
|
-
React.ComponentPropsWithoutRef<typeof RadioGroupPrimitive.Item>
|
|
24
|
-
>(({ className, ...props }, ref) => {
|
|
25
|
-
return (
|
|
26
|
-
<RadioGroupPrimitive.Item
|
|
27
|
-
ref={ref}
|
|
28
|
-
className={cn(
|
|
29
|
-
"dy-aspect-square dy-h-5 dy-w-5 dy-rounded-full dy-border dy-border-primary/20 dy-bg-white/50 dy-text-primary dy-shadow-sm focus:dy-outline-none focus-visible:dy-ring-2 focus-visible:dy-ring-ring disabled:dy-cursor-not-allowed disabled:dy-opacity-50 dy-transition-all hover:dy-border-primary/40 data-[state=checked]:dy-border-primary data-[state=checked]:dy-bg-primary/5",
|
|
30
|
-
className
|
|
31
|
-
)}
|
|
32
|
-
{...props}
|
|
33
|
-
>
|
|
34
|
-
<RadioGroupPrimitive.Indicator className="dy-flex dy-items-center dy-justify-center">
|
|
35
|
-
<Circle className="dy-h-2.5 dy-w-2.5 dy-fill-current dy-text-primary" />
|
|
36
|
-
</RadioGroupPrimitive.Indicator>
|
|
37
|
-
</RadioGroupPrimitive.Item>
|
|
38
|
-
)
|
|
39
|
-
})
|
|
40
|
-
RadioGroupItem.displayName = RadioGroupPrimitive.Item.displayName
|
|
41
|
-
|
|
42
|
-
export { RadioGroup, RadioGroupItem }
|
|
@@ -1,110 +0,0 @@
|
|
|
1
|
-
import { Badge } from "./badge"
|
|
2
|
-
import { Calendar } from "lucide-react"
|
|
3
|
-
import { getMediaUrl } from "../../lib/utils"
|
|
4
|
-
|
|
5
|
-
interface RenderCellProps {
|
|
6
|
-
value: any
|
|
7
|
-
field: any
|
|
8
|
-
client: any
|
|
9
|
-
schemas: any
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
export function RenderCell({ value, field, client, schemas }: RenderCellProps) {
|
|
13
|
-
if (value === null || value === undefined) return <span className="dy-text-muted-foreground">-</span>
|
|
14
|
-
|
|
15
|
-
// Handle Boolean
|
|
16
|
-
if (field.type === "boolean" || typeof value === "boolean") {
|
|
17
|
-
return <Badge variant={value ? "default" : "secondary"}>{value ? "Yes" : "No"}</Badge>
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
// Handle Date
|
|
21
|
-
if (field.type === "date") {
|
|
22
|
-
const date = new Date(value)
|
|
23
|
-
return (
|
|
24
|
-
<div className="dy-flex dy-items-center dy-gap-1.5 dy-text-muted-foreground">
|
|
25
|
-
<Calendar className="dy-h-3 dy-w-3" />
|
|
26
|
-
<span className="dy-text-xs">{date.toLocaleDateString()}</span>
|
|
27
|
-
</div>
|
|
28
|
-
)
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
// Handle Image/Media (from upload collections)
|
|
32
|
-
const relationTo = field.relationTo || field.collection
|
|
33
|
-
if (field.type === "image" || (field.type === "relationship" && isUploadCollection(relationTo, schemas))) {
|
|
34
|
-
const media = value
|
|
35
|
-
if (!media) return <span className="dy-text-muted-foreground">-</span>
|
|
36
|
-
|
|
37
|
-
const url = getMediaUrl(value, client?.getBaseUrl() || "")
|
|
38
|
-
|
|
39
|
-
if (!url) return <span className="dy-text-muted-foreground">-</span>
|
|
40
|
-
|
|
41
|
-
return (
|
|
42
|
-
<div className="dy-h-8 dy-w-8 dy-rounded dy-overflow-hidden dy-border dy-bg-muted dy-shadow-sm">
|
|
43
|
-
<img src={url} className="dy-h-full dy-w-full dy-object-cover" alt="" />
|
|
44
|
-
</div>
|
|
45
|
-
)
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
// Handle Relationship (Populated)
|
|
49
|
-
if (field.type === "relationship" && typeof value === "object") {
|
|
50
|
-
const relTo = field.relationTo || field.collection
|
|
51
|
-
const relatedCollection = schemas?.collections.find((c: any) => c.slug === relTo)
|
|
52
|
-
const displayField = relatedCollection?.admin?.useAsTitle || "title"
|
|
53
|
-
const displayValue = value[displayField] || value.name || value.id || "Unknown"
|
|
54
|
-
|
|
55
|
-
return (
|
|
56
|
-
<div className="dy-flex dy-items-center dy-gap-2">
|
|
57
|
-
<Badge variant="outline" className="dy-font-normal dy-border-primary/20 dy-bg-primary/5 dy-text-primary">
|
|
58
|
-
{String(displayValue)}
|
|
59
|
-
</Badge>
|
|
60
|
-
</div>
|
|
61
|
-
)
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
// Handle Array of strings or IDs
|
|
65
|
-
if (Array.isArray(value)) {
|
|
66
|
-
return (
|
|
67
|
-
<div className="dy-flex dy-flex-wrap dy-gap-1">
|
|
68
|
-
{value.slice(0, 2).map((item, i) => (
|
|
69
|
-
<Badge key={i} variant="outline" className="dy-text-[10px] dy-px-1.5 dy-h-5">
|
|
70
|
-
{typeof item === 'object' ? (item.title || item.name || item.id) : String(item)}
|
|
71
|
-
</Badge>
|
|
72
|
-
))}
|
|
73
|
-
{value.length > 2 && (
|
|
74
|
-
<span className="dy-text-[10px] dy-text-muted-foreground">+{value.length - 2} more</span>
|
|
75
|
-
)}
|
|
76
|
-
</div>
|
|
77
|
-
)
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
// Handle Generic Object (Summary)
|
|
81
|
-
if (typeof value === "object" && !Array.isArray(value)) {
|
|
82
|
-
const entries = Object.entries(value)
|
|
83
|
-
.filter(([_, v]) => typeof v !== 'object' && v !== null && v !== undefined)
|
|
84
|
-
.slice(0, 3)
|
|
85
|
-
|
|
86
|
-
if (entries.length > 0) {
|
|
87
|
-
return (
|
|
88
|
-
<span className="dy-text-[11px] dy-text-muted-foreground dy-font-medium dy-leading-tight">
|
|
89
|
-
{entries.map(([k, v]) => `${k}: ${String(v)}`).join(", ")}
|
|
90
|
-
{Object.keys(value).length > 3 ? "..." : ""}
|
|
91
|
-
</span>
|
|
92
|
-
)
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
return (
|
|
96
|
-
<span className="dy-text-[11px] dy-text-muted-foreground dy-font-mono dy-bg-muted/30 dy-px-1 dy-rounded">
|
|
97
|
-
{JSON.stringify(value).slice(0, 30)}
|
|
98
|
-
{JSON.stringify(value).length > 30 ? "..." : ""}
|
|
99
|
-
</span>
|
|
100
|
-
)
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
return <span className="dy-text-sm dy-font-medium">{typeof value === 'object' ? JSON.stringify(value).slice(0, 50) : String(value)}</span>
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
function isUploadCollection(slug: string | undefined, schemas: any) {
|
|
107
|
-
if (!slug) return false
|
|
108
|
-
const collection = schemas?.collections.find((c: any) => c.slug === slug)
|
|
109
|
-
return !!collection?.upload
|
|
110
|
-
}
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
import * as React from "react"
|
|
2
|
-
import * as ScrollAreaPrimitive from "@radix-ui/react-scroll-area"
|
|
3
|
-
|
|
4
|
-
import { cn } from "../../lib/utils"
|
|
5
|
-
|
|
6
|
-
const ScrollArea = React.forwardRef<
|
|
7
|
-
React.ElementRef<typeof ScrollAreaPrimitive.Root>,
|
|
8
|
-
React.ComponentPropsWithoutRef<typeof ScrollAreaPrimitive.Root>
|
|
9
|
-
>(({ className, children, ...props }, ref) => (
|
|
10
|
-
<ScrollAreaPrimitive.Root
|
|
11
|
-
ref={ref}
|
|
12
|
-
className={cn("dy-relative dy-overflow-hidden", className)}
|
|
13
|
-
{...props}
|
|
14
|
-
>
|
|
15
|
-
<ScrollAreaPrimitive.Viewport className="dy-h-full dy-w-full dy-rounded-[inherit]">
|
|
16
|
-
{children}
|
|
17
|
-
</ScrollAreaPrimitive.Viewport>
|
|
18
|
-
<ScrollBar />
|
|
19
|
-
<ScrollAreaPrimitive.Corner />
|
|
20
|
-
</ScrollAreaPrimitive.Root>
|
|
21
|
-
))
|
|
22
|
-
ScrollArea.displayName = ScrollAreaPrimitive.Root.displayName
|
|
23
|
-
|
|
24
|
-
const ScrollBar = React.forwardRef<
|
|
25
|
-
React.ElementRef<typeof ScrollAreaPrimitive.ScrollAreaScrollbar>,
|
|
26
|
-
React.ComponentPropsWithoutRef<typeof ScrollAreaPrimitive.ScrollAreaScrollbar>
|
|
27
|
-
>(({ className, orientation = "vertical", ...props }, ref) => (
|
|
28
|
-
<ScrollAreaPrimitive.ScrollAreaScrollbar
|
|
29
|
-
ref={ref}
|
|
30
|
-
orientation={orientation}
|
|
31
|
-
className={cn(
|
|
32
|
-
"dy-flex dy-touch-none dy-select-none dy-transition-colors",
|
|
33
|
-
orientation === "vertical" &&
|
|
34
|
-
"dy-h-full dy-w-2.5 dy-border-l dy-border-l-transparent dy-p-[1px]",
|
|
35
|
-
orientation === "horizontal" &&
|
|
36
|
-
"dy-h-2.5 dy-flex-col dy-border-t dy-border-t-transparent dy-p-[1px]",
|
|
37
|
-
className
|
|
38
|
-
)}
|
|
39
|
-
{...props}
|
|
40
|
-
>
|
|
41
|
-
<ScrollAreaPrimitive.ScrollAreaThumb className="dy-relative dy-flex-1 dy-rounded-full dy-bg-border" />
|
|
42
|
-
</ScrollAreaPrimitive.ScrollAreaScrollbar>
|
|
43
|
-
))
|
|
44
|
-
ScrollBar.displayName = ScrollAreaPrimitive.ScrollAreaScrollbar.displayName
|
|
45
|
-
|
|
46
|
-
export { ScrollArea, ScrollBar }
|
|
@@ -1,160 +0,0 @@
|
|
|
1
|
-
"use client"
|
|
2
|
-
|
|
3
|
-
import * as React from "react"
|
|
4
|
-
import * as SelectPrimitive from "@radix-ui/react-select"
|
|
5
|
-
import { Check, ChevronDown, ChevronUp } from "lucide-react"
|
|
6
|
-
|
|
7
|
-
import { cn } from "../../lib/utils"
|
|
8
|
-
|
|
9
|
-
const Select = SelectPrimitive.Root
|
|
10
|
-
|
|
11
|
-
const SelectGroup = SelectPrimitive.Group
|
|
12
|
-
|
|
13
|
-
const SelectValue = SelectPrimitive.Value
|
|
14
|
-
|
|
15
|
-
const SelectTrigger = React.forwardRef<
|
|
16
|
-
React.ElementRef<typeof SelectPrimitive.Trigger>,
|
|
17
|
-
React.ComponentPropsWithoutRef<typeof SelectPrimitive.Trigger>
|
|
18
|
-
>(({ className, children, ...props }, ref) => (
|
|
19
|
-
<SelectPrimitive.Trigger
|
|
20
|
-
ref={ref}
|
|
21
|
-
className={cn(
|
|
22
|
-
"dy-flex dy-h-10 dy-w-full dy-items-center dy-justify-between dy-rounded-md dy-border dy-border-input dy-bg-background dy-px-3 dy-py-2 dy-text-sm dy-ring-offset-background data-[placeholder]:dy-text-muted-foreground focus:dy-outline-none focus:dy-ring-2 focus:dy-ring-ring focus:dy-ring-offset-2 disabled:dy-cursor-not-allowed disabled:dy-opacity-50 [&>span]:dy-line-clamp-1",
|
|
23
|
-
className
|
|
24
|
-
)}
|
|
25
|
-
{...props}
|
|
26
|
-
>
|
|
27
|
-
{children}
|
|
28
|
-
<SelectPrimitive.Icon asChild>
|
|
29
|
-
<ChevronDown className="dy-h-4 dy-w-4 dy-opacity-50" />
|
|
30
|
-
</SelectPrimitive.Icon>
|
|
31
|
-
</SelectPrimitive.Trigger>
|
|
32
|
-
))
|
|
33
|
-
SelectTrigger.displayName = SelectPrimitive.Trigger.displayName
|
|
34
|
-
|
|
35
|
-
const SelectScrollUpButton = React.forwardRef<
|
|
36
|
-
React.ElementRef<typeof SelectPrimitive.ScrollUpButton>,
|
|
37
|
-
React.ComponentPropsWithoutRef<typeof SelectPrimitive.ScrollUpButton>
|
|
38
|
-
>(({ className, ...props }, ref) => (
|
|
39
|
-
<SelectPrimitive.ScrollUpButton
|
|
40
|
-
ref={ref}
|
|
41
|
-
className={cn(
|
|
42
|
-
"dy-flex dy-cursor-default dy-items-center dy-justify-center dy-py-1",
|
|
43
|
-
className
|
|
44
|
-
)}
|
|
45
|
-
{...props}
|
|
46
|
-
>
|
|
47
|
-
<ChevronUp className="dy-h-4 dy-w-4" />
|
|
48
|
-
</SelectPrimitive.ScrollUpButton>
|
|
49
|
-
))
|
|
50
|
-
SelectScrollUpButton.displayName = SelectPrimitive.ScrollUpButton.displayName
|
|
51
|
-
|
|
52
|
-
const SelectScrollDownButton = React.forwardRef<
|
|
53
|
-
React.ElementRef<typeof SelectPrimitive.ScrollDownButton>,
|
|
54
|
-
React.ComponentPropsWithoutRef<typeof SelectPrimitive.ScrollDownButton>
|
|
55
|
-
>(({ className, ...props }, ref) => (
|
|
56
|
-
<SelectPrimitive.ScrollDownButton
|
|
57
|
-
ref={ref}
|
|
58
|
-
className={cn(
|
|
59
|
-
"dy-flex dy-cursor-default dy-items-center dy-justify-center dy-py-1",
|
|
60
|
-
className
|
|
61
|
-
)}
|
|
62
|
-
{...props}
|
|
63
|
-
>
|
|
64
|
-
<ChevronDown className="dy-h-4 dy-w-4" />
|
|
65
|
-
</SelectPrimitive.ScrollDownButton>
|
|
66
|
-
))
|
|
67
|
-
SelectScrollDownButton.displayName =
|
|
68
|
-
SelectPrimitive.ScrollDownButton.displayName
|
|
69
|
-
|
|
70
|
-
const SelectContent = React.forwardRef<
|
|
71
|
-
React.ElementRef<typeof SelectPrimitive.Content>,
|
|
72
|
-
React.ComponentPropsWithoutRef<typeof SelectPrimitive.Content>
|
|
73
|
-
>(({ className, children, position = "popper", ...props }, ref) => (
|
|
74
|
-
<SelectPrimitive.Portal>
|
|
75
|
-
<SelectPrimitive.Content
|
|
76
|
-
ref={ref}
|
|
77
|
-
className={cn(
|
|
78
|
-
"dy-relative dy-z-[100] dy-max-h-[--radix-select-content-available-height] dy-min-w-[8rem] dy-overflow-y-auto dy-overflow-x-hidden dy-rounded-md dy-border dy-bg-white dy-text-popover-foreground dy-shadow-md data-[state=open]:dy-animate-in data-[state=closed]:dy-animate-out data-[state=closed]:dy-fade-out-0 data-[state=open]:dy-fade-in-0 data-[state=closed]:dy-zoom-out-95 data-[state=open]:dy-zoom-in-95 data-[side=bottom]:dy-slide-in-from-top-2 data-[side=left]:dy-slide-in-from-right-2 data-[side=right]:dy-translate-x-1 data-[side=top]:dy--translate-y-1 dy-origin-[--radix-select-content-transform-origin]",
|
|
79
|
-
position === "popper" &&
|
|
80
|
-
"data-[side=bottom]:dy-translate-y-1 data-[side=left]:dy--translate-x-1 data-[side=right]:dy-translate-x-1 data-[side=top]:dy--translate-y-1",
|
|
81
|
-
className
|
|
82
|
-
)}
|
|
83
|
-
position={position}
|
|
84
|
-
{...props}
|
|
85
|
-
>
|
|
86
|
-
<SelectScrollUpButton />
|
|
87
|
-
<SelectPrimitive.Viewport
|
|
88
|
-
className={cn(
|
|
89
|
-
"dy-p-1",
|
|
90
|
-
position === "popper" &&
|
|
91
|
-
"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"
|
|
92
|
-
)}
|
|
93
|
-
>
|
|
94
|
-
{children}
|
|
95
|
-
</SelectPrimitive.Viewport>
|
|
96
|
-
<SelectScrollDownButton />
|
|
97
|
-
</SelectPrimitive.Content>
|
|
98
|
-
</SelectPrimitive.Portal>
|
|
99
|
-
))
|
|
100
|
-
SelectContent.displayName = SelectPrimitive.Content.displayName
|
|
101
|
-
|
|
102
|
-
const SelectLabel = React.forwardRef<
|
|
103
|
-
React.ElementRef<typeof SelectPrimitive.Label>,
|
|
104
|
-
React.ComponentPropsWithoutRef<typeof SelectPrimitive.Label>
|
|
105
|
-
>(({ className, ...props }, ref) => (
|
|
106
|
-
<SelectPrimitive.Label
|
|
107
|
-
ref={ref}
|
|
108
|
-
className={cn("dy-py-1.5 dy-pl-8 dy-pr-2 dy-text-sm dy-font-semibold", className)}
|
|
109
|
-
{...props}
|
|
110
|
-
/>
|
|
111
|
-
))
|
|
112
|
-
SelectLabel.displayName = SelectPrimitive.Label.displayName
|
|
113
|
-
|
|
114
|
-
const SelectItem = React.forwardRef<
|
|
115
|
-
React.ElementRef<typeof SelectPrimitive.Item>,
|
|
116
|
-
React.ComponentPropsWithoutRef<typeof SelectPrimitive.Item>
|
|
117
|
-
>(({ className, children, ...props }, ref) => (
|
|
118
|
-
<SelectPrimitive.Item
|
|
119
|
-
ref={ref}
|
|
120
|
-
className={cn(
|
|
121
|
-
"dy-relative dy-flex dy-w-full dy-cursor-default dy-select-none dy-items-center dy-rounded-sm dy-py-1.5 dy-pl-8 dy-pr-2 dy-text-sm dy-outline-none focus:dy-bg-accent focus:dy-text-accent-foreground data-[disabled]:dy-pointer-events-none data-[disabled]:dy-opacity-50",
|
|
122
|
-
className
|
|
123
|
-
)}
|
|
124
|
-
{...props}
|
|
125
|
-
>
|
|
126
|
-
<span className="dy-absolute dy-left-2 dy-flex dy-h-3.5 dy-w-3.5 dy-items-center dy-justify-center">
|
|
127
|
-
<SelectPrimitive.ItemIndicator>
|
|
128
|
-
<Check className="dy-h-4 dy-w-4" />
|
|
129
|
-
</SelectPrimitive.ItemIndicator>
|
|
130
|
-
</span>
|
|
131
|
-
|
|
132
|
-
<SelectPrimitive.ItemText>{children}</SelectPrimitive.ItemText>
|
|
133
|
-
</SelectPrimitive.Item>
|
|
134
|
-
))
|
|
135
|
-
SelectItem.displayName = SelectPrimitive.Item.displayName
|
|
136
|
-
|
|
137
|
-
const SelectSeparator = React.forwardRef<
|
|
138
|
-
React.ElementRef<typeof SelectPrimitive.Separator>,
|
|
139
|
-
React.ComponentPropsWithoutRef<typeof SelectPrimitive.Separator>
|
|
140
|
-
>(({ className, ...props }, ref) => (
|
|
141
|
-
<SelectPrimitive.Separator
|
|
142
|
-
ref={ref}
|
|
143
|
-
className={cn("dy--mx-1 dy-my-1 dy-h-px dy-bg-muted", className)}
|
|
144
|
-
{...props}
|
|
145
|
-
/>
|
|
146
|
-
))
|
|
147
|
-
SelectSeparator.displayName = SelectPrimitive.Separator.displayName
|
|
148
|
-
|
|
149
|
-
export {
|
|
150
|
-
Select,
|
|
151
|
-
SelectGroup,
|
|
152
|
-
SelectValue,
|
|
153
|
-
SelectTrigger,
|
|
154
|
-
SelectContent,
|
|
155
|
-
SelectLabel,
|
|
156
|
-
SelectItem,
|
|
157
|
-
SelectSeparator,
|
|
158
|
-
SelectScrollUpButton,
|
|
159
|
-
SelectScrollDownButton,
|
|
160
|
-
}
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import * as React from "react"
|
|
2
|
-
import * as SeparatorPrimitive from "@radix-ui/react-separator"
|
|
3
|
-
|
|
4
|
-
import { cn } from "../../lib/utils"
|
|
5
|
-
|
|
6
|
-
const Separator = React.forwardRef<
|
|
7
|
-
React.ElementRef<typeof SeparatorPrimitive.Root>,
|
|
8
|
-
React.ComponentPropsWithoutRef<typeof SeparatorPrimitive.Root>
|
|
9
|
-
>(
|
|
10
|
-
(
|
|
11
|
-
{ className, orientation = "horizontal", decorative = true, ...props },
|
|
12
|
-
ref
|
|
13
|
-
) => (
|
|
14
|
-
<SeparatorPrimitive.Root
|
|
15
|
-
ref={ref}
|
|
16
|
-
decorative={decorative}
|
|
17
|
-
orientation={orientation}
|
|
18
|
-
className={cn(
|
|
19
|
-
"dy-shrink-0 dy-bg-border",
|
|
20
|
-
orientation === "horizontal" ? "dy-h-[1px] dy-w-full" : "dy-h-full dy-w-[1px]",
|
|
21
|
-
className
|
|
22
|
-
)}
|
|
23
|
-
{...props}
|
|
24
|
-
/>
|
|
25
|
-
)
|
|
26
|
-
)
|
|
27
|
-
Separator.displayName = SeparatorPrimitive.Root.displayName
|
|
28
|
-
|
|
29
|
-
export { Separator }
|
|
@@ -1,140 +0,0 @@
|
|
|
1
|
-
"use client"
|
|
2
|
-
|
|
3
|
-
import * as React from "react"
|
|
4
|
-
import * as SheetPrimitive from "@radix-ui/react-dialog"
|
|
5
|
-
import { cva, type VariantProps } from "class-variance-authority"
|
|
6
|
-
import { X } from "lucide-react"
|
|
7
|
-
|
|
8
|
-
import { cn } from "../../lib/utils"
|
|
9
|
-
|
|
10
|
-
const Sheet = SheetPrimitive.Root
|
|
11
|
-
|
|
12
|
-
const SheetTrigger = SheetPrimitive.Trigger
|
|
13
|
-
|
|
14
|
-
const SheetClose = SheetPrimitive.Close
|
|
15
|
-
|
|
16
|
-
const SheetPortal = SheetPrimitive.Portal
|
|
17
|
-
|
|
18
|
-
const SheetOverlay = React.forwardRef<
|
|
19
|
-
React.ElementRef<typeof SheetPrimitive.Overlay>,
|
|
20
|
-
React.ComponentPropsWithoutRef<typeof SheetPrimitive.Overlay>
|
|
21
|
-
>(({ className, ...props }, ref) => (
|
|
22
|
-
<SheetPrimitive.Overlay
|
|
23
|
-
className={cn(
|
|
24
|
-
"dy-fixed dy-inset-0 dy-z-50 dy-bg-black/40 dy-backdrop-blur-[2px] data-[state=open]:dy-animate-in data-[state=closed]:dy-animate-out data-[state=closed]:dy-fade-out-0 data-[state=open]:dy-fade-in-0",
|
|
25
|
-
className
|
|
26
|
-
)}
|
|
27
|
-
{...props}
|
|
28
|
-
ref={ref}
|
|
29
|
-
/>
|
|
30
|
-
))
|
|
31
|
-
SheetOverlay.displayName = SheetPrimitive.Overlay.displayName
|
|
32
|
-
|
|
33
|
-
const sheetVariants = cva(
|
|
34
|
-
"dy-fixed dy-z-50 dy-gap-4 dy-bg-white dy-p-6 dy-shadow-2xl dy-transition dy-ease-in-out data-[state=open]:dy-animate-in data-[state=closed]:dy-animate-out data-[state=closed]:dy-duration-300 data-[state=open]:dy-duration-500",
|
|
35
|
-
{
|
|
36
|
-
variants: {
|
|
37
|
-
side: {
|
|
38
|
-
top: "dy-inset-x-0 dy-top-0 dy-border-b data-[state=closed]:dy-slide-out-to-top data-[state=open]:dy-slide-in-from-top",
|
|
39
|
-
bottom:
|
|
40
|
-
"dy-inset-x-0 dy-bottom-0 dy-border-t data-[state=closed]:dy-slide-out-to-bottom data-[state=open]:dy-slide-in-from-bottom",
|
|
41
|
-
left: "dy-inset-y-0 dy-left-0 dy-h-full dy-w-3/4 dy-border-r data-[state=closed]:dy-slide-out-to-left data-[state=open]:dy-slide-in-from-left sm:dy-max-w-sm",
|
|
42
|
-
right:
|
|
43
|
-
"dy-inset-y-0 dy-right-0 dy-h-full dy-w-3/4 dy-border-l data-[state=closed]:dy-slide-out-to-right data-[state=open]:dy-slide-in-from-right sm:dy-max-w-sm",
|
|
44
|
-
},
|
|
45
|
-
},
|
|
46
|
-
defaultVariants: {
|
|
47
|
-
side: "right",
|
|
48
|
-
},
|
|
49
|
-
}
|
|
50
|
-
)
|
|
51
|
-
|
|
52
|
-
interface SheetContentProps
|
|
53
|
-
extends React.ComponentPropsWithoutRef<typeof SheetPrimitive.Content>,
|
|
54
|
-
VariantProps<typeof sheetVariants> {}
|
|
55
|
-
|
|
56
|
-
const SheetContent = React.forwardRef<
|
|
57
|
-
React.ElementRef<typeof SheetPrimitive.Content>,
|
|
58
|
-
SheetContentProps
|
|
59
|
-
>(({ side = "right", className, children, ...props }, ref) => (
|
|
60
|
-
<SheetPortal>
|
|
61
|
-
<SheetOverlay />
|
|
62
|
-
<SheetPrimitive.Content
|
|
63
|
-
ref={ref}
|
|
64
|
-
className={cn(sheetVariants({ side }), className)}
|
|
65
|
-
{...props}
|
|
66
|
-
>
|
|
67
|
-
{children}
|
|
68
|
-
<SheetPrimitive.Close className="dy-absolute dy-right-4 dy-top-4 dy-rounded-sm dy-opacity-70 dy-ring-offset-background dy-transition-opacity hover:dy-opacity-100 focus:dy-outline-none focus:dy-ring-2 focus:dy-ring-ring focus:dy-ring-offset-2 disabled:dy-pointer-events-none data-[state=open]:dy-bg-secondary">
|
|
69
|
-
<X className="dy-h-4 dy-w-4" />
|
|
70
|
-
<span className="dy-sr-only">Close</span>
|
|
71
|
-
</SheetPrimitive.Close>
|
|
72
|
-
</SheetPrimitive.Content>
|
|
73
|
-
</SheetPortal>
|
|
74
|
-
))
|
|
75
|
-
SheetContent.displayName = SheetPrimitive.Content.displayName
|
|
76
|
-
|
|
77
|
-
const SheetHeader = ({
|
|
78
|
-
className,
|
|
79
|
-
...props
|
|
80
|
-
}: React.HTMLAttributes<HTMLDivElement>) => (
|
|
81
|
-
<div
|
|
82
|
-
className={cn(
|
|
83
|
-
"dy-flex dy-flex-col dy-space-y-2 dy-text-center sm:dy-text-left",
|
|
84
|
-
className
|
|
85
|
-
)}
|
|
86
|
-
{...props}
|
|
87
|
-
/>
|
|
88
|
-
)
|
|
89
|
-
SheetHeader.displayName = "SheetHeader"
|
|
90
|
-
|
|
91
|
-
const SheetFooter = ({
|
|
92
|
-
className,
|
|
93
|
-
...props
|
|
94
|
-
}: React.HTMLAttributes<HTMLDivElement>) => (
|
|
95
|
-
<div
|
|
96
|
-
className={cn(
|
|
97
|
-
"dy-flex dy-flex-col-reverse sm:dy-flex-row sm:dy-justify-end sm:dy-space-x-2",
|
|
98
|
-
className
|
|
99
|
-
)}
|
|
100
|
-
{...props}
|
|
101
|
-
/>
|
|
102
|
-
)
|
|
103
|
-
SheetFooter.displayName = "SheetFooter"
|
|
104
|
-
|
|
105
|
-
const SheetTitle = React.forwardRef<
|
|
106
|
-
React.ElementRef<typeof SheetPrimitive.Title>,
|
|
107
|
-
React.ComponentPropsWithoutRef<typeof SheetPrimitive.Title>
|
|
108
|
-
>(({ className, ...props }, ref) => (
|
|
109
|
-
<SheetPrimitive.Title
|
|
110
|
-
ref={ref}
|
|
111
|
-
className={cn("dy-text-lg dy-font-semibold dy-text-foreground", className)}
|
|
112
|
-
{...props}
|
|
113
|
-
/>
|
|
114
|
-
))
|
|
115
|
-
SheetTitle.displayName = SheetPrimitive.Title.displayName
|
|
116
|
-
|
|
117
|
-
const SheetDescription = React.forwardRef<
|
|
118
|
-
React.ElementRef<typeof SheetPrimitive.Description>,
|
|
119
|
-
React.ComponentPropsWithoutRef<typeof SheetPrimitive.Description>
|
|
120
|
-
>(({ className, ...props }, ref) => (
|
|
121
|
-
<SheetPrimitive.Description
|
|
122
|
-
ref={ref}
|
|
123
|
-
className={cn("dy-text-sm dy-text-muted-foreground", className)}
|
|
124
|
-
{...props}
|
|
125
|
-
/>
|
|
126
|
-
))
|
|
127
|
-
SheetDescription.displayName = SheetPrimitive.Description.displayName
|
|
128
|
-
|
|
129
|
-
export {
|
|
130
|
-
Sheet,
|
|
131
|
-
SheetPortal,
|
|
132
|
-
SheetOverlay,
|
|
133
|
-
SheetTrigger,
|
|
134
|
-
SheetClose,
|
|
135
|
-
SheetContent,
|
|
136
|
-
SheetHeader,
|
|
137
|
-
SheetFooter,
|
|
138
|
-
SheetTitle,
|
|
139
|
-
SheetDescription,
|
|
140
|
-
}
|