@mahatisystems/mahati-ui-components 4.6.0 → 5.0.0

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.
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
package/dist/index.d.mts CHANGED
@@ -1,4 +1,4 @@
1
- import * as _emotion_react_jsx_runtime from '@emotion/react/jsx-runtime';
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
2
  import * as React from 'react';
3
3
  import React__default from 'react';
4
4
  import { ChartData } from 'chart.js';
@@ -11,7 +11,7 @@ interface AccordionProps {
11
11
  headerTestId?: string;
12
12
  contentTestId?: string;
13
13
  }
14
- declare function Accordion({ title, children, defaultOpen, accordionTestId, headerTestId, contentTestId, }: AccordionProps): _emotion_react_jsx_runtime.JSX.Element;
14
+ declare function Accordion({ title, children, defaultOpen, accordionTestId, headerTestId, contentTestId, }: AccordionProps): react_jsx_runtime.JSX.Element;
15
15
  declare namespace Accordion {
16
16
  var displayName: string;
17
17
  }
@@ -20,13 +20,7 @@ interface IconButtonGroupProps extends React__default.HTMLAttributes<HTMLDivElem
20
20
  direction?: "row" | "col";
21
21
  gapClass?: string;
22
22
  }
23
- /**
24
- * IconButtonGroup - Groups icon buttons with consistent spacing
25
- */
26
23
  declare const IconButtonGroup: React__default.ForwardRefExoticComponent<IconButtonGroupProps & React__default.RefAttributes<HTMLDivElement>>;
27
- /**
28
- * ButtonBase - Main button component
29
- */
30
24
  declare const ButtonBase: any;
31
25
  type ButtonWithGroup = typeof ButtonBase & {
32
26
  IconButtonGroup: typeof IconButtonGroup;
@@ -62,7 +56,7 @@ type MahatiModalProps = {
62
56
  headerIcon?: React.ReactNode;
63
57
  showDivider?: boolean;
64
58
  };
65
- declare function Modal({ testId, isOpen, onClose, title, subtitle, children, className, width: customWidth, height, margin, primaryAction, secondaryAction, headerIcon, showDivider, position, size, }: MahatiModalProps): _emotion_react_jsx_runtime.JSX.Element | null;
59
+ declare function Modal({ testId, isOpen, onClose, title, subtitle, children, className, width: customWidth, height, margin, primaryAction, secondaryAction, headerIcon, showDivider, position, size, }: MahatiModalProps): react_jsx_runtime.JSX.Element | null;
66
60
  declare namespace Modal {
67
61
  var displayName: string;
68
62
  }
@@ -75,7 +69,7 @@ interface FormContainerProps {
75
69
  testId?: string;
76
70
  }
77
71
  declare const FormContainer: {
78
- ({ children, onSubmit, style, testId, className }: FormContainerProps): _emotion_react_jsx_runtime.JSX.Element;
72
+ ({ children, onSubmit, style, testId, className, }: FormContainerProps): react_jsx_runtime.JSX.Element;
79
73
  displayName: string;
80
74
  };
81
75
 
@@ -135,7 +129,7 @@ interface CalendarProps {
135
129
  };
136
130
  }
137
131
  declare const Calendar: {
138
- ({ calendartestId, value, onChange, enableRangeSelection, rangeValue, onRangeChange, enableTimeSelection, timeValue, onTimeChange, showTimeFormatToggle, timeFormat, onTimeFormatChange, autoHide, showTodayButton, showClearButton, placeholder, className, disabled, onShow, onHide, icon, showIcon, size, enableYearDropdown, showDateFormatSelector, dateFormat, onDateFormatChange, showTimeZoneSelector, timeZoneFormat, onTimeZoneFormatChange, blockDateConfig, previewTextStyles, globalTypography }: CalendarProps): _emotion_react_jsx_runtime.JSX.Element;
132
+ ({ calendartestId, value, onChange, enableRangeSelection, rangeValue, onRangeChange, enableTimeSelection, timeValue, onTimeChange, showTimeFormatToggle, timeFormat, onTimeFormatChange, autoHide, showTodayButton, showClearButton, placeholder, className, disabled, onShow, onHide, icon, showIcon, size, enableYearDropdown, showDateFormatSelector, dateFormat, onDateFormatChange, showTimeZoneSelector, timeZoneFormat, onTimeZoneFormatChange, blockDateConfig, previewTextStyles, globalTypography }: CalendarProps): react_jsx_runtime.JSX.Element;
139
133
  displayName: string;
140
134
  };
141
135
 
@@ -180,25 +174,24 @@ interface FilterProps {
180
174
  statusOptions?: SelectOption[];
181
175
  searchPlaceholder?: string;
182
176
  testId?: string;
183
- size?: any;
184
177
  }
185
178
  declare const Filter$1: {
186
- ({ onApply, onReset, activityOptions, statusOptions, searchPlaceholder, size, testId }: FilterProps): _emotion_react_jsx_runtime.JSX.Element;
179
+ ({ onApply, onReset, activityOptions, statusOptions, searchPlaceholder, testId, }: FilterProps): react_jsx_runtime.JSX.Element;
187
180
  displayName: string;
188
181
  };
189
- /** MAHATI ACTIVITY */
182
+ /** ================= MAHATI ACTIVITY ================= */
190
183
  declare const MahatiActivity: {
191
- ({ value, onChange, options, size, testId }: MahatiActivityProps): _emotion_react_jsx_runtime.JSX.Element;
184
+ ({ value, onChange, options, size, testId, }: MahatiActivityProps): react_jsx_runtime.JSX.Element;
192
185
  displayName: string;
193
186
  };
194
- /** MAHATI STATUS */
187
+ /** ================= MAHATI STATUS ================= */
195
188
  declare const MahatiStatus: {
196
- ({ value, onChange, options, size, testId, }: MahatiStatusProps): _emotion_react_jsx_runtime.JSX.Element;
189
+ ({ value, onChange, options, size, testId, }: MahatiStatusProps): react_jsx_runtime.JSX.Element;
197
190
  displayName: string;
198
191
  };
199
- /** MAHATI SEARCH */
192
+ /** ================= MAHATI SEARCH ================= */
200
193
  declare const MahatiSearch: {
201
- ({ value, onChange, placeholder, size, testId }: MahatiSearchProps): _emotion_react_jsx_runtime.JSX.Element;
194
+ ({ value, onChange, placeholder, size, testId, }: MahatiSearchProps): react_jsx_runtime.JSX.Element;
202
195
  displayName: string;
203
196
  };
204
197
 
@@ -246,7 +239,7 @@ interface DropdownProps {
246
239
  testId?: string;
247
240
  }
248
241
  declare const Dropdown: {
249
- ({ options, value, onSelect, variant, className, placeholder, disabled, testId }: DropdownProps): _emotion_react_jsx_runtime.JSX.Element;
242
+ ({ options, value, onSelect, variant, className, placeholder, disabled, testId }: DropdownProps): react_jsx_runtime.JSX.Element;
250
243
  displayName: string;
251
244
  };
252
245
 
@@ -285,67 +278,95 @@ interface TableProps {
285
278
  textWrapMaxLength?: number;
286
279
  textWrapColumnMaxLengths?: Record<string, number>;
287
280
  }
288
- declare const Table: {
289
- ({ headers, data, page, setPage, limit, setLimit, totalCount, highlightRowColor, actions, paginationRequired, paginationPosition, onDownloadPDF, onDownloadExcel, searchable, searchTerm, onResetSearch, onSearch, searchModeOptions, summary, summaryKey, summaryTitleField, summaryColumn, summaryColumnKey, summaryColumnMaxLength, textWrapColumns, textWrapMaxLength, textWrapColumnMaxLengths, tableTestId, }: TableProps): any;
290
- displayName: string;
291
- };
281
+ declare const Table: ({ headers, data, page, setPage, limit, setLimit, totalCount, highlightRowColor, actions, paginationRequired, paginationPosition, onDownloadPDF, onDownloadExcel, searchable, searchTerm, onResetSearch, onSearch, searchModeOptions, summary, summaryKey, summaryTitleField, summaryColumn, summaryColumnKey, summaryColumnMaxLength, textWrapColumns, textWrapMaxLength, textWrapColumnMaxLengths, tableTestId, }: TableProps) => react_jsx_runtime.JSX.Element;
292
282
 
293
283
  type BaseTableProps = React__default.ComponentProps<typeof Table>;
294
284
  type BaseTabProps = React__default.ComponentProps<typeof TabbedInterface>;
295
285
  type AllowedTabProps = Omit<BaseTabProps, "tabs" | "onTabChange" | "draggableTabs" | "onReorderTabs" | "onCloseTab">;
296
286
  interface TableWithTabProps<RowType extends Record<string, any>> {
297
- /**
298
- * Props that describe how the table should look.
299
- * We reuse the Table's interface, but here we only require headers + data.
300
- */
301
287
  tableProps: Pick<BaseTableProps, "headers" | "data">;
302
- /**
303
- * Props that describe how the tab container should look.
304
- * We reuse TabbedInterface's props but we control tabs & tab state.
305
- */
306
288
  tabProps?: AllowedTabProps;
307
- /**
308
- * If true, user can rearrange tabs by dragging.
309
- * If false/undefined, tabs cannot be rearranged.
310
- */
311
289
  rearrange?: boolean;
312
- /**
313
- * Optional custom row id. Defaults to the row index.
314
- */
315
290
  getRowId?: (row: RowType, index: number) => string | number;
316
- /**
317
- * Optional custom content renderer for the tab body.
318
- * If not provided, a simple key/value layout is shown.
319
- */
320
291
  renderTabContent?: (row: RowType) => React__default.ReactNode;
321
- /**
322
- * Optional callback when a row is opened as a tab.
323
- */
324
292
  onRowOpenInTab?: (row: RowType) => void;
325
- /**
326
- * Optional title/description displayed above the table.
327
- */
328
293
  title?: string;
329
294
  description?: string;
330
295
  testId?: string;
331
- /**
332
- * Key of the column to use as the tab header label.
333
- * For example: "name", "email", "policyNumber", etc.
334
- * If not provided, the first column in headers is used.
335
- */
336
296
  tabLabelKey?: string;
337
- /**
338
- * Optional font configuration for the section title/description.
339
- * Values like "sans", "serif", "mono", "Poppins", or a custom font name.
340
- */
341
297
  sectionTitleFont?: string;
342
298
  sectionDescriptionFont?: string;
343
299
  }
344
- declare function TableWithTab<RowType extends Record<string, any>>({ tableProps, tabProps, rearrange, getRowId, renderTabContent, onRowOpenInTab, title, description, tabLabelKey, sectionTitleFont, sectionDescriptionFont, testId }: TableWithTabProps<RowType>): _emotion_react_jsx_runtime.JSX.Element;
300
+ declare function TableWithTab<RowType extends Record<string, any>>({ tableProps, tabProps, rearrange, getRowId, renderTabContent, onRowOpenInTab, title, description, tabLabelKey, sectionTitleFont, sectionDescriptionFont, testId, }: TableWithTabProps<RowType>): react_jsx_runtime.JSX.Element;
345
301
  declare namespace TableWithTab {
346
302
  var displayName: string;
347
303
  }
348
304
 
305
+ interface LollipopData {
306
+ title: string;
307
+ [year: string]: any;
308
+ }
309
+
310
+ interface ColumnChartYAxisConfig {
311
+ min: number;
312
+ max: number;
313
+ step: number;
314
+ labels: number[];
315
+ }
316
+ interface ColumnChartData {
317
+ title: string;
318
+ yAxis?: Record<string, ColumnChartYAxisConfig>;
319
+ [year: string]: string | Record<string, any> | undefined;
320
+ }
321
+
322
+ interface KPIChartData {
323
+ title: string;
324
+ value: string;
325
+ change?: number;
326
+ timeLabel: string;
327
+ timePeriod: string;
328
+ data: number[];
329
+ labels?: string[];
330
+ timePeriods?: string[];
331
+ timestamps?: string[];
332
+ }
333
+
334
+ interface GroupBarLegendItem {
335
+ key: string;
336
+ label: string;
337
+ color: string;
338
+ }
339
+ interface GroupBarChartYAxisConfig {
340
+ min: number;
341
+ max: number;
342
+ step: number;
343
+ labels: number[];
344
+ }
345
+ interface GroupBarChartData {
346
+ title: string;
347
+ legends?: GroupBarLegendItem[];
348
+ yAxis?: Record<string, GroupBarChartYAxisConfig>;
349
+ [year: string]: string | Record<string, any> | undefined;
350
+ }
351
+
352
+ interface StackBarLegendItem {
353
+ key: string;
354
+ label: string;
355
+ color: string;
356
+ }
357
+ interface StackBarChartYAxisConfig {
358
+ min: number;
359
+ max: number;
360
+ step: number;
361
+ labels: number[];
362
+ }
363
+ interface StackBarChartData {
364
+ title: string;
365
+ legends?: StackBarLegendItem[];
366
+ yAxis?: Record<string, StackBarChartYAxisConfig>;
367
+ [year: string]: string | Record<string, any> | undefined;
368
+ }
369
+
349
370
  interface BulletItem {
350
371
  name: string;
351
372
  achieved: number;
@@ -365,7 +386,7 @@ interface GaugeItem {
365
386
  interface GaugeData {
366
387
  title: string;
367
388
  gauges: GaugeItem[];
368
- [year: string]: any;
389
+ [key: string]: any;
369
390
  }
370
391
 
371
392
  interface HorizontalBarData {
@@ -418,7 +439,7 @@ interface HeatmapData {
418
439
  project?: string;
419
440
  }
420
441
 
421
- type ChartType = "pie" | "doughnut" | "line" | "area" | "bar" | "bullet" | "gauge" | "gantt" | "calendarheatmap" | "horizontalbar";
442
+ type ChartType = "pie" | "doughnut" | "line" | "area" | "bar" | "bullet" | "gauge" | "gantt" | "calendarheatmap" | "horizontalbar" | "columnchart" | "groupbar" | "lollipop" | "kpi" | "riskgauge" | "stackbar";
422
443
  interface Filter {
423
444
  id: string;
424
445
  label: string;
@@ -433,8 +454,15 @@ interface ChartFiltersConfig {
433
454
  bullet?: Filter[];
434
455
  gauge?: Filter[];
435
456
  gantt?: Filter[];
457
+ heatmap?: Filter[];
436
458
  calendarheatmap?: Filter[];
437
459
  horizontalbar?: Filter[];
460
+ columnchart?: Filter[];
461
+ groupbar?: Filter[];
462
+ stackbar?: Filter[];
463
+ lollipop?: Filter[];
464
+ kpi?: Filter[];
465
+ riskgauge?: Filter[];
438
466
  }
439
467
  interface DetailItem {
440
468
  label: string;
@@ -454,6 +482,12 @@ interface MahatiChartAnalyticsWidgetProps {
454
482
  bulletData?: BulletData;
455
483
  gaugeData?: GaugeData;
456
484
  horizontalBarData?: HorizontalBarData;
485
+ columnChartData?: ColumnChartData;
486
+ groupBarData?: GroupBarChartData;
487
+ stackBarData?: StackBarChartData;
488
+ lollipopData?: LollipopData;
489
+ kpiData?: Record<string, KPIChartData>;
490
+ riskGaugeData?: any;
457
491
  ganttData?: Record<string, Record<string, GanttData>>;
458
492
  heatmapData?: Record<string, HeatmapData>;
459
493
  calendarheatmapData?: Record<string, any>;
@@ -479,7 +513,7 @@ interface MahatiChartAnalyticsWidgetProps {
479
513
  }[];
480
514
  }
481
515
  declare const MahatiChartAnalyticsWidget: {
482
- ({ title, chartTypes, initialChartType, filters, chartFilters, selectedFilters, chartDataMap, bulletData, gaugeData, horizontalBarData, ganttData, heatmapData, calendarheatmapData, onApplyFilters, quickStats, actionButtons, onChartTypeChange, onFiltersChange, details, }: MahatiChartAnalyticsWidgetProps): _emotion_react_jsx_runtime.JSX.Element;
516
+ ({ title, chartTypes, initialChartType, filters, chartFilters, selectedFilters, chartDataMap, bulletData, gaugeData, horizontalBarData, columnChartData, groupBarData, stackBarData, lollipopData, kpiData, riskGaugeData, ganttData, heatmapData, calendarheatmapData, onApplyFilters, quickStats, actionButtons, onChartTypeChange, onFiltersChange, details, }: MahatiChartAnalyticsWidgetProps): react_jsx_runtime.JSX.Element;
483
517
  displayName: string;
484
518
  };
485
519
 
@@ -573,7 +607,7 @@ interface ToastMessageProps extends React__default.HTMLAttributes<HTMLDivElement
573
607
  }
574
608
  declare const ToastMessage: React__default.ForwardRefExoticComponent<ToastMessageProps & React__default.RefAttributes<HTMLDivElement>>;
575
609
 
576
- interface ConfettiExplosionProps {
610
+ interface ConfettiExplosionProps$1 {
577
611
  isActive: boolean;
578
612
  particleCount?: number;
579
613
  duration?: number;
@@ -583,18 +617,19 @@ interface ConfettiExplosionProps {
583
617
  stageHeight?: number;
584
618
  testId?: string;
585
619
  }
586
- declare const ConfettiExplosion: React__default.FC<ConfettiExplosionProps>;
620
+ declare const ConfettiExplosion: React__default.FC<ConfettiExplosionProps$1>;
587
621
 
588
- interface RealisticConfettiProps {
589
- isActive?: boolean;
622
+ interface ConfettiExplosionProps {
623
+ isActive: boolean;
590
624
  particleCount?: number;
591
625
  duration?: number;
592
626
  colors?: string[];
593
- explosionForce?: number;
594
- wind?: number;
627
+ force?: number;
628
+ particleSize?: number;
629
+ stageHeight?: number;
595
630
  testId?: string;
596
631
  }
597
- declare const RealisticConfetti: React__default.FC<RealisticConfettiProps>;
632
+ declare const RealisticConfetti: React__default.FC<ConfettiExplosionProps>;
598
633
 
599
634
  interface SpinnerProps {
600
635
  size?: number;
@@ -605,7 +640,7 @@ interface SpinnerProps {
605
640
  speed?: number;
606
641
  testId?: string;
607
642
  }
608
- declare const Spinner: ({ size, testId, borderWidth, borderRadius, primaryColor, backgroundColor, speed }: SpinnerProps) => any;
643
+ declare const Spinner: ({ size, borderWidth, borderRadius, primaryColor, backgroundColor, speed, testId, }: SpinnerProps) => any;
609
644
  interface CircularSpinnerProps {
610
645
  size?: number;
611
646
  color?: string;
@@ -624,7 +659,7 @@ interface CardOverlayLoaderProps {
624
659
  label?: string;
625
660
  testId?: string;
626
661
  }
627
- declare const CardOverlayLoader: ({ show, testId, spinnerSize, spinnerBorderWidth, spinnerPrimary, spinnerTrack, backdrop, label }: CardOverlayLoaderProps) => any;
662
+ declare const CardOverlayLoader: ({ show, spinnerSize, spinnerBorderWidth, spinnerPrimary, spinnerTrack, backdrop, label, testId, }: CardOverlayLoaderProps) => any;
628
663
  interface LoadingDotsProps {
629
664
  size?: number;
630
665
  color?: string;
@@ -642,7 +677,7 @@ interface LoadingDotsLinearProps {
642
677
  count?: number;
643
678
  testId?: string;
644
679
  }
645
- declare const LoadingDotsLinear: ({ size, color, gap, speed, count, testId }: LoadingDotsLinearProps) => any;
680
+ declare const LoadingDotsLinear: ({ size, color, gap, speed, count, testId, }: LoadingDotsLinearProps) => any;
646
681
  interface CardWithLoadingProps {
647
682
  loading?: boolean;
648
683
  imageUrl?: string;
@@ -650,9 +685,9 @@ interface CardWithLoadingProps {
650
685
  content?: string;
651
686
  testId?: string;
652
687
  }
653
- declare const CardWithLoading: ({ loading, testId, imageUrl, title, content, }: CardWithLoadingProps) => any;
688
+ declare const CardWithLoading: ({ loading, imageUrl, title, content, testId, }: CardWithLoadingProps) => any;
654
689
 
655
- declare function SearchableDropdown({ label, options, value, onChange, placeholder, testId }: any): _emotion_react_jsx_runtime.JSX.Element;
690
+ declare function SearchableDropdown({ label, options, value, onChange, placeholder, testId }: any): react_jsx_runtime.JSX.Element;
656
691
 
657
692
  type IconSet = {
658
693
  play: string;
@@ -666,7 +701,7 @@ type IconSet = {
666
701
  };
667
702
  declare const TexttoAudio: ({ icons }: {
668
703
  icons?: IconSet;
669
- }) => _emotion_react_jsx_runtime.JSX.Element;
704
+ }) => react_jsx_runtime.JSX.Element;
670
705
 
671
706
  declare const MahatiLocationAccessModal: ({ isOpen, onClose, title, description, image, allowText, denyText, onAllow, onDeny, testId, }: any) => any;
672
707
  interface MahatiCameraAccessModalProps {
@@ -744,6 +779,6 @@ interface MahatiNotificationCardProps {
744
779
  onSecondaryAction?: () => void;
745
780
  onClose?: () => void;
746
781
  }
747
- declare const MahatiNotificationCard: ({ title, testId, description, time, iconSrc, avatarSrc, badgeIconSrc, badgeType, primaryActionText, onPrimaryAction, secondaryActionText, onSecondaryAction, onClose, }: MahatiNotificationCardProps) => _emotion_react_jsx_runtime.JSX.Element;
782
+ declare const MahatiNotificationCard: ({ title, testId, description, time, iconSrc, avatarSrc, badgeIconSrc, badgeType, primaryActionText, onPrimaryAction, secondaryActionText, onSecondaryAction, onClose, }: MahatiNotificationCardProps) => react_jsx_runtime.JSX.Element;
748
783
 
749
784
  export { Accordion, type AccordionProps, type CalendarDate, type CalendarDateRange, type CalendarProps, type CalendarTime, CardOverlayLoader, CardWithLoading, CircularSpinner, DEFAULT_ACTIVITY_OPTIONS, DEFAULT_STATUS_OPTIONS, type FieldSize, Filter$1 as Filter, type FilterValues, LoadingDots, LoadingDotsLinear, MahatiActivity, type MahatiActivityProps, Button as MahatiButton, Calendar as MahatiCalendar, MahatiCameraAccessModal, Card as MahatiCard, MahatiChartAnalyticsWidget, ConfettiExplosion as MahatiConfettiExplosion, Dropdown as MahatiDropdown, FormContainer as MahatiFormContainer, Input as MahatiInput, MahatiLocationAccessModal, MahatiMicrophoneAccessModal, Modal as MahatiModal, MahatiNotificationCard, MahatiPromotionModal as MahatiPromotionModal_V1, MahatiPromotionModalV2Modal as MahatiPromotionModal_V2, MahatiPromotionModalV3Modal as MahatiPromotionModal_V3, RealisticConfetti as MahatiRealisticConfetti, MahatiSearch, type MahatiSearchProps, SearchableDropdown as MahatiSearchableDropdown, MahatiStatus, type MahatiStatusProps, TabbedInterface as MahatiTabbedInterface, Table as MahatiTable, TableWithTab as MahatiTableWithTab, TexttoAudio as MahatiTexttoAudio, ToastMessage as MahatiToastMessage, Tooltip as MahatiTooltip, type SelectOption, Spinner };