@memoreco/ui 0.2.3 → 0.2.5
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/dist/index.js +57 -23
- package/dist/index.mjs +3430 -3111
- package/dist/ui/src/components/code-sample.d.ts +61 -0
- package/dist/ui/src/components/thumbnail-card.d.ts +25 -0
- package/dist/ui/src/components/thumbnail-preview.d.ts +21 -0
- package/dist/ui/src/components/thumbnail-strip.d.ts +30 -0
- package/dist/ui/src/index.d.ts +9 -1
- package/package.json +1 -1
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
|
|
3
|
+
export interface CodeSampleProps {
|
|
4
|
+
/**
|
|
5
|
+
* Optional caption displayed above the code block
|
|
6
|
+
*/
|
|
7
|
+
caption?: string;
|
|
8
|
+
/**
|
|
9
|
+
* Code content - can be a plain string or React elements for custom syntax highlighting
|
|
10
|
+
*/
|
|
11
|
+
children: React.ReactNode;
|
|
12
|
+
/**
|
|
13
|
+
* Plain text version for clipboard copy (if children is JSX, provide this)
|
|
14
|
+
*/
|
|
15
|
+
plainText?: string;
|
|
16
|
+
/**
|
|
17
|
+
* Enable keyboard shortcut (spacebar) to copy code
|
|
18
|
+
* @default false
|
|
19
|
+
*/
|
|
20
|
+
enableSpacebar?: boolean;
|
|
21
|
+
/**
|
|
22
|
+
* Show copy success toast notification
|
|
23
|
+
* @default true
|
|
24
|
+
*/
|
|
25
|
+
showToast?: boolean;
|
|
26
|
+
/**
|
|
27
|
+
* Maximum height for code block with scroll
|
|
28
|
+
* @default "60vh"
|
|
29
|
+
*/
|
|
30
|
+
maxHeight?: string;
|
|
31
|
+
/**
|
|
32
|
+
* Custom className for the code block container
|
|
33
|
+
*/
|
|
34
|
+
className?: string;
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* CodeSample: Professional code display component with copy functionality
|
|
38
|
+
*
|
|
39
|
+
* Features:
|
|
40
|
+
* - Copy to clipboard with animated feedback
|
|
41
|
+
* - Hover tooltip showing "Copy" hint
|
|
42
|
+
* - Optional keyboard shortcut (spacebar) for quick copy
|
|
43
|
+
* - Smooth scale animation on button press
|
|
44
|
+
* - Portal-based tooltip positioning
|
|
45
|
+
* - Toast notifications for copy success/failure
|
|
46
|
+
* - Supports both plain text and custom JSX syntax highlighting
|
|
47
|
+
*
|
|
48
|
+
* Usage:
|
|
49
|
+
* ```tsx
|
|
50
|
+
* // Simple usage with plain text
|
|
51
|
+
* <CodeSample caption="Example">
|
|
52
|
+
* {`const hello = "world";`}
|
|
53
|
+
* </CodeSample>
|
|
54
|
+
*
|
|
55
|
+
* // Advanced usage with custom syntax highlighting
|
|
56
|
+
* <CodeSample caption="React Example" plainText={plainTextVersion}>
|
|
57
|
+
* <span className="text-purple-400">import</span> ...
|
|
58
|
+
* </CodeSample>
|
|
59
|
+
* ```
|
|
60
|
+
*/
|
|
61
|
+
export declare function CodeSample({ caption, children, plainText, enableSpacebar, showToast, maxHeight, className, }: CodeSampleProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
export interface ThumbnailCardProps {
|
|
2
|
+
url: string;
|
|
3
|
+
imageUrl?: string;
|
|
4
|
+
status: "loading" | "ready" | "error";
|
|
5
|
+
onClick?: () => void;
|
|
6
|
+
className?: string;
|
|
7
|
+
size?: "sm" | "md" | "lg";
|
|
8
|
+
showHostname?: boolean;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* ThumbnailCard - Displays a thumbnail preview card with loading/error states
|
|
12
|
+
*
|
|
13
|
+
* @example
|
|
14
|
+
* ```tsx
|
|
15
|
+
* <ThumbnailCard
|
|
16
|
+
* url="https://example.com"
|
|
17
|
+
* imageUrl="https://cdn.example.com/screenshot.png"
|
|
18
|
+
* status="ready"
|
|
19
|
+
* onClick={() => console.log('clicked')}
|
|
20
|
+
* size="md"
|
|
21
|
+
* showHostname={true}
|
|
22
|
+
* />
|
|
23
|
+
* ```
|
|
24
|
+
*/
|
|
25
|
+
export declare function ThumbnailCard({ url, imageUrl, status, onClick, className, size, showHostname, }: ThumbnailCardProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
export interface ThumbnailPreviewOverlayProps {
|
|
2
|
+
url: string;
|
|
3
|
+
imageUrl?: string;
|
|
4
|
+
status: "loading" | "ready" | "error";
|
|
5
|
+
onClose: () => void;
|
|
6
|
+
className?: string;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* ThumbnailPreviewOverlay - Full-screen overlay for previewing thumbnails
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
* ```tsx
|
|
13
|
+
* <ThumbnailPreviewOverlay
|
|
14
|
+
* url="https://example.com"
|
|
15
|
+
* imageUrl="https://cdn.example.com/screenshot.png"
|
|
16
|
+
* status="ready"
|
|
17
|
+
* onClose={() => setPreview(null)}
|
|
18
|
+
* />
|
|
19
|
+
* ```
|
|
20
|
+
*/
|
|
21
|
+
export declare function ThumbnailPreviewOverlay({ url, imageUrl, status, onClose, className, }: ThumbnailPreviewOverlayProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
export interface ThumbnailData {
|
|
2
|
+
url: string;
|
|
3
|
+
imageUrl?: string;
|
|
4
|
+
status: "loading" | "ready" | "error";
|
|
5
|
+
}
|
|
6
|
+
export interface ThumbnailStripProps {
|
|
7
|
+
thumbnails: ThumbnailData[];
|
|
8
|
+
onThumbnailClick?: (thumbnail: ThumbnailData) => void;
|
|
9
|
+
className?: string;
|
|
10
|
+
size?: "sm" | "md" | "lg";
|
|
11
|
+
showHostname?: boolean;
|
|
12
|
+
maxDisplay?: number;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* ThumbnailStrip - Displays a horizontal strip of thumbnail cards
|
|
16
|
+
*
|
|
17
|
+
* @example
|
|
18
|
+
* ```tsx
|
|
19
|
+
* <ThumbnailStrip
|
|
20
|
+
* thumbnails={[
|
|
21
|
+
* { url: "https://example.com", imageUrl: "...", status: "ready" },
|
|
22
|
+
* { url: "https://figma.com", status: "loading" },
|
|
23
|
+
* ]}
|
|
24
|
+
* onThumbnailClick={(thumb) => setPreview(thumb)}
|
|
25
|
+
* size="md"
|
|
26
|
+
* maxDisplay={5}
|
|
27
|
+
* />
|
|
28
|
+
* ```
|
|
29
|
+
*/
|
|
30
|
+
export declare function ThumbnailStrip({ thumbnails, onThumbnailClick, className, size, showHostname, maxDisplay, }: ThumbnailStripProps): import("react/jsx-runtime").JSX.Element | null;
|
package/dist/ui/src/index.d.ts
CHANGED
|
@@ -15,6 +15,10 @@ export { Dialog, DialogPortal, DialogOverlay, DialogClose, DialogTrigger, Dialog
|
|
|
15
15
|
export { Select, SelectGroup, SelectValue, SelectTrigger, SelectContent, SelectLabel, SelectItem, SelectSeparator, } from './components/select';
|
|
16
16
|
export { Checkbox } from './components/checkbox';
|
|
17
17
|
export { AlertDialog, AlertDialogPortal, AlertDialogOverlay, AlertDialogTrigger, AlertDialogContent, AlertDialogHeader, AlertDialogFooter, AlertDialogTitle, AlertDialogDescription, AlertDialogAction, AlertDialogCancel, } from './components/alert-dialog';
|
|
18
|
+
export { CodeSample } from './components/code-sample';
|
|
19
|
+
export { ThumbnailCard } from './components/thumbnail-card';
|
|
20
|
+
export { ThumbnailPreviewOverlay } from './components/thumbnail-preview';
|
|
21
|
+
export { ThumbnailStrip } from './components/thumbnail-strip';
|
|
18
22
|
export type { ButtonProps } from './components/button';
|
|
19
23
|
export type { CardProps } from './components/card';
|
|
20
24
|
export type { InputProps } from './components/input';
|
|
@@ -23,5 +27,9 @@ export type { FormProps, FormFieldProps } from './components/form';
|
|
|
23
27
|
export type { BadgeProps } from './components/badge';
|
|
24
28
|
export type { SeparatorProps } from './components/separator';
|
|
25
29
|
export type { DiscLoaderProps } from './components/disc-loader';
|
|
30
|
+
export type { CodeSampleProps } from './components/code-sample';
|
|
31
|
+
export type { ThumbnailCardProps } from './components/thumbnail-card';
|
|
32
|
+
export type { ThumbnailPreviewOverlayProps } from './components/thumbnail-preview';
|
|
33
|
+
export type { ThumbnailStripProps, ThumbnailData as UIThumbnailData } from './components/thumbnail-strip';
|
|
26
34
|
export { cn } from './lib/utils';
|
|
27
|
-
export declare const UI_LIBRARY_VERSION = "0.2.
|
|
35
|
+
export declare const UI_LIBRARY_VERSION = "0.2.4";
|