@mrigx/ui 0.1.0
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/package.json +73 -0
- package/src/blocks/ContactPanel.tsx +99 -0
- package/src/blocks/FeatureGrid.tsx +38 -0
- package/src/blocks/OpticalCTA.tsx +33 -0
- package/src/blocks/OpticalHero.tsx +51 -0
- package/src/blocks/styles.ts +175 -0
- package/src/components/accordion/optical-accordion.tsx +199 -0
- package/src/components/alert/optical-alert.tsx +59 -0
- package/src/components/alert-dialog/optical-alert-dialog.tsx +143 -0
- package/src/components/ambient-light.tsx +27 -0
- package/src/components/aspect-ratio/optical-aspect-ratio.tsx +7 -0
- package/src/components/attachment/optical-attachment.tsx +25 -0
- package/src/components/avatar/optical-avatar.tsx +50 -0
- package/src/components/badge/optical-badge.tsx +36 -0
- package/src/components/breadcrumb/optical-breadcrumb.tsx +115 -0
- package/src/components/bubble/optical-bubble.tsx +25 -0
- package/src/components/button/optical-button.tsx +67 -0
- package/src/components/button-group/optical-button-group.tsx +83 -0
- package/src/components/calendar/optical-calendar.tsx +214 -0
- package/src/components/card/optical-card.tsx +44 -0
- package/src/components/carousel/optical-carousel.tsx +262 -0
- package/src/components/chart/optical-chart.tsx +369 -0
- package/src/components/checkbox/optical-checkbox.tsx +42 -0
- package/src/components/collapsible/optical-collapsible.tsx +11 -0
- package/src/components/combobox/optical-combobox.tsx +25 -0
- package/src/components/command/optical-command.tsx +153 -0
- package/src/components/context-menu/optical-context-menu.tsx +201 -0
- package/src/components/cursor/optical-cursor.tsx +10 -0
- package/src/components/data-table/optical-data-table.tsx +25 -0
- package/src/components/date-picker/optical-date-picker.tsx +25 -0
- package/src/components/dialog/optical-dialog.tsx +110 -0
- package/src/components/direction/optical-direction.tsx +25 -0
- package/src/components/drawer/optical-drawer.tsx +120 -0
- package/src/components/dropdown-menu/optical-dropdown-menu.tsx +194 -0
- package/src/components/empty/optical-empty.tsx +104 -0
- package/src/components/field/optical-field.tsx +244 -0
- package/src/components/glass-card.tsx +13 -0
- package/src/components/hover-card/optical-hover-card.tsx +30 -0
- package/src/components/icon-button/optical-icon-button.tsx +22 -0
- package/src/components/input/optical-input.tsx +29 -0
- package/src/components/input-group/optical-input-group.tsx +170 -0
- package/src/components/input-otp/optical-input-otp.tsx +71 -0
- package/src/components/item/optical-item.tsx +193 -0
- package/src/components/kbd/optical-kbd.tsx +28 -0
- package/src/components/label/optical-label.tsx +25 -0
- package/src/components/marker/optical-marker.tsx +25 -0
- package/src/components/menubar/optical-menubar.tsx +257 -0
- package/src/components/message/optical-message.tsx +25 -0
- package/src/components/message-scroller/optical-message-scroller.tsx +25 -0
- package/src/components/native-select/optical-native-select.tsx +25 -0
- package/src/components/navigation-menu/optical-navigation-menu.tsx +68 -0
- package/src/components/pagination/optical-pagination.tsx +118 -0
- package/src/components/panel/optical-panel.tsx +26 -0
- package/src/components/popover/optical-popover.tsx +32 -0
- package/src/components/prism-button.tsx +17 -0
- package/src/components/progress/optical-progress.tsx +28 -0
- package/src/components/questionnaire/optical-questionnaire.tsx +25 -0
- package/src/components/radio-group/optical-radio-group.tsx +25 -0
- package/src/components/resizable/optical-resizable.tsx +45 -0
- package/src/components/scroll-area/optical-scroll-area.tsx +48 -0
- package/src/components/select/optical-select.tsx +110 -0
- package/src/components/separator/optical-separator.tsx +31 -0
- package/src/components/sheet/optical-sheet.tsx +143 -0
- package/src/components/sidebar/optical-sidebar.tsx +762 -0
- package/src/components/skeleton/optical-skeleton.tsx +15 -0
- package/src/components/slider/optical-slider.tsx +34 -0
- package/src/components/sonner/optical-toast.tsx +45 -0
- package/src/components/spinner/optical-spinner.tsx +16 -0
- package/src/components/stained-glass-card.tsx +93 -0
- package/src/components/switch/optical-switch.tsx +31 -0
- package/src/components/table/optical-table.tsx +83 -0
- package/src/components/tabs/optical-tabs.tsx +56 -0
- package/src/components/text/liquid-tension-text.tsx +65 -0
- package/src/components/text/optical-tension-text.tsx +65 -0
- package/src/components/text/optical-text.tsx +20 -0
- package/src/components/text/prismatic-selection.tsx +5 -0
- package/src/components/textarea/optical-textarea.tsx +22 -0
- package/src/components/theme-toggle/optical-theme-toggle.tsx +45 -0
- package/src/components/toast/optical-toast.tsx +25 -0
- package/src/components/toggle/optical-toggle.tsx +45 -0
- package/src/components/toggle-group/optical-toggle-group.tsx +61 -0
- package/src/components/tooltip/optical-tooltip.tsx +33 -0
- package/src/components/typography/optical-typography.tsx +49 -0
- package/src/hooks/use-mobile.ts +19 -0
- package/src/index.ts +88 -0
- package/src/templates/ContactPageTemplate.tsx +42 -0
- package/src/templates/LandingPageTemplate.tsx +29 -0
- package/src/templates/ProductPageTemplate.tsx +46 -0
- package/src/templates/styles.ts +23 -0
- package/src/utils/button-variants.ts +26 -0
- package/src/utils/cn.ts +6 -0
- package/tsconfig.json +27 -0
- package/vite.config.ts +42 -0
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
"use client"
|
|
2
|
+
|
|
3
|
+
import * as React from "react"
|
|
4
|
+
import * as ContextMenuPrimitive from "@radix-ui/react-context-menu"
|
|
5
|
+
import { Check, ChevronRight, Circle } from "lucide-react"
|
|
6
|
+
|
|
7
|
+
import { cn } from '../../utils/cn';
|
|
8
|
+
import { GlassSurface } from '@mrigx/fx';
|
|
9
|
+
|
|
10
|
+
const ContextMenu = ContextMenuPrimitive.Root
|
|
11
|
+
|
|
12
|
+
const ContextMenuTrigger = ContextMenuPrimitive.Trigger
|
|
13
|
+
|
|
14
|
+
const ContextMenuGroup = ContextMenuPrimitive.Group
|
|
15
|
+
|
|
16
|
+
const ContextMenuPortal = ContextMenuPrimitive.Portal
|
|
17
|
+
|
|
18
|
+
const ContextMenuSub = ContextMenuPrimitive.Sub
|
|
19
|
+
|
|
20
|
+
const ContextMenuRadioGroup = ContextMenuPrimitive.RadioGroup
|
|
21
|
+
|
|
22
|
+
const ContextMenuSubTrigger = React.forwardRef<
|
|
23
|
+
React.ElementRef<typeof ContextMenuPrimitive.SubTrigger>,
|
|
24
|
+
React.ComponentPropsWithoutRef<typeof ContextMenuPrimitive.SubTrigger> & {
|
|
25
|
+
inset?: boolean
|
|
26
|
+
}
|
|
27
|
+
>(({ className, inset, children, ...props }, ref) => (
|
|
28
|
+
<ContextMenuPrimitive.SubTrigger
|
|
29
|
+
ref={ref}
|
|
30
|
+
className={cn(
|
|
31
|
+
"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",
|
|
32
|
+
inset && "pl-8",
|
|
33
|
+
className
|
|
34
|
+
)}
|
|
35
|
+
{...props}
|
|
36
|
+
>
|
|
37
|
+
{children}
|
|
38
|
+
<ChevronRight className="ml-auto h-4 w-4" />
|
|
39
|
+
</ContextMenuPrimitive.SubTrigger>
|
|
40
|
+
))
|
|
41
|
+
ContextMenuSubTrigger.displayName = ContextMenuPrimitive.SubTrigger.displayName
|
|
42
|
+
|
|
43
|
+
const ContextMenuSubContent = React.forwardRef<
|
|
44
|
+
React.ElementRef<typeof ContextMenuPrimitive.SubContent>,
|
|
45
|
+
React.ComponentPropsWithoutRef<typeof ContextMenuPrimitive.SubContent>
|
|
46
|
+
>(({ className, ...props }, ref) => (
|
|
47
|
+
<ContextMenuPrimitive.SubContent
|
|
48
|
+
ref={ref}
|
|
49
|
+
className={cn(
|
|
50
|
+
"z-50 min-w-[8rem] overflow-hidden rounded-md border bg-transparent border-white/10 relative p-1 text-white shadow-md 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-context-menu-content-transform-origin]",
|
|
51
|
+
className
|
|
52
|
+
)}
|
|
53
|
+
{...props}
|
|
54
|
+
/>
|
|
55
|
+
))
|
|
56
|
+
ContextMenuSubContent.displayName = ContextMenuPrimitive.SubContent.displayName
|
|
57
|
+
|
|
58
|
+
const ContextMenuContent = React.forwardRef<
|
|
59
|
+
React.ElementRef<typeof ContextMenuPrimitive.Content>,
|
|
60
|
+
React.ComponentPropsWithoutRef<typeof ContextMenuPrimitive.Content>
|
|
61
|
+
>(({ className, ...props }, ref) => (
|
|
62
|
+
<ContextMenuPrimitive.Portal>
|
|
63
|
+
<ContextMenuPrimitive.Content
|
|
64
|
+
ref={ref}
|
|
65
|
+
className={cn(
|
|
66
|
+
"z-50 max-h-[--radix-context-menu-content-available-height] min-w-[8rem] overflow-y-auto overflow-x-hidden rounded-md border bg-transparent border-white/10 relative p-1 text-white shadow-md animate-in fade-in-80 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-context-menu-content-transform-origin]",
|
|
67
|
+
className
|
|
68
|
+
)}
|
|
69
|
+
{...props}
|
|
70
|
+
/>
|
|
71
|
+
</ContextMenuPrimitive.Portal>
|
|
72
|
+
))
|
|
73
|
+
ContextMenuContent.displayName = ContextMenuPrimitive.Content.displayName
|
|
74
|
+
|
|
75
|
+
const ContextMenuItem = React.forwardRef<
|
|
76
|
+
React.ElementRef<typeof ContextMenuPrimitive.Item>,
|
|
77
|
+
React.ComponentPropsWithoutRef<typeof ContextMenuPrimitive.Item> & {
|
|
78
|
+
inset?: boolean
|
|
79
|
+
}
|
|
80
|
+
>(({ className, inset, ...props }, ref) => (
|
|
81
|
+
<ContextMenuPrimitive.Item
|
|
82
|
+
ref={ref}
|
|
83
|
+
className={cn(
|
|
84
|
+
"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",
|
|
85
|
+
inset && "pl-8",
|
|
86
|
+
className
|
|
87
|
+
)}
|
|
88
|
+
{...props}
|
|
89
|
+
/>
|
|
90
|
+
))
|
|
91
|
+
ContextMenuItem.displayName = ContextMenuPrimitive.Item.displayName
|
|
92
|
+
|
|
93
|
+
const ContextMenuCheckboxItem = React.forwardRef<
|
|
94
|
+
React.ElementRef<typeof ContextMenuPrimitive.CheckboxItem>,
|
|
95
|
+
React.ComponentPropsWithoutRef<typeof ContextMenuPrimitive.CheckboxItem>
|
|
96
|
+
>(({ className, children, checked, ...props }, ref) => (
|
|
97
|
+
<ContextMenuPrimitive.CheckboxItem
|
|
98
|
+
ref={ref}
|
|
99
|
+
className={cn(
|
|
100
|
+
"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",
|
|
101
|
+
className
|
|
102
|
+
)}
|
|
103
|
+
checked={checked}
|
|
104
|
+
{...props}
|
|
105
|
+
>
|
|
106
|
+
<span className="absolute left-2 flex h-3.5 w-3.5 items-center justify-center">
|
|
107
|
+
<ContextMenuPrimitive.ItemIndicator>
|
|
108
|
+
<Check className="h-4 w-4" />
|
|
109
|
+
</ContextMenuPrimitive.ItemIndicator>
|
|
110
|
+
</span>
|
|
111
|
+
{children}
|
|
112
|
+
</ContextMenuPrimitive.CheckboxItem>
|
|
113
|
+
))
|
|
114
|
+
ContextMenuCheckboxItem.displayName =
|
|
115
|
+
ContextMenuPrimitive.CheckboxItem.displayName
|
|
116
|
+
|
|
117
|
+
const ContextMenuRadioItem = React.forwardRef<
|
|
118
|
+
React.ElementRef<typeof ContextMenuPrimitive.RadioItem>,
|
|
119
|
+
React.ComponentPropsWithoutRef<typeof ContextMenuPrimitive.RadioItem>
|
|
120
|
+
>(({ className, children, ...props }, ref) => (
|
|
121
|
+
<ContextMenuPrimitive.RadioItem
|
|
122
|
+
ref={ref}
|
|
123
|
+
className={cn(
|
|
124
|
+
"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",
|
|
125
|
+
className
|
|
126
|
+
)}
|
|
127
|
+
{...props}
|
|
128
|
+
>
|
|
129
|
+
<span className="absolute left-2 flex h-3.5 w-3.5 items-center justify-center">
|
|
130
|
+
<ContextMenuPrimitive.ItemIndicator>
|
|
131
|
+
<Circle className="h-2 w-2 fill-current" />
|
|
132
|
+
</ContextMenuPrimitive.ItemIndicator>
|
|
133
|
+
</span>
|
|
134
|
+
{children}
|
|
135
|
+
</ContextMenuPrimitive.RadioItem>
|
|
136
|
+
))
|
|
137
|
+
ContextMenuRadioItem.displayName = ContextMenuPrimitive.RadioItem.displayName
|
|
138
|
+
|
|
139
|
+
const ContextMenuLabel = React.forwardRef<
|
|
140
|
+
React.ElementRef<typeof ContextMenuPrimitive.Label>,
|
|
141
|
+
React.ComponentPropsWithoutRef<typeof ContextMenuPrimitive.Label> & {
|
|
142
|
+
inset?: boolean
|
|
143
|
+
}
|
|
144
|
+
>(({ className, inset, ...props }, ref) => (
|
|
145
|
+
<ContextMenuPrimitive.Label
|
|
146
|
+
ref={ref}
|
|
147
|
+
className={cn(
|
|
148
|
+
"px-2 py-1.5 text-sm font-semibold text-white",
|
|
149
|
+
inset && "pl-8",
|
|
150
|
+
className
|
|
151
|
+
)}
|
|
152
|
+
{...props}
|
|
153
|
+
/>
|
|
154
|
+
))
|
|
155
|
+
ContextMenuLabel.displayName = ContextMenuPrimitive.Label.displayName
|
|
156
|
+
|
|
157
|
+
const ContextMenuSeparator = React.forwardRef<
|
|
158
|
+
React.ElementRef<typeof ContextMenuPrimitive.Separator>,
|
|
159
|
+
React.ComponentPropsWithoutRef<typeof ContextMenuPrimitive.Separator>
|
|
160
|
+
>(({ className, ...props }, ref) => (
|
|
161
|
+
<ContextMenuPrimitive.Separator
|
|
162
|
+
ref={ref}
|
|
163
|
+
className={cn("-mx-1 my-1 h-px bg-border", className)}
|
|
164
|
+
{...props}
|
|
165
|
+
/>
|
|
166
|
+
))
|
|
167
|
+
ContextMenuSeparator.displayName = ContextMenuPrimitive.Separator.displayName
|
|
168
|
+
|
|
169
|
+
const ContextMenuShortcut = ({
|
|
170
|
+
className,
|
|
171
|
+
...props
|
|
172
|
+
}: React.HTMLAttributes<HTMLSpanElement>) => {
|
|
173
|
+
return (
|
|
174
|
+
<span
|
|
175
|
+
className={cn(
|
|
176
|
+
"ml-auto text-xs tracking-widest text-white/50",
|
|
177
|
+
className
|
|
178
|
+
)}
|
|
179
|
+
{...props}
|
|
180
|
+
/>
|
|
181
|
+
)
|
|
182
|
+
}
|
|
183
|
+
ContextMenuShortcut.displayName = "ContextMenuShortcut"
|
|
184
|
+
|
|
185
|
+
export {
|
|
186
|
+
ContextMenu,
|
|
187
|
+
ContextMenuTrigger,
|
|
188
|
+
ContextMenuContent,
|
|
189
|
+
ContextMenuItem,
|
|
190
|
+
ContextMenuCheckboxItem,
|
|
191
|
+
ContextMenuRadioItem,
|
|
192
|
+
ContextMenuLabel,
|
|
193
|
+
ContextMenuSeparator,
|
|
194
|
+
ContextMenuShortcut,
|
|
195
|
+
ContextMenuGroup,
|
|
196
|
+
ContextMenuPortal,
|
|
197
|
+
ContextMenuSub,
|
|
198
|
+
ContextMenuSubContent,
|
|
199
|
+
ContextMenuSubTrigger,
|
|
200
|
+
ContextMenuRadioGroup,
|
|
201
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
|
|
3
|
+
// The actual cursor rendering has been moved entirely into the WebGPU fragment shader
|
|
4
|
+
// to completely bypass the html-to-image DOM rasterization delay.
|
|
5
|
+
// This component now only serves to globally hide the native OS cursor.
|
|
6
|
+
export function OpticalCursor() {
|
|
7
|
+
return (
|
|
8
|
+
<style>{`* { cursor: none !important; }`}</style>
|
|
9
|
+
);
|
|
10
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import React, { useRef } from 'react';
|
|
2
|
+
import { useMrigSurface } from "@mrigx/react";
|
|
3
|
+
|
|
4
|
+
export interface OpticalDataTableProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
5
|
+
material?: 'glass' | 'crystal' | 'abyss';
|
|
6
|
+
materialStrength?: number;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export function OpticalDataTable({ children, className = "", material = 'glass', materialStrength = 1.0, ...props }: OpticalDataTableProps) {
|
|
10
|
+
const localRef = useRef<HTMLDivElement>(null);
|
|
11
|
+
const ref = useMrigSurface<HTMLDivElement>({ material, materialStrength, borderRadius: 8 }, localRef);
|
|
12
|
+
|
|
13
|
+
return (
|
|
14
|
+
<div
|
|
15
|
+
ref={ref as any}
|
|
16
|
+
className={`p-6 border border-white/10 bg-white/5 rounded-xl shadow-lg backdrop-blur-md flex items-center justify-center text-white/80 font-light ${className}`}
|
|
17
|
+
{...props}
|
|
18
|
+
>
|
|
19
|
+
{children || 'Data Table Interface'}
|
|
20
|
+
</div>
|
|
21
|
+
);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import React, { useRef } from 'react';
|
|
2
|
+
import { useMrigSurface } from "@mrigx/react";
|
|
3
|
+
|
|
4
|
+
export interface OpticalDatePickerProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
5
|
+
material?: 'glass' | 'crystal' | 'abyss';
|
|
6
|
+
materialStrength?: number;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export function OpticalDatePicker({ children, className = "", material = 'glass', materialStrength = 1.0, ...props }: OpticalDatePickerProps) {
|
|
10
|
+
const localRef = useRef<HTMLDivElement>(null);
|
|
11
|
+
const ref = useMrigSurface<HTMLDivElement>({ material, materialStrength, borderRadius: 8 }, localRef);
|
|
12
|
+
|
|
13
|
+
return (
|
|
14
|
+
<div
|
|
15
|
+
ref={ref as any}
|
|
16
|
+
className={`p-6 border border-white/10 bg-white/5 rounded-xl shadow-lg backdrop-blur-md flex items-center justify-center text-white/80 font-light ${className}`}
|
|
17
|
+
{...props}
|
|
18
|
+
>
|
|
19
|
+
{children || 'Date Picker Interface'}
|
|
20
|
+
</div>
|
|
21
|
+
);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
import * as React from "react"
|
|
2
|
+
import * as DialogPrimitive from "@radix-ui/react-dialog"
|
|
3
|
+
import { GlassSurface } from '@mrigx/fx';
|
|
4
|
+
|
|
5
|
+
const OpticalDialog = DialogPrimitive.Root
|
|
6
|
+
|
|
7
|
+
const OpticalDialogTrigger = DialogPrimitive.Trigger
|
|
8
|
+
|
|
9
|
+
const OpticalDialogPortal = DialogPrimitive.Portal
|
|
10
|
+
|
|
11
|
+
const OpticalDialogClose = DialogPrimitive.Close
|
|
12
|
+
|
|
13
|
+
const OpticalDialogOverlay = React.forwardRef<
|
|
14
|
+
React.ElementRef<typeof DialogPrimitive.Overlay>,
|
|
15
|
+
React.ComponentPropsWithoutRef<typeof DialogPrimitive.Overlay>
|
|
16
|
+
>(({ className, ...props }, ref) => (
|
|
17
|
+
<DialogPrimitive.Overlay
|
|
18
|
+
ref={ref}
|
|
19
|
+
className={`fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 ${className}`}
|
|
20
|
+
{...props}
|
|
21
|
+
/>
|
|
22
|
+
))
|
|
23
|
+
OpticalDialogOverlay.displayName = DialogPrimitive.Overlay.displayName
|
|
24
|
+
|
|
25
|
+
interface OpticalDialogContentProps extends React.ComponentPropsWithoutRef<typeof DialogPrimitive.Content> {
|
|
26
|
+
material?: string;
|
|
27
|
+
materialStrength?: number;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
const OpticalDialogContent = React.forwardRef<
|
|
31
|
+
React.ElementRef<typeof DialogPrimitive.Content>,
|
|
32
|
+
OpticalDialogContentProps
|
|
33
|
+
>(({ className, children, material = "glass", materialStrength = 1.0, ...props }, ref) => (
|
|
34
|
+
<OpticalDialogPortal>
|
|
35
|
+
<OpticalDialogOverlay />
|
|
36
|
+
<DialogPrimitive.Content
|
|
37
|
+
ref={ref}
|
|
38
|
+
className={`fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 duration-200 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-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-2xl ${className}`}
|
|
39
|
+
{...props}
|
|
40
|
+
>
|
|
41
|
+
<GlassSurface material={material} materialStrength={materialStrength} borderRadius={16} className="w-full border border-white/10 shadow-2xl p-6 relative">
|
|
42
|
+
{children}
|
|
43
|
+
<DialogPrimitive.Close className="absolute right-4 top-4 rounded-full opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-white/10 data-[state=open]:text-white/50 w-8 h-8 flex items-center justify-center hover:bg-white/10 cursor-pointer">
|
|
44
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round"><path d="M18 6 6 18"/><path d="m6 6 12 12"/></svg>
|
|
45
|
+
<span className="sr-only">Close</span>
|
|
46
|
+
</DialogPrimitive.Close>
|
|
47
|
+
</GlassSurface>
|
|
48
|
+
</DialogPrimitive.Content>
|
|
49
|
+
</OpticalDialogPortal>
|
|
50
|
+
))
|
|
51
|
+
OpticalDialogContent.displayName = DialogPrimitive.Content.displayName
|
|
52
|
+
|
|
53
|
+
const OpticalDialogHeader = ({
|
|
54
|
+
className,
|
|
55
|
+
...props
|
|
56
|
+
}: React.HTMLAttributes<HTMLDivElement>) => (
|
|
57
|
+
<div
|
|
58
|
+
className={`flex flex-col space-y-1.5 text-center sm:text-left ${className}`}
|
|
59
|
+
{...props}
|
|
60
|
+
/>
|
|
61
|
+
)
|
|
62
|
+
OpticalDialogHeader.displayName = "OpticalDialogHeader"
|
|
63
|
+
|
|
64
|
+
const OpticalDialogFooter = ({
|
|
65
|
+
className,
|
|
66
|
+
...props
|
|
67
|
+
}: React.HTMLAttributes<HTMLDivElement>) => (
|
|
68
|
+
<div
|
|
69
|
+
className={`flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2 ${className}`}
|
|
70
|
+
{...props}
|
|
71
|
+
/>
|
|
72
|
+
)
|
|
73
|
+
OpticalDialogFooter.displayName = "OpticalDialogFooter"
|
|
74
|
+
|
|
75
|
+
const OpticalDialogTitle = React.forwardRef<
|
|
76
|
+
React.ElementRef<typeof DialogPrimitive.Title>,
|
|
77
|
+
React.ComponentPropsWithoutRef<typeof DialogPrimitive.Title>
|
|
78
|
+
>(({ className, ...props }, ref) => (
|
|
79
|
+
<DialogPrimitive.Title
|
|
80
|
+
ref={ref}
|
|
81
|
+
className={`text-xl font-light tracking-tight text-white ${className}`}
|
|
82
|
+
{...props}
|
|
83
|
+
/>
|
|
84
|
+
))
|
|
85
|
+
OpticalDialogTitle.displayName = DialogPrimitive.Title.displayName
|
|
86
|
+
|
|
87
|
+
const OpticalDialogDescription = React.forwardRef<
|
|
88
|
+
React.ElementRef<typeof DialogPrimitive.Description>,
|
|
89
|
+
React.ComponentPropsWithoutRef<typeof DialogPrimitive.Description>
|
|
90
|
+
>(({ className, ...props }, ref) => (
|
|
91
|
+
<DialogPrimitive.Description
|
|
92
|
+
ref={ref}
|
|
93
|
+
className={`text-sm text-white/50 leading-relaxed ${className}`}
|
|
94
|
+
{...props}
|
|
95
|
+
/>
|
|
96
|
+
))
|
|
97
|
+
OpticalDialogDescription.displayName = DialogPrimitive.Description.displayName
|
|
98
|
+
|
|
99
|
+
export {
|
|
100
|
+
OpticalDialog,
|
|
101
|
+
OpticalDialogPortal,
|
|
102
|
+
OpticalDialogOverlay,
|
|
103
|
+
OpticalDialogClose,
|
|
104
|
+
OpticalDialogTrigger,
|
|
105
|
+
OpticalDialogContent,
|
|
106
|
+
OpticalDialogHeader,
|
|
107
|
+
OpticalDialogFooter,
|
|
108
|
+
OpticalDialogTitle,
|
|
109
|
+
OpticalDialogDescription,
|
|
110
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import React, { useRef } from 'react';
|
|
2
|
+
import { useMrigSurface } from "@mrigx/react";
|
|
3
|
+
|
|
4
|
+
export interface OpticalDirectionProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
5
|
+
material?: 'glass' | 'crystal' | 'abyss';
|
|
6
|
+
materialStrength?: number;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export function OpticalDirection({ children, className = "", material = 'glass', materialStrength = 1.0, ...props }: OpticalDirectionProps) {
|
|
10
|
+
const localRef = useRef<HTMLDivElement>(null);
|
|
11
|
+
const ref = useMrigSurface<HTMLDivElement>({ material, materialStrength, borderRadius: 8 }, localRef);
|
|
12
|
+
|
|
13
|
+
return (
|
|
14
|
+
<div
|
|
15
|
+
ref={ref as any}
|
|
16
|
+
className={`p-6 border border-white/10 bg-white/5 rounded-xl shadow-lg backdrop-blur-md flex items-center justify-center text-white/80 font-light ${className}`}
|
|
17
|
+
{...props}
|
|
18
|
+
>
|
|
19
|
+
{children || 'Direction Interface'}
|
|
20
|
+
</div>
|
|
21
|
+
);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
"use client"
|
|
2
|
+
|
|
3
|
+
import * as React from "react"
|
|
4
|
+
import { Drawer as DrawerPrimitive } from "vaul"
|
|
5
|
+
|
|
6
|
+
import { cn } from '../../utils/cn';
|
|
7
|
+
import { GlassSurface } from '@mrigx/fx';
|
|
8
|
+
|
|
9
|
+
const Drawer = ({
|
|
10
|
+
shouldScaleBackground = true,
|
|
11
|
+
...props
|
|
12
|
+
}: React.ComponentProps<typeof DrawerPrimitive.Root>) => (
|
|
13
|
+
<DrawerPrimitive.Root
|
|
14
|
+
shouldScaleBackground={shouldScaleBackground}
|
|
15
|
+
{...props}
|
|
16
|
+
/>
|
|
17
|
+
)
|
|
18
|
+
Drawer.displayName = "Drawer"
|
|
19
|
+
|
|
20
|
+
const DrawerTrigger = DrawerPrimitive.Trigger
|
|
21
|
+
|
|
22
|
+
const DrawerPortal = DrawerPrimitive.Portal
|
|
23
|
+
|
|
24
|
+
const DrawerClose = DrawerPrimitive.Close
|
|
25
|
+
|
|
26
|
+
const DrawerOverlay = React.forwardRef<
|
|
27
|
+
React.ElementRef<typeof DrawerPrimitive.Overlay>,
|
|
28
|
+
React.ComponentPropsWithoutRef<typeof DrawerPrimitive.Overlay>
|
|
29
|
+
>(({ className, ...props }, ref) => (
|
|
30
|
+
<DrawerPrimitive.Overlay
|
|
31
|
+
ref={ref}
|
|
32
|
+
className={cn("fixed inset-0 z-50 bg-black/80", className)}
|
|
33
|
+
{...props}
|
|
34
|
+
/>
|
|
35
|
+
))
|
|
36
|
+
DrawerOverlay.displayName = DrawerPrimitive.Overlay.displayName
|
|
37
|
+
|
|
38
|
+
const DrawerContent = React.forwardRef<
|
|
39
|
+
React.ElementRef<typeof DrawerPrimitive.Content>,
|
|
40
|
+
React.ComponentPropsWithoutRef<typeof DrawerPrimitive.Content>
|
|
41
|
+
>(({ className, children, ...props }, ref) => (
|
|
42
|
+
<DrawerPortal>
|
|
43
|
+
<DrawerOverlay />
|
|
44
|
+
<DrawerPrimitive.Content
|
|
45
|
+
ref={ref}
|
|
46
|
+
className={cn(
|
|
47
|
+
"fixed inset-x-0 bottom-0 z-50 mt-24 flex h-auto flex-col rounded-t-[10px] border bg-transparent",
|
|
48
|
+
className
|
|
49
|
+
)}
|
|
50
|
+
{...props}
|
|
51
|
+
>
|
|
52
|
+
<GlassSurface material="liquid" materialStrength={1.0} borderRadius={16} className="absolute inset-0 -z-10" />
|
|
53
|
+
<div className="mx-auto mt-4 h-2 w-[100px] rounded-full bg-white/10" />
|
|
54
|
+
{children}
|
|
55
|
+
</DrawerPrimitive.Content>
|
|
56
|
+
</DrawerPortal>
|
|
57
|
+
))
|
|
58
|
+
DrawerContent.displayName = "DrawerContent"
|
|
59
|
+
|
|
60
|
+
const DrawerHeader = ({
|
|
61
|
+
className,
|
|
62
|
+
...props
|
|
63
|
+
}: React.HTMLAttributes<HTMLDivElement>) => (
|
|
64
|
+
<div
|
|
65
|
+
className={cn("grid gap-1.5 p-4 text-center sm:text-left", className)}
|
|
66
|
+
{...props}
|
|
67
|
+
/>
|
|
68
|
+
)
|
|
69
|
+
DrawerHeader.displayName = "DrawerHeader"
|
|
70
|
+
|
|
71
|
+
const DrawerFooter = ({
|
|
72
|
+
className,
|
|
73
|
+
...props
|
|
74
|
+
}: React.HTMLAttributes<HTMLDivElement>) => (
|
|
75
|
+
<div
|
|
76
|
+
className={cn("mt-auto flex flex-col gap-2 p-4", className)}
|
|
77
|
+
{...props}
|
|
78
|
+
/>
|
|
79
|
+
)
|
|
80
|
+
DrawerFooter.displayName = "DrawerFooter"
|
|
81
|
+
|
|
82
|
+
const DrawerTitle = React.forwardRef<
|
|
83
|
+
React.ElementRef<typeof DrawerPrimitive.Title>,
|
|
84
|
+
React.ComponentPropsWithoutRef<typeof DrawerPrimitive.Title>
|
|
85
|
+
>(({ className, ...props }, ref) => (
|
|
86
|
+
<DrawerPrimitive.Title
|
|
87
|
+
ref={ref}
|
|
88
|
+
className={cn(
|
|
89
|
+
"text-lg font-semibold leading-none tracking-tight",
|
|
90
|
+
className
|
|
91
|
+
)}
|
|
92
|
+
{...props}
|
|
93
|
+
/>
|
|
94
|
+
))
|
|
95
|
+
DrawerTitle.displayName = DrawerPrimitive.Title.displayName
|
|
96
|
+
|
|
97
|
+
const DrawerDescription = React.forwardRef<
|
|
98
|
+
React.ElementRef<typeof DrawerPrimitive.Description>,
|
|
99
|
+
React.ComponentPropsWithoutRef<typeof DrawerPrimitive.Description>
|
|
100
|
+
>(({ className, ...props }, ref) => (
|
|
101
|
+
<DrawerPrimitive.Description
|
|
102
|
+
ref={ref}
|
|
103
|
+
className={cn("text-sm text-white/50", className)}
|
|
104
|
+
{...props}
|
|
105
|
+
/>
|
|
106
|
+
))
|
|
107
|
+
DrawerDescription.displayName = DrawerPrimitive.Description.displayName
|
|
108
|
+
|
|
109
|
+
export {
|
|
110
|
+
Drawer,
|
|
111
|
+
DrawerPortal,
|
|
112
|
+
DrawerOverlay,
|
|
113
|
+
DrawerTrigger,
|
|
114
|
+
DrawerClose,
|
|
115
|
+
DrawerContent,
|
|
116
|
+
DrawerHeader,
|
|
117
|
+
DrawerFooter,
|
|
118
|
+
DrawerTitle,
|
|
119
|
+
DrawerDescription,
|
|
120
|
+
}
|