@dyrected/admin 2.4.0 → 2.4.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/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,15 +0,0 @@
|
|
|
1
|
-
import { cn } from "../../lib/utils"
|
|
2
|
-
|
|
3
|
-
function Skeleton({
|
|
4
|
-
className,
|
|
5
|
-
...props
|
|
6
|
-
}: React.HTMLAttributes<HTMLDivElement>) {
|
|
7
|
-
return (
|
|
8
|
-
<div
|
|
9
|
-
className={cn("dy-animate-pulse dy-rounded-md dy-bg-muted", className)}
|
|
10
|
-
{...props}
|
|
11
|
-
/>
|
|
12
|
-
)
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
export { Skeleton }
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import { Toaster as Sonner } from "sonner"
|
|
2
|
-
|
|
3
|
-
type ToasterProps = React.ComponentProps<typeof Sonner>
|
|
4
|
-
|
|
5
|
-
const Toaster = ({ ...props }: ToasterProps) => {
|
|
6
|
-
return (
|
|
7
|
-
<Sonner
|
|
8
|
-
className="dy-toaster dy-group"
|
|
9
|
-
toastOptions={{
|
|
10
|
-
classNames: {
|
|
11
|
-
toast:
|
|
12
|
-
"group toast group-[.toaster]:bg-background group-[.toaster]:text-foreground group-[.toaster]:border-border group-[.toaster]:shadow-lg group-[.toaster]:rounded-xl",
|
|
13
|
-
description: "group-[.toast]:text-muted-foreground",
|
|
14
|
-
actionButton:
|
|
15
|
-
"group-[.toast]:bg-primary group-[.toast]:text-primary-foreground",
|
|
16
|
-
cancelButton:
|
|
17
|
-
"group-[.toast]:bg-muted group-[.toast]:text-muted-foreground",
|
|
18
|
-
success: "group-[.toaster]:border-emerald-500/20 group-[.toaster]:bg-emerald-50 group-[.toaster]:text-emerald-900",
|
|
19
|
-
error: "group-[.toaster]:border-red-500/20 group-[.toaster]:bg-red-50 group-[.toaster]:text-red-900",
|
|
20
|
-
},
|
|
21
|
-
}}
|
|
22
|
-
{...props}
|
|
23
|
-
/>
|
|
24
|
-
)
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
export { Toaster }
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import * as React from "react"
|
|
2
|
-
import * as SwitchPrimitives from "@radix-ui/react-switch"
|
|
3
|
-
|
|
4
|
-
import { cn } from "../../lib/utils"
|
|
5
|
-
|
|
6
|
-
const Switch = React.forwardRef<
|
|
7
|
-
React.ElementRef<typeof SwitchPrimitives.Root>,
|
|
8
|
-
React.ComponentPropsWithoutRef<typeof SwitchPrimitives.Root>
|
|
9
|
-
>(({ className, ...props }, ref) => (
|
|
10
|
-
<SwitchPrimitives.Root
|
|
11
|
-
className={cn(
|
|
12
|
-
"dy-peer dy-inline-flex dy-h-6 dy-w-11 dy-shrink-0 dy-cursor-pointer dy-items-center dy-rounded-full dy-border-2 dy-border-transparent dy-transition-colors focus-visible:dy-outline-none focus-visible:dy-ring-2 focus-visible:dy-ring-ring focus-visible:dy-ring-offset-2 focus-visible:dy-ring-offset-background disabled:dy-cursor-not-allowed disabled:dy-opacity-50 data-[state=checked]:dy-bg-primary data-[state=unchecked]:dy-bg-input",
|
|
13
|
-
className
|
|
14
|
-
)}
|
|
15
|
-
{...props}
|
|
16
|
-
ref={ref}
|
|
17
|
-
>
|
|
18
|
-
<SwitchPrimitives.Thumb
|
|
19
|
-
className={cn(
|
|
20
|
-
"dy-pointer-events-none dy-block dy-h-5 dy-w-5 dy-rounded-full dy-bg-background dy-shadow-lg dy-ring-0 dy-transition-transform data-[state=checked]:dy-translate-x-5 data-[state=unchecked]:dy-translate-x-0"
|
|
21
|
-
)}
|
|
22
|
-
/>
|
|
23
|
-
</SwitchPrimitives.Root>
|
|
24
|
-
))
|
|
25
|
-
Switch.displayName = SwitchPrimitives.Root.displayName
|
|
26
|
-
|
|
27
|
-
export { Switch }
|
|
@@ -1,117 +0,0 @@
|
|
|
1
|
-
import * as React from "react"
|
|
2
|
-
|
|
3
|
-
import { cn } from "../../lib/utils"
|
|
4
|
-
|
|
5
|
-
const Table = React.forwardRef<
|
|
6
|
-
HTMLTableElement,
|
|
7
|
-
React.HTMLAttributes<HTMLTableElement>
|
|
8
|
-
>(({ className, ...props }, ref) => (
|
|
9
|
-
<div className="dy-relative dy-w-full dy-overflow-auto">
|
|
10
|
-
<table
|
|
11
|
-
ref={ref}
|
|
12
|
-
className={cn("dy-w-full dy-caption-bottom dy-text-sm", className)}
|
|
13
|
-
{...props}
|
|
14
|
-
/>
|
|
15
|
-
</div>
|
|
16
|
-
))
|
|
17
|
-
Table.displayName = "Table"
|
|
18
|
-
|
|
19
|
-
const TableHeader = React.forwardRef<
|
|
20
|
-
HTMLTableSectionElement,
|
|
21
|
-
React.HTMLAttributes<HTMLTableSectionElement>
|
|
22
|
-
>(({ className, ...props }, ref) => (
|
|
23
|
-
<thead ref={ref} className={cn("[&_tr]:dy-border-b", className)} {...props} />
|
|
24
|
-
))
|
|
25
|
-
TableHeader.displayName = "TableHeader"
|
|
26
|
-
|
|
27
|
-
const TableBody = React.forwardRef<
|
|
28
|
-
HTMLTableSectionElement,
|
|
29
|
-
React.HTMLAttributes<HTMLTableSectionElement>
|
|
30
|
-
>(({ className, ...props }, ref) => (
|
|
31
|
-
<tbody
|
|
32
|
-
ref={ref}
|
|
33
|
-
className={cn("[&_tr:last-child]:dy-border-0", className)}
|
|
34
|
-
{...props}
|
|
35
|
-
/>
|
|
36
|
-
))
|
|
37
|
-
TableBody.displayName = "TableBody"
|
|
38
|
-
|
|
39
|
-
const TableFooter = React.forwardRef<
|
|
40
|
-
HTMLTableSectionElement,
|
|
41
|
-
React.HTMLAttributes<HTMLTableSectionElement>
|
|
42
|
-
>(({ className, ...props }, ref) => (
|
|
43
|
-
<tfoot
|
|
44
|
-
ref={ref}
|
|
45
|
-
className={cn(
|
|
46
|
-
"dy-border-t dy-bg-muted/50 dy-font-medium [&>tr]:last:dy-border-b-0",
|
|
47
|
-
className
|
|
48
|
-
)}
|
|
49
|
-
{...props}
|
|
50
|
-
/>
|
|
51
|
-
))
|
|
52
|
-
TableFooter.displayName = "TableFooter"
|
|
53
|
-
|
|
54
|
-
const TableRow = React.forwardRef<
|
|
55
|
-
HTMLTableRowElement,
|
|
56
|
-
React.HTMLAttributes<HTMLTableRowElement>
|
|
57
|
-
>(({ className, ...props }, ref) => (
|
|
58
|
-
<tr
|
|
59
|
-
ref={ref}
|
|
60
|
-
className={cn(
|
|
61
|
-
"dy-border-b dy-border-border/30 dy-transition-colors hover:dy-bg-muted/30 data-[state=selected]:dy-bg-muted",
|
|
62
|
-
className
|
|
63
|
-
)}
|
|
64
|
-
{...props}
|
|
65
|
-
/>
|
|
66
|
-
))
|
|
67
|
-
TableRow.displayName = "TableRow"
|
|
68
|
-
|
|
69
|
-
const TableHead = React.forwardRef<
|
|
70
|
-
HTMLTableCellElement,
|
|
71
|
-
React.ThHTMLAttributes<HTMLTableCellElement>
|
|
72
|
-
>(({ className, ...props }, ref) => (
|
|
73
|
-
<th
|
|
74
|
-
ref={ref}
|
|
75
|
-
className={cn(
|
|
76
|
-
"h-12 px-4 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0",
|
|
77
|
-
className
|
|
78
|
-
)}
|
|
79
|
-
{...props}
|
|
80
|
-
/>
|
|
81
|
-
))
|
|
82
|
-
TableHead.displayName = "TableHead"
|
|
83
|
-
|
|
84
|
-
const TableCell = React.forwardRef<
|
|
85
|
-
HTMLTableCellElement,
|
|
86
|
-
React.TdHTMLAttributes<HTMLTableCellElement>
|
|
87
|
-
>(({ className, ...props }, ref) => (
|
|
88
|
-
<td
|
|
89
|
-
ref={ref}
|
|
90
|
-
className={cn("p-4 align-middle [&:has([role=checkbox])]:pr-0", className)}
|
|
91
|
-
{...props}
|
|
92
|
-
/>
|
|
93
|
-
))
|
|
94
|
-
TableCell.displayName = "TableCell"
|
|
95
|
-
|
|
96
|
-
const TableCaption = React.forwardRef<
|
|
97
|
-
HTMLTableCaptionElement,
|
|
98
|
-
React.HTMLAttributes<HTMLTableCaptionElement>
|
|
99
|
-
>(({ className, ...props }, ref) => (
|
|
100
|
-
<caption
|
|
101
|
-
ref={ref}
|
|
102
|
-
className={cn("dy-mt-4 dy-text-sm dy-text-muted-foreground", className)}
|
|
103
|
-
{...props}
|
|
104
|
-
/>
|
|
105
|
-
))
|
|
106
|
-
TableCaption.displayName = "TableCaption"
|
|
107
|
-
|
|
108
|
-
export {
|
|
109
|
-
Table,
|
|
110
|
-
TableHeader,
|
|
111
|
-
TableBody,
|
|
112
|
-
TableFooter,
|
|
113
|
-
TableHead,
|
|
114
|
-
TableRow,
|
|
115
|
-
TableCell,
|
|
116
|
-
TableCaption,
|
|
117
|
-
}
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
import * as React from "react"
|
|
2
|
-
import * as TabsPrimitive from "@radix-ui/react-tabs"
|
|
3
|
-
|
|
4
|
-
import { cn } from "../../lib/utils"
|
|
5
|
-
|
|
6
|
-
const Tabs = TabsPrimitive.Root
|
|
7
|
-
|
|
8
|
-
const TabsList = React.forwardRef<
|
|
9
|
-
React.ElementRef<typeof TabsPrimitive.List>,
|
|
10
|
-
React.ComponentPropsWithoutRef<typeof TabsPrimitive.List>
|
|
11
|
-
>(({ className, ...props }, ref) => (
|
|
12
|
-
<TabsPrimitive.List
|
|
13
|
-
ref={ref}
|
|
14
|
-
className={cn(
|
|
15
|
-
"dy-inline-flex dy-h-10 dy-items-center dy-justify-center dy-rounded-md dy-bg-muted dy-p-1 dy-text-muted-foreground",
|
|
16
|
-
className
|
|
17
|
-
)}
|
|
18
|
-
{...props}
|
|
19
|
-
/>
|
|
20
|
-
))
|
|
21
|
-
TabsList.displayName = TabsPrimitive.List.displayName
|
|
22
|
-
|
|
23
|
-
const TabsTrigger = React.forwardRef<
|
|
24
|
-
React.ElementRef<typeof TabsPrimitive.Trigger>,
|
|
25
|
-
React.ComponentPropsWithoutRef<typeof TabsPrimitive.Trigger>
|
|
26
|
-
>(({ className, ...props }, ref) => (
|
|
27
|
-
<TabsPrimitive.Trigger
|
|
28
|
-
ref={ref}
|
|
29
|
-
className={cn(
|
|
30
|
-
"dy-inline-flex dy-items-center dy-justify-center dy-whitespace-nowrap dy-rounded-sm dy-px-3 dy-py-1.5 dy-text-sm dy-font-medium dy-ring-offset-background dy-transition-all focus-visible:dy-outline-none focus-visible:dy-ring-2 focus-visible:dy-ring-ring focus-visible:dy-ring-offset-2 disabled:dy-pointer-events-none disabled:dy-opacity-50 data-[state=active]:dy-bg-background data-[state=active]:dy-text-foreground data-[state=active]:dy-shadow-sm",
|
|
31
|
-
className
|
|
32
|
-
)}
|
|
33
|
-
{...props}
|
|
34
|
-
/>
|
|
35
|
-
))
|
|
36
|
-
TabsTrigger.displayName = TabsPrimitive.Trigger.displayName
|
|
37
|
-
|
|
38
|
-
const TabsContent = React.forwardRef<
|
|
39
|
-
React.ElementRef<typeof TabsPrimitive.Content>,
|
|
40
|
-
React.ComponentPropsWithoutRef<typeof TabsPrimitive.Content>
|
|
41
|
-
>(({ className, ...props }, ref) => (
|
|
42
|
-
<TabsPrimitive.Content
|
|
43
|
-
ref={ref}
|
|
44
|
-
className={cn(
|
|
45
|
-
"dy-mt-2 dy-ring-offset-background focus-visible:dy-outline-none focus-visible:dy-ring-2 focus-visible:dy-ring-ring focus-visible:dy-ring-offset-2",
|
|
46
|
-
className
|
|
47
|
-
)}
|
|
48
|
-
{...props}
|
|
49
|
-
/>
|
|
50
|
-
))
|
|
51
|
-
TabsContent.displayName = TabsPrimitive.Content.displayName
|
|
52
|
-
|
|
53
|
-
export { Tabs, TabsList, TabsTrigger, TabsContent }
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import * as React from "react"
|
|
2
|
-
|
|
3
|
-
import { cn } from "../../lib/utils"
|
|
4
|
-
|
|
5
|
-
const Textarea = React.forwardRef<
|
|
6
|
-
HTMLTextAreaElement,
|
|
7
|
-
React.ComponentProps<"textarea">
|
|
8
|
-
>(({ className, ...props }, ref) => {
|
|
9
|
-
return (
|
|
10
|
-
<textarea
|
|
11
|
-
className={cn(
|
|
12
|
-
"dy-flex dy-min-h-[80px] dy-w-full dy-rounded-md dy-border dy-border-input dy-bg-background dy-px-3 dy-py-2 dy-text-base dy-ring-offset-background placeholder:dy-text-muted-foreground focus-visible:dy-outline-none focus-visible:dy-ring-2 focus-visible:dy-ring-ring focus-visible:dy-ring-offset-2 disabled:dy-cursor-not-allowed disabled:dy-opacity-50 md:dy-text-sm",
|
|
13
|
-
className
|
|
14
|
-
)}
|
|
15
|
-
ref={ref}
|
|
16
|
-
{...props}
|
|
17
|
-
/>
|
|
18
|
-
)
|
|
19
|
-
})
|
|
20
|
-
Textarea.displayName = "Textarea"
|
|
21
|
-
|
|
22
|
-
export { Textarea }
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
import * as React from "react"
|
|
2
|
-
import * as TogglePrimitive from "@radix-ui/react-toggle"
|
|
3
|
-
import { cva, type VariantProps } from "class-variance-authority"
|
|
4
|
-
|
|
5
|
-
import { cn } from "../../lib/utils"
|
|
6
|
-
|
|
7
|
-
const toggleVariants = cva(
|
|
8
|
-
"dy-inline-flex dy-items-center dy-justify-center dy-rounded-md dy-text-sm dy-font-medium dy-ring-offset-background dy-transition-colors hover:dy-bg-muted hover:dy-text-muted-foreground focus-visible:dy-outline-none focus-visible:dy-ring-2 focus-visible:dy-ring-ring focus-visible:dy-ring-offset-2 disabled:dy-pointer-events-none disabled:dy-opacity-50 data-[state=on]:dy-bg-accent data-[state=on]:dy-text-accent-foreground [&_svg]:dy-pointer-events-none [&_svg]:dy-size-4 [&_svg]:dy-shrink-0 dy-gap-2",
|
|
9
|
-
{
|
|
10
|
-
variants: {
|
|
11
|
-
variant: {
|
|
12
|
-
default: "dy-bg-transparent",
|
|
13
|
-
outline:
|
|
14
|
-
"dy-border dy-border-input dy-bg-transparent hover:dy-bg-accent hover:dy-text-accent-foreground",
|
|
15
|
-
},
|
|
16
|
-
size: {
|
|
17
|
-
default: "dy-h-10 dy-px-3 dy-min-w-10",
|
|
18
|
-
sm: "dy-h-9 dy-px-2.5 dy-min-w-9",
|
|
19
|
-
lg: "dy-h-11 dy-px-5 dy-min-w-11",
|
|
20
|
-
},
|
|
21
|
-
},
|
|
22
|
-
defaultVariants: {
|
|
23
|
-
variant: "default",
|
|
24
|
-
size: "default",
|
|
25
|
-
},
|
|
26
|
-
}
|
|
27
|
-
)
|
|
28
|
-
|
|
29
|
-
const Toggle = React.forwardRef<
|
|
30
|
-
React.ElementRef<typeof TogglePrimitive.Root>,
|
|
31
|
-
React.ComponentPropsWithoutRef<typeof TogglePrimitive.Root> &
|
|
32
|
-
VariantProps<typeof toggleVariants>
|
|
33
|
-
>(({ className, variant, size, ...props }, ref) => (
|
|
34
|
-
<TogglePrimitive.Root
|
|
35
|
-
ref={ref}
|
|
36
|
-
className={cn(toggleVariants({ variant, size, className }))}
|
|
37
|
-
{...props}
|
|
38
|
-
/>
|
|
39
|
-
))
|
|
40
|
-
|
|
41
|
-
Toggle.displayName = TogglePrimitive.Root.displayName
|
|
42
|
-
|
|
43
|
-
export { Toggle, toggleVariants }
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import * as React from "react"
|
|
2
|
-
import * as TooltipPrimitive from "@radix-ui/react-tooltip"
|
|
3
|
-
|
|
4
|
-
import { cn } from "../../lib/utils"
|
|
5
|
-
|
|
6
|
-
const TooltipProvider = TooltipPrimitive.Provider
|
|
7
|
-
|
|
8
|
-
const Tooltip = TooltipPrimitive.Root
|
|
9
|
-
|
|
10
|
-
const TooltipTrigger = TooltipPrimitive.Trigger
|
|
11
|
-
|
|
12
|
-
const TooltipContent = React.forwardRef<
|
|
13
|
-
React.ElementRef<typeof TooltipPrimitive.Content>,
|
|
14
|
-
React.ComponentPropsWithoutRef<typeof TooltipPrimitive.Content>
|
|
15
|
-
>(({ className, sideOffset = 4, ...props }, ref) => (
|
|
16
|
-
<TooltipPrimitive.Content
|
|
17
|
-
ref={ref}
|
|
18
|
-
sideOffset={sideOffset}
|
|
19
|
-
className={cn(
|
|
20
|
-
"dy-z-50 dy-overflow-hidden dy-rounded-md dy-border dy-bg-popover dy-px-3 dy-py-1.5 dy-text-sm dy-text-popover-foreground dy-shadow-md dy-animate-in dy-fade-in-0 dy-zoom-in-95 data-[state=closed]:dy-animate-out data-[state=closed]:dy-fade-out-0 data-[state=closed]:dy-zoom-out-95 data-[side=bottom]:dy-slide-in-from-top-2 data-[side=left]:dy-slide-in-from-right-2 data-[side=right]:dy-slide-in-from-left-2 data-[side=top]:dy-slide-in-from-bottom-2 dy-origin-[--radix-tooltip-content-transform-origin]",
|
|
21
|
-
className
|
|
22
|
-
)}
|
|
23
|
-
{...props}
|
|
24
|
-
/>
|
|
25
|
-
))
|
|
26
|
-
TooltipContent.displayName = TooltipPrimitive.Content.displayName
|
|
27
|
-
|
|
28
|
-
export { Tooltip, TooltipTrigger, TooltipContent, TooltipProvider }
|
package/src/hooks/use-mobile.tsx
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import * as React from "react"
|
|
2
|
-
|
|
3
|
-
const MOBILE_BREAKPOINT = 768
|
|
4
|
-
|
|
5
|
-
export function useIsMobile() {
|
|
6
|
-
const [isMobile, setIsMobile] = React.useState<boolean | undefined>(undefined)
|
|
7
|
-
|
|
8
|
-
React.useEffect(() => {
|
|
9
|
-
const mql = window.matchMedia(`(max-width: ${MOBILE_BREAKPOINT - 1}px)`)
|
|
10
|
-
const onChange = () => {
|
|
11
|
-
setIsMobile(window.innerWidth < MOBILE_BREAKPOINT)
|
|
12
|
-
}
|
|
13
|
-
mql.addEventListener("change", onChange)
|
|
14
|
-
setIsMobile(window.innerWidth < MOBILE_BREAKPOINT)
|
|
15
|
-
return () => mql.removeEventListener("change", onChange)
|
|
16
|
-
}, [])
|
|
17
|
-
|
|
18
|
-
return !!isMobile
|
|
19
|
-
}
|
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
import * as React from "react"
|
|
2
|
-
|
|
3
|
-
export type Updater<T> = T | ((old: T) => T);
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* A hook to manage and persist user preferences in the Admin UI.
|
|
7
|
-
* Currently uses localStorage for persistence.
|
|
8
|
-
*/
|
|
9
|
-
export function usePreferences<T>(key: string, defaultValue: T): [T, (updater: Updater<T>) => void] {
|
|
10
|
-
const [value, setValue] = React.useState<T>(() => {
|
|
11
|
-
if (typeof window === "undefined") return defaultValue
|
|
12
|
-
|
|
13
|
-
try {
|
|
14
|
-
const stored = window.localStorage.getItem(`dyrected_pref_${key}`)
|
|
15
|
-
return stored ? JSON.parse(stored) : defaultValue
|
|
16
|
-
} catch (e) {
|
|
17
|
-
console.warn(`[usePreferences] Error loading key "${key}":`, e)
|
|
18
|
-
return defaultValue
|
|
19
|
-
}
|
|
20
|
-
})
|
|
21
|
-
|
|
22
|
-
// Sync state if key changes (e.g. navigating between collections)
|
|
23
|
-
React.useEffect(() => {
|
|
24
|
-
if (typeof window === "undefined") return
|
|
25
|
-
|
|
26
|
-
try {
|
|
27
|
-
const stored = window.localStorage.getItem(`dyrected_pref_${key}`)
|
|
28
|
-
if (stored) {
|
|
29
|
-
setValue(JSON.parse(stored))
|
|
30
|
-
} else {
|
|
31
|
-
setValue(defaultValue)
|
|
32
|
-
}
|
|
33
|
-
} catch (e) {
|
|
34
|
-
console.warn(`[usePreferences] Error syncing key "${key}":`, e)
|
|
35
|
-
}
|
|
36
|
-
}, [key, defaultValue])
|
|
37
|
-
|
|
38
|
-
const updateValue = React.useCallback((updater: Updater<T>) => {
|
|
39
|
-
setValue((prev) => {
|
|
40
|
-
const newValue = typeof updater === 'function'
|
|
41
|
-
? (updater as (old: T) => T)(prev)
|
|
42
|
-
: updater;
|
|
43
|
-
|
|
44
|
-
if (typeof window !== "undefined") {
|
|
45
|
-
try {
|
|
46
|
-
window.localStorage.setItem(`dyrected_pref_${key}`, JSON.stringify(newValue))
|
|
47
|
-
} catch (e) {
|
|
48
|
-
console.warn(`[usePreferences] Error saving key "${key}":`, e)
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
return newValue;
|
|
52
|
-
});
|
|
53
|
-
}, [key]);
|
|
54
|
-
|
|
55
|
-
return [value, updateValue]
|
|
56
|
-
}
|
package/src/index.css
DELETED
|
@@ -1,111 +0,0 @@
|
|
|
1
|
-
@import url('https://fonts.googleapis.com/css2?family=Instrument+Serif:ital@0;1&family=DM+Sans:ital,opsz,wght@0,9..40,100..1000;1,9..40,100..1000&display=swap');
|
|
2
|
-
|
|
3
|
-
@tailwind base;
|
|
4
|
-
@tailwind components;
|
|
5
|
-
@tailwind utilities;
|
|
6
|
-
|
|
7
|
-
@layer base {
|
|
8
|
-
/* Design Tokens — Light Foundation, Amber Accent */
|
|
9
|
-
:root {
|
|
10
|
-
/* Fonts */
|
|
11
|
-
--font-sans: "DM Sans", ui-sans-serif, system-ui, sans-serif;
|
|
12
|
-
--font-serif: "Instrument Serif", ui-serif, Georgia, serif;
|
|
13
|
-
|
|
14
|
-
/* Backgrounds */
|
|
15
|
-
--background: 60 17% 97%; /* #FAFAF8 warm white */
|
|
16
|
-
--foreground: 60 3% 6%; /* #111110 near-black, warm undertone */
|
|
17
|
-
|
|
18
|
-
--card: 60 10% 95%; /* #F2F2EF soft grey surface */
|
|
19
|
-
--card-foreground: 60 3% 6%;
|
|
20
|
-
|
|
21
|
-
--popover: 60 17% 97%;
|
|
22
|
-
--popover-foreground: 60 3% 6%;
|
|
23
|
-
|
|
24
|
-
/* Primary — Amber (overridable via branding.primaryColor) */
|
|
25
|
-
--primary: 38 92% 50%; /* #F59E0B amber */
|
|
26
|
-
--primary-foreground: 60 3% 6%; /* dark text on amber */
|
|
27
|
-
|
|
28
|
-
/* Secondary — surface tones */
|
|
29
|
-
--secondary: 60 10% 95%; /* #F2F2EF */
|
|
30
|
-
--secondary-foreground: 60 3% 6%;
|
|
31
|
-
|
|
32
|
-
/* Muted — for placeholders, subtle labels */
|
|
33
|
-
--muted: 60 10% 95%;
|
|
34
|
-
--muted-foreground: 60 4% 40%; /* #6B6B63 brown-grey */
|
|
35
|
-
|
|
36
|
-
/* Accent — very subtle hover tint */
|
|
37
|
-
--accent: 60 10% 95%;
|
|
38
|
-
--accent-foreground: 60 3% 6%;
|
|
39
|
-
|
|
40
|
-
/* Destructive */
|
|
41
|
-
--destructive: 0 84% 60%;
|
|
42
|
-
--destructive-foreground: 60 17% 97%;
|
|
43
|
-
|
|
44
|
-
/* Borders & inputs */
|
|
45
|
-
--border: 60 7% 89%; /* #E4E4E0 */
|
|
46
|
-
--input: 60 7% 89%;
|
|
47
|
-
--ring: 38 92% 50% / 0.15; /* amber ring */
|
|
48
|
-
|
|
49
|
-
--radius: 0.5rem;
|
|
50
|
-
|
|
51
|
-
/* Sidebar */
|
|
52
|
-
--sidebar-background: 60 17% 97%;
|
|
53
|
-
--sidebar-foreground: 60 3% 6%;
|
|
54
|
-
--sidebar-primary: 38 92% 50%;
|
|
55
|
-
--sidebar-primary-foreground: 60 3% 6%;
|
|
56
|
-
--sidebar-accent: 60 10% 95%;
|
|
57
|
-
--sidebar-accent-foreground: 38 92% 50%; /* amber for active items */
|
|
58
|
-
--sidebar-border: 60 7% 89%;
|
|
59
|
-
--sidebar-ring: 38 92% 50%;
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
.dy-admin-ui {
|
|
63
|
-
color-scheme: light;
|
|
64
|
-
@apply dy-font-sans;
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
.dy-admin-ui h1,
|
|
68
|
-
.dy-admin-ui h2,
|
|
69
|
-
.dy-admin-ui h3,
|
|
70
|
-
.dy-admin-ui h4,
|
|
71
|
-
.dy-admin-ui h5,
|
|
72
|
-
.dy-admin-ui h6 {
|
|
73
|
-
@apply dy-font-serif;
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
@layer utilities {
|
|
78
|
-
.dy-admin-ui .left-accent {
|
|
79
|
-
@apply dy-border-l-2 dy-border-primary/10 dy-px-4 dy--mx-8 dy-py-4 dy-transition-all dy-duration-200 dy-bg-transparent;
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
.dy-admin-ui .left-accent:hover {
|
|
83
|
-
@apply dy-border-l-primary dy-bg-primary/[0.04];
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
.dy-admin-ui .left-accent .left-accent {
|
|
87
|
-
@apply dy-px-4 dy--mx-4;
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
.dy-admin-ui .left-accent .left-accent .left-accent{
|
|
91
|
-
@apply dy-px-4 dy-mx-0;
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
.dy-admin-ui .flat-container {
|
|
95
|
-
@apply dy-bg-transparent dy-border-none dy-shadow-none dy-p-0;
|
|
96
|
-
}
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
@layer components {
|
|
100
|
-
.dy-admin-ui input,
|
|
101
|
-
.dy-admin-ui select,
|
|
102
|
-
.dy-admin-ui textarea {
|
|
103
|
-
@apply focus-visible:dy-ring-0 focus-visible:dy-ring-offset-0 focus-visible:dy-outline-none focus:dy-outline-none dy-border-border/60 dy-bg-transparent dy-transition-all;
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
.dy-admin-ui input:focus,
|
|
107
|
-
.dy-admin-ui select:focus,
|
|
108
|
-
.dy-admin-ui textarea:focus {
|
|
109
|
-
@apply dy-border-primary/50;
|
|
110
|
-
}
|
|
111
|
-
}
|