@restnfeel/agentc-starter-kit
Version:
한국어 기업용 CMS 모듈 - Task Master AI와 함께 빠르게 웹사이트를 구현할 수 있는 재사용 가능한 컴포넌트 시스템
356 lines (337 loc) • 12.6 kB
TypeScript
import React$1, { ReactNode } from 'react';
import * as __types_templates from '@/types/templates';
import { SiteTemplate, TemplateCategory, TemplateLibrary } from '@/types/templates';
import { Prisma } from '@prisma/client';
interface ButtonProps extends React$1.ButtonHTMLAttributes<HTMLButtonElement> {
variant?: "primary" | "secondary" | "outline" | "destructive" | "ghost";
size?: "sm" | "md" | "lg";
loading?: boolean;
}
declare const Button: React$1.ForwardRefExoticComponent<ButtonProps & React$1.RefAttributes<HTMLButtonElement>>;
interface InputProps extends React$1.InputHTMLAttributes<HTMLInputElement> {
label?: string;
helperText?: string;
error?: string;
}
declare const Input: React$1.ForwardRefExoticComponent<InputProps & React$1.RefAttributes<HTMLInputElement>>;
interface CardProps extends React$1.HTMLAttributes<HTMLDivElement> {
}
declare const Card: React$1.ForwardRefExoticComponent<CardProps & React$1.RefAttributes<HTMLDivElement>>;
interface CardHeaderProps extends React$1.HTMLAttributes<HTMLDivElement> {
}
declare const CardHeader: React$1.ForwardRefExoticComponent<CardHeaderProps & React$1.RefAttributes<HTMLDivElement>>;
interface CardContentProps extends React$1.HTMLAttributes<HTMLDivElement> {
}
declare const CardContent: React$1.ForwardRefExoticComponent<CardContentProps & React$1.RefAttributes<HTMLDivElement>>;
interface CardFooterProps extends React$1.HTMLAttributes<HTMLDivElement> {
}
declare const CardFooter: React$1.ForwardRefExoticComponent<CardFooterProps & React$1.RefAttributes<HTMLDivElement>>;
interface CardTitleProps extends React$1.HTMLAttributes<HTMLHeadingElement> {
}
declare const CardTitle: React$1.ForwardRefExoticComponent<CardTitleProps & React$1.RefAttributes<HTMLHeadingElement>>;
interface BaseComponentProps {
className?: string;
children?: React.ReactNode;
}
interface ModalProps extends BaseComponentProps {
open?: boolean;
onClose?: () => void;
onOpenChange?: (open: boolean) => void;
size?: "sm" | "md" | "lg" | "xl" | "full";
showCloseButton?: boolean;
closeOnOverlayClick?: boolean;
closeOnEscape?: boolean;
role?: "dialog" | "alertdialog";
ariaLabelledBy?: string;
ariaDescribedBy?: string;
animation?: boolean;
}
declare const Modal: React$1.ForwardRefExoticComponent<ModalProps & React$1.RefAttributes<HTMLDivElement>>;
declare const ModalHeader: React$1.ForwardRefExoticComponent<BaseComponentProps & React$1.RefAttributes<HTMLDivElement>>;
interface ModalTitleProps extends BaseComponentProps {
as?: "h1" | "h2" | "h3" | "h4" | "h5" | "h6";
}
declare const ModalTitle: React$1.ForwardRefExoticComponent<ModalTitleProps & React$1.RefAttributes<HTMLHeadingElement>>;
declare const ModalDescription: React$1.ForwardRefExoticComponent<BaseComponentProps & React$1.RefAttributes<HTMLParagraphElement>>;
declare const ModalContent: React$1.ForwardRefExoticComponent<BaseComponentProps & React$1.RefAttributes<HTMLDivElement>>;
interface ModalFooterProps extends BaseComponentProps {
justify?: "start" | "end" | "center" | "between";
}
declare const ModalFooter: React$1.ForwardRefExoticComponent<ModalFooterProps & React$1.RefAttributes<HTMLDivElement>>;
interface LoadingProps extends BaseComponentProps {
size?: "xs" | "sm" | "md" | "lg" | "xl";
variant?: "spinner" | "dots" | "pulse" | "bars" | "ring";
text?: string;
center?: boolean;
color?: "primary" | "secondary" | "muted";
overlay?: boolean;
}
declare const Loading: React$1.ForwardRefExoticComponent<LoadingProps & React$1.RefAttributes<HTMLDivElement>>;
interface ConfirmationDialogProps {
open: boolean;
onOpenChange: (open: boolean) => void;
title: string;
description: string;
confirmText?: string;
cancelText?: string;
variant?: "default" | "destructive" | "warning";
onConfirm: () => void;
onCancel?: () => void;
loading?: boolean;
}
declare function ConfirmationDialog({ open, onOpenChange, title, description, confirmText, cancelText, variant, onConfirm, onCancel, loading, }: ConfirmationDialogProps): React$1.JSX.Element;
declare function useConfirmationDialog(): {
showConfirmation: (options: {
title: string;
description: string;
confirmText?: string;
cancelText?: string;
variant?: "default" | "destructive" | "warning";
onConfirm: () => void;
onCancel?: () => void;
}) => void;
hideConfirmation: () => void;
setLoading: (loading: boolean) => void;
ConfirmationDialog: () => React$1.JSX.Element;
};
declare const UI_COMPONENTS_VERSION = "0.1.0";
interface Message$1 {
id: string;
content: string;
sender: "user" | "ai";
timestamp: Date;
type?: "text" | "error" | "system";
isStreaming?: boolean;
}
declare class ChatbotAPIError extends Error {
status?: number;
code?: string;
constructor(message: string, status?: number, code?: string);
}
interface ChatbotTheme {
primary: string;
secondary: string;
background: string;
surface: string;
text: {
primary: string;
secondary: string;
inverse: string;
};
border: string;
shadow: string;
success: string;
warning: string;
error: string;
radius: {
sm: string;
md: string;
lg: string;
full: string;
};
spacing: {
xs: string;
sm: string;
md: string;
lg: string;
xl: string;
};
typography: {
fontFamily: string;
fontSize: {
xs: string;
sm: string;
md: string;
lg: string;
xl: string;
};
fontWeight: {
normal: string;
medium: string;
semibold: string;
bold: string;
};
};
}
declare const themes: {
readonly default: ChatbotTheme;
readonly dark: ChatbotTheme;
readonly compact: ChatbotTheme;
};
type ThemeName = keyof typeof themes;
interface ChatbotWidgetProps {
apiBaseUrl?: string;
apiKey?: string;
position?: "bottom-right" | "bottom-left" | "top-right" | "top-left";
buttonSize?: "sm" | "md" | "lg";
buttonColor?: string;
title?: string;
placeholder?: string;
enableSuggestedQuestions?: boolean;
enableTypingIndicator?: boolean;
enableRetry?: boolean;
maxRetries?: number;
className?: string;
disabled?: boolean;
onError?: (error: ChatbotAPIError) => void;
onMessageSent?: (message: string) => void;
onMessageReceived?: (message: Message$1) => void;
theme?: ThemeName;
language?: string;
enableLanguageSelector?: boolean;
enableThemeToggle?: boolean;
}
declare function ChatbotWidget({ theme, language, ...props }: ChatbotWidgetProps): React$1.JSX.Element;
interface DesktopChatModalProps {
onSendMessage: (message: string) => void;
isTyping?: boolean;
title?: string;
placeholder?: string;
className?: string;
disabled?: boolean;
showSuggestedQuestions?: boolean;
suggestedQuestionsContext?: string;
allowMinimize?: boolean;
width?: string;
height?: string;
/** Whether to announce messages to screen readers */
announceMessages?: boolean;
/** Custom breakpoints for responsive design */
breakpoints?: {
mobile: string;
tablet: string;
desktop: string;
};
}
declare function DesktopChatModal({ onSendMessage, isTyping, title, placeholder, className, disabled, showSuggestedQuestions, suggestedQuestionsContext, allowMinimize, width, height, announceMessages, breakpoints, }: DesktopChatModalProps): React$1.JSX.Element;
interface Message {
id: string;
content: string;
sender: "user" | "ai";
timestamp: Date;
type?: "text" | "error" | "system";
isStreaming?: boolean;
}
interface ModalState {
isOpen: boolean;
isMinimized: boolean;
position: {
x: number;
y: number;
};
size: {
width: string;
height: string;
};
zIndex: number;
}
interface ChatSession {
id: string;
messages: Message[];
createdAt: Date;
lastActivity: Date;
title?: string;
}
interface ModalStateContextType {
modalState: ModalState;
openModal: () => void;
closeModal: () => void;
minimizeModal: () => void;
maximizeModal: () => void;
setModalPosition: (x: number, y: number) => void;
setModalSize: (width: string, height: string) => void;
bringToFront: () => void;
currentSession: ChatSession | null;
sessions: ChatSession[];
createSession: (title?: string) => string;
switchSession: (sessionId: string) => void;
deleteSession: (sessionId: string) => void;
addMessage: (message: Omit<Message, "id" | "timestamp">) => void;
clearCurrentSession: () => void;
saveToStorage: () => void;
loadFromStorage: () => void;
clearStorage: () => void;
}
declare function useModalState(): ModalStateContextType;
interface ModalStateProviderProps {
children: ReactNode;
persistToStorage?: boolean;
maxSessions?: number;
sessionTimeout?: number;
}
declare function ModalStateProvider({ children, persistToStorage, maxSessions, sessionTimeout, }: ModalStateProviderProps): React$1.JSX.Element;
type ClassValue = string | number | null | boolean | undefined | Record<string, any> | ClassValue[];
declare function cn(...inputs: ClassValue[]): string;
declare const templates: SiteTemplate[];
declare const templateCategories: {
id: TemplateCategory;
name: string;
description: string;
icon: string;
}[];
declare const templateLibrary: TemplateLibrary;
declare class TemplateManager {
private templates;
constructor(templates: SiteTemplate[]);
getById(id: string): SiteTemplate | undefined;
getBySlug(slug: string): SiteTemplate | undefined;
getByCategory(category: TemplateCategory): SiteTemplate[];
getFreeTemplates(): SiteTemplate[];
getPremiumTemplates(): SiteTemplate[];
getActiveTemplates(): SiteTemplate[];
getPublicTemplates(): SiteTemplate[];
search(query: string): SiteTemplate[];
filter(options: {
category?: TemplateCategory;
pricing?: "FREE" | "PREMIUM" | "ENTERPRISE";
features?: string[];
tags?: string[];
search?: string;
}): SiteTemplate[];
sort(templates: SiteTemplate[], sortBy: "name" | "popularity" | "rating" | "date", order?: "asc" | "desc"): SiteTemplate[];
getRecommendations(currentTemplate?: SiteTemplate, limit?: number): SiteTemplate[];
getStats(): {
total: number;
active: number;
free: number;
premium: number;
categories: Record<TemplateCategory, number>;
};
}
declare const templateManager: TemplateManager;
declare const getTemplateById: (id: string) => SiteTemplate;
declare const getTemplateBySlug: (slug: string) => SiteTemplate;
declare const getTemplatesByCategory: (category: TemplateCategory) => SiteTemplate[];
declare const searchTemplates: (query: string) => SiteTemplate[];
declare const filterTemplates: (options: Parameters<typeof templateManager.filter>[0]) => SiteTemplate[];
declare const getTemplateStats: () => {
total: number;
active: number;
free: number;
premium: number;
categories: Record<TemplateCategory, number>;
};
declare const createSiteFromTemplate: (templateId: string, siteData: {
name: string;
slug: string;
domain?: string;
}) => {
name: string;
slug: string;
domain: string;
templateId: string;
templateData: Prisma.InputJsonValue;
settings: Prisma.InputJsonValue;
sections: {
type: __types_templates.SectionType;
name: string;
content: Prisma.InputJsonValue;
styles: Prisma.InputJsonValue;
order: number;
isVisible: boolean;
isPublished: boolean;
}[];
};
declare const cloneTemplate: (templateId: string, newData: Partial<SiteTemplate>) => SiteTemplate;
export { Button, Card, CardContent, CardFooter, CardHeader, CardTitle, ChatbotWidget, ConfirmationDialog, DesktopChatModal, Input, Loading, Modal, ModalContent, ModalDescription, ModalFooter, ModalHeader, ModalStateProvider, ModalTitle, TemplateManager, UI_COMPONENTS_VERSION, cloneTemplate, cn, createSiteFromTemplate, filterTemplates, getTemplateById, getTemplateBySlug, getTemplateStats, getTemplatesByCategory, searchTemplates, templateCategories, templateLibrary, templateManager, templates, useConfirmationDialog, useModalState };
export type { ButtonProps, CardProps, CardTitleProps, InputProps, LoadingProps, ModalProps };