@rehagro/ui 1.0.46 → 1.0.48

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
@@ -275,6 +275,13 @@ type TextInputProps = Omit<React__default.InputHTMLAttributes<HTMLInputElement>,
275
275
  * colors — those still come from `statusClasses`.
276
276
  */
277
277
  borderColor?: string;
278
+ /**
279
+ * Custom background color for the input container. Accepts any valid
280
+ * CSS color value (hex, rgb, CSS variable, etc). When provided,
281
+ * overrides the default `rh-bg-surface` background. Ignored when
282
+ * `disabled` is true to preserve the disabled visual style.
283
+ */
284
+ backgroundColor?: string;
278
285
  /**
279
286
  * Border width token for the input container.
280
287
  *
@@ -316,6 +323,13 @@ declare const TextInput: React__default.ForwardRefExoticComponent<Omit<React__de
316
323
  * colors — those still come from `statusClasses`.
317
324
  */
318
325
  borderColor?: string;
326
+ /**
327
+ * Custom background color for the input container. Accepts any valid
328
+ * CSS color value (hex, rgb, CSS variable, etc). When provided,
329
+ * overrides the default `rh-bg-surface` background. Ignored when
330
+ * `disabled` is true to preserve the disabled visual style.
331
+ */
332
+ backgroundColor?: string;
319
333
  /**
320
334
  * Border width token for the input container.
321
335
  *
@@ -462,6 +476,8 @@ type SelectBaseProps = {
462
476
  className?: string;
463
477
  /** Custom class for the outermost wrapper */
464
478
  wrapperClassName?: string;
479
+ /** Custom background color for the trigger button */
480
+ backgroundColor?: string;
465
481
  };
466
482
  type SelectSingleProps = SelectBaseProps & {
467
483
  /** Enables multi-select mode */
@@ -733,8 +749,18 @@ declare const Spinner: React__default.ForwardRefExoticComponent<React__default.H
733
749
  label?: string;
734
750
  } & React__default.RefAttributes<HTMLDivElement>>;
735
751
 
752
+ type CustomSelectOption = {
753
+ value: string;
754
+ label: string;
755
+ backgroundColor?: string;
756
+ };
757
+
736
758
  type TableSize = "sm" | "md" | "lg";
737
759
  type TableVariant = "default" | "striped";
760
+ type ColumnActionIcon<T> = {
761
+ icon: React__default.ReactNode;
762
+ onClick: (row: T, index: number) => void;
763
+ };
738
764
  type TableColumn<T> = {
739
765
  /** Unique key for this column */
740
766
  key: string;
@@ -744,16 +770,41 @@ type TableColumn<T> = {
744
770
  render: (row: T, index: number) => React__default.ReactNode;
745
771
  /** Column width (CSS value) */
746
772
  width?: string;
773
+ /** Maximum column width (CSS value) */
774
+ maxWidth?: string;
747
775
  /** Text alignment */
748
776
  align?: "left" | "center" | "right";
749
777
  /** Whether this column is sortable */
750
778
  sortable?: boolean;
779
+ /** Action icon to show in this column (clickable) */
780
+ actionIcon?: ColumnActionIcon<T>;
781
+ /** Whether this column is editable with a dropdown */
782
+ editable?: boolean;
783
+ /** Type of editable field: "select" (default) or "date" */
784
+ type?: "select" | "date";
785
+ /** List of choices for the editable dropdown (required for type="select") */
786
+ choices?: CustomSelectOption[];
787
+ /** Function to get the current value for the editable field */
788
+ editableValue?: (row: T) => string;
789
+ /** Callback when the editable value changes */
790
+ onEditChange?: (row: T, index: number, value: string) => void;
751
791
  };
752
792
  type SortDirection = "asc" | "desc" | null;
753
793
  type TableSort = {
754
794
  key: string;
755
795
  direction: SortDirection;
756
796
  };
797
+ type HeaderTextStyle = {
798
+ color?: string;
799
+ fontFamily?: string;
800
+ fontSize?: string;
801
+ fontWeight?: string | number;
802
+ };
803
+ type HeaderStyle = {
804
+ backgroundColor?: string;
805
+ height?: string;
806
+ border?: string;
807
+ };
757
808
  type TableProps<T> = Omit<React__default.HTMLAttributes<HTMLTableElement>, "children"> & {
758
809
  /** Column definitions */
759
810
  columns: TableColumn<T>[];
@@ -778,9 +829,27 @@ type TableProps<T> = Omit<React__default.HTMLAttributes<HTMLTableElement>, "chil
778
829
  /** Whether the table has sticky header */
779
830
  stickyHeader?: boolean;
780
831
  /** Custom header row style */
781
- headerStyle?: React__default.CSSProperties;
832
+ headerStyle?: HeaderStyle;
833
+ /** Custom body row style */
834
+ bodyBackground?: string;
835
+ /** Custom body text style (color, font, weight) */
836
+ bodyTextStyle?: HeaderTextStyle;
782
837
  /** Custom header text class (overrides default rh-text-text-muted) */
783
838
  headerTextClassName?: string;
839
+ /** Custom header text style (color, font, weight) */
840
+ headerTextStyle?: HeaderTextStyle;
841
+ /** Custom row padding (CSS value for all sides or object with x/y) */
842
+ rowPadding?: string | {
843
+ x?: string;
844
+ y?: string;
845
+ };
846
+ /** Add row button */
847
+ addRowButton?: {
848
+ icon?: React__default.ReactNode;
849
+ text?: React__default.ReactNode;
850
+ };
851
+ /** Callback when add row is clicked */
852
+ onAddRow?: () => void;
784
853
  };
785
854
  declare const Table: <T>(props: TableProps<T> & {
786
855
  ref?: React__default.ForwardedRef<HTMLTableElement>;
package/dist/index.d.ts CHANGED
@@ -275,6 +275,13 @@ type TextInputProps = Omit<React__default.InputHTMLAttributes<HTMLInputElement>,
275
275
  * colors — those still come from `statusClasses`.
276
276
  */
277
277
  borderColor?: string;
278
+ /**
279
+ * Custom background color for the input container. Accepts any valid
280
+ * CSS color value (hex, rgb, CSS variable, etc). When provided,
281
+ * overrides the default `rh-bg-surface` background. Ignored when
282
+ * `disabled` is true to preserve the disabled visual style.
283
+ */
284
+ backgroundColor?: string;
278
285
  /**
279
286
  * Border width token for the input container.
280
287
  *
@@ -316,6 +323,13 @@ declare const TextInput: React__default.ForwardRefExoticComponent<Omit<React__de
316
323
  * colors — those still come from `statusClasses`.
317
324
  */
318
325
  borderColor?: string;
326
+ /**
327
+ * Custom background color for the input container. Accepts any valid
328
+ * CSS color value (hex, rgb, CSS variable, etc). When provided,
329
+ * overrides the default `rh-bg-surface` background. Ignored when
330
+ * `disabled` is true to preserve the disabled visual style.
331
+ */
332
+ backgroundColor?: string;
319
333
  /**
320
334
  * Border width token for the input container.
321
335
  *
@@ -462,6 +476,8 @@ type SelectBaseProps = {
462
476
  className?: string;
463
477
  /** Custom class for the outermost wrapper */
464
478
  wrapperClassName?: string;
479
+ /** Custom background color for the trigger button */
480
+ backgroundColor?: string;
465
481
  };
466
482
  type SelectSingleProps = SelectBaseProps & {
467
483
  /** Enables multi-select mode */
@@ -733,8 +749,18 @@ declare const Spinner: React__default.ForwardRefExoticComponent<React__default.H
733
749
  label?: string;
734
750
  } & React__default.RefAttributes<HTMLDivElement>>;
735
751
 
752
+ type CustomSelectOption = {
753
+ value: string;
754
+ label: string;
755
+ backgroundColor?: string;
756
+ };
757
+
736
758
  type TableSize = "sm" | "md" | "lg";
737
759
  type TableVariant = "default" | "striped";
760
+ type ColumnActionIcon<T> = {
761
+ icon: React__default.ReactNode;
762
+ onClick: (row: T, index: number) => void;
763
+ };
738
764
  type TableColumn<T> = {
739
765
  /** Unique key for this column */
740
766
  key: string;
@@ -744,16 +770,41 @@ type TableColumn<T> = {
744
770
  render: (row: T, index: number) => React__default.ReactNode;
745
771
  /** Column width (CSS value) */
746
772
  width?: string;
773
+ /** Maximum column width (CSS value) */
774
+ maxWidth?: string;
747
775
  /** Text alignment */
748
776
  align?: "left" | "center" | "right";
749
777
  /** Whether this column is sortable */
750
778
  sortable?: boolean;
779
+ /** Action icon to show in this column (clickable) */
780
+ actionIcon?: ColumnActionIcon<T>;
781
+ /** Whether this column is editable with a dropdown */
782
+ editable?: boolean;
783
+ /** Type of editable field: "select" (default) or "date" */
784
+ type?: "select" | "date";
785
+ /** List of choices for the editable dropdown (required for type="select") */
786
+ choices?: CustomSelectOption[];
787
+ /** Function to get the current value for the editable field */
788
+ editableValue?: (row: T) => string;
789
+ /** Callback when the editable value changes */
790
+ onEditChange?: (row: T, index: number, value: string) => void;
751
791
  };
752
792
  type SortDirection = "asc" | "desc" | null;
753
793
  type TableSort = {
754
794
  key: string;
755
795
  direction: SortDirection;
756
796
  };
797
+ type HeaderTextStyle = {
798
+ color?: string;
799
+ fontFamily?: string;
800
+ fontSize?: string;
801
+ fontWeight?: string | number;
802
+ };
803
+ type HeaderStyle = {
804
+ backgroundColor?: string;
805
+ height?: string;
806
+ border?: string;
807
+ };
757
808
  type TableProps<T> = Omit<React__default.HTMLAttributes<HTMLTableElement>, "children"> & {
758
809
  /** Column definitions */
759
810
  columns: TableColumn<T>[];
@@ -778,9 +829,27 @@ type TableProps<T> = Omit<React__default.HTMLAttributes<HTMLTableElement>, "chil
778
829
  /** Whether the table has sticky header */
779
830
  stickyHeader?: boolean;
780
831
  /** Custom header row style */
781
- headerStyle?: React__default.CSSProperties;
832
+ headerStyle?: HeaderStyle;
833
+ /** Custom body row style */
834
+ bodyBackground?: string;
835
+ /** Custom body text style (color, font, weight) */
836
+ bodyTextStyle?: HeaderTextStyle;
782
837
  /** Custom header text class (overrides default rh-text-text-muted) */
783
838
  headerTextClassName?: string;
839
+ /** Custom header text style (color, font, weight) */
840
+ headerTextStyle?: HeaderTextStyle;
841
+ /** Custom row padding (CSS value for all sides or object with x/y) */
842
+ rowPadding?: string | {
843
+ x?: string;
844
+ y?: string;
845
+ };
846
+ /** Add row button */
847
+ addRowButton?: {
848
+ icon?: React__default.ReactNode;
849
+ text?: React__default.ReactNode;
850
+ };
851
+ /** Callback when add row is clicked */
852
+ onAddRow?: () => void;
784
853
  };
785
854
  declare const Table: <T>(props: TableProps<T> & {
786
855
  ref?: React__default.ForwardedRef<HTMLTableElement>;