analytica-frontend-lib 1.2.10 → 1.2.12

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.d.mts CHANGED
@@ -34,13 +34,14 @@ export { ThemeToggle } from './ThemeToggle/index.mjs';
34
34
  export { d as SubjectData, e as SubjectEnum, I as SubjectIconProps, S as SubjectInfo, b as getSubjectColorClass, a as getSubjectIcon, g as getSubjectInfo, c as getSubjectName } from './SubjectInfo-Dvt0OodP.mjs';
35
35
  export { c as ThemeActions, T as ThemeMode, b as ThemeState, a as ThemeStore, u as useThemeStore } from './themeStore-P2X64zC-.mjs';
36
36
  export { default as DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuSeparator, DropdownMenuTrigger, MenuLabel, ProfileMenuFooter, ProfileMenuHeader, ProfileMenuSection, ProfileMenuTrigger, ProfileToggleTheme } from './DropdownMenu/index.mjs';
37
- export { default as Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow, useTableSort } from './Table/index.mjs';
37
+ export { SortDirection, default as Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow, UseTableSortOptions, useTableSort } from './Table/index.mjs';
38
38
  export { default as Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from './Select/index.mjs';
39
39
  export { default as Menu, MenuContent, MenuItem, MenuOverflow } from './Menu/index.mjs';
40
40
  export { CardActivitiesResults, CardAudio, CardPerformance, CardProgress, CardQuestions, CardResults, CardSimulado, CardSimulationHistory, CardStatus, CardTest, CardTopic } from './Card/index.mjs';
41
41
  export { StatisticsCard } from './StatisticsCard/index.mjs';
42
42
  export { Skeleton, SkeletonCard, SkeletonCircle, SkeletonList, SkeletonRectangle, SkeletonRounded, SkeletonTable, SkeletonText } from './Skeleton/index.mjs';
43
43
  export { default as NotFound } from './NotFound/index.mjs';
44
+ export { default as NoSearchResult, NoSearchResultProps } from './NoSearchResult/index.mjs';
44
45
  export { default as VideoPlayer } from './VideoPlayer/index.mjs';
45
46
  export { default as Whiteboard } from './Whiteboard/index.mjs';
46
47
  export { default as DownloadButton, DownloadButtonProps, DownloadContent } from './DownloadButton/index.mjs';
@@ -182,7 +183,7 @@ declare const CheckboxListItem: react.ForwardRefExoticComponent<{
182
183
  state?: CheckboxListState;
183
184
  /** Additional CSS classes */
184
185
  className?: string;
185
- } & Omit<InputHTMLAttributes<HTMLInputElement>, "size" | "value" | "checked" | "type" | "name" | "onChange"> & react.RefAttributes<HTMLInputElement>>;
186
+ } & Omit<InputHTMLAttributes<HTMLInputElement>, "onChange" | "name" | "type" | "size" | "value" | "checked"> & react.RefAttributes<HTMLInputElement>>;
186
187
 
187
188
  type Item = {
188
189
  id: string;
@@ -453,6 +454,119 @@ declare const createNotificationsHook: (apiClient: NotificationApiClient) => ()
453
454
  }[];
454
455
  };
455
456
 
457
+ type FilterConfig = {
458
+ key: string;
459
+ label: string;
460
+ categories: CategoryConfig[];
461
+ };
462
+ type UseTableFilterOptions = {
463
+ syncWithUrl?: boolean;
464
+ };
465
+ type UseTableFilterReturn = {
466
+ filterConfigs: FilterConfig[];
467
+ activeFilters: Record<string, string[]>;
468
+ hasActiveFilters: boolean;
469
+ updateFilters: (configs: FilterConfig[]) => void;
470
+ applyFilters: () => void;
471
+ clearFilters: () => void;
472
+ };
473
+ /**
474
+ * Hook for managing table filters with URL synchronization
475
+ *
476
+ * @param initialConfigs - Initial filter configurations
477
+ * @param options - Hook options including URL sync
478
+ * @returns Filter state and management functions
479
+ *
480
+ * @example
481
+ * ```tsx
482
+ * const { filterConfigs, activeFilters, updateFilters, applyFilters } = useTableFilter(
483
+ * [
484
+ * {
485
+ * key: 'academic',
486
+ * label: 'Dados Acadêmicos',
487
+ * categories: [...]
488
+ * }
489
+ * ],
490
+ * { syncWithUrl: true }
491
+ * );
492
+ * ```
493
+ */
494
+ declare const useTableFilter: (initialConfigs: FilterConfig[], options?: UseTableFilterOptions) => UseTableFilterReturn;
495
+
496
+ type FilterModalProps = {
497
+ /**
498
+ * Controls modal visibility
499
+ */
500
+ isOpen: boolean;
501
+ /**
502
+ * Callback when modal should close
503
+ */
504
+ onClose: () => void;
505
+ /**
506
+ * Filter configurations with categories
507
+ */
508
+ filterConfigs: FilterConfig[];
509
+ /**
510
+ * Callback when filters change (temporary, before applying)
511
+ */
512
+ onFiltersChange: (configs: FilterConfig[]) => void;
513
+ /**
514
+ * Callback when "Aplicar" button is clicked
515
+ */
516
+ onApply: () => void;
517
+ /**
518
+ * Callback when "Limpar filtros" button is clicked
519
+ */
520
+ onClear: () => void;
521
+ /**
522
+ * Modal title
523
+ * @default "Filtros"
524
+ */
525
+ title?: string;
526
+ /**
527
+ * Modal size
528
+ * @default "md"
529
+ */
530
+ size?: 'xs' | 'sm' | 'md' | 'lg' | 'xl';
531
+ /**
532
+ * Apply button label
533
+ * @default "Aplicar"
534
+ */
535
+ applyLabel?: string;
536
+ /**
537
+ * Clear button label
538
+ * @default "Limpar filtros"
539
+ */
540
+ clearLabel?: string;
541
+ };
542
+ /**
543
+ * FilterModal component - A modal for table filtering with CheckboxGroup
544
+ *
545
+ * Integrates Modal, CheckboxGroup, and Button components to create a
546
+ * complete filtering interface. Works with useTableFilter hook for URL synchronization.
547
+ *
548
+ * @example
549
+ * ```tsx
550
+ * const { filterConfigs, updateFilters, applyFilters, clearFilters } = useTableFilter(
551
+ * initialConfigs,
552
+ * { syncWithUrl: true }
553
+ * );
554
+ *
555
+ * <FilterModal
556
+ * isOpen={isOpen}
557
+ * onClose={() => setIsOpen(false)}
558
+ * filterConfigs={filterConfigs}
559
+ * onFiltersChange={updateFilters}
560
+ * onApply={() => {
561
+ * applyFilters();
562
+ * setIsOpen(false);
563
+ * }}
564
+ * onClear={clearFilters}
565
+ * />
566
+ * ```
567
+ */
568
+ declare const FilterModal: ({ isOpen, onClose, filterConfigs, onFiltersChange, onApply, onClear, title, size, applyLabel, clearLabel, }: FilterModalProps) => react_jsx_runtime.JSX.Element;
569
+
456
570
  interface AccordionGroupProps extends HTMLAttributes<HTMLDivElement> {
457
571
  type?: 'single' | 'multiple';
458
572
  defaultValue?: string | string[];
@@ -677,4 +791,4 @@ declare const useAppStore: zustand.UseBoundStore<Omit<zustand.StoreApi<AppState>
677
791
  };
678
792
  }>;
679
793
 
680
- export { AccordionGroup, type AuthState, type CategoryConfig, CheckboxGroup, CheckboxList, CheckboxListItem, FetchNotificationsParams, ImageUpload, type ImageUploadProps, type Item, Notification, type NotificationActions, NotificationApiClient, NotificationEntityType, NotificationGroup, type NotificationState, type NotificationStore, NotificationType, Question, QuizAlternative, QuizConnectDots, QuizDissertative, QuizHeaderResult, QuizImageQuestion, QuizListResult, QuizListResultByMateria, QuizMultipleChoice, QuizResultHeaderTitle, QuizResultPerformance, QuizResultTitle, QuizTrueOrFalse, createNotificationStore, createNotificationsHook, createUseNotificationStore, createUseNotifications, formatTimeAgo, getStatusBadge, useAppContent, useAppInitialization, useAppStore, useAuthStore, useInstitutionId };
794
+ export { AccordionGroup, type AuthState, type CategoryConfig, CheckboxGroup, CheckboxList, CheckboxListItem, FetchNotificationsParams, type FilterConfig, FilterModal, type FilterModalProps, ImageUpload, type ImageUploadProps, type Item, Notification, type NotificationActions, NotificationApiClient, NotificationEntityType, NotificationGroup, type NotificationState, type NotificationStore, NotificationType, Question, QuizAlternative, QuizConnectDots, QuizDissertative, QuizHeaderResult, QuizImageQuestion, QuizListResult, QuizListResultByMateria, QuizMultipleChoice, QuizResultHeaderTitle, QuizResultPerformance, QuizResultTitle, QuizTrueOrFalse, type UseTableFilterOptions, type UseTableFilterReturn, createNotificationStore, createNotificationsHook, createUseNotificationStore, createUseNotifications, formatTimeAgo, getStatusBadge, useAppContent, useAppInitialization, useAppStore, useAuthStore, useInstitutionId, useTableFilter };
package/dist/index.d.ts CHANGED
@@ -34,13 +34,14 @@ export { ThemeToggle } from './ThemeToggle/index.js';
34
34
  export { d as SubjectData, e as SubjectEnum, I as SubjectIconProps, S as SubjectInfo, b as getSubjectColorClass, a as getSubjectIcon, g as getSubjectInfo, c as getSubjectName } from './SubjectInfo-Dvt0OodP.js';
35
35
  export { c as ThemeActions, T as ThemeMode, b as ThemeState, a as ThemeStore, u as useThemeStore } from './themeStore-P2X64zC-.js';
36
36
  export { default as DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuSeparator, DropdownMenuTrigger, MenuLabel, ProfileMenuFooter, ProfileMenuHeader, ProfileMenuSection, ProfileMenuTrigger, ProfileToggleTheme } from './DropdownMenu/index.js';
37
- export { default as Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow, useTableSort } from './Table/index.js';
37
+ export { SortDirection, default as Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow, UseTableSortOptions, useTableSort } from './Table/index.js';
38
38
  export { default as Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from './Select/index.js';
39
39
  export { default as Menu, MenuContent, MenuItem, MenuOverflow } from './Menu/index.js';
40
40
  export { CardActivitiesResults, CardAudio, CardPerformance, CardProgress, CardQuestions, CardResults, CardSimulado, CardSimulationHistory, CardStatus, CardTest, CardTopic } from './Card/index.js';
41
41
  export { StatisticsCard } from './StatisticsCard/index.js';
42
42
  export { Skeleton, SkeletonCard, SkeletonCircle, SkeletonList, SkeletonRectangle, SkeletonRounded, SkeletonTable, SkeletonText } from './Skeleton/index.js';
43
43
  export { default as NotFound } from './NotFound/index.js';
44
+ export { default as NoSearchResult, NoSearchResultProps } from './NoSearchResult/index.js';
44
45
  export { default as VideoPlayer } from './VideoPlayer/index.js';
45
46
  export { default as Whiteboard } from './Whiteboard/index.js';
46
47
  export { default as DownloadButton, DownloadButtonProps, DownloadContent } from './DownloadButton/index.js';
@@ -182,7 +183,7 @@ declare const CheckboxListItem: react.ForwardRefExoticComponent<{
182
183
  state?: CheckboxListState;
183
184
  /** Additional CSS classes */
184
185
  className?: string;
185
- } & Omit<InputHTMLAttributes<HTMLInputElement>, "size" | "value" | "checked" | "type" | "name" | "onChange"> & react.RefAttributes<HTMLInputElement>>;
186
+ } & Omit<InputHTMLAttributes<HTMLInputElement>, "onChange" | "name" | "type" | "size" | "value" | "checked"> & react.RefAttributes<HTMLInputElement>>;
186
187
 
187
188
  type Item = {
188
189
  id: string;
@@ -453,6 +454,119 @@ declare const createNotificationsHook: (apiClient: NotificationApiClient) => ()
453
454
  }[];
454
455
  };
455
456
 
457
+ type FilterConfig = {
458
+ key: string;
459
+ label: string;
460
+ categories: CategoryConfig[];
461
+ };
462
+ type UseTableFilterOptions = {
463
+ syncWithUrl?: boolean;
464
+ };
465
+ type UseTableFilterReturn = {
466
+ filterConfigs: FilterConfig[];
467
+ activeFilters: Record<string, string[]>;
468
+ hasActiveFilters: boolean;
469
+ updateFilters: (configs: FilterConfig[]) => void;
470
+ applyFilters: () => void;
471
+ clearFilters: () => void;
472
+ };
473
+ /**
474
+ * Hook for managing table filters with URL synchronization
475
+ *
476
+ * @param initialConfigs - Initial filter configurations
477
+ * @param options - Hook options including URL sync
478
+ * @returns Filter state and management functions
479
+ *
480
+ * @example
481
+ * ```tsx
482
+ * const { filterConfigs, activeFilters, updateFilters, applyFilters } = useTableFilter(
483
+ * [
484
+ * {
485
+ * key: 'academic',
486
+ * label: 'Dados Acadêmicos',
487
+ * categories: [...]
488
+ * }
489
+ * ],
490
+ * { syncWithUrl: true }
491
+ * );
492
+ * ```
493
+ */
494
+ declare const useTableFilter: (initialConfigs: FilterConfig[], options?: UseTableFilterOptions) => UseTableFilterReturn;
495
+
496
+ type FilterModalProps = {
497
+ /**
498
+ * Controls modal visibility
499
+ */
500
+ isOpen: boolean;
501
+ /**
502
+ * Callback when modal should close
503
+ */
504
+ onClose: () => void;
505
+ /**
506
+ * Filter configurations with categories
507
+ */
508
+ filterConfigs: FilterConfig[];
509
+ /**
510
+ * Callback when filters change (temporary, before applying)
511
+ */
512
+ onFiltersChange: (configs: FilterConfig[]) => void;
513
+ /**
514
+ * Callback when "Aplicar" button is clicked
515
+ */
516
+ onApply: () => void;
517
+ /**
518
+ * Callback when "Limpar filtros" button is clicked
519
+ */
520
+ onClear: () => void;
521
+ /**
522
+ * Modal title
523
+ * @default "Filtros"
524
+ */
525
+ title?: string;
526
+ /**
527
+ * Modal size
528
+ * @default "md"
529
+ */
530
+ size?: 'xs' | 'sm' | 'md' | 'lg' | 'xl';
531
+ /**
532
+ * Apply button label
533
+ * @default "Aplicar"
534
+ */
535
+ applyLabel?: string;
536
+ /**
537
+ * Clear button label
538
+ * @default "Limpar filtros"
539
+ */
540
+ clearLabel?: string;
541
+ };
542
+ /**
543
+ * FilterModal component - A modal for table filtering with CheckboxGroup
544
+ *
545
+ * Integrates Modal, CheckboxGroup, and Button components to create a
546
+ * complete filtering interface. Works with useTableFilter hook for URL synchronization.
547
+ *
548
+ * @example
549
+ * ```tsx
550
+ * const { filterConfigs, updateFilters, applyFilters, clearFilters } = useTableFilter(
551
+ * initialConfigs,
552
+ * { syncWithUrl: true }
553
+ * );
554
+ *
555
+ * <FilterModal
556
+ * isOpen={isOpen}
557
+ * onClose={() => setIsOpen(false)}
558
+ * filterConfigs={filterConfigs}
559
+ * onFiltersChange={updateFilters}
560
+ * onApply={() => {
561
+ * applyFilters();
562
+ * setIsOpen(false);
563
+ * }}
564
+ * onClear={clearFilters}
565
+ * />
566
+ * ```
567
+ */
568
+ declare const FilterModal: ({ isOpen, onClose, filterConfigs, onFiltersChange, onApply, onClear, title, size, applyLabel, clearLabel, }: FilterModalProps) => react_jsx_runtime.JSX.Element;
569
+
456
570
  interface AccordionGroupProps extends HTMLAttributes<HTMLDivElement> {
457
571
  type?: 'single' | 'multiple';
458
572
  defaultValue?: string | string[];
@@ -677,4 +791,4 @@ declare const useAppStore: zustand.UseBoundStore<Omit<zustand.StoreApi<AppState>
677
791
  };
678
792
  }>;
679
793
 
680
- export { AccordionGroup, type AuthState, type CategoryConfig, CheckboxGroup, CheckboxList, CheckboxListItem, FetchNotificationsParams, ImageUpload, type ImageUploadProps, type Item, Notification, type NotificationActions, NotificationApiClient, NotificationEntityType, NotificationGroup, type NotificationState, type NotificationStore, NotificationType, Question, QuizAlternative, QuizConnectDots, QuizDissertative, QuizHeaderResult, QuizImageQuestion, QuizListResult, QuizListResultByMateria, QuizMultipleChoice, QuizResultHeaderTitle, QuizResultPerformance, QuizResultTitle, QuizTrueOrFalse, createNotificationStore, createNotificationsHook, createUseNotificationStore, createUseNotifications, formatTimeAgo, getStatusBadge, useAppContent, useAppInitialization, useAppStore, useAuthStore, useInstitutionId };
794
+ export { AccordionGroup, type AuthState, type CategoryConfig, CheckboxGroup, CheckboxList, CheckboxListItem, FetchNotificationsParams, type FilterConfig, FilterModal, type FilterModalProps, ImageUpload, type ImageUploadProps, type Item, Notification, type NotificationActions, NotificationApiClient, NotificationEntityType, NotificationGroup, type NotificationState, type NotificationStore, NotificationType, Question, QuizAlternative, QuizConnectDots, QuizDissertative, QuizHeaderResult, QuizImageQuestion, QuizListResult, QuizListResultByMateria, QuizMultipleChoice, QuizResultHeaderTitle, QuizResultPerformance, QuizResultTitle, QuizTrueOrFalse, type UseTableFilterOptions, type UseTableFilterReturn, createNotificationStore, createNotificationsHook, createUseNotificationStore, createUseNotifications, formatTimeAgo, getStatusBadge, useAppContent, useAppInitialization, useAppStore, useAuthStore, useInstitutionId, useTableFilter };