@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.
Files changed (93) hide show
  1. package/package.json +73 -0
  2. package/src/blocks/ContactPanel.tsx +99 -0
  3. package/src/blocks/FeatureGrid.tsx +38 -0
  4. package/src/blocks/OpticalCTA.tsx +33 -0
  5. package/src/blocks/OpticalHero.tsx +51 -0
  6. package/src/blocks/styles.ts +175 -0
  7. package/src/components/accordion/optical-accordion.tsx +199 -0
  8. package/src/components/alert/optical-alert.tsx +59 -0
  9. package/src/components/alert-dialog/optical-alert-dialog.tsx +143 -0
  10. package/src/components/ambient-light.tsx +27 -0
  11. package/src/components/aspect-ratio/optical-aspect-ratio.tsx +7 -0
  12. package/src/components/attachment/optical-attachment.tsx +25 -0
  13. package/src/components/avatar/optical-avatar.tsx +50 -0
  14. package/src/components/badge/optical-badge.tsx +36 -0
  15. package/src/components/breadcrumb/optical-breadcrumb.tsx +115 -0
  16. package/src/components/bubble/optical-bubble.tsx +25 -0
  17. package/src/components/button/optical-button.tsx +67 -0
  18. package/src/components/button-group/optical-button-group.tsx +83 -0
  19. package/src/components/calendar/optical-calendar.tsx +214 -0
  20. package/src/components/card/optical-card.tsx +44 -0
  21. package/src/components/carousel/optical-carousel.tsx +262 -0
  22. package/src/components/chart/optical-chart.tsx +369 -0
  23. package/src/components/checkbox/optical-checkbox.tsx +42 -0
  24. package/src/components/collapsible/optical-collapsible.tsx +11 -0
  25. package/src/components/combobox/optical-combobox.tsx +25 -0
  26. package/src/components/command/optical-command.tsx +153 -0
  27. package/src/components/context-menu/optical-context-menu.tsx +201 -0
  28. package/src/components/cursor/optical-cursor.tsx +10 -0
  29. package/src/components/data-table/optical-data-table.tsx +25 -0
  30. package/src/components/date-picker/optical-date-picker.tsx +25 -0
  31. package/src/components/dialog/optical-dialog.tsx +110 -0
  32. package/src/components/direction/optical-direction.tsx +25 -0
  33. package/src/components/drawer/optical-drawer.tsx +120 -0
  34. package/src/components/dropdown-menu/optical-dropdown-menu.tsx +194 -0
  35. package/src/components/empty/optical-empty.tsx +104 -0
  36. package/src/components/field/optical-field.tsx +244 -0
  37. package/src/components/glass-card.tsx +13 -0
  38. package/src/components/hover-card/optical-hover-card.tsx +30 -0
  39. package/src/components/icon-button/optical-icon-button.tsx +22 -0
  40. package/src/components/input/optical-input.tsx +29 -0
  41. package/src/components/input-group/optical-input-group.tsx +170 -0
  42. package/src/components/input-otp/optical-input-otp.tsx +71 -0
  43. package/src/components/item/optical-item.tsx +193 -0
  44. package/src/components/kbd/optical-kbd.tsx +28 -0
  45. package/src/components/label/optical-label.tsx +25 -0
  46. package/src/components/marker/optical-marker.tsx +25 -0
  47. package/src/components/menubar/optical-menubar.tsx +257 -0
  48. package/src/components/message/optical-message.tsx +25 -0
  49. package/src/components/message-scroller/optical-message-scroller.tsx +25 -0
  50. package/src/components/native-select/optical-native-select.tsx +25 -0
  51. package/src/components/navigation-menu/optical-navigation-menu.tsx +68 -0
  52. package/src/components/pagination/optical-pagination.tsx +118 -0
  53. package/src/components/panel/optical-panel.tsx +26 -0
  54. package/src/components/popover/optical-popover.tsx +32 -0
  55. package/src/components/prism-button.tsx +17 -0
  56. package/src/components/progress/optical-progress.tsx +28 -0
  57. package/src/components/questionnaire/optical-questionnaire.tsx +25 -0
  58. package/src/components/radio-group/optical-radio-group.tsx +25 -0
  59. package/src/components/resizable/optical-resizable.tsx +45 -0
  60. package/src/components/scroll-area/optical-scroll-area.tsx +48 -0
  61. package/src/components/select/optical-select.tsx +110 -0
  62. package/src/components/separator/optical-separator.tsx +31 -0
  63. package/src/components/sheet/optical-sheet.tsx +143 -0
  64. package/src/components/sidebar/optical-sidebar.tsx +762 -0
  65. package/src/components/skeleton/optical-skeleton.tsx +15 -0
  66. package/src/components/slider/optical-slider.tsx +34 -0
  67. package/src/components/sonner/optical-toast.tsx +45 -0
  68. package/src/components/spinner/optical-spinner.tsx +16 -0
  69. package/src/components/stained-glass-card.tsx +93 -0
  70. package/src/components/switch/optical-switch.tsx +31 -0
  71. package/src/components/table/optical-table.tsx +83 -0
  72. package/src/components/tabs/optical-tabs.tsx +56 -0
  73. package/src/components/text/liquid-tension-text.tsx +65 -0
  74. package/src/components/text/optical-tension-text.tsx +65 -0
  75. package/src/components/text/optical-text.tsx +20 -0
  76. package/src/components/text/prismatic-selection.tsx +5 -0
  77. package/src/components/textarea/optical-textarea.tsx +22 -0
  78. package/src/components/theme-toggle/optical-theme-toggle.tsx +45 -0
  79. package/src/components/toast/optical-toast.tsx +25 -0
  80. package/src/components/toggle/optical-toggle.tsx +45 -0
  81. package/src/components/toggle-group/optical-toggle-group.tsx +61 -0
  82. package/src/components/tooltip/optical-tooltip.tsx +33 -0
  83. package/src/components/typography/optical-typography.tsx +49 -0
  84. package/src/hooks/use-mobile.ts +19 -0
  85. package/src/index.ts +88 -0
  86. package/src/templates/ContactPageTemplate.tsx +42 -0
  87. package/src/templates/LandingPageTemplate.tsx +29 -0
  88. package/src/templates/ProductPageTemplate.tsx +46 -0
  89. package/src/templates/styles.ts +23 -0
  90. package/src/utils/button-variants.ts +26 -0
  91. package/src/utils/cn.ts +6 -0
  92. package/tsconfig.json +27 -0
  93. package/vite.config.ts +42 -0
@@ -0,0 +1,257 @@
1
+ "use client"
2
+
3
+ import * as React from "react"
4
+ import * as MenubarPrimitive from "@radix-ui/react-menubar"
5
+ import { Check, ChevronRight, Circle } from "lucide-react"
6
+
7
+ import { cn } from '../../utils/cn';
8
+ import { GlassSurface } from '@mrigx/fx';
9
+
10
+ function MenubarMenu({
11
+ ...props
12
+ }: React.ComponentProps<typeof MenubarPrimitive.Menu>) {
13
+ return <MenubarPrimitive.Menu {...props} />
14
+ }
15
+
16
+ function MenubarGroup({
17
+ ...props
18
+ }: React.ComponentProps<typeof MenubarPrimitive.Group>) {
19
+ return <MenubarPrimitive.Group {...props} />
20
+ }
21
+
22
+ function MenubarPortal({
23
+ ...props
24
+ }: React.ComponentProps<typeof MenubarPrimitive.Portal>) {
25
+ return <MenubarPrimitive.Portal {...props} />
26
+ }
27
+
28
+ function MenubarRadioGroup({
29
+ ...props
30
+ }: React.ComponentProps<typeof MenubarPrimitive.RadioGroup>) {
31
+ return <MenubarPrimitive.RadioGroup {...props} />
32
+ }
33
+
34
+ function MenubarSub({
35
+ ...props
36
+ }: React.ComponentProps<typeof MenubarPrimitive.Sub>) {
37
+ return <MenubarPrimitive.Sub data-slot="menubar-sub" {...props} />
38
+ }
39
+
40
+ const Menubar = React.forwardRef<
41
+ React.ElementRef<typeof MenubarPrimitive.Root>,
42
+ React.ComponentPropsWithoutRef<typeof MenubarPrimitive.Root>
43
+ >(({ className, ...props }, ref) => (
44
+ <MenubarPrimitive.Root
45
+ ref={ref}
46
+ className={cn(
47
+ "flex h-10 items-center space-x-1 rounded-md border bg-transparent p-1",
48
+ className
49
+ )}
50
+ {...props}
51
+ />
52
+ ))
53
+ Menubar.displayName = MenubarPrimitive.Root.displayName
54
+
55
+ const MenubarTrigger = React.forwardRef<
56
+ React.ElementRef<typeof MenubarPrimitive.Trigger>,
57
+ React.ComponentPropsWithoutRef<typeof MenubarPrimitive.Trigger>
58
+ >(({ className, ...props }, ref) => (
59
+ <MenubarPrimitive.Trigger
60
+ ref={ref}
61
+ className={cn(
62
+ "flex cursor-default select-none items-center rounded-sm px-3 py-1.5 text-sm font-medium outline-none focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground",
63
+ className
64
+ )}
65
+ {...props}
66
+ />
67
+ ))
68
+ MenubarTrigger.displayName = MenubarPrimitive.Trigger.displayName
69
+
70
+ const MenubarSubTrigger = React.forwardRef<
71
+ React.ElementRef<typeof MenubarPrimitive.SubTrigger>,
72
+ React.ComponentPropsWithoutRef<typeof MenubarPrimitive.SubTrigger> & {
73
+ inset?: boolean
74
+ }
75
+ >(({ className, inset, children, ...props }, ref) => (
76
+ <MenubarPrimitive.SubTrigger
77
+ ref={ref}
78
+ className={cn(
79
+ "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",
80
+ inset && "pl-8",
81
+ className
82
+ )}
83
+ {...props}
84
+ >
85
+ {children}
86
+ <ChevronRight className="ml-auto h-4 w-4" />
87
+ </MenubarPrimitive.SubTrigger>
88
+ ))
89
+ MenubarSubTrigger.displayName = MenubarPrimitive.SubTrigger.displayName
90
+
91
+ const MenubarSubContent = React.forwardRef<
92
+ React.ElementRef<typeof MenubarPrimitive.SubContent>,
93
+ React.ComponentPropsWithoutRef<typeof MenubarPrimitive.SubContent>
94
+ >(({ className, ...props }, ref) => (
95
+ <MenubarPrimitive.SubContent
96
+ ref={ref}
97
+ className={cn(
98
+ "z-50 min-w-[8rem] overflow-hidden rounded-md border bg-transparent border-white/10 relative p-1 text-white data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-[--radix-menubar-content-transform-origin]",
99
+ className
100
+ )}
101
+ {...props}
102
+ />
103
+ ))
104
+ MenubarSubContent.displayName = MenubarPrimitive.SubContent.displayName
105
+
106
+ const MenubarContent = React.forwardRef<
107
+ React.ElementRef<typeof MenubarPrimitive.Content>,
108
+ React.ComponentPropsWithoutRef<typeof MenubarPrimitive.Content>
109
+ >(
110
+ (
111
+ { className, align = "start", alignOffset = -4, sideOffset = 8, ...props },
112
+ ref
113
+ ) => (
114
+ <MenubarPrimitive.Portal>
115
+ <MenubarPrimitive.Content
116
+ ref={ref}
117
+ align={align}
118
+ alignOffset={alignOffset}
119
+ sideOffset={sideOffset}
120
+ className={cn(
121
+ "z-50 min-w-[12rem] 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]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-[--radix-menubar-content-transform-origin]",
122
+ className
123
+ )}
124
+ {...props}
125
+ />
126
+ </MenubarPrimitive.Portal>
127
+ )
128
+ )
129
+ MenubarContent.displayName = MenubarPrimitive.Content.displayName
130
+
131
+ const MenubarItem = React.forwardRef<
132
+ React.ElementRef<typeof MenubarPrimitive.Item>,
133
+ React.ComponentPropsWithoutRef<typeof MenubarPrimitive.Item> & {
134
+ inset?: boolean
135
+ }
136
+ >(({ className, inset, ...props }, ref) => (
137
+ <MenubarPrimitive.Item
138
+ ref={ref}
139
+ className={cn(
140
+ "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",
141
+ inset && "pl-8",
142
+ className
143
+ )}
144
+ {...props}
145
+ />
146
+ ))
147
+ MenubarItem.displayName = MenubarPrimitive.Item.displayName
148
+
149
+ const MenubarCheckboxItem = React.forwardRef<
150
+ React.ElementRef<typeof MenubarPrimitive.CheckboxItem>,
151
+ React.ComponentPropsWithoutRef<typeof MenubarPrimitive.CheckboxItem>
152
+ >(({ className, children, checked, ...props }, ref) => (
153
+ <MenubarPrimitive.CheckboxItem
154
+ ref={ref}
155
+ className={cn(
156
+ "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",
157
+ className
158
+ )}
159
+ checked={checked}
160
+ {...props}
161
+ >
162
+ <span className="absolute left-2 flex h-3.5 w-3.5 items-center justify-center">
163
+ <MenubarPrimitive.ItemIndicator>
164
+ <Check className="h-4 w-4" />
165
+ </MenubarPrimitive.ItemIndicator>
166
+ </span>
167
+ {children}
168
+ </MenubarPrimitive.CheckboxItem>
169
+ ))
170
+ MenubarCheckboxItem.displayName = MenubarPrimitive.CheckboxItem.displayName
171
+
172
+ const MenubarRadioItem = React.forwardRef<
173
+ React.ElementRef<typeof MenubarPrimitive.RadioItem>,
174
+ React.ComponentPropsWithoutRef<typeof MenubarPrimitive.RadioItem>
175
+ >(({ className, children, ...props }, ref) => (
176
+ <MenubarPrimitive.RadioItem
177
+ ref={ref}
178
+ className={cn(
179
+ "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",
180
+ className
181
+ )}
182
+ {...props}
183
+ >
184
+ <span className="absolute left-2 flex h-3.5 w-3.5 items-center justify-center">
185
+ <MenubarPrimitive.ItemIndicator>
186
+ <Circle className="h-2 w-2 fill-current" />
187
+ </MenubarPrimitive.ItemIndicator>
188
+ </span>
189
+ {children}
190
+ </MenubarPrimitive.RadioItem>
191
+ ))
192
+ MenubarRadioItem.displayName = MenubarPrimitive.RadioItem.displayName
193
+
194
+ const MenubarLabel = React.forwardRef<
195
+ React.ElementRef<typeof MenubarPrimitive.Label>,
196
+ React.ComponentPropsWithoutRef<typeof MenubarPrimitive.Label> & {
197
+ inset?: boolean
198
+ }
199
+ >(({ className, inset, ...props }, ref) => (
200
+ <MenubarPrimitive.Label
201
+ ref={ref}
202
+ className={cn(
203
+ "px-2 py-1.5 text-sm font-semibold",
204
+ inset && "pl-8",
205
+ className
206
+ )}
207
+ {...props}
208
+ />
209
+ ))
210
+ MenubarLabel.displayName = MenubarPrimitive.Label.displayName
211
+
212
+ const MenubarSeparator = React.forwardRef<
213
+ React.ElementRef<typeof MenubarPrimitive.Separator>,
214
+ React.ComponentPropsWithoutRef<typeof MenubarPrimitive.Separator>
215
+ >(({ className, ...props }, ref) => (
216
+ <MenubarPrimitive.Separator
217
+ ref={ref}
218
+ className={cn("-mx-1 my-1 h-px bg-white/10", className)}
219
+ {...props}
220
+ />
221
+ ))
222
+ MenubarSeparator.displayName = MenubarPrimitive.Separator.displayName
223
+
224
+ const MenubarShortcut = ({
225
+ className,
226
+ ...props
227
+ }: React.HTMLAttributes<HTMLSpanElement>) => {
228
+ return (
229
+ <span
230
+ className={cn(
231
+ "ml-auto text-xs tracking-widest text-white/50",
232
+ className
233
+ )}
234
+ {...props}
235
+ />
236
+ )
237
+ }
238
+ MenubarShortcut.displayname = "MenubarShortcut"
239
+
240
+ export {
241
+ Menubar,
242
+ MenubarMenu,
243
+ MenubarTrigger,
244
+ MenubarContent,
245
+ MenubarItem,
246
+ MenubarSeparator,
247
+ MenubarLabel,
248
+ MenubarCheckboxItem,
249
+ MenubarRadioGroup,
250
+ MenubarRadioItem,
251
+ MenubarPortal,
252
+ MenubarSubContent,
253
+ MenubarSubTrigger,
254
+ MenubarGroup,
255
+ MenubarSub,
256
+ MenubarShortcut,
257
+ }
@@ -0,0 +1,25 @@
1
+ import React, { useRef } from 'react';
2
+ import { useMrigSurface } from "@mrigx/react";
3
+
4
+ export interface OpticalMessageProps extends React.HTMLAttributes<HTMLDivElement> {
5
+ material?: 'glass' | 'crystal' | 'abyss';
6
+ materialStrength?: number;
7
+ }
8
+
9
+ export function OpticalMessage({ children, className = "", material = 'glass', materialStrength = 1.0, ...props }: OpticalMessageProps) {
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 || 'Message 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 OpticalMessageScrollerProps extends React.HTMLAttributes<HTMLDivElement> {
5
+ material?: 'glass' | 'crystal' | 'abyss';
6
+ materialStrength?: number;
7
+ }
8
+
9
+ export function OpticalMessageScroller({ children, className = "", material = 'glass', materialStrength = 1.0, ...props }: OpticalMessageScrollerProps) {
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 || 'Message Scroller 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 OpticalNativeSelectProps extends React.HTMLAttributes<HTMLDivElement> {
5
+ material?: 'glass' | 'crystal' | 'abyss';
6
+ materialStrength?: number;
7
+ }
8
+
9
+ export function OpticalNativeSelect({ children, className = "", material = 'glass', materialStrength = 1.0, ...props }: OpticalNativeSelectProps) {
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 || 'Native Select Interface'}
20
+ </div>
21
+ );
22
+ }
23
+
24
+
25
+
@@ -0,0 +1,68 @@
1
+ import * as React from "react";
2
+ import { RippleSurface } from '@mrigx/fx';
3
+ import { Link, useLocation } from "react-router-dom";
4
+
5
+ export interface OpticalNavigationItem {
6
+ title: string;
7
+ href: string;
8
+ label?: string;
9
+ disabled?: boolean;
10
+ }
11
+
12
+ export interface OpticalNavigationGroup {
13
+ title: string;
14
+ items: OpticalNavigationItem[];
15
+ }
16
+
17
+ export interface OpticalNavigationMenuProps extends React.HTMLAttributes<HTMLDivElement> {
18
+ groups: OpticalNavigationGroup[];
19
+ }
20
+
21
+ export const OpticalNavigationMenu = React.forwardRef<HTMLDivElement, OpticalNavigationMenuProps>(
22
+ ({ className = "", groups, ...props }, ref) => {
23
+ const location = useLocation();
24
+
25
+ return (
26
+ <div ref={ref} className={`w-full flex flex-col gap-8 ${className}`} {...props}>
27
+ {groups.map((group, index) => (
28
+ <div key={index} className="flex flex-col gap-2">
29
+ <h4 className="px-4 text-xs font-semibold uppercase tracking-widest text-white/40 mb-2">
30
+ {group.title}
31
+ </h4>
32
+ <div className="flex flex-col gap-1">
33
+ {group.items.map((item, i) => {
34
+ const isActive = location.pathname === item.href;
35
+ return (
36
+ <RippleSurface
37
+ key={i}
38
+ material={isActive ? "crystal" : "glass"}
39
+ materialStrength={isActive ? 0.3 : 0.1}
40
+ borderRadius={8}
41
+ className="w-full relative"
42
+ >
43
+ <Link
44
+ to={item.disabled ? "#" : item.href}
45
+ className={`
46
+ w-full flex items-center justify-between px-4 py-2.5 rounded-lg text-sm font-medium transition-colors
47
+ ${item.disabled ? "opacity-40 cursor-not-allowed pointer-events-none" : "hover:text-white"}
48
+ ${isActive ? "text-white bg-white/10 shadow-[inset_0_1px_1px_rgba(255,255,255,0.05)]" : "text-white/60"}
49
+ `}
50
+ >
51
+ {item.title}
52
+ {item.label && (
53
+ <span className={`text-[10px] uppercase tracking-wider px-2 py-0.5 rounded-full ${isActive ? "bg-white/20 text-white" : "bg-white/5 text-white/40"}`}>
54
+ {item.label}
55
+ </span>
56
+ )}
57
+ </Link>
58
+ </RippleSurface>
59
+ );
60
+ })}
61
+ </div>
62
+ </div>
63
+ ))}
64
+ </div>
65
+ );
66
+ }
67
+ );
68
+ OpticalNavigationMenu.displayName = "OpticalNavigationMenu";
@@ -0,0 +1,118 @@
1
+ import * as React from "react"
2
+ import { ChevronLeft, ChevronRight, MoreHorizontal } from "lucide-react"
3
+
4
+ import { cn } from '../../utils/cn';
5
+ import { OpticalButtonProps as ButtonProps } from '../button/optical-button';
6
+ import { buttonVariants } from '../../utils/button-variants';
7
+
8
+ const Pagination = ({ className, ...props }: React.ComponentProps<"nav">) => (
9
+ <nav
10
+ role="navigation"
11
+ aria-label="pagination"
12
+ className={cn("mx-auto flex w-full justify-center", className)}
13
+ {...props}
14
+ />
15
+ )
16
+ Pagination.displayName = "Pagination"
17
+
18
+ const PaginationContent = React.forwardRef<
19
+ HTMLUListElement,
20
+ React.ComponentProps<"ul">
21
+ >(({ className, ...props }, ref) => (
22
+ <ul
23
+ ref={ref}
24
+ className={cn("flex flex-row items-center gap-1", className)}
25
+ {...props}
26
+ />
27
+ ))
28
+ PaginationContent.displayName = "PaginationContent"
29
+
30
+ const PaginationItem = React.forwardRef<
31
+ HTMLLIElement,
32
+ React.ComponentProps<"li">
33
+ >(({ className, ...props }, ref) => (
34
+ <li ref={ref} className={cn("", className)} {...props} />
35
+ ))
36
+ PaginationItem.displayName = "PaginationItem"
37
+
38
+ type PaginationLinkProps = {
39
+ isActive?: boolean
40
+ } & Pick<ButtonProps, "size"> &
41
+ React.ComponentProps<"a">
42
+
43
+ const PaginationLink = ({
44
+ className,
45
+ isActive,
46
+ size = "icon",
47
+ ...props
48
+ }: PaginationLinkProps) => (
49
+ <a
50
+ aria-current={isActive ? "page" : undefined}
51
+ className={cn(
52
+ buttonVariants({
53
+ variant: isActive ? "outline" : "ghost",
54
+ size,
55
+ }),
56
+ className
57
+ )}
58
+ {...props}
59
+ />
60
+ )
61
+ PaginationLink.displayName = "PaginationLink"
62
+
63
+ const PaginationPrevious = ({
64
+ className,
65
+ ...props
66
+ }: React.ComponentProps<typeof PaginationLink>) => (
67
+ <PaginationLink
68
+ aria-label="Go to previous page"
69
+ size="default"
70
+ className={cn("gap-1 pl-2.5", className)}
71
+ {...props}
72
+ >
73
+ <ChevronLeft className="h-4 w-4" />
74
+ <span>Previous</span>
75
+ </PaginationLink>
76
+ )
77
+ PaginationPrevious.displayName = "PaginationPrevious"
78
+
79
+ const PaginationNext = ({
80
+ className,
81
+ ...props
82
+ }: React.ComponentProps<typeof PaginationLink>) => (
83
+ <PaginationLink
84
+ aria-label="Go to next page"
85
+ size="default"
86
+ className={cn("gap-1 pr-2.5", className)}
87
+ {...props}
88
+ >
89
+ <span>Next</span>
90
+ <ChevronRight className="h-4 w-4" />
91
+ </PaginationLink>
92
+ )
93
+ PaginationNext.displayName = "PaginationNext"
94
+
95
+ const PaginationEllipsis = ({
96
+ className,
97
+ ...props
98
+ }: React.ComponentProps<"span">) => (
99
+ <span
100
+ aria-hidden
101
+ className={cn("flex h-9 w-9 items-center justify-center", className)}
102
+ {...props}
103
+ >
104
+ <MoreHorizontal className="h-4 w-4" />
105
+ <span className="sr-only">More pages</span>
106
+ </span>
107
+ )
108
+ PaginationEllipsis.displayName = "PaginationEllipsis"
109
+
110
+ export {
111
+ Pagination,
112
+ PaginationContent,
113
+ PaginationEllipsis,
114
+ PaginationItem,
115
+ PaginationLink,
116
+ PaginationNext,
117
+ PaginationPrevious,
118
+ }
@@ -0,0 +1,26 @@
1
+
2
+ import React, { forwardRef } from 'react';
3
+ import { GlassSurface } from '@mrigx/fx';
4
+
5
+ export interface OpticalPanelProps extends React.HTMLAttributes<HTMLDivElement> {
6
+ title?: string;
7
+ description?: string;
8
+ }
9
+
10
+ export const OpticalPanel = forwardRef<HTMLDivElement, OpticalPanelProps>(({ className = "", title, description, children, ...props }, ref) => {
11
+ return (
12
+ <GlassSurface
13
+ ref={ref as any}
14
+ className={`rounded-2xl border border-white/10 bg-white/5 p-6 shadow-sm ${className}`}
15
+ {...props}
16
+ >
17
+ {title && <h3 className="font-semibold leading-none tracking-tight text-white mb-2">{title}</h3>}
18
+ {description && <p className="text-sm text-white/60 mb-4">{description}</p>}
19
+ {children}
20
+ </GlassSurface>
21
+ );
22
+ });
23
+ OpticalPanel.displayName = "OpticalPanel";
24
+
25
+
26
+
@@ -0,0 +1,32 @@
1
+ import * as React from "react"
2
+ import * as PopoverPrimitive from "@radix-ui/react-popover"
3
+ import { cn } from '../../utils/cn';
4
+ import { GlassSurface } from '@mrigx/fx';
5
+
6
+ const OpticalPopover = PopoverPrimitive.Root
7
+
8
+ const OpticalPopoverTrigger = PopoverPrimitive.Trigger
9
+
10
+ const OpticalPopoverContent = React.forwardRef<
11
+ React.ElementRef<typeof PopoverPrimitive.Content>,
12
+ React.ComponentPropsWithoutRef<typeof PopoverPrimitive.Content> & { material?: string; materialStrength?: number }
13
+ >(({ className, align = "center", sideOffset = 4, material = "glass", materialStrength = 1.0, ...props }, ref) => (
14
+ <PopoverPrimitive.Portal>
15
+ <PopoverPrimitive.Content
16
+ ref={ref}
17
+ align={align}
18
+ sideOffset={sideOffset}
19
+ className={cn(
20
+ "z-50 w-72 rounded-xl border border-white/10 p-4 text-white shadow-2xl outline-none 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 relative",
21
+ className
22
+ )}
23
+ {...props}
24
+ >
25
+ <GlassSurface material={material} materialStrength={materialStrength} borderRadius={12} className="absolute inset-0 -z-10" />
26
+ {props.children}
27
+ </PopoverPrimitive.Content>
28
+ </PopoverPrimitive.Portal>
29
+ ))
30
+ OpticalPopoverContent.displayName = PopoverPrimitive.Content.displayName
31
+
32
+ export { OpticalPopover, OpticalPopoverTrigger, OpticalPopoverContent }
@@ -0,0 +1,17 @@
1
+ import React from 'react';
2
+ import { RippleSurface } from '@mrigx/fx';
3
+
4
+ export function PrismButton({ as, children, onClick, className = "", ...props }: { as?: React.ElementType, children: React.ReactNode, onClick?: () => void, className?: string, [key: string]: any }) {
5
+ return (
6
+ <RippleSurface as={as}
7
+ material={0}
8
+ materialStrength={2.5}
9
+ borderRadius={0}
10
+ onClick={onClick}
11
+ {...props} className={`cursor-pointer px-8 py-3 text-sm tracking-widest font-bold uppercase rounded-none border border-white/20 bg-white/5 hover:bg-white/10 ${className}`}
12
+ >
13
+ {children}
14
+ </RippleSurface>
15
+ );
16
+ }
17
+
@@ -0,0 +1,28 @@
1
+ "use client"
2
+
3
+ import * as React from "react"
4
+ import * as ProgressPrimitive from "@radix-ui/react-progress"
5
+
6
+ import { cn } from '../../utils/cn';
7
+
8
+ const Progress = React.forwardRef<
9
+ React.ElementRef<typeof ProgressPrimitive.Root>,
10
+ React.ComponentPropsWithoutRef<typeof ProgressPrimitive.Root>
11
+ >(({ className, value, ...props }, ref) => (
12
+ <ProgressPrimitive.Root
13
+ ref={ref}
14
+ className={cn(
15
+ "relative h-4 w-full overflow-hidden rounded-full bg-white/5",
16
+ className
17
+ )}
18
+ {...props}
19
+ >
20
+ <ProgressPrimitive.Indicator
21
+ className="h-full w-full flex-1 bg-white/20 transition-all"
22
+ style={{ transform: `translateX(-${100 - (value || 0)}%)` }}
23
+ />
24
+ </ProgressPrimitive.Root>
25
+ ))
26
+ Progress.displayName = ProgressPrimitive.Root.displayName
27
+
28
+ export { Progress }
@@ -0,0 +1,25 @@
1
+ import React, { useRef } from 'react';
2
+ import { useMrigSurface } from "@mrigx/react";
3
+
4
+ export interface OpticalQuestionnaireProps extends React.HTMLAttributes<HTMLDivElement> {
5
+ material?: 'glass' | 'crystal' | 'abyss';
6
+ materialStrength?: number;
7
+ }
8
+
9
+ export function OpticalQuestionnaire({ children, className = "", material = 'glass', materialStrength = 1.0, ...props }: OpticalQuestionnaireProps) {
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 || 'Questionnaire 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 OpticalRadioGroupProps extends React.HTMLAttributes<HTMLDivElement> {
5
+ material?: 'glass' | 'crystal' | 'abyss';
6
+ materialStrength?: number;
7
+ }
8
+
9
+ export function OpticalRadioGroup({ children, className = "", material = 'glass', materialStrength = 1.0, ...props }: OpticalRadioGroupProps) {
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 || 'Radio Group Interface'}
20
+ </div>
21
+ );
22
+ }
23
+
24
+
25
+