@rock10/ui 1.0.0 → 1.0.2

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.
@@ -0,0 +1,9 @@
1
+ export interface DatePickerProps {
2
+ onDateSelect: (date: string) => void;
3
+ label?: string;
4
+ maxDate?: string;
5
+ minDate?: string;
6
+ initialDate?: string;
7
+ }
8
+ export declare const DatePicker: ({ onDateSelect, label, maxDate, minDate, initialDate }: DatePickerProps) => JSX.Element;
9
+ export default DatePicker;
@@ -0,0 +1,14 @@
1
+ export interface DateSelectorProps {
2
+ /** Callback quando a data é selecionada */
3
+ onDateChange: (startDate: string | null, endDate: string | null) => void;
4
+ /** Data inicial selecionada (formato YYYY-MM-DD) */
5
+ initialStartDate?: string;
6
+ /** Data final selecionada (formato YYYY-MM-DD) */
7
+ initialEndDate?: string;
8
+ /** Se true, permite seleção de range de datas */
9
+ allowRange?: boolean;
10
+ /** Placeholder para o input de data */
11
+ placeholder?: string;
12
+ }
13
+ export declare const DateSelector: ({ onDateChange, initialStartDate, initialEndDate, allowRange, placeholder, }: DateSelectorProps) => JSX.Element;
14
+ export default DateSelector;
@@ -0,0 +1,22 @@
1
+ export interface DownloadButtonProps {
2
+ /** URL do vídeo para download */
3
+ videoUrl: string;
4
+ /** Nome do arquivo para download */
5
+ fileName: string;
6
+ /** Contador de downloads */
7
+ downloadCount?: number;
8
+ /** Função assíncrona opcional que incrementa os downloads no servidor e retorna a nova contagem */
9
+ onDownloadIncrement?: () => Promise<number>;
10
+ /** Callback após download completado */
11
+ onDownloadComplete?: () => void;
12
+ /** Callback para atualizar contagem de downloads */
13
+ onDownloadChange?: (newCount: number) => void;
14
+ /** Callback em caso de erro */
15
+ onError?: (error: Error) => void;
16
+ /** Tamanho do botão */
17
+ size?: 'sm' | 'md' | 'lg';
18
+ /** Se true, mostra apenas o ícone */
19
+ iconOnly?: boolean;
20
+ }
21
+ export declare const DownloadButton: ({ videoUrl, fileName, downloadCount, onDownloadIncrement, onDownloadComplete, onDownloadChange, onError, size, iconOnly, }: DownloadButtonProps) => JSX.Element;
22
+ export default DownloadButton;
@@ -0,0 +1,14 @@
1
+ import { ReactNode } from 'react';
2
+
3
+ export interface EmptyStateProps {
4
+ icon?: ReactNode;
5
+ title: string;
6
+ description?: string;
7
+ action?: {
8
+ label: string;
9
+ onClick: () => void;
10
+ };
11
+ variant?: 'default' | 'error' | 'search';
12
+ }
13
+ export declare const EmptyState: ({ icon, title, description, action, variant }: EmptyStateProps) => JSX.Element;
14
+ export default EmptyState;
@@ -0,0 +1,16 @@
1
+ export interface LikeButtonProps {
2
+ /** Número inicial de curtidas */
3
+ initialLikes?: number;
4
+ /** Função assíncrona chamada para registrar a curtida e retornar a nova contagem */
5
+ onLike: () => Promise<number>;
6
+ /** Callback opcional chamado quando o like muda localmente */
7
+ onLikeChange?: (newCount: number) => void;
8
+ /** Tamanho do botão */
9
+ size?: 'sm' | 'md' | 'lg';
10
+ /** Se true, mostra apenas o ícone */
11
+ iconOnly?: boolean;
12
+ /** Se true, desabilita o botão */
13
+ disabled?: boolean;
14
+ }
15
+ export declare const LikeButton: ({ initialLikes, onLike, onLikeChange, size, iconOnly, disabled, }: LikeButtonProps) => JSX.Element;
16
+ export default LikeButton;
@@ -7,6 +7,7 @@ export interface ModalProps {
7
7
  children: ReactNode;
8
8
  footer?: ReactNode;
9
9
  size?: 'sm' | 'md' | 'lg' | 'xl';
10
+ closeOnOutsideClick?: boolean;
10
11
  }
11
- export declare function Modal({ isOpen, onClose, title, children, footer, size }: ModalProps): import("react").JSX.Element | null;
12
+ export declare function Modal({ isOpen, onClose, title, children, footer, size, closeOnOutsideClick }: ModalProps): import("react").JSX.Element | null;
12
13
  export default Modal;
@@ -0,0 +1,20 @@
1
+ import { InputHTMLAttributes } from 'react';
2
+
3
+ export interface SearchBarProps extends Omit<InputHTMLAttributes<HTMLInputElement>, 'onChange' | 'size'> {
4
+ /** Callback chamado quando o valor muda (com debounce) */
5
+ onSearch: (value: string) => void;
6
+ /** Tempo de debounce em ms */
7
+ debounceMs?: number;
8
+ /** Placeholder do input */
9
+ placeholder?: string;
10
+ /** Valor inicial */
11
+ initialValue?: string;
12
+ /** Se true, mostra botão de limpar */
13
+ showClear?: boolean;
14
+ /** Se true, foca automaticamente ao montar */
15
+ autoFocus?: boolean;
16
+ /** Tamanho do input */
17
+ size?: 'sm' | 'md' | 'lg';
18
+ }
19
+ export declare const SearchBar: ({ onSearch, debounceMs, placeholder, initialValue, showClear, autoFocus, size, className, ...props }: SearchBarProps) => JSX.Element;
20
+ export default SearchBar;
package/dist/index.d.ts CHANGED
@@ -3,3 +3,9 @@ export { Loading, type LoadingProps } from './components/Loading';
3
3
  export { IconButton, type IconButtonProps, type IconButtonVariant, type IconButtonSize } from './components/IconButton';
4
4
  export { Modal, type ModalProps } from './components/Modal';
5
5
  export { ConfirmDialog, type ConfirmDialogProps } from './components/ConfirmDialog';
6
+ export { EmptyState, type EmptyStateProps } from './components/EmptyState';
7
+ export { SearchBar, type SearchBarProps } from './components/SearchBar';
8
+ export { DatePicker, type DatePickerProps } from './components/DatePicker';
9
+ export { DateSelector, type DateSelectorProps } from './components/DateSelector';
10
+ export { LikeButton, type LikeButtonProps } from './components/LikeButton';
11
+ export { DownloadButton, type DownloadButtonProps } from './components/DownloadButton';