@surreal-ui/react 0.5.2 → 0.5.4
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 +12 -0
- package/dist/index.js +346 -365
- package/package.json +2 -2
- package/src/components/GlassmorphismAlert.tsx +4 -1
- package/src/components/GlassmorphismButton.tsx +1 -1
- package/src/components/GlassmorphismEmptyState.tsx +1 -1
- package/src/components/GlassmorphismInputGroup.tsx +1 -1
- package/src/components/GlassmorphismMenubar.tsx +2 -2
- package/src/components/GlassmorphismScrollArea.tsx +1 -1
- package/src/components/GlassmorphismTypography.tsx +1 -1
- package/src/components/MinimalistAccordion.tsx +9 -9
- package/src/components/MinimalistAlert.tsx +4 -1
- package/src/components/MinimalistAlertDialog.tsx +44 -43
- package/src/components/MinimalistAspectRatio.tsx +2 -2
- package/src/components/MinimalistAvatar.tsx +13 -13
- package/src/components/MinimalistBadge.tsx +7 -7
- package/src/components/MinimalistBreadcrumb.tsx +6 -2
- package/src/components/MinimalistButton.tsx +7 -7
- package/src/components/MinimalistButtonGroup.tsx +28 -27
- package/src/components/MinimalistCalendar.tsx +16 -13
- package/src/components/MinimalistCard.tsx +1 -1
- package/src/components/MinimalistCarousel.tsx +12 -12
- package/src/components/MinimalistChart.tsx +15 -15
- package/src/components/MinimalistCheckbox.tsx +4 -4
- package/src/components/MinimalistCodeBlock.tsx +16 -16
- package/src/components/MinimalistCollapsible.tsx +2 -2
- package/src/components/MinimalistCommand.tsx +21 -21
- package/src/components/MinimalistContextMenu.tsx +50 -42
- package/src/components/MinimalistDialog.tsx +12 -8
- package/src/components/MinimalistDrawer.tsx +10 -6
- package/src/components/MinimalistDropdownMenu.tsx +67 -67
- package/src/components/MinimalistEmpty.tsx +8 -8
- package/src/components/MinimalistEmptyState.tsx +1 -1
- package/src/components/MinimalistField.tsx +26 -26
- package/src/components/MinimalistForm.tsx +17 -15
- package/src/components/MinimalistHoverCard.tsx +2 -2
- package/src/components/MinimalistInput.tsx +3 -3
- package/src/components/MinimalistInputGroup.tsx +21 -21
- package/src/components/MinimalistInputOtp.tsx +9 -9
- package/src/components/MinimalistItem.tsx +18 -17
- package/src/components/MinimalistKbd.tsx +3 -3
- package/src/components/MinimalistLabel.tsx +2 -2
- package/src/components/MinimalistMenubar.tsx +14 -14
- package/src/components/MinimalistNativeSelect.tsx +3 -3
- package/src/components/MinimalistNavigationMenu.tsx +8 -8
- package/src/components/MinimalistPagination.tsx +9 -9
- package/src/components/MinimalistPopover.tsx +20 -19
- package/src/components/MinimalistProgress.tsx +2 -2
- package/src/components/MinimalistRadioGroup.tsx +3 -3
- package/src/components/MinimalistRangeCalendar.tsx +15 -15
- package/src/components/MinimalistResizable.tsx +2 -2
- package/src/components/MinimalistScrollArea.tsx +1 -1
- package/src/components/MinimalistSelect.tsx +28 -31
- package/src/components/MinimalistSeparator.tsx +5 -5
- package/src/components/MinimalistSheet.tsx +13 -13
- package/src/components/MinimalistSidebar.tsx +73 -72
- package/src/components/MinimalistSkeleton.tsx +1 -1
- package/src/components/MinimalistSlider.tsx +8 -8
- package/src/components/MinimalistSonner.tsx +4 -4
- package/src/components/MinimalistSpinner.tsx +3 -3
- package/src/components/MinimalistSwitch.tsx +5 -5
- package/src/components/MinimalistTabs.tsx +13 -8
- package/src/components/MinimalistTextarea.tsx +3 -3
- package/src/components/MinimalistToggle.tsx +8 -8
- package/src/components/MinimalistToggleGroup.tsx +18 -17
- package/src/components/MinimalistTooltip.tsx +7 -7
- package/src/components/MinimalistTypography.tsx +1 -1
- package/src/components/NeubrutalismCard.tsx +82 -1
- package/src/components/ShadcnAccordion.tsx +9 -9
- package/src/components/ShadcnAlertDialog.tsx +44 -43
- package/src/components/ShadcnAspectRatio.tsx +2 -2
- package/src/components/ShadcnAvatar.tsx +13 -13
- package/src/components/ShadcnBadge.tsx +7 -7
- package/src/components/ShadcnBreadcrumb.tsx +6 -2
- package/src/components/ShadcnButton.tsx +7 -7
- package/src/components/ShadcnButtonGroup.tsx +28 -27
- package/src/components/ShadcnCalendar.tsx +16 -13
- package/src/components/ShadcnCarousel.tsx +12 -12
- package/src/components/ShadcnChart.tsx +15 -15
- package/src/components/ShadcnCheckbox.tsx +4 -4
- package/src/components/ShadcnCodeBlock.tsx +16 -16
- package/src/components/ShadcnCollapsible.tsx +2 -2
- package/src/components/ShadcnCommand.tsx +21 -21
- package/src/components/ShadcnContextMenu.tsx +50 -42
- package/src/components/ShadcnDialog.tsx +12 -8
- package/src/components/ShadcnDrawer.tsx +10 -6
- package/src/components/ShadcnDropdownMenu.tsx +67 -67
- package/src/components/ShadcnEmpty.tsx +8 -8
- package/src/components/ShadcnField.tsx +26 -26
- package/src/components/ShadcnForm.tsx +17 -15
- package/src/components/ShadcnHoverCard.tsx +2 -2
- package/src/components/ShadcnInput.tsx +3 -3
- package/src/components/ShadcnInputGroup.tsx +21 -21
- package/src/components/ShadcnInputOtp.tsx +9 -9
- package/src/components/ShadcnItem.tsx +18 -17
- package/src/components/ShadcnKbd.tsx +3 -3
- package/src/components/ShadcnLabel.tsx +2 -2
- package/src/components/ShadcnMenubar.tsx +14 -14
- package/src/components/ShadcnNativeSelect.tsx +3 -3
- package/src/components/ShadcnNavigationMenu.tsx +8 -8
- package/src/components/ShadcnPagination.tsx +9 -9
- package/src/components/ShadcnPopover.tsx +20 -19
- package/src/components/ShadcnProgress.tsx +2 -2
- package/src/components/ShadcnRadioGroup.tsx +3 -3
- package/src/components/ShadcnRangeCalendar.tsx +15 -15
- package/src/components/ShadcnSelect.tsx +28 -31
- package/src/components/ShadcnSeparator.tsx +5 -5
- package/src/components/ShadcnSheet.tsx +13 -13
- package/src/components/ShadcnSidebar.tsx +73 -72
- package/src/components/ShadcnSkeleton.tsx +1 -1
- package/src/components/ShadcnSlider.tsx +8 -8
- package/src/components/ShadcnSonner.tsx +4 -4
- package/src/components/ShadcnSpinner.tsx +3 -3
- package/src/components/ShadcnSwitch.tsx +5 -5
- package/src/components/ShadcnTabs.tsx +13 -8
- package/src/components/ShadcnTextarea.tsx +3 -3
- package/src/components/ShadcnToggle.tsx +8 -8
- package/src/components/ShadcnToggleGroup.tsx +18 -17
- package/src/components/ShadcnTooltip.tsx +7 -7
|
@@ -9,19 +9,19 @@ export const toggleVariants = cva(
|
|
|
9
9
|
default:
|
|
10
10
|
'bg-transparent hover:bg-muted hover:text-muted-foreground data-[state=on]:bg-accent data-[state=on]:text-accent-foreground',
|
|
11
11
|
outline:
|
|
12
|
-
'border border-input bg-transparent hover:bg-accent hover:text-accent-foreground data-[state=on]:bg-accent data-[state=on]:text-accent-foreground'
|
|
12
|
+
'border border-input bg-transparent hover:bg-accent hover:text-accent-foreground data-[state=on]:bg-accent data-[state=on]:text-accent-foreground'
|
|
13
13
|
},
|
|
14
14
|
size: {
|
|
15
15
|
default: 'h-9 px-3 min-w-9',
|
|
16
16
|
sm: 'h-8 px-2 min-w-8 text-xs',
|
|
17
|
-
lg: 'h-10 px-3 min-w-10'
|
|
18
|
-
}
|
|
17
|
+
lg: 'h-10 px-3 min-w-10'
|
|
18
|
+
}
|
|
19
19
|
},
|
|
20
20
|
defaultVariants: {
|
|
21
21
|
variant: 'default',
|
|
22
|
-
size: 'default'
|
|
23
|
-
}
|
|
24
|
-
}
|
|
22
|
+
size: 'default'
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
25
|
);
|
|
26
26
|
|
|
27
27
|
export type ToggleVariantProps = VariantProps<typeof toggleVariants>;
|
|
@@ -40,10 +40,11 @@ const ToggleGroupContext = React.createContext<ToggleGroupContextValue>({
|
|
|
40
40
|
size: 'default',
|
|
41
41
|
variant: 'default',
|
|
42
42
|
spacing: 0,
|
|
43
|
-
orientation: 'horizontal'
|
|
43
|
+
orientation: 'horizontal'
|
|
44
44
|
});
|
|
45
45
|
|
|
46
|
-
export interface ShadcnToggleGroupProps
|
|
46
|
+
export interface ShadcnToggleGroupProps
|
|
47
|
+
extends React.HTMLAttributes<HTMLDivElement>, ToggleVariantProps {
|
|
47
48
|
type?: 'single' | 'multiple';
|
|
48
49
|
value?: string | string[];
|
|
49
50
|
defaultValue?: string | string[];
|
|
@@ -70,10 +71,10 @@ export const ShadcnToggleGroup = React.forwardRef<HTMLDivElement, ToggleGroupPro
|
|
|
70
71
|
style,
|
|
71
72
|
...props
|
|
72
73
|
},
|
|
73
|
-
ref
|
|
74
|
+
ref
|
|
74
75
|
) => {
|
|
75
76
|
const [uncontrolledValue, setUncontrolledValue] = React.useState<string | string[]>(
|
|
76
|
-
defaultValue ?? (type === 'multiple' ? [] : '')
|
|
77
|
+
defaultValue ?? (type === 'multiple' ? [] : '')
|
|
77
78
|
);
|
|
78
79
|
|
|
79
80
|
const isControlled = controlledValue !== undefined;
|
|
@@ -106,7 +107,7 @@ export const ShadcnToggleGroup = React.forwardRef<HTMLDivElement, ToggleGroupPro
|
|
|
106
107
|
onValueChange?.(arr);
|
|
107
108
|
}
|
|
108
109
|
},
|
|
109
|
-
[currentValue, disabled, isControlled, onValueChange, type]
|
|
110
|
+
[currentValue, disabled, isControlled, onValueChange, type]
|
|
110
111
|
);
|
|
111
112
|
|
|
112
113
|
return (
|
|
@@ -119,7 +120,7 @@ export const ShadcnToggleGroup = React.forwardRef<HTMLDivElement, ToggleGroupPro
|
|
|
119
120
|
size,
|
|
120
121
|
spacing,
|
|
121
122
|
orientation,
|
|
122
|
-
disabled
|
|
123
|
+
disabled
|
|
123
124
|
}}
|
|
124
125
|
>
|
|
125
126
|
<div
|
|
@@ -133,7 +134,7 @@ export const ShadcnToggleGroup = React.forwardRef<HTMLDivElement, ToggleGroupPro
|
|
|
133
134
|
style={{ ...style, gap: `${spacing}px` }}
|
|
134
135
|
className={cn(
|
|
135
136
|
'rounded-lg data-[size=sm]:rounded-[min(var(--radius-md),10px)] group/toggle-group flex w-fit flex-row items-center data-[orientation=vertical]:flex-col data-[orientation=vertical]:items-stretch',
|
|
136
|
-
className
|
|
137
|
+
className
|
|
137
138
|
)}
|
|
138
139
|
{...props}
|
|
139
140
|
>
|
|
@@ -141,7 +142,7 @@ export const ShadcnToggleGroup = React.forwardRef<HTMLDivElement, ToggleGroupPro
|
|
|
141
142
|
</div>
|
|
142
143
|
</ToggleGroupContext.Provider>
|
|
143
144
|
);
|
|
144
|
-
}
|
|
145
|
+
}
|
|
145
146
|
);
|
|
146
147
|
ToggleGroup.displayName = 'ToggleGroup';
|
|
147
148
|
|
|
@@ -178,16 +179,16 @@ export const ShadcnToggleGroupItem = React.forwardRef<HTMLButtonElement, ToggleG
|
|
|
178
179
|
'group-data-[spacing=0]/toggle-group:rounded-none group-data-[spacing=0]/toggle-group:px-2 group-data-[spacing=0]/toggle-group:has-data-[icon=inline-end]:pr-1.5 group-data-[spacing=0]/toggle-group:has-data-[icon=inline-start]:pl-1.5 group-data-horizontal/toggle-group:data-[spacing=0]:first:rounded-l-lg group-data-vertical/toggle-group:data-[spacing=0]:first:rounded-t-lg group-data-horizontal/toggle-group:data-[spacing=0]:last:rounded-r-lg group-data-vertical/toggle-group:data-[spacing=0]:last:rounded-b-lg shrink-0 focus:z-10 focus-visible:z-10 group-data-horizontal/toggle-group:data-[spacing=0]:data-[variant=outline]:border-l-0 group-data-vertical/toggle-group:data-[spacing=0]:data-[variant=outline]:border-t-0 group-data-horizontal/toggle-group:data-[spacing=0]:data-[variant=outline]:first:border-l group-data-vertical/toggle-group:data-[spacing=0]:data-[variant=outline]:first:border-t',
|
|
179
180
|
toggleVariants({
|
|
180
181
|
variant: activeVariant,
|
|
181
|
-
size: activeSize
|
|
182
|
+
size: activeSize
|
|
182
183
|
}),
|
|
183
|
-
className
|
|
184
|
+
className
|
|
184
185
|
)}
|
|
185
186
|
{...props}
|
|
186
187
|
>
|
|
187
188
|
{children}
|
|
188
189
|
</button>
|
|
189
190
|
);
|
|
190
|
-
}
|
|
191
|
+
}
|
|
191
192
|
);
|
|
192
193
|
ToggleGroupItem.displayName = 'ToggleGroupItem';
|
|
193
194
|
|
|
@@ -31,7 +31,7 @@ export function ShadcnTooltip({
|
|
|
31
31
|
defaultOpen = false,
|
|
32
32
|
onOpenChange,
|
|
33
33
|
delayDuration = 0,
|
|
34
|
-
children
|
|
34
|
+
children
|
|
35
35
|
}: TooltipProps) {
|
|
36
36
|
const [uncontrolledOpen, setUncontrolledOpen] = React.useState(defaultOpen);
|
|
37
37
|
const isControlled = controlledOpen !== undefined;
|
|
@@ -44,7 +44,7 @@ export function ShadcnTooltip({
|
|
|
44
44
|
}
|
|
45
45
|
onOpenChange?.(nextOpen);
|
|
46
46
|
},
|
|
47
|
-
[isControlled, onOpenChange]
|
|
47
|
+
[isControlled, onOpenChange]
|
|
48
48
|
);
|
|
49
49
|
|
|
50
50
|
return (
|
|
@@ -104,7 +104,7 @@ export const ShadcnTooltipTrigger = React.forwardRef<HTMLDivElement, TooltipTrig
|
|
|
104
104
|
{children}
|
|
105
105
|
</div>
|
|
106
106
|
);
|
|
107
|
-
}
|
|
107
|
+
}
|
|
108
108
|
);
|
|
109
109
|
TooltipTrigger.displayName = 'TooltipTrigger';
|
|
110
110
|
|
|
@@ -139,7 +139,7 @@ export const ShadcnTooltipContent = React.forwardRef<HTMLDivElement, TooltipCont
|
|
|
139
139
|
side === 'bottom' && 'top-full mt-1 left-1/2 -translate-x-1/2',
|
|
140
140
|
side === 'left' && 'right-full mr-1 top-1/2 -translate-y-1/2',
|
|
141
141
|
side === 'right' && 'left-full ml-1 top-1/2 -translate-y-1/2',
|
|
142
|
-
className
|
|
142
|
+
className
|
|
143
143
|
)}
|
|
144
144
|
{...props}
|
|
145
145
|
>
|
|
@@ -152,12 +152,12 @@ export const ShadcnTooltipContent = React.forwardRef<HTMLDivElement, TooltipCont
|
|
|
152
152
|
side === 'bottom' && '-top-1 left-1/2 -translate-x-1/2',
|
|
153
153
|
side === 'left' && '-right-1 top-1/2 -translate-y-1/2',
|
|
154
154
|
side === 'right' && '-left-1 top-1/2 -translate-y-1/2',
|
|
155
|
-
arrowClasses
|
|
155
|
+
arrowClasses
|
|
156
156
|
)}
|
|
157
157
|
/>
|
|
158
158
|
</div>
|
|
159
159
|
);
|
|
160
|
-
}
|
|
160
|
+
}
|
|
161
161
|
);
|
|
162
162
|
TooltipContent.displayName = 'TooltipContent';
|
|
163
163
|
|
|
@@ -166,7 +166,7 @@ export {
|
|
|
166
166
|
TooltipTrigger as Trigger,
|
|
167
167
|
TooltipContent as Content,
|
|
168
168
|
TooltipProvider as Provider,
|
|
169
|
-
TooltipPortal as Portal
|
|
169
|
+
TooltipPortal as Portal
|
|
170
170
|
};
|
|
171
171
|
|
|
172
172
|
export default MinimalistTooltip;
|
|
@@ -12,7 +12,7 @@ export const ModernTypography: React.FC<ModernTypographyProps> = ({
|
|
|
12
12
|
badgeText = 'AI Multi-Platform Synthesizer Studio',
|
|
13
13
|
title = 'Ingest & Generate Component',
|
|
14
14
|
description = "Paste your raw component code in any framework. Surreal UI's engine will synthesize React, Svelte, and WebComponent variants, extract prop docs, and tag aesthetics automatically.",
|
|
15
|
-
highlightText = '@pixerate/ai-core'
|
|
15
|
+
highlightText = '@pixerate/ai-core'
|
|
16
16
|
}) => {
|
|
17
17
|
return (
|
|
18
18
|
<div className="space-y-2">
|
|
@@ -1,3 +1,84 @@
|
|
|
1
|
-
import React from 'react';
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Sparkles, AlertTriangle, ShieldCheck, ArrowRight } from 'lucide-react';
|
|
3
|
+
interface NeubrutalismCardProps {
|
|
4
|
+
loading?: boolean;
|
|
5
|
+
errorMsg?: string;
|
|
6
|
+
onLogin?: () => void;
|
|
7
|
+
}
|
|
8
|
+
export const NeubrutalismCard: React.FC<NeubrutalismCardProps> = ({
|
|
9
|
+
loading = false,
|
|
10
|
+
errorMsg = '',
|
|
11
|
+
onLogin = () => {}
|
|
12
|
+
}) => {
|
|
13
|
+
return (
|
|
14
|
+
<div className="min-h-screen bg-slate-950 text-slate-100 flex items-center justify-center p-4 relative overflow-hidden">
|
|
15
|
+
<div className="absolute -top-40 -left-40 w-96 h-96 bg-indigo-600/20 rounded-full blur-3xl pointer-events-none" />
|
|
16
|
+
<div className="absolute -bottom-40 -right-40 w-96 h-96 bg-purple-600/20 rounded-full blur-3xl pointer-events-none" />
|
|
17
|
+
<div className="w-full max-w-md bg-slate-900 border-4 border-black shadow-[8px_8px_0px_0px_rgba(0,0,0,1)] p-8 rounded-none space-y-6 relative z-10">
|
|
18
|
+
<div className="text-center space-y-3">
|
|
19
|
+
<div className="inline-flex p-3 rounded-none border-2 border-black bg-indigo-400 text-black shadow-[4px_4px_0px_0px_rgba(0,0,0,1)]">
|
|
20
|
+
<Sparkles className="w-8 h-8" />
|
|
21
|
+
</div>
|
|
22
|
+
<div>
|
|
23
|
+
<h1 className="text-3xl font-extrabold text-black tracking-tight bg-yellow-300 px-2 py-1 inline-block border-2 border-black">
|
|
24
|
+
Surreal UI
|
|
25
|
+
</h1>
|
|
26
|
+
<p className="text-xs uppercase font-mono tracking-widest text-slate-300 mt-2">
|
|
27
|
+
Component Repository Portal
|
|
28
|
+
</p>
|
|
29
|
+
</div>
|
|
30
|
+
</div>
|
|
31
|
+
{errorMsg && (
|
|
32
|
+
<div className="flex items-start gap-3 p-4 bg-red-400 border-2 border-black text-black text-xs font-bold shadow-[4px_4px_0px_0px_rgba(0,0,0,1)]">
|
|
33
|
+
<AlertTriangle className="w-5 h-5 text-black shrink-0 mt-0.5" />
|
|
34
|
+
<div>
|
|
35
|
+
<strong className="font-black block">Authentication Failed</strong>
|
|
36
|
+
<span>{errorMsg}</span>
|
|
37
|
+
</div>
|
|
38
|
+
</div>
|
|
39
|
+
)}
|
|
40
|
+
<div className="flex items-center gap-2.5 p-3 rounded-none bg-yellow-400 border-2 border-black text-black text-xs font-bold shadow-[4px_4px_0px_0px_rgba(0,0,0,1)]">
|
|
41
|
+
<ShieldCheck className="w-4 h-4 text-black shrink-0" />
|
|
42
|
+
<span>Access is restricted to authorized accounts only.</span>
|
|
43
|
+
</div>
|
|
44
|
+
<button
|
|
45
|
+
onClick={onLogin}
|
|
46
|
+
disabled={loading}
|
|
47
|
+
className="w-full py-3.5 px-4 bg-green-400 hover:bg-green-500 text-black font-black border-2 border-black shadow-[4px_4px_0px_0px_rgba(0,0,0,1)] active:translate-x-1 active:translate-y-1 active:shadow-none flex items-center justify-center gap-2 transition-all disabled:opacity-50 disabled:cursor-not-allowed group"
|
|
48
|
+
>
|
|
49
|
+
{loading ? (
|
|
50
|
+
<>
|
|
51
|
+
<span className="w-5 h-5 border-2 border-black border-t-transparent rounded-full animate-spin" />
|
|
52
|
+
<span>Authenticating...</span>
|
|
53
|
+
</>
|
|
54
|
+
) : (
|
|
55
|
+
<>
|
|
56
|
+
<svg className="w-5 h-5 fill-current" viewBox="0 0 24 24">
|
|
57
|
+
<path
|
|
58
|
+
d="M22.56 12.25c0-.78-.07-1.53-.2-2.25H12v4.26h5.92c-.26 1.37-1.04 2.53-2.21 3.31v2.77h3.57c2.08-1.92 3.28-4.74 3.28-8.09z"
|
|
59
|
+
fill="#000"
|
|
60
|
+
/>
|
|
61
|
+
<path
|
|
62
|
+
d="M12 23c2.97 0 5.46-.98 7.28-2.66l-3.57-2.77c-.98.66-2.23 1.06-3.71 1.06-2.86 0-5.29-1.93-6.16-4.53H2.18v2.84C3.99 20.53 7.7 23 12 23z"
|
|
63
|
+
fill="#000"
|
|
64
|
+
/>
|
|
65
|
+
<path
|
|
66
|
+
d="M5.84 14.09c-.22-.66-.35-1.36-.35-2.09s.13-1.43.35-2.09V7.06H2.18C1.43 8.55 1 10.22 1 12s.43 3.45 1.18 4.94l2.85-2.22.81-.63z"
|
|
67
|
+
fill="#000"
|
|
68
|
+
/>
|
|
69
|
+
<path
|
|
70
|
+
d="M12 5.38c1.62 0 3.06.56 4.21 1.64l3.15-3.15C17.45 2.09 14.97 1 12 1 12 1 7.7 1 3.99 3.47 2.18 7.06l3.66 2.84c.87-2.6 3.3-4.52 6.16-4.52z"
|
|
71
|
+
fill="#000"
|
|
72
|
+
/>
|
|
73
|
+
</svg>
|
|
74
|
+
<span>Sign In with Google</span>
|
|
75
|
+
<ArrowRight className="w-4 h-4 group-hover:translate-x-1 transition-transform" />
|
|
76
|
+
</>
|
|
77
|
+
)}
|
|
78
|
+
</button>
|
|
79
|
+
</div>
|
|
80
|
+
</div>
|
|
81
|
+
);
|
|
82
|
+
};
|
|
2
83
|
|
|
3
84
|
export default NeubrutalismCard;
|
|
@@ -59,7 +59,7 @@ export const Root = React.forwardRef<HTMLDivElement, AccordionProps>(
|
|
|
59
59
|
children,
|
|
60
60
|
...props
|
|
61
61
|
},
|
|
62
|
-
ref
|
|
62
|
+
ref
|
|
63
63
|
) => {
|
|
64
64
|
const [uncontrolledValue, setUncontrolledValue] = React.useState<string[]>(() => {
|
|
65
65
|
if (defaultValue !== undefined) {
|
|
@@ -105,7 +105,7 @@ export const Root = React.forwardRef<HTMLDivElement, AccordionProps>(
|
|
|
105
105
|
const emitted = type === 'single' ? (nextValues[0] ?? '') : nextValues;
|
|
106
106
|
onValueChange?.(emitted);
|
|
107
107
|
},
|
|
108
|
-
[disabled, openValues, type, collapsible, isControlled, onValueChange]
|
|
108
|
+
[disabled, openValues, type, collapsible, isControlled, onValueChange]
|
|
109
109
|
);
|
|
110
110
|
|
|
111
111
|
return (
|
|
@@ -115,7 +115,7 @@ export const Root = React.forwardRef<HTMLDivElement, AccordionProps>(
|
|
|
115
115
|
</div>
|
|
116
116
|
</AccordionContext.Provider>
|
|
117
117
|
);
|
|
118
|
-
}
|
|
118
|
+
}
|
|
119
119
|
);
|
|
120
120
|
Root.displayName = 'Accordion';
|
|
121
121
|
|
|
@@ -142,7 +142,7 @@ export const Item = React.forwardRef<HTMLDivElement, AccordionItemProps>(
|
|
|
142
142
|
</div>
|
|
143
143
|
</AccordionItemContext.Provider>
|
|
144
144
|
);
|
|
145
|
-
}
|
|
145
|
+
}
|
|
146
146
|
);
|
|
147
147
|
Item.displayName = 'AccordionItem';
|
|
148
148
|
|
|
@@ -166,7 +166,7 @@ export const Trigger = React.forwardRef<HTMLButtonElement, AccordionTriggerProps
|
|
|
166
166
|
onClick={() => toggleItem(value, itemDisabled)}
|
|
167
167
|
className={cn(
|
|
168
168
|
'flex flex-1 items-center justify-between py-4 text-sm font-medium transition-all hover:underline text-left text-foreground [&[data-state=open]>svg]:rotate-180 disabled:pointer-events-none disabled:opacity-50',
|
|
169
|
-
className
|
|
169
|
+
className
|
|
170
170
|
)}
|
|
171
171
|
{...props}
|
|
172
172
|
>
|
|
@@ -175,7 +175,7 @@ export const Trigger = React.forwardRef<HTMLButtonElement, AccordionTriggerProps
|
|
|
175
175
|
</button>
|
|
176
176
|
</h3>
|
|
177
177
|
);
|
|
178
|
-
}
|
|
178
|
+
}
|
|
179
179
|
);
|
|
180
180
|
Trigger.displayName = 'AccordionTrigger';
|
|
181
181
|
|
|
@@ -194,14 +194,14 @@ export const Content = React.forwardRef<HTMLDivElement, AccordionContentProps>(
|
|
|
194
194
|
className={cn(
|
|
195
195
|
'grid transition-all duration-200 ease-out text-sm text-muted-foreground',
|
|
196
196
|
isOpen ? 'grid-rows-[1fr] opacity-100' : 'grid-rows-[0fr] opacity-0 invisible h-0',
|
|
197
|
-
className
|
|
197
|
+
className
|
|
198
198
|
)}
|
|
199
199
|
{...props}
|
|
200
200
|
>
|
|
201
201
|
<div className="overflow-hidden pb-4 pt-0">{children}</div>
|
|
202
202
|
</div>
|
|
203
203
|
);
|
|
204
|
-
}
|
|
204
|
+
}
|
|
205
205
|
);
|
|
206
206
|
Content.displayName = 'AccordionContent';
|
|
207
207
|
|
|
@@ -209,7 +209,7 @@ export {
|
|
|
209
209
|
Root as ShadcnAccordion,
|
|
210
210
|
Item as AccordionItem,
|
|
211
211
|
Trigger as AccordionTrigger,
|
|
212
|
-
Content as AccordionContent
|
|
212
|
+
Content as AccordionContent
|
|
213
213
|
};
|
|
214
214
|
|
|
215
215
|
export default ShadcnAccordion;
|
|
@@ -27,7 +27,7 @@ export function ShadcnAlertDialog({
|
|
|
27
27
|
open: controlledOpen,
|
|
28
28
|
defaultOpen = false,
|
|
29
29
|
onOpenChange,
|
|
30
|
-
children
|
|
30
|
+
children
|
|
31
31
|
}: AlertDialogProps) {
|
|
32
32
|
const [uncontrolledOpen, setUncontrolledOpen] = React.useState(defaultOpen);
|
|
33
33
|
const isControlled = controlledOpen !== undefined;
|
|
@@ -40,7 +40,7 @@ export function ShadcnAlertDialog({
|
|
|
40
40
|
}
|
|
41
41
|
onOpenChange?.(nextOpen);
|
|
42
42
|
},
|
|
43
|
-
[isControlled, onOpenChange]
|
|
43
|
+
[isControlled, onOpenChange]
|
|
44
44
|
);
|
|
45
45
|
|
|
46
46
|
return (
|
|
@@ -52,25 +52,26 @@ export interface ShadcnAlertDialogTriggerProps extends React.ButtonHTMLAttribute
|
|
|
52
52
|
asChild?: boolean;
|
|
53
53
|
}
|
|
54
54
|
|
|
55
|
-
export const ShadcnAlertDialogTrigger = React.forwardRef<
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
);
|
|
55
|
+
export const ShadcnAlertDialogTrigger = React.forwardRef<
|
|
56
|
+
HTMLButtonElement,
|
|
57
|
+
AlertDialogTriggerProps
|
|
58
|
+
>(({ onClick, children, ...props }, ref) => {
|
|
59
|
+
const { setOpen } = useAlertDialog();
|
|
60
|
+
return (
|
|
61
|
+
<button
|
|
62
|
+
ref={ref}
|
|
63
|
+
type="button"
|
|
64
|
+
data-slot="alert-dialog-trigger"
|
|
65
|
+
onClick={(e) => {
|
|
66
|
+
onClick?.(e);
|
|
67
|
+
setOpen(true);
|
|
68
|
+
}}
|
|
69
|
+
{...props}
|
|
70
|
+
>
|
|
71
|
+
{children}
|
|
72
|
+
</button>
|
|
73
|
+
);
|
|
74
|
+
});
|
|
74
75
|
AlertDialogTrigger.displayName = 'AlertDialogTrigger';
|
|
75
76
|
|
|
76
77
|
export const ShadcnAlertDialogPortal = ({ children }: { children: React.ReactNode }) => {
|
|
@@ -87,12 +88,12 @@ export const ShadcnAlertDialogOverlay = React.forwardRef<HTMLDivElement, AlertDi
|
|
|
87
88
|
data-slot="alert-dialog-overlay"
|
|
88
89
|
className={cn(
|
|
89
90
|
'fixed inset-0 z-50 bg-black/60 backdrop-blur-xs transition-opacity animate-in fade-in-0',
|
|
90
|
-
className
|
|
91
|
+
className
|
|
91
92
|
)}
|
|
92
93
|
{...props}
|
|
93
94
|
/>
|
|
94
95
|
);
|
|
95
|
-
}
|
|
96
|
+
}
|
|
96
97
|
);
|
|
97
98
|
AlertDialogOverlay.displayName = 'AlertDialogOverlay';
|
|
98
99
|
|
|
@@ -128,7 +129,7 @@ export const ShadcnAlertDialogContent = React.forwardRef<HTMLDivElement, AlertDi
|
|
|
128
129
|
className={cn(
|
|
129
130
|
'fixed top-1/2 left-1/2 z-50 grid w-full -translate-x-1/2 -translate-y-1/2 gap-4 rounded-xl bg-popover p-4 text-popover-foreground ring-1 ring-foreground/10 shadow-2xl duration-150 animate-in fade-in-0 zoom-in-95 outline-none',
|
|
130
131
|
size === 'default' ? 'max-w-xs sm:max-w-sm' : 'max-w-xs',
|
|
131
|
-
className
|
|
132
|
+
className
|
|
132
133
|
)}
|
|
133
134
|
{...props}
|
|
134
135
|
>
|
|
@@ -136,7 +137,7 @@ export const ShadcnAlertDialogContent = React.forwardRef<HTMLDivElement, AlertDi
|
|
|
136
137
|
</div>
|
|
137
138
|
</AlertDialogPortal>
|
|
138
139
|
);
|
|
139
|
-
}
|
|
140
|
+
}
|
|
140
141
|
);
|
|
141
142
|
AlertDialogContent.displayName = 'AlertDialogContent';
|
|
142
143
|
|
|
@@ -149,11 +150,11 @@ export const ShadcnAlertDialogHeader = React.forwardRef<HTMLDivElement, AlertDia
|
|
|
149
150
|
data-slot="alert-dialog-header"
|
|
150
151
|
className={cn(
|
|
151
152
|
'grid grid-rows-[auto_1fr] place-items-center gap-1.5 text-center has-data-[slot=alert-dialog-media]:grid-rows-[auto_auto_1fr] has-data-[slot=alert-dialog-media]:gap-x-4 sm:place-items-start sm:text-left sm:has-data-[slot=alert-dialog-media]:grid-rows-[auto_1fr]',
|
|
152
|
-
className
|
|
153
|
+
className
|
|
153
154
|
)}
|
|
154
155
|
{...props}
|
|
155
156
|
/>
|
|
156
|
-
)
|
|
157
|
+
)
|
|
157
158
|
);
|
|
158
159
|
AlertDialogHeader.displayName = 'AlertDialogHeader';
|
|
159
160
|
|
|
@@ -166,11 +167,11 @@ export const ShadcnAlertDialogMedia = React.forwardRef<HTMLDivElement, AlertDial
|
|
|
166
167
|
data-slot="alert-dialog-media"
|
|
167
168
|
className={cn(
|
|
168
169
|
"mb-2 inline-flex size-10 items-center justify-center rounded-md bg-muted sm:row-span-2 *:[svg:not([class*='size-'])]:size-6",
|
|
169
|
-
className
|
|
170
|
+
className
|
|
170
171
|
)}
|
|
171
172
|
{...props}
|
|
172
173
|
/>
|
|
173
|
-
)
|
|
174
|
+
)
|
|
174
175
|
);
|
|
175
176
|
AlertDialogMedia.displayName = 'AlertDialogMedia';
|
|
176
177
|
|
|
@@ -183,11 +184,11 @@ export const ShadcnAlertDialogTitle = React.forwardRef<HTMLHeadingElement, Alert
|
|
|
183
184
|
data-slot="alert-dialog-title"
|
|
184
185
|
className={cn(
|
|
185
186
|
'text-base font-semibold tracking-tight text-foreground sm:col-start-2',
|
|
186
|
-
className
|
|
187
|
+
className
|
|
187
188
|
)}
|
|
188
189
|
{...props}
|
|
189
190
|
/>
|
|
190
|
-
)
|
|
191
|
+
)
|
|
191
192
|
);
|
|
192
193
|
AlertDialogTitle.displayName = 'AlertDialogTitle';
|
|
193
194
|
|
|
@@ -202,7 +203,7 @@ export const ShadcnAlertDialogDescription = React.forwardRef<
|
|
|
202
203
|
data-slot="alert-dialog-description"
|
|
203
204
|
className={cn(
|
|
204
205
|
'text-sm text-balance text-muted-foreground leading-relaxed md:text-pretty *:[a]:underline *:[a]:underline-offset-3 *:[a]:hover:text-foreground',
|
|
205
|
-
className
|
|
206
|
+
className
|
|
206
207
|
)}
|
|
207
208
|
{...props}
|
|
208
209
|
/>
|
|
@@ -218,11 +219,11 @@ export const ShadcnAlertDialogFooter = React.forwardRef<HTMLDivElement, AlertDia
|
|
|
218
219
|
data-slot="alert-dialog-footer"
|
|
219
220
|
className={cn(
|
|
220
221
|
'-mx-4 -mb-4 flex flex-col-reverse gap-2 rounded-b-xl border-t border-border bg-muted/50 p-4 sm:flex-row sm:justify-end',
|
|
221
|
-
className
|
|
222
|
+
className
|
|
222
223
|
)}
|
|
223
224
|
{...props}
|
|
224
225
|
/>
|
|
225
|
-
)
|
|
226
|
+
)
|
|
226
227
|
);
|
|
227
228
|
AlertDialogFooter.displayName = 'AlertDialogFooter';
|
|
228
229
|
|
|
@@ -237,20 +238,20 @@ const buttonVariants = cva(
|
|
|
237
238
|
'border border-input bg-background shadow-sm hover:bg-accent hover:text-accent-foreground',
|
|
238
239
|
secondary: 'bg-secondary text-secondary-foreground shadow-sm hover:bg-secondary/80',
|
|
239
240
|
ghost: 'hover:bg-accent hover:text-accent-foreground',
|
|
240
|
-
link: 'text-primary underline-offset-4 hover:underline'
|
|
241
|
+
link: 'text-primary underline-offset-4 hover:underline'
|
|
241
242
|
},
|
|
242
243
|
size: {
|
|
243
244
|
default: 'h-9 px-4 py-2',
|
|
244
245
|
sm: 'h-8 rounded-md px-3 text-xs',
|
|
245
246
|
lg: 'h-10 rounded-md px-8',
|
|
246
|
-
icon: 'h-9 w-9'
|
|
247
|
-
}
|
|
247
|
+
icon: 'h-9 w-9'
|
|
248
|
+
}
|
|
248
249
|
},
|
|
249
250
|
defaultVariants: {
|
|
250
251
|
variant: 'default',
|
|
251
|
-
size: 'default'
|
|
252
|
-
}
|
|
253
|
-
}
|
|
252
|
+
size: 'default'
|
|
253
|
+
}
|
|
254
|
+
}
|
|
254
255
|
);
|
|
255
256
|
|
|
256
257
|
export interface ShadcnAlertDialogActionProps
|
|
@@ -272,7 +273,7 @@ export const ShadcnAlertDialogAction = React.forwardRef<HTMLButtonElement, Alert
|
|
|
272
273
|
{...props}
|
|
273
274
|
/>
|
|
274
275
|
);
|
|
275
|
-
}
|
|
276
|
+
}
|
|
276
277
|
);
|
|
277
278
|
AlertDialogAction.displayName = 'AlertDialogAction';
|
|
278
279
|
|
|
@@ -295,7 +296,7 @@ export const ShadcnAlertDialogCancel = React.forwardRef<HTMLButtonElement, Alert
|
|
|
295
296
|
{...props}
|
|
296
297
|
/>
|
|
297
298
|
);
|
|
298
|
-
}
|
|
299
|
+
}
|
|
299
300
|
);
|
|
300
301
|
AlertDialogCancel.displayName = 'AlertDialogCancel';
|
|
301
302
|
|
|
@@ -311,7 +312,7 @@ export {
|
|
|
311
312
|
AlertDialogCancel as Cancel,
|
|
312
313
|
AlertDialogMedia as Media,
|
|
313
314
|
AlertDialogOverlay as Overlay,
|
|
314
|
-
AlertDialogPortal as Portal
|
|
315
|
+
AlertDialogPortal as Portal
|
|
315
316
|
};
|
|
316
317
|
|
|
317
318
|
export default ShadcnAlertDialog;
|
|
@@ -15,7 +15,7 @@ export const ShadcnAspectRatio = React.forwardRef<HTMLDivElement, AspectRatioPro
|
|
|
15
15
|
position: 'relative',
|
|
16
16
|
width: '100%',
|
|
17
17
|
aspectRatio: ratio,
|
|
18
|
-
...style
|
|
18
|
+
...style
|
|
19
19
|
}}
|
|
20
20
|
className={cn(className)}
|
|
21
21
|
{...props}
|
|
@@ -23,7 +23,7 @@ export const ShadcnAspectRatio = React.forwardRef<HTMLDivElement, AspectRatioPro
|
|
|
23
23
|
{children}
|
|
24
24
|
</div>
|
|
25
25
|
);
|
|
26
|
-
}
|
|
26
|
+
}
|
|
27
27
|
);
|
|
28
28
|
AspectRatio.displayName = 'AspectRatio';
|
|
29
29
|
|
|
@@ -14,12 +14,12 @@ export const ShadcnAvatar = React.forwardRef<HTMLDivElement, AvatarProps>(
|
|
|
14
14
|
data-size={size}
|
|
15
15
|
className={cn(
|
|
16
16
|
'size-8 rounded-full after:rounded-full data-[size=lg]:size-10 data-[size=sm]:size-6 group/avatar relative flex shrink-0 select-none after:absolute after:inset-0 after:border after:border-border after:mix-blend-darken dark:after:mix-blend-lighten',
|
|
17
|
-
className
|
|
17
|
+
className
|
|
18
18
|
)}
|
|
19
19
|
{...props}
|
|
20
20
|
/>
|
|
21
21
|
);
|
|
22
|
-
}
|
|
22
|
+
}
|
|
23
23
|
);
|
|
24
24
|
Avatar.displayName = 'Avatar';
|
|
25
25
|
|
|
@@ -41,7 +41,7 @@ export const ShadcnAvatarImage = React.forwardRef<HTMLImageElement, AvatarImageP
|
|
|
41
41
|
className={cn(
|
|
42
42
|
'rounded-full aspect-square size-full object-cover',
|
|
43
43
|
!hasLoaded && 'hidden',
|
|
44
|
-
className
|
|
44
|
+
className
|
|
45
45
|
)}
|
|
46
46
|
onLoad={(e) => {
|
|
47
47
|
setHasLoaded(true);
|
|
@@ -54,7 +54,7 @@ export const ShadcnAvatarImage = React.forwardRef<HTMLImageElement, AvatarImageP
|
|
|
54
54
|
{...props}
|
|
55
55
|
/>
|
|
56
56
|
);
|
|
57
|
-
}
|
|
57
|
+
}
|
|
58
58
|
);
|
|
59
59
|
AvatarImage.displayName = 'AvatarImage';
|
|
60
60
|
|
|
@@ -68,12 +68,12 @@ export const ShadcnAvatarFallback = React.forwardRef<HTMLSpanElement, AvatarFall
|
|
|
68
68
|
data-slot="avatar-fallback"
|
|
69
69
|
className={cn(
|
|
70
70
|
'rounded-full bg-muted text-muted-foreground flex size-full items-center justify-center text-sm group-data-[size=sm]/avatar:text-xs',
|
|
71
|
-
className
|
|
71
|
+
className
|
|
72
72
|
)}
|
|
73
73
|
{...props}
|
|
74
74
|
/>
|
|
75
75
|
);
|
|
76
|
-
}
|
|
76
|
+
}
|
|
77
77
|
);
|
|
78
78
|
AvatarFallback.displayName = 'AvatarFallback';
|
|
79
79
|
|
|
@@ -90,12 +90,12 @@ export const ShadcnAvatarBadge = React.forwardRef<HTMLSpanElement, AvatarBadgePr
|
|
|
90
90
|
'group-data-[size=sm]/avatar:size-2 group-data-[size=sm]/avatar:[&>svg]:hidden',
|
|
91
91
|
'group-data-[size=default]/avatar:size-2.5 group-data-[size=default]/avatar:[&>svg]:size-2',
|
|
92
92
|
'group-data-[size=lg]/avatar:size-3 group-data-[size=lg]/avatar:[&>svg]:size-2',
|
|
93
|
-
className
|
|
93
|
+
className
|
|
94
94
|
)}
|
|
95
95
|
{...props}
|
|
96
96
|
/>
|
|
97
97
|
);
|
|
98
|
-
}
|
|
98
|
+
}
|
|
99
99
|
);
|
|
100
100
|
AvatarBadge.displayName = 'AvatarBadge';
|
|
101
101
|
|
|
@@ -109,12 +109,12 @@ export const ShadcnAvatarGroup = React.forwardRef<HTMLDivElement, AvatarGroupPro
|
|
|
109
109
|
data-slot="avatar-group"
|
|
110
110
|
className={cn(
|
|
111
111
|
'cn-avatar-group group/avatar-group flex -space-x-2 *:data-[slot=avatar]:ring-2 *:data-[slot=avatar]:ring-background',
|
|
112
|
-
className
|
|
112
|
+
className
|
|
113
113
|
)}
|
|
114
114
|
{...props}
|
|
115
115
|
/>
|
|
116
116
|
);
|
|
117
|
-
}
|
|
117
|
+
}
|
|
118
118
|
);
|
|
119
119
|
AvatarGroup.displayName = 'AvatarGroup';
|
|
120
120
|
|
|
@@ -128,12 +128,12 @@ export const AvatarGroupCount = React.forwardRef<HTMLDivElement, AvatarGroupCoun
|
|
|
128
128
|
data-slot="avatar-group-count"
|
|
129
129
|
className={cn(
|
|
130
130
|
'size-8 rounded-full bg-muted text-sm text-muted-foreground group-has-data-[size=lg]/avatar-group:size-10 group-has-data-[size=sm]/avatar-group:size-6 [&>svg]:size-4 group-has-data-[size=lg]/avatar-group:[&>svg]:size-5 group-has-data-[size=sm]/avatar-group:[&>svg]:size-3 relative flex shrink-0 items-center justify-center ring-2 ring-background',
|
|
131
|
-
className
|
|
131
|
+
className
|
|
132
132
|
)}
|
|
133
133
|
{...props}
|
|
134
134
|
/>
|
|
135
135
|
);
|
|
136
|
-
}
|
|
136
|
+
}
|
|
137
137
|
);
|
|
138
138
|
AvatarGroupCount.displayName = 'AvatarGroupCount';
|
|
139
139
|
|
|
@@ -143,7 +143,7 @@ export {
|
|
|
143
143
|
AvatarFallback as Fallback,
|
|
144
144
|
AvatarBadge as Badge,
|
|
145
145
|
AvatarGroup as Group,
|
|
146
|
-
AvatarGroupCount as GroupCount
|
|
146
|
+
AvatarGroupCount as GroupCount
|
|
147
147
|
};
|
|
148
148
|
|
|
149
149
|
export default ShadcnAvatar;
|