hologram-sticker
Version:
A React component library for creating holographic sticker effects
201 lines (184 loc) • 5.21 kB
TypeScript
import * as React from 'react';
import React__default, { ReactNode, CSSProperties } from 'react';
interface ControlsProps$1 {
className?: string;
}
interface MinimapProps$1 {
className?: string;
}
interface GlareProps$1 {
className?: string;
}
interface SpotlightProps$1 {
className?: string;
intensity?: number;
}
interface ContentProps$1 {
children: React__default.ReactNode;
className?: string;
}
interface RefractionProps$1 {
className?: string;
intensity?: number;
variant?: 'default' | 'debug';
colors?: string[];
}
interface WatermarkProps$1 {
children?: React__default.ReactNode;
className?: string;
imageUrl?: string;
opacity?: number;
}
interface PatternProps$1 {
children?: React__default.ReactNode;
className?: string;
maskUrl?: string;
maskSize?: 'contain' | 'cover' | string;
textureUrl?: string;
opacity?: number;
mode?: 'composite' | 'texture-only';
mixBlendMode?: 'hard-light' | 'multiply';
textureSize?: string;
}
interface ImageLayerProps$1 {
src: string;
alt?: string;
className?: string;
opacity?: number;
objectFit?: 'contain' | 'cover' | 'fill' | 'none' | 'scale-down';
scale?: number | string;
parallax?: boolean;
style?: React__default.CSSProperties;
}
interface CardProps$1 {
children: React__default.ReactNode;
className?: string;
/**
* Card width in pixels. Defaults to 260px (via CSS variable --sticker-card-width)
*/
width?: number;
/**
* Card aspect ratio (width/height). Defaults to 5/7 (0.714) - classic card proportions
*/
aspectRatio?: number;
}
interface SceneProps$1 {
children: React__default.ReactNode;
className?: string;
}
interface RootProps$1 {
children: React__default.ReactNode;
className?: string;
style?: React__default.CSSProperties;
}
interface HologramContextType$1 {
isActive: boolean;
isExploded: boolean;
setIsExploded: (exploded: boolean) => void;
pointerPos: {
x: string;
y: string;
};
showGlare: boolean;
cardRef: React__default.RefObject<HTMLElement>;
minimapRef: React__default.RefObject<HTMLDivElement>;
sceneRef: React__default.RefObject<HTMLDivElement>;
rootRef: React__default.RefObject<HTMLDivElement>;
}
declare const useHologram: () => HologramContextType$1;
interface RootProps {
children: ReactNode;
className?: string;
style?: CSSProperties;
}
interface SceneProps {
children: ReactNode;
className?: string;
}
interface CardProps {
children: ReactNode;
className?: string;
width?: number;
aspectRatio?: number;
}
interface ImageLayerProps {
src: string;
alt?: string;
className?: string;
opacity?: number;
objectFit?: 'contain' | 'cover' | 'fill' | 'none' | 'scale-down';
scale?: number | string;
parallax?: boolean;
style?: React__default.CSSProperties;
}
interface PatternProps {
children?: ReactNode;
className?: string;
maskUrl?: string;
maskSize?: 'contain' | 'cover' | string;
textureUrl?: string;
opacity?: number;
mode?: 'composite' | 'texture-only';
mixBlendMode?: 'hard-light' | 'multiply';
textureSize?: string;
}
interface WatermarkProps {
children?: ReactNode;
className?: string;
imageUrl?: string;
opacity?: number;
}
interface RefractionProps {
className?: string;
intensity?: number;
variant?: 'default' | 'debug';
colors?: string[];
}
interface ContentProps {
children: ReactNode;
className?: string;
}
interface SpotlightProps {
className?: string;
intensity?: number;
}
interface GlareProps {
className?: string;
}
interface MinimapProps {
className?: string;
}
interface ControlsProps {
className?: string;
}
interface PointerPosition {
x: string;
y: string;
}
interface HologramContextType {
isActive: boolean;
isExploded: boolean;
setIsExploded: (exploded: boolean) => void;
pointerPos: PointerPosition;
showGlare: boolean;
cardRef: React__default.RefObject<HTMLElement>;
minimapRef: React__default.RefObject<HTMLDivElement>;
sceneRef: React__default.RefObject<HTMLDivElement>;
rootRef: React__default.RefObject<HTMLDivElement>;
}
declare const HologramSticker: {
Root: React.FC<RootProps$1>;
Scene: React.ForwardRefExoticComponent<SceneProps$1 & React.RefAttributes<HTMLDivElement>>;
Card: React.ForwardRefExoticComponent<CardProps$1 & React.RefAttributes<HTMLElement>>;
ImageLayer: React.FC<ImageLayerProps$1>;
Pattern: React.FC<PatternProps$1>;
Watermark: React.FC<WatermarkProps$1>;
Refraction: React.FC<RefractionProps$1>;
Content: React.FC<ContentProps$1>;
Spotlight: React.FC<SpotlightProps$1>;
Glare: React.FC<GlareProps$1>;
Minimap: React.FC<MinimapProps$1>;
Controls: React.FC<ControlsProps$1>;
};
export { HologramSticker, HologramSticker as default, useHologram };
export type { CardProps, ContentProps, ControlsProps, GlareProps, HologramContextType, ImageLayerProps, MinimapProps, PatternProps, PointerPosition, RefractionProps, RootProps, SceneProps, SpotlightProps, WatermarkProps };