@surreal-ui/react 0.5.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/CHANGELOG.md +69 -0
- package/dist/index.js +11307 -0
- package/package.json +38 -0
- package/src/components/GlassmorphismAlert.tsx +40 -0
- package/src/components/GlassmorphismButton.tsx +20 -0
- package/src/components/GlassmorphismCard.tsx +43 -0
- package/src/components/GlassmorphismEmptyState.tsx +20 -0
- package/src/components/GlassmorphismInputGroup.tsx +148 -0
- package/src/components/GlassmorphismMenubar.tsx +96 -0
- package/src/components/GlassmorphismScrollArea.tsx +67 -0
- package/src/components/GlassmorphismTable.tsx +61 -0
- package/src/components/GlassmorphismTypography.tsx +31 -0
- package/src/components/MinimalistAccordion.tsx +215 -0
- package/src/components/MinimalistAlert.tsx +40 -0
- package/src/components/MinimalistAlertDialog.tsx +317 -0
- package/src/components/MinimalistAspectRatio.tsx +30 -0
- package/src/components/MinimalistAvatar.tsx +149 -0
- package/src/components/MinimalistBadge.tsx +49 -0
- package/src/components/MinimalistBreadcrumb.tsx +105 -0
- package/src/components/MinimalistButton.tsx +86 -0
- package/src/components/MinimalistButtonGroup.tsx +85 -0
- package/src/components/MinimalistCalendar.tsx +352 -0
- package/src/components/MinimalistCard.tsx +89 -0
- package/src/components/MinimalistCarousel.tsx +266 -0
- package/src/components/MinimalistChart.tsx +296 -0
- package/src/components/MinimalistCheckbox.tsx +117 -0
- package/src/components/MinimalistCodeBlock.tsx +203 -0
- package/src/components/MinimalistCollapsible.tsx +134 -0
- package/src/components/MinimalistCommand.tsx +344 -0
- package/src/components/MinimalistContextMenu.tsx +400 -0
- package/src/components/MinimalistDialog.tsx +269 -0
- package/src/components/MinimalistDrawer.tsx +216 -0
- package/src/components/MinimalistDropdownMenu.tsx +431 -0
- package/src/components/MinimalistEmpty.tsx +105 -0
- package/src/components/MinimalistEmptyState.tsx +34 -0
- package/src/components/MinimalistField.tsx +275 -0
- package/src/components/MinimalistForm.tsx +203 -0
- package/src/components/MinimalistHoverCard.tsx +48 -0
- package/src/components/MinimalistInput.tsx +24 -0
- package/src/components/MinimalistInputGroup.tsx +180 -0
- package/src/components/MinimalistInputOtp.tsx +189 -0
- package/src/components/MinimalistItem.tsx +181 -0
- package/src/components/MinimalistKbd.tsx +46 -0
- package/src/components/MinimalistLabel.tsx +19 -0
- package/src/components/MinimalistMenubar.tsx +491 -0
- package/src/components/MinimalistNativeSelect.tsx +77 -0
- package/src/components/MinimalistNavigationMenu.tsx +198 -0
- package/src/components/MinimalistPagination.tsx +152 -0
- package/src/components/MinimalistPopover.tsx +228 -0
- package/src/components/MinimalistProgress.tsx +39 -0
- package/src/components/MinimalistRadioGroup.tsx +115 -0
- package/src/components/MinimalistRangeCalendar.tsx +396 -0
- package/src/components/MinimalistResizable.tsx +54 -0
- package/src/components/MinimalistScrollArea.tsx +41 -0
- package/src/components/MinimalistSelect.tsx +265 -0
- package/src/components/MinimalistSeparator.tsx +45 -0
- package/src/components/MinimalistSheet.tsx +247 -0
- package/src/components/MinimalistSidebar.tsx +637 -0
- package/src/components/MinimalistSkeleton.tsx +16 -0
- package/src/components/MinimalistSlider.tsx +213 -0
- package/src/components/MinimalistSonner.tsx +41 -0
- package/src/components/MinimalistSpinner.tsx +39 -0
- package/src/components/MinimalistSwitch.tsx +92 -0
- package/src/components/MinimalistTable.tsx +65 -0
- package/src/components/MinimalistTabs.tsx +166 -0
- package/src/components/MinimalistTextarea.tsx +24 -0
- package/src/components/MinimalistToggle.tsx +74 -0
- package/src/components/MinimalistToggleGroup.tsx +196 -0
- package/src/components/MinimalistTooltip.tsx +172 -0
- package/src/components/MinimalistTypography.tsx +33 -0
- package/src/components/NeubrutalismCard.tsx +3 -0
- package/src/components/NeubrutalismItem.tsx +48 -0
- package/src/components/ShadcnAccordion.tsx +215 -0
- package/src/components/ShadcnAlertDialog.tsx +317 -0
- package/src/components/ShadcnAspectRatio.tsx +30 -0
- package/src/components/ShadcnAvatar.tsx +149 -0
- package/src/components/ShadcnBadge.tsx +49 -0
- package/src/components/ShadcnBreadcrumb.tsx +105 -0
- package/src/components/ShadcnButton.tsx +86 -0
- package/src/components/ShadcnButtonGroup.tsx +85 -0
- package/src/components/ShadcnCalendar.tsx +352 -0
- package/src/components/ShadcnCarousel.tsx +266 -0
- package/src/components/ShadcnChart.tsx +296 -0
- package/src/components/ShadcnCheckbox.tsx +117 -0
- package/src/components/ShadcnCodeBlock.tsx +203 -0
- package/src/components/ShadcnCollapsible.tsx +134 -0
- package/src/components/ShadcnCommand.tsx +344 -0
- package/src/components/ShadcnContextMenu.tsx +400 -0
- package/src/components/ShadcnDialog.tsx +269 -0
- package/src/components/ShadcnDrawer.tsx +216 -0
- package/src/components/ShadcnDropdownMenu.tsx +431 -0
- package/src/components/ShadcnEmpty.tsx +105 -0
- package/src/components/ShadcnField.tsx +275 -0
- package/src/components/ShadcnForm.tsx +203 -0
- package/src/components/ShadcnHoverCard.tsx +48 -0
- package/src/components/ShadcnInput.tsx +24 -0
- package/src/components/ShadcnInputGroup.tsx +180 -0
- package/src/components/ShadcnInputOtp.tsx +189 -0
- package/src/components/ShadcnItem.tsx +181 -0
- package/src/components/ShadcnKbd.tsx +46 -0
- package/src/components/ShadcnLabel.tsx +19 -0
- package/src/components/ShadcnMenubar.tsx +491 -0
- package/src/components/ShadcnNativeSelect.tsx +77 -0
- package/src/components/ShadcnNavigationMenu.tsx +198 -0
- package/src/components/ShadcnPagination.tsx +152 -0
- package/src/components/ShadcnPopover.tsx +228 -0
- package/src/components/ShadcnProgress.tsx +39 -0
- package/src/components/ShadcnRadioGroup.tsx +115 -0
- package/src/components/ShadcnRangeCalendar.tsx +396 -0
- package/src/components/ShadcnSelect.tsx +265 -0
- package/src/components/ShadcnSeparator.tsx +45 -0
- package/src/components/ShadcnSheet.tsx +247 -0
- package/src/components/ShadcnSidebar.tsx +637 -0
- package/src/components/ShadcnSkeleton.tsx +16 -0
- package/src/components/ShadcnSlider.tsx +213 -0
- package/src/components/ShadcnSonner.tsx +41 -0
- package/src/components/ShadcnSpinner.tsx +39 -0
- package/src/components/ShadcnSwitch.tsx +92 -0
- package/src/components/ShadcnTabs.tsx +166 -0
- package/src/components/ShadcnTextarea.tsx +24 -0
- package/src/components/ShadcnToggle.tsx +74 -0
- package/src/components/ShadcnToggleGroup.tsx +196 -0
- package/src/components/ShadcnTooltip.tsx +172 -0
- package/src/index.ts +124 -0
- package/tsconfig.json +10 -0
package/package.json
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@surreal-ui/react",
|
|
3
|
+
"version": "0.5.0",
|
|
4
|
+
"type": "module",
|
|
5
|
+
"main": "./dist/index.js",
|
|
6
|
+
"types": "./dist/index.d.ts",
|
|
7
|
+
"publishConfig": {
|
|
8
|
+
"access": "public"
|
|
9
|
+
},
|
|
10
|
+
"exports": {
|
|
11
|
+
".": {
|
|
12
|
+
"import": "./dist/index.js",
|
|
13
|
+
"types": "./dist/index.d.ts"
|
|
14
|
+
}
|
|
15
|
+
},
|
|
16
|
+
"peerDependencies": {
|
|
17
|
+
"react": ">=18.0.0",
|
|
18
|
+
"react-dom": ">=18.0.0"
|
|
19
|
+
},
|
|
20
|
+
"dependencies": {
|
|
21
|
+
"@radix-ui/react-hover-card": "^1.1.6",
|
|
22
|
+
"lucide-react": "^1.16.0",
|
|
23
|
+
"sonner": "^2.0.7",
|
|
24
|
+
"@surreal-ui/core": "0.5.0"
|
|
25
|
+
},
|
|
26
|
+
"devDependencies": {
|
|
27
|
+
"@radix-ui/react-hover-card": "^1.1.6",
|
|
28
|
+
"@types/react": "^18.3.0",
|
|
29
|
+
"@types/react-dom": "^18.3.0",
|
|
30
|
+
"lucide-react": "^1.16.0",
|
|
31
|
+
"sonner": "^2.0.7",
|
|
32
|
+
"tsup": "^8.0.2",
|
|
33
|
+
"typescript": "^5.5.0"
|
|
34
|
+
},
|
|
35
|
+
"scripts": {
|
|
36
|
+
"build": "tsup src/index.ts --format esm --clean --external react --external react-dom --external lucide-react --external sonner --external @radix-ui/react-hover-card --external @surreal-ui/core"
|
|
37
|
+
}
|
|
38
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { CheckCircle2, ArrowRight } from 'lucide-react';
|
|
3
|
+
|
|
4
|
+
interface CreatedComponent {
|
|
5
|
+
id: string;
|
|
6
|
+
title: string;
|
|
7
|
+
currentVersion: string | number;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
interface GlassmorphismAlertProps {
|
|
11
|
+
successMessage?: string;
|
|
12
|
+
createdComponent?: CreatedComponent | null;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export const GlassmorphismAlert: React.FC<GlassmorphismAlertProps> = ({ successMessage = '', createdComponent = null }) => {
|
|
16
|
+
if (!successMessage || !createdComponent) {
|
|
17
|
+
return null;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
return (
|
|
21
|
+
<div className="p-6 backdrop-blur-md bg-emerald-500/10 border border-emerald-500/30 rounded-2xl space-y-4 shadow-xl">
|
|
22
|
+
<div className="flex items-center gap-3 text-emerald-300 font-bold text-lg">
|
|
23
|
+
<CheckCircle2 className="w-6 h-6" />
|
|
24
|
+
<span>{successMessage}</span>
|
|
25
|
+
</div>
|
|
26
|
+
<p className="text-slate-300 text-sm">
|
|
27
|
+
View your new component v{createdComponent.currentVersion} in the Surreal UI catalog:
|
|
28
|
+
</p>
|
|
29
|
+
<a
|
|
30
|
+
href={`/components/${createdComponent.id}`}
|
|
31
|
+
className="inline-flex items-center gap-2 px-5 py-2.5 bg-emerald-600/80 hover:bg-emerald-600 text-white font-semibold text-sm rounded-xl transition-colors shadow-lg shadow-emerald-500/20 backdrop-blur-sm"
|
|
32
|
+
>
|
|
33
|
+
<span>Open {createdComponent.title} in Playground</span>
|
|
34
|
+
<ArrowRight className="w-4 h-4" />
|
|
35
|
+
</a>
|
|
36
|
+
</div>
|
|
37
|
+
);
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
export default GlassmorphismAlert;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
interface GlassButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {
|
|
3
|
+
label?: string;
|
|
4
|
+
}
|
|
5
|
+
export const GlassmorphismButton: React.FC<GlassButtonProps> = ({
|
|
6
|
+
label = 'Glass Action Button',
|
|
7
|
+
children,
|
|
8
|
+
className = '',
|
|
9
|
+
...props
|
|
10
|
+
}) => {
|
|
11
|
+
return (
|
|
12
|
+
<button
|
|
13
|
+
className={`px-6 py-3 rounded-2xl bg-white/10 backdrop-blur-md border border-white/20 text-white font-semibold shadow-lg hover:bg-white/20 transition-all active:scale-95 cursor-pointer dark:bg-slate-900/40 dark:border-white/10 dark:hover:bg-slate-900/60 ${className}`}
|
|
14
|
+
{...props}
|
|
15
|
+
>
|
|
16
|
+
{children || label}
|
|
17
|
+
</button>
|
|
18
|
+
);
|
|
19
|
+
};
|
|
20
|
+
export default GlassmorphismButton;
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
interface CardSkeletonGridProps {
|
|
3
|
+
count?: number;
|
|
4
|
+
}
|
|
5
|
+
export const CardSkeletonGrid: React.FC<CardSkeletonGridProps> = ({ count = 6 }) => {
|
|
6
|
+
return (
|
|
7
|
+
<div className="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6">
|
|
8
|
+
{Array.from({ length: count }).map((_, index) => (
|
|
9
|
+
<div
|
|
10
|
+
key={index}
|
|
11
|
+
className="relative flex flex-col justify-between rounded-2xl bg-slate-900/60 backdrop-blur-xl border border-slate-800/80 p-6 animate-pulse overflow-hidden space-y-4"
|
|
12
|
+
>
|
|
13
|
+
<div className="space-y-3">
|
|
14
|
+
<div className="flex items-center justify-between">
|
|
15
|
+
<div className="h-5 w-28 bg-slate-800/80 rounded-md"></div>
|
|
16
|
+
<div className="h-4 w-12 bg-slate-800/60 rounded"></div>
|
|
17
|
+
</div>
|
|
18
|
+
<div className="space-y-2 pt-1">
|
|
19
|
+
<div className="h-6 w-3/4 bg-slate-800/90 rounded-lg"></div>
|
|
20
|
+
<div className="h-3.5 w-full bg-slate-800/60 rounded"></div>
|
|
21
|
+
<div className="h-3.5 w-5/6 bg-slate-800/50 rounded"></div>
|
|
22
|
+
</div>
|
|
23
|
+
<div className="flex items-center gap-2 pt-2">
|
|
24
|
+
<div className="h-4 w-16 bg-slate-800/70 rounded"></div>
|
|
25
|
+
<div className="h-4 w-14 bg-slate-800/60 rounded"></div>
|
|
26
|
+
<div className="h-4 w-12 bg-slate-800/50 rounded"></div>
|
|
27
|
+
</div>
|
|
28
|
+
</div>
|
|
29
|
+
<div className="pt-4 border-t border-slate-800/60 flex items-center justify-between">
|
|
30
|
+
<div className="flex items-center gap-1.5">
|
|
31
|
+
<div className="h-4 w-12 bg-slate-800/60 rounded"></div>
|
|
32
|
+
<div className="h-4 w-12 bg-slate-800/60 rounded"></div>
|
|
33
|
+
<div className="h-4 w-12 bg-slate-800/60 rounded"></div>
|
|
34
|
+
</div>
|
|
35
|
+
<div className="h-4 w-20 bg-slate-800/70 rounded"></div>
|
|
36
|
+
</div>
|
|
37
|
+
</div>
|
|
38
|
+
))}
|
|
39
|
+
</div>
|
|
40
|
+
);
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
export default GlassmorphismCard;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Activity } from 'lucide-react';
|
|
3
|
+
interface GlassmorphismEmptyStateProps {
|
|
4
|
+
title?: string;
|
|
5
|
+
description?: string;
|
|
6
|
+
}
|
|
7
|
+
export const GlassmorphismEmptyState: React.FC<GlassmorphismEmptyStateProps> = ({
|
|
8
|
+
title = 'No activity logged yet',
|
|
9
|
+
description = 'Activities will appear automatically as components are ingested or modified.',
|
|
10
|
+
}) => {
|
|
11
|
+
return (
|
|
12
|
+
<div className="text-center py-16 px-6 bg-white/5 backdrop-blur-md border border-dashed border-white/10 rounded-3xl space-y-3 shadow-2xl">
|
|
13
|
+
<Activity className="w-10 h-10 mx-auto text-slate-400" />
|
|
14
|
+
<h3 className="text-lg font-bold text-white">{title}</h3>
|
|
15
|
+
<p className="text-xs text-slate-400">{description}</p>
|
|
16
|
+
</div>
|
|
17
|
+
);
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
export default GlassmorphismEmptyState;
|
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
import React, { useState } from 'react';
|
|
2
|
+
import { Sparkles, Loader2 } from 'lucide-react';
|
|
3
|
+
|
|
4
|
+
interface GlassInputGroupProps {
|
|
5
|
+
componentTypeId?: string;
|
|
6
|
+
aestheticId?: string;
|
|
7
|
+
codeBundle?: string;
|
|
8
|
+
changelogNote?: string;
|
|
9
|
+
sourcePlatform?: string;
|
|
10
|
+
loading?: boolean;
|
|
11
|
+
onSubmit?: () => void;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export const GlassInputGroup: React.FC<GlassInputGroupProps> = ({
|
|
15
|
+
componentTypeId: initialComponentTypeId = 'button',
|
|
16
|
+
aestheticId: initialAestheticId = 'glassmorphism',
|
|
17
|
+
codeBundle: initialCodeBundle = '',
|
|
18
|
+
changelogNote: initialChangelogNote = 'Initial code package release',
|
|
19
|
+
sourcePlatform: initialSourcePlatform = '',
|
|
20
|
+
loading = false,
|
|
21
|
+
onSubmit = () => {},
|
|
22
|
+
}) => {
|
|
23
|
+
const [componentTypeId, setComponentTypeId] = useState(initialComponentTypeId);
|
|
24
|
+
const [aestheticId, setAestheticId] = useState(initialAestheticId);
|
|
25
|
+
const [codeBundle, setCodeBundle] = useState(initialCodeBundle);
|
|
26
|
+
const [changelogNote, setChangelogNote] = useState(initialChangelogNote);
|
|
27
|
+
const [sourcePlatform, setSourcePlatform] = useState(initialSourcePlatform);
|
|
28
|
+
|
|
29
|
+
const handleSubmit = (e: React.FormEvent) => {
|
|
30
|
+
e.preventDefault();
|
|
31
|
+
onSubmit();
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
return (
|
|
35
|
+
<form
|
|
36
|
+
onSubmit={handleSubmit}
|
|
37
|
+
className="p-8 rounded-3xl bg-slate-900/80 backdrop-blur-xl border border-slate-800/80 space-y-6 shadow-2xl"
|
|
38
|
+
>
|
|
39
|
+
<div className="grid grid-cols-1 md:grid-cols-2 gap-6">
|
|
40
|
+
<div className="space-y-2">
|
|
41
|
+
<label
|
|
42
|
+
htmlFor="comp-type"
|
|
43
|
+
className="text-xs font-semibold text-slate-300 uppercase tracking-wider"
|
|
44
|
+
>
|
|
45
|
+
UI Component Type *
|
|
46
|
+
</label>
|
|
47
|
+
<input
|
|
48
|
+
id="comp-type"
|
|
49
|
+
type="text"
|
|
50
|
+
value={componentTypeId}
|
|
51
|
+
onChange={(e) => setComponentTypeId(e.target.value)}
|
|
52
|
+
placeholder="e.g. button, card, dialog, accordion"
|
|
53
|
+
required
|
|
54
|
+
className="w-full px-4 py-2.5 bg-slate-950/60 border border-slate-800 rounded-xl text-sm text-white placeholder-slate-500 focus:outline-none focus:border-indigo-500"
|
|
55
|
+
/>
|
|
56
|
+
</div>
|
|
57
|
+
<div className="space-y-2">
|
|
58
|
+
<label
|
|
59
|
+
htmlFor="aesthetic-id"
|
|
60
|
+
className="text-xs font-semibold text-slate-300 uppercase tracking-wider"
|
|
61
|
+
>
|
|
62
|
+
Aesthetic Variant *
|
|
63
|
+
</label>
|
|
64
|
+
<input
|
|
65
|
+
id="aesthetic-id"
|
|
66
|
+
type="text"
|
|
67
|
+
value={aestheticId}
|
|
68
|
+
onChange={(e) => setAestheticId(e.target.value)}
|
|
69
|
+
placeholder="e.g. glassmorphism, neubrutalism, minimalist, modern"
|
|
70
|
+
required
|
|
71
|
+
className="w-full px-4 py-2.5 bg-slate-950/60 border border-slate-800 rounded-xl text-sm text-white placeholder-slate-500 focus:outline-none focus:border-indigo-500"
|
|
72
|
+
/>
|
|
73
|
+
</div>
|
|
74
|
+
<div className="space-y-2">
|
|
75
|
+
<label
|
|
76
|
+
htmlFor="source-plat"
|
|
77
|
+
className="text-xs font-semibold text-slate-300 uppercase tracking-wider"
|
|
78
|
+
>
|
|
79
|
+
Source Language (Optional)
|
|
80
|
+
</label>
|
|
81
|
+
<select
|
|
82
|
+
id="source-plat"
|
|
83
|
+
value={sourcePlatform}
|
|
84
|
+
onChange={(e) => setSourcePlatform(e.target.value)}
|
|
85
|
+
className="w-full px-4 py-2.5 bg-slate-950/60 border border-slate-800 rounded-xl text-sm text-white focus:outline-none focus:border-indigo-500"
|
|
86
|
+
>
|
|
87
|
+
<option value="">✨ Auto-Detect Language</option>
|
|
88
|
+
<option value="svelte">Svelte Component (.svelte)</option>
|
|
89
|
+
<option value="react">React Component (.tsx/.jsx)</option>
|
|
90
|
+
<option value="webcomponent">WebComponent / Custom Element</option>
|
|
91
|
+
</select>
|
|
92
|
+
</div>
|
|
93
|
+
<div className="space-y-2">
|
|
94
|
+
<label
|
|
95
|
+
htmlFor="change-note"
|
|
96
|
+
className="text-xs font-semibold text-slate-300 uppercase tracking-wider"
|
|
97
|
+
>
|
|
98
|
+
Changelog Note
|
|
99
|
+
</label>
|
|
100
|
+
<input
|
|
101
|
+
id="change-note"
|
|
102
|
+
type="text"
|
|
103
|
+
value={changelogNote}
|
|
104
|
+
onChange={(e) => setChangelogNote(e.target.value)}
|
|
105
|
+
placeholder="Summary of code changes..."
|
|
106
|
+
className="w-full px-4 py-2.5 bg-slate-950/60 border border-slate-800 rounded-xl text-sm text-white placeholder-slate-500 focus:outline-none focus:border-indigo-500"
|
|
107
|
+
/>
|
|
108
|
+
</div>
|
|
109
|
+
</div>
|
|
110
|
+
<div className="space-y-2">
|
|
111
|
+
<label
|
|
112
|
+
htmlFor="code-bundle"
|
|
113
|
+
className="text-xs font-semibold text-slate-300 uppercase tracking-wider"
|
|
114
|
+
>
|
|
115
|
+
Raw Encapsulated Code Bundle *
|
|
116
|
+
</label>
|
|
117
|
+
<textarea
|
|
118
|
+
id="code-bundle"
|
|
119
|
+
value={codeBundle}
|
|
120
|
+
onChange={(e) => setCodeBundle(e.target.value)}
|
|
121
|
+
rows={10}
|
|
122
|
+
required
|
|
123
|
+
placeholder="Paste component source code here..."
|
|
124
|
+
className="w-full p-4 bg-slate-950/60 border border-slate-800 rounded-xl font-mono text-xs text-indigo-200 placeholder-slate-600 focus:outline-none focus:border-indigo-500 leading-relaxed"
|
|
125
|
+
></textarea>
|
|
126
|
+
</div>
|
|
127
|
+
<button
|
|
128
|
+
type="submit"
|
|
129
|
+
disabled={loading}
|
|
130
|
+
className="w-full py-3.5 bg-gradient-to-r from-indigo-500 via-purple-500 to-pink-500 hover:from-indigo-600 hover:to-pink-600 text-white font-bold text-sm rounded-xl shadow-xl shadow-indigo-500/25 transition-all flex items-center justify-center gap-2 cursor-pointer disabled:opacity-50"
|
|
131
|
+
>
|
|
132
|
+
{loading ? (
|
|
133
|
+
<>
|
|
134
|
+
<Loader2 className="w-5 h-5 animate-spin" />
|
|
135
|
+
<span>Ingesting Code Package & Synthesizing Multi-Platform Bundles...</span>
|
|
136
|
+
</>
|
|
137
|
+
) : (
|
|
138
|
+
<>
|
|
139
|
+
<Sparkles className="w-5 h-5" />
|
|
140
|
+
<span>Ingest Code Package & Generate Svelte, React & WebComponent Variants</span>
|
|
141
|
+
</>
|
|
142
|
+
)}
|
|
143
|
+
</button>
|
|
144
|
+
</form>
|
|
145
|
+
);
|
|
146
|
+
};
|
|
147
|
+
|
|
148
|
+
export default GlassmorphismInputGroup;
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import {
|
|
3
|
+
Sparkles,
|
|
4
|
+
LayoutGrid,
|
|
5
|
+
PlusCircle,
|
|
6
|
+
Activity,
|
|
7
|
+
Terminal,
|
|
8
|
+
Github,
|
|
9
|
+
LogOut,
|
|
10
|
+
User,
|
|
11
|
+
} from 'lucide-react';
|
|
12
|
+
interface GlassmorphismMenubarProps {
|
|
13
|
+
appVersion?: string;
|
|
14
|
+
currentUser?: { email: string } | null;
|
|
15
|
+
onSignOut?: () => void;
|
|
16
|
+
}
|
|
17
|
+
export const GlassmorphismMenubar: React.FC<GlassmorphismMenubarProps> = ({
|
|
18
|
+
appVersion = '0.1.0',
|
|
19
|
+
currentUser = null,
|
|
20
|
+
onSignOut = () => {},
|
|
21
|
+
}) => {
|
|
22
|
+
return (
|
|
23
|
+
<header className="sticky top-0 z-50 bg-slate-950/80 backdrop-blur-md border-b border-slate-800/80 px-4 lg:px-8 py-3.5">
|
|
24
|
+
<div className="max-w-7xl mx-auto flex items-center justify-between gap-4">
|
|
25
|
+
<a href="/" className="flex items-center gap-2.5 group">
|
|
26
|
+
<div className="p-2 rounded-xl bg-gradient-to-tr from-indigo-500 via-purple-500 to-pink-500 text-white shadow-lg shadow-indigo-500/30 group-hover:scale-105 transition-transform">
|
|
27
|
+
<Sparkles className="w-5 h-5" />
|
|
28
|
+
</div>
|
|
29
|
+
<div>
|
|
30
|
+
<span className="text-xl font-bold bg-gradient-to-r from-white via-slate-200 to-indigo-300 bg-clip-text text-transparent tracking-tight">
|
|
31
|
+
Surreal UI
|
|
32
|
+
</span>
|
|
33
|
+
<span className="hidden sm:inline-block ml-2 px-2 py-0.5 text-[10px] font-mono tracking-wider bg-indigo-500/20 text-indigo-300 border border-indigo-500/30 rounded-full">
|
|
34
|
+
v{appVersion}
|
|
35
|
+
</span>
|
|
36
|
+
</div>
|
|
37
|
+
</a>
|
|
38
|
+
<nav className="hidden md:flex items-center gap-1 bg-slate-900/60 p-1 rounded-xl border border-slate-800">
|
|
39
|
+
<a
|
|
40
|
+
href="/"
|
|
41
|
+
className="flex items-center gap-2 px-3.5 py-1.5 rounded-lg text-sm font-medium hover:bg-slate-800 text-slate-200 transition-colors"
|
|
42
|
+
>
|
|
43
|
+
<LayoutGrid className="w-4 h-4 text-indigo-400" />
|
|
44
|
+
Catalog
|
|
45
|
+
</a>
|
|
46
|
+
<a
|
|
47
|
+
href="/studio"
|
|
48
|
+
className="flex items-center gap-2 px-3.5 py-1.5 rounded-lg text-sm font-medium hover:bg-slate-800 text-slate-200 transition-colors"
|
|
49
|
+
>
|
|
50
|
+
<PlusCircle className="w-4 h-4 text-pink-400" />
|
|
51
|
+
Studio & Ingest
|
|
52
|
+
</a>
|
|
53
|
+
<a
|
|
54
|
+
href="/activity"
|
|
55
|
+
className="flex items-center gap-2 px-3.5 py-1.5 rounded-lg text-sm font-medium hover:bg-slate-800 text-slate-200 transition-colors"
|
|
56
|
+
>
|
|
57
|
+
<Activity className="w-4 h-4 text-emerald-400" />
|
|
58
|
+
Activity Log
|
|
59
|
+
</a>
|
|
60
|
+
</nav>
|
|
61
|
+
<div className="flex items-center gap-2 sm:gap-3">
|
|
62
|
+
<div className="hidden lg:flex items-center gap-1.5 px-3 py-1.5 bg-slate-900 border border-slate-800 rounded-lg text-xs font-mono text-slate-400">
|
|
63
|
+
<Terminal className="w-3.5 h-3.5 text-purple-400" />
|
|
64
|
+
<span>npx @surreal-ui/mcp</span>
|
|
65
|
+
</div>
|
|
66
|
+
<a
|
|
67
|
+
href="https://github.com/surrealroad/surreal-ui"
|
|
68
|
+
target="_blank"
|
|
69
|
+
rel="noreferrer"
|
|
70
|
+
className="p-2 rounded-lg bg-slate-900 border border-slate-800 hover:bg-slate-800 text-slate-300 transition-colors hidden sm:inline-flex"
|
|
71
|
+
title="GitHub Repository"
|
|
72
|
+
>
|
|
73
|
+
<Github className="w-4 h-4" />
|
|
74
|
+
</a>
|
|
75
|
+
{currentUser && (
|
|
76
|
+
<div className="flex items-center gap-2 pl-2 border-l border-slate-800">
|
|
77
|
+
<div className="hidden sm:flex items-center gap-1.5 px-2.5 py-1 bg-indigo-500/10 border border-indigo-500/20 rounded-lg text-xs text-indigo-300">
|
|
78
|
+
<User className="w-3.5 h-3.5 text-indigo-400" />
|
|
79
|
+
<span className="max-w-[120px] truncate font-medium">{currentUser.email}</span>
|
|
80
|
+
</div>
|
|
81
|
+
<button
|
|
82
|
+
onClick={onSignOut}
|
|
83
|
+
className="p-2 rounded-lg bg-slate-900 border border-slate-800 hover:bg-red-500/20 hover:border-red-500/30 hover:text-red-300 text-slate-400 transition-colors"
|
|
84
|
+
title="Sign Out"
|
|
85
|
+
>
|
|
86
|
+
<LogOut className="w-4 h-4" />
|
|
87
|
+
</button>
|
|
88
|
+
</div>
|
|
89
|
+
)}
|
|
90
|
+
</div>
|
|
91
|
+
</div>
|
|
92
|
+
</header>
|
|
93
|
+
);
|
|
94
|
+
};
|
|
95
|
+
|
|
96
|
+
export default GlassmorphismMenubar;
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { RotateCcw } from 'lucide-react';
|
|
3
|
+
interface Version {
|
|
4
|
+
id: string;
|
|
5
|
+
version: string;
|
|
6
|
+
aestheticId: string;
|
|
7
|
+
createdAt: string;
|
|
8
|
+
changelogNote: string;
|
|
9
|
+
}
|
|
10
|
+
interface GlassmorphismScrollAreaProps {
|
|
11
|
+
currentVersionId?: string;
|
|
12
|
+
versions?: Version[];
|
|
13
|
+
revertLoading?: boolean;
|
|
14
|
+
onRevert?: (versionId: string) => void;
|
|
15
|
+
}
|
|
16
|
+
export const GlassmorphismScrollArea: React.FC<GlassmorphismScrollAreaProps> = ({
|
|
17
|
+
currentVersionId = '',
|
|
18
|
+
versions = [],
|
|
19
|
+
revertLoading = false,
|
|
20
|
+
onRevert = () => {},
|
|
21
|
+
}) => {
|
|
22
|
+
return (
|
|
23
|
+
<div className="backdrop-blur-xl bg-slate-900/60 border border-white/10 p-6 rounded-2xl shadow-2xl space-y-4 max-h-[600px] overflow-y-auto">
|
|
24
|
+
<h3 className="text-sm font-semibold text-slate-300 uppercase tracking-wider">
|
|
25
|
+
Semver Timeline & Revert
|
|
26
|
+
</h3>
|
|
27
|
+
<div className="space-y-3">
|
|
28
|
+
{versions.map((v) => (
|
|
29
|
+
<div
|
|
30
|
+
key={v.id}
|
|
31
|
+
className="p-4 rounded-xl bg-slate-950/40 border border-white/10 backdrop-blur-md flex flex-col sm:flex-row sm:items-center justify-between gap-4 transition-all hover:bg-slate-950/60"
|
|
32
|
+
>
|
|
33
|
+
<div className="space-y-1">
|
|
34
|
+
<div className="flex flex-wrap items-center gap-2">
|
|
35
|
+
<span className="font-mono text-sm font-bold text-indigo-300">v{v.version}</span>
|
|
36
|
+
<span className="px-2 py-0.5 text-[10px] font-mono bg-purple-500/20 text-purple-300 border border-purple-500/30 rounded">
|
|
37
|
+
{v.aestheticId}
|
|
38
|
+
</span>
|
|
39
|
+
{v.id === currentVersionId && (
|
|
40
|
+
<span className="px-2 py-0.5 text-[10px] font-bold bg-emerald-500/20 text-emerald-300 border border-emerald-500/30 rounded-full uppercase">
|
|
41
|
+
Active Version
|
|
42
|
+
</span>
|
|
43
|
+
)}
|
|
44
|
+
<span className="text-xs text-slate-500">
|
|
45
|
+
{new Date(v.createdAt).toLocaleString()}
|
|
46
|
+
</span>
|
|
47
|
+
</div>
|
|
48
|
+
<p className="text-xs text-slate-300">{v.changelogNote}</p>
|
|
49
|
+
</div>
|
|
50
|
+
{v.id !== currentVersionId && (
|
|
51
|
+
<button
|
|
52
|
+
disabled={revertLoading}
|
|
53
|
+
onClick={() => onRevert(v.id)}
|
|
54
|
+
className="px-3.5 py-1.5 bg-white/5 hover:bg-white/10 active:bg-white/15 disabled:opacity-50 text-slate-200 text-xs font-semibold rounded-lg border border-white/10 flex items-center gap-1.5 transition-colors self-start sm:self-auto cursor-pointer"
|
|
55
|
+
>
|
|
56
|
+
<RotateCcw className="w-3.5 h-3.5 text-indigo-400" />
|
|
57
|
+
<span>Revert to v{v.version}</span>
|
|
58
|
+
</button>
|
|
59
|
+
)}
|
|
60
|
+
</div>
|
|
61
|
+
))}
|
|
62
|
+
</div>
|
|
63
|
+
</div>
|
|
64
|
+
);
|
|
65
|
+
};
|
|
66
|
+
|
|
67
|
+
export default GlassmorphismScrollArea;
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
interface PropItem {
|
|
3
|
+
name: string;
|
|
4
|
+
type: string;
|
|
5
|
+
default?: string;
|
|
6
|
+
description: string;
|
|
7
|
+
}
|
|
8
|
+
interface TableDocsProps {
|
|
9
|
+
title: string;
|
|
10
|
+
docs?: { usage?: string; props?: PropItem[] };
|
|
11
|
+
}
|
|
12
|
+
export const GlassTable: React.FC<TableDocsProps> = ({ title, docs }) => {
|
|
13
|
+
const usageText = (docs?.usage || "import Component from '@surreal-ui/react';").trim();
|
|
14
|
+
return (
|
|
15
|
+
<div className="space-y-6 backdrop-blur-md bg-white/5 border border-white/10 p-6 rounded-2xl shadow-xl">
|
|
16
|
+
<div>
|
|
17
|
+
<h3 className="text-sm font-semibold text-slate-200 uppercase tracking-wider mb-2">
|
|
18
|
+
Usage Example
|
|
19
|
+
</h3>
|
|
20
|
+
<pre className="p-4 rounded-xl bg-black/40 border border-white/10 text-xs font-mono text-indigo-300 leading-relaxed overflow-x-auto shadow-inner">
|
|
21
|
+
<code>{usageText}</code>
|
|
22
|
+
</pre>
|
|
23
|
+
</div>
|
|
24
|
+
<div>
|
|
25
|
+
<h3 className="text-sm font-semibold text-slate-200 uppercase tracking-wider mb-3">
|
|
26
|
+
Props & Component Interface
|
|
27
|
+
</h3>
|
|
28
|
+
{docs?.props && docs.props.length > 0 ? (
|
|
29
|
+
<div className="border border-white/10 rounded-xl overflow-hidden text-xs backdrop-blur-sm bg-black/20">
|
|
30
|
+
<table className="w-full text-left">
|
|
31
|
+
<thead className="bg-white/5 border-b border-white/10 text-slate-300">
|
|
32
|
+
<tr>
|
|
33
|
+
<th className="p-3 font-semibold">Name</th>
|
|
34
|
+
<th className="p-3 font-semibold">Type</th>
|
|
35
|
+
<th className="p-3 font-semibold">Default</th>
|
|
36
|
+
<th className="p-3 font-semibold">Description</th>
|
|
37
|
+
</tr>
|
|
38
|
+
</thead>
|
|
39
|
+
<tbody className="divide-y divide-white/10 text-slate-200">
|
|
40
|
+
{docs.props.map((prop, idx) => (
|
|
41
|
+
<tr key={idx}>
|
|
42
|
+
<td className="p-3 font-mono font-bold text-indigo-300">{prop.name}</td>
|
|
43
|
+
<td className="p-3 font-mono text-slate-400">{prop.type}</td>
|
|
44
|
+
<td className="p-3 font-mono text-slate-500">{prop.default || '-'}</td>
|
|
45
|
+
<td className="p-3">{prop.description}</td>
|
|
46
|
+
</tr>
|
|
47
|
+
))}
|
|
48
|
+
</tbody>
|
|
49
|
+
</table>
|
|
50
|
+
</div>
|
|
51
|
+
) : (
|
|
52
|
+
<p className="text-xs text-slate-400">
|
|
53
|
+
No prop documentation specified for this package.
|
|
54
|
+
</p>
|
|
55
|
+
)}
|
|
56
|
+
</div>
|
|
57
|
+
</div>
|
|
58
|
+
);
|
|
59
|
+
};
|
|
60
|
+
|
|
61
|
+
export default GlassmorphismTable;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Sparkles } from 'lucide-react';
|
|
3
|
+
interface GlassmorphismTypographyProps {
|
|
4
|
+
badgeText?: string;
|
|
5
|
+
title?: string;
|
|
6
|
+
description?: string;
|
|
7
|
+
highlightText?: string;
|
|
8
|
+
}
|
|
9
|
+
export const GlassmorphismTypography: React.FC<GlassmorphismTypographyProps> = ({
|
|
10
|
+
badgeText = 'AI Multi-Platform Synthesizer Studio',
|
|
11
|
+
title = 'Ingest & Generate Component',
|
|
12
|
+
description = "Paste your raw component code in any framework. Surreal UI's engine (powered by ",
|
|
13
|
+
highlightText = '@pixerate/ai-core',
|
|
14
|
+
}) => {
|
|
15
|
+
return (
|
|
16
|
+
<div className="space-y-2">
|
|
17
|
+
<div className="inline-flex items-center gap-2 px-3 py-1 rounded-full bg-pink-500/10 border border-pink-500/30 text-pink-300 text-xs font-semibold backdrop-blur-md">
|
|
18
|
+
<Sparkles className="w-3.5 h-3.5" />
|
|
19
|
+
<span>{badgeText}</span>
|
|
20
|
+
</div>
|
|
21
|
+
<h1 className="text-3xl font-extrabold text-white tracking-tight">{title}</h1>
|
|
22
|
+
<p className="text-slate-400 text-sm">
|
|
23
|
+
{description}
|
|
24
|
+
<strong className="text-slate-200">{highlightText}</strong>) will synthesize React, Svelte,
|
|
25
|
+
and WebComponent variants, extract prop docs, and tag aesthetics automatically.
|
|
26
|
+
</p>
|
|
27
|
+
</div>
|
|
28
|
+
);
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
export default GlassmorphismTypography;
|