@yuhuanowo/yunui 0.1.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/LICENSE +201 -0
- package/README.md +104 -0
- package/dist/adapters.d.ts +46 -0
- package/dist/adapters.js +4 -0
- package/dist/adapters.js.map +1 -0
- package/dist/ai.d.ts +192 -0
- package/dist/ai.js +1013 -0
- package/dist/ai.js.map +1 -0
- package/dist/chunk-DRZ7UCRU.js +85 -0
- package/dist/chunk-DRZ7UCRU.js.map +1 -0
- package/dist/chunk-OHIFY64L.js +1839 -0
- package/dist/chunk-OHIFY64L.js.map +1 -0
- package/dist/chunk-WASCOOVD.js +29 -0
- package/dist/chunk-WASCOOVD.js.map +1 -0
- package/dist/chunk-XZGNL5A6.js +66 -0
- package/dist/chunk-XZGNL5A6.js.map +1 -0
- package/dist/index.d.ts +510 -0
- package/dist/index.js +6 -0
- package/dist/index.js.map +1 -0
- package/dist/patterns.d.ts +311 -0
- package/dist/patterns.js +1031 -0
- package/dist/patterns.js.map +1 -0
- package/package.json +77 -0
- package/styles/yunui.css +2251 -0
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,510 @@
|
|
|
1
|
+
import * as framer_motion from 'framer-motion';
|
|
2
|
+
import * as React$1 from 'react';
|
|
3
|
+
import { ReactNode } from 'react';
|
|
4
|
+
import * as DialogPrimitive from '@radix-ui/react-dialog';
|
|
5
|
+
import * as TooltipPrimitive from '@radix-ui/react-tooltip';
|
|
6
|
+
import * as DropdownMenuPrimitive from '@radix-ui/react-dropdown-menu';
|
|
7
|
+
import * as SelectPrimitive from '@radix-ui/react-select';
|
|
8
|
+
import * as SliderPrimitive from '@radix-ui/react-slider';
|
|
9
|
+
import * as ProgressPrimitive from '@radix-ui/react-progress';
|
|
10
|
+
import * as TabsPrimitive from '@radix-ui/react-tabs';
|
|
11
|
+
import * as AvatarPrimitive from '@radix-ui/react-avatar';
|
|
12
|
+
import { LucideIcon } from 'lucide-react';
|
|
13
|
+
import * as Primitive from '@radix-ui/react-collapsible';
|
|
14
|
+
import * as PopoverPrimitive from '@radix-ui/react-popover';
|
|
15
|
+
import { ClassValue } from 'clsx';
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Modal Size Classes
|
|
19
|
+
*
|
|
20
|
+
* Consistent across all modal implementations
|
|
21
|
+
*/
|
|
22
|
+
declare const SIZE_CLASSES: {
|
|
23
|
+
readonly sm: "max-w-sm";
|
|
24
|
+
readonly md: "max-w-md";
|
|
25
|
+
readonly lg: "max-w-lg";
|
|
26
|
+
readonly xl: "max-w-xl";
|
|
27
|
+
readonly "2xl": "max-w-2xl";
|
|
28
|
+
readonly "3xl": "max-w-3xl";
|
|
29
|
+
readonly "4xl": "max-w-4xl";
|
|
30
|
+
readonly "5xl": "max-w-5xl";
|
|
31
|
+
readonly "6xl": "max-w-6xl";
|
|
32
|
+
readonly full: "max-w-[95vw]";
|
|
33
|
+
};
|
|
34
|
+
type ModalSize = keyof typeof SIZE_CLASSES;
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* Modal System Types
|
|
38
|
+
*
|
|
39
|
+
* Unified type definitions for all modal components
|
|
40
|
+
*/
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* Base Modal Props
|
|
44
|
+
*
|
|
45
|
+
* Common props shared by all modal types
|
|
46
|
+
*/
|
|
47
|
+
interface BaseModalProps {
|
|
48
|
+
/** Whether the modal is open */
|
|
49
|
+
isOpen: boolean;
|
|
50
|
+
/** Callback when modal should close */
|
|
51
|
+
onClose: () => void;
|
|
52
|
+
/** Modal title (required for accessibility) */
|
|
53
|
+
title: string;
|
|
54
|
+
/** Optional subtitle displayed below title */
|
|
55
|
+
subtitle?: string;
|
|
56
|
+
/** Modal size */
|
|
57
|
+
size?: ModalSize;
|
|
58
|
+
/** Additional CSS classes */
|
|
59
|
+
className?: string;
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* Standard Modal Props
|
|
63
|
+
*
|
|
64
|
+
* For general-purpose modals with content and optional footer
|
|
65
|
+
*/
|
|
66
|
+
interface ModalProps extends BaseModalProps {
|
|
67
|
+
/** Modal content */
|
|
68
|
+
children: ReactNode;
|
|
69
|
+
/** Optional footer content */
|
|
70
|
+
footer?: ReactNode;
|
|
71
|
+
/** Whether to show the close button */
|
|
72
|
+
showCloseButton?: boolean;
|
|
73
|
+
/** Whether modal is in closing animation state */
|
|
74
|
+
isClosing?: boolean;
|
|
75
|
+
/** Callback to set closing state */
|
|
76
|
+
setIsClosing?: (closing: boolean) => void;
|
|
77
|
+
/** Whether to show unsaved changes badge */
|
|
78
|
+
showUnsavedBadge?: boolean;
|
|
79
|
+
/** Custom max-height override */
|
|
80
|
+
maxHeight?: string;
|
|
81
|
+
/** Called when backdrop is clicked (defaults to onClose) */
|
|
82
|
+
onBackdropClick?: () => void;
|
|
83
|
+
}
|
|
84
|
+
/**
|
|
85
|
+
* Confirm Modal Variant
|
|
86
|
+
*/
|
|
87
|
+
type ConfirmModalVariant = "danger" | "warning" | "info" | "success";
|
|
88
|
+
/**
|
|
89
|
+
* Confirm Modal Props
|
|
90
|
+
*
|
|
91
|
+
* For confirmation dialogs with confirm/cancel actions
|
|
92
|
+
*/
|
|
93
|
+
interface ConfirmModalProps extends BaseModalProps {
|
|
94
|
+
/** Main message content */
|
|
95
|
+
message: ReactNode;
|
|
96
|
+
/** Variant affects icon and button colors */
|
|
97
|
+
variant?: ConfirmModalVariant;
|
|
98
|
+
/** Text for confirm button */
|
|
99
|
+
confirmText?: string;
|
|
100
|
+
/** Text for cancel button */
|
|
101
|
+
cancelText?: string;
|
|
102
|
+
/** Whether action is in progress */
|
|
103
|
+
isLoading?: boolean;
|
|
104
|
+
/** Called when user confirms */
|
|
105
|
+
onConfirm: () => void;
|
|
106
|
+
/** Custom icon (overrides variant default) */
|
|
107
|
+
icon?: ReactNode;
|
|
108
|
+
}
|
|
109
|
+
/**
|
|
110
|
+
* Delete Confirm Modal Props
|
|
111
|
+
*/
|
|
112
|
+
interface DeleteConfirmModalProps extends Omit<ConfirmModalProps, "variant" | "title" | "confirmText" | "message"> {
|
|
113
|
+
/** Name of item to delete */
|
|
114
|
+
itemName: string;
|
|
115
|
+
}
|
|
116
|
+
/**
|
|
117
|
+
* Regenerate Confirm Modal Props
|
|
118
|
+
*/
|
|
119
|
+
interface RegenerateConfirmModalProps extends Omit<ConfirmModalProps, "variant" | "title" | "confirmText" | "message"> {
|
|
120
|
+
/** Name of item to regenerate */
|
|
121
|
+
itemName: string;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
declare function Modal({ isOpen, onClose, title, subtitle, children, footer, size, className, showCloseButton, isClosing: externalIsClosing, setIsClosing: externalSetIsClosing, showUnsavedBadge, maxHeight, onBackdropClick, }: ModalProps): React$1.ReactPortal | null;
|
|
125
|
+
|
|
126
|
+
declare function ConfirmModal({ isOpen, title, subtitle, message, variant, confirmText, cancelText, isLoading, onConfirm, onClose, className, icon, }: ConfirmModalProps): React$1.ReactPortal | null;
|
|
127
|
+
/**
|
|
128
|
+
* Quick confirm dialog for delete actions
|
|
129
|
+
*/
|
|
130
|
+
declare function DeleteConfirmModal({ itemName, ...props }: DeleteConfirmModalProps): React$1.JSX.Element;
|
|
131
|
+
/**
|
|
132
|
+
* Quick confirm dialog for regenerate actions
|
|
133
|
+
*/
|
|
134
|
+
declare function RegenerateConfirmModal({ itemName, ...props }: RegenerateConfirmModalProps): React$1.JSX.Element;
|
|
135
|
+
|
|
136
|
+
interface SheetProps {
|
|
137
|
+
open: boolean;
|
|
138
|
+
onClose: () => void;
|
|
139
|
+
children: React.ReactNode;
|
|
140
|
+
title?: string;
|
|
141
|
+
}
|
|
142
|
+
declare function Sheet({ open, onClose, children, title }: SheetProps): React$1.ReactPortal | null;
|
|
143
|
+
|
|
144
|
+
interface CheckboxProps {
|
|
145
|
+
checked: boolean;
|
|
146
|
+
onCheckedChange: (checked: boolean) => void;
|
|
147
|
+
disabled?: boolean;
|
|
148
|
+
className?: string;
|
|
149
|
+
id?: string;
|
|
150
|
+
}
|
|
151
|
+
declare const Checkbox: React$1.ForwardRefExoticComponent<CheckboxProps & React$1.RefAttributes<HTMLButtonElement>>;
|
|
152
|
+
|
|
153
|
+
/**
|
|
154
|
+
* Merge class names with Tailwind-aware conflict resolution.
|
|
155
|
+
* `cn("px-4", "px-8")` → `"px-8"`.
|
|
156
|
+
*/
|
|
157
|
+
declare function cn(...inputs: ClassValue[]): string;
|
|
158
|
+
|
|
159
|
+
interface ComboboxOption {
|
|
160
|
+
value: string;
|
|
161
|
+
label: string;
|
|
162
|
+
description?: string;
|
|
163
|
+
/**
|
|
164
|
+
* Optional resolved icon URL for the option. The host app resolves this
|
|
165
|
+
* (e.g. from a provider id) before passing options in — YunUI stays
|
|
166
|
+
* domain-agnostic.
|
|
167
|
+
*/
|
|
168
|
+
iconUrl?: string | null;
|
|
169
|
+
}
|
|
170
|
+
interface ComboboxProps {
|
|
171
|
+
options: ComboboxOption[];
|
|
172
|
+
value: string;
|
|
173
|
+
onChange: (value: string) => void;
|
|
174
|
+
placeholder?: string;
|
|
175
|
+
className?: string;
|
|
176
|
+
disabled?: boolean;
|
|
177
|
+
allowCustom?: boolean;
|
|
178
|
+
creatableText?: string;
|
|
179
|
+
}
|
|
180
|
+
declare function Combobox({ options, value, onChange, placeholder, className, disabled, allowCustom, creatableText, }: ComboboxProps): React$1.JSX.Element;
|
|
181
|
+
|
|
182
|
+
interface ButtonProps extends React$1.ButtonHTMLAttributes<HTMLButtonElement> {
|
|
183
|
+
variant?: "default" | "primary" | "secondary" | "ghost" | "accent" | "outline" | "amber" | "red" | "destructive";
|
|
184
|
+
size?: "sm" | "md" | "lg" | "icon";
|
|
185
|
+
loading?: boolean;
|
|
186
|
+
/** Render the single child element with the button styling instead of a <button> (e.g. wrap a <Link>). */
|
|
187
|
+
asChild?: boolean;
|
|
188
|
+
}
|
|
189
|
+
declare const Button: React$1.ForwardRefExoticComponent<ButtonProps & React$1.RefAttributes<HTMLButtonElement>>;
|
|
190
|
+
interface InputProps extends React$1.InputHTMLAttributes<HTMLInputElement> {
|
|
191
|
+
icon?: React$1.ReactNode;
|
|
192
|
+
error?: string;
|
|
193
|
+
}
|
|
194
|
+
declare const Input: React$1.ForwardRefExoticComponent<InputProps & React$1.RefAttributes<HTMLInputElement>>;
|
|
195
|
+
interface TextareaProps extends React$1.TextareaHTMLAttributes<HTMLTextAreaElement> {
|
|
196
|
+
error?: string;
|
|
197
|
+
}
|
|
198
|
+
declare const Textarea: React$1.ForwardRefExoticComponent<TextareaProps & React$1.RefAttributes<HTMLTextAreaElement>>;
|
|
199
|
+
interface CardProps extends React$1.HTMLAttributes<HTMLDivElement> {
|
|
200
|
+
hover?: boolean;
|
|
201
|
+
}
|
|
202
|
+
declare const Card: React$1.ForwardRefExoticComponent<CardProps & React$1.RefAttributes<HTMLDivElement>>;
|
|
203
|
+
interface BadgeProps extends React$1.HTMLAttributes<HTMLSpanElement> {
|
|
204
|
+
variant?: "default" | "success" | "warning" | "error" | "info";
|
|
205
|
+
}
|
|
206
|
+
declare function Badge({ className, variant, ...props }: BadgeProps): React$1.JSX.Element;
|
|
207
|
+
declare const Dialog: React$1.FC<DialogPrimitive.DialogProps>;
|
|
208
|
+
declare const DialogTrigger: React$1.ForwardRefExoticComponent<DialogPrimitive.DialogTriggerProps & React$1.RefAttributes<HTMLButtonElement>>;
|
|
209
|
+
declare const DialogPortal: React$1.FC<DialogPrimitive.DialogPortalProps>;
|
|
210
|
+
declare const DialogClose: React$1.ForwardRefExoticComponent<DialogPrimitive.DialogCloseProps & React$1.RefAttributes<HTMLButtonElement>>;
|
|
211
|
+
declare const DialogOverlay: React$1.ForwardRefExoticComponent<Omit<DialogPrimitive.DialogOverlayProps & React$1.RefAttributes<HTMLDivElement>, "ref"> & React$1.RefAttributes<HTMLDivElement>>;
|
|
212
|
+
declare const DialogContent: React$1.ForwardRefExoticComponent<Omit<DialogPrimitive.DialogContentProps & React$1.RefAttributes<HTMLDivElement>, "ref"> & React$1.RefAttributes<HTMLDivElement>>;
|
|
213
|
+
declare function DialogHeader({ className, ...props }: React$1.HTMLAttributes<HTMLDivElement>): React$1.JSX.Element;
|
|
214
|
+
declare const DialogTitle: React$1.ForwardRefExoticComponent<Omit<DialogPrimitive.DialogTitleProps & React$1.RefAttributes<HTMLHeadingElement>, "ref"> & React$1.RefAttributes<HTMLHeadingElement>>;
|
|
215
|
+
declare const DialogDescription: React$1.ForwardRefExoticComponent<Omit<DialogPrimitive.DialogDescriptionProps & React$1.RefAttributes<HTMLParagraphElement>, "ref"> & React$1.RefAttributes<HTMLParagraphElement>>;
|
|
216
|
+
declare function DialogFooter({ className, ...props }: React$1.HTMLAttributes<HTMLDivElement>): React$1.JSX.Element;
|
|
217
|
+
declare const Select: React$1.FC<SelectPrimitive.SelectProps>;
|
|
218
|
+
declare const SelectValue: React$1.ForwardRefExoticComponent<SelectPrimitive.SelectValueProps & React$1.RefAttributes<HTMLSpanElement>>;
|
|
219
|
+
declare const SelectGroup: React$1.ForwardRefExoticComponent<SelectPrimitive.SelectGroupProps & React$1.RefAttributes<HTMLDivElement>>;
|
|
220
|
+
declare const SelectTrigger: React$1.ForwardRefExoticComponent<Omit<SelectPrimitive.SelectTriggerProps & React$1.RefAttributes<HTMLButtonElement>, "ref"> & React$1.RefAttributes<HTMLButtonElement>>;
|
|
221
|
+
declare const SelectContent: React$1.ForwardRefExoticComponent<Omit<SelectPrimitive.SelectContentProps & React$1.RefAttributes<HTMLDivElement>, "ref"> & React$1.RefAttributes<HTMLDivElement>>;
|
|
222
|
+
declare const SelectItem: React$1.ForwardRefExoticComponent<Omit<SelectPrimitive.SelectItemProps & React$1.RefAttributes<HTMLDivElement>, "ref"> & React$1.RefAttributes<HTMLDivElement>>;
|
|
223
|
+
declare const Slider: React$1.ForwardRefExoticComponent<Omit<SliderPrimitive.SliderProps & React$1.RefAttributes<HTMLSpanElement>, "ref"> & React$1.RefAttributes<HTMLSpanElement>>;
|
|
224
|
+
declare const Progress: React$1.ForwardRefExoticComponent<Omit<ProgressPrimitive.ProgressProps & React$1.RefAttributes<HTMLDivElement>, "ref"> & {
|
|
225
|
+
value?: number;
|
|
226
|
+
} & React$1.RefAttributes<HTMLDivElement>>;
|
|
227
|
+
declare const Tabs: React$1.ForwardRefExoticComponent<TabsPrimitive.TabsProps & React$1.RefAttributes<HTMLDivElement>>;
|
|
228
|
+
declare const TabsList: React$1.ForwardRefExoticComponent<Omit<TabsPrimitive.TabsListProps & React$1.RefAttributes<HTMLDivElement>, "ref"> & React$1.RefAttributes<HTMLDivElement>>;
|
|
229
|
+
declare const TabsTrigger: React$1.ForwardRefExoticComponent<Omit<TabsPrimitive.TabsTriggerProps & React$1.RefAttributes<HTMLButtonElement>, "ref"> & React$1.RefAttributes<HTMLButtonElement>>;
|
|
230
|
+
declare const TabsContent: React$1.ForwardRefExoticComponent<Omit<TabsPrimitive.TabsContentProps & React$1.RefAttributes<HTMLDivElement>, "ref"> & React$1.RefAttributes<HTMLDivElement>>;
|
|
231
|
+
declare const Avatar: React$1.ForwardRefExoticComponent<Omit<AvatarPrimitive.AvatarProps & React$1.RefAttributes<HTMLSpanElement>, "ref"> & React$1.RefAttributes<HTMLSpanElement>>;
|
|
232
|
+
declare const AvatarImage: React$1.ForwardRefExoticComponent<Omit<AvatarPrimitive.AvatarImageProps & React$1.RefAttributes<HTMLImageElement>, "ref"> & React$1.RefAttributes<HTMLImageElement>>;
|
|
233
|
+
declare const AvatarFallback: React$1.ForwardRefExoticComponent<Omit<AvatarPrimitive.AvatarFallbackProps & React$1.RefAttributes<HTMLSpanElement>, "ref"> & React$1.RefAttributes<HTMLSpanElement>>;
|
|
234
|
+
declare const TooltipProvider: React$1.FC<TooltipPrimitive.TooltipProviderProps>;
|
|
235
|
+
declare const Tooltip: React$1.FC<TooltipPrimitive.TooltipProps>;
|
|
236
|
+
declare const TooltipTrigger: React$1.ForwardRefExoticComponent<TooltipPrimitive.TooltipTriggerProps & React$1.RefAttributes<HTMLButtonElement>>;
|
|
237
|
+
declare const TooltipContent: React$1.ForwardRefExoticComponent<Omit<TooltipPrimitive.TooltipContentProps & React$1.RefAttributes<HTMLDivElement>, "ref"> & React$1.RefAttributes<HTMLDivElement>>;
|
|
238
|
+
declare function Skeleton({ className, ...props }: React$1.HTMLAttributes<HTMLDivElement>): React$1.JSX.Element;
|
|
239
|
+
interface SpinnerProps extends React$1.HTMLAttributes<HTMLDivElement> {
|
|
240
|
+
size?: "sm" | "md" | "lg";
|
|
241
|
+
}
|
|
242
|
+
declare function Spinner({ size, className, ...props }: SpinnerProps): React$1.JSX.Element;
|
|
243
|
+
interface PageLoaderProps extends React$1.HTMLAttributes<HTMLDivElement> {
|
|
244
|
+
title?: string;
|
|
245
|
+
subtitle?: string;
|
|
246
|
+
}
|
|
247
|
+
declare function PageLoader({ title, subtitle, className, ...props }: PageLoaderProps): React$1.JSX.Element;
|
|
248
|
+
interface EmptyStateProps {
|
|
249
|
+
icon?: React$1.ReactNode;
|
|
250
|
+
title: string;
|
|
251
|
+
description?: string;
|
|
252
|
+
action?: React$1.ReactNode;
|
|
253
|
+
}
|
|
254
|
+
declare function EmptyState({ icon, title, description, action }: EmptyStateProps): React$1.JSX.Element;
|
|
255
|
+
declare const MotionDiv: framer_motion.ForwardRefComponent<HTMLDivElement, framer_motion.HTMLMotionProps<"div">>;
|
|
256
|
+
declare const MotionSpan: framer_motion.ForwardRefComponent<HTMLSpanElement, framer_motion.HTMLMotionProps<"span">>;
|
|
257
|
+
declare const fadeIn: {
|
|
258
|
+
initial: {
|
|
259
|
+
opacity: number;
|
|
260
|
+
y: number;
|
|
261
|
+
};
|
|
262
|
+
animate: {
|
|
263
|
+
opacity: number;
|
|
264
|
+
y: number;
|
|
265
|
+
};
|
|
266
|
+
exit: {
|
|
267
|
+
opacity: number;
|
|
268
|
+
y: number;
|
|
269
|
+
};
|
|
270
|
+
transition: {
|
|
271
|
+
duration: number;
|
|
272
|
+
};
|
|
273
|
+
};
|
|
274
|
+
declare const staggerContainer: {
|
|
275
|
+
animate: {
|
|
276
|
+
transition: {
|
|
277
|
+
staggerChildren: number;
|
|
278
|
+
};
|
|
279
|
+
};
|
|
280
|
+
};
|
|
281
|
+
declare const staggerItem: {
|
|
282
|
+
initial: {
|
|
283
|
+
opacity: number;
|
|
284
|
+
y: number;
|
|
285
|
+
};
|
|
286
|
+
animate: {
|
|
287
|
+
opacity: number;
|
|
288
|
+
y: number;
|
|
289
|
+
};
|
|
290
|
+
};
|
|
291
|
+
interface IconButtonProps extends React$1.ButtonHTMLAttributes<HTMLButtonElement> {
|
|
292
|
+
icon: React$1.ReactNode;
|
|
293
|
+
label: string;
|
|
294
|
+
}
|
|
295
|
+
declare const IconButton: React$1.ForwardRefExoticComponent<IconButtonProps & React$1.RefAttributes<HTMLButtonElement>>;
|
|
296
|
+
declare function Label({ className, ...props }: React$1.LabelHTMLAttributes<HTMLLabelElement>): React$1.JSX.Element;
|
|
297
|
+
declare const DropdownMenu: React$1.FC<DropdownMenuPrimitive.DropdownMenuProps>;
|
|
298
|
+
declare const DropdownMenuTrigger: React$1.ForwardRefExoticComponent<DropdownMenuPrimitive.DropdownMenuTriggerProps & React$1.RefAttributes<HTMLButtonElement>>;
|
|
299
|
+
declare const DropdownMenuGroup: React$1.ForwardRefExoticComponent<DropdownMenuPrimitive.DropdownMenuGroupProps & React$1.RefAttributes<HTMLDivElement>>;
|
|
300
|
+
declare const DropdownMenuPortal: React$1.FC<DropdownMenuPrimitive.DropdownMenuPortalProps>;
|
|
301
|
+
declare const DropdownMenuSub: React$1.FC<DropdownMenuPrimitive.DropdownMenuSubProps>;
|
|
302
|
+
declare const DropdownMenuRadioGroup: React$1.ForwardRefExoticComponent<DropdownMenuPrimitive.DropdownMenuRadioGroupProps & React$1.RefAttributes<HTMLDivElement>>;
|
|
303
|
+
declare const DropdownMenuSubTrigger: React$1.ForwardRefExoticComponent<Omit<DropdownMenuPrimitive.DropdownMenuSubTriggerProps & React$1.RefAttributes<HTMLDivElement>, "ref"> & {
|
|
304
|
+
inset?: boolean;
|
|
305
|
+
} & React$1.RefAttributes<HTMLDivElement>>;
|
|
306
|
+
declare const DropdownMenuSubContent: React$1.ForwardRefExoticComponent<Omit<DropdownMenuPrimitive.DropdownMenuSubContentProps & React$1.RefAttributes<HTMLDivElement>, "ref"> & React$1.RefAttributes<HTMLDivElement>>;
|
|
307
|
+
declare const DropdownMenuContent: React$1.ForwardRefExoticComponent<Omit<DropdownMenuPrimitive.DropdownMenuContentProps & React$1.RefAttributes<HTMLDivElement>, "ref"> & React$1.RefAttributes<HTMLDivElement>>;
|
|
308
|
+
declare const DropdownMenuItem: React$1.ForwardRefExoticComponent<Omit<DropdownMenuPrimitive.DropdownMenuItemProps & React$1.RefAttributes<HTMLDivElement>, "ref"> & {
|
|
309
|
+
inset?: boolean;
|
|
310
|
+
} & React$1.RefAttributes<HTMLDivElement>>;
|
|
311
|
+
declare const DropdownMenuCheckboxItem: React$1.ForwardRefExoticComponent<Omit<DropdownMenuPrimitive.DropdownMenuCheckboxItemProps & React$1.RefAttributes<HTMLDivElement>, "ref"> & React$1.RefAttributes<HTMLDivElement>>;
|
|
312
|
+
declare const DropdownMenuRadioItem: React$1.ForwardRefExoticComponent<Omit<DropdownMenuPrimitive.DropdownMenuRadioItemProps & React$1.RefAttributes<HTMLDivElement>, "ref"> & React$1.RefAttributes<HTMLDivElement>>;
|
|
313
|
+
declare const DropdownMenuLabel: React$1.ForwardRefExoticComponent<Omit<DropdownMenuPrimitive.DropdownMenuLabelProps & React$1.RefAttributes<HTMLDivElement>, "ref"> & {
|
|
314
|
+
inset?: boolean;
|
|
315
|
+
} & React$1.RefAttributes<HTMLDivElement>>;
|
|
316
|
+
declare const DropdownMenuSeparator: React$1.ForwardRefExoticComponent<Omit<DropdownMenuPrimitive.DropdownMenuSeparatorProps & React$1.RefAttributes<HTMLDivElement>, "ref"> & React$1.RefAttributes<HTMLDivElement>>;
|
|
317
|
+
declare const DropdownMenuShortcut: {
|
|
318
|
+
({ className, ...props }: React$1.HTMLAttributes<HTMLSpanElement>): React$1.JSX.Element;
|
|
319
|
+
displayName: string;
|
|
320
|
+
};
|
|
321
|
+
|
|
322
|
+
interface SelectOption {
|
|
323
|
+
value: string;
|
|
324
|
+
label: string;
|
|
325
|
+
icon?: React.ReactNode;
|
|
326
|
+
description?: string;
|
|
327
|
+
}
|
|
328
|
+
interface CustomSelectProps {
|
|
329
|
+
options: SelectOption[];
|
|
330
|
+
value: string;
|
|
331
|
+
onChange: (value: string) => void;
|
|
332
|
+
placeholder?: string;
|
|
333
|
+
searchable?: boolean;
|
|
334
|
+
className?: string;
|
|
335
|
+
disabled?: boolean;
|
|
336
|
+
}
|
|
337
|
+
declare function CustomSelect({ options, value, onChange, placeholder, searchable, className, disabled, }: CustomSelectProps): React$1.JSX.Element;
|
|
338
|
+
|
|
339
|
+
interface SegmentedOption<T = string> {
|
|
340
|
+
value: T;
|
|
341
|
+
label: string;
|
|
342
|
+
desc?: string;
|
|
343
|
+
icon?: LucideIcon;
|
|
344
|
+
}
|
|
345
|
+
interface SegmentedSelectProps<T = string> {
|
|
346
|
+
options: SegmentedOption<T>[];
|
|
347
|
+
value: T;
|
|
348
|
+
onChange: (value: T) => void;
|
|
349
|
+
className?: string;
|
|
350
|
+
disabled?: boolean;
|
|
351
|
+
}
|
|
352
|
+
declare function SegmentedSelect<T = string>({ options, value, onChange, className, disabled, }: SegmentedSelectProps<T>): React$1.JSX.Element;
|
|
353
|
+
|
|
354
|
+
interface NavTab {
|
|
355
|
+
key: string;
|
|
356
|
+
label: ReactNode;
|
|
357
|
+
/** When set, the tab renders as a route Link instead of a button. */
|
|
358
|
+
href?: string;
|
|
359
|
+
}
|
|
360
|
+
interface NavTabsProps {
|
|
361
|
+
tabs: NavTab[];
|
|
362
|
+
activeKey: string;
|
|
363
|
+
/** Called for button-mode (in-page) tabs. Ignored when tabs use `href`. */
|
|
364
|
+
onChange?: (key: string) => void;
|
|
365
|
+
className?: string;
|
|
366
|
+
ariaLabel?: string;
|
|
367
|
+
}
|
|
368
|
+
/**
|
|
369
|
+
* The canonical horizontal tab bar. Each tab owns its indicator (the `.nav-tab`
|
|
370
|
+
* `::after`), which slides in + fades + grows exactly like the sidebar's
|
|
371
|
+
* per-item active bar, just rotated to the bottom edge and sitting inside the
|
|
372
|
+
* tab's floating hover box. Hovering raises that soft rounded box (懸浮框).
|
|
373
|
+
*/
|
|
374
|
+
declare function NavTabs({ tabs, activeKey, onChange, className, ariaLabel }: NavTabsProps): React$1.JSX.Element;
|
|
375
|
+
|
|
376
|
+
declare function ShinyButton({ children, className, href, onClick, }: {
|
|
377
|
+
children: ReactNode;
|
|
378
|
+
className?: string;
|
|
379
|
+
href?: string;
|
|
380
|
+
onClick?: () => void;
|
|
381
|
+
}): React$1.JSX.Element;
|
|
382
|
+
|
|
383
|
+
declare function Marquee({ className, reverse, pauseOnHover, children, vertical, repeat, ...props }: {
|
|
384
|
+
className?: string;
|
|
385
|
+
reverse?: boolean;
|
|
386
|
+
pauseOnHover?: boolean;
|
|
387
|
+
children?: React.ReactNode;
|
|
388
|
+
vertical?: boolean;
|
|
389
|
+
repeat?: number;
|
|
390
|
+
[key: string]: unknown;
|
|
391
|
+
}): React$1.JSX.Element;
|
|
392
|
+
|
|
393
|
+
declare const BentoGrid: ({ className, children, }: {
|
|
394
|
+
className?: string;
|
|
395
|
+
children?: ReactNode;
|
|
396
|
+
}) => React$1.JSX.Element;
|
|
397
|
+
declare const BentoCard: ({ className, title, description, header, icon, }: {
|
|
398
|
+
className?: string;
|
|
399
|
+
title?: string | ReactNode;
|
|
400
|
+
description?: string | ReactNode;
|
|
401
|
+
header?: ReactNode;
|
|
402
|
+
icon?: ReactNode;
|
|
403
|
+
}) => React$1.JSX.Element;
|
|
404
|
+
|
|
405
|
+
declare const Collapsible: React$1.ForwardRefExoticComponent<Primitive.CollapsibleProps & React$1.RefAttributes<HTMLDivElement>>;
|
|
406
|
+
declare const CollapsibleTrigger: React$1.ForwardRefExoticComponent<Primitive.CollapsibleTriggerProps & React$1.RefAttributes<HTMLButtonElement>>;
|
|
407
|
+
declare const CollapsibleContent: React$1.ForwardRefExoticComponent<Omit<Primitive.CollapsibleContentProps & React$1.RefAttributes<HTMLDivElement>, "ref"> & React$1.RefAttributes<HTMLDivElement>>;
|
|
408
|
+
|
|
409
|
+
type CollapsibleProps = Primitive.CollapsibleProps;
|
|
410
|
+
type CollapsibleContentProps = Primitive.CollapsibleContentProps;
|
|
411
|
+
type CollapsibleTriggerProps = Primitive.CollapsibleTriggerProps;
|
|
412
|
+
|
|
413
|
+
declare const Popover: React$1.FC<PopoverPrimitive.PopoverProps>;
|
|
414
|
+
declare const PopoverTrigger: React$1.ForwardRefExoticComponent<PopoverPrimitive.PopoverTriggerProps & React$1.RefAttributes<HTMLButtonElement>>;
|
|
415
|
+
declare const PopoverContent: React$1.ForwardRefExoticComponent<Omit<PopoverPrimitive.PopoverContentProps & React$1.RefAttributes<HTMLDivElement>, "ref"> & React$1.RefAttributes<HTMLDivElement>>;
|
|
416
|
+
declare const PopoverClose: React$1.ForwardRefExoticComponent<PopoverPrimitive.PopoverCloseProps & React$1.RefAttributes<HTMLButtonElement>>;
|
|
417
|
+
|
|
418
|
+
interface ThemeToggleProps {
|
|
419
|
+
/** Visual variant */
|
|
420
|
+
variant?: "icon" | "pill";
|
|
421
|
+
/** Dropdown alignment */
|
|
422
|
+
align?: "left" | "right";
|
|
423
|
+
/** Additional className */
|
|
424
|
+
className?: string;
|
|
425
|
+
}
|
|
426
|
+
declare function ThemeToggle({ variant, align, className }: ThemeToggleProps): React$1.JSX.Element;
|
|
427
|
+
|
|
428
|
+
interface SwitchProps {
|
|
429
|
+
checked: boolean;
|
|
430
|
+
onCheckedChange: (checked: boolean) => void;
|
|
431
|
+
disabled?: boolean;
|
|
432
|
+
size?: "sm" | "md";
|
|
433
|
+
variant?: "default" | "success" | "warning" | "danger";
|
|
434
|
+
className?: string;
|
|
435
|
+
id?: string;
|
|
436
|
+
}
|
|
437
|
+
declare const Switch: React$1.ForwardRefExoticComponent<SwitchProps & React$1.RefAttributes<HTMLButtonElement>>;
|
|
438
|
+
|
|
439
|
+
interface AnimatedNumberProps {
|
|
440
|
+
value: number;
|
|
441
|
+
suffix?: string;
|
|
442
|
+
/** Decimal places; trailing zeros are stripped (100.00 → 100). */
|
|
443
|
+
decimals?: number;
|
|
444
|
+
}
|
|
445
|
+
/**
|
|
446
|
+
* A number that springs from 0 up to `value` on mount / when `value` changes.
|
|
447
|
+
* Starts at 0 on both server and client, so it is SSR-hydration safe.
|
|
448
|
+
*/
|
|
449
|
+
declare function AnimatedNumber({ value, suffix, decimals }: AnimatedNumberProps): React$1.JSX.Element;
|
|
450
|
+
|
|
451
|
+
declare function Toaster(): React$1.JSX.Element;
|
|
452
|
+
declare const toast: {
|
|
453
|
+
success: (message: string, description?: string) => void;
|
|
454
|
+
error: (message: string, description?: string) => void;
|
|
455
|
+
info: (message: string, description?: string) => void;
|
|
456
|
+
warning: (message: string, description?: string) => void;
|
|
457
|
+
loading: (message: string) => string | number;
|
|
458
|
+
dismiss: (id?: string | number) => void;
|
|
459
|
+
promise: <T>(promise: Promise<T>, messages: {
|
|
460
|
+
loading: string;
|
|
461
|
+
success: string | ((data: T) => string);
|
|
462
|
+
error: string | ((error: Error) => string);
|
|
463
|
+
}) => (string & {
|
|
464
|
+
unwrap: () => Promise<T>;
|
|
465
|
+
}) | (number & {
|
|
466
|
+
unwrap: () => Promise<T>;
|
|
467
|
+
}) | {
|
|
468
|
+
unwrap: () => Promise<T>;
|
|
469
|
+
};
|
|
470
|
+
};
|
|
471
|
+
|
|
472
|
+
/**
|
|
473
|
+
* useEscapeKey - Hook for handling Escape key press
|
|
474
|
+
*
|
|
475
|
+
* Used by modals, dialogs, and other overlays to close on Escape key.
|
|
476
|
+
*/
|
|
477
|
+
/**
|
|
478
|
+
* Hook that calls the callback when Escape key is pressed
|
|
479
|
+
*
|
|
480
|
+
* @param onEscape - Callback function to call when Escape is pressed
|
|
481
|
+
* @param enabled - Whether the hook is active (default: true)
|
|
482
|
+
*
|
|
483
|
+
* @example
|
|
484
|
+
* ```tsx
|
|
485
|
+
* function MyModal({ onClose }) {
|
|
486
|
+
* useEscapeKey(onClose);
|
|
487
|
+
* return <div>Modal content</div>;
|
|
488
|
+
* }
|
|
489
|
+
* ```
|
|
490
|
+
*/
|
|
491
|
+
declare function useEscapeKey(onEscape: () => void, enabled?: boolean): void;
|
|
492
|
+
declare function useBodyScrollLock(locked?: boolean): void;
|
|
493
|
+
/**
|
|
494
|
+
* Combined hook for modal behavior: Escape key + body scroll lock
|
|
495
|
+
*
|
|
496
|
+
* @param isOpen - Whether the modal is open
|
|
497
|
+
* @param onClose - Callback to close the modal
|
|
498
|
+
*
|
|
499
|
+
* @example
|
|
500
|
+
* ```tsx
|
|
501
|
+
* function MyModal({ isOpen, onClose }) {
|
|
502
|
+
* useModalBehavior(isOpen, onClose);
|
|
503
|
+
* if (!isOpen) return null;
|
|
504
|
+
* return <div>Modal content</div>;
|
|
505
|
+
* }
|
|
506
|
+
* ```
|
|
507
|
+
*/
|
|
508
|
+
declare function useModalBehavior(isOpen: boolean, onClose: () => void): void;
|
|
509
|
+
|
|
510
|
+
export { AnimatedNumber, type AnimatedNumberProps, Avatar, AvatarFallback, AvatarImage, Badge, BentoCard, BentoGrid, Button, Card, Checkbox, type CheckboxProps, Collapsible, CollapsibleContent, type CollapsibleContentProps, type CollapsibleProps, CollapsibleTrigger, type CollapsibleTriggerProps, Combobox, type ComboboxOption, ConfirmModal, type ConfirmModalVariant, CustomSelect, DeleteConfirmModal, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, EmptyState, IconButton, Input, Label, Marquee, Modal, MotionDiv, MotionSpan, type NavTab, NavTabs, PageLoader, Popover, PopoverClose, PopoverContent, PopoverTrigger, Progress, RegenerateConfirmModal, type SegmentedOption, SegmentedSelect, Select, SelectContent, SelectGroup, SelectItem, type SelectOption, SelectTrigger, SelectValue, Sheet, ShinyButton, Skeleton, Slider, Spinner, Switch, type SwitchProps, Tabs, TabsContent, TabsList, TabsTrigger, Textarea, ThemeToggle, Toaster, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, cn, fadeIn, staggerContainer, staggerItem, toast, useBodyScrollLock, useEscapeKey, useModalBehavior };
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
export { AnimatedNumber, Avatar, AvatarFallback, AvatarImage, Badge, BentoCard, BentoGrid, Button, Card, Checkbox, Collapsible, CollapsibleContent, CollapsibleTrigger, Combobox, ConfirmModal, CustomSelect, DeleteConfirmModal, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, EmptyState, IconButton, Input, Label, Marquee, Modal, MotionDiv, MotionSpan, NavTabs, PageLoader, Popover, PopoverClose, PopoverContent, PopoverTrigger, Progress, RegenerateConfirmModal, SegmentedSelect, Select, SelectContent, SelectGroup, SelectItem, SelectTrigger, SelectValue, Sheet, ShinyButton, Skeleton, Slider, Spinner, Switch, Tabs, TabsContent, TabsList, TabsTrigger, Textarea, Toaster, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, fadeIn, staggerContainer, staggerItem, toast, useBodyScrollLock, useEscapeKey, useModalBehavior } from './chunk-OHIFY64L.js';
|
|
3
|
+
export { ThemeToggle, cn } from './chunk-DRZ7UCRU.js';
|
|
4
|
+
import './chunk-XZGNL5A6.js';
|
|
5
|
+
//# sourceMappingURL=index.js.map
|
|
6
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"index.js"}
|