primus-react-ui 1.0.10 → 1.0.14

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
@@ -1,5 +1,6 @@
1
1
  import React$1, { ReactNode } from 'react';
2
2
  import * as react_jsx_runtime from 'react/jsx-runtime';
3
+ import { ChartType, ChartData, ChartOptions, ChartDataset } from 'chart.js';
3
4
 
4
5
  declare const AccountDashboard: React$1.FC<{
5
6
  apiUrl?: string;
@@ -101,7 +102,15 @@ interface PrimusLoginProps {
101
102
  declare function PrimusLogin({ onLogin, socialProviders, onSocialLogin, authEndpoint, showEmailLogin, title, subtitle, logo, theme: themeOverride, }: PrimusLoginProps): react_jsx_runtime.JSX.Element;
102
103
  declare const LoginPage: typeof PrimusLogin;
103
104
 
104
- declare const UserProfile: React$1.FC;
105
+ interface UserProfileProps {
106
+ user?: {
107
+ name: string;
108
+ email?: string;
109
+ };
110
+ showLogout?: boolean;
111
+ onLogout?: () => void;
112
+ }
113
+ declare const UserProfile: React$1.FC<UserProfileProps>;
105
114
 
106
115
  interface PrimusUser {
107
116
  id?: string;
@@ -198,13 +207,55 @@ declare function usePrimusTheme(): PrimusThemeContextValue;
198
207
  */
199
208
  declare function PrimusThemeToggle(): react_jsx_runtime.JSX.Element;
200
209
 
201
- declare const NotificationFeed: React$1.FC;
210
+ interface Notification$1 {
211
+ id: string;
212
+ title: string;
213
+ message: string;
214
+ type: 'info' | 'success' | 'warning' | 'error';
215
+ timestamp: string;
216
+ read: boolean;
217
+ }
218
+ interface UseNotificationsOptions {
219
+ apiUrl?: string;
220
+ useMock?: boolean;
221
+ mockData?: Notification$1[];
222
+ }
223
+ declare const useNotifications: ({ apiUrl, useMock, mockData }?: UseNotificationsOptions) => {
224
+ notifications: Notification$1[];
225
+ unreadCount: number;
226
+ loading: boolean;
227
+ markAsRead: (id: string) => void;
228
+ markAllAsRead: () => void;
229
+ refresh: () => Promise<void>;
230
+ };
202
231
 
232
+ interface PrimusNotificationFeedProps {
233
+ useMock?: boolean;
234
+ mockData?: Notification$1[];
235
+ apiUrl?: string;
236
+ className?: string;
237
+ }
238
+ declare const PrimusNotificationFeed: React$1.FC<PrimusNotificationFeedProps>;
239
+
240
+ interface Notification {
241
+ id: string;
242
+ title: string;
243
+ message: string;
244
+ type: 'info' | 'success' | 'warning' | 'error';
245
+ timestamp: string;
246
+ read: boolean;
247
+ }
203
248
  interface PrimusNotificationCenterProps {
204
249
  /** Override the theme from context (optional) */
205
250
  theme?: PrimusTheme;
206
251
  /** Custom API URL (optional) */
207
252
  apiUrl?: string;
253
+ /** Polling interval in ms */
254
+ pollInterval?: number;
255
+ /** Use mock data instead of API */
256
+ useMock?: boolean;
257
+ /** Mock notification list */
258
+ mockData?: Notification[];
208
259
  }
209
260
  /**
210
261
  * PrimusNotificationCenter - Enterprise Notification Component
@@ -227,27 +278,10 @@ interface PrimusNotificationCenterProps {
227
278
  * <PrimusNotificationCenter theme="light" />
228
279
  * ```
229
280
  */
230
- declare function PrimusNotificationCenter({ theme: themeOverride, apiUrl }: PrimusNotificationCenterProps): react_jsx_runtime.JSX.Element;
281
+ declare function PrimusNotificationCenter({ theme: themeOverride, apiUrl, pollInterval, useMock, mockData, }: PrimusNotificationCenterProps): react_jsx_runtime.JSX.Element;
231
282
  declare const NotificationBell: typeof PrimusNotificationCenter;
232
283
  declare const PrimusNotifications: typeof PrimusNotificationCenter;
233
284
 
234
- interface Notification {
235
- id: string;
236
- title: string;
237
- message: string;
238
- type: 'info' | 'success' | 'warning' | 'error';
239
- timestamp: string;
240
- read: boolean;
241
- }
242
- declare const useNotifications: (apiUrl?: string) => {
243
- notifications: Notification[];
244
- unreadCount: number;
245
- loading: boolean;
246
- markAsRead: (id: string) => void;
247
- markAllAsRead: () => void;
248
- refresh: () => Promise<void>;
249
- };
250
-
251
285
  interface PrimusNotification {
252
286
  id: string;
253
287
  title: string;
@@ -375,6 +409,8 @@ interface SidebarItem {
375
409
  label: string;
376
410
  icon?: React$1.ReactNode;
377
411
  href?: string;
412
+ route?: string;
413
+ target?: string;
378
414
  onClick?: () => void;
379
415
  active?: boolean;
380
416
  badge?: string | number;
@@ -444,8 +480,19 @@ interface PrimusDataTableProps<T> {
444
480
  searchPlaceholder?: string;
445
481
  /** Enable search */
446
482
  searchable?: boolean;
483
+ /** Enable client-side pagination */
484
+ paginated?: boolean;
485
+ /** Page size when paginated */
486
+ pageSize?: number;
487
+ /** Controlled page index */
488
+ pageIndex?: number;
489
+ /** Page change handler */
490
+ onPageChange?: (payload: {
491
+ pageIndex: number;
492
+ pageSize: number;
493
+ }) => void;
447
494
  }
448
- declare function PrimusDataTable<T extends Record<string, any>>({ data, columns, rowKey, loading, selectable, selectedKeys, onSelectionChange, onRowClick, actions, emptyMessage, searchPlaceholder, searchable, }: PrimusDataTableProps<T>): react_jsx_runtime.JSX.Element;
495
+ declare function PrimusDataTable<T extends Record<string, any>>({ data, columns, rowKey, loading, selectable, selectedKeys, onSelectionChange, onRowClick, actions, emptyMessage, searchPlaceholder, searchable, paginated, pageSize, pageIndex, onPageChange, }: PrimusDataTableProps<T>): react_jsx_runtime.JSX.Element;
449
496
 
450
497
  interface PrimusModalProps {
451
498
  open: boolean;
@@ -482,4 +529,282 @@ interface DashboardGridProps {
482
529
  }
483
530
  declare const DashboardGrid: React$1.FC<DashboardGridProps>;
484
531
 
485
- export { AICopilot, AccountDashboard, AgentDirectory, CheckoutForm, type CheckoutFormProps, ClaimStatusTracker, type ClaimStatusTrackerProps, type ClaimStep, type Column, type CreditCardProps, CreditCardVisual, CreditScoreCard, DashboardGrid, type DashboardGridProps, type Document, DocumentViewer, type DocumentViewerProps, type FeatureFlag, FeatureFlagToggle, FileUploader, FraudDetectionDashboard, KYCVerification, LoanCalculator, LogViewer, LoginPage, type Notification, NotificationBell, NotificationFeed, PolicyCard, type PolicyProps, PremiumCalculator, PrimusDashboard, type PrimusDashboardProps, PrimusDataTable, type PrimusDataTableProps, PrimusHeader, type PrimusHeaderProps, PrimusLayout, type PrimusLayoutProps, PrimusLogin, type PrimusLoginProps, PrimusModal, type PrimusModalProps, type PrimusNotification, PrimusNotificationCenter, PrimusNotifications, PrimusProvider, type PrimusProviderProps, PrimusSidebar, type PrimusSidebarProps, PrimusStatCard, type PrimusTheme, PrimusThemeProvider, PrimusThemeToggle, QuoteComparison, SecurityDashboard, type SidebarItem, type SocialProvider, type StatCardProps, type Transaction, TransactionHistory, type TransactionHistoryProps, type UseRealtimeNotificationsOptions, UserProfile, themeColors, useNotifications, usePrimusAuth, usePrimusTheme, useRealtimeNotifications };
532
+ interface PrimusActivityItem {
533
+ id?: string;
534
+ title: string;
535
+ description?: string;
536
+ timestamp?: string | Date;
537
+ status?: 'success' | 'warning' | 'error' | 'info';
538
+ }
539
+ interface PrimusActivityFeedProps {
540
+ items: PrimusActivityItem[];
541
+ maxItems?: number;
542
+ showTimestamps?: boolean;
543
+ groupByDate?: boolean;
544
+ loading?: boolean;
545
+ }
546
+ declare const PrimusActivityFeed: React$1.FC<PrimusActivityFeedProps>;
547
+
548
+ interface PrimusChartSeries {
549
+ name: string;
550
+ data: number[];
551
+ color?: string;
552
+ borderColor?: string;
553
+ backgroundColor?: string;
554
+ fill?: boolean;
555
+ }
556
+ interface PrimusChartBaseProps<TType extends ChartType = ChartType> {
557
+ type: TType;
558
+ data?: ChartData<TType>;
559
+ labels?: Array<string | number | Date>;
560
+ series?: PrimusChartSeries[];
561
+ options?: ChartOptions<TType>;
562
+ responsive?: boolean;
563
+ maintainAspectRatio?: boolean;
564
+ legend?: boolean;
565
+ height?: number;
566
+ width?: number;
567
+ ariaLabel?: string;
568
+ className?: string;
569
+ datasetTransform?: (dataset: ChartDataset<TType, number[]>) => ChartDataset<TType, number[]>;
570
+ }
571
+ declare const PrimusChartBase: <TType extends ChartType = ChartType>({ type, data, labels, series, options, responsive, maintainAspectRatio, legend, height, width, ariaLabel, className, datasetTransform, }: PrimusChartBaseProps<TType>) => react_jsx_runtime.JSX.Element;
572
+
573
+ type PrimusLineChartProps = Omit<PrimusChartBaseProps<'line'>, 'type' | 'datasetTransform'> & {
574
+ options?: ChartOptions<'line'>;
575
+ };
576
+ declare const PrimusLineChart: React$1.FC<PrimusLineChartProps>;
577
+
578
+ type PrimusAreaChartProps = Omit<PrimusChartBaseProps<'line'>, 'type' | 'datasetTransform'> & {
579
+ options?: ChartOptions<'line'>;
580
+ };
581
+ declare const PrimusAreaChart: React$1.FC<PrimusAreaChartProps>;
582
+
583
+ type PrimusBarChartProps = Omit<PrimusChartBaseProps<'bar'>, 'type' | 'datasetTransform'> & {
584
+ options?: ChartOptions<'bar'>;
585
+ stacked?: boolean;
586
+ };
587
+ declare const PrimusBarChart: React$1.FC<PrimusBarChartProps>;
588
+
589
+ type PrimusPieChartProps = Omit<PrimusChartBaseProps<'pie' | 'doughnut'>, 'type' | 'datasetTransform'> & {
590
+ donut?: boolean;
591
+ cutout?: string;
592
+ options?: ChartOptions<'pie' | 'doughnut'>;
593
+ };
594
+ declare const PrimusPieChart: React$1.FC<PrimusPieChartProps>;
595
+
596
+ interface PrimusSparklineProps {
597
+ series?: PrimusChartSeries[];
598
+ data?: number[];
599
+ type?: 'line' | 'area';
600
+ height?: number;
601
+ width?: number;
602
+ strokeWidth?: number;
603
+ className?: string;
604
+ ariaLabel?: string;
605
+ }
606
+ declare const PrimusSparkline: React$1.FC<PrimusSparklineProps>;
607
+
608
+ interface ButtonProps extends React$1.ButtonHTMLAttributes<HTMLButtonElement> {
609
+ variant?: 'primary' | 'secondary' | 'outline' | 'ghost';
610
+ size?: 'sm' | 'md' | 'lg';
611
+ color?: 'sapphire' | 'emerald' | 'ruby';
612
+ }
613
+ declare const Button: React$1.ForwardRefExoticComponent<ButtonProps & React$1.RefAttributes<HTMLButtonElement>>;
614
+
615
+ interface InputProps extends Omit<React$1.InputHTMLAttributes<HTMLInputElement>, 'size'> {
616
+ label?: string;
617
+ error?: string;
618
+ startIcon?: React$1.ReactNode;
619
+ endIcon?: React$1.ReactNode;
620
+ onClear?: () => void;
621
+ size?: 'sm' | 'md' | 'lg';
622
+ loading?: boolean;
623
+ }
624
+ declare const Input: React$1.ForwardRefExoticComponent<InputProps & React$1.RefAttributes<HTMLInputElement>>;
625
+
626
+ interface CheckboxProps extends Omit<React$1.InputHTMLAttributes<HTMLInputElement>, 'type'> {
627
+ label?: string;
628
+ error?: string;
629
+ }
630
+ declare const Checkbox: React$1.ForwardRefExoticComponent<CheckboxProps & React$1.RefAttributes<HTMLInputElement>>;
631
+
632
+ interface RadioGroupProps {
633
+ name: string;
634
+ options: Array<{
635
+ value: string;
636
+ label: string;
637
+ disabled?: boolean;
638
+ }>;
639
+ value?: string;
640
+ onChange?: (value: string) => void;
641
+ error?: string;
642
+ disabled?: boolean;
643
+ orientation?: 'horizontal' | 'vertical';
644
+ }
645
+ declare const RadioGroup: React$1.FC<RadioGroupProps>;
646
+
647
+ interface SelectOption {
648
+ value: string;
649
+ label: string;
650
+ disabled?: boolean;
651
+ }
652
+ interface SelectProps {
653
+ label?: string;
654
+ error?: string;
655
+ options: SelectOption[];
656
+ placeholder?: string;
657
+ value?: string | string[];
658
+ onChange?: (value: string | string[]) => void;
659
+ multiple?: boolean;
660
+ disabled?: boolean;
661
+ className?: string;
662
+ }
663
+ declare const Select: React$1.FC<SelectProps>;
664
+
665
+ interface ToggleProps {
666
+ checked?: boolean;
667
+ onChange?: (checked: boolean) => void;
668
+ disabled?: boolean;
669
+ label?: string;
670
+ size?: 'sm' | 'md' | 'lg';
671
+ }
672
+ declare const Toggle: React$1.FC<ToggleProps>;
673
+
674
+ interface TextareaProps extends React$1.TextareaHTMLAttributes<HTMLTextAreaElement> {
675
+ label?: string;
676
+ error?: string;
677
+ resize?: 'none' | 'vertical' | 'horizontal' | 'both';
678
+ }
679
+ declare const Textarea: React$1.ForwardRefExoticComponent<TextareaProps & React$1.RefAttributes<HTMLTextAreaElement>>;
680
+
681
+ interface CardProps extends React$1.HTMLAttributes<HTMLDivElement> {
682
+ variant?: 'default' | 'outlined' | 'elevated';
683
+ padding?: 'none' | 'sm' | 'md' | 'lg';
684
+ }
685
+ declare const Card: React$1.ForwardRefExoticComponent<CardProps & React$1.RefAttributes<HTMLDivElement>>;
686
+
687
+ interface BadgeProps extends React$1.HTMLAttributes<HTMLSpanElement> {
688
+ variant?: 'default' | 'success' | 'warning' | 'error' | 'info';
689
+ size?: 'sm' | 'md' | 'lg';
690
+ }
691
+ declare const Badge: React$1.ForwardRefExoticComponent<BadgeProps & React$1.RefAttributes<HTMLSpanElement>>;
692
+
693
+ interface TableColumn<T = any> {
694
+ key: string;
695
+ header: string;
696
+ render?: (item: T) => React$1.ReactNode;
697
+ width?: string;
698
+ }
699
+ interface TableProps<T = any> {
700
+ columns: TableColumn<T>[];
701
+ data: T[];
702
+ striped?: boolean;
703
+ hoverable?: boolean;
704
+ bordered?: boolean;
705
+ style?: React$1.CSSProperties;
706
+ }
707
+ declare function Table<T extends Record<string, any>>({ columns, data, striped, hoverable, bordered, style, }: TableProps<T>): react_jsx_runtime.JSX.Element;
708
+ declare namespace Table {
709
+ var displayName: string;
710
+ }
711
+
712
+ interface ContainerProps extends React$1.HTMLAttributes<HTMLDivElement> {
713
+ maxWidth?: 'sm' | 'md' | 'lg' | 'xl' | '2xl' | 'full';
714
+ padding?: 'none' | 'sm' | 'md' | 'lg';
715
+ }
716
+ declare const Container: React$1.ForwardRefExoticComponent<ContainerProps & React$1.RefAttributes<HTMLDivElement>>;
717
+
718
+ interface GridProps extends React$1.HTMLAttributes<HTMLDivElement> {
719
+ columns?: number;
720
+ rows?: number;
721
+ gap?: 'none' | 'sm' | 'md' | 'lg' | 'xl' | string;
722
+ width?: string;
723
+ height?: string;
724
+ responsive?: boolean;
725
+ }
726
+ declare const Grid: React$1.ForwardRefExoticComponent<GridProps & React$1.RefAttributes<HTMLDivElement>>;
727
+
728
+ interface StackProps extends React$1.HTMLAttributes<HTMLDivElement> {
729
+ direction?: 'horizontal' | 'vertical';
730
+ gap?: 'none' | 'sm' | 'md' | 'lg' | 'xl';
731
+ align?: 'start' | 'center' | 'end' | 'stretch';
732
+ justify?: 'start' | 'center' | 'end' | 'between' | 'around';
733
+ }
734
+ declare const Stack: React$1.ForwardRefExoticComponent<StackProps & React$1.RefAttributes<HTMLDivElement>>;
735
+
736
+ interface ModalProps {
737
+ isOpen: boolean;
738
+ onClose: () => void;
739
+ title?: string;
740
+ children: React$1.ReactNode;
741
+ size?: 'sm' | 'md' | 'lg' | 'xl';
742
+ closeOnOverlayClick?: boolean;
743
+ }
744
+ declare const Modal: React$1.FC<ModalProps>;
745
+
746
+ interface PrimusDateRangeOption {
747
+ label: string;
748
+ start: string | Date;
749
+ end: string | Date;
750
+ }
751
+ interface PrimusDateRangePickerProps {
752
+ startDate?: string | null;
753
+ endDate?: string | null;
754
+ ranges?: Array<string | PrimusDateRangeOption>;
755
+ min?: string;
756
+ max?: string;
757
+ disabled?: boolean;
758
+ onRangeChange?: (payload: {
759
+ startDate: string | null;
760
+ endDate: string | null;
761
+ label?: string;
762
+ }) => void;
763
+ }
764
+ declare const PrimusDateRangePicker: React$1.FC<PrimusDateRangePickerProps>;
765
+
766
+ type PrimusFilterType = 'select' | 'toggle' | 'search';
767
+ interface PrimusFilterConfig {
768
+ key: string;
769
+ label: string;
770
+ type: PrimusFilterType;
771
+ options?: Array<{
772
+ label: string;
773
+ value: string;
774
+ disabled?: boolean;
775
+ }>;
776
+ placeholder?: string;
777
+ }
778
+ interface PrimusFilterBarProps {
779
+ filters: PrimusFilterConfig[];
780
+ activeFilters: Record<string, any>;
781
+ onChange?: (nextFilters: Record<string, any>) => void;
782
+ children?: React$1.ReactNode;
783
+ }
784
+ declare const PrimusFilterBar: React$1.FC<PrimusFilterBarProps>;
785
+
786
+ interface PrimusExportMenuProps {
787
+ formats?: string[];
788
+ includeCharts?: boolean;
789
+ includeStats?: boolean;
790
+ includeTables?: boolean;
791
+ onExport?: (payload: {
792
+ format: string;
793
+ includeCharts: boolean;
794
+ includeStats: boolean;
795
+ includeTables: boolean;
796
+ }) => void;
797
+ }
798
+ declare const PrimusExportMenu: React$1.FC<PrimusExportMenuProps>;
799
+
800
+ interface PrimusSearchProps {
801
+ placeholder?: string;
802
+ debounce?: number;
803
+ value?: string;
804
+ showSuggestions?: boolean;
805
+ suggestions?: string[];
806
+ onSearch?: (value: string) => void;
807
+ }
808
+ declare const PrimusSearch: React$1.FC<PrimusSearchProps>;
809
+
810
+ export { AICopilot, AccountDashboard, AgentDirectory, Badge, Button, Card, Checkbox, CheckoutForm, type CheckoutFormProps, ClaimStatusTracker, type ClaimStatusTrackerProps, type ClaimStep, type Column, Container, type CreditCardProps, CreditCardVisual, CreditScoreCard, DashboardGrid, type DashboardGridProps, type Document, DocumentViewer, type DocumentViewerProps, type FeatureFlag, FeatureFlagToggle, FileUploader, FraudDetectionDashboard, Grid, Input, KYCVerification, LoanCalculator, LogViewer, LoginPage, Modal, type Notification$1 as Notification, NotificationBell, PrimusNotificationFeed as NotificationFeed, PolicyCard, type PolicyProps, PremiumCalculator, PrimusActivityFeed, type PrimusActivityFeedProps, type PrimusActivityItem, PrimusAreaChart, type PrimusAreaChartProps, Badge as PrimusBadge, PrimusBarChart, type PrimusBarChartProps, Button as PrimusButton, Card as PrimusCard, PrimusChartBase, type PrimusChartBaseProps, type PrimusChartSeries, Checkbox as PrimusCheckbox, Container as PrimusContainer, PrimusDashboard, type PrimusDashboardProps, PrimusDataTable, type PrimusDataTableProps, PrimusDateRangePicker, PrimusExportMenu, PrimusFilterBar, Grid as PrimusGrid, PrimusHeader, type PrimusHeaderProps, Input as PrimusInput, PrimusLayout, type PrimusLayoutProps, PrimusLineChart, type PrimusLineChartProps, PrimusLogin, type PrimusLoginProps, PrimusModal, Modal as PrimusModalComponent, type PrimusModalProps, type PrimusNotification, PrimusNotificationCenter, PrimusNotificationFeed, PrimusNotifications, PrimusPieChart, type PrimusPieChartProps, PrimusProvider, type PrimusProviderProps, RadioGroup as PrimusRadioGroup, PrimusSearch, Select as PrimusSelect, PrimusSidebar, type PrimusSidebarProps, PrimusSparkline, type PrimusSparklineProps, Stack as PrimusStack, PrimusStatCard, Table as PrimusTable, Textarea as PrimusTextarea, type PrimusTheme, PrimusThemeProvider, PrimusThemeToggle, Toggle as PrimusToggle, QuoteComparison, RadioGroup, SecurityDashboard, Select, type SidebarItem, type SocialProvider, Stack, type StatCardProps, Table, Textarea, Toggle, type Transaction, TransactionHistory, type TransactionHistoryProps, type UseNotificationsOptions, type UseRealtimeNotificationsOptions, UserProfile, type UserProfileProps, themeColors, useNotifications, usePrimusAuth, usePrimusTheme, useRealtimeNotifications };